┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Salatas <[email protected]>2017-01-14 04:26:14 -0800
committerJohn Salatas <[email protected]>2017-01-14 04:26:14 -0800
commit63a591f32a56cb4caac9a616d21fab0f37c8d827 (patch)
tree28062a54a6d58db654c983467a99211d900daecf /src
parent97415005de040885cb63ea01fdb879e20226a2f2 (diff)
Show full path in title bar
BUG: 229810 Differential Revision: https://phabricator.kde.org/D4078
Diffstat (limited to 'src')
-rw-r--r--src/dolphinmainwindow.cpp15
-rw-r--r--src/settings/dolphin_generalsettings.kcfg4
-rw-r--r--src/settings/startup/startupsettingspage.cpp8
-rw-r--r--src/settings/startup/startupsettingspage.h1
4 files changed, 22 insertions, 6 deletions
diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp
index e5103fd42..deb5d5e57 100644
--- a/src/dolphinmainwindow.cpp
+++ b/src/dolphinmainwindow.cpp
@@ -961,13 +961,17 @@ void DolphinMainWindow::setUrlAsCaption(const QUrl& url)
}
}
- QString fileName = url.adjusted(QUrl::StripTrailingSlash).fileName();
- if (fileName.isEmpty()) {
- fileName = '/';
+ if (GeneralSettings::showFullPathInTitlebar()) {
+ const QString path = url.adjusted(QUrl::StripTrailingSlash).path();
+ caption.append(path);
+ } else {
+ QString fileName = url.adjusted(QUrl::StripTrailingSlash).fileName();
+ if (fileName.isEmpty()) {
+ fileName = '/';
+ }
+ caption.append(fileName);
}
- caption.append(fileName);
-
setWindowTitle(caption);
}
@@ -1404,6 +1408,7 @@ void DolphinMainWindow::refreshViews()
const bool splitView = GeneralSettings::splitView();
m_tabWidget->currentTabPage()->setSplitViewEnabled(splitView);
updateSplitAction();
+ setUrlAsCaption(activeViewContainer()->url());
}
emit settingsChanged();
diff --git a/src/settings/dolphin_generalsettings.kcfg b/src/settings/dolphin_generalsettings.kcfg
index c724afcd1..5878abcbe 100644
--- a/src/settings/dolphin_generalsettings.kcfg
+++ b/src/settings/dolphin_generalsettings.kcfg
@@ -22,6 +22,10 @@
<label>Should the full path be shown inside the location bar</label>
<default>false</default>
</entry>
+ <entry name="ShowFullPathInTitlebar" type="Bool">
+ <label>Should the full path be shown in the title bar</label>
+ <default>false</default>
+ </entry>
<entry name="Version" type="Int">
<label>Internal version of Dolphin, containing 3 digits for major, minor, bugfix</label>
<default>0</default>
diff --git a/src/settings/startup/startupsettingspage.cpp b/src/settings/startup/startupsettingspage.cpp
index 6554493d8..f076f16c7 100644
--- a/src/settings/startup/startupsettingspage.cpp
+++ b/src/settings/startup/startupsettingspage.cpp
@@ -46,7 +46,8 @@ StartupSettingsPage::StartupSettingsPage(const QUrl& url, QWidget* parent) :
m_splitView(0),
m_editableUrl(0),
m_showFullPath(0),
- m_filterBar(0)
+ m_filterBar(0),
+ m_showFullPathInTitlebar(0)
{
QVBoxLayout* topLayout = new QVBoxLayout(this);
QWidget* vBox = new QWidget(this);
@@ -104,6 +105,8 @@ StartupSettingsPage::StartupSettingsPage(const QUrl& url, QWidget* parent) :
vBoxLayout->addWidget(m_showFullPath);
m_filterBar = new QCheckBox(i18nc("@option:check Startup Settings", "Show filter bar"), vBox);
vBoxLayout->addWidget(m_filterBar);
+ m_showFullPathInTitlebar = new QCheckBox(i18nc("@option:check Startup Settings", "Show full path in title bar"), vBox);
+ vBoxLayout->addWidget(m_showFullPathInTitlebar);
// Add a dummy widget with no restriction regarding
// a vertical resizing. This assures that the dialog layout
@@ -119,6 +122,7 @@ StartupSettingsPage::StartupSettingsPage(const QUrl& url, QWidget* parent) :
connect(m_editableUrl, &QCheckBox::toggled, this, &StartupSettingsPage::slotSettingsChanged);
connect(m_showFullPath, &QCheckBox::toggled, this, &StartupSettingsPage::slotSettingsChanged);
connect(m_filterBar, &QCheckBox::toggled, this, &StartupSettingsPage::slotSettingsChanged);
+ connect(m_showFullPathInTitlebar, &QCheckBox::toggled, this, &StartupSettingsPage::slotSettingsChanged);
}
StartupSettingsPage::~StartupSettingsPage()
@@ -141,6 +145,7 @@ void StartupSettingsPage::applySettings()
settings->setEditableUrl(m_editableUrl->isChecked());
settings->setShowFullPath(m_showFullPath->isChecked());
settings->setFilterBar(m_filterBar->isChecked());
+ settings->setShowFullPathInTitlebar(m_showFullPathInTitlebar->isChecked());
settings->save();
}
@@ -190,4 +195,5 @@ void StartupSettingsPage::loadSettings()
m_editableUrl->setChecked(GeneralSettings::editableUrl());
m_showFullPath->setChecked(GeneralSettings::showFullPath());
m_filterBar->setChecked(GeneralSettings::filterBar());
+ m_showFullPathInTitlebar->setChecked(GeneralSettings::showFullPathInTitlebar());
}
diff --git a/src/settings/startup/startupsettingspage.h b/src/settings/startup/startupsettingspage.h
index 9bcc31131..7a69cd3d6 100644
--- a/src/settings/startup/startupsettingspage.h
+++ b/src/settings/startup/startupsettingspage.h
@@ -62,6 +62,7 @@ private:
QCheckBox* m_editableUrl;
QCheckBox* m_showFullPath;
QCheckBox* m_filterBar;
+ QCheckBox* m_showFullPathInTitlebar;
};
#endif