Init the main window class in a slot called with a single shot timer to speed
up perceived startup time for the application. svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=954798
This commit is contained in:
parent
f7177b8319
commit
9bda1ce0e4
|
@ -104,8 +104,11 @@ MainWindow::MainWindow(QWidget* parent, KActionCollection* coll) :
|
|||
m_ActionCollection(coll)
|
||||
{
|
||||
setupUi(this);
|
||||
QTimer::singleShot(0, this, SLOT(init()));
|
||||
}
|
||||
|
||||
FileSystemFactory::init();
|
||||
void MainWindow::init()
|
||||
{
|
||||
connect(GlobalLog::instance(), SIGNAL(newMessage(log::Level, const QString&)), SLOT(onNewLogMessage(log::Level, const QString&)));
|
||||
|
||||
setupActions();
|
||||
|
@ -114,11 +117,13 @@ MainWindow::MainWindow(QWidget* parent, KActionCollection* coll) :
|
|||
|
||||
// If we were called with an action collection we're supposed to be a KPart, so don't
|
||||
// create the GUI in that case.
|
||||
if (coll != NULL)
|
||||
if (m_ActionCollection != NULL)
|
||||
setupGUI(ToolBar | Keys | StatusBar | Save);
|
||||
else
|
||||
setupGUI(ToolBar | Keys | StatusBar | Save | Create);
|
||||
|
||||
FileSystemFactory::init();
|
||||
|
||||
loadConfig();
|
||||
|
||||
dockInformation().setWidget(&infoPane());
|
||||
|
|
|
@ -160,6 +160,7 @@ class LIBPARTITIONMANAGERPRIVATE_EXPORT MainWindow : public KXmlGuiWindow, publi
|
|||
void onNewLogMessage(log::Level logLevel, const QString& s);
|
||||
void onFinished();
|
||||
void scanDevices();
|
||||
void init();
|
||||
|
||||
private:
|
||||
LibParted m_LibParted;
|
||||
|
|
Loading…
Reference in New Issue