Add generic output support to sigencfilestask

There is no reason why it should only work with files
it can be more flexible if it works with every input/output.
parent b04c0b10
......@@ -377,6 +377,13 @@ void SignEncryptFilesTask::setInput(const std::shared_ptr<Input> &input)
d->input = input;
}
void SignEncryptFilesTask::setOutput(const std::shared_ptr<Output> &output)
{
kleo_assert(!d->job);
kleo_assert(output);
d->output = output;
}
void SignEncryptFilesTask::setOutputFileName(const QString &fileName)
{
kleo_assert(!d->job);
......@@ -465,7 +472,10 @@ void SignEncryptFilesTask::doStart()
}
kleo_assert(d->input);
d->output = Output::createFromFile(d->outputFileName, d->m_overwritePolicy);
if (!d->output) {
d->output = Output::createFromFile(d->outputFileName, d->m_overwritePolicy);
}
if (d->encrypt || d->symmetric) {
Context::EncryptionFlags flags = Context::AlwaysTrust;
......
......@@ -53,6 +53,7 @@ namespace Kleo
{
class OverwritePolicy;
class Input;
class Output;
}
namespace Kleo
......@@ -70,6 +71,7 @@ public:
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);
void setSigners(const std::vector<GpgME::Key> &singners);
void setRecipients(const std::vector<GpgME::Key> &recipients);
......
Markdown is supported
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