]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/panels/folders/folderspanel.cpp
Fix wrong window titles
[dolphin.git] / src / panels / folders / folderspanel.cpp
index 95953f66bd1a47531621985c2a142a70061a0a9f..01f338461f0d8990651ed615612cab5d239fa589 100644 (file)
@@ -111,7 +111,7 @@ void FoldersPanel::rename(const KFileItem& item)
 
 bool FoldersPanel::urlChanged()
 {
-    if (!url().isValid() || url().scheme().contains(QStringLiteral("search"))) {
+    if (!url().isValid() || url().scheme().contains(QLatin1String("search"))) {
         // Skip results shown by a search, as possible identical
         // directory names are useless without parent-path information.
         return false;
@@ -214,12 +214,10 @@ void FoldersPanel::slotItemMiddleClicked(int index)
 
 void FoldersPanel::slotItemContextMenuRequested(int index, const QPointF& pos)
 {
-    Q_UNUSED(pos);
-
     const KFileItem fileItem = m_model->fileItem(index);
 
     QPointer<TreeViewContextMenu> contextMenu = new TreeViewContextMenu(this, fileItem);
-    contextMenu.data()->open();
+    contextMenu.data()->open(pos.toPoint());
     if (contextMenu.data()) {
         delete contextMenu.data();
     }
@@ -227,10 +225,8 @@ void FoldersPanel::slotItemContextMenuRequested(int index, const QPointF& pos)
 
 void FoldersPanel::slotViewContextMenuRequested(const QPointF& pos)
 {
-    Q_UNUSED(pos);
-
     QPointer<TreeViewContextMenu> contextMenu = new TreeViewContextMenu(this, KFileItem());
-    contextMenu.data()->open();
+    contextMenu.data()->open(pos.toPoint());
     if (contextMenu.data()) {
         delete contextMenu.data();
     }
@@ -262,7 +258,7 @@ void FoldersPanel::slotRoleEditingFinished(int index, const QByteArray& role, co
     if (role == "text") {
         const KFileItem item = m_model->fileItem(index);
         const QString newName = value.toString();
-        if (!newName.isEmpty() && newName != item.text() && newName != QLatin1String(".") && newName != QLatin1String("..")) {
+        if (!newName.isEmpty() && newName != item.text() && newName != QLatin1Char('.') && newName != QLatin1String("..")) {
             const QUrl oldUrl = item.url();
             QUrl newUrl = oldUrl.adjusted(QUrl::RemoveFilename);
             newUrl.setPath(newUrl.path() + KIO::encodeFileName(newName));