summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYoann Laissus <yoann.laissus@gmail.com>2012-08-10 12:08:55 +0200
committerYoann Laissus <yoann.laissus@gmail.com>2012-08-10 12:08:55 +0200
commite3591fc1126add9c122eb1921ffb87948ab04af6 (patch)
tree08a0cbf41600eaf24ea62d5aab31578d851eaf7c
parentAdd an icon for the toolbar root entry in the BookmarkWidget (diff)
downloadrekonq-e3591fc1126add9c122eb1921ffb87948ab04af6.tar.xz
BookmarkWidget:
- Don't display an empty entry if the bookmark is in the root folder - Improve the code to choose the current index
-rw-r--r--src/urlbar/bookmarkwidget.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/urlbar/bookmarkwidget.cpp b/src/urlbar/bookmarkwidget.cpp
index 6026cb20..2a91f333 100644
--- a/src/urlbar/bookmarkwidget.cpp
+++ b/src/urlbar/bookmarkwidget.cpp
@@ -256,7 +256,14 @@ void BookmarkWidget::setupFolderComboBox()
if (m_bookmark->parentGroup().address() != toolBarRoot.address())
{
- m_folder->addItem(m_bookmark->parentGroup().text(),
+ QString parentText = m_bookmark->parentGroup().text();
+
+ if (m_bookmark->parentGroup().address() == root.address())
+ {
+ parentText = i18n("Root folder");
+ }
+
+ m_folder->addItem(parentText,
m_bookmark->parentGroup().address());
m_folder->insertSeparator(3);
}
@@ -269,15 +276,8 @@ void BookmarkWidget::setupFolderComboBox()
}
}
- if (m_bookmark->parentGroup().address() == toolBarRoot.address())
- {
- m_folder->setCurrentIndex(0);
- }
- else
- {
- int index = m_folder->findText(m_bookmark->parentGroup().text());
- m_folder->setCurrentIndex(index);
- }
+ int index = m_folder->findData(m_bookmark->parentGroup().address());
+ m_folder->setCurrentIndex(index);
}