summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/tabwindow/tabwindow.cpp11
-rw-r--r--src/webwindow/webwindow.cpp11
2 files changed, 13 insertions, 9 deletions
diff --git a/src/tabwindow/tabwindow.cpp b/src/tabwindow/tabwindow.cpp
index 99c4aa40..5b295981 100644
--- a/src/tabwindow/tabwindow.cpp
+++ b/src/tabwindow/tabwindow.cpp
@@ -262,9 +262,7 @@ void TabWindow::tabTitleChanged(const QString &title)
if (!tab)
return;
- bool emptyTitle = title.isEmpty();
-
- QString tabTitle = emptyTitle ? tab->url().url() : title;
+ QString tabTitle = title.isEmpty() ? tab->title() : title;
tabTitle.replace('&', "&&");
int index = indexOf(tab);
@@ -275,14 +273,11 @@ void TabWindow::tabTitleChanged(const QString &title)
if (currentIndex() != index)
{
- if (!emptyTitle)
- tabBar()->setTabHighlighted(index, true);
+ tabBar()->setTabHighlighted(index, true);
}
else
{
- emptyTitle
- ? setWindowTitle(QL1S("rekonq"))
- : setWindowTitle(tabTitle + QL1S(" - rekonq"));
+ setWindowTitle(tabTitle + QL1S(" - rekonq"));
}
}
diff --git a/src/webwindow/webwindow.cpp b/src/webwindow/webwindow.cpp
index 4c8f9dae..b38498d5 100644
--- a/src/webwindow/webwindow.cpp
+++ b/src/webwindow/webwindow.cpp
@@ -630,7 +630,16 @@ KUrl WebWindow::url() const
QString WebWindow::title() const
{
- return _tab->view()->title();
+ QString t = _tab->view()->title();
+ if (t.isEmpty())
+ {
+ if (url().isLocalFile())
+ return url().fileName();
+ else
+ return QL1S("rekonq");
+ }
+
+ return t;
}