Commit Graph

347 Commits

Author SHA1 Message Date
Tim Jenssen
a78e3e5dd5 use initializer lists
Change-Id: I82b04601f1db52197b3dc625b6b7e0f143c1c8b6
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2019-01-21 15:10:54 +00:00
Bernhard Beschow
88839a8cfa Const'ify two static variables
Even though the variables are local, they were exposed as writable
references. Turning those variables into constants and propagating the
constness prevents accidental modifications.

Change-Id: If874ae4995fb95434ad28da6682c980f90666061
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-12-19 13:24:33 +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
Christian Stenger
31ed8137d6 ExtensionSystem: Remove icon from categories
It provides no real additional value and seems to
be more confusing when Qt Creator gets started with
command line options that load disabled or disable
enabled plugins.

Change-Id: I979f9ee95154af11aedd6100717043adc5e1e7a9
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-10-12 05:34:05 +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
a48b771a3e ExtensionSystem: Relax platform regexp matching
Match anywhere, not only exact matches.

Change-Id: I3f530e9ee796250252108f835f7435c57f8d516b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-09-25 08:32:18 +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
Ivan Donchevskii
d5ffac83e7 ExtensionSystem: Forward setEnabledBySettings to PluginSpec
Private part of PluginSpec is not accessible from plugins.

Change-Id: Id5b8099777b58895b37b5a57c65ecc11a5228143
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-05-14 12:50:46 +00:00
Tobias Hunger
d96d786c34 ExtensionSystem: Consistently use nullptr
Fixed by clang-tidy modernize-use-nullptr.

Change-Id: Ibf3797854e8f15940d363695ce30cc4558ed1ab8
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-05-08 07:43:52 +00:00
Tobias Hunger
3890f5d67d ExtensionSystem/Aggregation: Use override consistently
clang-tidy fixes from modernize-use-override check.

Change-Id: Ic10099c2a2f3a070c972442736e50e797a063597
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-05-07 15:44:10 +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
Eike Ziller
124e4499eb Merge remote-tracking branch 'origin/4.6'
Change-Id: I421af2d62994436782dab6d37e97622bd055ed44
2018-03-05 09:28:34 +01:00
Eike Ziller
994a68280e Merge remote-tracking branch 'origin/4.5' into 4.6
Change-Id: Iaf254ce5bc895c703aa6772b4aaa139e531696f6
2018-03-02 15:55:29 +01: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
8673aae986 Allow plugins to specify a "revision" to show in addition to the version
To be used for the version control revision the plugin was built from.
Invent a QTC_PLUGIN_REVISION replacement string for the plugin .json.in
which can be set by the build process.

Task-number: QTCREATORBUG-19951
Change-Id: Id5fd64b5506383e0b7749bcfd34d178baf8fe7af
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2018-03-02 12:33:32 +00:00
hjk
31a55b0247 ExtensionSystem: Remove per-plugin object pools
Remove now-unused IPlugin::addAutoReleasedObject and IPlugin::
{add,remove}Object convenience functions that were only forwarding
to the global pool.

Adjust all related tests.

All previous users of these convenience functions are gone, and we do
not want to encourage the use of object pool anymore.

Plugins that wish to share objects to implement weak dependencies
can use the global object pool via  ExtensionSystem::PluginManager::
{add,remove}Object directly.

Change-Id: Ic668ad5504af76963f6d4c69ae160438efc70db5
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-02-23 08:57:49 +00:00
Nikita Baryshnikov
ccc0bebcf4 PluginView: do not allow to edit Load column
Change-Id: I23d653700ad22e3c277352dc4025351d1e58f687
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-12-26 11:55:15 +00:00
hjk
cc88302309 De-emphasize PluginManager::getObjects<Type>()
... by additionally keeping local (currently non-owning) pools per
"interesting" type.

Current situation:
  - The global object pool does not scale well for looking up
    objects, as iteration plus qobject_cast typically iterates
    over all pooled objects.
  - User code that can use typed results from the object
    pool need to have access to the full type definition anyway,
    i.e.  depend on the plugin of the target class anyway.

The patch here solves the scaling problem is to have local
type-specific pools to which objects register in their
constructors and deregister in their destructors.

This patch here does *not* change the ownership model of the
pooled objects, however, it opens the possibility to change
the ownership model per type (e.g. by not putting things into
the global pool at all anymore and make the local pool 'owning')
and the intent is to handle that in later patchs.

Even without the follow-up patches this here is a performance
improvement for the cases that access the local pools instead
the global one, i.e. "practically all".

Change-Id: Ib11a42df2c4ecf5e1155534730083a520dd1995b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-12-15 07:08:05 +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
Leena Miettinen
c7c0bbf511 Plugins: Fix capitalization of Plugin Loader Messages dialog
Change-Id: I5f3c45559f867fdc3751ff893b87279fe6fab79c
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-10-18 15:11:11 +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
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
7f68088f3b PluginView: remove stale includes
Change-Id: Ic3484d8694b54032c8ee3dbb9aa45b97e19c9b6c
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-08-31 08:31:16 +00:00
Eike Ziller
7ef365d756 Do not disable "required" plugins when testing
"Required" is only the Core plugin, and that should never be disabled.
Fixes the weird issue that running "qtcreator -test WinRt" on
non-Windows platforms failed with "Core plugin is disabled".

Change-Id: Id349f406e4bde876ae5513c75d39b4b4c052b8ba
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-08-23 09:01:53 +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
Leena Miettinen
11893271ba Extensionsystem: Add a full stop to the end of error message
Change-Id: I8cf154434ed757861bf43de68ea9b6625cd6db4c
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-07-28 08:31:40 +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
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
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
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
Eike Ziller
284fa63be2 Support 'hidden' plugins
Plugins can be hidden in the "About Plugins" view by default. Users can
still make them all visible, but the default view can be made less noisy
by hiding plugins that only exist as a base for other plugins.
Plugins that can not run on the current platform are hidden by default
as well.

Change-Id: Iaf2f751c4ea4b3afc605bbbea6611eea042e62c7
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2017-01-09 12:25:08 +00:00
Eike Ziller
e0dd885338 PluginSpec: Use member initialization
Change-Id: Ie8720248eca88ec447461b54b27928c25dace97e
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-01-04 16:32:42 +00:00
Eike Ziller
3ef8ebd436 Explicitly mark experimental plugins as such in plugin overview
This makes the difference between "experimental" and "disabled" visible
in the UI.

Task-number: QTCREATORBUG-17368
Change-Id: I6a74d27dbad9d35f447fe5687fe26c4eee3a3808
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2017-01-03 14:21:18 +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
b17b2461dd Simplify Utils::sort calls that sort by member
Change-Id: I0937e98014f223f42fbf1c6b2bd94fb109bc8870
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-08-09 13:52:47 +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
Ulf Hermann
4ab130ed9f Utils: Rename the "error" icon to "broken"
It is only used in the pluginview, and "broken" fits in better with
"ok" and "notloaded" for plugin states. Also, we avoid confusion with
the "error" icon in coreicons.h.

Change-Id: I44159a878f60eacf46780b27b4d9c4f31601a9dc
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2016-08-05 10:17:08 +00:00
Orgad Shaneh
1853f01a5b Merge remote-tracking branch 'origin/4.1'
Change-Id: Ia442f30f387fe9292217582260bbe79e54608810
2016-08-05 11:40:07 +02: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
Orgad Shaneh
35d7352b3e Merge remote-tracking branch 'origin/4.1'
Change-Id: Ie96fa53a88bcd06fa688a579c1d84aaf6f5e905f
2016-07-29 16:13:18 +03:00