updateEditActions();
updateViewActions();
updateGoActions();
- setCaption(url.fileName());
+ setUrlAsCaption(url);
if (m_viewTab.count() > 1) {
m_tabBar->setTabText(m_tabIndex, tabName(url));
}
setupActions();
const KUrl& homeUrl = generalSettings->homeUrl();
- setCaption(homeUrl.fileName());
+ setUrlAsCaption(homeUrl);
m_actionHandler = new DolphinViewActionHandler(actionCollection(), this);
connect(m_actionHandler, SIGNAL(actionBeingHandled()), SLOT(clearStatusBar()));
connect(m_actionHandler, SIGNAL(createDirectory()), SLOT(createDirectory()));
updateGoActions();
const KUrl& url = m_activeViewContainer->url();
- setCaption(url.fileName());
+ setUrlAsCaption(url);
if (m_viewTab.count() > 1 && m_viewTab[m_tabIndex].secondaryView != 0) {
m_tabBar->setTabText(m_tabIndex, tabName(url));
m_tabBar->setTabIcon(m_tabIndex, KIcon(KMimeType::iconNameForUrl(url)));
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() :
KIO::FileUndoManager::UiInterface()
{
*/
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:
/**
* Implements a custom error handling for the undo manager. This