Commit Graph

191 Commits

Author SHA1 Message Date
Eike Ziller
d67ab36c6f Plugin install: Check if archive contains a usable plugin
Checks if there is a library file which is a Qt Creator plugin
that is compatible with the version of Qt Creator that is running.

Change-Id: Ic5284e3803c45b8e2ef0d30afccb1680fabf43f3
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-07-02 06:59:47 +00:00
hjk
8efe0df9dc ExtensionSystem: Port PluginManager to QRegularExpression
Task-number: QTCREATORBUG-24098
Change-Id: Idd52e7fe37c8ea8937af7123755b324dd326bb16
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-06-16 08:28:26 +00:00
Eike Ziller
f1fddfd408 Fix "Header" documentation in ExtensionSystem and Aggregation
Change-Id: Ia6c05bdc1fe810c6afcc337320ed0512fff098c0
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2020-06-15 08:25:03 +00:00
Eike Ziller
6f1ad0b0cb Fix extensionsystem API documentation for new qdoc
Change-Id: I2303e46a3e5840a3c23c84a9126237eeb2eb21d9
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2020-02-20 12:01:54 +00:00
hjk
89e2327f23 ExtensionSystem: Replace a deprecated endl
Change-Id: Ib6b297b0176518d3bc2db1e45476cc9e8c00b2e0
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-02-19 08:34:31 +00:00
hjk
d3d294cd81 ExtensionSystem: Some modernization
Mostly 'foreach'.

Change-Id: I5390d03bb5cc37c3674b61cea6f5d22bae554ed2
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-02-14 09:50:07 +00:00
Eike Ziller
eadfe1a421 Merge remote-tracking branch 'origin/4.11'
Change-Id: Iaa3142a7109bc23c2e6ff96d061a58a9c0e31a54
2020-02-07 16:20:03 +01:00
Leena Miettinen
62a2b1718d Doc: Fix QDoc warnings in ExtensionSystem class docs
Task-number: QTCREATORBUG-23544
Change-Id: I6500fefdaa919f807fa4bf4372426b19a6e57aa2
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-02-07 15:12:41 +00:00
Orgad Shaneh
0737291d54 Merge remote-tracking branch 'origin/4.11'
Change-Id: I65ce6aa917219a8f8b91b48c7077f8097248375c
2020-02-06 12:50:22 +02:00
Leena Miettinen
055bfb9339 Doc: Fix PluginManager docs
- Mark internal functions \internal.
- Remove docs for signals that QDoc seems to consider internal.
- Remove obsolete information.
- Edit for language and style.

Task-number: QTCREATORBUG-23544
Change-Id: I8c7b48e6c338acd3d529b81203b4beb64ab4fe24
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-02-06 09:23:22 +00:00
Eike Ziller
c9a4176b2f Plugin manager: Robustify writing/reading of lock-file
On some platforms the settings path might not exist at the time that we
want to write the lock file, so make sure the directory is created.

Amends 392b063fe8

Change-Id: Ic72ee59120cd1bb9ec3175d5032c94a936530300
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-01-21 13:16:39 +00:00
Eike Ziller
392b063fe8 Guard against crashing plugins
If a plugin crashes, ask the user if that plugin should be disabled.
For this track which plugin currently is changing its state. Remove that
information if the state change was successful.
At startup check if there is a plugin for which we wrote, but not
removed that information.

This is especially interesting if the user installed 3rdparty plugins.

Change-Id: I5729aa5c786b653d5bd53304f4fbeaca35ec9e71
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-01-20 10:39:28 +00:00
Eike Ziller
be19b00289 Provide "Restart Now" functionality
And use it for the plugin dialog and when changing the UI language.

Change-Id: Ic767837d2526409f7ec46d7e4612a1499f19459e
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-01-07 12:46:59 +00:00
hjk
e3b1106afa Compile fix with recent Qt dev
The reasoning in 1b4766e26c did not take into account that the scope
of QT_NO_JAVA_STYLE_ITERATORS may change over time, as done with
f70905448f6 in Qt base.

Change-Id: Ib1966ff26c4d36d5f62e149d6b45baa4aecf825d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-07-29 08:54:18 +00:00
Christian Kandeler
928550ed79 PluginManager: Provide helpful output if unit tests cannot be run
We can show the errors directly, rather than asking the user to re-run
Creator with different arguments.

Change-Id: If8196ba3a496406f5539a91e678d26a9a4801b85
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-07-26 10:14:11 +00:00
Eike Ziller
8e376ab340 Merge remote-tracking branch 'origin/4.10'
Conflicts:
	src/plugins/baremetal/iarewtoolchain.cpp

Change-Id: I483e81d7e920e724fb7cde84a8f6fa9bce4cd518
2019-07-25 09:38:09 +02:00
hjk
8b72e92167 Utils: Add CommandLine convenience constructors
... taking a QString for the executable.

This weakens the very explicit QString -> FileName conversion via the
named constructors for the special case of constructing a CommandLine.

I think that's worthwhile here, as it reduces the noise on the caller
site under circumstance where the nature of the thing is obvious.

