1 /* 2 SPDX-FileCopyrightText: 2012-2021 Laurent Montel <montel@kde.org> 3 4 SPDX-License-Identifier: GPL-2.0-or-later 5 */ 6 7 #pragma once 8 9 #include "libimportwizard_export.h" 10 #include <QObject> 11 #include <qt5keychain/keychain.h> 12 class LIBIMPORTWIZARD_EXPORT ImportWizardSavePasswordJob : public QObject 13 { 14 Q_OBJECT 15 public: 16 explicit ImportWizardSavePasswordJob(QObject *parent = nullptr); 17 ~ImportWizardSavePasswordJob() override; 18 19 Q_REQUIRED_RESULT bool canStart() const; 20 21 void start(); 22 23 Q_REQUIRED_RESULT QString password() const; 24 void setPassword(const QString &password); 25 26 Q_REQUIRED_RESULT QString key() const; 27 void setKey(const QString &key); 28 29 Q_REQUIRED_RESULT QString name() const; 30 void setName(const QString &name); 31 32 private: 33 void slotPasswordWritten(QKeychain::Job *baseJob); 34 QString mPassword; 35 QString mKey; 36 QString mName; 37 }; 38 39