mirror of https://github.com/Qortal/Brooklyn
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
61 lines
1.3 KiB
61 lines
1.3 KiB
/* |
|
SPDX-FileCopyrightText: 2009 Jan Gerrit Marker <[email protected]> |
|
SPDX-FileCopyrightText: 2020 Alexander Lohnau <[email protected]> |
|
|
|
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL |
|
*/ |
|
|
|
#pragma once |
|
|
|
#include <QReadWriteLock> |
|
#include <QTimer> |
|
|
|
#include <KRunner/AbstractRunner> |
|
|
|
#include "config_keys.h" |
|
class QAction; |
|
|
|
namespace KSysGuard |
|
{ |
|
class Processes; |
|
class Process; |
|
} |
|
|
|
class KillRunner : public Plasma::AbstractRunner |
|
{ |
|
Q_OBJECT |
|
|
|
public: |
|
KillRunner(QObject *parent, const KPluginMetaData &metaData, const QVariantList &args); |
|
~KillRunner() override; |
|
|
|
void match(Plasma::RunnerContext &context) override; |
|
void run(const Plasma::RunnerContext &context, const Plasma::QueryMatch &match) override; |
|
void reloadConfiguration() override; |
|
|
|
private Q_SLOTS: |
|
void prep(); |
|
void cleanup(); |
|
|
|
private: |
|
/** The trigger word */ |
|
QString m_triggerWord; |
|
|
|
/** How to sort */ |
|
Sort m_sorting; |
|
|
|
/** process lister */ |
|
KSysGuard::Processes *m_processes; |
|
|
|
/** lock for initializing m_processes */ |
|
QReadWriteLock m_prepLock; |
|
|
|
/** timer for retrying the cleanup due to lock contention */ |
|
QTimer m_delayedCleanupTimer; |
|
|
|
/** Reuse actions */ |
|
QList<QAction *> m_actionList; |
|
|
|
/** Reuse value */ |
|
bool m_hasTrigger; |
|
};
|
|
|