┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/settings/dolphin_25.04_update_statusandlocationbarssettings.cpp
blob: 2188fcb82f45a7c34fe9d38f6d1833ff688ac917 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/*
    SPDX-FileCopyrightText: 2025 Akseli Lahtinen <[email protected]>

    SPDX-License-Identifier: GPL-2.0-or-later
*/

#include <KConfigGroup>
#include <KSharedConfig>

int main()
{
    const auto showStatusBar = QStringLiteral("ShowStatusBar");
    auto config = KSharedConfig::openConfig(QStringLiteral("dolphinrc"));

    KConfigGroup general = config->group(QStringLiteral("General"));
    if (!general.hasKey(showStatusBar)) {
        return EXIT_SUCCESS;
    }

    const auto value = general.readEntry(showStatusBar);
    if (value == QStringLiteral("true")) {
        general.writeEntry(showStatusBar, QStringLiteral("Small"));
    } else if (value == QStringLiteral("false")) {
        general.writeEntry(showStatusBar, QStringLiteral("Disabled"));
    }

    return general.sync() ? EXIT_SUCCESS : EXIT_FAILURE;
}