summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libkonq/konqbookmarkmanager.h16
1 files 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 <kbookmarkmanager.h>
#include <kstandarddirs.h>
+#include <kurl.h>
+#include <tdeio/job.h>
#include <libkonq_export.h>
+#include <tdeapplication.h>
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;