diff options
author | Yoann Laissus <yoann.laissus@gmail.com> | 2012-08-10 12:08:55 +0200 |
---|---|---|
committer | Yoann Laissus <yoann.laissus@gmail.com> | 2012-08-10 12:08:55 +0200 |
commit | e3591fc1126add9c122eb1921ffb87948ab04af6 (patch) | |
tree | 08a0cbf41600eaf24ea62d5aab31578d851eaf7c /src/urlbar/bookmarkwidget.cpp | |
parent | Add an icon for the toolbar root entry in the BookmarkWidget (diff) | |
download | rekonq-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
Diffstat (limited to 'src/urlbar/bookmarkwidget.cpp')
-rw-r--r-- | src/urlbar/bookmarkwidget.cpp | 20 |
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); } |