Change-Id: I27b4a73639728893d053b2e7ba65cb745f0ffe83
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-07-23 15:51:45 +00:00
hjk
eb67ab31e7 ExtensionSystem: Remove one deprecated use of QTime
Change-Id: I6bb4657127fdc1d79631059d26a1e35672af87e4
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-07-23 09:04:39 +00:00
hjk
ca4ba34229 Use Utils::FilePath in SynchronousProcess
Adapt callers and surrounding code.

Change-Id: Ie6c1883a44169cf9d790d06b660f46d24dc24c89
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-06-11 08:11:07 +00:00
Eike Ziller
e0b0a08e50 ExtensionSystem: Move away from QList
Qt 6 API will move away from it.
Use QVector for API and some std container for internal things.

Change-Id: Iff14d48a47d5ac52ade875d9c8c84ad8a4f577d8
Reviewed-by: hjk <hjk@qt.io>
2019-05-27 14:21:00 +00:00
Orgad Shaneh
bdc2b4b59f Remove hard-coded disabling of debug logs
Instead, set the default level of all logs to QtWarningMsg.

The call to setFilterRules overrides the user preferences in qtlogging.ini.

Change-Id: Id5f6cd550d14ff7f45ae04c5d3110e0bafb0f072
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-10-13 16:36:58 +00:00
Eike Ziller
e2e9707510 Fix plugin loading profiling report
We print a report both before and after a plugin's initialization method
is called, but only the time spent till after the method call should be
counted.
This makes a different for the delayedInitialize cycle: Before
delayedInitialize is called of a plugin, there can be a delay after the
previous one. But this delay should not be counted as part of the
initialization time of the plugin.

Change-Id: I4e5fb53cd83cb36a45a599cfc3f1f8539f6327f9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-10-01 08:13:57 +00:00
Orgad Shaneh
9a72f26fa4 PluginManager: Replace getPlatformName with QSysInfo::prettyProductName
QSysInfo::*Version is deprecated, and prettyProductName should
provide better results anyway.

Change-Id: I5de3369e583d8d51b894e74509363cd6be150010
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-09-25 08:31:58 +00:00
Alessandro Portale
e21b146776 Extensionsystem: Modernize
modernize-use-auto
modernize-use-nullptr
modernize-use-override
modernize-use-equals-default

Change-Id: I20b4508e98ad3f8d6cd0ca2339bfc4c7dcb2ef2c
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-08-08 10:16:07 +00:00
hjk
99bcc00199 ExtensionSystem: Remove PluginManager::getObjectByClassName
Not used anymore inside Qt Creator.

If 3rd party code really relies on this function, it can use the
function locally, or, likely switch to the still supported
getObjectByName or getObject.

Change-Id: I041877b3e0630e6b257055dec5e10baf68c83546
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-04-11 06:47:18 +00:00
hjk
72585ef3f1 ExtensionSystem: Remove type based getObjects()
Since commit cc88302309, access to the
typed lists is cheaper via the local pools, and subsequently all users
of getObjects() have been adapted.

As getObjects() is unused now, and the local pool pattern is preferred,
having the function around is not needed anymore. If the provided
functionality would ever be needed, user code can use allObjects() and
manually filter.

Change-Id: I1e9d8fa11da2ed0e68090cce1a25a3dd62c1aef6
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-03-02 12:36:10 +00:00
Eike Ziller
125604c80c ExtensionSystem: Work around linguist issue
lupdate has issues with resolving non-trivial uses of "using namespace"
(QTBUG-64007)

Change-Id: I1edbd74ecc97476b961fd3c741f1a3d3f22a2bf7
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-10-24 14:36:16 +00:00
Eike Ziller
30f0b6857a ExtensionSystem: Avoid using iterators from temporaries
Doing it can lead to unexpected results

Change-Id: I602cf6a4692c9e0c0adb4564679478ea25bf8829
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-10-19 15:58:02 +00:00
Tobias Hunger
83210400b1 Benchmarks: Provide infrastructure for benchmarks
... and use it for the profiling report.

Instantiate a Utils::Benchmarker(...) to report a data point (which
will be created at destruction time, reporting the live-time of the
object).

Alternatively you can use Utils::Benchmarker::report(...) to record
your data point.

Independent of how you create a datapoint, it will be reported through
the qtc.benchmark logging category and can get pushed to a database
from a script parsing creator's output.

Note: The plugin-loading uses the existing -profiling infrastructure,
so you need to start Creator with -profile to see data points.

Change-Id: I18e6b84137d0f49ee5e12e7c3d75323005ce5a29
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-09-25 11:33:29 +00:00
Robert Loehning
816fdb579b ExtensionSystem: Add missing spaces
Change-Id: I9fc5df6c33bf802e1e4f85f394db40e64f3e1b55
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-09-14 09:42:57 +00:00
Eike Ziller
240aff88ab Fix that plugins were wrongly indirectly enabled when testing
Since the disabling of all plugins except tested onces was implemented
as an afterthought, it did not update the indirectly enabled plugins.
Instead, update the list of enabled/disabled plugins in the
optionsparser like for the -(no)load options, and trigger the update of
indirectly enabled plugins afterwards. Also take test dependencies into
account when indirectly enabling plugins directly.

