[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kdelibs/KDE/4.10] kio/bookmarks: Set toolbar attribute on root, do not create empty bookmarks.xml.t
From: Stefan_Brüns <stefan.bruens () rwth-aachen ! de>
Date: 2012-09-30 21:10:48
Message-ID: 20120930211048.229B0A605D () git ! kde ! org
[Download RAW message or body]
Git commit 92d2484a4b0ba692a78faa83ceca851a6511f4f5 by Stefan Brüns.
Committed on 30/09/2012 at 22:55.
Pushed by bruns into branch 'KDE/4.10'.
Set toolbar attribute on root, do not create empty bookmarks.xml.tbcache
If no toolbar attribute is set on any folder (including root), an
empty document is saved for .tbcache. Setting toolbar=yes on root
element during first lookup avoids this problem, and has the nice
side effect of speeding up any future findToolbar() invocations.
M +7 -2 kio/bookmarks/kbookmarkmanager.cc
http://commits.kde.org/kdelibs/92d2484a4b0ba692a78faa83ceca851a6511f4f5
diff --git a/kio/bookmarks/kbookmarkmanager.cc b/kio/bookmarks/kbookmarkmanager.cc
index d8a9cb7..940cffd 100644
--- a/kio/bookmarks/kbookmarkmanager.cc
+++ b/kio/bookmarks/kbookmarkmanager.cc
@@ -502,9 +502,14 @@ KBookmarkGroup KBookmarkManager::toolbar()
// is already loaded
QDomElement elem = root().findToolbar();
if (elem.isNull())
- return root(); // Root is the bookmark toolbar if none has been set.
+ {
+ // Root is the bookmark toolbar if none has been set.
+ // Make it explicit to speed up invocations of findToolbar()
+ root().internalElement().setAttribute("toolbar", "yes");
+ return root();
+ }
else
- return KBookmarkGroup(root().findToolbar());
+ return KBookmarkGroup(elem);
}
KBookmark KBookmarkManager::findByAddress( const QString & address )
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic