gwenview: process all events while waiting for document to be loaded and MIME type to be determined

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2022-05-26 15:26:23 +03:00
parent 6fd2ddf25d
commit 9d46d64323
2 changed files with 2 additions and 2 deletions

View file

@ -293,7 +293,7 @@ void Document::waitUntilLoaded()
if (state == Loaded || state == LoadingFailed) {
return;
}
qApp->processEvents(QEventLoop::ExcludeUserInputEvents);
qApp->processEvents();
}
}

View file

@ -141,7 +141,7 @@ QString urlMimeTypeByContent(const KUrl& url)
KIO::TransferJob* job = KIO::get(url);
DataAccumulator accumulator(job);
while (!accumulator.finished() && accumulator.data().size() < HEADER_SIZE) {
qApp->processEvents(QEventLoop::ExcludeUserInputEvents);
qApp->processEvents();
}
return KMimeType::findByContent(accumulator.data())->name();
}