Changeset View
Changeset View
Standalone View
Standalone View
src/dolphinbookmarkhandler.cpp
Show All 15 Lines | |||||
16 | * Free Software Foundation, Inc., * | 16 | * Free Software Foundation, Inc., * | ||
17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * | 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * | ||
18 | ***************************************************************************/ | 18 | ***************************************************************************/ | ||
19 | 19 | | |||
20 | #include "dolphinbookmarkhandler.h" | 20 | #include "dolphinbookmarkhandler.h" | ||
21 | #include "dolphinmainwindow.h" | 21 | #include "dolphinmainwindow.h" | ||
22 | #include "dolphinviewcontainer.h" | 22 | #include "dolphinviewcontainer.h" | ||
23 | #include "global.h" | 23 | #include "global.h" | ||
24 | #include <KActionCollection> | ||||
24 | #include <KBookmarkMenu> | 25 | #include <KBookmarkMenu> | ||
25 | #include <KIO/Global> | 26 | #include <KIO/Global> | ||
26 | #include <QDebug> | 27 | #include <QDebug> | ||
27 | #include <QDir> | 28 | #include <QDir> | ||
28 | #include <QStandardPaths> | 29 | #include <QStandardPaths> | ||
29 | 30 | | |||
30 | DolphinBookmarkHandler::DolphinBookmarkHandler(DolphinMainWindow *mainWindow, | 31 | DolphinBookmarkHandler::DolphinBookmarkHandler(DolphinMainWindow *mainWindow, | ||
31 | KActionCollection* collection, | 32 | KActionCollection* collection, | ||
Show All 10 Lines | 42 | if (genericDataLocation.isEmpty()) { | |||
42 | qWarning() << "GenericDataLocation is empty! Bookmarks will not be saved correctly."; | 43 | qWarning() << "GenericDataLocation is empty! Bookmarks will not be saved correctly."; | ||
43 | } | 44 | } | ||
44 | bookmarksFile = QStringLiteral("%1/dolphin").arg(genericDataLocation); | 45 | bookmarksFile = QStringLiteral("%1/dolphin").arg(genericDataLocation); | ||
45 | QDir().mkpath(bookmarksFile); | 46 | QDir().mkpath(bookmarksFile); | ||
46 | bookmarksFile += QLatin1String("/bookmarks.xml"); | 47 | bookmarksFile += QLatin1String("/bookmarks.xml"); | ||
47 | } | 48 | } | ||
48 | m_bookmarkManager = KBookmarkManager::managerForFile(bookmarksFile, QStringLiteral("dolphin")); | 49 | m_bookmarkManager = KBookmarkManager::managerForFile(bookmarksFile, QStringLiteral("dolphin")); | ||
49 | m_bookmarkManager->setUpdate(true); | 50 | m_bookmarkManager->setUpdate(true); | ||
50 | m_bookmarkMenu.reset(new KBookmarkMenu(m_bookmarkManager, this, menu, collection)); | 51 | m_bookmarkMenu.reset(new KBookmarkMenu(m_bookmarkManager, this, menu)); | ||
52 | | ||||
53 | collection->addAction(QStringLiteral("add_bookmark"), m_bookmarkMenu->addBookmarkAction()); | ||||
54 | collection->addAction(QStringLiteral("edit_bookmarks"), m_bookmarkMenu->editBookmarksAction()); | ||||
55 | collection->addAction(QStringLiteral("add_bookmarks_list"), m_bookmarkMenu->bookmarkTabsAsFolderAction()); | ||||
51 | } | 56 | } | ||
52 | 57 | | |||
53 | DolphinBookmarkHandler::~DolphinBookmarkHandler() | 58 | DolphinBookmarkHandler::~DolphinBookmarkHandler() | ||
54 | { | 59 | { | ||
55 | } | 60 | } | ||
56 | 61 | | |||
57 | QString DolphinBookmarkHandler::currentTitle() const | 62 | QString DolphinBookmarkHandler::currentTitle() const | ||
58 | { | 63 | { | ||
▲ Show 20 Lines • Show All 72 Lines • Show Last 20 Lines |