Assistant: Make "Bookmarks Menu" the default bookmarks folder
authorAlexander Volkov <a.volkov@rusbitech.ru>
Thu, 18 Sep 2014 14:31:40 +0000 (18:31 +0400)
committerAlexander Volkov <a.volkov@rusbitech.ru>
Thu, 16 Oct 2014 19:50:21 +0000 (21:50 +0200)
Assistant doesn't show the bookmarks toolbar by default so it's more
reasonable to preselect the "Bookmarks Menu" folder when a user adds
a bookmark.

Change-Id: If1b92c1decb280e96e5c58a56d6948eec6e44813
Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
src/assistant/assistant/bookmarkdialog.cpp

index ac7fd44..14132d1 100644 (file)
@@ -84,8 +84,7 @@ BookmarkDialog::BookmarkDialog(BookmarkModel *sourceModel, const QString &title,
     connect(ui.treeView->selectionModel(), SIGNAL(currentChanged(QModelIndex,
         QModelIndex)), this, SLOT(currentIndexChanged(QModelIndex)));
 
-    ui.bookmarkFolders->setCurrentIndex(0);
-    ui.treeView->setCurrentIndex(ui.treeView->indexAt(QPoint(2, 2)));
+    ui.bookmarkFolders->setCurrentIndex(ui.bookmarkFolders->count() > 1 ? 1 : 0);
 
     const HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance();
     if (helpEngine.usesAppFont())