disable watcher for plugin add/remove for now

the watcher is helpful actually, but its too buggy

Change-Id: Idc082fd55e50cdc15df207f517cdafba43b49a78
This commit is contained in:
Hualet Wang 2015-09-08 17:01:50 +08:00
parent bfddee7d21
commit 416558a11d
Notes: Deepin Code Review 2016-06-14 07:19:47 +00:00
Verified+1: Anonymous Coward #1000004
Code-Review+2: <mr.asianwang@gmail.com>
Submitted-by: <mr.asianwang@gmail.com>
Submitted-at: Thu, 10 Sep 2015 11:10:14 +0800
Reviewed-on: https://cr.deepin.io/6914
Project: dde/dde-dock
Branch: refs/heads/master

View File

@ -1,7 +1,7 @@
#include <QDir>
#include <QLibrary>
#include <QPluginLoader>
#include <QFileSystemWatcher>
//#include <QFileSystemWatcher>
#include "dockpluginproxy.h"
#include "dockpluginmanager.h"
@ -14,8 +14,8 @@ DockPluginManager::DockPluginManager(QObject *parent) :
m_searchPaths << "/usr/share/dde-dock/plugins/";
m_watcher = new QFileSystemWatcher(this);
m_watcher->addPaths(m_searchPaths);
// m_watcher = new QFileSystemWatcher(this);
// m_watcher->addPaths(m_searchPaths);
foreach (QString path, m_searchPaths) {
QDir pluginsDir(path);
@ -27,10 +27,8 @@ DockPluginManager::DockPluginManager(QObject *parent) :
}
}
connect(m_watcher, &QFileSystemWatcher::fileChanged, this, &DockPluginManager::watchedFileChanged);
connect(m_watcher, &QFileSystemWatcher::directoryChanged, this, &DockPluginManager::watchedDirectoryChanged);
// connect(m_watcher, &QFileSystemWatcher::fileChanged, this, &DockPluginManager::watchedFileChanged);
// connect(m_watcher, &QFileSystemWatcher::directoryChanged, this, &DockPluginManager::watchedDirectoryChanged);
}
void DockPluginManager::initAll()
@ -89,7 +87,7 @@ DockPluginProxy * DockPluginManager::loadPlugin(const QString &path)
DockPluginProxy * proxy = new DockPluginProxy(pluginLoader, interface);
if (proxy) {
m_proxies[path] = proxy;
m_watcher->addPath(path);
// m_watcher->addPath(path);
connect(proxy, &DockPluginProxy::itemAdded, this, &DockPluginManager::onPluginItemAdded);
connect(proxy, &DockPluginProxy::itemRemoved, this, &DockPluginManager::onPluginItemRemoved);
connect(m_settingFrame, &PluginsSettingFrame::disableChanged, [=](QString uuid, bool disable){