diff --git a/shell/core.h b/shell/core.h --- a/shell/core.h +++ b/shell/core.h @@ -58,12 +58,13 @@ * returns false if the initialization fails, which may happen * if the same session is already active in another instance * - * @param splash the splashscreen instance that shows the startup progress (may be 0) * @param mode the mode in which to run * @param session the name or uuid of the session to be loaded * */ - static bool initialize(QObject* splash = nullptr, Setup mode=Default, const QString& session = {} ); + static bool initialize(Setup mode=Default, const QString& session = {}); + // TODO: remove before 5.2 release + static QT_DEPRECATED bool initialize(QObject* splash = nullptr, Setup mode=Default, const QString& session = {}); /** * \brief Provide access an instance of Core @@ -118,9 +119,6 @@ public slots: void shutdown(); -signals: - void startupProgress(int percent); - protected: friend class CorePrivate; explicit Core( KDevelop::CorePrivate* dd, QObject* parent = nullptr ); diff --git a/shell/core.cpp b/shell/core.cpp --- a/shell/core.cpp +++ b/shell/core.cpp @@ -133,7 +133,6 @@ qCDebug(SHELL) << "Creating controllers"; - emit m_core->startupProgress(0); if( !sessionController ) { sessionController = new SessionController(m_core); @@ -147,7 +146,6 @@ { uiController = new UiController(m_core); } - emit m_core->startupProgress(10); qCDebug(SHELL) << "Creating plugin controller"; if( !pluginController ) @@ -169,7 +167,6 @@ { partController = new PartController(m_core, uiController.data()->defaultMainWindow()); } - emit m_core->startupProgress(20); if( !projectController ) { @@ -187,7 +184,6 @@ // on the document controller. languageController = new LanguageController(m_core); } - emit m_core->startupProgress(25); if( !runController ) { @@ -198,7 +194,6 @@ { sourceFormatterController = new SourceFormatterController(m_core); } - emit m_core->startupProgress(30); if ( !progressController) { @@ -209,7 +204,6 @@ { selectionController = new SelectionController(m_core); } - emit m_core->startupProgress(35); if( !documentationController && !(mode & Core::NoUi) ) { @@ -220,13 +214,11 @@ { debugController = new DebugController(m_core); } - emit m_core->startupProgress(40); if( !testController ) { testController = new TestController(m_core); } - emit m_core->startupProgress(47); qCDebug(SHELL) << "Done creating controllers"; @@ -237,8 +229,6 @@ return false; } - emit m_core->startupProgress(55); - // TODO: Is this early enough, or should we put the loading of the session into // the controller construct DUChain::initialize(); @@ -253,8 +243,6 @@ projectController.data()->initialize(); documentController.data()->initialize(); - emit m_core->startupProgress(63); - /* This is somewhat messy. We want to load the areas before loading the plugins, so that when each plugin is loaded we know if an area wants some of the tool view from that plugin. @@ -266,7 +254,6 @@ qCDebug(SHELL) << "Initializing plugin controller (loading session plugins)"; pluginController.data()->initialize(); - emit m_core->startupProgress(78); qCDebug(SHELL) << "Initializing working set controller"; if(!(mode & Core::NoUi)) @@ -278,24 +265,21 @@ uiController.data()->loadAllAreas(KSharedConfig::openConfig()); uiController.data()->defaultMainWindow()->show(); } - emit m_core->startupProgress(90); qCDebug(SHELL) << "Initializing remaining controllers"; runController.data()->initialize(); sourceFormatterController.data()->initialize(); selectionController.data()->initialize(); if (documentationController) { documentationController.data()->initialize(); } - emit m_core->startupProgress(95); debugController.data()->initialize(); testController.data()->initialize(); installSignalHandler(); qCDebug(SHELL) << "Done initializing controllers"; - emit m_core->startupProgress(100); return true; } CorePrivate::~CorePrivate() @@ -333,18 +317,19 @@ bool Core::initialize(QObject* splash, Setup mode, const QString& session ) { + if (splash) { + QTimer::singleShot( 200, splash, SLOT(deleteLater()) ); + } + return initialize(mode, session); +} + +bool Core::initialize(Setup mode, const QString& session) +{ if (m_self) return true; m_self = new Core(); - if (splash) { - // can't use new signal/slot syntax here, we don't know the class that splash has at runtime - connect(m_self, SIGNAL(startupProgress(int)), splash, SLOT(progress(int))); - } bool ret = m_self->d->initialize(mode, session); - if( splash ) { - QTimer::singleShot( 200, splash, SLOT(deleteLater()) ); - } if(ret) emit m_self->initializationCompleted();