diff options
-rw-r--r-- | data/CMakeLists.txt | 6 | ||||
-rw-r--r-- | src/bookmarks.cpp | 24 |
2 files changed, 28 insertions, 2 deletions
diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt index 41c9995f..4a17e30d 100644 --- a/data/CMakeLists.txt +++ b/data/CMakeLists.txt @@ -1,9 +1,13 @@ INSTALL( FILES - defaultbookmarks.xbel loading.gif DESTINATION ${DATA_INSTALL_DIR}/rekonq/pics ) +INSTALL( FILES + defaultbookmarks.xbel + DESTINATION ${DATA_INSTALL_DIR}/rekonq +) + INSTALL( FILES rekonq.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} diff --git a/src/bookmarks.cpp b/src/bookmarks.cpp index 1066e3ce..6b6d549c 100644 --- a/src/bookmarks.cpp +++ b/src/bookmarks.cpp @@ -20,16 +20,22 @@ -// Local Includes +// Self Includes #include "bookmarks.h" #include "bookmarks.moc" +// Local Includes #include "mainwindow.h" #include "webview.h" // KDE Includes #include <KMimeType> #include <KMenu> +#include <KStandardDirs> +#include <KDebug> + +// Qt Includes +#include <QFile> OwnBookMarks::OwnBookMarks(KMainWindow *parent) : QObject(parent) @@ -85,6 +91,22 @@ BookmarksProvider::BookmarksProvider(KMainWindow* parent) , m_bmToolbar(0) { KUrl bookfile = KUrl( "~/.kde/share/apps/konqueror/bookmarks.xml" ); // share konqueror bookmarks + + if (!QFile::exists( bookfile.path() ) ) + { + bookfile = KUrl( "~/.kde4/share/apps/konqueror/bookmarks.xml" ); + if (!QFile::exists( bookfile.path() ) ) + { + QString bookmarksDefaultPath = KStandardDirs::locate("appdata" , "defaultbookmarks.xbel"); + kWarning() << bookmarksDefaultPath; + QFile bkms(bookmarksDefaultPath); + QString bookmarksPath = KStandardDirs::locateLocal("appdata", "bookmarks.xml", true); + bookmarksPath.replace("rekonq", "konqueror"); + bkms.copy(bookmarksPath); + + bookfile = KUrl( bookmarksPath ); + } + } m_manager = KBookmarkManager::managerForExternalFile( bookfile.path() ); m_ac = new KActionCollection( this ); } |