Bug 412661 - Copy paste error in KIO::TransferJob::doResume()
Summary: Copy paste error in KIO::TransferJob::doResume()
Status: RESOLVED NOT A BUG
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: David Faure
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-10-06 11:17 UTC by wolthera
Modified: 2019-10-07 12:56 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description wolthera 2019-10-06 11:17:55 UTC
Hey,

I was looking at the KIO job files because I was trying to understand how KJob::doResume() should be implemented, and noticed the following in the transferjob file:

291 bool TransferJob::doResume()
292 {
293     Q_D(TransferJob);
294     if (!SimpleJob::doResume()) {
295         return false;
296     }
297     if (d->m_internalSuspended) {
298         d->internalSuspend();
299     }
300     return true;
301 }

The function seems to call d->internalSuspend() on line 298 instead of d->internalResume(), which seems wrong to me?

I am looking at the file here: https://api.kde.org/frameworks-api/frameworks-apidocs/frameworks/kio/html/transferjob_8cpp_source.html
Comment 1 wolthera 2019-10-06 11:26:17 UTC
I might be wrong btw, I am not too familiar with the code, just confused that resume suspends a thing but never resumes...
Comment 2 Ahmad Samir 2019-10-07 10:00:50 UTC
There are two different objects here, a KIO job and KIO slave; the actual job resume is done in SimpleJob::doResume() and if that succeeds, d->internalSuspend() suspends the KIO slave (not the job):
void TransferJobPrivate::internalSuspend()
{
    m_internalSuspended = true;
    if (m_slave) {
        m_slave->suspend();
    }
}
Comment 3 wolthera 2019-10-07 12:56:36 UTC
Alright, thanks!