┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2012-06-07 23:08:05 +0200
committerPeter Penz <[email protected]>2012-06-07 23:10:04 +0200
commit5c163a41c5fdb8d97138cce455c81cb5732263aa (patch)
tree07fd957ec9159d21df43f5a4c5acd019afee638f
parentc214b3751fe6a09a298d5904b62628caeff3bc56 (diff)
Hide "Recently Accessed" and "Search for" if indexing is disabled
The bookmarks for "Recently Accessed" and "Search for" require enabled indexing not only an enabled Nepomuk. BUG: 301340 FIXED-IN: 4.9.0
-rw-r--r--src/panels/places/placesitemmodel.cpp14
-rw-r--r--src/panels/places/placesitemmodel.h2
2 files changed, 10 insertions, 6 deletions
diff --git a/src/panels/places/placesitemmodel.cpp b/src/panels/places/placesitemmodel.cpp
index 8530b92f5..a0358cb43 100644
--- a/src/panels/places/placesitemmodel.cpp
+++ b/src/panels/places/placesitemmodel.cpp
@@ -73,7 +73,7 @@ namespace {
PlacesItemModel::PlacesItemModel(QObject* parent) :
KStandardItemModel(parent),
- m_nepomukRunning(false),
+ m_fileIndexingEnabled(false),
m_hiddenItemsShown(false),
m_availableDevices(),
m_predicate(),
@@ -87,7 +87,11 @@ PlacesItemModel::PlacesItemModel(QObject* parent) :
m_storageSetupInProgress()
{
#ifdef HAVE_NEPOMUK
- m_nepomukRunning = (Nepomuk::ResourceManager::instance()->initialized());
+ if (Nepomuk::ResourceManager::instance()->initialized()) {
+ KConfig config("nepomukserverrc");
+ m_fileIndexingEnabled = config.group("Service-nepomukfileindexer").readEntry("autostart", false);
+ }
+
#endif
const QString file = KStandardDirs::locateLocal("data", "kfileplaces/bookmarks.xml");
m_bookmarkManager = KBookmarkManager::managerForFile(file, "kfilePlaces");
@@ -808,8 +812,8 @@ bool PlacesItemModel::acceptBookmark(const KBookmark& bookmark,
const bool allowedHere = (appName.isEmpty()
|| appName == KGlobal::mainComponent().componentName()
|| appName == KGlobal::mainComponent().componentName() + AppNamePrefix)
- && (m_nepomukRunning || (url.protocol() != QLatin1String("timeline") &&
- url.protocol() != QLatin1String("search")));
+ && (m_fileIndexingEnabled || (url.protocol() != QLatin1String("timeline") &&
+ url.protocol() != QLatin1String("search")));
return (udi.isEmpty() && allowedHere) || deviceAvailable;
}
@@ -890,7 +894,7 @@ void PlacesItemModel::createSystemBookmarks()
"user-trash",
i18nc("@item", "Trash")));
- if (m_nepomukRunning) {
+ if (m_fileIndexingEnabled) {
m_systemBookmarks.append(SystemBookmarkData(KUrl("timeline:/today"),
timeLineIcon,
i18nc("@item Recently Accessed", "Today")));
diff --git a/src/panels/places/placesitemmodel.h b/src/panels/places/placesitemmodel.h
index b0f66d652..a060f4549 100644
--- a/src/panels/places/placesitemmodel.h
+++ b/src/panels/places/placesitemmodel.h
@@ -260,7 +260,7 @@ private:
#endif
private:
- bool m_nepomukRunning;
+ bool m_fileIndexingEnabled;
bool m_hiddenItemsShown;
QSet<QString> m_availableDevices;