mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 10:22:48 +00:00
kio: fix possible infinite loop on KDirLister::isFinished()
in case the listing has been canceled for example Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
5a2393001a
commit
bedf3b590c
3 changed files with 12 additions and 1 deletions
|
@ -34,7 +34,7 @@ KDirListerPrivate::KDirListerPrivate(KDirLister *parent)
|
|||
autoErrorHandling(true),
|
||||
showingDotFiles(false),
|
||||
dirOnlyMode(false),
|
||||
complete(false),
|
||||
complete(true),
|
||||
window(nullptr),
|
||||
listJob(nullptr),
|
||||
dirWatch(nullptr),
|
||||
|
@ -382,6 +382,7 @@ void KDirLister::stop()
|
|||
d->listJob->kill();
|
||||
d->listJob->deleteLater();
|
||||
d->listJob = nullptr;
|
||||
d->complete = true;
|
||||
emit canceled();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,4 +58,13 @@ void KDirListerTest::testItems()
|
|||
QVERIFY(!foobaritem.isNull());
|
||||
}
|
||||
|
||||
|
||||
void KDirListerTest::testIsFinished()
|
||||
{
|
||||
QCOMPARE(m_dirLister->isFinished(), true);
|
||||
m_dirLister->openUrl(KUrl(m_tempDir->name()));
|
||||
QTest::kWaitForSignal(m_dirLister, SIGNAL(completed()), 5000);
|
||||
QCOMPARE(m_dirLister->isFinished(), true);
|
||||
}
|
||||
|
||||
#include "moc_kdirlistertest.cpp"
|
||||
|
|
|
@ -31,6 +31,7 @@ private Q_SLOTS:
|
|||
|
||||
void testOpenUrl();
|
||||
void testItems();
|
||||
void testIsFinished();
|
||||
|
||||
private:
|
||||
KTempDir* m_tempDir;
|
||||
|
|
Loading…
Add table
Reference in a new issue