diff options
| author | Frank Reininghaus <[email protected]> | 2013-05-11 18:47:58 +0200 |
|---|---|---|
| committer | Frank Reininghaus <[email protected]> | 2013-05-11 18:47:58 +0200 |
| commit | cad78cdfcf1f3b76acaadc7e9394df3ef466d770 (patch) | |
| tree | c20bd592150467d0f306a748258492ebe78ade8b /src/panels | |
| parent | f9990aff6a087bf5e7225810e200fdd26a9d7a3e (diff) | |
| parent | f6fcf4be851e82e13a60f469e10b207a2c7facba (diff) | |
Merge remote-tracking branch 'origin/KDE/4.10'
Conflicts:
CMakeLists.txt
Diffstat (limited to 'src/panels')
| -rw-r--r-- | src/panels/places/placesitemmodel.cpp | 40 | ||||
| -rw-r--r-- | src/panels/places/placesitemmodel.h | 3 |
2 files changed, 42 insertions, 1 deletions
diff --git a/src/panels/places/placesitemmodel.cpp b/src/panels/places/placesitemmodel.cpp index 1acbb5771..caf6b7566 100644 --- a/src/panels/places/placesitemmodel.cpp +++ b/src/panels/places/placesitemmodel.cpp @@ -88,7 +88,11 @@ PlacesItemModel::PlacesItemModel(QObject* parent) : m_storageSetupInProgress() { #ifdef HAVE_NEPOMUK - if (Nepomuk2::ResourceManager::instance()->initialized()) { + Nepomuk2::ResourceManager* rm = Nepomuk2::ResourceManager::instance(); + connect(rm, SIGNAL(nepomukSystemStarted()), this, SLOT(slotNepomukStarted())); + connect(rm, SIGNAL(nepomukSystemStopped()), this, SLOT(slotNepomukStopped())); + + if (rm->initialized()) { KConfig config("nepomukserverrc"); m_fileIndexingEnabled = config.group("Service-nepomukfileindexer").readEntry("autostart", true); } @@ -949,6 +953,40 @@ void PlacesItemModel::createSystemBookmarks() } } +void PlacesItemModel::clear() { + m_bookmarkedItems.clear(); + KStandardItemModel::clear(); +} + +void PlacesItemModel::slotNepomukStarted() +{ + KConfig config("nepomukserverrc"); + m_fileIndexingEnabled = config.group("Service-nepomukfileindexer").readEntry("autostart", true); + if (m_fileIndexingEnabled) { + m_systemBookmarks.clear(); + m_systemBookmarksIndexes.clear(); + createSystemBookmarks(); + + clear(); + loadBookmarks(); + } +} + +void PlacesItemModel::slotNepomukStopped() +{ + if (m_fileIndexingEnabled) { + m_fileIndexingEnabled = false; + + m_systemBookmarks.clear(); + m_systemBookmarksIndexes.clear(); + createSystemBookmarks(); + + clear(); + loadBookmarks(); + } +} + + void PlacesItemModel::initializeAvailableDevices() { QString predicate("[[[[ StorageVolume.ignored == false AND [ StorageVolume.usage == 'FileSystem' OR StorageVolume.usage == 'Encrypted' ]]" diff --git a/src/panels/places/placesitemmodel.h b/src/panels/places/placesitemmodel.h index e42187860..693836033 100644 --- a/src/panels/places/placesitemmodel.h +++ b/src/panels/places/placesitemmodel.h @@ -133,6 +133,7 @@ public: */ static KUrl convertedUrl(const KUrl& url); + virtual void clear(); signals: void errorMessage(const QString& message); void storageSetupDone(int index, bool success); @@ -163,6 +164,8 @@ private slots: */ void saveBookmarks(); + void slotNepomukStarted(); + void slotNepomukStopped(); private: struct SystemBookmarkData; |
