delay load plugins

Change-Id: Ida0ee8d2f92103272aa64d3ec9873d7230867d07
This commit is contained in:
石博文 2016-08-01 11:26:39 +08:00 committed by Hualet Wang
parent dac174d756
commit 70253afad8
4 changed files with 9 additions and 4 deletions

View File

@ -75,6 +75,7 @@ void DockPluginsController::loadPlugins()
#endif
const QStringList plugins = pluginsDir.entryList(QDir::Files);
int pluginIndex = 0;
for (const QString file : plugins)
{
if (!QLibrary::isLibrary(file))
@ -94,9 +95,8 @@ void DockPluginsController::loadPlugins()
continue;
}
// interface->init(this);
// delay load
QTimer::singleShot(100, [=] {interface->init(this);});
QTimer::singleShot(100 + (++pluginIndex) * 50, [=] {interface->init(this);});
}
}

View File

@ -43,6 +43,8 @@ int main(int argc, char *argv[])
DLogManager::registerConsoleAppender();
DLogManager::registerFileAppender();
qDebug() << "\n\ndde-dock startup";
#ifndef QT_DEBUG
QDir::setCurrent(QApplication::applicationDirPath());
#endif

View File

@ -31,6 +31,9 @@ protected:
private slots:
void globalMouseRelease(int button, int x, int y, const QString &id);
private:
using Dtk::Widget::DArrowRectangle::show;
private:
bool m_model;
QPoint m_lastPoint;

View File

@ -13,8 +13,8 @@ NetworkManager *NetworkManager::instance(QObject *parent)
void NetworkManager::init()
{
reloadDevices();
reloadActiveConnections();
QTimer::singleShot(2000, this, &NetworkManager::reloadDevices);
QTimer::singleShot(2500, this, &NetworkManager::reloadActiveConnections);
}
const NetworkDevice::NetworkTypes NetworkManager::states() const