Change-Id: I59d6c05de69a3073576155f7bd6201f1cd44697c
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-08-21 09:17:27 +00:00
Montel Laurent
f18ae4ff6f Don't use return keyword when not necessary
Change-Id: I4b9fad1eee60e942ddbccda53a4af27e978df498
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-04-14 11:02:14 +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
hjk
56409f5afa Replace a few occurrences of QStringList() << ...
... by something shorter.

Change-Id: I363b4e509adb07997517b2d233246a333aea4aea
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-02-08 11:21:45 +00:00
hjk
0b36c75ee0 MimeDatabase: Add some startup phase tracking
... to warn about situations where Mime types are registered too
late (i.e. after Plugin::initialize() or used too early (i.e. before
Plugin::extensionsInitialized())

Change-Id: I22681e94bfdd508e954bb3457b834ec3ad1f0fee
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-01-11 10:39:36 +00:00
Alessandro Portale
40d7399755 Help: Small improvements for System Info dialog
1) Make the font non-proportional, since qtDiag's output is formatted
with spaces
2) Make the dialog a window with maximize buttons
3) Fix the formatting for unloaded plugins

Change-Id: I911871b1ffc9dceebcbb04f544cc6d580b95c54e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-09-28 09:39:29 +00:00
Orgad Shaneh
ffe52196c3 ExtensionSystem: Replace macro usage with HostOsInfo
Change-Id: I112ff6f61e3bd06a4ccfca9c6d91037e3d814e44
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-09-16 09:21:16 +00:00
Christian Stenger
01f222bfdc ExtensionSystem: Fix compile on OSX
Using Qt5.6 and Xcode 5 or Xcode 6 results in compile
issues.

Change-Id: I33af400f51991e043672712b531869c6a79d6ffd
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-09-06 06:06:44 +00:00
Eike Ziller
f38531effb Add a menu entry for copying system information
Which outputs the information from qtdiag, installed plugins,
and general Qt Creator build information.

Task-number: QTCREATORBUG-16135
Change-Id: I618b9883369bae45006bb109f8757e89b091b882
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-09-05 13:00:54 +00:00
Eike Ziller
9260a6d7f9 ExtensionSystem: Simplify PluginCollection
There is no reason why it should be more than just a list of plugin
specs. Saves a few symbols. Also simplify some related code.

Change-Id: Ibaff64735e78e1454e1aca0b49cadb9e1030ee3c
Reviewed-by: hjk <hjk@qt.io>
2016-08-22 11:17:44 +00:00
Orgad Shaneh
670e54345c Remove use of deprecated Qt algorithms
Change-Id: Ib35cffa2d5762874feea9b1d4df7f569c0e5f496
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-08-09 13:41:25 +00:00
Christian Stenger
89ede98904 Tests: Only disable crashhandler on UNIX
On Windows disabling the crashhandler results in re-enabling the
Windows internal error reporting which causes trouble as well, so
limit disabling of crashhandler to Linux/OSX.

This patch more or less amends 80352d703c.

Change-Id: I0588cd22c2ff894e07378524baf03794963c92a1
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2016-08-01 08:36:31 +00:00
Christian Stenger
80352d703c Tests: Disable QTest crashhandler for plugin unit tests
Temporary workaround to avoid dead lock when executing
plugin unit test.

Change-Id: Ie6c3673d756ff3b67320bcc75d590933e58a5276
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2016-07-28 13:30:01 +00:00
Eike Ziller
5fcf0c438f PluginManager: Code clean up
Mostly refactor some explicit loops, and nicer reverse looping.

Change-Id: I102b86da597b37cd496762bd776af73ec407d838
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-06-24 12:30:05 +00:00
Orgad Shaneh
9370e863f8 ExtensionSystem: Use Qt5-style connects
Change-Id: I94f7dceff0cd53249406e9a4ec6b3b776bf00ab0
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-06-01 05:50:29 +00:00
Alessandro Portale
ac6e4a13ce PluginManager: add Windows 8 and 10 to getPlatformName()
Change-Id: Id2ff33784f98529c293b770f11340ae27fbe3ab7
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-05-30 09:13:42 +00: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
Tobias Hunger
3990c1c7ed Add "-notest" option that prevents a plugin from being tested
This is similar to "-noload" and prevents a plugin from being loaded
for testing. Nice to blacklist some problematic plugins.

Change-Id: Ib273d244333a9d275969c9608e556a11b7518386
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2016-02-11 14:41:02 +00:00
Friedemann Kleint
e6a572e07a Extension system: Extend error message for invalid test functions.
Output the list of available test functions.

Change-Id: I86578b9eeaa2f4cd5782de7ea2d90fae06e22542
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-02-08 09:31:49 +00:00
Tobias Hunger
f72370f20a Update License according to agreement with Free Qt Foundation
* Update remaining files in src

Change-Id: I1896f17fcf34f71c3310c87899fb5171b8e4afb1
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-01-19 15:59:41 +00:00