generic: process all events and use KJob::exec() instead of QEventLoop

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2022-05-26 15:56:30 +03:00
parent 5275fdc8a4
commit 8696681c5c
3 changed files with 5 additions and 14 deletions

View file

@ -1306,10 +1306,7 @@ void KFilePropsPlugin::applyChanges()
connect( job, SIGNAL(renamed(KIO::Job*,KUrl,KUrl)), connect( job, SIGNAL(renamed(KIO::Job*,KUrl,KUrl)),
SLOT(slotFileRenamed(KIO::Job*,KUrl,KUrl)) ); SLOT(slotFileRenamed(KIO::Job*,KUrl,KUrl)) );
// wait for job // wait for job
QEventLoop eventLoop; job->exec();
connect(this, SIGNAL(leaveModality()),
&eventLoop, SLOT(quit()));
eventLoop.exec(QEventLoop::ExcludeUserInputEvents);
return; return;
} }
properties->updateUrl(properties->kurl()); properties->updateUrl(properties->kurl());
@ -2481,10 +2478,7 @@ void KFilePermissionsPropsPlugin::applyChanges()
connect( job, SIGNAL(result(KJob*)), connect( job, SIGNAL(result(KJob*)),
SLOT(slotChmodResult(KJob*)) ); SLOT(slotChmodResult(KJob*)) );
QEventLoop eventLoop; job->exec();
connect(this, SIGNAL(leaveModality()),
&eventLoop, SLOT(quit()));
eventLoop.exec(QEventLoop::ExcludeUserInputEvents);
} }
if (dirs.count() > 0) { if (dirs.count() > 0) {
job = KIO::chmod( dirs, orDirPermissions, ~andDirPermissions, job = KIO::chmod( dirs, orDirPermissions, ~andDirPermissions,
@ -2496,10 +2490,7 @@ void KFilePermissionsPropsPlugin::applyChanges()
connect( job, SIGNAL(result(KJob*)), connect( job, SIGNAL(result(KJob*)),
SLOT(slotChmodResult(KJob*)) ); SLOT(slotChmodResult(KJob*)) );
QEventLoop eventLoop; job->exec();
connect(this, SIGNAL(leaveModality()),
&eventLoop, SLOT(quit()));
eventLoop.exec(QEventLoop::ExcludeUserInputEvents);
} }
} }

View file

@ -411,7 +411,7 @@ void NetAccess::enter_loop()
QEventLoop eventLoop; QEventLoop eventLoop;
connect(this, SIGNAL(leaveModality()), connect(this, SIGNAL(leaveModality()),
&eventLoop, SLOT(quit())); &eventLoop, SLOT(quit()));
eventLoop.exec(QEventLoop::ExcludeUserInputEvents); eventLoop.exec();
} }
void NetAccess::slotResult( KJob * job ) void NetAccess::slotResult( KJob * job )

View file

@ -1012,7 +1012,7 @@ bool ReadWritePart::waitSaveComplete()
d->m_waitForSave = true; d->m_waitForSave = true;
d->m_eventLoop.exec(QEventLoop::ExcludeUserInputEvents); d->m_eventLoop.exec();
d->m_waitForSave = false; d->m_waitForSave = false;