Skip to content

Commit

Permalink
remove deprecated methods
Browse files Browse the repository at this point in the history
  • Loading branch information
russelltg committed Aug 14, 2021
1 parent b0dcae7 commit 26e72f9
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
cmake_minimum_required(VERSION 3.10)
cmake_minimum_required(VERSION 3.21)
cmake_policy(SET CMP0057 NEW)

project(chigraph-gui)

Expand Down
22 changes: 13 additions & 9 deletions src/thememanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include <KColorScheme>
#include <KConfigGroup>
#include <KIO/CommandLauncherJob>
#include <KLocalizedString>
#include <KMessageBox>
#include <KSharedConfig>
Expand Down Expand Up @@ -60,16 +61,19 @@ ThemeManager::ThemeManager(KActionMenu* menu) : mMenu{menu} {
auto configAct = new QAction(i18n("Configuration..."), mMenu);
configAct->setIcon(QIcon::fromTheme(QStringLiteral("preferences-desktop-theme")));
mMenu->addAction(configAct);
connect(configAct, &QAction::triggered, this, [] {
connect(configAct, &QAction::triggered, this, [this] {
// open the colors dialog
int errCode = KToolInvocation::kdeinitExec(QStringLiteral("kcmshell5"),
QStringList(QStringLiteral("colors")));

if (errCode > 0) {
KMessageBox::error(0,
i18n("Cannot start Colors Settings panel from KDE Control Center. "
"Please check your system..."));
}
auto job = new KIO::CommandLauncherJob(QStringLiteral("kcmshell5 colors"));
job->setAutoDelete(true);
job->start();

connect(job, &KIO::CommandLauncherJob::finished, this, [](KJob* job) {
if (job->error() != 0) {
KMessageBox::error(
0, i18n("Cannot start Colors Settings panel from KDE Control Center. "
"Please check your system..."));
}
});
});
}

Expand Down
2 changes: 1 addition & 1 deletion third_party/nodeeditor

0 comments on commit 26e72f9

Please sign in to comment.