Changeset View
Changeset View
Standalone View
Standalone View
app/plasma/dataengine/kdevelopsessionsengine.cpp
Show All 31 Lines | 31 | KDevelopSessionsEngine::KDevelopSessionsEngine(QObject *parent, const QVariantList &args) | |||
---|---|---|---|---|---|
32 | : Plasma::DataEngine(parent, args), | 32 | : Plasma::DataEngine(parent, args), | ||
33 | m_dirWatch(nullptr) | 33 | m_dirWatch(nullptr) | ||
34 | { | 34 | { | ||
35 | init(); | 35 | init(); | ||
36 | } | 36 | } | ||
37 | 37 | | |||
38 | KDevelopSessionsEngine::~KDevelopSessionsEngine() | 38 | KDevelopSessionsEngine::~KDevelopSessionsEngine() | ||
39 | { | 39 | { | ||
40 | delete m_dirWatch; | ||||
brauch: KDirWatch looks like a QObject, do you really need to delete it? | |||||
40 | } | 41 | } | ||
41 | 42 | | |||
42 | void KDevelopSessionsEngine::init() | 43 | void KDevelopSessionsEngine::init() | ||
43 | { | 44 | { | ||
45 | if(m_dirWatch) | ||||
brauch: Does this ever happen? | |||||
46 | delete m_dirWatch; | ||||
47 | | ||||
44 | m_dirWatch = new KDirWatch( this ); | 48 | m_dirWatch = new KDirWatch( this ); | ||
45 | 49 | | |||
46 | const QStringList sessionDirs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, "kdevelop/sessions", QStandardPaths::LocateDirectory ); | 50 | const QStringList sessionDirs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, "kdevelop/sessions", QStandardPaths::LocateDirectory ); | ||
47 | 51 | | |||
48 | for ( int i = 0; i < sessionDirs.count(); ++i ) | 52 | for ( int i = 0; i < sessionDirs.count(); ++i ) | ||
49 | m_dirWatch->addDir( sessionDirs[i], KDirWatch::WatchSubDirs ); | 53 | m_dirWatch->addDir( sessionDirs[i], KDirWatch::WatchSubDirs ); | ||
50 | 54 | | |||
51 | connect(m_dirWatch, &KDirWatch::dirty, this, &KDevelopSessionsEngine::updateSessions); | 55 | connect(m_dirWatch, &KDirWatch::dirty, this, &KDevelopSessionsEngine::updateSessions); | ||
▲ Show 20 Lines • Show All 110 Lines • Show Last 20 Lines |
KDirWatch looks like a QObject, do you really need to delete it?