┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphinmainwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/dolphinmainwindow.cpp')
-rw-r--r--src/dolphinmainwindow.cpp37
1 files changed, 18 insertions, 19 deletions
diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp
index 588bfda64..95b08af96 100644
--- a/src/dolphinmainwindow.cpp
+++ b/src/dolphinmainwindow.cpp
@@ -136,6 +136,8 @@ DolphinMainWindow::DolphinMainWindow() :
this, SLOT(activeViewChanged(DolphinViewContainer*)));
connect(m_tabWidget, SIGNAL(tabCountChanged(int)),
this, SLOT(tabCountChanged(int)));
+ connect(m_tabWidget, SIGNAL(currentUrlChanged(KUrl)),
+ this, SLOT(setUrlAsCaption(KUrl)));
setCentralWidget(m_tabWidget);
setupActions();
@@ -236,7 +238,6 @@ void DolphinMainWindow::changeUrl(const KUrl& url)
updatePasteAction();
updateViewActions();
updateGoActions();
- setUrlAsCaption(url);
emit urlChanged(url);
}
@@ -945,8 +946,6 @@ void DolphinMainWindow::activeViewChanged(DolphinViewContainer* viewContainer)
updateGoActions();
const KUrl url = viewContainer->url();
- setUrlAsCaption(url);
-
emit urlChanged(url);
}
@@ -958,6 +957,22 @@ void DolphinMainWindow::tabCountChanged(int count)
actionCollection()->action("activate_prev_tab")->setEnabled(enableTabActions);
}
+void DolphinMainWindow::setUrlAsCaption(const KUrl& url)
+{
+ QString caption;
+ if (!url.isLocalFile()) {
+ caption.append(url.protocol() + " - ");
+ if (url.hasHost()) {
+ caption.append(url.host() + " - ");
+ }
+ }
+
+ const QString fileName = url.fileName().isEmpty() ? "/" : url.fileName();
+ caption.append(fileName);
+
+ setCaption(caption);
+}
+
void DolphinMainWindow::setupActions()
{
// setup 'File' menu
@@ -1471,22 +1486,6 @@ bool DolphinMainWindow::isKompareInstalled() const
return installed;
}
-void DolphinMainWindow::setUrlAsCaption(const KUrl& url)
-{
- QString caption;
- if (!url.isLocalFile()) {
- caption.append(url.protocol() + " - ");
- if (url.hasHost()) {
- caption.append(url.host() + " - ");
- }
- }
-
- const QString fileName = url.fileName().isEmpty() ? "/" : url.fileName();
- caption.append(fileName);
-
- setCaption(caption);
-}
-
void DolphinMainWindow::createPanelAction(const KIcon& icon,
const QKeySequence& shortcut,
QAction* dockAction,