From: Frank Reininghaus Date: Fri, 7 Feb 2014 09:26:00 +0000 (+0100) Subject: Merge remote-tracking branch 'origin/KDE/4.12' X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/016cf47c53c28aa57cf58c37d5acdcfce0bc47b0?hp=-c Merge remote-tracking branch 'origin/KDE/4.12' --- 016cf47c53c28aa57cf58c37d5acdcfce0bc47b0 diff --combined src/views/dolphinview.cpp index 63b53f2e2,71364e045..9f5f48a86 --- a/src/views/dolphinview.cpp +++ b/src/views/dolphinview.cpp @@@ -20,7 -20,7 +20,7 @@@ #include "dolphinview.h" -#include +#include #include #include @@@ -74,8 -74,8 +74,8 @@@ #include "views/tooltips/tooltipmanager.h" #include "zoomlevelinfo.h" -#ifdef HAVE_NEPOMUK - #include +#ifdef HAVE_BALOO + #include #endif namespace { @@@ -870,10 -870,14 +870,10 @@@ void DolphinView::slotHeaderContextMenu KItemListView* view = m_container->controller()->view(); const QSet visibleRolesSet = view->visibleRoles().toSet(); - bool nepomukRunning = false; bool indexingEnabled = false; -#ifdef HAVE_NEPOMUK - nepomukRunning = (Nepomuk2::ResourceManager::instance()->initialized()); - if (nepomukRunning) { - KConfig config("nepomukserverrc"); - indexingEnabled = config.group("Service-nepomukfileindexer").readEntry("autostart", true); - } +#ifdef HAVE_BALOO + Baloo::IndexerConfig config; + indexingEnabled = config.fileIndexingEnabled(); #endif QString groupName; @@@ -904,8 -908,8 +904,8 @@@ action->setChecked(visibleRolesSet.contains(info.role)); action->setData(info.role); - const bool enable = (!info.requiresNepomuk && !info.requiresIndexer) || - (info.requiresNepomuk && nepomukRunning) || + const bool enable = (!info.requiresBaloo && !info.requiresIndexer) || + (info.requiresBaloo) || (info.requiresIndexer && indexingEnabled); action->setEnabled(enable); } @@@ -1662,11 -1666,16 +1662,16 @@@ void DolphinView::updateWritableState( const bool wasFolderWritable = m_isFolderWritable; m_isFolderWritable = false; - const KFileItem item = m_model->rootItem(); - if (!item.isNull()) { - KFileItemListProperties capabilities(KFileItemList() << item); - m_isFolderWritable = capabilities.supportsWriting(); + KFileItem item = m_model->rootItem(); + if (item.isNull()) { + // Try to find out if the URL is writable even if the "root item" is + // null, see https://bugs.kde.org/show_bug.cgi?id=330001 + item = KFileItem(KFileItem::Unknown, KFileItem::Unknown, url(), true); } + + KFileItemListProperties capabilities(KFileItemList() << item); + m_isFolderWritable = capabilities.supportsWriting(); + if (m_isFolderWritable != wasFolderWritable) { emit writeStateChanged(m_isFolderWritable); }