mirror of
https://bitbucket.org/smil3y/kde-playground.git
synced 2025-02-23 18:32:51 +00:00
kman: move watcher to lister thread
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
c1b0b3c417
commit
e87e117174
1 changed files with 5 additions and 3 deletions
|
@ -37,7 +37,6 @@
|
||||||
#include "ui_kman.h"
|
#include "ui_kman.h"
|
||||||
|
|
||||||
static QMap<QString,QString> s_mans;
|
static QMap<QString,QString> s_mans;
|
||||||
static QFileSystemWatcher s_watcher;
|
|
||||||
|
|
||||||
class KManLister : public QThread {
|
class KManLister : public QThread {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
@ -57,6 +56,9 @@ class KManLister : public QThread {
|
||||||
protected:
|
protected:
|
||||||
// reimplementation
|
// reimplementation
|
||||||
virtual void run();
|
virtual void run();
|
||||||
|
|
||||||
|
private:
|
||||||
|
QFileSystemWatcher m_watcher;
|
||||||
};
|
};
|
||||||
|
|
||||||
KManLister::KManLister(QObject *parent)
|
KManLister::KManLister(QObject *parent)
|
||||||
|
@ -73,10 +75,10 @@ KManLister::KManLister(QObject *parent)
|
||||||
}
|
}
|
||||||
m_paths << path;
|
m_paths << path;
|
||||||
kDebug() << "watching" << path;
|
kDebug() << "watching" << path;
|
||||||
s_watcher.addPath(path);
|
m_watcher.addPath(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
connect(&s_watcher, SIGNAL(directoryChanged(QString)), this, SLOT(slotScan(QString)));
|
connect(&m_watcher, SIGNAL(directoryChanged(QString)), this, SLOT(slotScan(QString)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void KManLister::slotScan(QString path) {
|
void KManLister::slotScan(QString path) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue