diff options
author | aqua <aqua@iserlohn-fortress.net> | 2022-08-14 18:47:37 +0300 |
---|---|---|
committer | aqua <aqua@iserlohn-fortress.net> | 2022-09-14 08:51:09 +0300 |
commit | c2d18d73b0e1a74525ec0cda36a2e2e7e5b4ff4c (patch) | |
tree | d5b9febb29ef801faa08fce4e56c4f453ddb38d0 /src/bookmarks/bookmarkmanager.cpp | |
parent | Add clazy cmake preset (diff) | |
download | rekonq-c2d18d73b0e1a74525ec0cda36a2e2e7e5b4ff4c.tar.xz |
Import BookmarkModel from poi
Diffstat (limited to 'src/bookmarks/bookmarkmanager.cpp')
-rw-r--r-- | src/bookmarks/bookmarkmanager.cpp | 81 |
1 files changed, 22 insertions, 59 deletions
diff --git a/src/bookmarks/bookmarkmanager.cpp b/src/bookmarks/bookmarkmanager.cpp index d8001819..1f406a04 100644 --- a/src/bookmarks/bookmarkmanager.cpp +++ b/src/bookmarks/bookmarkmanager.cpp @@ -1,80 +1,43 @@ /* ============================================================ -* -* This file is a part of the rekonq project -* -* Copyright (C) 2008-2012 by Andrea Diamantini <adjam7 at gmail dot com> -* Copyright (C) 2009 by Paweł Prażak <pawelprazak at gmail dot com> -* Copyright (C) 2009-2010 by Lionel Chauvin <megabigbug@yahoo.fr> -* Copyright (C) 2010 by Yoann Laissus <yoann dot laissus at gmail dot com> -* -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License as -* published by the Free Software Foundation; either version 2 of -* the License or (at your option) version 3 or any later version -* accepted by the membership of KDE e.V. (or its successor approved -* by the membership of KDE e.V.), which shall act as a proxy -* defined in Section 14 of version 3 of the license. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see <http://www.gnu.org/licenses/>. -* -* ============================================================ */ - + * The rekonq project + * ============================================================ + * SPDX-License-Identifier: GPL-2.0-or-later + * Copyright (C) 2008-2012 by Andrea Diamantini <adjam7 at gmail dot com> + * Copyright (C) 2009 by Paweł Prażak <pawelprazak at gmail dot com> + * Copyright (C) 2009-2010 by Lionel Chauvin <megabigbug@yahoo.fr> + * Copyright (C) 2010 by Yoann Laissus <yoann dot laissus at gmail dot com> + * SPDX-License-Identifier: GPL-3.0-only + * Copyright (C) 2022 aqua <aqua@iserlohn-fortress.net> + * ============================================================ + * Description: rekonq bookmarks system interface + * ============================================================ */ // Self Includes -#include "bookmarkmanager.h" -#include "bookmarkmanager.moc" - -// Local Includes -#include "application.h" - +#include "bookmarkmanager.hpp" +#include "bookmarkowner.h" #include "bookmarksmenu.h" #include "bookmarkstoolbar.h" -#include "bookmarkowner.h" - -#include "iconmanager.h" - -// KDE Includes -#include <KActionCollection> -#include <KStandardDirs> - -// Qt Includes -#include <QtCore/QFile> - +#include <QFile> +#include <QStandardPaths> +#include <memory> // ---------------------------------------------------------------------------------------------- - -QWeakPointer<BookmarkManager> BookmarkManager::s_bookmarkManager; - +static std::unique_ptr<BookmarkManager> s_bookmarkManager = nullptr; BookmarkManager *BookmarkManager::self() { - if (s_bookmarkManager.isNull()) - { - s_bookmarkManager = new BookmarkManager(qApp); - } - return s_bookmarkManager.data(); + if (!s_bookmarkManager) { s_bookmarkManager = new BookmarkManager(qApp); } + return *s_bookmarkManager; } // ---------------------------------------------------------------------------------------------- - -BookmarkManager::BookmarkManager(QObject *parent) - : QObject(parent) - , m_manager(0) - , m_owner(0) - , m_actionCollection(new KActionCollection(this)) +BookmarkManager::BookmarkManager(QObject *parent) : QObject(parent) { m_manager = KBookmarkManager::userBookmarksManager(); - const QString bookmarksFile = KStandardDirs::locateLocal("data", QString::fromLatin1("konqueror/bookmarks.xml")); + const auto bookmarksFile = QStandardPaths::locate(AppLocalDataLocation, QString::fromLatin1("bookmarks.xbel")); if (!QFile::exists(bookmarksFile)) { |