mirror of
https://invent.kde.org/system/dolphin
synced 2024-09-19 16:31:21 +00:00
Don't show an empty window caption when browsing "/", "trash:", etc.
BUG: 190783 svn path=/trunk/KDE/kdebase/apps/; revision=964061
This commit is contained in:
parent
0738c273ce
commit
cc8a62ff16
|
@ -236,7 +236,7 @@ void DolphinMainWindow::changeUrl(const KUrl& url)
|
||||||
updateEditActions();
|
updateEditActions();
|
||||||
updateViewActions();
|
updateViewActions();
|
||||||
updateGoActions();
|
updateGoActions();
|
||||||
setCaption(url.fileName());
|
setUrlAsCaption(url);
|
||||||
if (m_viewTab.count() > 1) {
|
if (m_viewTab.count() > 1) {
|
||||||
m_tabBar->setTabText(m_tabIndex, tabName(url));
|
m_tabBar->setTabText(m_tabIndex, tabName(url));
|
||||||
}
|
}
|
||||||
|
@ -987,7 +987,7 @@ void DolphinMainWindow::init()
|
||||||
setupActions();
|
setupActions();
|
||||||
|
|
||||||
const KUrl& homeUrl = generalSettings->homeUrl();
|
const KUrl& homeUrl = generalSettings->homeUrl();
|
||||||
setCaption(homeUrl.fileName());
|
setUrlAsCaption(homeUrl);
|
||||||
m_actionHandler = new DolphinViewActionHandler(actionCollection(), this);
|
m_actionHandler = new DolphinViewActionHandler(actionCollection(), this);
|
||||||
connect(m_actionHandler, SIGNAL(actionBeingHandled()), SLOT(clearStatusBar()));
|
connect(m_actionHandler, SIGNAL(actionBeingHandled()), SLOT(clearStatusBar()));
|
||||||
connect(m_actionHandler, SIGNAL(createDirectory()), SLOT(createDirectory()));
|
connect(m_actionHandler, SIGNAL(createDirectory()), SLOT(createDirectory()));
|
||||||
|
@ -1096,7 +1096,7 @@ void DolphinMainWindow::setActiveViewContainer(DolphinViewContainer* viewContain
|
||||||
updateGoActions();
|
updateGoActions();
|
||||||
|
|
||||||
const KUrl& url = m_activeViewContainer->url();
|
const KUrl& url = m_activeViewContainer->url();
|
||||||
setCaption(url.fileName());
|
setUrlAsCaption(url);
|
||||||
if (m_viewTab.count() > 1 && m_viewTab[m_tabIndex].secondaryView != 0) {
|
if (m_viewTab.count() > 1 && m_viewTab[m_tabIndex].secondaryView != 0) {
|
||||||
m_tabBar->setTabText(m_tabIndex, tabName(url));
|
m_tabBar->setTabText(m_tabIndex, tabName(url));
|
||||||
m_tabBar->setTabIcon(m_tabIndex, KIcon(KMimeType::iconNameForUrl(url)));
|
m_tabBar->setTabIcon(m_tabIndex, KIcon(KMimeType::iconNameForUrl(url)));
|
||||||
|
@ -1555,6 +1555,21 @@ QString DolphinMainWindow::tabProperty(const QString& property, int tabIndex) co
|
||||||
return "Tab " + QString::number(tabIndex) + ' ' + property;
|
return "Tab " + QString::number(tabIndex) + ' ' + property;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DolphinMainWindow::setUrlAsCaption(const KUrl& url)
|
||||||
|
{
|
||||||
|
QString caption;
|
||||||
|
if (url.equals(KUrl("file:///"))) {
|
||||||
|
caption = '/';
|
||||||
|
} else {
|
||||||
|
caption = url.fileName();
|
||||||
|
if (caption.isEmpty()) {
|
||||||
|
caption = url.protocol();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
setCaption(caption);
|
||||||
|
}
|
||||||
|
|
||||||
DolphinMainWindow::UndoUiInterface::UndoUiInterface() :
|
DolphinMainWindow::UndoUiInterface::UndoUiInterface() :
|
||||||
KIO::FileUndoManager::UiInterface()
|
KIO::FileUndoManager::UiInterface()
|
||||||
{
|
{
|
||||||
|
|
|
@ -435,6 +435,12 @@ private:
|
||||||
*/
|
*/
|
||||||
QString tabProperty(const QString& property, int tabIndex) const;
|
QString tabProperty(const QString& property, int tabIndex) const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the window caption to url.fileName() if this is non-empty,
|
||||||
|
* "/" if the URL is "file:///", and url.protocol() otherwise.
|
||||||
|
*/
|
||||||
|
void setUrlAsCaption(const KUrl& url);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/**
|
/**
|
||||||
* Implements a custom error handling for the undo manager. This
|
* Implements a custom error handling for the undo manager. This
|
||||||
|
|
Loading…
Reference in a new issue