forked from qt-creator/qt-creator
Add "delayedInitialize" feature to plugin manager.
And use it for some of the plugins. It avoids the plugins to do the timing on their own, and actually adds guarantees about the order the delayed initialization is done. Change-Id: I88ad9b46b24b82c91509774170fe0e7e99e88e4b Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
This commit is contained in:
@@ -1013,6 +1013,25 @@ bool PluginSpecPrivate::initializeExtensions()
|
||||
return true;
|
||||
}
|
||||
|
||||
/*!
|
||||
\fn bool PluginSpecPrivate::delayedInitialize()
|
||||
\internal
|
||||
*/
|
||||
bool PluginSpecPrivate::delayedInitialize()
|
||||
{
|
||||
if (hasError)
|
||||
return false;
|
||||
if (state != PluginSpec::Running) {
|
||||
return false;
|
||||
}
|
||||
if (!plugin) {
|
||||
errorString = QCoreApplication::translate("PluginSpec", "Internal error: have no plugin instance to perform delayedInitialize");
|
||||
hasError = true;
|
||||
return false;
|
||||
}
|
||||
return plugin->delayedInitialize();
|
||||
}
|
||||
|
||||
/*!
|
||||
\fn bool PluginSpecPrivate::stop()
|
||||
\internal
|
||||
|
||||
Reference in New Issue
Block a user