#include "dolphinview.h"
-#include <config-nepomuk.h>
+#include <config-baloo.h>
#include <QAbstractItemView>
#include <QApplication>
#include "views/tooltips/tooltipmanager.h"
#include "zoomlevelinfo.h"
-#ifdef HAVE_NEPOMUK
- #include <Nepomuk2/ResourceManager>
+#ifdef HAVE_BALOO
+ #include <baloo/indexerconfig.h>
#endif
namespace {
const int index = m_model->index(items.first());
m_view->editRole(index, "text");
+ hideToolTip();
+
connect(m_view, SIGNAL(roleEditingFinished(int,QByteArray,QVariant)),
this, SLOT(slotRoleEditingFinished(int,QByteArray,QVariant)));
} else {
KItemListView* view = m_container->controller()->view();
const QSet<QByteArray> 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;
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);
}
if (op && destUrl == url()) {
// Mark the dropped urls as selected.
m_clearSelectionBeforeSelectingNewItems = true;
+ m_markFirstNewlySelectedItemAsCurrent = true;
connect(op, SIGNAL(aboutToCreate(KUrl::List)), this, SLOT(slotAboutToCreate(KUrl::List)));
}
void DolphinView::slotMouseButtonPressed(int itemIndex, Qt::MouseButtons buttons)
{
+ Q_UNUSED(itemIndex);
+
hideToolTip();
- if (itemIndex < 0) {
- // Trigger the history navigation only when clicking on the viewport:
- // Above an item the XButtons provide a simple way to select items in
- // the singleClick mode.
- if (buttons & Qt::XButton1) {
- emit goBackRequested();
- } else if (buttons & Qt::XButton2) {
- emit goForwardRequested();
- }
+ // TODO: Qt5: Replace Qt::XButton1 by Qt::BackButton and Qt::XButton2 by Qt::ForwardButton
+ if (buttons & Qt::XButton1) {
+ emit goBackRequested();
+ } else if (buttons & Qt::XButton2) {
+ emit goForwardRequested();
}
}
}
}
-void DolphinView::showHoverInformation(const KFileItem& item)
-{
- emit requestItemInfo(item);
-}
-
-void DolphinView::clearHoverInformation()
-{
- emit requestItemInfo(KFileItem());
-}
-
void DolphinView::slotDeleteFileFinished(KJob* job)
{
if (job->error() == 0) {
}
KonqOperations* op = KonqOperations::renameV2(this, oldUrl, newName);
- if (op) {
+ if (op && !newNameExistsAlready) {
+ // Only connect the renamingFailed signal if there is no item with the new name
+ // in the model yet, see bug 328262.
connect(op, SIGNAL(renamingFailed(KUrl,KUrl)), SLOT(slotRenamingFailed(KUrl,KUrl)));
}
}
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);
}