Skip to content

Commit e58e240

Browse files
committed
Minor improvements
1 parent 64d56db commit e58e240

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 2.8.12)
22

33
project(KWalletRunner)
44

5-
set(KF5_VERSION "5.24.0")
5+
set(KF5_VERSION "5.44.0")
66
find_package(ECM ${KF5_VERSION} REQUIRED NO_MODULE)
77
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
88

src/kwalletrunner.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ KWalletRunner::KWalletRunner(QObject *parent, const QVariantList &args) :
2323

2424
// Open the wallet
2525
wallet = Wallet::openWallet(Wallet::LocalWallet(), 0, Wallet::Synchronous);
26-
validWallet = Wallet::isEnabled() && wallet;
2726

2827
auto *overview = addAction(QStringLiteral("overview"),
2928
QIcon::fromTheme(QStringLiteral("documentinfo")),
@@ -35,20 +34,22 @@ KWalletRunner::KWalletRunner(QObject *parent, const QVariantList &args) :
3534
edit->setData(QStringLiteral("edit"));
3635
actions = {overview, edit};
3736

37+
const bool validWallet = Wallet::isEnabled() && wallet;
3838
if (!validWallet || !wallet->isOpen()) {
3939
KNotification::event(KNotification::Error,
4040
QStringLiteral("KWallet"),
4141
QStringLiteral("Could not open KWallet!"),
4242
QStringLiteral("kwallet"));
4343
}
44+
matchingSuspended(!validWallet);
4445
}
4546

4647
KWalletRunner::~KWalletRunner() {
4748
delete wallet;
4849
}
4950

5051
void KWalletRunner::match(Plasma::RunnerContext &context) {
51-
if (!validWallet || !context.isValid() || !wallet->isOpen()) {
52+
if (!context.isValid() || !wallet->isOpen()) {
5253
return;
5354
}
5455

@@ -117,7 +118,7 @@ void KWalletRunner::run(const Plasma::RunnerContext &context, const Plasma::Quer
117118
return;
118119
}
119120
}
120-
QTimer::singleShot(0, data, [data]() {
121+
QTimer::singleShot(0, [data]() {
121122
EditDialog addDialog;
122123
addDialog.init(data);
123124
addDialog.exec();
@@ -166,7 +167,7 @@ QList<QAction *> KWalletRunner::actionsForMatch(const Plasma::QueryMatch &match)
166167
void KWalletRunner::setClipboardPassword(const QString &password) {
167168
QClipboard *cb = QApplication::clipboard();
168169
cb->setText(password);
169-
QTimer::singleShot(5000, cb, [cb]() {
170+
QTimer::singleShot(5000, [cb]() {
170171
// Clipboard managers might cause the clear function to not work properly
171172
cb->setText(QString());
172173
});

src/kwalletrunner.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ Q_OBJECT
3333
const QLatin1String defaultMatchId = QLatin1String("kwalletrunner");
3434
const QRegularExpression addRegex = QRegularExpression(QStringLiteral("^kwallet-add ?"));
3535
const QRegularExpression shortAddRegex = QRegularExpression(QStringLiteral("^kwl-add ?"));
36-
bool validWallet;
3736
};
3837

3938
#endif /* KWALLETRUNNER_H */

src/plasma-runner-kwallet.desktop

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,6 @@ X-KDE-Library=krunner_kwallet
7373
X-KDE-PluginInfo-Author=alex1701c
7474
X-KDE-PluginInfo-Email=alex1701c.dev@gmx.net
7575
X-KDE-PluginInfo-Name=kwalletrunner
76-
X-KDE-PluginInfo-Version=0.1
76+
X-KDE-PluginInfo-Version=1.0.0
7777
X-KDE-PluginInfo-License=GPL
7878
X-KDE-PluginInfo-EnabledByDefault=true

0 commit comments

Comments
 (0)