]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphintabwidget.cpp
Improve padding in the Places View
[dolphin.git] / src / dolphintabwidget.cpp
index 7a14f7ca4ff73729272a950a10c887a37d8c3f00..5ef39dac658ce3793ac9083d2f10a64a300dca38 100644 (file)
@@ -216,7 +216,7 @@ void DolphinTabWidget::openFiles(const QList<QUrl>& files, bool splitView)
     // for each directory. If the "split view" option is enabled, two
     // directories are shown inside one tab (see openDirectories()).
     QList<QUrl> dirs;
     // for each directory. If the "split view" option is enabled, two
     // directories are shown inside one tab (see openDirectories()).
     QList<QUrl> dirs;
-    foreach (const QUrl& url, files) {
+    for (const QUrl& url : files) {
         const QUrl dir(url.adjusted(QUrl::RemoveFilename));
         if (!dirs.contains(dir)) {
             dirs.append(dir);
         const QUrl dir(url.adjusted(QUrl::RemoveFilename));
         if (!dirs.contains(dir)) {
             dirs.append(dir);
@@ -258,7 +258,7 @@ void DolphinTabWidget::closeTab(const int index)
     }
 
     DolphinTabPage* tabPage = tabPageAt(index);
     }
 
     DolphinTabPage* tabPage = tabPageAt(index);
-    emit rememberClosedTab(tabPage->activeViewContainer()->url(), tabPage->saveState());
+    Q_EMIT rememberClosedTab(tabPage->activeViewContainer()->url(), tabPage->saveState());
 
     removeTab(index);
     tabPage->deleteLater();
 
     removeTab(index);
     tabPage->deleteLater();
@@ -382,7 +382,7 @@ void DolphinTabWidget::tabUrlChanged(const QUrl& url)
     const int index = indexOf(qobject_cast<QWidget*>(sender()));
     if (index >= 0) {
         tabBar()->setTabText(index, tabName(tabPageAt(index)));
     const int index = indexOf(qobject_cast<QWidget*>(sender()));
     if (index >= 0) {
         tabBar()->setTabText(index, tabName(tabPageAt(index)));
-        tabBar()->setTabToolTip(index, url.path());
+        tabBar()->setTabToolTip(index, url.toDisplayString(QUrl::PreferLocalFile));
         if (tabBar()->isVisible()) {
             tabBar()->setTabIcon(index, QIcon::fromTheme(KIO::iconNameForUrl(url)));
         } else {
         if (tabBar()->isVisible()) {
             tabBar()->setTabIcon(index, QIcon::fromTheme(KIO::iconNameForUrl(url)));
         } else {
@@ -392,7 +392,7 @@ void DolphinTabWidget::tabUrlChanged(const QUrl& url)
 
         // Emit the currentUrlChanged signal if the url of the current tab has been changed.
         if (index == currentIndex()) {
 
         // Emit the currentUrlChanged signal if the url of the current tab has been changed.
         if (index == currentIndex()) {
-            emit currentUrlChanged(url);
+            Q_EMIT currentUrlChanged(url);
         }
     }
 }
         }
     }
 }
@@ -405,8 +405,8 @@ void DolphinTabWidget::currentTabChanged(int index)
     }
     DolphinTabPage* tabPage = tabPageAt(index);
     DolphinViewContainer* viewContainer = tabPage->activeViewContainer();
     }
     DolphinTabPage* tabPage = tabPageAt(index);
     DolphinViewContainer* viewContainer = tabPage->activeViewContainer();
-    emit activeViewChanged(viewContainer);
-    emit currentUrlChanged(viewContainer->url());
+    Q_EMIT activeViewChanged(viewContainer);
+    Q_EMIT currentUrlChanged(viewContainer->url());
     tabPage->setActive(true);
     m_lastViewedTab = index;
 }
     tabPage->setActive(true);
     m_lastViewedTab = index;
 }
@@ -423,14 +423,14 @@ void DolphinTabWidget::tabInserted(int index)
                 tabBar()->setTabIcon(i, QIcon::fromTheme(KIO::iconNameForUrl(url)));
             }
             if (tabBar()->tabToolTip(i).isEmpty()) {
                 tabBar()->setTabIcon(i, QIcon::fromTheme(KIO::iconNameForUrl(url)));
             }
             if (tabBar()->tabToolTip(i).isEmpty()) {
-                tabBar()->setTabToolTip(index, url.path());
+                tabBar()->setTabToolTip(index, url.toDisplayString(QUrl::PreferLocalFile));
             }
         }
 
         tabBar()->show();
     }
 
             }
         }
 
         tabBar()->show();
     }
 
-    emit tabCountChanged(count());
+    Q_EMIT tabCountChanged(count());
 }
 
 void DolphinTabWidget::tabRemoved(int index)
 }
 
 void DolphinTabWidget::tabRemoved(int index)
@@ -443,7 +443,7 @@ void DolphinTabWidget::tabRemoved(int index)
         tabBar()->hide();
     }
 
         tabBar()->hide();
     }
 
-    emit tabCountChanged(count());
+    Q_EMIT tabCountChanged(count());
 }
 
 QString DolphinTabWidget::tabName(DolphinTabPage* tabPage) const
 }
 
 QString DolphinTabWidget::tabName(DolphinTabPage* tabPage) const