forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -833,6 +833,7 @@ void PluginManagerPrivate::nextDelayedInitialize()
|
||||
break; // do next delayedInitialize after a delay
|
||||
}
|
||||
if (delayedInitializeQueue.isEmpty()) {
|
||||
m_isInitializationDone = true;
|
||||
delete delayedInitializeTimer;
|
||||
delayedInitializeTimer = 0;
|
||||
profilingSummary();
|
||||
@@ -1673,6 +1674,11 @@ QString PluginManager::platformName()
|
||||
return result;
|
||||
}
|
||||
|
||||
bool PluginManager::isInitializationDone()
|
||||
{
|
||||
return d->m_isInitializationDone;
|
||||
}
|
||||
|
||||
/*!
|
||||
Retrieves one object with \a name from the object pool.
|
||||
\sa addObject()
|
||||
|
@@ -147,6 +147,8 @@ public:
|
||||
|
||||
static QString platformName();
|
||||
|
||||
static bool isInitializationDone();
|
||||
|
||||
signals:
|
||||
void objectAdded(QObject *obj);
|
||||
void aboutToRemoveObject(QObject *obj);
|
||||
|
@@ -132,6 +132,8 @@ public:
|
||||
|
||||
mutable QReadWriteLock m_lock;
|
||||
|
||||
bool m_isInitializationDone = false;
|
||||
|
||||
private slots:
|
||||
void nextDelayedInitialize();
|
||||
void asyncShutdownFinished();
|
||||
|
@@ -240,6 +240,13 @@ QObject *CorePlugin::remoteCommand(const QStringList & /* options */,
|
||||
const QString &workingDirectory,
|
||||
const QStringList &args)
|
||||
{
|
||||
if (!ExtensionSystem::PluginManager::isInitializationDone()) {
|
||||
connect(ExtensionSystem::PluginManager::instance(), &ExtensionSystem::PluginManager::initializationDone,
|
||||
this, [this, workingDirectory, args]() {
|
||||
remoteCommand(QStringList(), workingDirectory, args);
|
||||
});
|
||||
return nullptr;
|
||||
}
|
||||
IDocument *res = m_mainWindow->openFiles(
|
||||
args, ICore::OpenFilesFlags(ICore::SwitchMode | ICore::CanContainLineAndColumnNumbers),
|
||||
workingDirectory);
|
||||
|
Reference in New Issue
Block a user