Page Menu
Home
GnuPG
Search
Configure Global Search
Log In
Files
F36276320
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Size
160 KB
Subscribers
None
View Options
diff --git a/src/commands/command.h b/src/commands/command.h
index 40a0b036f..830d71632 100644
--- a/src/commands/command.h
+++ b/src/commands/command.h
@@ -1,140 +1,140 @@
/* -*- mode: c++; c-basic-offset:4 -*-
commands/command.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2007 Klarälvdalens Datakonsult AB
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include <QObject>
#include <qwindowdefs.h> // for WId
-#include <utils/pimpl_ptr.h>
#include <utils/types.h> // for ExecutionContext
+#include <memory>
#include <vector>
class QModelIndex;
template<typename T>
class QList;
class QAbstractItemView;
namespace GpgME
{
class Key;
}
namespace Kleo
{
class KeyListController;
class AbstractKeyListSortFilterProxyModel;
class Command : public QObject, public ExecutionContext
{
Q_OBJECT
public:
explicit Command(KeyListController *parent);
explicit Command(QAbstractItemView *view, KeyListController *parent);
explicit Command(const GpgME::Key &key);
explicit Command(const std::vector<GpgME::Key> &keys);
~Command() override;
enum Restriction {
// clang-format off
NoRestriction = 0x0000,
NeedSelection = 0x0001,
OnlyOneKey = 0x0002,
NeedSecretKey = 0x0004, //< command performs secret key operations
NeedSecretPrimaryKeyData = 0x0008, //< command needs access to the secret key data of the primary key
NeedSecretSubkeyData = 0x0010, //< command needs access to the secret key data of one or more subkeys
// esoteric:
MayOnlyBeSecretKeyIfOwnerTrustIsNotYetUltimate = 0x0040, // for set-owner-trust
AnyCardHasNullPin = 0x0080,
MustBeRoot = 0x0200,
MustBeTrustedRoot = 0x0400 | MustBeRoot,
MustBeUntrustedRoot = 0x0800 | MustBeRoot,
MustBeValid = 0x1000, //< key is neither revoked nor expired nor otherwise "bad"
MustBeOpenPGP = 0x2000,
MustBeCMS = 0x4000,
_AllRestrictions_Helper,
AllRestrictions = 2 * (_AllRestrictions_Helper - 1) - 1,
// clang-format on
};
Q_DECLARE_FLAGS(Restrictions, Restriction)
static Restrictions restrictions()
{
return NoRestriction;
}
/** Classify the files and return the most appropriate commands.
*
* @param files: A list of files.
*
* @returns null QString on success. Error message otherwise.
*/
static QList<Command *> commandsForFiles(const QStringList &files, KeyListController *controller);
/** Get a command for a query.
*
* @param query: A keyid / fingerprint or any string to use in the search.
*/
static Command *commandForQuery(const QString &query);
void setParentWidget(QWidget *widget);
void setParentWId(WId wid);
void setView(QAbstractItemView *view);
void setKey(const GpgME::Key &key);
void setKeys(const std::vector<GpgME::Key> &keys);
void setAutoDelete(bool on);
bool autoDelete() const;
void setWarnWhenRunningAtShutdown(bool warn);
bool warnWhenRunningAtShutdown() const;
public Q_SLOTS:
void start();
void cancel();
Q_SIGNALS:
void info(const QString &message, int timeout = 0);
void progress(int current, int total);
void finished();
void canceled();
private:
virtual void doStart() = 0;
virtual void doCancel() = 0;
private:
void applyWindowID(QWidget *wid) const override;
protected:
void addTemporaryView(const QString &title, AbstractKeyListSortFilterProxyModel *proxy = nullptr, const QString &tabToolTip = QString());
protected:
class Private;
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
protected:
explicit Command(Private *pp);
explicit Command(QAbstractItemView *view, Private *pp);
explicit Command(const std::vector<GpgME::Key> &keys, Private *pp);
explicit Command(const GpgME::Key &key, Private *pp);
};
}
Q_DECLARE_OPERATORS_FOR_FLAGS(Kleo::Command::Restrictions)
diff --git a/src/conf/appearanceconfigwidget.h b/src/conf/appearanceconfigwidget.h
index 585e1ac89..47723bdd5 100644
--- a/src/conf/appearanceconfigwidget.h
+++ b/src/conf/appearanceconfigwidget.h
@@ -1,59 +1,59 @@
/*
appearanceconfigwidget.h
This file is part of kleopatra, the KDE key manager
SPDX-FileCopyrightText: 2002, 2004, 2008 Klarälvdalens Datakonsult AB
SPDX-FileCopyrightText: 2002, 2003 Marc Mutz <mutz@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include <QWidget>
-#include <utils/pimpl_ptr.h>
+#include <memory>
namespace Kleo
{
namespace Config
{
class AppearanceConfigWidget : public QWidget
{
Q_OBJECT
public:
explicit AppearanceConfigWidget(QWidget *parent = nullptr, Qt::WindowFlags f = {});
~AppearanceConfigWidget() override;
void load();
void save();
void defaults();
Q_SIGNALS:
void changed();
private:
class Private;
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
Q_PRIVATE_SLOT(d, void slotIconClicked())
#ifndef QT_NO_COLORDIALOG
Q_PRIVATE_SLOT(d, void slotForegroundClicked())
Q_PRIVATE_SLOT(d, void slotBackgroundClicked())
#endif
#ifndef QT_NO_FONTDIALOG
Q_PRIVATE_SLOT(d, void slotFontClicked())
#endif
Q_PRIVATE_SLOT(d, void slotSelectionChanged())
Q_PRIVATE_SLOT(d, void slotDefaultClicked())
Q_PRIVATE_SLOT(d, void slotItalicToggled(bool))
Q_PRIVATE_SLOT(d, void slotBoldToggled(bool))
Q_PRIVATE_SLOT(d, void slotStrikeOutToggled(bool))
Q_PRIVATE_SLOT(d, void slotTooltipValidityChanged(bool))
Q_PRIVATE_SLOT(d, void slotTooltipDetailsChanged(bool))
Q_PRIVATE_SLOT(d, void slotTooltipOwnerChanged(bool))
Q_PRIVATE_SLOT(d, void slotUseTagsChanged(bool))
};
}
}
diff --git a/src/conf/cryptooperationsconfigwidget.h b/src/conf/cryptooperationsconfigwidget.h
index 0fc9fa8e3..a40557432 100644
--- a/src/conf/cryptooperationsconfigwidget.h
+++ b/src/conf/cryptooperationsconfigwidget.h
@@ -1,65 +1,63 @@
/*
cryptooperationsconfigwidget.h
This file is part of kleopatra, the KDE key manager
SPDX-FileCopyrightText: 2010 Klarälvdalens Datakonsult AB
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include "labelledwidget.h"
#include <QWidget>
-#include <utils/pimpl_ptr.h>
-
class QCheckBox;
class QComboBox;
class QBoxLayout;
class QPushButton;
namespace Kleo
{
class FileOperationsPreferences;
class Settings;
class ClassifyConfig;
namespace Config
{
class CryptoOperationsConfigWidget : public QWidget
{
Q_OBJECT
public:
explicit CryptoOperationsConfigWidget(QWidget *parent = nullptr, Qt::WindowFlags f = {});
~CryptoOperationsConfigWidget() override;
void load();
void save();
void defaults();
Q_SIGNALS:
void changed();
private:
void setupGui();
void load(const Kleo::FileOperationsPreferences &filePrefs, const Kleo::Settings &settings, const Kleo::ClassifyConfig &classifyConfig);
private:
QCheckBox *mPGPFileExtCB = nullptr;
QCheckBox *mTreatP7mEmailCB = nullptr;
QCheckBox *mAutoDecryptVerifyCB = nullptr;
QCheckBox *mAutoExtractArchivesCB = nullptr;
QCheckBox *mASCIIArmorCB = nullptr;
QCheckBox *mTmpDirCB = nullptr;
QCheckBox *mSymmetricOnlyCB = nullptr;
Kleo::LabelledWidget<QComboBox> mChecksumDefinitionCB;
Kleo::LabelledWidget<QComboBox> mArchiveDefinitionCB;
QPushButton *mApplyBtn = nullptr;
};
}
}
diff --git a/src/conf/smimevalidationconfigurationwidget.h b/src/conf/smimevalidationconfigurationwidget.h
index 374158702..9a40d9c74 100644
--- a/src/conf/smimevalidationconfigurationwidget.h
+++ b/src/conf/smimevalidationconfigurationwidget.h
@@ -1,41 +1,41 @@
/* -*- mode: c++; c-basic-offset:4 -*-
conf/smimevalidationconfigurationwidget.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2008 Klarälvdalens Datakonsult AB
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include <QWidget>
-#include <utils/pimpl_ptr.h>
+#include <memory>
namespace Kleo
{
namespace Config
{
class SMimeValidationConfigurationWidget : public QWidget
{
Q_OBJECT
public:
explicit SMimeValidationConfigurationWidget(QWidget *parent = nullptr, Qt::WindowFlags f = {});
~SMimeValidationConfigurationWidget() override;
void load();
void save() const;
void defaults();
Q_SIGNALS:
void changed();
private:
class Private;
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
};
}
}
diff --git a/src/crypto/autodecryptverifyfilescontroller.h b/src/crypto/autodecryptverifyfilescontroller.h
index 9d5d10d9e..ac6861683 100644
--- a/src/crypto/autodecryptverifyfilescontroller.h
+++ b/src/crypto/autodecryptverifyfilescontroller.h
@@ -1,54 +1,54 @@
/* -*- mode: c++; c-basic-offset:4 -*-
autodecryptverifyfilescontroller.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2008 Klarälvdalens Datakonsult AB
SPDX-FileCopyrightText: 2016 Bundesamt für Sicherheit in der Informationstechnik
SPDX-FileContributor: Intevation GmbH
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include "crypto/decryptverifyfilescontroller.h"
#include <utils/types.h>
#include <memory>
#include <vector>
namespace Kleo
{
namespace Crypto
{
class AutoDecryptVerifyFilesController : public DecryptVerifyFilesController
{
Q_OBJECT
public:
explicit AutoDecryptVerifyFilesController(QObject *parent = nullptr);
explicit AutoDecryptVerifyFilesController(const std::shared_ptr<const ExecutionContext> &ctx, QObject *parent = nullptr);
~AutoDecryptVerifyFilesController() override;
void setFiles(const QStringList &files) override;
void setOperation(DecryptVerifyOperation op) override;
DecryptVerifyOperation operation() const override;
void start() override;
public Q_SLOTS:
void cancel() override;
private:
void doTaskDone(const Task *task, const std::shared_ptr<const Task::Result> &) override;
private:
class Private;
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
Q_PRIVATE_SLOT(d, void schedule())
};
}
}
diff --git a/src/crypto/certificateresolver.h b/src/crypto/certificateresolver.h
index 4671161c3..d0750e521 100644
--- a/src/crypto/certificateresolver.h
+++ b/src/crypto/certificateresolver.h
@@ -1,79 +1,79 @@
/* -*- mode: c++; c-basic-offset:4 -*-
crypto/certificateresolver.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2007 Klarälvdalens Datakonsult AB
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
-#include <utils/pimpl_ptr.h>
-
#include <KMime/Types>
#include <gpgme++/key.h>
#include <KSharedConfig>
+#include <memory>
+
class KConfig;
namespace GpgME
{
class Key;
}
namespace Kleo
{
namespace Crypto
{
class SigningPreferences
{
public:
virtual ~SigningPreferences()
{
}
virtual GpgME::Key preferredCertificate(GpgME::Protocol protocol) = 0;
virtual void setPreferredCertificate(GpgME::Protocol protocol, const GpgME::Key &certificate) = 0;
};
class RecipientPreferences
{
public:
virtual ~RecipientPreferences()
{
}
virtual GpgME::Key preferredCertificate(const KMime::Types::Mailbox &recipient, GpgME::Protocol protocol) = 0;
virtual void setPreferredCertificate(const KMime::Types::Mailbox &recipient, GpgME::Protocol protocol, const GpgME::Key &certificate) = 0;
};
class KConfigBasedRecipientPreferences : public RecipientPreferences
{
public:
explicit KConfigBasedRecipientPreferences(const KSharedConfigPtr &config);
~KConfigBasedRecipientPreferences() override;
GpgME::Key preferredCertificate(const KMime::Types::Mailbox &recipient, GpgME::Protocol protocol) override;
void setPreferredCertificate(const KMime::Types::Mailbox &recipient, GpgME::Protocol protocol, const GpgME::Key &certificate) override;
private:
Q_DISABLE_COPY(KConfigBasedRecipientPreferences)
class Private;
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
};
class KConfigBasedSigningPreferences : public SigningPreferences
{
public:
explicit KConfigBasedSigningPreferences(const KSharedConfigPtr &config);
~KConfigBasedSigningPreferences() override;
GpgME::Key preferredCertificate(GpgME::Protocol protocol) override;
void setPreferredCertificate(GpgME::Protocol protocol, const GpgME::Key &certificate) override;
private:
Q_DISABLE_COPY(KConfigBasedSigningPreferences)
class Private;
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
};
}
}
diff --git a/src/crypto/controller.h b/src/crypto/controller.h
index c20f15787..c0ae730dd 100644
--- a/src/crypto/controller.h
+++ b/src/crypto/controller.h
@@ -1,76 +1,75 @@
/* -*- mode: c++; c-basic-offset:4 -*-
crypto/controller.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2008 Klarälvdalens Datakonsult AB
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include <QObject>
#include <crypto/task.h>
-#include <utils/pimpl_ptr.h>
#include <utils/types.h>
#include <memory>
namespace Kleo
{
namespace Crypto
{
class Controller : public QObject, protected ExecutionContextUser
{
Q_OBJECT
public:
explicit Controller(QObject *parent = nullptr);
explicit Controller(const std::shared_ptr<const ExecutionContext> &cmd, QObject *parent = nullptr);
~Controller() override;
using ExecutionContextUser::setExecutionContext;
Q_SIGNALS:
void progress(int current, int total, const QString &what);
protected:
void emitDoneOrError();
void setLastError(int err, const QString &details);
void connectTask(const std::shared_ptr<Task> &task);
virtual void doTaskDone(const Task *task, const std::shared_ptr<const Task::Result> &result);
protected Q_SLOTS:
void taskDone(const std::shared_ptr<const Kleo::Crypto::Task::Result> &);
Q_SIGNALS:
/**
* Private signal, you can connect to it, but derived classes cannot emit it.
*/
void error(int err,
const QString &details
#ifndef DOXYGEN_SHOULD_SKIP_THIS
,
QPrivateSignal
#endif
);
/**
* Private signal, you can connect to it, but derived classes cannot emit it.
*/
void done(
#ifndef DOXYGEN_SHOULD_SKIP_THIS
QPrivateSignal
#endif
);
private:
class Private;
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
};
}
}
diff --git a/src/crypto/createchecksumscontroller.h b/src/crypto/createchecksumscontroller.h
index 7374a66db..4940c586b 100644
--- a/src/crypto/createchecksumscontroller.h
+++ b/src/crypto/createchecksumscontroller.h
@@ -1,52 +1,50 @@
/* -*- mode: c++; c-basic-offset:4 -*-
crypto/createchecksumscontroller.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2010 Klarälvdalens Datakonsult AB
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include <crypto/controller.h>
-#include <utils/pimpl_ptr.h>
-
#include <gpgme++/global.h>
#include <memory>
#include <vector>
namespace Kleo
{
namespace Crypto
{
class CreateChecksumsController : public Controller
{
Q_OBJECT
public:
explicit CreateChecksumsController(QObject *parent = nullptr);
explicit CreateChecksumsController(const std::shared_ptr<const ExecutionContext> &ctx, QObject *parent = nullptr);
~CreateChecksumsController() override;
void setAllowAddition(bool allow);
bool allowAddition() const;
void setFiles(const QStringList &files);
void start();
public Q_SLOTS:
void cancel();
private:
class Private;
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
Q_PRIVATE_SLOT(d, void slotOperationFinished())
Q_PRIVATE_SLOT(d, void slotProgress(int, int, QString))
};
}
}
diff --git a/src/crypto/decryptverifyemailcontroller.h b/src/crypto/decryptverifyemailcontroller.h
index 8f9c68311..c7e1b14bf 100644
--- a/src/crypto/decryptverifyemailcontroller.h
+++ b/src/crypto/decryptverifyemailcontroller.h
@@ -1,90 +1,90 @@
/* -*- mode: c++; c-basic-offset:4 -*-
decryptverifyemailcontroller.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2008 Klarälvdalens Datakonsult AB
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include <crypto/controller.h>
#include <utils/types.h>
#include <gpgme++/global.h>
#include <QMetaType>
#include <memory>
#include <vector>
#include <gpgme++/verificationresult.h>
namespace KMime
{
namespace Types
{
class Mailbox;
}
}
namespace Kleo
{
class Input;
class Output;
namespace Crypto
{
class DecryptVerifyEMailController : public Controller
{
Q_OBJECT
public:
explicit DecryptVerifyEMailController(QObject *parent = nullptr);
explicit DecryptVerifyEMailController(const std::shared_ptr<const ExecutionContext> &cmd, QObject *parent = nullptr);
~DecryptVerifyEMailController() override;
void setInput(const std::shared_ptr<Input> &input);
void setInputs(const std::vector<std::shared_ptr<Input>> &inputs);
void setSignedData(const std::shared_ptr<Input> &data);
void setSignedData(const std::vector<std::shared_ptr<Input>> &data);
void setOutput(const std::shared_ptr<Output> &output);
void setOutputs(const std::vector<std::shared_ptr<Output>> &outputs);
void setInformativeSenders(const std::vector<KMime::Types::Mailbox> &senders);
void setWizardShown(bool shown);
void setOperation(DecryptVerifyOperation operation);
void setVerificationMode(VerificationMode vm);
void setProtocol(GpgME::Protocol protocol);
void setSessionId(unsigned int id);
void start();
public Q_SLOTS:
void cancel();
Q_SIGNALS:
void verificationResult(const GpgME::VerificationResult &);
private:
void doTaskDone(const Task *task, const std::shared_ptr<const Task::Result> &result) override;
class Private;
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
Q_PRIVATE_SLOT(d, void slotWizardCanceled())
Q_PRIVATE_SLOT(d, void schedule())
};
} // namespace Crypto
} // namespace Kleo
Q_DECLARE_METATYPE(GpgME::VerificationResult)
diff --git a/src/crypto/decryptverifytask.h b/src/crypto/decryptverifytask.h
index eeecc7baa..1bf79e60a 100644
--- a/src/crypto/decryptverifytask.h
+++ b/src/crypto/decryptverifytask.h
@@ -1,276 +1,276 @@
/* -*- mode: c++; c-basic-offset:4 -*-
decryptverifytask.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2008 Klarälvdalens Datakonsult AB
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include "task.h"
#include <utils/types.h>
#include <gpgme++/verificationresult.h>
#include <memory>
namespace KMime
{
namespace Types
{
class Mailbox;
}
}
namespace GpgME
{
class DecryptionResult;
class VerificationResult;
class Key;
class Signature;
}
namespace QGpgME
{
class Job;
}
namespace Kleo
{
class Input;
class Output;
class AuditLogEntry;
}
namespace Kleo
{
namespace Crypto
{
class DecryptVerifyResult;
class AbstractDecryptVerifyTask : public Task
{
Q_OBJECT
public:
explicit AbstractDecryptVerifyTask(QObject *parent = nullptr);
~AbstractDecryptVerifyTask() override;
virtual void autodetectProtocolFromInput() = 0;
KMime::Types::Mailbox informativeSender() const;
void setInformativeSender(const KMime::Types::Mailbox &senders);
virtual QString inputLabel() const = 0;
virtual QString outputLabel() const = 0;
public Q_SLOTS:
void cancel() override;
protected:
std::shared_ptr<DecryptVerifyResult> fromDecryptResult(const GpgME::DecryptionResult &dr, const QByteArray &plaintext, const AuditLogEntry &auditLog);
std::shared_ptr<DecryptVerifyResult> fromDecryptResult(const GpgME::Error &err, const QString &details, const AuditLogEntry &auditLog);
std::shared_ptr<DecryptVerifyResult> fromDecryptVerifyResult(const GpgME::DecryptionResult &dr,
const GpgME::VerificationResult &vr,
const QByteArray &plaintext,
const QString &fileName,
const AuditLogEntry &auditLog);
std::shared_ptr<DecryptVerifyResult> fromDecryptVerifyResult(const GpgME::Error &err, const QString &what, const AuditLogEntry &auditLog);
std::shared_ptr<DecryptVerifyResult>
fromVerifyOpaqueResult(const GpgME::VerificationResult &vr, const QByteArray &plaintext, const AuditLogEntry &auditLog);
std::shared_ptr<DecryptVerifyResult> fromVerifyOpaqueResult(const GpgME::Error &err, const QString &details, const AuditLogEntry &auditLog);
std::shared_ptr<DecryptVerifyResult> fromVerifyDetachedResult(const GpgME::VerificationResult &vr, const AuditLogEntry &auditLog);
std::shared_ptr<DecryptVerifyResult> fromVerifyDetachedResult(const GpgME::Error &err, const QString &details, const AuditLogEntry &auditLog);
public:
// public to allow access from the Private classes of the concrete tasks
QGpgME::Job *job() const;
void setJob(QGpgME::Job *job);
private:
class Private;
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
};
class DecryptTask : public AbstractDecryptVerifyTask
{
Q_OBJECT
public:
explicit DecryptTask(QObject *parent = nullptr);
~DecryptTask() override;
void setInput(const std::shared_ptr<Input> &input);
void setOutput(const std::shared_ptr<Output> &output);
void setProtocol(GpgME::Protocol prot);
void autodetectProtocolFromInput() override;
QString label() const override;
GpgME::Protocol protocol() const override;
QString inputLabel() const override;
QString outputLabel() const override;
private:
void doStart() override;
unsigned long long inputSize() const override;
private:
class Private;
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
Q_PRIVATE_SLOT(d, void slotResult(GpgME::DecryptionResult, QByteArray))
};
class VerifyDetachedTask : public AbstractDecryptVerifyTask
{
Q_OBJECT
public:
explicit VerifyDetachedTask(QObject *parent = nullptr);
~VerifyDetachedTask() override;
void setInput(const std::shared_ptr<Input> &input);
void setSignedData(const std::shared_ptr<Input> &signedData);
void setSignatureFile(const QString &path);
void setSignedFile(const QString &path);
void setProtocol(GpgME::Protocol prot);
void autodetectProtocolFromInput() override;
QString label() const override;
GpgME::Protocol protocol() const override;
QString inputLabel() const override;
QString outputLabel() const override;
private:
void doStart() override;
unsigned long long inputSize() const override;
private:
class Private;
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
Q_PRIVATE_SLOT(d, void slotResult(GpgME::VerificationResult))
};
class VerifyOpaqueTask : public AbstractDecryptVerifyTask
{
Q_OBJECT
public:
explicit VerifyOpaqueTask(QObject *parent = nullptr);
~VerifyOpaqueTask() override;
void setInput(const std::shared_ptr<Input> &input);
void setOutput(const std::shared_ptr<Output> &output);
void setProtocol(GpgME::Protocol prot);
void autodetectProtocolFromInput() override;
QString label() const override;
GpgME::Protocol protocol() const override;
void setExtractArchive(bool extract);
void setInputFile(const QString &path);
// for files
void setOutputFile(const QString &path);
// for archives
void setOutputDirectory(const QString &directory);
QString inputLabel() const override;
QString outputLabel() const override;
private:
void doStart() override;
unsigned long long inputSize() const override;
private:
class Private;
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
Q_PRIVATE_SLOT(d, void slotResult(GpgME::VerificationResult, QByteArray))
};
class DecryptVerifyTask : public AbstractDecryptVerifyTask
{
Q_OBJECT
public:
explicit DecryptVerifyTask(QObject *parent = nullptr);
~DecryptVerifyTask() override;
void setInput(const std::shared_ptr<Input> &input);
void setOutput(const std::shared_ptr<Output> &output);
void setProtocol(GpgME::Protocol prot);
void autodetectProtocolFromInput() override;
QString label() const override;
GpgME::Protocol protocol() const override;
void setIgnoreMDCError(bool value);
void setExtractArchive(bool extract);
void setInputFile(const QString &path);
// for files
void setOutputFile(const QString &path);
// for archives
void setOutputDirectory(const QString &directory);
QString inputLabel() const override;
QString outputLabel() const override;
private:
void doStart() override;
unsigned long long inputSize() const override;
private:
class Private;
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
Q_PRIVATE_SLOT(d, void slotResult(GpgME::DecryptionResult, GpgME::VerificationResult, QByteArray))
};
class DecryptVerifyResult : public Task::Result
{
friend class ::Kleo::Crypto::AbstractDecryptVerifyTask;
public:
class SenderInfo;
QString overview() const override;
QString details() const override;
GpgME::Error error() const override;
QString errorString() const override;
VisualCode code() const override;
AuditLogEntry auditLog() const override;
QPointer<Task> parentTask() const override;
Task::Result::ContentType viewableContentType() const override;
GpgME::VerificationResult verificationResult() const;
GpgME::DecryptionResult decryptionResult() const;
QString fileName() const;
private:
DecryptVerifyResult();
DecryptVerifyResult(const DecryptVerifyResult &);
DecryptVerifyResult &operator=(const DecryptVerifyResult &other);
DecryptVerifyResult(DecryptVerifyOperation op,
const GpgME::VerificationResult &vr,
const GpgME::DecryptionResult &dr,
const QByteArray &stuff,
const QString &fileName,
const GpgME::Error &error,
const QString &errString,
const QString &inputLabel,
const QString &outputLabel,
const AuditLogEntry &auditLog,
Task *parentTask,
const KMime::Types::Mailbox &informativeSender);
private:
class Private;
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
};
}
}
diff --git a/src/crypto/encryptemailcontroller.h b/src/crypto/encryptemailcontroller.h
index 5cf82fbe3..525f67b1b 100644
--- a/src/crypto/encryptemailcontroller.h
+++ b/src/crypto/encryptemailcontroller.h
@@ -1,85 +1,83 @@
/* -*- mode: c++; c-basic-offset:4 -*-
crypto/encryptemailcontroller.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2007 Klarälvdalens Datakonsult AB
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include <crypto/controller.h>
-#include <utils/pimpl_ptr.h>
-
#include <gpgme++/global.h>
#include <memory>
#include <vector>
namespace KMime
{
namespace Types
{
class Mailbox;
}
}
namespace Kleo
{
class Input;
class Output;
namespace Crypto
{
class EncryptEMailController : public Controller
{
Q_OBJECT
public:
enum Mode {
GpgOLMode,
ClipboardMode,
NumModes
};
explicit EncryptEMailController(Mode mode, QObject *parent = nullptr);
explicit EncryptEMailController(const std::shared_ptr<ExecutionContext> &xc, Mode mode, QObject *parent = nullptr);
~EncryptEMailController() override;
Mode mode() const;
static const char *mementoName()
{
return "EncryptEMailController";
}
void setProtocol(GpgME::Protocol proto);
const char *protocolAsString();
GpgME::Protocol protocol();
void startResolveRecipients();
void setInputAndOutput(const std::shared_ptr<Kleo::Input> &input, const std::shared_ptr<Kleo::Output> &output);
void setInputsAndOutputs(const std::vector<std::shared_ptr<Kleo::Input>> &inputs, const std::vector<std::shared_ptr<Kleo::Output>> &outputs);
void start();
public Q_SLOTS:
void cancel();
Q_SIGNALS:
void recipientsResolved();
private:
void doTaskDone(const Task *task, const std::shared_ptr<const Kleo::Crypto::Task::Result> &) override;
class Private;
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
};
} // Crypto
} // Kleo
diff --git a/src/crypto/encryptemailtask.h b/src/crypto/encryptemailtask.h
index c25329523..c39108f38 100644
--- a/src/crypto/encryptemailtask.h
+++ b/src/crypto/encryptemailtask.h
@@ -1,64 +1,62 @@
/* -*- mode: c++; c-basic-offset:4 -*-
crypto/encryptemailtask.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2007 Klarälvdalens Datakonsult AB
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include <crypto/task.h>
-#include <utils/pimpl_ptr.h>
-
#include <gpgme++/global.h>
#include <memory>
#include <vector>
namespace GpgME
{
class Key;
}
namespace Kleo
{
class Input;
class Output;
}
namespace Kleo
{
namespace Crypto
{
class EncryptEMailTask : public Task
{
Q_OBJECT
public:
explicit EncryptEMailTask(QObject *parent = nullptr);
~EncryptEMailTask() override;
void setInput(const std::shared_ptr<Input> &input);
void setOutput(const std::shared_ptr<Output> &output);
void setRecipients(const std::vector<GpgME::Key> &recipients);
GpgME::Protocol protocol() const override;
void cancel() override;
QString label() const override;
private:
void doStart() override;
unsigned long long inputSize() const override;
private:
class Private;
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
Q_PRIVATE_SLOT(d, void slotResult(const GpgME::EncryptionResult &))
};
}
}
diff --git a/src/crypto/gui/decryptverifyfileswizard.h b/src/crypto/gui/decryptverifyfileswizard.h
index 9560938f1..1a8dd253b 100644
--- a/src/crypto/gui/decryptverifyfileswizard.h
+++ b/src/crypto/gui/decryptverifyfileswizard.h
@@ -1,62 +1,60 @@
/* -*- mode: c++; c-basic-offset:4 -*-
crypto/gui/decryptverifyfileswizard.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2007 Klarälvdalens Datakonsult AB
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include <crypto/gui/wizard.h>
-#include <utils/pimpl_ptr.h>
-
#include <memory>
namespace Kleo
{
namespace Crypto
{
class Task;
class TaskCollection;
namespace Gui
{
class DecryptVerifyOperationWidget;
class DecryptVerifyFilesWizard : public Wizard
{
Q_OBJECT
public:
enum Page {
OperationsPage = 0,
ResultPage,
};
explicit DecryptVerifyFilesWizard(QWidget *parent = nullptr, Qt::WindowFlags f = {});
~DecryptVerifyFilesWizard() override;
void setOutputDirectory(const QString &dir);
QString outputDirectory() const;
bool useOutputDirectory() const;
void setTaskCollection(const std::shared_ptr<TaskCollection> &coll);
DecryptVerifyOperationWidget *operationWidget(unsigned int idx);
Q_SIGNALS:
void operationPrepared();
private:
void onNext(int id) override;
private:
class Private;
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
};
}
}
}
diff --git a/src/crypto/gui/decryptverifyoperationwidget.h b/src/crypto/gui/decryptverifyoperationwidget.h
index dcf0a1f64..d255da8f9 100644
--- a/src/crypto/gui/decryptverifyoperationwidget.h
+++ b/src/crypto/gui/decryptverifyoperationwidget.h
@@ -1,71 +1,69 @@
/* -*- mode: c++; c-basic-offset:4 -*-
crypto/gui/decryptverifyoperationwidget.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2007 Klarälvdalens Datakonsult AB
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include <QWidget>
-#include <utils/pimpl_ptr.h>
-
#include <memory>
#include <vector>
namespace Kleo
{
class ArchiveDefinition;
}
namespace Kleo
{
namespace Crypto
{
namespace Gui
{
class DecryptVerifyOperationWidget : public QWidget
{
Q_OBJECT
Q_ENUMS(Mode)
Q_PROPERTY(Mode mode READ mode WRITE setMode)
Q_PROPERTY(QString inputFileName READ inputFileName WRITE setInputFileName)
Q_PROPERTY(QString signedDataFileName READ signedDataFileName WRITE setSignedDataFileName)
public:
explicit DecryptVerifyOperationWidget(QWidget *parent = nullptr);
~DecryptVerifyOperationWidget() override;
enum Mode {
VerifyDetachedWithSignature,
VerifyDetachedWithSignedData,
DecryptVerifyOpaque,
};
void setMode(Mode mode, const std::shared_ptr<ArchiveDefinition> &ad);
void setMode(Mode mode);
Mode mode() const;
void setInputFileName(const QString &name);
QString inputFileName() const;
void setSignedDataFileName(const QString &name);
QString signedDataFileName() const;
void setArchiveDefinitions(const std::vector<std::shared_ptr<ArchiveDefinition>> &ads);
std::shared_ptr<ArchiveDefinition> selectedArchiveDefinition() const;
Q_SIGNALS:
void changed();
private:
class Private;
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
Q_PRIVATE_SLOT(d, void enableDisableWidgets())
};
}
}
}
diff --git a/src/crypto/gui/newresultpage.h b/src/crypto/gui/newresultpage.h
index faf900f3d..0121a8e99 100644
--- a/src/crypto/gui/newresultpage.h
+++ b/src/crypto/gui/newresultpage.h
@@ -1,59 +1,57 @@
/* -*- mode: c++; c-basic-offset:4 -*-
crypto/gui/newresultpage.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2008, 2009 Klarälvdalens Datakonsult AB
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include <QWizardPage>
-#include <utils/pimpl_ptr.h>
-
#include <memory>
namespace Kleo
{
namespace Crypto
{
class TaskCollection;
class Task;
}
}
namespace Kleo
{
namespace Crypto
{
namespace Gui
{
class NewResultPage : public QWizardPage
{
Q_OBJECT
public:
explicit NewResultPage(QWidget *parent = nullptr);
~NewResultPage() override;
void setTaskCollection(const std::shared_ptr<TaskCollection> &coll);
void addTaskCollection(const std::shared_ptr<TaskCollection> &coll);
bool isComplete() const override;
Q_SIGNALS:
void linkActivated(const QString &link);
private:
class Private;
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
Q_PRIVATE_SLOT(d, void result(std::shared_ptr<const Kleo::Crypto::Task::Result>))
Q_PRIVATE_SLOT(d, void started(std::shared_ptr<Kleo::Crypto::Task>))
Q_PRIVATE_SLOT(d, void allDone())
};
}
}
}
diff --git a/src/crypto/gui/objectspage.h b/src/crypto/gui/objectspage.h
index 96f95caff..26c2b786c 100644
--- a/src/crypto/gui/objectspage.h
+++ b/src/crypto/gui/objectspage.h
@@ -1,46 +1,46 @@
/* -*- mode: c++; c-basic-offset:4 -*-
crypto/gui/objectspage.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2007 Klarälvdalens Datakonsult AB
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include <crypto/gui/wizardpage.h>
-#include <utils/pimpl_ptr.h>
-
#include <QStringList>
+#include <memory>
+
namespace Kleo
{
namespace Crypto
{
namespace Gui
{
class ObjectsPage : public WizardPage
{
Q_OBJECT
public:
explicit ObjectsPage(QWidget *parent = nullptr, Qt::WindowFlags f = {});
~ObjectsPage() override;
bool isComplete() const override;
void setFiles(const QStringList &files);
QStringList files() const;
private:
class Private;
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
Q_PRIVATE_SLOT(d, void add())
Q_PRIVATE_SLOT(d, void remove())
Q_PRIVATE_SLOT(d, void listSelectionChanged())
};
}
}
}
diff --git a/src/crypto/gui/resolverecipientspage.h b/src/crypto/gui/resolverecipientspage.h
index 867a33b09..b176e8b4d 100644
--- a/src/crypto/gui/resolverecipientspage.h
+++ b/src/crypto/gui/resolverecipientspage.h
@@ -1,101 +1,99 @@
/* -*- mode: c++; c-basic-offset:4 -*-
crypto/gui/resolverecipientspage.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2007 Klarälvdalens Datakonsult AB
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include <crypto/gui/wizardpage.h>
-#include <utils/pimpl_ptr.h>
-
#include <gpgme++/global.h>
#include <memory>
#include <vector>
namespace GpgME
{
class Key;
}
namespace KMime
{
namespace Types
{
class Mailbox;
}
}
namespace Kleo
{
namespace Crypto
{
class RecipientPreferences;
namespace Gui
{
class ResolveRecipientsPage : public WizardPage
{
Q_OBJECT
public:
explicit ResolveRecipientsPage(QWidget *parent = nullptr);
~ResolveRecipientsPage() override;
bool isComplete() const override;
/**
* The protocol selected by the user (which is chosen by
* the user in case none was preset)
*/
GpgME::Protocol selectedProtocol() const;
/**
* the protocol set before the dialog is shown. Defaults to
* GpgME::UnknownProtocol */
GpgME::Protocol presetProtocol() const;
void setPresetProtocol(GpgME::Protocol protocol);
bool multipleProtocolsAllowed() const;
void setMultipleProtocolsAllowed(bool allowed);
/** if true, the user is allowed to remove/add recipients via the UI.
* Defaults to @p false.
*/
bool recipientsUserMutable() const;
void setRecipientsUserMutable(bool isMutable);
void setAdditionalRecipientsInfo(const std::vector<GpgME::Key> &recipients);
std::vector<GpgME::Key> resolvedCertificates() const;
std::shared_ptr<RecipientPreferences> recipientPreferences() const;
void setRecipientPreferences(const std::shared_ptr<RecipientPreferences> &prefs);
Q_SIGNALS:
void selectedProtocolChanged();
private:
void onNext() override;
private:
class Private;
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
Q_PRIVATE_SLOT(d, void selectionChanged())
Q_PRIVATE_SLOT(d, void protocolSelected(int))
Q_PRIVATE_SLOT(d, void addRecipient())
Q_PRIVATE_SLOT(d, void removeSelectedEntries())
Q_PRIVATE_SLOT(d, void completeChangedInternal())
class ListWidget;
class ItemWidget;
};
}
}
}
diff --git a/src/crypto/gui/resultitemwidget.h b/src/crypto/gui/resultitemwidget.h
index 475e5c483..2a3d6b573 100644
--- a/src/crypto/gui/resultitemwidget.h
+++ b/src/crypto/gui/resultitemwidget.h
@@ -1,59 +1,57 @@
/* -*- mode: c++; c-basic-offset:4 -*-
crypto/gui/resultitemwidget.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2008 Klarälvdalens Datakonsult AB
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include <QWidget>
#include <crypto/task.h>
-#include <utils/pimpl_ptr.h>
-
#include <memory>
class QString;
namespace Kleo
{
namespace Crypto
{
class Task;
namespace Gui
{
class ResultItemWidget : public QWidget
{
Q_OBJECT
public:
explicit ResultItemWidget(const std::shared_ptr<const Task::Result> &result, QWidget *parent = nullptr, Qt::WindowFlags flags = {});
~ResultItemWidget() override;
bool hasErrorResult() const;
void showCloseButton(bool show);
void setShowButton(const QString &text, bool show);
public Q_SLOTS:
void showAuditLog();
Q_SIGNALS:
void linkActivated(const QString &link);
void closeButtonClicked();
void showButtonClicked();
private:
class Private;
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
Q_PRIVATE_SLOT(d, void slotLinkActivated(QString))
};
}
}
}
diff --git a/src/crypto/gui/resultlistwidget.h b/src/crypto/gui/resultlistwidget.h
index ab10096ef..3ff18e325 100644
--- a/src/crypto/gui/resultlistwidget.h
+++ b/src/crypto/gui/resultlistwidget.h
@@ -1,63 +1,61 @@
/* -*- mode: c++; c-basic-offset:4 -*-
crypto/gui/resultlistwidget.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2008 Klarälvdalens Datakonsult AB
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include <QWidget>
#include <crypto/taskcollection.h>
-#include <utils/pimpl_ptr.h>
-
#include <memory>
class QString;
namespace Kleo
{
namespace Crypto
{
class TaskCollection;
namespace Gui
{
class ResultListWidget : public QWidget
{
Q_OBJECT
public:
explicit ResultListWidget(QWidget *parent = nullptr, Qt::WindowFlags flags = {});
~ResultListWidget() override;
void setTaskCollection(const std::shared_ptr<TaskCollection> &coll);
void addTaskCollection(const std::shared_ptr<TaskCollection> &coll);
void setStandaloneMode(bool standalone);
bool isComplete() const;
unsigned int totalNumberOfTasks() const;
unsigned int numberOfCompletedTasks() const;
Q_SIGNALS:
void linkActivated(const QString &link);
void showButtonClicked(const std::shared_ptr<const Task::Result> &result);
void completeChanged();
private:
class Private;
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
Q_PRIVATE_SLOT(d, void result(std::shared_ptr<const Kleo::Crypto::Task::Result>))
Q_PRIVATE_SLOT(d, void started(std::shared_ptr<Kleo::Crypto::Task>))
Q_PRIVATE_SLOT(d, void allTasksDone())
};
}
}
}
diff --git a/src/crypto/gui/resultpage.h b/src/crypto/gui/resultpage.h
index 122f14507..caa9b8e76 100644
--- a/src/crypto/gui/resultpage.h
+++ b/src/crypto/gui/resultpage.h
@@ -1,54 +1,52 @@
/* -*- mode: c++; c-basic-offset:4 -*-
crypto/gui/resultpage.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2008 Klarälvdalens Datakonsult AB
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include <crypto/gui/wizardpage.h>
#include <crypto/task.h>
-#include <utils/pimpl_ptr.h>
-
#include <memory>
namespace Kleo
{
namespace Crypto
{
class TaskCollection;
namespace Gui
{
class ResultPage : public WizardPage
{
Q_OBJECT
public:
explicit ResultPage(QWidget *parent = nullptr, Qt::WindowFlags flags = {});
~ResultPage() override;
void setTaskCollection(const std::shared_ptr<TaskCollection> &coll);
bool isComplete() const override;
bool keepOpenWhenDone() const;
void setKeepOpenWhenDone(bool keep);
private:
class Private;
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
Q_PRIVATE_SLOT(d, void result(std::shared_ptr<const Kleo::Crypto::Task::Result>))
Q_PRIVATE_SLOT(d, void started(std::shared_ptr<Kleo::Crypto::Task>))
Q_PRIVATE_SLOT(d, void allDone())
};
}
}
}
diff --git a/src/crypto/gui/signemailwizard.h b/src/crypto/gui/signemailwizard.h
index 6c610fcf4..2d2f23e98 100644
--- a/src/crypto/gui/signemailwizard.h
+++ b/src/crypto/gui/signemailwizard.h
@@ -1,33 +1,31 @@
/* -*- mode: c++; c-basic-offset:4 -*-
crypto/gui/signemailwizard.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2008 Klarälvdalens Datakonsult AB
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include <crypto/gui/signencryptwizard.h>
-#include <utils/pimpl_ptr.h>
-
namespace Kleo
{
namespace Crypto
{
namespace Gui
{
class SignEMailWizard : public SignEncryptWizard
{
Q_OBJECT
public:
explicit SignEMailWizard(QWidget *parent = nullptr, Qt::WindowFlags f = {});
~SignEMailWizard() override;
};
}
}
}
diff --git a/src/crypto/gui/signencryptemailconflictdialog.h b/src/crypto/gui/signencryptemailconflictdialog.h
index 1cd028f09..00f292115 100644
--- a/src/crypto/gui/signencryptemailconflictdialog.h
+++ b/src/crypto/gui/signencryptemailconflictdialog.h
@@ -1,88 +1,87 @@
/* -*- mode: c++; c-basic-offset:4 -*-
crypto/gui/signencryptemailconflictdialog.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2009 Klarälvdalens Datakonsult AB
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include <QDialog>
-#include <utils/pimpl_ptr.h>
-
#include <gpgme++/global.h>
+#include <memory>
#include <vector>
namespace GpgME
{
class Key;
}
namespace Kleo
{
namespace Crypto
{
class Sender;
class Recipient;
}
}
namespace Kleo
{
namespace Crypto
{
namespace Gui
{
class SignEncryptEMailConflictDialog : public QDialog
{
Q_OBJECT
public:
explicit SignEncryptEMailConflictDialog(QWidget *parent = nullptr);
~SignEncryptEMailConflictDialog() override;
// Inputs
void setPresetProtocol(GpgME::Protocol proto);
void setSubject(const QString &subject);
void setSenders(const std::vector<Sender> &senders);
void setRecipients(const std::vector<Recipient> &recipients);
void setSign(bool on);
void setEncrypt(bool on);
void setQuickMode(bool on);
// To wrap up inputs:
void pickProtocol();
void setConflict(bool conflict);
// Intermediate
bool isComplete() const;
// Outputs
GpgME::Protocol selectedProtocol() const;
std::vector<GpgME::Key> resolvedSigningKeys() const;
std::vector<GpgME::Key> resolvedEncryptionKeys() const;
bool isQuickMode() const;
private:
Q_PRIVATE_SLOT(d, void slotCompleteChanged())
Q_PRIVATE_SLOT(d, void slotShowAllRecipientsToggled(bool))
Q_PRIVATE_SLOT(d, void slotProtocolChanged())
Q_PRIVATE_SLOT(d, void slotCertificateSelectionDialogRequested())
class Private;
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
};
}
}
}
diff --git a/src/crypto/gui/signencryptfileswizard.h b/src/crypto/gui/signencryptfileswizard.h
index 55d37776a..5fb5aa656 100644
--- a/src/crypto/gui/signencryptfileswizard.h
+++ b/src/crypto/gui/signencryptfileswizard.h
@@ -1,101 +1,99 @@
/* -*- mode: c++; c-basic-offset:4 -*-
crypto/gui/signencryptfileswizard.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2009 Klarälvdalens Datakonsult AB
SPDX-FileCopyrightText: 2016 Bundesamt für Sicherheit in der Informationstechnik
SPDX-FileContributor: Intevation GmbH
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
-#include <utils/pimpl_ptr.h>
-
#include <gpgme++/global.h>
#include <QWizard>
#include <QMap>
#include <memory>
namespace GpgME
{
class Key;
}
namespace Kleo
{
namespace Crypto
{
class TaskCollection;
}
}
class ResultPage;
class SigEncPage;
namespace Kleo
{
class SignEncryptFilesWizard : public QWizard
{
Q_OBJECT
public:
enum KindNames {
SignatureCMS,
SignaturePGP,
CombinedPGP,
EncryptedPGP,
EncryptedCMS,
Directory,
};
explicit SignEncryptFilesWizard(QWidget *parent = nullptr, Qt::WindowFlags f = {});
~SignEncryptFilesWizard() override;
// Inputs
void setSigningPreset(bool preset);
void setSigningUserMutable(bool mut);
void setEncryptionPreset(bool preset);
void setEncryptionUserMutable(bool mut);
void setArchiveForced(bool archive);
void setArchiveMutable(bool archive);
void setSingleFile(bool singleFile);
void setOutputNames(const QMap<int, QString> &nameMap) const;
QMap<int, QString> outputNames() const;
void setTaskCollection(const std::shared_ptr<Kleo::Crypto::TaskCollection> &coll);
// Outputs
std::vector<GpgME::Key> resolvedRecipients() const;
std::vector<GpgME::Key> resolvedSigners() const;
bool encryptSymmetric() const;
void setLabelText(const QString &label);
protected:
void readConfig();
void writeConfig();
Q_SIGNALS:
void operationPrepared();
private Q_SLOTS:
void slotCurrentIdChanged(int);
private:
SigEncPage *mSigEncPage = nullptr;
ResultPage *mResultPage = nullptr;
bool mSigningUserMutable = true;
bool mEncryptionUserMutable = true;
};
}
diff --git a/src/crypto/gui/signencryptwizard.h b/src/crypto/gui/signencryptwizard.h
index 303d7519a..94377f091 100644
--- a/src/crypto/gui/signencryptwizard.h
+++ b/src/crypto/gui/signencryptwizard.h
@@ -1,138 +1,136 @@
/* -*- mode: c++; c-basic-offset:4 -*-
crypto/gui/signencryptwizard.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2007 Klarälvdalens Datakonsult AB
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include <crypto/gui/wizard.h>
#include <crypto/gui/signerresolvepage.h>
-#include <utils/pimpl_ptr.h>
-
#include <KMime/Types>
#include <gpgme++/global.h>
#include <memory>
#include <vector>
namespace GpgME
{
class Key;
}
class QFileInfo;
template<typename T>
class QList;
using QFileInfoList = QList<QFileInfo>;
namespace Kleo
{
namespace Crypto
{
class Task;
class TaskCollection;
namespace Gui
{
class ObjectsPage;
class ResolveRecipientsPage;
class ResultPage;
class SignerResolvePage;
class SignEncryptWizard : public Wizard
{
Q_OBJECT
public:
explicit SignEncryptWizard(QWidget *parent = nullptr, Qt::WindowFlags f = {});
~SignEncryptWizard() override;
struct Page {
enum Id {
ResolveSigner = 0,
Objects,
ResolveRecipients,
Result,
};
};
void setCommitPage(Page::Id);
GpgME::Protocol presetProtocol() const;
void setPresetProtocol(GpgME::Protocol proto);
GpgME::Protocol selectedProtocol() const;
/// SignOrEncryptFiles mode subinterface
//@{
QFileInfoList resolvedFiles() const;
void setFiles(const QStringList &files);
bool signingSelected() const;
void setSigningSelected(bool selected);
bool encryptionSelected() const;
void setEncryptionSelected(bool selected);
bool isSigningUserMutable() const;
void setSigningUserMutable(bool isMutable);
bool isEncryptionUserMutable() const;
void setEncryptionUserMutable(bool isMutable);
bool isMultipleProtocolsAllowed() const;
void setMultipleProtocolsAllowed(bool allowed);
//@}
/** if true, the user is allowed to remove/add recipients via the UI.
* Defaults to @p false.
*/
bool recipientsUserMutable() const;
void setRecipientsUserMutable(bool isMutable);
void setSignersAndCandidates(const std::vector<KMime::Types::Mailbox> &signers, const std::vector<std::vector<GpgME::Key>> &keys);
void setTaskCollection(const std::shared_ptr<TaskCollection> &tasks);
std::vector<GpgME::Key> resolvedCertificates() const;
std::vector<GpgME::Key> resolvedSigners() const;
bool isAsciiArmorEnabled() const;
void setAsciiArmorEnabled(bool enabled);
bool keepResultPageOpenWhenDone() const;
void setKeepResultPageOpenWhenDone(bool keep);
void onNext(int currentId) override;
Q_SIGNALS:
void signersResolved();
void objectsResolved();
void recipientsResolved();
protected:
SignerResolvePage *signerResolvePage();
const SignerResolvePage *signerResolvePage() const;
ObjectsPage *objectsPage();
ResultPage *resultPage();
ResolveRecipientsPage *resolveRecipientsPage();
void setSignerResolvePageValidator(const std::shared_ptr<SignerResolvePage::Validator> &validator);
private:
class Private;
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
};
}
}
}
diff --git a/src/crypto/gui/signerresolvepage.h b/src/crypto/gui/signerresolvepage.h
index aeb29d302..b39249990 100644
--- a/src/crypto/gui/signerresolvepage.h
+++ b/src/crypto/gui/signerresolvepage.h
@@ -1,123 +1,121 @@
/* -*- mode: c++; c-basic-offset:4 -*-
crypto/gui/signerresolvepage.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2007 Klarälvdalens Datakonsult AB
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include <crypto/gui/wizardpage.h>
-#include <utils/pimpl_ptr.h>
-
#include <KMime/Types>
#include <gpgme++/global.h>
#include <memory>
#include <set>
#include <vector>
namespace GpgME
{
class Key;
}
namespace Kleo
{
namespace Crypto
{
class SigningPreferences;
namespace Gui
{
class SignerResolvePage : public WizardPage
{
Q_OBJECT
public:
explicit SignerResolvePage(QWidget *parent = nullptr, Qt::WindowFlags f = {});
~SignerResolvePage() override;
void setSignersAndCandidates(const std::vector<KMime::Types::Mailbox> &signers, const std::vector<std::vector<GpgME::Key>> &keys);
std::vector<GpgME::Key> resolvedSigners() const;
std::vector<GpgME::Key> signingCertificates(GpgME::Protocol protocol = GpgME::UnknownProtocol) const;
bool isComplete() const override;
bool encryptionSelected() const;
void setEncryptionSelected(bool selected);
bool signingSelected() const;
void setSigningSelected(bool selected);
bool isEncryptionUserMutable() const;
void setEncryptionUserMutable(bool ismutable);
bool isSigningUserMutable() const;
void setSigningUserMutable(bool ismutable);
bool isAsciiArmorEnabled() const;
void setAsciiArmorEnabled(bool enabled);
void setPresetProtocol(GpgME::Protocol protocol);
void setPresetProtocols(const std::vector<GpgME::Protocol> &protocols);
std::set<GpgME::Protocol> selectedProtocols() const;
std::set<GpgME::Protocol> selectedProtocolsWithoutSigningCertificate() const;
void setMultipleProtocolsAllowed(bool allowed);
bool multipleProtocolsAllowed() const;
void setProtocolSelectionUserMutable(bool ismutable);
bool protocolSelectionUserMutable() const;
enum Operation {
SignAndEncrypt = 0,
SignOnly,
EncryptOnly,
};
Operation operation() const;
class Validator
{
public:
virtual ~Validator()
{
}
virtual bool isComplete() const = 0;
virtual QString explanation() const = 0;
/**
* returns a custom window title, or a null string if no custom
* title is required.
* (use this if the title needs dynamic adaption
* depending on the user's selection)
*/
virtual QString customWindowTitle() const = 0;
};
void setValidator(const std::shared_ptr<Validator> &);
std::shared_ptr<Validator> validator() const;
void setSigningPreferences(const std::shared_ptr<SigningPreferences> &prefs);
std::shared_ptr<SigningPreferences> signingPreferences() const;
private:
void onNext() override;
private:
class Private;
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
Q_PRIVATE_SLOT(d, void operationButtonClicked(int))
Q_PRIVATE_SLOT(d, void selectCertificates())
Q_PRIVATE_SLOT(d, void updateUi())
};
}
}
}
diff --git a/src/crypto/gui/signingcertificateselectiondialog.h b/src/crypto/gui/signingcertificateselectiondialog.h
index 4de660eb5..1adce33e1 100644
--- a/src/crypto/gui/signingcertificateselectiondialog.h
+++ b/src/crypto/gui/signingcertificateselectiondialog.h
@@ -1,52 +1,50 @@
/* -*- mode: c++; c-basic-offset:4 -*-
crypto/gui/signingcertificateselectiondialog.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2007 Klarälvdalens Datakonsult AB
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include <QDialog>
#include <gpgme++/key.h>
-#include <utils/pimpl_ptr.h>
-
#include <set>
template<typename K, typename U>
class QMap;
namespace Kleo
{
struct CertificatePair;
namespace Crypto
{
namespace Gui
{
class SigningCertificateSelectionWidget;
class SigningCertificateSelectionDialog : public QDialog
{
Q_OBJECT
public:
explicit SigningCertificateSelectionDialog(QWidget *parent = nullptr);
~SigningCertificateSelectionDialog() override;
void setAllowedProtocols(const std::set<GpgME::Protocol> &allowedProtocols);
void setSelectedCertificates(const CertificatePair &certificates);
[[nodiscard]] CertificatePair selectedCertificates() const;
[[nodiscard]] bool rememberAsDefault() const;
private:
SigningCertificateSelectionWidget *const widget;
};
}
}
}
diff --git a/src/crypto/gui/signingcertificateselectionwidget.h b/src/crypto/gui/signingcertificateselectionwidget.h
index 77dbe4892..f1876e349 100644
--- a/src/crypto/gui/signingcertificateselectionwidget.h
+++ b/src/crypto/gui/signingcertificateselectionwidget.h
@@ -1,58 +1,57 @@
/* -*- mode: c++; c-basic-offset:4 -*-
crypto/gui/signingcertificateselectionwidget.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2007, 2009 Klarälvdalens Datakonsult AB
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include <QWidget>
#include <gpgme++/global.h>
-#include <utils/pimpl_ptr.h>
-
+#include <memory>
#include <set>
template<typename K, typename U>
class QMap;
namespace GpgME
{
class Key;
}
namespace Kleo
{
struct CertificatePair;
namespace Crypto
{
namespace Gui
{
class SigningCertificateSelectionWidget : public QWidget
{
Q_OBJECT
public:
explicit SigningCertificateSelectionWidget(QWidget *parent = nullptr, Qt::WindowFlags f = {});
~SigningCertificateSelectionWidget() override;
void setAllowedProtocols(const std::set<GpgME::Protocol> &allowedProtocols);
void setAllowedProtocols(bool pgp, bool cms);
void setSelectedCertificates(const CertificatePair &certificates);
void setSelectedCertificates(const GpgME::Key &pgp, const GpgME::Key &cms);
CertificatePair selectedCertificates() const;
bool rememberAsDefault() const;
private:
class Private;
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
};
}
}
}
diff --git a/src/crypto/gui/verifychecksumsdialog.h b/src/crypto/gui/verifychecksumsdialog.h
index 7ee211ce4..3db25cb06 100644
--- a/src/crypto/gui/verifychecksumsdialog.h
+++ b/src/crypto/gui/verifychecksumsdialog.h
@@ -1,63 +1,63 @@
/* -*- mode: c++; c-basic-offset:4 -*-
crypto/gui/verifychecksumsdialog.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2010 Klarälvdalens Datakonsult AB
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include <QDialog>
#include <QMetaType>
#ifndef QT_NO_DIRMODEL
-#include <utils/pimpl_ptr.h>
+#include <memory>
namespace Kleo
{
namespace Crypto
{
namespace Gui
{
class VerifyChecksumsDialog : public QDialog
{
Q_OBJECT
Q_ENUMS(Status)
public:
explicit VerifyChecksumsDialog(QWidget *parent = nullptr);
~VerifyChecksumsDialog() override;
enum Status {
Unknown,
OK,
Failed,
Error,
NumStatii,
};
public Q_SLOTS:
void setBaseDirectories(const QStringList &bases);
void setProgress(int current, int total);
void setStatus(const QString &file, Kleo::Crypto::Gui::VerifyChecksumsDialog::Status status);
void setErrors(const QStringList &errors);
void clearStatusInformation();
Q_SIGNALS:
void canceled();
private:
Q_PRIVATE_SLOT(d, void slotErrorButtonClicked())
class Private;
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
};
}
}
}
Q_DECLARE_METATYPE(Kleo::Crypto::Gui::VerifyChecksumsDialog::Status)
#endif // QT_NO_DIRMODEL
diff --git a/src/crypto/gui/wizard.h b/src/crypto/gui/wizard.h
index 678107cbc..fac061cc8 100644
--- a/src/crypto/gui/wizard.h
+++ b/src/crypto/gui/wizard.h
@@ -1,76 +1,75 @@
/* -*- mode: c++; c-basic-offset:4 -*-
crypto/gui/wizard.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2007 Klarälvdalens Datakonsult AB
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
-#include <utils/pimpl_ptr.h>
-
+#include <memory>
#include <vector>
#include <QDialog>
namespace Kleo
{
namespace Crypto
{
namespace Gui
{
class WizardPage;
class Wizard : public QDialog
{
Q_OBJECT
public:
explicit Wizard(QWidget *parent = nullptr, Qt::WindowFlags f = {});
~Wizard() override;
enum Page {
InvalidPage = -1,
};
void setPage(int id, WizardPage *page);
const WizardPage *page(int id) const;
WizardPage *page(int id);
void setPageOrder(const std::vector<int> &pages);
void setPageVisible(int id, bool visible);
void setCurrentPage(int id);
int currentPage() const;
const WizardPage *currentPageWidget() const;
WizardPage *currentPageWidget();
bool canGoToPreviousPage() const;
bool canGoToNextPage() const;
public Q_SLOTS:
void next();
void back();
Q_SIGNALS:
void canceled();
protected:
virtual void onNext(int currentId);
virtual void onBack(int currentId);
private:
class Private;
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
Q_PRIVATE_SLOT(d, void updateButtonStates())
Q_PRIVATE_SLOT(d, void updateHeader())
};
}
}
}
diff --git a/src/crypto/gui/wizardpage.h b/src/crypto/gui/wizardpage.h
index f38908678..15033134d 100644
--- a/src/crypto/gui/wizardpage.h
+++ b/src/crypto/gui/wizardpage.h
@@ -1,73 +1,73 @@
/* -*- mode: c++; c-basic-offset:4 -*-
crypto/gui/wizardpage.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2007 Klarälvdalens Datakonsult AB
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include <QWidget>
-#include <utils/pimpl_ptr.h>
+#include <memory>
class KGuiItem;
namespace Kleo
{
namespace Crypto
{
namespace Gui
{
class Wizard;
class WizardPage : public QWidget
{
friend class ::Kleo::Crypto::Gui::Wizard;
Q_OBJECT
public:
explicit WizardPage(QWidget *parent = nullptr, Qt::WindowFlags f = {});
~WizardPage() override;
virtual bool isComplete() const = 0;
bool isCommitPage() const;
void setCommitPage(bool commitPage);
bool autoAdvance() const;
void setAutoAdvance(bool enabled);
QString title() const;
void setTitle(const QString &title);
QString subTitle() const;
void setSubTitle(const QString &subTitle);
QString explanation() const;
void setExplanation(const QString &explanation);
KGuiItem customNextButton() const;
void setCustomNextButton(const KGuiItem &item);
Q_SIGNALS:
void completeChanged();
void explanationChanged();
void titleChanged();
void subTitleChanged();
void autoAdvanceChanged();
void windowTitleChanged(const QString &title);
protected:
virtual void onNext();
private:
class Private;
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
};
}
}
}
diff --git a/src/crypto/newsignencryptemailcontroller.h b/src/crypto/newsignencryptemailcontroller.h
index a5baadb76..e7a62d9ab 100644
--- a/src/crypto/newsignencryptemailcontroller.h
+++ b/src/crypto/newsignencryptemailcontroller.h
@@ -1,100 +1,98 @@
/* -*- mode: c++; c-basic-offset:4 -*-
crypto/newsignencryptemailcontroller.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2007 Klarälvdalens Datakonsult AB
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include <crypto/controller.h>
-#include <utils/pimpl_ptr.h>
-
#include <gpgme++/global.h>
#include <memory>
#include <utility>
#include <vector>
namespace KMime
{
namespace Types
{
class Mailbox;
}
}
namespace GpgME
{
}
namespace Kleo
{
class Input;
class Output;
namespace Crypto
{
class NewSignEncryptEMailController : public Controller
{
Q_OBJECT
public:
explicit NewSignEncryptEMailController(QObject *parent = nullptr);
explicit NewSignEncryptEMailController(const std::shared_ptr<ExecutionContext> &xc, QObject *parent = nullptr);
~NewSignEncryptEMailController() override;
static const char *mementoName()
{
return "NewSignEncryptEMailController";
}
// 1st stage inputs
void setSubject(const QString &subject);
void setProtocol(GpgME::Protocol proto);
const char *protocolAsString() const;
GpgME::Protocol protocol() const;
void setSigning(bool sign);
bool isSigning() const;
void setEncrypting(bool encrypt);
bool isEncrypting() const;
void startResolveCertificates(const std::vector<KMime::Types::Mailbox> &recipients, const std::vector<KMime::Types::Mailbox> &senders);
bool isResolvingInProgress() const;
bool areCertificatesResolved() const;
// 2nd stage inputs
void setDetachedSignature(bool detached);
void startSigning(const std::vector<std::shared_ptr<Kleo::Input>> &inputs, const std::vector<std::shared_ptr<Kleo::Output>> &outputs);
void startEncryption(const std::vector<std::shared_ptr<Kleo::Input>> &inputs, const std::vector<std::shared_ptr<Kleo::Output>> &outputs);
public Q_SLOTS:
void cancel();
Q_SIGNALS:
void certificatesResolved();
void reportMicAlg(const QString &micAlg);
private:
void doTaskDone(const Task *task, const std::shared_ptr<const Kleo::Crypto::Task::Result> &) override;
class Private;
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
Q_PRIVATE_SLOT(d, void slotDialogAccepted())
Q_PRIVATE_SLOT(d, void slotDialogRejected())
Q_PRIVATE_SLOT(d, void schedule())
};
} // Crypto
} // Kleo
diff --git a/src/crypto/signemailcontroller.h b/src/crypto/signemailcontroller.h
index 702e625dc..33315e5e3 100644
--- a/src/crypto/signemailcontroller.h
+++ b/src/crypto/signemailcontroller.h
@@ -1,86 +1,84 @@
/* -*- mode: c++; c-basic-offset:4 -*-
crypto/signemailcontroller.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2007 Klarälvdalens Datakonsult AB
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include <crypto/controller.h>
-#include <utils/pimpl_ptr.h>
-
#include <gpgme++/global.h>
#include <memory>
#include <vector>
namespace KMime
{
namespace Types
{
class Mailbox;
}
}
namespace Kleo
{
class Input;
class Output;
namespace Crypto
{
class SignEMailController : public Controller
{
Q_OBJECT
public:
enum Mode {
GpgOLMode,
ClipboardMode,
NumModes
};
explicit SignEMailController(Mode mode, QObject *parent = nullptr);
explicit SignEMailController(const std::shared_ptr<ExecutionContext> &xc, Mode mode, QObject *parent = nullptr);
~SignEMailController() override;
Mode mode() const;
void setProtocol(GpgME::Protocol proto);
GpgME::Protocol protocol() const;
// const char * protocolAsString() const;
void startResolveSigners();
void setDetachedSignature(bool detached);
void setInputAndOutput(const std::shared_ptr<Kleo::Input> &input, const std::shared_ptr<Kleo::Output> &output);
void setInputsAndOutputs(const std::vector<std::shared_ptr<Kleo::Input>> &inputs, const std::vector<std::shared_ptr<Kleo::Output>> &outputs);
void start();
public Q_SLOTS:
void cancel();
Q_SIGNALS:
void signersResolved();
void reportMicAlg(const QString &micalg);
private:
void doTaskDone(const Task *task, const std::shared_ptr<const Task::Result> &result) override;
class Private;
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
Q_PRIVATE_SLOT(d, void slotWizardSignersResolved())
Q_PRIVATE_SLOT(d, void slotWizardCanceled())
Q_PRIVATE_SLOT(d, void schedule())
};
} // Crypto
} // Kleo
diff --git a/src/crypto/signemailtask.h b/src/crypto/signemailtask.h
index 5a85b58b6..e35a12bf9 100644
--- a/src/crypto/signemailtask.h
+++ b/src/crypto/signemailtask.h
@@ -1,69 +1,67 @@
/* -*- mode: c++; c-basic-offset:4 -*-
crypto/signemailtask.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2007 Klarälvdalens Datakonsult AB
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include <crypto/task.h>
-#include <utils/pimpl_ptr.h>
-
#include <gpgme++/global.h>
#include <memory>
#include <vector>
namespace GpgME
{
class Key;
}
namespace Kleo
{
class Input;
class Output;
}
namespace Kleo
{
namespace Crypto
{
class SignEMailTask : public Task
{
Q_OBJECT
public:
explicit SignEMailTask(QObject *parent = nullptr);
~SignEMailTask() override;
void setInput(const std::shared_ptr<Input> &input);
void setOutput(const std::shared_ptr<Output> &output);
void setSigners(const std::vector<GpgME::Key> &recipients);
void setDetachedSignature(bool detached);
void setClearsign(bool clear);
GpgME::Protocol protocol() const override;
void cancel() override;
QString label() const override;
QString micAlg() const;
private:
void doStart() override;
unsigned long long inputSize() const override;
private:
class Private;
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
Q_PRIVATE_SLOT(d, void slotResult(const GpgME::SigningResult &))
};
}
}
diff --git a/src/crypto/signencryptfilescontroller.h b/src/crypto/signencryptfilescontroller.h
index b4d4a10ff..14b2e69f2 100644
--- a/src/crypto/signencryptfilescontroller.h
+++ b/src/crypto/signencryptfilescontroller.h
@@ -1,78 +1,76 @@
/* -*- mode: c++; c-basic-offset:4 -*-
crypto/signencryptfilescontroller.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2007 Klarälvdalens Datakonsult AB
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include <crypto/controller.h>
-#include <utils/pimpl_ptr.h>
-
#include <gpgme++/global.h>
#include <memory>
#include <vector>
namespace Kleo
{
namespace Crypto
{
class SignEncryptFilesController : public Controller
{
Q_OBJECT
public:
explicit SignEncryptFilesController(QObject *parent = nullptr);
explicit SignEncryptFilesController(const std::shared_ptr<const ExecutionContext> &ctx, QObject *parent = nullptr);
~SignEncryptFilesController() override;
void setProtocol(GpgME::Protocol proto);
GpgME::Protocol protocol() const;
// const char * protocolAsString() const;
enum Operation {
SignDisallowed = 0,
SignAllowed = 1,
SignSelected = 2,
SignMask = SignAllowed | SignSelected,
EncryptDisallowed = 0,
EncryptAllowed = 4,
EncryptSelected = 8,
EncryptMask = EncryptAllowed | EncryptSelected,
ArchiveDisallowed = 0,
ArchiveAllowed = 16,
ArchiveForced = 32,
ArchiveMask = ArchiveAllowed | ArchiveForced
};
void setOperationMode(unsigned int mode);
unsigned int operationMode() const;
void setFiles(const QStringList &files);
void start();
public Q_SLOTS:
void cancel();
private:
void doTaskDone(const Task *task, const std::shared_ptr<const Task::Result> &) override;
class Private;
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
Q_PRIVATE_SLOT(d, void slotWizardOperationPrepared())
Q_PRIVATE_SLOT(d, void slotWizardCanceled())
Q_PRIVATE_SLOT(d, void schedule())
};
}
}
diff --git a/src/crypto/signencrypttask.h b/src/crypto/signencrypttask.h
index d9459d29d..a13011ab2 100644
--- a/src/crypto/signencrypttask.h
+++ b/src/crypto/signencrypttask.h
@@ -1,83 +1,81 @@
/* -*- mode: c++; c-basic-offset:4 -*-
crypto/signencrypttask.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2007 Klarälvdalens Datakonsult AB
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include <crypto/task.h>
-#include <utils/pimpl_ptr.h>
-
#include <gpgme++/global.h>
#include <memory>
#include <vector>
class QString;
namespace GpgME
{
class Key;
}
namespace Kleo
{
class OverwritePolicy;
class Input;
class Output;
}
namespace Kleo
{
namespace Crypto
{
class SignEncryptTask : public Task
{
Q_OBJECT
public:
explicit SignEncryptTask(QObject *parent = nullptr);
~SignEncryptTask() override;
void setInputFileName(const QString &fileName);
void setInputFileNames(const QStringList &fileNames);
void setInput(const std::shared_ptr<Input> &input);
void setOutput(const std::shared_ptr<Output> &output);
void setOutputFileName(const QString &fileName);
QString outputFileName() const;
void setSigners(const std::vector<GpgME::Key> &signers);
void setRecipients(const std::vector<GpgME::Key> &recipients);
void setSign(bool sign);
void setEncrypt(bool encrypt);
void setDetachedSignature(bool detached);
void setEncryptSymmetric(bool symmetric);
void setClearsign(bool clearsign);
void setCreateArchive(bool archive);
void setOverwritePolicy(const std::shared_ptr<OverwritePolicy> &policy);
GpgME::Protocol protocol() const override;
void cancel() override;
QString label() const override;
QString tag() const override;
private:
void doStart() override;
unsigned long long inputSize() const override;
private:
class Private;
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
Q_PRIVATE_SLOT(d, void slotResult(const GpgME::SigningResult &))
Q_PRIVATE_SLOT(d, void slotResult(const GpgME::SigningResult &, const GpgME::EncryptionResult &))
Q_PRIVATE_SLOT(d, void slotResult(const GpgME::EncryptionResult &))
};
}
}
diff --git a/src/crypto/task.h b/src/crypto/task.h
index a7bc9bac6..214b55457 100644
--- a/src/crypto/task.h
+++ b/src/crypto/task.h
@@ -1,140 +1,139 @@
/* -*- mode: c++; c-basic-offset:4 -*-
crypto/task.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2007 Klarälvdalens Datakonsult AB
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include <QObject>
#include <QString>
-#include <utils/pimpl_ptr.h>
-
#include <gpgme++/global.h>
#include <QPointer>
+
#include <memory>
namespace Kleo
{
class AuditLogEntry;
}
namespace Kleo
{
namespace Crypto
{
class Task : public QObject
{
Q_OBJECT
public:
explicit Task(QObject *parent = nullptr);
~Task() override;
class Result;
void setAsciiArmor(bool armor);
bool asciiArmor() const;
virtual GpgME::Protocol protocol() const = 0;
void start();
virtual QString label() const = 0;
virtual QString tag() const;
int currentProgress() const;
int totalProgress() const;
int id() const;
static std::shared_ptr<Task> makeErrorTask(const GpgME::Error &error, const QString &details, const QString &label);
public Q_SLOTS:
virtual void cancel() = 0;
Q_SIGNALS:
void progress(int processed, int total, QPrivateSignal);
void result(const std::shared_ptr<const Kleo::Crypto::Task::Result> &, QPrivateSignal);
void started(QPrivateSignal);
protected:
std::shared_ptr<Result> makeErrorResult(const GpgME::Error &error, const QString &details);
void emitResult(const std::shared_ptr<const Task::Result> &result);
protected Q_SLOTS:
void setProgress(int processed, int total);
private Q_SLOTS:
void emitError(const GpgME::Error &error, const QString &details);
private:
virtual void doStart() = 0;
virtual unsigned long long inputSize() const = 0;
private:
class Private;
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
};
class Task::Result
{
const QString m_nonce;
public:
class Content;
Result();
virtual ~Result();
const QString &nonce() const
{
return m_nonce;
}
bool hasError() const;
enum VisualCode {
AllGood,
Warning,
Danger,
NeutralSuccess,
NeutralError,
};
enum class ContentType {
None,
Mime,
Mbox,
};
virtual QString icon() const;
virtual QString overview() const = 0;
virtual QString details() const = 0;
virtual GpgME::Error error() const = 0;
virtual QString errorString() const = 0;
virtual VisualCode code() const = 0;
virtual AuditLogEntry auditLog() const = 0;
virtual QPointer<Task> parentTask() const
{
return QPointer<Task>();
}
virtual ContentType viewableContentType() const;
protected:
static QString iconPath(VisualCode code);
static QString makeOverview(const QString &msg);
private:
class Private;
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
};
}
}
diff --git a/src/crypto/taskcollection.h b/src/crypto/taskcollection.h
index 7124314a7..a86edc83d 100644
--- a/src/crypto/taskcollection.h
+++ b/src/crypto/taskcollection.h
@@ -1,60 +1,57 @@
/* -*- mode: c++; c-basic-offset:4 -*-
crypto/taskcollection.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2008 Klarälvdalens Datakonsult AB
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include <QObject>
#include <crypto/task.h>
-#include <utils/pimpl_ptr.h>
-
#include <memory>
-
#include <vector>
namespace Kleo
{
namespace Crypto
{
class TaskCollection : public QObject
{
Q_OBJECT
public:
explicit TaskCollection(QObject *parent = nullptr);
~TaskCollection() override;
std::vector<std::shared_ptr<Task>> tasks() const;
std::shared_ptr<Task> taskById(int id) const;
void setTasks(const std::vector<std::shared_ptr<Task>> &tasks);
bool isEmpty() const;
size_t size() const;
int numberOfCompletedTasks() const;
bool allTasksCompleted() const;
bool errorOccurred() const;
bool allTasksHaveErrors() const;
Q_SIGNALS:
void progress(int processed, int total);
void result(const std::shared_ptr<const Kleo::Crypto::Task::Result> &result);
void started(const std::shared_ptr<Kleo::Crypto::Task> &task);
void done();
private:
class Private;
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
Q_PRIVATE_SLOT(d, void taskResult(std::shared_ptr<const Kleo::Crypto::Task::Result>))
Q_PRIVATE_SLOT(d, void taskStarted())
};
}
}
diff --git a/src/crypto/verifychecksumscontroller.h b/src/crypto/verifychecksumscontroller.h
index 467c6203e..dc2d9503d 100644
--- a/src/crypto/verifychecksumscontroller.h
+++ b/src/crypto/verifychecksumscontroller.h
@@ -1,52 +1,50 @@
/* -*- mode: c++; c-basic-offset:4 -*-
crypto/verifychecksumscontroller.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2010 Klarälvdalens Datakonsult AB
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include <crypto/controller.h>
#ifndef QT_NO_DIRMODEL
-#include <utils/pimpl_ptr.h>
-
#include <gpgme++/global.h>
#include <memory>
#include <vector>
namespace Kleo
{
namespace Crypto
{
class VerifyChecksumsController : public Controller
{
Q_OBJECT
public:
explicit VerifyChecksumsController(QObject *parent = nullptr);
explicit VerifyChecksumsController(const std::shared_ptr<const ExecutionContext> &ctx, QObject *parent = nullptr);
~VerifyChecksumsController() override;
void setFiles(const QStringList &files);
void start();
public Q_SLOTS:
void cancel();
private:
class Private;
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
Q_PRIVATE_SLOT(d, void slotOperationFinished())
};
}
}
#endif // QT_NO_DIRMODEL
diff --git a/src/dialogs/certificateselectiondialog.h b/src/dialogs/certificateselectiondialog.h
index 49e532e71..6a2042607 100644
--- a/src/dialogs/certificateselectiondialog.h
+++ b/src/dialogs/certificateselectiondialog.h
@@ -1,104 +1,102 @@
/* -*- mode: c++; c-basic-offset:4 -*-
dialogs/certificateselectiondialog.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2008 Klarälvdalens Datakonsult AB
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include <QDialog>
-#include <utils/pimpl_ptr.h>
-
#include <gpgme++/global.h>
#include <memory>
#include <vector>
namespace GpgME
{
class Key;
class UserID;
}
namespace Kleo
{
class KeyFilter;
class KeyGroup;
namespace Dialogs
{
class CertificateSelectionDialog : public QDialog
{
Q_OBJECT
Q_FLAGS(Options)
public:
enum Option {
// clang-format off
SingleSelection = 0x00,
MultiSelection = 0x01,
SignOnly = 0x02,
EncryptOnly = 0x04,
AnyCertificate = 0x06,
OpenPGPFormat = 0x08,
CMSFormat = 0x10,
AnyFormat = 0x18,
Certificates = 0x00,
SecretKeys = 0x20,
IncludeGroups = 0x40,
OptionMask
// clang-format on
};
Q_DECLARE_FLAGS(Options, Option)
static Option optionsFromProtocol(GpgME::Protocol proto);
explicit CertificateSelectionDialog(QWidget *parent = nullptr);
~CertificateSelectionDialog() override;
void setCustomLabelText(const QString &text);
QString customLabelText() const;
void setOptions(Options options);
Options options() const;
void selectCertificates(const std::vector<GpgME::Key> &certs);
void selectCertificate(const GpgME::Key &key);
std::vector<GpgME::Key> selectedCertificates() const;
GpgME::Key selectedCertificate() const;
void selectGroups(const std::vector<Kleo::KeyGroup> &groups);
std::vector<Kleo::KeyGroup> selectedGroups() const;
std::vector<GpgME::UserID> selectedUserIDs() const;
static void filterAllowedKeys(std::vector<GpgME::Key> &keys, int options);
public Q_SLOTS:
void setStringFilter(const QString &text);
void setKeyFilter(const std::shared_ptr<Kleo::KeyFilter> &filter);
void accept() override;
protected:
void hideEvent(QHideEvent *) override;
private:
class Private;
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
};
}
}
Q_DECLARE_OPERATORS_FOR_FLAGS(Kleo::Dialogs::CertificateSelectionDialog::Options)
diff --git a/src/dialogs/certifycertificatedialog.h b/src/dialogs/certifycertificatedialog.h
index d26099bc2..6358ed3e9 100644
--- a/src/dialogs/certifycertificatedialog.h
+++ b/src/dialogs/certifycertificatedialog.h
@@ -1,64 +1,62 @@
/* -*- mode: c++; c-basic-offset:4 -*-
dialogs/signcertificatedialog.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2008 Klarälvdalens Datakonsult AB
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include <QWizard>
#include <QGpgME/SignKeyJob>
#include <gpgme++/key.h>
-#include <utils/pimpl_ptr.h>
-
namespace Kleo
{
class CertifyWidget;
class CertifyCertificateDialog : public QDialog
{
Q_OBJECT
public:
explicit CertifyCertificateDialog(QWidget *parent = nullptr, Qt::WindowFlags f = {});
~CertifyCertificateDialog() override;
/** Sets the certificate to certify for certifying user IDs of a single certificate. */
void setCertificateToCertify(const GpgME::Key &key, const std::vector<GpgME::UserID> &uids = {});
/** Sets the certificates to certify for bulk certification. */
void setCertificatesToCertify(const std::vector<GpgME::Key> &keys);
/** Set the optional group name when certifying the certificates of a certificate group. */
void setGroupName(const QString &name);
bool exportableCertificationSelected() const;
bool trustSignatureSelected() const;
QString trustSignatureDomain() const;
void setSelectedUserIDs(const std::vector<GpgME::UserID> &uids);
std::vector<GpgME::UserID> selectedUserIDs() const;
GpgME::Key selectedSecretKey() const;
bool sendToServer() const;
QString tags() const;
QDate expirationDate() const;
public Q_SLOTS:
void accept() override;
private:
CertifyWidget *mCertWidget = nullptr;
};
}
diff --git a/src/dialogs/deletecertificatesdialog.h b/src/dialogs/deletecertificatesdialog.h
index 6e3f41a30..6d037691e 100644
--- a/src/dialogs/deletecertificatesdialog.h
+++ b/src/dialogs/deletecertificatesdialog.h
@@ -1,48 +1,47 @@
/* -*- mode: c++; c-basic-offset:4 -*-
dialogs/deletecertificatesdialog.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2009 Klarälvdalens Datakonsult AB
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include <QDialog>
-#include <utils/pimpl_ptr.h>
-
+#include <memory>
#include <vector>
namespace GpgME
{
class Key;
}
namespace Kleo
{
namespace Dialogs
{
class DeleteCertificatesDialog : public QDialog
{
Q_OBJECT
public:
explicit DeleteCertificatesDialog(QWidget *parent = nullptr);
~DeleteCertificatesDialog() override;
void setSelectedKeys(const std::vector<GpgME::Key> &keys);
void setUnselectedKeys(const std::vector<GpgME::Key> &keys);
std::vector<GpgME::Key> keys() const;
void accept() override;
private:
class Private;
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
};
}
}
diff --git a/src/dialogs/lookupcertificatesdialog.h b/src/dialogs/lookupcertificatesdialog.h
index a1ccaae17..f444678ab 100644
--- a/src/dialogs/lookupcertificatesdialog.h
+++ b/src/dialogs/lookupcertificatesdialog.h
@@ -1,71 +1,70 @@
/* -*- mode: c++; c-basic-offset:4 -*-
dialogs/lookupcertificatesdialog.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2008 Klarälvdalens Datakonsult AB
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include <QDialog>
-#include <utils/pimpl_ptr.h>
-
+#include <memory>
#include <vector>
#include <gpgme++/key.h>
namespace Kleo
{
namespace Dialogs
{
class LookupCertificatesDialog : public QDialog
{
Q_OBJECT
public:
enum QueryMode {
AnyQuery, //< any query is allowed
EmailQuery, //< only email queries are allowed
};
explicit LookupCertificatesDialog(QWidget *parent = nullptr, Qt::WindowFlags f = {});
~LookupCertificatesDialog() override;
void setQueryMode(QueryMode mode);
QueryMode queryMode() const;
void setCertificates(const std::vector<GpgME::Key> &certs, const std::vector<GpgME::Key::Origin> &origins);
std::vector<GpgME::Key> selectedCertificates() const;
void setPassive(bool passive);
bool isPassive() const;
void setSearchText(const QString &text);
QString searchText() const;
void setOverlayText(const QString &text);
QString overlayText() const;
Q_SIGNALS:
void searchTextChanged(const QString &text);
void saveAsRequested(const std::vector<GpgME::Key> &certs);
void importRequested(const std::vector<GpgME::Key> &certs);
void detailsRequested(const GpgME::Key &certs);
public Q_SLOTS:
void accept() override;
private:
class Private;
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
Q_PRIVATE_SLOT(d, void slotSearchTextChanged())
Q_PRIVATE_SLOT(d, void slotSearchClicked())
Q_PRIVATE_SLOT(d, void slotSelectionChanged())
Q_PRIVATE_SLOT(d, void slotDetailsClicked())
Q_PRIVATE_SLOT(d, void slotSaveAsClicked())
};
}
}
diff --git a/src/dialogs/selftestdialog.h b/src/dialogs/selftestdialog.h
index 8ecd6a152..e4a60d918 100644
--- a/src/dialogs/selftestdialog.h
+++ b/src/dialogs/selftestdialog.h
@@ -1,51 +1,49 @@
/* -*- mode: c++; c-basic-offset:4 -*-
dialogs/selftestdialog.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2008 Klarälvdalens Datakonsult AB
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include <QDialog>
-#include <utils/pimpl_ptr.h>
-
#include <memory>
#include <vector>
namespace Kleo
{
class SelfTest;
namespace Dialogs
{
class SelfTestDialog : public QDialog
{
Q_OBJECT
Q_PROPERTY(bool runAtStartUp READ runAtStartUp WRITE setRunAtStartUp)
public:
explicit SelfTestDialog(QWidget *parent = nullptr, Qt::WindowFlags f = {});
~SelfTestDialog() override;
void setAutomaticMode(bool automatic);
void setTests(const std::vector<std::shared_ptr<SelfTest>> &tests);
void setRunAtStartUp(bool run);
bool runAtStartUp() const;
Q_SIGNALS:
void updateRequested();
private:
class Private;
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
};
}
}
diff --git a/src/dialogs/setinitialpindialog.h b/src/dialogs/setinitialpindialog.h
index 9d64cf1c6..9c0e7ba0f 100644
--- a/src/dialogs/setinitialpindialog.h
+++ b/src/dialogs/setinitialpindialog.h
@@ -1,54 +1,54 @@
/* -*- mode: c++; c-basic-offset:4 -*-
dialogs/setinitialpindialog.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2009 Klarälvdalens Datakonsult AB
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include <QDialog>
-#include <utils/pimpl_ptr.h>
+#include <memory>
namespace GpgME
{
class Error;
}
namespace Kleo
{
namespace Dialogs
{
class SetInitialPinDialog : public QDialog
{
Q_OBJECT
public:
explicit SetInitialPinDialog(QWidget *parent = nullptr);
~SetInitialPinDialog() override;
void setNksPinPresent(bool);
void setSigGPinPresent(bool);
bool isComplete() const;
public Q_SLOTS:
void setNksPinSettingResult(const GpgME::Error &error);
void setSigGPinSettingResult(const GpgME::Error &error);
Q_SIGNALS:
void nksPinRequested();
void sigGPinRequested();
private:
class Private;
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
Q_PRIVATE_SLOT(d, void slotNksButtonClicked())
Q_PRIVATE_SLOT(d, void slotSigGButtonClicked())
};
}
}
diff --git a/src/kleopatraapplication.h b/src/kleopatraapplication.h
index 0ebe714bb..a0e27935f 100644
--- a/src/kleopatraapplication.h
+++ b/src/kleopatraapplication.h
@@ -1,117 +1,117 @@
/*
kleopatraapplication.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2008 Klarälvdalens Datakonsult AB
SPDX-FileCopyrightText: 2016 Bundesamt für Sicherheit in der Informationstechnik
SPDX-FileContributor: Intevation GmbH
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include <QApplication>
#include <QCommandLineParser>
#include <QElapsedTimer>
-#include <utils/pimpl_ptr.h>
-
#include <gpgme++/global.h>
+#include <memory>
+
extern QElapsedTimer startupTimer;
#define STARTUP_TIMING qCDebug(KLEOPATRA_LOG) << "Startup timing:" << startupTimer.elapsed() << "ms:"
#define STARTUP_TRACE qCDebug(KLEOPATRA_LOG) << "Startup timing:" << startupTimer.elapsed() << "ms:" << SRCNAME << __func__ << __LINE__;
class MainWindow;
class SysTrayIcon;
class QSettings;
class KleopatraApplication : public QApplication
{
Q_OBJECT
public:
/** Create a new Application object. You have to
* make sure to call init afterwards to get a valid object.
* This is to delay initialisation after the UniqueService
* call is done and our init / call might be forwarded to
* another instance. */
KleopatraApplication(int &argc, char *argv[]);
~KleopatraApplication() override;
/** Initialize the application. Without calling init any
* other call to KleopatraApplication will result in undefined behavior
* and likely crash. */
void init();
static KleopatraApplication *instance()
{
return qobject_cast<KleopatraApplication *>(qApp);
}
/** Starts a new instance or a command from the command line.
*
* Handles the parser options and starts the according commands.
* If ignoreNewInstance is set this function does nothing.
* The parser should have been initialized with kleopatra_options and
* already processed.
* If kleopatra is not session restored
*
* @param parser: The command line parser to use.
* @param workingDirectory: Optional working directory for file arguments.
*
* @returns an empty QString on success. A localized error message otherwise.
* */
QString newInstance(const QCommandLineParser &parser, const QString &workingDirectory = QString());
void setMainWindow(MainWindow *mw);
const MainWindow *mainWindow() const;
MainWindow *mainWindow();
void setIgnoreNewInstance(bool on);
bool ignoreNewInstance() const;
void toggleMainWindowVisibility();
void restoreMainWindow();
void openConfigDialogWithForeignParent(WId parentWId);
/* Add optional signed settings for specialized distributions */
void setDistributionSettings(const std::shared_ptr<QSettings> &settings);
std::shared_ptr<QSettings> distributionSettings() const;
public Q_SLOTS:
void openOrRaiseMainWindow();
void openOrRaiseConfigDialog();
void openOrRaiseGroupsConfigDialog(QWidget *parent);
#ifndef QT_NO_SYSTEMTRAYICON
void startMonitoringSmartCard();
#endif
void importCertificatesFromFile(const QStringList &files, GpgME::Protocol proto);
void encryptFiles(const QStringList &files, GpgME::Protocol proto);
void signFiles(const QStringList &files, GpgME::Protocol proto);
void signEncryptFiles(const QStringList &files, GpgME::Protocol proto);
void decryptFiles(const QStringList &files, GpgME::Protocol proto);
void verifyFiles(const QStringList &files, GpgME::Protocol proto);
void decryptVerifyFiles(const QStringList &files, GpgME::Protocol proto);
void checksumFiles(const QStringList &files, GpgME::Protocol /* unused */);
void slotActivateRequested(const QStringList &arguments, const QString &workingDirectory);
void handleFiles(const QStringList &files, WId parentId = 0);
Q_SIGNALS:
/* Emitted from slotActivateRequested to enable setting the
* correct exitValue */
void setExitValue(int value);
void configurationChanged();
private Q_SLOTS:
// used as URL handler for URLs with schemes that shall be blocked
void blockUrl(const QUrl &url);
void startGpgAgent();
private:
class Private;
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
};
diff --git a/src/mainwindow.h b/src/mainwindow.h
index dabf46b2b..7469a0e56 100644
--- a/src/mainwindow.h
+++ b/src/mainwindow.h
@@ -1,59 +1,59 @@
/* -*- mode: c++; c-basic-offset:4 -*-
mainwindow.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2007 Klarälvdalens Datakonsult AB
SPDX-FileCopyrightText: 2016 Bundesamt für Sicherheit in der Informationstechnik
SPDX-FileContributor: Intevation GmbH
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include <KXmlGuiWindow>
-#include <utils/pimpl_ptr.h>
+#include <memory>
namespace Kleo
{
class KeyListController;
}
class MainWindow : public KXmlGuiWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = nullptr, Qt::WindowFlags f = {});
~MainWindow() override;
Kleo::KeyListController *keyListController();
public Q_SLOTS:
void importCertificatesFromFile(const QStringList &files);
void exportWindow();
void unexportWindow();
protected:
QByteArray savedGeometry;
void closeEvent(QCloseEvent *e) override;
void showEvent(QShowEvent *e) override;
void hideEvent(QHideEvent *e) override;
void dragEnterEvent(QDragEnterEvent *) override;
void dropEvent(QDropEvent *) override;
void readProperties(const KConfigGroup &cg) override;
void saveProperties(KConfigGroup &cg) override;
private:
class Private;
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
Q_PRIVATE_SLOT(d, void closeAndQuit())
Q_PRIVATE_SLOT(d, void configureToolbars())
Q_PRIVATE_SLOT(d, void editKeybindings())
Q_PRIVATE_SLOT(d, void slotConfigCommitted())
Q_PRIVATE_SLOT(d, void slotContextMenuRequested(QAbstractItemView *, QPoint))
Q_PRIVATE_SLOT(d, void slotFocusQuickSearch())
Q_PRIVATE_SLOT(d, void showPadView())
};
diff --git a/src/newcertificatewizard/keycreationpage_p.h b/src/newcertificatewizard/keycreationpage_p.h
index db69bd1b9..26a197784 100644
--- a/src/newcertificatewizard/keycreationpage_p.h
+++ b/src/newcertificatewizard/keycreationpage_p.h
@@ -1,58 +1,60 @@
/* -*- mode: c++; c-basic-offset:4 -*-
newcertificatewizard/keycreationpage_p.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2008 Klarälvdalens Datakonsult AB
SPDX-FileCopyrightText: 2016, 2017 Bundesamt für Sicherheit in der Informationstechnik
SPDX-FileContributor: Intevation GmbH
SPDX-FileCopyrightText: 2022 g10 Code GmbH
SPDX-FileContributor: Ingo Klöcker <dev@ingo-kloecker.de>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include "wizardpage_p.h"
#include "utils/emptypassphraseprovider.h"
+#include <QPointer>
+
namespace GpgME
{
class KeyGenerationResult;
}
namespace QGpgME
{
class KeyGenerationJob;
}
namespace Kleo
{
class KeyUsage;
}
class KeyCreationPage : public Kleo::NewCertificateUi::WizardPage
{
Q_OBJECT
public:
explicit KeyCreationPage(QWidget *p = nullptr);
~KeyCreationPage() override;
bool isComplete() const override;
void initializePage() override;
private:
void startJob();
Kleo::KeyUsage keyUsage() const;
QString createGnupgKeyParms() const;
private Q_SLOTS:
void slotResult(const GpgME::KeyGenerationResult &result, const QByteArray &request, const QString &auditLog);
private:
struct UI;
std::unique_ptr<UI> ui;
EmptyPassphraseProvider mEmptyPassphraseProvider;
QPointer<QGpgME::KeyGenerationJob> job;
};
diff --git a/src/newcertificatewizard/listwidget.h b/src/newcertificatewizard/listwidget.h
index 9d46d8907..3aa382667 100644
--- a/src/newcertificatewizard/listwidget.h
+++ b/src/newcertificatewizard/listwidget.h
@@ -1,59 +1,59 @@
/* -*- mode: c++; c-basic-offset:4 -*-
newcertificatewizard/listwidget.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2008 Klarälvdalens Datakonsult AB
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
+#include <QStringList>
#include <QWidget>
-#include <utils/pimpl_ptr.h>
+#include <memory>
class QString;
-#include <QStringList>
namespace Kleo
{
namespace NewCertificateUi
{
class ListWidget : public QWidget
{
Q_OBJECT
Q_PROPERTY(QStringList items READ items WRITE setItems USER true NOTIFY itemsChanged)
Q_PROPERTY(QRegularExpression regExpFilter READ regExpFilter WRITE setRegExpFilter)
Q_PROPERTY(QString defaultValue READ defaultValue WRITE setDefaultValue)
public:
explicit ListWidget(QWidget *parent = nullptr);
~ListWidget() override;
void setDefaultValue(const QString &defaultValue);
QString defaultValue() const;
void setRegExpFilter(const QRegularExpression &rx);
QRegularExpression regExpFilter() const;
QStringList items() const;
public Q_SLOTS:
void setItems(const QStringList &items);
Q_SIGNALS:
void itemsChanged();
private:
class Private;
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
Q_PRIVATE_SLOT(d, void slotAdd())
Q_PRIVATE_SLOT(d, void slotRemove())
Q_PRIVATE_SLOT(d, void slotUp())
Q_PRIVATE_SLOT(d, void slotDown())
Q_PRIVATE_SLOT(d, void slotSelectionChanged())
};
}
}
diff --git a/src/newcertificatewizard/newcertificatewizard.h b/src/newcertificatewizard/newcertificatewizard.h
index 197d7cb84..c2ab39ad4 100644
--- a/src/newcertificatewizard/newcertificatewizard.h
+++ b/src/newcertificatewizard/newcertificatewizard.h
@@ -1,59 +1,59 @@
/* -*- mode: c++; c-basic-offset:4 -*-
newcertificatewizard/newcertificatewizard.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2008 Klarälvdalens Datakonsult AB
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include <QWizard>
-#include <utils/pimpl_ptr.h>
-
#include <gpgme++/global.h>
+#include <memory>
+
class QDir;
namespace Kleo
{
namespace NewCertificateUi
{
class WizardPage;
}
class NewCertificateWizard : public QWizard
{
Q_OBJECT
public:
explicit NewCertificateWizard(QWidget *parent = nullptr);
~NewCertificateWizard() override;
void setProtocol(GpgME::Protocol protocol);
GpgME::Protocol protocol() const;
enum Pages {
EnterDetailsPageId,
KeyCreationPageId,
ResultPageId,
NumPages
};
protected:
void showEvent(QShowEvent *event) override;
private:
void restartAtEnterDetailsPage();
QDir tmpDir() const;
private:
class Private;
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
friend class ::Kleo::NewCertificateUi::WizardPage;
};
}
diff --git a/src/newcertificatewizard/resultpage_p.h b/src/newcertificatewizard/resultpage_p.h
index 2ee757140..66228e477 100644
--- a/src/newcertificatewizard/resultpage_p.h
+++ b/src/newcertificatewizard/resultpage_p.h
@@ -1,62 +1,64 @@
/* -*- mode: c++; c-basic-offset:4 -*-
newcertificatewizard/resultpage_p.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2008 Klarälvdalens Datakonsult AB
SPDX-FileCopyrightText: 2016, 2017 Bundesamt für Sicherheit in der Informationstechnik
SPDX-FileContributor: Intevation GmbH
SPDX-FileCopyrightText: 2022 g10 Code GmbH
SPDX-FileContributor: Ingo Klöcker <dev@ingo-kloecker.de>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include "wizardpage_p.h"
+#include <QPointer>
+
namespace GpgME
{
class Key;
}
namespace Kleo
{
class ExportCertificateCommand;
}
namespace Kleo::NewCertificateUi
{
class ResultPage : public WizardPage
{
Q_OBJECT
public:
explicit ResultPage(QWidget *p = nullptr);
~ResultPage() override;
void initializePage() override;
bool isError() const;
bool isComplete() const override;
private:
GpgME::Key key() const;
private Q_SLOTS:
void slotSaveRequestToFile();
void slotSendRequestByEMail();
void slotCreateSigningCertificate();
void slotCreateEncryptionCertificate();
private:
void toggleSignEncryptAndRestart();
private:
struct UI;
std::unique_ptr<UI> ui;
bool initialized : 1;
bool successfullyCreatedSigningCertificate : 1;
bool successfullyCreatedEncryptionCertificate : 1;
QPointer<Kleo::ExportCertificateCommand> exportCertificateCommand;
};
}
diff --git a/src/systrayicon.h b/src/systrayicon.h
index 3a186ece1..ffa131d2c 100644
--- a/src/systrayicon.h
+++ b/src/systrayicon.h
@@ -1,44 +1,44 @@
/* -*- mode: c++; c-basic-offset:4 -*-
systrayicon.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2007 Klarälvdalens Datakonsult AB
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include <utils/systemtrayicon.h>
#ifndef QT_NO_SYSTEMTRAYICON
-#include <utils/pimpl_ptr.h>
+#include <memory>
class MainWindow;
class QDialog;
class SysTrayIcon : public Kleo::SystemTrayIcon
{
Q_OBJECT
public:
explicit SysTrayIcon(QObject *parent = nullptr);
~SysTrayIcon() override;
MainWindow *mainWindow() const;
QDialog *attentionWindow() const;
public Q_SLOTS:
void setFirstCardWithNullPin(const std::string &serialNumber);
private:
void doActivated() override;
void slotEnableDisableActions() override;
private:
class Private;
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
Q_PRIVATE_SLOT(d, void slotAbout())
Q_PRIVATE_SLOT(d, void slotSetInitialPin())
};
#endif // QT_NO_SYSTEMTRAYICON
diff --git a/src/uiserver/assuancommand.h b/src/uiserver/assuancommand.h
index 0c0b677f1..232a806f7 100644
--- a/src/uiserver/assuancommand.h
+++ b/src/uiserver/assuancommand.h
@@ -1,378 +1,377 @@
/* -*- mode: c++; c-basic-offset:4 -*-
uiserver/assuancommand.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2007 Klarälvdalens Datakonsult AB
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
-#include <utils/pimpl_ptr.h>
#include <utils/types.h>
#include <gpgme++/error.h>
#include <gpgme++/global.h>
#include <gpg-error.h>
#include <KMime/Types>
#include <qwindowdefs.h> // for WId
#include <map>
#include <memory>
#include <string>
#include <vector>
class QVariant;
class QObject;
#include <QStringList>
struct assuan_context_s;
namespace Kleo
{
class Input;
class Output;
class AssuanCommandFactory;
/*!
\brief Base class for GnuPG UI Server commands
\note large parts of this are outdated by now!
<h3>Implementing a new AssuanCommand</h3>
You do not directly inherit AssuanCommand, unless you want to
deal with implementing low-level, repetitive things like name()
in terms of staticName(). Assuming you don't, then you inherit
your command class from AssuanCommandMixin, passing your class
as the template argument to AssuanCommandMixin, like this:
\code
class MyFooCommand : public AssuanCommandMixin<MyFooCommand> {
\endcode
(http://en.wikipedia.org/wiki/Curiously_recurring_template_pattern)
You then choose a command name, and return that from the static
method staticName(), which is by convention queried by both
AssuanCommandMixin<> and GenericAssuanCommandFactory<>:
\code
static const char * staticName() { return "MYFOO"; }
\endcode
The string should be all-uppercase by convention, but the
UiServer implementation doesn't enforce this.
The next step is to implement start(), the starting point of
command execution:
<h3>Executing the command</h3>
\code
int start( const std::string & line ) {
\endcode
This should set everything up and check the parameters in \a
line and any options this command understands. If there's an
error, choose one of the gpg-error codes and create a
gpg_error_t from it using the protected makeError() function:
\code
return makeError( GPG_ERR_NOT_IMPLEMENTED );
\endcode
But usually, you will want to create a dialog, or call some
GpgME function from here. In case of errors from GpgME, you
shouldn't pipe them through makeError(), but return them
as-is. This will preserve the error source. Error created using
makeError() will have Kleopatra as their error source, so watch
out what you're doing :)
In addition to options and the command line, your command might
require <em>bulk data</em> input or output. That's what the bulk
input and output channels are for. You can check whether the
client handed you an input channel by checking that
bulkInputDevice() isn't NULL, likewise for bulkOutputDevice().
If everything is ok, you return 0. This indicates to the client
that the command has been accepted and is now in progress.
In this mode (start() returned 0), there are a bunch of options
for your command to do. Some commands may require additional
information from the client. The options passed to start() are
designed to be persistent across commands, and rather limited in
length (there's a strict line length limit in the assuan
protocol with no line continuation mechanism). The same is true
for command line arguments, which, in addition, you have to
parse yourself. Those usually apply only to this command, and
not to following ones.
If you need data that might be larger than the line length
limit, you can either expect it on the bulkInputDevice(), or, if
you have the need for more than one such data channel, or the
data is optional or conditional on some condition that can only
be determined during command execution, you can \em inquire the
missing information from the client.
As an example, a VERIFY command would expect the signed data on
the bulkInputDevice(). But if the input stream doesn't contain
an embedded (opaque) signature, indicating a \em detached
signature, it would go and inquire that data from the
client. Here's how it works:
\code
const int err = inquire( "DETACHED_SIGNATURE",
this, SLOT(slotDetachedSignature(int,QByteArray,QByteArray)) );
if ( err )
done( err );
\endcode
This should be self-explanatory: You give a slot to call when
the data has arrived. The slot's first argument is an error
code. The second the data (if any), and the third is just
repeating what you gave as inquire()'s first argument. As usual,
you can leave argument off of the end, if you are not interested
in them.
You can do as many inquiries as you want, but only one at a
time.
You should periodically send status updates to the client. You do
that by calling sendStatus().
Once your command has finished executing, call done(). If it's
with an error code, call done(err) like above. <b>Do not
forget to call done() when done!</b>. It will close
bulkInputDevice(), bulkOutputDevice(), and send an OK or ERR
message back to the client.
At that point, your command has finished executing, and a new
one can be accepted, or the connection closed.
Apropos connection closed. The only way for the client to cancel
an operation is to shut down the connection. In this case, the
canceled() function will be called. At that point, the
connection to the client will have been broken already, and all
you can do is pack your things and go down gracefully.
If _you_ detect that the user has canceled (your dialog contains
a cancel button, doesn't it?), then you should instead call
done( GPG_ERR_CANCELED ), like for normal operation.
<h3>Registering the command with UiServer</h3>
To register a command, you implement a AssuanCommandFactory for
your AssuanCommand subclass, and register it with the
UiServer. This can be made considerably easier using
GenericAssuanCommandFactory:
\code
UiServer server;
server.registerCommandFactory( shared_ptr<AssuanCommandFactory>( new GenericAssuanCommandFactory<MyFooCommand> ) );
// more registerCommandFactory calls...
server.start();
\endcode
*/
class AssuanCommand : public ExecutionContext, public std::enable_shared_from_this<AssuanCommand>
{
// defined in assuanserverconnection.cpp!
public:
AssuanCommand();
~AssuanCommand() override;
int start();
void canceled();
virtual const char *name() const = 0;
class Memento
{
public:
virtual ~Memento()
{
}
};
template<typename T>
class TypedMemento : public Memento
{
T m_t;
public:
explicit TypedMemento(const T &t)
: m_t(t)
{
}
const T &get() const
{
return m_t;
}
T &get()
{
return m_t;
}
};
template<typename T>
static std::shared_ptr<TypedMemento<T>> make_typed_memento(const T &t)
{
return std::shared_ptr<TypedMemento<T>>(new TypedMemento<T>(t));
}
static int makeError(int code);
// convenience methods:
enum Mode { NoMode, EMail, FileManager };
Mode checkMode() const;
enum CheckProtocolOption {
AllowProtocolMissing = 0x01,
};
GpgME::Protocol checkProtocol(Mode mode, int options = 0) const;
void applyWindowID(QWidget *w) const override
{
doApplyWindowID(w);
}
WId parentWId() const;
void setNohup(bool on);
bool isNohup() const;
bool isDone() const;
QString sessionTitle() const;
unsigned int sessionId() const;
bool informativeRecipients() const;
bool informativeSenders() const;
const std::vector<KMime::Types::Mailbox> &recipients() const;
const std::vector<KMime::Types::Mailbox> &senders() const;
bool hasMemento(const QByteArray &tag) const;
std::shared_ptr<Memento> memento(const QByteArray &tag) const;
template<typename T>
std::shared_ptr<T> mementoAs(const QByteArray &tag) const
{
return std::dynamic_pointer_cast<T>(this->memento(tag));
}
QByteArray registerMemento(const std::shared_ptr<Memento> &mem);
QByteArray registerMemento(const QByteArray &tag, const std::shared_ptr<Memento> &mem);
void removeMemento(const QByteArray &tag);
template<typename T>
T mementoContent(const QByteArray &tag) const
{
if (std::shared_ptr<TypedMemento<T>> m = mementoAs<TypedMemento<T>>(tag)) {
return m->get();
} else {
return T();
}
}
bool hasOption(const char *opt) const;
QVariant option(const char *opt) const;
const std::map<std::string, QVariant> &options() const;
const std::vector<std::shared_ptr<Input>> &inputs() const;
const std::vector<std::shared_ptr<Input>> &messages() const;
const std::vector<std::shared_ptr<Output>> &outputs() const;
QStringList fileNames() const;
unsigned int numFiles() const;
void sendStatus(const char *keyword, const QString &text);
void sendStatusEncoded(const char *keyword, const std::string &text);
void sendData(const QByteArray &data, bool moreToCome = false);
int inquire(const char *keyword, QObject *receiver, const char *slot, unsigned int maxSize = 0);
void done(const GpgME::Error &err = GpgME::Error());
void done(const GpgME::Error &err, const QString &details);
void done(int err)
{
done(GpgME::Error(err));
}
void done(int err, const QString &details)
{
done(GpgME::Error(err), details);
}
private:
virtual void doCanceled() = 0;
virtual int doStart() = 0;
private:
void doApplyWindowID(QWidget *w) const;
private:
const std::map<QByteArray, std::shared_ptr<Memento>> &mementos() const;
private:
friend class ::Kleo::AssuanCommandFactory;
class Private;
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
};
class AssuanCommandFactory
{
public:
virtual ~AssuanCommandFactory()
{
}
virtual std::shared_ptr<AssuanCommand> create() const = 0;
virtual const char *name() const = 0;
using _Handler = gpg_error_t (*)(assuan_context_s *, char *);
virtual _Handler _handler() const = 0;
static gpg_error_t _handle(assuan_context_s *, char *, const char *);
};
template<typename Command>
class GenericAssuanCommandFactory : public AssuanCommandFactory
{
AssuanCommandFactory::_Handler _handler() const override
{
return &GenericAssuanCommandFactory::_handle;
}
static gpg_error_t _handle(assuan_context_s *_ctx, char *_line)
{
return AssuanCommandFactory::_handle(_ctx, _line, Command::staticName());
}
std::shared_ptr<AssuanCommand> create() const override
{
return make();
}
const char *name() const override
{
return Command::staticName();
}
public:
static std::shared_ptr<Command> make()
{
return std::shared_ptr<Command>(new Command);
}
};
template<typename Derived, typename Base = AssuanCommand>
class AssuanCommandMixin : public Base
{
protected:
/* reimp */ const char *name() const override
{
return Derived::staticName();
}
};
}
diff --git a/src/uiserver/assuanserverconnection.h b/src/uiserver/assuanserverconnection.h
index ac5f4b990..d23f1ddb9 100644
--- a/src/uiserver/assuanserverconnection.h
+++ b/src/uiserver/assuanserverconnection.h
@@ -1,49 +1,47 @@
/* -*- mode: c++; c-basic-offset:4 -*-
uiserver/assuanserverconnection.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2007 Klarälvdalens Datakonsult AB
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include <QObject>
#include <assuan.h> // for assuan_fd_t
-#include <utils/pimpl_ptr.h>
-
#include <memory>
#include <string>
#include <vector>
namespace Kleo
{
class AssuanCommandFactory;
class AssuanServerConnection : public QObject
{
Q_OBJECT
public:
AssuanServerConnection(assuan_fd_t fd, const std::vector<std::shared_ptr<AssuanCommandFactory>> &factories, QObject *parent = nullptr);
~AssuanServerConnection() override;
public Q_SLOTS:
void enableCryptoCommands(bool enable = true);
Q_SIGNALS:
void closed(Kleo::AssuanServerConnection *which);
void startKeyManagerRequested();
void startConfigDialogRequested();
public:
class Private;
private:
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
};
}
diff --git a/src/uiserver/createchecksumscommand.h b/src/uiserver/createchecksumscommand.h
index 2e289ef21..65378ce04 100644
--- a/src/uiserver/createchecksumscommand.h
+++ b/src/uiserver/createchecksumscommand.h
@@ -1,47 +1,47 @@
/* -*- mode: c++; c-basic-offset:4 -*-
uiserver/createchecksumscommand.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2010 Klarälvdalens Datakonsult AB
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include "assuancommand.h"
#include <QObject>
-#include <utils/pimpl_ptr.h>
+#include <memory>
namespace Kleo
{
class CreateChecksumsCommand : public QObject, public AssuanCommandMixin<CreateChecksumsCommand>
{
Q_OBJECT
public:
CreateChecksumsCommand();
~CreateChecksumsCommand() override;
static const char *staticName()
{
return "CHECKSUM_CREATE_FILES";
}
private:
int doStart() override;
void doCanceled() override;
#ifdef Q_MOC_RUN
private Q_SLOTS:
void done();
void done(int, QString);
#endif
private:
class Private;
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
};
}
diff --git a/src/uiserver/decryptverifycommandemailbase.h b/src/uiserver/decryptverifycommandemailbase.h
index f04244344..3fa8782e2 100644
--- a/src/uiserver/decryptverifycommandemailbase.h
+++ b/src/uiserver/decryptverifycommandemailbase.h
@@ -1,64 +1,65 @@
/* -*- mode: c++; c-basic-offset:4 -*-
uiserver/decryptverifycommandemailbase.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2008 Klarälvdalens Datakonsult AB
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include "assuancommand.h"
-#include <utils/pimpl_ptr.h>
#include <utils/types.h>
+#include <memory>
+
namespace Kleo
{
class DecryptVerifyCommandEMailBase : public AssuanCommandMixin<DecryptVerifyCommandEMailBase>
{
public:
explicit DecryptVerifyCommandEMailBase();
~DecryptVerifyCommandEMailBase() override;
private:
virtual DecryptVerifyOperation operation() const = 0;
virtual Mode mode() const
{
return EMail;
}
private:
int doStart() override;
void doCanceled() override;
public:
static const char *staticName()
{
return "";
}
class Private;
private:
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
};
class DecryptVerifyCommand : public AssuanCommandMixin<DecryptVerifyCommand, DecryptVerifyCommandEMailBase>
{
public:
private:
DecryptVerifyOperation operation() const override
{
return DecryptVerify;
}
public:
static const char *staticName()
{
return "DECRYPT_VERIFY";
}
};
}
diff --git a/src/uiserver/decryptverifycommandfilesbase.h b/src/uiserver/decryptverifycommandfilesbase.h
index a93cc00b5..8e9e78592 100644
--- a/src/uiserver/decryptverifycommandfilesbase.h
+++ b/src/uiserver/decryptverifycommandfilesbase.h
@@ -1,59 +1,60 @@
/* -*- mode: c++; c-basic-offset:4 -*-
uiserver/decryptverifycommandfilesbase.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2008 Klarälvdalens Datakonsult AB
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include "assuancommand.h"
-#include <utils/pimpl_ptr.h>
#include <utils/types.h>
+#include <memory>
+
namespace Kleo
{
class DecryptVerifyCommandFilesBase : public AssuanCommandMixin<DecryptVerifyCommandFilesBase>
{
public:
enum Flags {
DecryptOff = 0x0,
DecryptOn = 0x1,
DecryptImplied = 0x2,
DecryptMask = 0x3,
VerifyOff = 0x00,
// VerifyOn = 0x10, // non-sensical
VerifyImplied = 0x20,
VerifyMask = 0x30
};
explicit DecryptVerifyCommandFilesBase();
~DecryptVerifyCommandFilesBase() override;
private:
virtual DecryptVerifyOperation operation() const = 0;
private:
int doStart() override;
void doCanceled() override;
public:
// ### FIXME fix this
static const char *staticName()
{
return "";
}
class Private;
private:
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
};
}
diff --git a/src/uiserver/echocommand.h b/src/uiserver/echocommand.h
index fa287b8b9..6d76b89ed 100644
--- a/src/uiserver/echocommand.h
+++ b/src/uiserver/echocommand.h
@@ -1,66 +1,66 @@
/* -*- mode: c++; c-basic-offset:4 -*-
uiserver/echocommand.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2007 Klarälvdalens Datakonsult AB
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include "assuancommand.h"
#include <QObject>
namespace Kleo
{
/*!
\brief GnuPG UI Server command for testing
<h3>Usage</h3>
\code
ECHO [--inquire <keyword>] [--nohup]
\endcode
<h3>Description</h3>
The ECHO command is a simple tool for testing. If a bulk input
channel has been set up by the client, ECHO will read data from
it, and pipe it right back into the bulk output channel. It is
an error for an input channel to exist without an output
channel.
ECHO will also send back any non-option command line arguments
in a status message. If the --inquire command line option has
been given, ECHO will inquire with that keyword, and send the
received data back on the status channel.
*/
class EchoCommand : public QObject, public AssuanCommandMixin<EchoCommand>
{
Q_OBJECT
public:
EchoCommand();
~EchoCommand() override;
static const char *staticName()
{
return "ECHO";
}
private:
int doStart() override;
void doCanceled() override;
private Q_SLOTS:
void slotInquireData(int, const QByteArray &);
void slotInputReadyRead();
void slotOutputBytesWritten();
private:
class Private;
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
};
}
diff --git a/src/uiserver/encryptcommand.h b/src/uiserver/encryptcommand.h
index f09d6b743..75d48e7b3 100644
--- a/src/uiserver/encryptcommand.h
+++ b/src/uiserver/encryptcommand.h
@@ -1,41 +1,41 @@
/* -*- mode: c++; c-basic-offset:4 -*-
uiserver/encryptcommand.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2007 Klarälvdalens Datakonsult AB
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include "assuancommand.h"
-#include <utils/pimpl_ptr.h>
+#include <memory>
namespace Kleo
{
class EncryptCommand : public Kleo::AssuanCommandMixin<EncryptCommand>
{
public:
EncryptCommand();
~EncryptCommand() override;
private:
int doStart() override;
void doCanceled() override;
public:
static const char *staticName()
{
return "ENCRYPT";
}
class Private;
private:
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
};
}
diff --git a/src/uiserver/importfilescommand.h b/src/uiserver/importfilescommand.h
index 72b931ec0..8ea9a3c28 100644
--- a/src/uiserver/importfilescommand.h
+++ b/src/uiserver/importfilescommand.h
@@ -1,41 +1,41 @@
/* -*- mode: c++; c-basic-offset:4 -*-
uiserver/importfilescommand.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2008 Klarälvdalens Datakonsult AB
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include "assuancommand.h"
#include <QObject>
namespace Kleo
{
class ImportFilesCommand : public QObject, public AssuanCommandMixin<ImportFilesCommand>
{
Q_OBJECT
public:
ImportFilesCommand();
~ImportFilesCommand() override;
static const char *staticName()
{
return "IMPORT_FILES";
}
private:
int doStart() override;
void doCanceled() override;
private:
class Private;
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
Q_PRIVATE_SLOT(d, void slotCommandFinished())
Q_PRIVATE_SLOT(d, void slotCommandCanceled())
};
}
diff --git a/src/uiserver/prepencryptcommand.h b/src/uiserver/prepencryptcommand.h
index a36842b01..44724be50 100644
--- a/src/uiserver/prepencryptcommand.h
+++ b/src/uiserver/prepencryptcommand.h
@@ -1,41 +1,41 @@
/* -*- mode: c++; c-basic-offset:4 -*-
uiserver/prepencryptcommand.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2007 Klarälvdalens Datakonsult AB
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include "assuancommand.h"
-#include <utils/pimpl_ptr.h>
+#include <memory>
namespace Kleo
{
class PrepEncryptCommand : public Kleo::AssuanCommandMixin<PrepEncryptCommand>
{
public:
PrepEncryptCommand();
~PrepEncryptCommand() override;
private:
int doStart() override;
void doCanceled() override;
public:
static const char *staticName()
{
return "PREP_ENCRYPT";
}
class Private;
private:
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
};
}
diff --git a/src/uiserver/prepsigncommand.h b/src/uiserver/prepsigncommand.h
index ed0eed3ac..fedb6cd3c 100644
--- a/src/uiserver/prepsigncommand.h
+++ b/src/uiserver/prepsigncommand.h
@@ -1,41 +1,41 @@
/* -*- mode: c++; c-basic-offset:4 -*-
uiserver/prepsigncommand.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2010 Klarälvdalens Datakonsult AB
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include "assuancommand.h"
-#include <utils/pimpl_ptr.h>
+#include <memory>
namespace Kleo
{
class PrepSignCommand : public Kleo::AssuanCommandMixin<PrepSignCommand>
{
public:
PrepSignCommand();
~PrepSignCommand() override;
private:
int doStart() override;
void doCanceled() override;
public:
static const char *staticName()
{
return "PREP_SIGN";
}
class Private;
private:
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
};
}
diff --git a/src/uiserver/selectcertificatecommand.h b/src/uiserver/selectcertificatecommand.h
index f10e01f9d..7fad4d34d 100644
--- a/src/uiserver/selectcertificatecommand.h
+++ b/src/uiserver/selectcertificatecommand.h
@@ -1,42 +1,42 @@
/* -*- mode: c++; c-basic-offset:4 -*-
uiserver/selectcertificatecommand.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2007 Klarälvdalens Datakonsult AB
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include "assuancommand.h"
#include <QObject>
namespace Kleo
{
class SelectCertificateCommand : public QObject, public AssuanCommandMixin<SelectCertificateCommand>
{
Q_OBJECT
public:
SelectCertificateCommand();
~SelectCertificateCommand() override;
static const char *staticName()
{
return "SELECT_CERTIFICATE";
}
private:
int doStart() override;
void doCanceled() override;
private:
class Private;
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
Q_PRIVATE_SLOT(d, void slotSelectedCertificates(int, QByteArray))
Q_PRIVATE_SLOT(d, void slotDialogAccepted())
Q_PRIVATE_SLOT(d, void slotDialogRejected())
};
}
diff --git a/src/uiserver/signcommand.h b/src/uiserver/signcommand.h
index d689686bf..eb58effba 100644
--- a/src/uiserver/signcommand.h
+++ b/src/uiserver/signcommand.h
@@ -1,41 +1,41 @@
/* -*- mode: c++; c-basic-offset:4 -*-
uiserver/signcommand.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2007 Klarälvdalens Datakonsult AB
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include "assuancommand.h"
-#include <utils/pimpl_ptr.h>
+#include <memory>
namespace Kleo
{
class SignCommand : public Kleo::AssuanCommandMixin<SignCommand>
{
public:
SignCommand();
~SignCommand() override;
private:
int doStart() override;
void doCanceled() override;
public:
static const char *staticName()
{
return "SIGN";
}
class Private;
private:
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
};
}
diff --git a/src/uiserver/signencryptfilescommand.h b/src/uiserver/signencryptfilescommand.h
index 40ba8f2e2..f71fbbbd6 100644
--- a/src/uiserver/signencryptfilescommand.h
+++ b/src/uiserver/signencryptfilescommand.h
@@ -1,97 +1,97 @@
/* -*- mode: c++; c-basic-offset:4 -*-
uiserver/signencryptfilescommand.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2007 Klarälvdalens Datakonsult AB
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include "assuancommand.h"
-#include <utils/pimpl_ptr.h>
+#include <memory>
namespace Kleo
{
class SignEncryptFilesCommand : public Kleo::AssuanCommandMixin<SignEncryptFilesCommand>
{
public:
SignEncryptFilesCommand();
~SignEncryptFilesCommand() override;
protected:
enum Operation {
SignDisallowed = 0,
SignAllowed = 1,
SignSelected = 2,
SignMask = SignAllowed | SignSelected,
EncryptDisallowed = 0,
EncryptAllowed = 4,
EncryptSelected = 8,
EncryptMask = EncryptAllowed | EncryptSelected
};
private:
virtual unsigned int operation() const
{
return SignSelected | EncryptSelected;
}
private:
int doStart() override;
void doCanceled() override;
public:
static const char *staticName()
{
return "SIGN_ENCRYPT_FILES";
}
class Private;
private:
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
};
class EncryptSignFilesCommand : public Kleo::AssuanCommandMixin<EncryptSignFilesCommand, SignEncryptFilesCommand>
{
public:
static const char *staticName()
{
return "ENCRYPT_SIGN_FILES";
}
};
class EncryptFilesCommand : public Kleo::AssuanCommandMixin<EncryptFilesCommand, SignEncryptFilesCommand>
{
public:
static const char *staticName()
{
return "ENCRYPT_FILES";
}
unsigned int operation() const override
{
return SignAllowed | EncryptSelected;
}
};
class SignFilesCommand : public Kleo::AssuanCommandMixin<SignFilesCommand, SignEncryptFilesCommand>
{
public:
static const char *staticName()
{
return "SIGN_FILES";
}
unsigned int operation() const override
{
return SignSelected | EncryptAllowed;
}
};
}
diff --git a/src/uiserver/uiserver.h b/src/uiserver/uiserver.h
index 9b14a5010..5bb3dc817 100644
--- a/src/uiserver/uiserver.h
+++ b/src/uiserver/uiserver.h
@@ -1,59 +1,57 @@
/* -*- mode: c++; c-basic-offset:4 -*-
uiserver/uiserver.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2007 Klarälvdalens Datakonsult AB
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include <QObject>
-#include <utils/pimpl_ptr.h>
-
#include <cstdio>
#include <memory>
class QString;
namespace Kleo
{
class AssuanCommandFactory;
class UiServer : public QObject
{
Q_OBJECT
public:
explicit UiServer(const QString &socket, QObject *parent = nullptr);
~UiServer() override;
static void setLogStream(FILE *file);
bool registerCommandFactory(const std::shared_ptr<AssuanCommandFactory> &cmdFactory);
bool waitForStopped(unsigned int ms = 0xFFFFFFFF);
bool isStopped() const;
bool isStopping() const;
QString socketName() const;
public Q_SLOTS:
void start();
void stop();
void enableCryptoCommands(bool enable = true);
Q_SIGNALS:
void stopped();
void startKeyManagerRequested();
void startConfigDialogRequested();
private:
class Private;
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
};
}
diff --git a/src/uiserver/verifychecksumscommand.h b/src/uiserver/verifychecksumscommand.h
index e502835bd..7fb688926 100644
--- a/src/uiserver/verifychecksumscommand.h
+++ b/src/uiserver/verifychecksumscommand.h
@@ -1,50 +1,50 @@
/* -*- mode: c++; c-basic-offset:4 -*-
uiserver/verifychecksumscommand.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2010 Klarälvdalens Datakonsult AB
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include "assuancommand.h"
#ifndef QT_NO_DIRMODEL
#include <QObject>
namespace Kleo
{
class VerifyChecksumsCommand : public QObject, public AssuanCommandMixin<VerifyChecksumsCommand>
{
Q_OBJECT
public:
VerifyChecksumsCommand();
~VerifyChecksumsCommand() override;
static const char *staticName()
{
return "CHECKSUM_VERIFY_FILES";
}
private:
int doStart() override;
void doCanceled() override;
#ifdef Q_MOC_RUN
private Q_SLOTS:
void done();
void done(int, QString);
#endif
private:
class Private;
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
};
}
#endif // QT_NO_DIRMODEL
diff --git a/src/uiserver/verifycommand.h b/src/uiserver/verifycommand.h
index df20e23c9..40f843acc 100644
--- a/src/uiserver/verifycommand.h
+++ b/src/uiserver/verifycommand.h
@@ -1,41 +1,39 @@
/* -*- mode: c++; c-basic-offset:4 -*-
uiserver/verifycommand.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2007 Klarälvdalens Datakonsult AB
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include "assuancommand.h"
-#include <utils/pimpl_ptr.h>
-
namespace Kleo
{
class VerifyCommand : public AssuanCommandMixin<VerifyCommand, DecryptVerifyCommandEMailBase>
{
public:
// VerifyCommand();
//~VerifyCommand();
private:
DecryptVerifyOperation operation() const override
{
return Verify;
}
Mode mode() const override
{
return EMail;
}
public:
static const char *staticName()
{
return "VERIFY";
}
};
}
diff --git a/src/utils/headerview.h b/src/utils/headerview.h
index df9d09f13..eb0001488 100644
--- a/src/utils/headerview.h
+++ b/src/utils/headerview.h
@@ -1,41 +1,40 @@
/* -*- mode: c++; c-basic-offset:4 -*-
utils/headerview.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2008 Klarälvdalens Datakonsult AB
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include <QHeaderView>
-#include <utils/pimpl_ptr.h>
-
+#include <memory>
#include <vector>
namespace Kleo
{
class HeaderView : public QHeaderView
{
Q_OBJECT
public:
explicit HeaderView(Qt::Orientation o, QWidget *parent = nullptr);
~HeaderView() override;
void setSectionSizes(const std::vector<int> &sizes);
std::vector<int> sectionSizes() const;
private:
//@{
/*! Defined, but not implemented, to catch at least some usage errors */
void setResizeMode(int, ResizeMode);
//@}
private:
class Private;
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
};
}
diff --git a/src/utils/iodevicelogger.h b/src/utils/iodevicelogger.h
index 0509933c7..d83c64087 100644
--- a/src/utils/iodevicelogger.h
+++ b/src/utils/iodevicelogger.h
@@ -1,54 +1,52 @@
/* -*- mode: c++; c-basic-offset:4 -*-
iodevicelogger.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2008 Klarälvdalens Datakonsult AB
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include <QIODevice>
-#include <utils/pimpl_ptr.h>
-
#include <memory>
namespace Kleo
{
class IODeviceLogger : public QIODevice
{
Q_OBJECT
public:
explicit IODeviceLogger(const std::shared_ptr<QIODevice> &iod, QObject *parent = nullptr);
~IODeviceLogger() override;
void setWriteLogDevice(const std::shared_ptr<QIODevice> &dev);
void setReadLogDevice(const std::shared_ptr<QIODevice> &dev);
bool atEnd() const override;
qint64 bytesAvailable() const override;
qint64 bytesToWrite() const override;
bool canReadLine() const override;
void close() override;
bool isSequential() const override;
bool open(OpenMode mode) override;
qint64 pos() const override;
bool reset() override;
bool seek(qint64 pos) override;
qint64 size() const override;
bool waitForBytesWritten(int msecs) override;
bool waitForReadyRead(int msecs) override;
protected:
qint64 readData(char *data, qint64 maxSize) override;
qint64 writeData(const char *data, qint64 maxSize) override;
qint64 readLineData(char *data, qint64 maxSize) override;
private:
class Private;
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
};
}
diff --git a/src/utils/kdtoolsglobal.h b/src/utils/kdtoolsglobal.h
index bbb534ee9..e2a306174 100644
--- a/src/utils/kdtoolsglobal.h
+++ b/src/utils/kdtoolsglobal.h
@@ -1,74 +1,29 @@
/****************************************************************************
** SPDX-FileCopyrightText: 2001-2007 Klarälvdalens Datakonsult AB. All rights reserved.
**
** This file is part of the KD Tools library.
**
** SPDX-License-Identifier: GPL-2.0-only
**
**********************************************************************/
#pragma once
-#include <QPointer>
-#include <qglobal.h>
-
-#define KDAB_DISABLE_COPY(x) \
-private: \
- x(const x &); \
- x &operator=(const x &)
-
-#ifdef DOXYGEN_RUN
-#define KDAB_IMPLEMENT_SAFE_BOOL_OPERATOR(func) \
- operator unspecified_bool_type() const \
- { \
- return func; \
- }
-#else
-#define KDAB_IMPLEMENT_SAFE_BOOL_OPERATOR(func) \
-private: \
- struct __safe_bool_dummy__ { \
- void nonnull(); \
- }; \
- typedef void (__safe_bool_dummy__::*unspecified_bool_type)(); \
- \
-public: \
- operator unspecified_bool_type() const \
- { \
- return (func) ? &__safe_bool_dummy__::nonnull : 0; \
- }
-#endif
-
-#define KDTOOLS_MAKE_RELATION_OPERATORS(Class, linkage) \
- linkage bool operator>(const Class &lhs, const Class &rhs) \
- { \
- return operator<(lhs, rhs); \
- } \
- linkage bool operator!=(const Class &lhs, const Class &rhs) \
- { \
- return !operator==(lhs, rhs); \
- } \
- linkage bool operator<=(const Class &lhs, const Class &rhs) \
- { \
- return !operator>(lhs, rhs); \
- } \
- linkage bool operator>=(const Class &lhs, const Class &rhs) \
- { \
- return !operator<(lhs, rhs); \
- }
+#include <QMutexLocker>
template<typename T>
inline T &__kdtools__dereference_for_methodcall(T &o)
{
return o;
}
template<typename T>
inline T &__kdtools__dereference_for_methodcall(T *o)
{
return *o;
}
#define KDAB_SYNCHRONIZED(mutex) \
if (bool __counter_##__LINE__ = false) { \
} else \
for (QMutexLocker __locker_##__LINE__(&__kdtools__dereference_for_methodcall(mutex)); !__counter_##__LINE__; __counter_##__LINE__ = true)
diff --git a/src/utils/log.h b/src/utils/log.h
index 5f4cd5c5c..10e040197 100644
--- a/src/utils/log.h
+++ b/src/utils/log.h
@@ -1,59 +1,59 @@
/* -*- mode: c++; c-basic-offset:4 -*-
utils/log.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2008 Klarälvdalens Datakonsult AB
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
-#include <utils/pimpl_ptr.h>
+#include <QtLogging>
#include <memory>
#include <cstdio>
class QIODevice;
class QString;
namespace Kleo
{
class Log
{
public:
enum OpenMode {
Read = 0x1,
Write = 0x2,
};
static void messageHandler(QtMsgType type, const QMessageLogContext &ctx, const QString &msg);
static std::shared_ptr<const Log> instance();
static std::shared_ptr<Log> mutableInstance();
~Log();
bool ioLoggingEnabled() const;
void setIOLoggingEnabled(bool enabled);
QString outputDirectory() const;
void setOutputDirectory(const QString &path);
std::shared_ptr<QIODevice> createIOLogger(const std::shared_ptr<QIODevice> &wrapped, const QString &prefix, OpenMode mode) const;
FILE *logFile() const;
private:
Log();
private:
class Private;
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
Q_DISABLE_COPY(Log)
};
}
diff --git a/src/utils/output.h b/src/utils/output.h
index 6ed57ec3a..4ff13dbcd 100644
--- a/src/utils/output.h
+++ b/src/utils/output.h
@@ -1,94 +1,92 @@
/* -*- mode: c++; c-basic-offset:4 -*-
utils/output.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2007 Klarälvdalens Datakonsult AB
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include <assuan.h> // for assuan_fd_t
-#include <utils/pimpl_ptr.h>
-
#include <QString>
#include <QStringList>
#include <memory>
class QIODevice;
class QDir;
class QWidget;
namespace Kleo
{
class OverwritePolicy
{
public:
enum Policy {
Ask,
Overwrite,
Rename,
Skip,
Cancel,
};
enum Options {
MultipleFiles = 1,
};
explicit OverwritePolicy(Policy initialPolicy);
/// creates an interactive policy, i.e. with initial policy set to Ask
OverwritePolicy(QWidget *parent, Options options);
~OverwritePolicy();
Policy policy() const;
void setPolicy(Policy);
/// returns the file name to write to or an empty string if overwriting was declined
QString obtainOverwritePermission(const QString &fileName);
private:
class Private;
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
};
class Output
{
public:
virtual ~Output();
virtual void setLabel(const QString &label) = 0;
virtual QString label() const = 0;
virtual std::shared_ptr<QIODevice> ioDevice() const = 0;
virtual QString errorString() const = 0;
virtual bool isFinalized() const = 0;
virtual void finalize() = 0;
virtual void cancel() = 0;
virtual bool binaryOpt() const = 0;
virtual void setBinaryOpt(bool value) = 0;
/** Whether or not the output failed. */
virtual bool failed() const
{
return false;
}
virtual QString fileName() const
{
return {};
}
static std::shared_ptr<Output> createFromFile(const QString &fileName, const std::shared_ptr<OverwritePolicy> &);
static std::shared_ptr<Output> createFromFile(const QString &fileName, bool forceOverwrite);
static std::shared_ptr<Output> createFromPipeDevice(assuan_fd_t fd, const QString &label);
static std::shared_ptr<Output> createFromProcessStdIn(const QString &command);
static std::shared_ptr<Output> createFromProcessStdIn(const QString &command, const QStringList &args);
static std::shared_ptr<Output> createFromProcessStdIn(const QString &command, const QStringList &args, const QDir &workingDirectory);
#ifndef QT_NO_CLIPBOARD
static std::shared_ptr<Output> createFromClipboard();
#endif
static std::shared_ptr<Output> createFromByteArray(QByteArray *data, const QString &label);
};
}
diff --git a/src/utils/pimpl_ptr.h b/src/utils/pimpl_ptr.h
deleted file mode 100644
index f5367f2ee..000000000
--- a/src/utils/pimpl_ptr.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/****************************************************************************
-** SPDX-FileCopyrightText: 2001-2007 Klarälvdalens Datakonsult AB. All rights reserved.
-**
-** This file is part of the KD Tools library.
-**
-** SPDX-License-Identifier: GPL-2.0-only
-**
-**********************************************************************/
-
-#pragma once
-
-#include <utils/kdtoolsglobal.h>
-
-namespace kdtools
-{
-
-template<typename T>
-class pimpl_ptr
-{
- KDAB_DISABLE_COPY(pimpl_ptr);
- T *d;
-
-public:
- pimpl_ptr()
- : d(new T)
- {
- }
- explicit pimpl_ptr(T *t)
- : d(t)
- {
- }
- ~pimpl_ptr()
- {
- delete d;
- d = nullptr;
- }
-
- T *get()
- {
- return d;
- }
- const T *get() const
- {
- return d;
- }
-
- T *operator->()
- {
- return get();
- }
- const T *operator->() const
- {
- return get();
- }
-
- T &operator*()
- {
- return *get();
- }
- const T &operator*() const
- {
- return *get();
- }
-
- KDAB_IMPLEMENT_SAFE_BOOL_OPERATOR(get())
-};
-
-// these are not implemented, so's we can catch their use at
-// link-time. Leaving them undeclared would open up a comparison
-// via operator unspecified-bool-type().
-template<typename T, typename S>
-void operator==(const pimpl_ptr<T> &, const pimpl_ptr<S> &);
-template<typename T, typename S>
-void operator!=(const pimpl_ptr<T> &, const pimpl_ptr<S> &);
-
-} // namespace kdtools
diff --git a/src/utils/systemtrayicon.h b/src/utils/systemtrayicon.h
index 548f3616a..f149b6f1c 100644
--- a/src/utils/systemtrayicon.h
+++ b/src/utils/systemtrayicon.h
@@ -1,63 +1,63 @@
/* -*- mode: c++; c-basic-offset:4 -*-
systemtrayicon.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2007, 2009 Klarälvdalens Datakonsult AB
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include <QSystemTrayIcon>
#ifndef QT_NO_SYSTEMTRAYICON
-#include <utils/pimpl_ptr.h>
+#include <memory>
namespace Kleo
{
class SystemTrayIcon : public QSystemTrayIcon
{
Q_OBJECT
public:
explicit SystemTrayIcon(QObject *parent = nullptr);
explicit SystemTrayIcon(const QIcon &icon, QObject *parent = nullptr);
~SystemTrayIcon() override;
void setMainWindow(QWidget *w);
QWidget *mainWindow() const;
void setAttentionWindow(QWidget *w);
QWidget *attentionWindow() const;
QIcon attentionIcon() const;
QIcon normalIcon() const;
bool attentionWanted() const;
public Q_SLOTS:
void setAttentionIcon(const QIcon &icon);
void setNormalIcon(const QIcon &icon);
void setAttentionWanted(bool);
protected Q_SLOTS:
virtual void slotEnableDisableActions() = 0;
private:
virtual void doMainWindowSet(QWidget *);
virtual void doMainWindowClosed(QWidget *);
virtual void doAttentionWindowClosed(QWidget *);
virtual void doActivated() = 0;
private:
bool eventFilter(QObject *, QEvent *) override;
private:
class Private;
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
};
} // namespace Kleo
#endif // QT_NO_SYSTEMTRAYICON
diff --git a/src/utils/types.h b/src/utils/types.h
index a99675be0..034e9a6f0 100644
--- a/src/utils/types.h
+++ b/src/utils/types.h
@@ -1,68 +1,66 @@
/* -*- mode: c++; c-basic-offset:4 -*-
utils/types.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2007 Klarälvdalens Datakonsult AB
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
-#include <utils/pimpl_ptr.h>
-
#include <memory>
class QWidget;
namespace Kleo
{
enum DecryptVerifyOperation {
Decrypt,
Verify,
DecryptVerify,
// VerifyOpaque,
// VerifyDetached,
};
enum VerificationMode {
Opaque,
Detached,
};
enum Policy {
NoPolicy,
Allow,
Force,
Deny,
};
class ExecutionContext
{
public:
virtual ~ExecutionContext()
{
}
virtual void applyWindowID(QWidget *widget) const = 0;
};
class ExecutionContextUser
{
public:
ExecutionContextUser();
explicit ExecutionContextUser(const std::shared_ptr<const ExecutionContext> &ec);
virtual ~ExecutionContextUser();
void setExecutionContext(const std::shared_ptr<const ExecutionContext> &ec);
std::shared_ptr<const ExecutionContext> executionContext() const;
protected:
void bringToForeground(QWidget *wid, bool stayOnTop = false);
void applyWindowID(QWidget *wid);
private:
class Private;
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
};
}
diff --git a/src/view/keylistcontroller.h b/src/view/keylistcontroller.h
index beeb8729c..7f44e63ba 100644
--- a/src/view/keylistcontroller.h
+++ b/src/view/keylistcontroller.h
@@ -1,99 +1,98 @@
/* -*- mode: c++; c-basic-offset:4 -*-
view/keylistcontroller.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2007 Klarälvdalens Datakonsult AB
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include <QObject>
#include <commands/command.h>
-#include <utils/pimpl_ptr.h>
-
+#include <memory>
#include <vector>
class QAbstractItemView;
class QAction;
class QPoint;
class QItemSelectionModel;
class KActionCollection;
namespace Kleo
{
class AbstractKeyListModel;
class Command;
class TabWidget;
class KeyListController : public QObject
{
Q_OBJECT
public:
explicit KeyListController(QObject *parent = nullptr);
~KeyListController() override;
std::vector<QAbstractItemView *> views() const;
void setFlatModel(AbstractKeyListModel *model);
AbstractKeyListModel *flatModel() const;
void setHierarchicalModel(AbstractKeyListModel *model);
AbstractKeyListModel *hierarchicalModel() const;
void setParentWidget(QWidget *parent);
QWidget *parentWidget() const;
QAbstractItemView *currentView() const;
void setTabWidget(TabWidget *tabs);
TabWidget *tabWidget() const;
void registerCommand(Command *cmd);
void createActions(KActionCollection *collection);
template<typename T_Command>
void registerActionForCommand(QAction *action)
{
this->registerAction(action, T_Command::restrictions(), &KeyListController::template create<T_Command>);
}
void enableDisableActions(const QItemSelectionModel *sm) const;
bool hasRunningCommands() const;
bool shutdownWarningRequired() const;
private:
void registerAction(QAction *action, Command::Restrictions restrictions, Command *(*create)(QAbstractItemView *, KeyListController *));
template<typename T_Command>
static Command *create(QAbstractItemView *v, KeyListController *c)
{
return new T_Command(v, c);
}
public Q_SLOTS:
void addView(QAbstractItemView *view);
void removeView(QAbstractItemView *view);
void setCurrentView(QAbstractItemView *view);
void cancelCommands();
void updateConfig();
Q_SIGNALS:
void progress(int current, int total);
void commandsExecuting(bool);
void contextMenuRequested(QAbstractItemView *view, const QPoint &p);
private:
class Private;
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
};
}
diff --git a/src/view/searchbar.h b/src/view/searchbar.h
index e75b4816a..bef109db1 100644
--- a/src/view/searchbar.h
+++ b/src/view/searchbar.h
@@ -1,55 +1,53 @@
/* -*- mode: c++; c-basic-offset:4 -*-
view/searchbar.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2007 Klarälvdalens Datakonsult AB
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include <QWidget>
-#include <utils/pimpl_ptr.h>
-
#include <memory>
class QLineEdit;
namespace Kleo
{
class KeyFilter;
class SearchBar : public QWidget
{
Q_OBJECT
public:
explicit SearchBar(QWidget *parent = nullptr, Qt::WindowFlags f = {});
~SearchBar() override;
const std::shared_ptr<KeyFilter> &keyFilter() const;
QLineEdit *lineEdit() const;
void updateClickMessage(const QString &shortcutStr);
public Q_SLOTS:
void setStringFilter(const QString &text);
void setKeyFilter(const std::shared_ptr<Kleo::KeyFilter> &filter);
void setChangeStringFilterEnabled(bool enable);
void setChangeKeyFilterEnabled(bool enable);
Q_SIGNALS:
void stringFilterChanged(const QString &text);
void keyFilterChanged(const std::shared_ptr<Kleo::KeyFilter> &filter);
private:
class Private;
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
Q_PRIVATE_SLOT(d, void showOrHideCertifyButton())
};
}
diff --git a/src/view/tabwidget.h b/src/view/tabwidget.h
index 58334dcd3..b1f53547d 100644
--- a/src/view/tabwidget.h
+++ b/src/view/tabwidget.h
@@ -1,94 +1,92 @@
/* -*- mode: c++; c-basic-offset:4 -*-
view/tabwidget.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2007 Klarälvdalens Datakonsult AB
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include <KSharedConfig>
#include <QWidget>
#include <memory>
#include <vector>
-#include <utils/pimpl_ptr.h>
-
class QAbstractItemView;
class KConfigGroup;
class KActionCollection;
namespace Kleo
{
class AbstractKeyListModel;
class AbstractKeyListSortFilterProxyModel;
class KeyFilter;
class KeyListModelInterface;
class SearchBar;
class TabWidget : public QWidget
{
Q_OBJECT
public:
enum Option {
ShowKeys = 0x00,
ShowUserIDs = 0x01,
};
Q_DECLARE_FLAGS(Options, Option)
explicit TabWidget(QWidget *parent = nullptr, Qt::WindowFlags f = {});
~TabWidget() override;
void setFlatModel(AbstractKeyListModel *model);
AbstractKeyListModel *flatModel() const;
void setHierarchicalModel(AbstractKeyListModel *model);
AbstractKeyListModel *hierarchicalModel() const;
QAbstractItemView *addView(const QString &title = QString(), const QString &keyFilterID = QString(), const QString &searchString = QString());
QAbstractItemView *addView(const KConfigGroup &group, Options options);
QAbstractItemView *
addTemporaryView(const QString &title = QString(), AbstractKeyListSortFilterProxyModel *proxy = nullptr, const QString &tabToolTip = QString());
void loadViews(const KSharedConfig::Ptr &config, const QString &configKeys, Options options = ShowKeys);
void saveViews();
std::vector<QAbstractItemView *> views() const;
QAbstractItemView *currentView() const;
KeyListModelInterface *currentModel() const;
unsigned int count() const;
void createActions(KActionCollection *collection);
void connectSearchBar(SearchBar *sb);
void setMultiSelection(bool on);
QString stringFilter() const;
public Q_SLOTS:
void setKeyFilter(const std::shared_ptr<Kleo::KeyFilter> &filter);
void setStringFilter(const QString &filter);
Q_SIGNALS:
void viewAdded(QAbstractItemView *view);
void viewAboutToBeRemoved(QAbstractItemView *view);
void currentViewChanged(QAbstractItemView *view);
void stringFilterChanged(const QString &filter);
void keyFilterChanged(const std::shared_ptr<Kleo::KeyFilter> &filter);
void enableChangeStringFilter(bool enable);
void enableChangeKeyFilter(bool enable);
private:
class Private;
- kdtools::pimpl_ptr<Private> d;
+ const std::unique_ptr<Private> d;
};
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sun, Feb 22, 6:42 PM (1 d, 14 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
3e/7c/bcc51bb10dddc3b4ee767c6b9b0d
Attached To
rKLEOPATRA Kleopatra
Event Timeline
Log In to Comment