Commit Graph

185 Commits

Author SHA1 Message Date
Eike Ziller
e46357a220 Adapt to move of options to Edit > Preferences
Change-Id: I6881f658db9eec5059b434bce12093667535d5ac
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2022-06-28 08:32:22 +00:00
hjk
530b9ae85a ProjectExplorer: Copy more RunConfiguration data to RunControl
The aspects are now responsible for defining what data needs
to be copied and also to provide a suitable interface (kind
of source-compatible to direct use) for access.

The important change here is that RunControl::aspect(...) doesn't
need to access RunControl::runConfiguration() in fully aspectified
RunConfigurations anymore. In not-fully aspectified the runConfig
access is moved to the user code to make the problem visible there.
Long term, aspectification should be finished.

As an additional benefit, the resolving of macros etc can
now be done at the correct time.

Change-Id: I690d9f8f696ce9b4efd42082ba3f81b514efcb77
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-04-12 08:43:09 +00:00
Eike Ziller
f562ebf239 Mimetypes: Make implementation switchable between new and old
- configure with QTC_USE_NEW_MIMEDATABASE to switch to the new one in
  utils/mimetypes2/
- added utils/mimeutils.h header for the Qt Creator specific static
  wrappers, that also includes the "public" headers for MimeType et al
  from the new or old implementation, depending on configuration
- change all utils/mimetypes/ includes to utils/mimeutils.h
- move the implementation for the wrappers to
  utils/mimetypes(2)/mimeutils.cpp
- also move the MimeDatabase declaration in the "old" implementation
  back to utils/mimetypes/mimedatabase.h

Change-Id: Ie8de229c035d6cd9a5e4739dc0fa78d9c17228e3
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-02-25 07:19:58 +00:00
Christian Kandeler
59fb0e9c9c Core: Properly handle file path arguments with -client option
These paths come from the user, so the separators must be translated.

Fixes: QTCREATORBUG-27075
Change-Id: Ia20c2662d30626b8b7ed3dd19afb64a43c8a716f
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-02-18 10:33:53 +00:00
Eike Ziller
3749cfc896 InfoBar: Make adding more buttons possible
Change-Id: Ic0c946cf3f87fe46cd06391f38e0bc71374ad340
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-01-18 09:33:20 +00:00
Eike Ziller
b5fd63b431 Merge remote-tracking branch 'origin/6.0'
Change-Id: I9b824b8bb7b0b5d76e9e8f28f909b542adf773f0
2021-10-27 12:05:08 +02:00
Eike Ziller
dc5717bd06 Move File System view to Core plugin
So it can be accessed from a wider range of places.

Change-Id: I282883addecf7bb070a65d9f4f7b8e6e2e4b5e47
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-10-27 09:02:23 +00:00
Eike Ziller
d977db303d macOS: Force light appearance before saving system palette
When using a light theme while macOS is in dark mode, we need to first
force the application appearance to be light, before saving the system
palette. Otherwise the system palette will contain colors from the dark
system appearance.

Fixes: QTCREATORBUG-21520
Fixes: QTCREATORBUG-26427
Fixes: QTCREATORBUG-26428
Change-Id: Icf802093de17715d16db5c5735b133f2fc465436
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-10-26 13:02:46 +00:00
hjk
1167f0fac7 Core: FilePath-ify DocumentManager
And adjust users.

Change-Id: I10ca9aeb442a07f7c8d42af362b294aa3398f5c1
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-09-22 09:10:29 +00:00
Jarek Kobus
ace765c199 Move ProcessReaper into lib/utils
Reuse ProcessReaper inside process launcher.
Automatically reap all internal QProcesses of QtcProcess
(either direct child of QtcProcess in QProcessImpl
or indirectly inside process launcher).
Make ProcessReaper work again on QProcess instead of on
QtcProcess, so it may still be reused for non-QtcProcesses.

Change-Id: I950cac5cec28f17ae97fe474d6a4e48c01d6aaa2
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2021-09-06 21:28:19 +00:00
Alessandro Portale
eb5788f00a Core: fix build (with MSVC)
coreplugin.cpp:407: error: C2664: 'QString
QString::arg(qlonglong,int,int,QChar) const': cannot convert argument 1
from 'const char [11]' to 'qlonglong'
note: There is no context in which this conversion is possible
qstring.h(444): note: see declaration of 'QString::arg'

Change-Id: I2c4122c4bf0f6b35f6f7b45b2c2d014ac7863065
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-31 05:41:13 +00:00
Artem Sokolovskii
5805208cec CorePlugin: Use FilePath istead of QString
Task-number: QTCREATORBUG-2616
Change-Id: Iaa5bc7946a7bddfd8adffe51906d90b2e76f5837
Reviewed-by: hjk <hjk@qt.io>
2021-08-30 10:39:41 +00:00
hjk
ba745a45aa Utils: Use FilePath in FileUtils::showInGraphicalShell
Change-Id: I393f33a6a31fc6cee3c0a4b16c474247673af312
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-08-19 03:02:10 +00:00
Eike Ziller
c7168d1063 Merge remote-tracking branch 'origin/5.0'
Conflicts:
	src/plugins/coreplugin/locator/executefilter.cpp

Change-Id: Iff5b82a9e491b782e4720138904f389d318b005c
2021-08-11 10:10:51 +02:00
Orgad Shaneh
26be258bf9 Core: Fix crash on shutdown
ProcessReapers waits for all the processes to terminate, and in the mean
time, it processes events. This is done after Core has already been
terminated, but QObject dtor has not been called yet, so not all signal
connections are disconnected.

