From e96ee72ff00de1de77dd4a50fca83cea15d5b549 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Tue, 17 Jun 2014 13:04:01 +0900 Subject: =?UTF-8?q?Added=20code=20to=20copy=20global=20bookmarks=20from=20?= =?UTF-8?q?/opt/trinity/share/apps/konqueror/bookmarks.xml=20to=20$HOME/.t?= =?UTF-8?q?rinity/share/apps/konqueror/bookmarks.xml=20if=20the=20user=20h?= =?UTF-8?q?as=20no=20personal=20bookmarks.=20This=20allows=20giving=20defa?= =?UTF-8?q?ult=20bookmarks=20to=20the=20users=20upon=20first=20konqueror?= =?UTF-8?q?=20startup.=20Thanks=20to=20Fran=C3=A7ois=20Andriot=20for=20the?= =?UTF-8?q?=20original=20patch,=20which=20had=20to=20be=20fixed=20in=20ord?= =?UTF-8?q?er=20to=20get=20this=20to=20work=20correctly.=20This=20relates?= =?UTF-8?q?=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(-) (limited to 'libkonq') 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; -- cgit v1.2.1