[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kdelibs/KDE/4.12] kio/bookmarks: When a user creates a new bookmark folder make that the current it
From:       Dawit Alemayehu <adawit () kde ! org>
Date:       2013-12-24 14:49:59
Message-ID: E1VvTJ1-0000RS-G7 () scm ! kde ! org
[Download RAW message or body]

Git commit 2d83344174fe956dd6df0be6c96e068e5186371c by Dawit Alemayehu.
Committed on 15/12/2013 at 16:25.
Pushed by adawit into branch 'KDE/4.12'.

When a user creates a new bookmark folder make that the current item.

BUG: 152158
REVIEW: 114479
FIXED-IN: 4.12.1

M  +14   -7    kio/bookmarks/kbookmarkdialog.cc
M  +3    -0    kio/bookmarks/kbookmarkdialog.h

http://commits.kde.org/kdelibs/2d83344174fe956dd6df0be6c96e068e5186371c

diff --git a/kio/bookmarks/kbookmarkdialog.cc b/kio/bookmarks/kbookmarkdialog.cc
index 713ceff..de2ed47 100644
--- a/kio/bookmarks/kbookmarkdialog.cc
+++ b/kio/bookmarks/kbookmarkdialog.cc
@@ -343,18 +343,25 @@ void KBookmarkDialog::newFolderButton()
         m_mgr->emitChanged( parentGroup );
         m_folderTree->clear();
         QTreeWidgetItem *root = new KBookmarkTreeItem(m_folderTree);
-        fillGroup( root, m_mgr->root() );
+        fillGroup(root, m_mgr->root(), group);
     }
 }
 
 void KBookmarkDialog::fillGroup( QTreeWidgetItem * parentItem, const KBookmarkGroup \
&group)  {
-  for ( KBookmark bk = group.first() ; !bk.isNull() ; bk = group.next(bk) )
-  {
-    if ( bk.isGroup() )
-    {
-      QTreeWidgetItem* item = new KBookmarkTreeItem(parentItem, m_folderTree, \
                bk.toGroup() );
-      fillGroup( item, bk.toGroup() );
+  fillGroup(parentItem, group, KBookmarkGroup());
+}
+
+void KBookmarkDialog::fillGroup(QTreeWidgetItem* parentItem, const KBookmarkGroup& \
group, const KBookmarkGroup& selectGroup) +{
+  for (KBookmark bk = group.first() ; !bk.isNull() ; bk = group.next(bk)) {
+    if (bk.isGroup()) {
+      const KBookmarkGroup bkGroup = bk.toGroup();
+      QTreeWidgetItem* item = new KBookmarkTreeItem(parentItem, m_folderTree, \
bkGroup); +      if (selectGroup == bkGroup) {
+        m_folderTree->setCurrentItem(item);
+      }
+      fillGroup(item, bkGroup, selectGroup);
     }
   }
 }
diff --git a/kio/bookmarks/kbookmarkdialog.h b/kio/bookmarks/kbookmarkdialog.h
index a746c22..b9db8aa 100644
--- a/kio/bookmarks/kbookmarkdialog.h
+++ b/kio/bookmarks/kbookmarkdialog.h
@@ -131,6 +131,9 @@ protected:
 
 protected Q_SLOTS:
   void newFolderButton();
+
+private:
+  void fillGroup(QTreeWidgetItem* parentItem, const KBookmarkGroup& group, const \
KBookmarkGroup& selectGroup);  };
 
 #endif


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic