diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2012-10-23 17:26:08 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2012-12-10 02:48:05 +0100 |
commit | fcbe8fba1b0d197fb2711bdce5e01a2b7a3a8e56 (patch) | |
tree | 082f52276c3adcc16c0af30fb63813ac0f3322c5 | |
parent | Fix line changed by accident, restoring correct behavior on startup (diff) | |
download | rekonq-fcbe8fba1b0d197fb2711bdce5e01a2b7a3a8e56.tar.xz |
Fix tab titles managements on empty page titles
-rw-r--r-- | src/tabwindow/tabwindow.cpp | 11 | ||||
-rw-r--r-- | src/webwindow/webwindow.cpp | 11 |
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; } |