Skip to content

Commit

Permalink
Clang format config
Browse files Browse the repository at this point in the history
  • Loading branch information
alex1701c committed Nov 3, 2024
1 parent 44fc229 commit 681360f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 19 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
28 changes: 13 additions & 15 deletions src/jetbrainsdolphinplugin.cpp
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
/*
* Copyright 2020 <Alex1701c> <[email protected]>
*
*
* 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
* the License or (at your option) version 3 or any later version
* 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 <http://www.gnu.org/licenses/>.
*/

#include "jetbrainsdolphinplugin.h"

#include <KPluginFactory>
#include <KActionMenu>
#include <KIO/CommandLauncherJob>
#include <KIO/DesktopExecParser>
#include <KPluginFactory>
#include <KService>
#include <KSharedConfig>
#include <KShell>
#include <KService>
#include <QDir>
#include <KIO/CommandLauncherJob>
#include <KIO/DesktopExecParser>

#include "jetbrains-api/export.h"

Expand All @@ -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")))
{
}

Expand All @@ -62,8 +62,7 @@ QList<QAction *> 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<QAction *> actionList;
Expand All @@ -80,7 +79,7 @@ QList<QAction *> 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) {
Expand Down Expand Up @@ -108,15 +107,14 @@ void JetBrainsDolphinPlugin::openIDE(JetbrainsApplication *app)
KService service(app->desktopFilePath);
KIO::DesktopExecParser p(service, QList<QUrl>{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<QAction *> 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);
Expand Down
8 changes: 4 additions & 4 deletions src/jetbrainsdolphinplugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <http://www.gnu.org/licenses/>.
*/
Expand All @@ -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);
Expand Down

0 comments on commit 681360f

Please sign in to comment.