diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2010-05-24 16:44:59 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2010-05-24 16:44:59 +0200 |
commit | ec1a1da63dd2d8504522360e2bf4583c164a0968 (patch) | |
tree | ccf500edc79fc6ae5088ce6c226d429f9a5ed582 /src | |
parent | Merge commit 'refs/merge-requests/2270' of git://gitorious.org/rekonq/mainlin... (diff) | |
parent | listitem: when the title of an item is empty fallback to domain name of the url. (diff) | |
download | rekonq-ec1a1da63dd2d8504522360e2bf4583c164a0968.tar.xz |
Merge commit 'refs/merge-requests/2271' of git://gitorious.org/rekonq/mainline into m2271
Diffstat (limited to 'src')
-rw-r--r-- | src/urlbar/listitem.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/urlbar/listitem.cpp b/src/urlbar/listitem.cpp index f91840d2..5254c7dc 100644 --- a/src/urlbar/listitem.cpp +++ b/src/urlbar/listitem.cpp @@ -220,7 +220,16 @@ PreviewListItem::PreviewListItem(const UrlSearchItem &item, const QString &text, QVBoxLayout *vLayout = new QVBoxLayout; vLayout->setMargin(0); - vLayout->addWidget(new TextLabel(item.title, text, this)); + + QString title = item.title; + if (title.isEmpty()) + { + title = item.url.url(); + title = title.remove("http://"); + title.truncate(title.indexOf("/")); + } + + vLayout->addWidget(new TextLabel(title, text, this)); vLayout->addWidget(new TextLabel("<i>" + item.url.url() + "</i>", text, this)); hLayout->addLayout(vLayout); |