Commit Graph

162 Commits

Author SHA1 Message Date
Alessandro Portale
3e9385bf1b Core: Make member functions const/static
readability-make-member-function-const finds lots of member functions
that could be made const. This change just picks getter functions that
really should be const.

readability-convert-member-functions-to-static finds non-static member
functions which do not access this. This change turns most of them
into static ones, but leaves some non static to keep the class API
consistent.

Change-Id: I004d6f7fab4375f9902f940f29b4a4f561fc7604
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-12-11 08:28:25 +00:00
Eike Ziller
a40e5b5382 Core: Save less settings
Try to not save settings that weren't changed from their default, and
make it possible for defaults to change in the future.

Task-number: QTCREATORBUG-24762
Change-Id: If469b72573791bc92ed535edf00271ef09b55386
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-12-11 08:02:57 +00:00
Eike Ziller
e755094480 Add option for globally changing the base environment for tools
Fixes: QTCREATORBUG-22123
Change-Id: I00a5bbdf92e5dab513cb12f3518a2abb1adbb9cd
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2020-11-18 15:24:02 +00:00
Eike Ziller
1d2b5db02f Merge remote-tracking branch 'origin/4.14'
Change-Id: I2ae0eb18782224e48cd20d41907f9dfea6ee1771
2020-11-10 13:42:46 +01:00
Christian Kandeler
ad48f2639c ProjectExplorer: Consider build environment
... in "Open Terminal Here" action in the build configuration.

Change-Id: I0b1b15d4f1097cf48eb5a977f2ca5951b2f78377
Reviewed-by: hjk <hjk@qt.io>
2020-11-10 09:01:48 +00:00
Alessandro Portale
af0e135e73 Utils: Improve InfoBar border
Replace 80s 3d frame with a slim separator line.

Task-number: QTCREATORBUG-23176
Change-Id: If50d35f500323bf4b963cb2222b5f947a307a5bc
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-10-19 10:44:44 +00:00
hjk
e6d1f08642 Drop use of Qt::DefaultLocaleShortDate
Gone in Qt 6.

Task-number: QTCREATORBUG-24098
Change-Id: Ie9fe1858406133fed6987de0e0a38fe86de15caf
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-06-22 06:43:39 +00:00
Eike Ziller
7c5ed6f7d9 Move InfoBar to Utils
The only reason it was required to be in Core plugin, was its use of Id,
which now is available in Utils.

Change-Id: I66ce863c24924e6448d339b3422538a7fe167336
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-06-18 06:39:54 +00:00
hjk
68c539bb9d Utils: Replace FileChooser::path() by filePath().toString()
Keep the old method for now to ease downstream porting.

The change is kept mechanical, there's a lot of cleanup possible now
on the user code side.

Change-Id: I936baedd45b7ba057f1c789a1bec896886f48eff
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-04-09 17:45:06 +00:00
hjk
299d34d547 Remove apparently unneeded QtPlugin includes
Change-Id: I511c0318a72dbf2a92e4749dee02eabfc9826139
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-02-12 16:03:37 +00:00
hjk
6b5bf41d9f Try even harder to register Utils::CommandLine and FilePath
Amends a460fa3152.

Change-Id: Id251c6ead6ca31020a3d990028a4ceac11bdac25
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-08-15 06:13:34 +00:00
Eike Ziller
c67ed4d35b Add global notification area and use for UI Tour info
Adds a global info bar display above the main window's status bar that
can be accessed via ICore::infoBar().

Replace the blocking "Take UI Tour" dialog by a notification there.

Fixes: QTCREATORBUG-22819
Change-Id: I733f1bfd2d1db0295754ed2e28bb202f927d0edb
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2019-08-12 07:15:27 +00:00
Christian Kandeler
b7a96a9342 Core: Warn the user if the settings file cannot be read
Do an initial check and if it fails, warn the user that they cannot
expect subsequent operations to succeed.

