From e96ee72ff00de1de77dd4a50fca83cea15d5b549 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Tue, 17 Jun 2014 13:04:01 +0900 Subject: [PATCH] =?UTF-8?q?Added=20code=20to=20copy=20global=20bookmarks?= =?UTF-8?q?=20from=20/opt/trinity/share/apps/konqueror/bookmarks.xml=20to?= =?UTF-8?q?=20$HOME/.trinity/share/apps/konqueror/bookmarks.xml=20if=20the?= =?UTF-8?q?=20user=20has=20no=20personal=20bookmarks.=20This=20allows=20gi?= =?UTF-8?q?ving=20default=20bookmarks=20to=20the=20users=20upon=20first=20?= =?UTF-8?q?konqueror=20startup.=20Thanks=20to=20Fran=C3=A7ois=20Andriot=20?= =?UTF-8?q?for=20the=20original=20patch,=20which=20had=20to=20be=20fixed?= =?UTF-8?q?=20in=20order=20to=20get=20this=20to=20work=20correctly.=20This?= =?UTF-8?q?=20relates=20to=20bug=201499.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libkonq/konqbookmarkmanager.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/libkonq/konqbookmarkmanager.h b/libkonq/konqbookmarkmanager.h index 9774d92e9..88ff45ced 100644 --- a/libkonq/konqbookmarkmanager.h +++ b/libkonq/konqbookmarkmanager.h @@ -3,15 +3,27 @@ #include #include +#include +#include #include +#include class LIBKONQ_EXPORT KonqBookmarkManager { public: - static KBookmarkManager * self() { + static KBookmarkManager * self() + { if ( !s_bookmarkManager ) { - TQString bookmarksFile = locateLocal("data", TQString::fromLatin1("konqueror/bookmarks.xml")); + TQString globalBookmarkFile = locate( "data", TQString::fromLatin1( "konqueror/bookmarks.xml" ) ); + TQString bookmarksFile = locateLocal( "data", TQString::fromLatin1("konqueror/bookmarks.xml" ), true); + if (globalBookmarkFile != TQString::null && bookmarksFile != TQString::null && + globalBookmarkFile != bookmarksFile) + { + TDEIO::file_copy(KURL::fromPathOrURL(globalBookmarkFile), + KURL::fromPathOrURL(bookmarksFile)); + kapp->processEvents(3000); // Allows up to 3 seconds to copy the file + } s_bookmarkManager = KBookmarkManager::managerForFile( bookmarksFile ); } return s_bookmarkManager;