From 681360f3fbad57a4abebde11e65cd4fa831c24b9 Mon Sep 17 00:00:00 2001 From: Alexander Lohnau Date: Sun, 3 Nov 2024 08:55:13 +0100 Subject: [PATCH] Clang format config --- CMakeLists.txt | 1 + src/jetbrainsdolphinplugin.cpp | 28 +++++++++++++--------------- src/jetbrainsdolphinplugin.h | 8 ++++---- 3 files changed, 18 insertions(+), 19 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7c33d63..6e110df 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,6 +12,7 @@ set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_MODULE_PATH}) include(KDEInstallDirs) include(KDECMakeSettings) include(QtVersionOption) +include(KDEClangFormat) include(KDECompilerSettings NO_POLICY_SCOPE) include(FeatureSummary) diff --git a/src/jetbrainsdolphinplugin.cpp b/src/jetbrainsdolphinplugin.cpp index 9bd0d2f..02d4b5e 100644 --- a/src/jetbrainsdolphinplugin.cpp +++ b/src/jetbrainsdolphinplugin.cpp @@ -1,6 +1,6 @@ /* * Copyright 2020 - * + * * 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 @@ -8,26 +8,26 @@ * 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 . */ #include "jetbrainsdolphinplugin.h" -#include #include +#include +#include +#include +#include #include #include -#include #include -#include -#include #include "jetbrains-api/export.h" @@ -38,9 +38,9 @@ inline bool containsPath(JetbrainsApplication *app, const QString &path) }); } -JetBrainsDolphinPlugin::JetBrainsDolphinPlugin(QObject *parent, const QVariantList &/*args*/) +JetBrainsDolphinPlugin::JetBrainsDolphinPlugin(QObject *parent, const QVariantList & /*args*/) : KAbstractFileItemActionPlugin(parent) - ,jetbrainsIcon(QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral("jetbrainsdolphinplugin/jetbrains.png"))) + , jetbrainsIcon(QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral("jetbrainsdolphinplugin/jetbrains.png"))) { } @@ -62,8 +62,7 @@ QList JetBrainsDolphinPlugin::actions(const KFileItemListProperties & if (QDir(projectPath + "/.idea").exists()) { // Only now the apps have to be loaded - const auto config = KSharedConfig::openConfig(QStringLiteral("krunnerplugins/jetbrainsrunnerrc")) - ->group("Config"); + const auto config = KSharedConfig::openConfig(QStringLiteral("krunnerplugins/jetbrainsrunnerrc"))->group("Config"); apps = JetbrainsAPI::fetchApplications(config, false, false); QList actionList; @@ -80,7 +79,7 @@ QList JetBrainsDolphinPlugin::actions(const KFileItemListProperties & // If the project was not opened in the other ides, add them in submenu if (actionList.size() != apps.size()) { auto *menuAction = new KActionMenu(this); - qWarning()<< QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral("icons/jetbrains.png")); + qWarning() << QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral("icons/jetbrains.png")); menuAction->setIcon(jetbrainsIcon); menuAction->setText(QStringLiteral("Jetbrains")); for (int i = 0; i < apps.count(); ++i) { @@ -108,15 +107,14 @@ void JetBrainsDolphinPlugin::openIDE(JetbrainsApplication *app) KService service(app->desktopFilePath); KIO::DesktopExecParser p(service, QList{QUrl::fromLocalFile(projectPath)}); QStringList exec = p.resultingArguments(); - auto job = new KIO::CommandLauncherJob(exec.takeFirst(),exec); + auto job = new KIO::CommandLauncherJob(exec.takeFirst(), exec); job->start(); } QList JetBrainsDolphinPlugin::getDefaultActions() { // Because the folder has no subfolder called .idea we can be sure that it is not a project - const auto config = KSharedConfig::openConfig(QStringLiteral("krunnerplugins/jetbrainsrunnerrc")) - ->group("Config"); + const auto config = KSharedConfig::openConfig(QStringLiteral("krunnerplugins/jetbrainsrunnerrc"))->group("Config"); apps = JetbrainsAPI::fetchRawApplications(config); // create default menu auto *menuAction = new KActionMenu(this); diff --git a/src/jetbrainsdolphinplugin.h b/src/jetbrainsdolphinplugin.h index 748b45f..e777772 100644 --- a/src/jetbrainsdolphinplugin.h +++ b/src/jetbrainsdolphinplugin.h @@ -8,12 +8,12 @@ * 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 . */ @@ -27,9 +27,9 @@ class JetbrainsApplication; -class JetBrainsDolphinPlugin: public KAbstractFileItemActionPlugin +class JetBrainsDolphinPlugin : public KAbstractFileItemActionPlugin { -Q_OBJECT + Q_OBJECT public: explicit JetBrainsDolphinPlugin(QObject *parent, const QVariantList &args);