Task-number: QTCREATORBUG-18294
Change-Id: I3bb323cf7b7ed99f97258da94cfd7669f8520717
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2019-07-17 13:59:29 +00:00
Andre Hartmann
e2f7380708 ProjectExplorer: Add "Open Terminal Here" as default entry
Most often, a terminal with system environment is needed.
Provide it as direct context menu entry, and leave the
additional entries for build and run environment (which
are probably more seldom used) as sub-menu as before,
but rename it to "Open Terminal with >".

Change-Id: I148395ca1e62eafff8844ba91db269a12b053de9
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-06-12 06:22:29 +00:00
Robert Loehning
a4d6c2d895 Core: Make variable descriptions consistent
The others aren't in imperative form, either.

Change-Id: I7af7b0ddcdf409d952223225bd901c84b9136bc6
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-10-22 16:20:20 +00:00
Tim Jenssen
3d207f96c8 Fix macOS build
std::srand was not existing maybe an issue with older SDKs.

Change-Id: Icd1af82d6e698da9f814ed0d96a839f46272c661
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-09-21 12:54:54 +00:00
Orgad Shaneh
b49175c86a Core: Avoid deprecated QDateTime::toTime_t
Change-Id: I96364e5c0bfa478483614910025169ffb7369b51
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-09-21 07:23:25 +00:00
Eike Ziller
2c17fbe8dd Make Core independent from QtHelp
We don't want various plugins to depend on the Help plugin,
but we also do not want Core to depend on QtHelp.
For example when turning the Help plugin off, documentation should
actually no longer be registered through QtHelp. So we need
parts of the interface in Core, which must then be delegated
to the actual implementation in Help.

As positive side-effects the interface in Core will be slimmer,
and the code in the Help plugin can later be simplified, too,
because then we don't have the "Core" and the "Gui" help engines
separated in different plugins anymore, which should remove the
need for some setup indirections.

Task-number: QTCREATORBUG-20381
Change-Id: I634c5811c45d6a3dfd6ddc682cae270e38384cbf
Reviewed-by: hjk <hjk@qt.io>
2018-09-04 11:21:18 +00:00
Alessandro Portale
f36f04deba Core: Modernize
modernize-use-auto
modernize-use-nullptr
modernize-use-override
modernize-use-using
modernize-use-default-member-init (partially)

Change-Id: Idf10d7ffb1d98a04edc09a25c35e4e9e3abe87b5
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-08-08 16:04:21 +00:00
Razi Alavizadeh
f009d5f151 CorePlugin: Switch split if remote command tries to open an already opened file
It seems more natural that remote commands
don't change current editor of active view if file
is already opened in another view.

Change-Id: Ie27de0d159cae6e63fa1d477fab59887a0e6d198
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-06-22 18:04:54 +00:00
Daniel Trevitz
d384e2398a Create Path
When the path listed in a PathChooser does not exist,
instead of showing actions on non-existent paths show
"Create Folder".

Task-number: QTCREATORBUG-20532
Change-Id: I98d149129ad33d7be36bfe13b2c1ab57ee193cf0
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-06-05 11:57:19 +00:00
Tobias Hunger
7ad738d236 Core: Add more HostOS related information to MacroExpander
* Add HostOS:PathListSeparator
* Add HostOS:ExecutableSuffix

Both should be useful e.g. for External Tools.

Change-Id: I2a807b189eb2ace5ac093e50ff406ebcd3e497a1
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-05-29 12:14:54 +00:00
David Schulz
63cc5491f5 Core: cancel async documentation registration on shutdown
Change-Id: I46bc81cf6326e964309996e0e205fff011f596e7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-02-21 07:58:10 +00:00
hjk
310a2bf96f Core: Simplify MainWindow::init() signature
And adapt its only user.

Change-Id: Ifc1f6c7857951d6e1a68f5bc909146e9689c5428
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-02-12 11:21:14 +00:00
hjk
e712c8b7e2 Core: Replace an in-Core connection by a direct call
Change-Id: Ic219a992658e080467a18d38121a41990cc377ce
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-02-01 13:31:04 +00:00
hjk
e783f883ea Core: Move MenuBarFilter closer to its peers
Change-Id: I9d7eac297a06fae39ef7ee19841547e8b5bea45a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-01-29 07:55:26 +00:00
hjk
53d14fbb48 Locator: Do not use object pool for some filters and LocatorManager
Also bundle lifetime management into one object.
Also minor interfact cleanup.

