File indexing completed on 2024-04-28 03:52:41

0001 // -*- c-basic-offset:4; indent-tabs-mode:nil -*-
0002 /*
0003     This file is part of the KDE libraries
0004     SPDX-FileCopyrightText: 2000 David Faure <faure@kde.org>
0005     SPDX-FileCopyrightText: 2003 Alexander Kellett <lypanov@kde.org>
0006     SPDX-FileCopyrightText: 2008 Norbert Frese <nf2@scheinwelt.at>
0007 
0008     SPDX-License-Identifier: LGPL-2.0-only
0009 */
0010 
0011 #include "kbookmarksettings_p.h"
0012 
0013 #include <KConfig>
0014 #include <KConfigGroup>
0015 
0016 KBookmarkSettings *KBookmarkSettings::s_self = nullptr;
0017 
0018 void KBookmarkSettings::readSettings()
0019 {
0020     KConfig config(QStringLiteral("kbookmarkrc"), KConfig::NoGlobals);
0021     KConfigGroup cg(&config, QStringLiteral("Bookmarks"));
0022 
0023     // add bookmark dialog usage - no reparse
0024     s_self->m_advancedaddbookmark = cg.readEntry("AdvancedAddBookmarkDialog", false);
0025 
0026     // this one alters the menu, therefore it needs a reparse
0027     s_self->m_contextmenu = cg.readEntry("ContextMenuActions", true);
0028 }
0029 
0030 KBookmarkSettings *KBookmarkSettings::self()
0031 {
0032     if (!s_self) {
0033         s_self = new KBookmarkSettings;
0034         readSettings();
0035     }
0036     return s_self;
0037 }