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", false);
+ m_fileIndexingEnabled = config.group("Service-nepomukfileindexer").readEntry("autostart", true);
}
#endif
delete item;
return;
}
- }
-
- for (int i = 0; i < count(); ++i) {
- if (placesItem(i)->udi() == udi) {
- removeItem(i);
- return;
- }
- }
+ }
+
+ for (int i = 0; i < count(); ++i) {
+ if (placesItem(i)->udi() == udi) {
+ removeItem(i);
+ return;
+ }
+ }
}
void PlacesItemModel::slotStorageTeardownDone(Solid::ErrorType error, const QVariant& errorData)
}
}
+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' ]]"