/****************************************************************************** * Copyright (C) 2017 by Lukas Fürmetz * * * * This library 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 3 of the License or (at * * your option) any later version. * * * * This library 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 * * Library General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this library; see the file LICENSE. * * If not, see . * *****************************************************************************/ #ifndef PASS_H #define PASS_H #include #include #include #include class Pass : public Plasma::AbstractRunner { Q_OBJECT public: Pass(QObject *parent, const QVariantList &args); ~Pass() override; void clip(const QString &msg); void match(Plasma::RunnerContext &) override; void run(const Plasma::RunnerContext &, const Plasma::QueryMatch &) override; QList actionsForMatch(const Plasma::QueryMatch &) override; void reloadConfiguration() override; public slots: void reinitPasswords(const QString &path); protected: void init() override; void initPasswords(); void showNotification(const QString &, const QString & = QString()); private: QDir baseDir; QString passOtpIdentifier; int timeout; QReadWriteLock lock; QList passwords; QFileSystemWatcher watcher; bool showActions; QList orderedActions; bool showOnlyPrefixed; QLatin1String queryPrefix = QLatin1String("pass"); }; #endif