Commit c5a5af14 authored by Ingo Klöcker's avatar Ingo Klöcker
Browse files

Allow retrieving the file name of an Output

For a FileOutput that's the name of the file the data was written to.
For all other outputs it's an empty string.

GnuPG-bug-id: 6056
parent dbc0e886
......@@ -382,7 +382,7 @@ public:
void doCancel() override {
qCDebug(KLEOPATRA_LOG) << this;
QString fileName() const
QString fileName() const override
return m_fileName;
......@@ -13,11 +13,12 @@
#include <utils/pimpl_ptr.h>
#include <QString>
#include <QStringList>
#include <memory>
class QIODevice;
class QString;
#include <QStringList>
class QDir;
class QWidget;
......@@ -62,6 +63,7 @@ public:
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);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment