gwenview: execute the move job via KIO::NetAccess::synchronousRun() and set its UI delegate to the document UI delegate

fixes rare hang, there is a bug lurking somewhere - the job progress is
shown only the first time the test is run if not in full session

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2022-05-26 17:10:26 +03:00
parent 9d46d64323
commit 7d6cd5a36e

View file

@ -28,7 +28,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA
// KDE
#include <KApplication>
#include <KIO/CopyJob>
#include <KIO/JobUiDelegate>
#include <KIO/NetAccess>
#include <KLocale>
#include <KSaveFile>
#include <KTemporaryFile>
@ -96,8 +96,8 @@ void SaveJob::threadedFinish()
if (!error()) {
// whether to overwite has already been asked for
KIO::Job* job = KIO::move(KUrl::fromPath(d->mTemporaryFile), d->mNewUrl, KIO::Overwrite);
job->ui()->setWindow(KApplication::kApplication()->activeWindow());
job->exec();
job->setUiDelegate(uiDelegate());
KIO::NetAccess::synchronousRun(job, KApplication::kApplication()->activeWindow());
}
}