]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinmainwindow.cpp
SVN_SILENT Added newline at EOF.
[dolphin.git] / src / dolphinmainwindow.cpp
index 70c28786929970fce6ef6947d6b13c5465046884..92c0cfc80a5051dd91d80f1fde7dc34c38b27a62 100644 (file)
@@ -266,6 +266,15 @@ void DolphinMainWindow::slotSelectionChanged(const KFileItemList& selection)
     emit selectionChanged(selection);
 }
 
+void DolphinMainWindow::slotWheelMoved(int wheelDelta)
+{
+    if (wheelDelta > 0) {
+        activatePrevTab();
+    } else {
+        activateNextTab();
+    }
+}
+
 void DolphinMainWindow::slotRequestItemInfo(const KFileItem& item)
 {
     emit requestItemInfo(item);
@@ -896,6 +905,9 @@ void DolphinMainWindow::init()
             this, SLOT(openNewTab()));
     connect(m_tabBar, SIGNAL(testCanDecode(const QDragMoveEvent*, bool&)),
             this, SLOT(slotTestCanDecode(const QDragMoveEvent*, bool&)));
+    connect(m_tabBar, SIGNAL(wheelDelta(int)),
+           this, SLOT(slotWheelMoved(int)));
+
     m_tabBar->blockSignals(true);  // signals get unblocked after at least 2 tabs are open
 
     QWidget* centralWidget = new QWidget(this);
@@ -1331,6 +1343,10 @@ QString DolphinMainWindow::tabName(const KUrl& url) const
         name = url.fileName();
         if (name.isEmpty()) {
             name = url.protocol();
+        } else {
+            // Make sure that a '&' inside the directory name is displayed correctly
+            // and not misinterpreted as a keyboard shortcut in QTabBar::setTabText()
+            name.replace('&', "&&");
         }
     }
     return name;