Crash trace:
1  QWidget::actions                                            Qt5Widgets               0x7ff93a662fe9
2  Core::Internal::MenuActionContainer::updateInternal         actioncontainer.cpp 482  0x7ff93158be03
3  Core::Internal::ActionContainerPrivate::update              actioncontainer.cpp 417  0x7ff93158bd72
4  QMetaCallEvent::placeMetaCall                               Qt5Core                  0x7ff939b9ac34
5  QObject::event                                              Qt5Core                  0x7ff939b995c1
6  QApplicationPrivate::notify_helper                          Qt5Widgets               0x7ff93a644990
7  QApplication::notify                                        Qt5Widgets               0x7ff93a643a13
8  QCoreApplication::notifyInternal2                           Qt5Core                  0x7ff939b72aca
9  QCoreApplicationPrivate::sendPostedEvents                   Qt5Core                  0x7ff939b74845
10 qt_plugin_query_metadata                                    qwindows                 0x7ff960422dff
11 QEventDispatcherWin32::processEvents                        Qt5Core                  0x7ff939bbba5a
12 qt_plugin_query_metadata                                    qwindows                 0x7ff960422dd9
13 Core::Internal::ProcessReapers::~ProcessReapers             reaper.cpp          134  0x7ff9317b54ee
14 Core::Internal::CorePlugin::~CorePlugin                     coreplugin.cpp      114  0x7ff9315a705c
15 Core::Internal::CorePlugin::`scalar deleting destructor'    Core                     0x7ff9315a8584
16 ExtensionSystem::Internal::PluginSpecPrivate::kill          pluginspec.cpp      1125 0x7ff95299a160
17 ExtensionSystem::Internal::PluginManagerPrivate::loadPlugin pluginmanager.cpp   1608 0x7ff95298e2ad
18 ExtensionSystem::Internal::PluginManagerPrivate::deleteAll  pluginmanager.cpp   1061 0x7ff9529885f5
19 ExtensionSystem::Internal::PluginManagerPrivate::shutdown   pluginmanager.cpp   1397 0x7ff95299463f
20 QObject::qt_static_metacall                                 Qt5Core                  0x7ff939b91d49
21 QCoreApplicationPrivate::execCleanup                        Qt5Core                  0x7ff939b71b25
22 QCoreApplication::exec                                      Qt5Core                  0x7ff939b71aaf
23 main                                                        main.cpp            762  0x7ff734b31bf7
24 WinMain                                                     qtcreator                0x7ff734b38407
25 __scrt_common_main_seh                                      exe_common.inl      288  0x7ff734b3716a
26 BaseThreadInitThunk                                         KERNEL32                 0x7ff9a8806fd4
27 RtlUserThreadStart                                          ntdll                    0x7ff9a8adcec1

Change-Id: I7cf32f57354ee9e2507a2883078f0818fc5d6116
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-08-09 08:34:50 +00:00
hjk
4a42bcd4e8 Utils/ProjectExplorer: Use FilePath for Runnable::workingDirectory
... and in some using code.

Change-Id: I231ea56628908f7d305d13f07eabe8803fe8a791
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-06 12:51:24 +00:00
hjk
906cfb060b Core: Use FilePath in some functions related to opening files
Change-Id: I9610855a914d315d7934996c755fb69ad399320f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-29 11:14:46 +00:00
Eike Ziller
f18ac508e8 Move CommandLine out of fileutils.h
to ProcessArgs and rename the files to commandline.*.
fileutils was a strange place for CommandLine, and this
reduces the dependencies needed for sdktool.

Change-Id: I9d7e8ffe8a3560f5d12934457b086f9446976883
Reviewed-by: hjk <hjk@qt.io>
2021-05-11 13:27:23 +00:00
Eike Ziller
c1f90aeca2 ICore: Change some path API to use FilePath
Change-Id: Id841d6177206a021c9e606ce560b47d1ae6e52b9
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2021-04-26 08:03:47 +00:00
Leena Miettinen
8e5e5cc01a Core: Fix typos in and capitalization of UI text
Change-Id: I830539c7b8f3004b5143a02e3c1e8cea69fa1c81
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-03-18 10:24:37 +00:00
Eike Ziller
7c0c98a438 Locator: Do not block main event loop
There are multiple locator filters (SpotlightLocatorFilter,
JavaScriptFilter, HelpIndexFilter, the LanguageClient filters) that
depend on the main event loop, and might lock up if that does not run
anymore.

So we cannot use waitForFinished. Cancel a running locator search, and
tell the plugin manager that we need to wait for asynchronous events to
finish before shutting down.

Amends cb5977fbad

Change-Id: Id0b3dc75bc22f21b34be39c3bdbec915b60bdee6
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2021-02-11 07:49:25 +00:00
Jarek Kobus
cb5977fbad Stop executing locator's threads when about to shutdown occurred
Mark that about to shutdown has occurred and don't start
any new thread after that.

Fixes: QTCREATORBUG-25318
Change-Id: I14d47c93dd8e8a82f6f68264a03d5831ec95da75
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-02-09 15:29:47 +00:00
Mahmoud Badri
cc7be5724a Add Crashpad to Qt Creator and Qt Design Studio
Fixes: QDS-2748
Change-Id: I87e25682f066d167eebfd7b78c46c166e5062e11
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2021-01-18 22:08:14 +00:00
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