]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinmainwindow.cpp
* Use Nepomuk for getting the meta data instead of KFileMetaInfo.
[dolphin.git] / src / dolphinmainwindow.cpp
index 077005c0fe49df1ede96cd9b6a437933918ac4b1..697fba85fcb8a2ac823a74ee506e7935dfce8c6a 100644 (file)
@@ -266,15 +266,12 @@ void DolphinMainWindow::slotSelectionChanged(const KFileItemList& selection)
     emit selectionChanged(selection);
 }
 
-void DolphinMainWindow::slotWheelMoved(int wheeldelta) 
-{
-    if (wheeldelta > 0)
-    {  
-       //Non-negative, wheel is going forwards, so the tab goes backwards (focuses left)
-       activatePrevTab();
-    } else
-    {  
-       activateNextTab();
+void DolphinMainWindow::slotWheelMoved(int wheelDelta)
+{
+    if (wheelDelta > 0) {
+        activatePrevTab();
+    } else {
+        activateNextTab();
     }
 }
 
@@ -908,9 +905,11 @@ 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)), 
+    connect(m_tabBar, SIGNAL(wheelDelta(int)),
            this, SLOT(slotWheelMoved(int)));
-           
+    connect(m_tabBar, SIGNAL(mouseMiddleClick(int)),
+            this, SLOT(closeTab(int)));
+
     m_tabBar->blockSignals(true);  // signals get unblocked after at least 2 tabs are open
 
     QWidget* centralWidget = new QWidget(this);
@@ -1007,7 +1006,7 @@ void DolphinMainWindow::setupActions()
     KAction* newTab = actionCollection()->addAction("new_tab");
     newTab->setIcon(KIcon("tab-new"));
     newTab->setText(i18nc("@action:inmenu File", "New Tab"));
-    newTab->setShortcut(KShortcut(Qt::CTRL | Qt::SHIFT | Qt::Key_N, Qt::CTRL | Qt::Key_T));
+    newTab->setShortcut(KShortcut(Qt::CTRL | Qt::Key_T, Qt::CTRL | Qt::SHIFT | Qt::Key_N));
     connect(newTab, SIGNAL(triggered()), this, SLOT(openNewTab()));
 
     QAction* closeTab = actionCollection()->addAction("close_tab");
@@ -1346,6 +1345,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;