Fix copy notification

master
Lukas Fürmetz 9 years ago
parent 2f50e418b5
commit 82dde3eef9
  1. 2
      krunner_pass.notifyrc
  2. 6
      pass.cpp

@ -3,7 +3,7 @@ IconName=object-unlocked
Comment=Krunner integration for pass
Name=Pass
[Event/passwordunlocked]
[Event/password-unlocked]
Name=Password copied to clipboard
Comment=Password copied to clipboard
Action=Popup

@ -109,9 +109,11 @@ void Pass::run(const Plasma::RunnerContext &context, const Plasma::QueryMatch &m
Q_UNUSED(context);
auto ret = QProcess::execute(QString("pass -c ") + match.text());
QString msg = i18n("Password %1 copied to clipboard for %2 seconds", match.text(), timeout);
if (ret == 0) {
KNotification::event("passwordunlocked", msg);
QString msg = i18n("Password %1 copied to clipboard for %2 seconds", match.text(), timeout);
KNotification::event("password-unlocked", "Pass", msg,
"object-unlocked", nullptr, KNotification::CloseOnTimeout,
"krunner_pass");
}
}

Loading…
Cancel
Save