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);
}
text = url.host();
}
+ if (url.isLocalFile() && !QFileInfo(url.toLocalFile()).isDir()) {
+ // Only directories are allowed
+ continue;
+ }
+
PlacesItem* newItem = createPlacesItem(text, url);
const int dropIndex = groupedDropIndex(index, newItem);
insertItem(dropIndex, newItem);
}
if (error) {
- // TODO: Request message-freeze exception
if (errorData.isValid()) {
- // emit errorMessage(i18nc("@info", "An error occurred while accessing '%1', the system responded: %2",
- // item->text(),
- // errorData.toString()));
- emit errorMessage(QString("An error occurred while accessing '%1', the system responded: %2")
- .arg(item->text()).arg(errorData.toString()));
+ emit errorMessage(i18nc("@info", "An error occurred while accessing '%1', the system responded: %2",
+ item->text(),
+ errorData.toString()));
} else {
- // emit errorMessage(i18nc("@info", "An error occurred while accessing '%1'",
- // item->text()));
- emit errorMessage(QString("An error occurred while accessing '%1'").arg(item->text()));
+ emit errorMessage(i18nc("@info", "An error occurred while accessing '%1'",
+ item->text()));
}
emit storageSetupDone(index, false);
} else {
}
}
+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' ]]"