summaryrefslogtreecommitdiff
path: root/src/bookmarks/bookmarkmanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/bookmarks/bookmarkmanager.cpp')
-rw-r--r--src/bookmarks/bookmarkmanager.cpp81
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))
{