1// -*- c-basic-offset:4; indent-tabs-mode:nil -*-
2/*
3 This file is part of the KDE libraries
4 SPDX-FileCopyrightText: 2000 David Faure <faure@kde.org>
5 SPDX-FileCopyrightText: 2003 Alexander Kellett <lypanov@kde.org>
6 SPDX-FileCopyrightText: 2008 Norbert Frese <nf2@scheinwelt.at>
7
8 SPDX-License-Identifier: LGPL-2.0-only
9*/
10
11#include "kbookmarksettings_p.h"
12
13#include <KConfig>
14#include <KConfigGroup>
15
16KBookmarkSettings *KBookmarkSettings::s_self = nullptr;
17
18void KBookmarkSettings::readSettings()
19{
20 KConfig config(QStringLiteral("kbookmarkrc"), KConfig::NoGlobals);
21 KConfigGroup cg(&config, QStringLiteral("Bookmarks"));
22
23 // add bookmark dialog usage - no reparse
24 s_self->m_advancedaddbookmark = cg.readEntry(key: "AdvancedAddBookmarkDialog", defaultValue: false);
25
26 // this one alters the menu, therefore it needs a reparse
27 s_self->m_contextmenu = cg.readEntry(key: "ContextMenuActions", defaultValue: true);
28}
29
30KBookmarkSettings *KBookmarkSettings::self()
31{
32 if (!s_self) {
33 s_self = new KBookmarkSettings;
34 readSettings();
35 }
36 return s_self;
37}
38

source code of kbookmarks/src/kbookmarksettings.cpp