44 const QVariantMap& additional,
58 e.Additional_ = additional;
67 const auto fileGuard =
MakeScopeGuard ([&file] { file.remove (); });
68 if (!file.open (QIODevice::ReadOnly))
74 cont.
Right (file.readAll ());
99 const auto& res = iem->DelegateEntity (e);
101 throw std::runtime_error (
"Cannot delegate entity.");
104 connect (res.Handler_,
105 SIGNAL (jobFinished (
int)),
107 SLOT (handleFinished (
int)));
108 connect (res.Handler_,
114 void DownloadHandler::handleFinished (
int id)
Entity MakeEntity(const QVariant &entity, const QString &location, TaskParameters tp, const QString &mime)
Proxy to core entity manager.
auto Right(Args &&... args) const
Invoke the right function and return its result.
detail::ScopeGuard< F > MakeScopeGuard(const F &f)
Returns an object performing passed function on scope exit.
A peir of two functions, typically a continuation and an error handler.
DownloadHandler(const QUrl &url, const QVariantMap &additional, IEntityManager *iem, const DataHandler_t &, QObject *parent=nullptr)
QString GetTemporaryName(const QString &pattern)
Returns a temporary filename.
auto Left(Args &&... args) const
Invoke the left function and return its result.
A message used for inter-plugin communication.
QString Location_
Source or destination.