Change-Id: I60eec84b0b28a20ce353fcdbfdff1c4848686ba0
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-01-26 14:40:44 +00:00
hjk
8426cc4025 Core: Do not put Edit mode in object pool
After cf7f898 not needed anymore.

Change-Id: I8d88ffe00b5a94cd9423dd2b9f3f60a2a745a924
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-01-26 12:45:55 +00:00
hjk
a5935cb27a DesignMode: Create only when needed
Postpone the Mode object creation until it is really necessary,
the private data object may be needed before.

In the QmlDesigner this patch moves the connection to the DesignMode
instance back to delayedInitialize, essentially reverting part of
e8b3b8140b.

Change-Id: I07146b0bc93eede09af8e824e916edb6de1817ef
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-01-23 13:08:37 +00:00
hjk
2b76504bd2 DesignMode: Apply 'static pattern'
Also:
 - and replace some occurrences of DesignMode::instance()->id() by
   Core::Constants::MODE_DESIGN for less dependence on the lifetime
   of the DesignMode object (and less indirection)
 - remove storage if DesignMode::instance() values when direct
   use of the static functions suffice
 - remove some unused items from the interface
 - use member-initialization in DesignMode::Private.

Change-Id: Ie66c06da0fc0a3ccc588b8079e51db6b39284152
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-01-23 09:18:55 +00:00
David Schulz
92ec21e5b5 Core: add menu bar locator filter
Adding the possibility to trigger menu actions from the locator

Change-Id: I70d595c167f5b43b02f8125eafbb83e5b45012c9
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-01-15 09:57:45 +00:00
Eike Ziller
58942de965 Remove use of global state from InfoBar
It is initialized by the core plugin anyhow, so give it enough
information there to avoid accessing the global state later.

Change-Id: I39e7a9f32ef5c7930faf9ba751e75bebf57b507e
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-11-01 14:51:57 +00:00
Eike Ziller
8e62881b12 Make DocumentManager::projectsDirectory a FileName
Change-Id: I9454c2148c398939c64bfa6b1fc182670a1d5f99
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-09-19 10:13:49 +00:00
Tobias Hunger
4ef01c961e app_version.h: Make IDE name configurable
Change-Id: I993f452c8d09cf89e9a2958fc8e36b7d2c17ee6f
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-09-05 10:19:48 +00:00
Nikita Baryshnikov
8de69d7b5f Replace QLatin1String, QStringLiteral ("") with QString()
Change-Id: I21e6165e7e8858df8436c04c9afcc1be5242bda4
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2017-08-21 09:27:21 +00:00
Nikolai Kosjar
ba6939fa90 Unit tests: Fix ProjectInfoGenerator.* tests
...by adapting to recent mime type changes:

    commit e8e46ab553
    Plugins: Fix that mimetype definition was not valid JSON

Change-Id: Iac416ab481814e4488fac4d818c51c647c1ec349
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-07-27 08:44:12 +00:00
Eike Ziller
e8e46ab553 Plugins: Fix that mimetype definition was not valid JSON
JSON officially does not support multiline strings, so we should use
the same mechanism that we already use for the plugin description
(i.e. additionally support arrays of strings which are interpreted
as lines).
This just happens to work because Qt's JSON parser eats it without
choking.

Change-Id: I25ef04600b209775c5a7af916c687fda4a8b1a4d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-07-25 06:00:49 +00:00
Alessandro Portale
dff0c9df7a Core: Add the "resourcePath" to the global macro expander
Example use case: Multiple wizard json files want to reference a shared
resource file without using fragile relative paths.

Change-Id: I2502083d4c371c25a8b66e7d5d3b4fb9d8697317
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-05-24 14:23:36 +00:00
hjk
3f5caf4cdc Utils: Wrap MimeDatabase into static functions
To avoid repeating the 'MimeDatabase mdb; mdb.something(); ' mantra
all over the place.

Change-Id: I4bfef62e73275a991455141671d6071162788e9d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-03-03 07:57:54 +00:00
Eike Ziller
d64e17ad55 Move mimetype definitions to plugin specs
- Avoids the hassle of QRC files and manually registering mime types
- Avoids performance regressions because of mime types that are
  registered after mime database has been used
- Makes it technically possible to detect that a disabled plugin could
  handle a mime type if it was enabled

Change-Id: I373008b1b56e9c6b4853055f20b3eeb112a6eff9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2017-02-27 13:54:59 +00:00
Marco Bubke
ddfd29852a Utils: First step to extend search results for clang query support
We need multi line support, multi text range support. This is only adding
enablers and adds later the multi line and multi text support because this
triggers larger changes because you have to know the text document.

Change-Id: I44e46d9d80d7d73b2650c69cc83657c20c85bfae
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-11-23 10:48:59 +00:00
Orgad Shaneh
410211e090 Merge remote-tracking branch 'origin/4.2'
Change-Id: Ibb932efece05a5f5613823fbc79c5b7601c73905
2016-11-02 16:52:58 +02:00
Eike Ziller
05bf915c03 Core: Refactor argument handling
Split up getting the data from the arguments list and actually applying
the values, and move the details of theme creation and application to
better places.

This gets rid of ugly control flow details like that
CorePlugin::initialize created the action manager before calling
parseArguments, because that is needed to apply the presentation mode
argument setting, and parseArguments created the main window because
that needs to be created _after_ setting the theme (which can be
overridden by command line argument), but _before_ applying the override
color argument setting.

Change-Id: I9c99305b6efbfcc4b37cea9e5c70d816a621963b
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-11-02 11:10:18 +00:00
Tobias Hunger
b75c6444d1 Core: Add a reaper that will asynchronously clean up QProcesses
Change-Id: Ic24dde261eac775d1a5854b8dbcbfeb002d0f729
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-10-28 12:28:46 +00:00
Eike Ziller
9e66ce48e4 Merge remote-tracking branch 'origin/4.0'
Conflicts:
	src/plugins/autotest/testcodeparser.cpp
	src/tools/clangbackend/ipcsource/clangbackendclangipc-source.pri
	tests/unit/unittest/unittest.pro

Change-Id: I9db4fbea6ea7c9fdd0d8e1703735af20c92e754b
2016-05-09 16:37:41 +02:00
Eike Ziller
fad08a1e9b OS X: Fix regression for opening projects from Finder
The kits are restored in delayedInitialize now, but the file open event
from Finder was delivered before that. That lead to the projects mode
being opened with the kit configuration screen, but mostly no kits in
it, when double-clicking a .pro file while Qt Creator is not running.

Delay the remote open file command until plugin initialization is really
done.

Change-Id: I1a75f6b1f7bcefb4c53d594de11df0d3a0d2e5d3
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-05-04 09:39:13 +00:00
Oswald Buddenhagen
3c2f0096ea Merge remote-tracking branch 'origin/4.0' 2016-03-22 15:23:12 +01:00
Alessandro Portale
3e040d4c3d Core: Use a constant for the default creator theme
Change-Id: I53ba63cf55fb6918d959b0d396175a3188d62bd9
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2016-03-18 11:18:17 +00:00
hjk
bcf7a11c24 Core: Apply 'static' pattern to Core::FindPlugin
Also, rename it to Core::Find. It hasn't been a plugin for a while.

Change-Id: I845885ccf18bdc1440258d523b033758d5583881
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2016-03-15 12:43:59 +00:00
Orgad Shaneh
9d0d39495f Rename ThemeSettingsWidget -> ThemeChooser
Change-Id: Ie61dc07d9f8bc8639ff80368a0b2ad4dd62cacb3
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2016-01-21 08:04:07 +00:00