Commit d970cdd2 authored by Simon Depiets's avatar Simon Depiets
Browse files

Clean up QThreadPool cancel warnings

parent 6755ffd3
......@@ -611,7 +611,7 @@ void FileSearchTab::stopSearch()
#if QT_VERSION >= 0x050500
int i = m_runningJobs.size();
while (--i >= 0)
QThreadPool::globalInstance()->cancel(m_runningJobs.at(i));
QThreadPool::globalInstance()->tryTake(m_runningJobs.at(i));
#endif
m_runningJobs.clear();
}
......
......@@ -338,7 +338,9 @@ public:
explicit ScanJobFeedingBack(const QString& filePath,
const QString& dbName)
: QObject(), ScanJob(filePath, dbName)
{}
{
setAutoDelete(false);
}
protected:
void run() override
......
......@@ -57,7 +57,7 @@ bool RecursiveScanJob::doKill()
{
#if QT_VERSION >= 0x050500
foreach (ScanJob* job, m_jobs)
TM::threadPool()->cancel(job);
TM::threadPool()->tryTake(job);
#endif
return true;
}
......
......@@ -160,7 +160,7 @@ TMView::~TMView()
#if QT_VERSION >= 0x050500
int i = m_jobs.size();
while (--i >= 0)
TM::threadPool()->cancel(m_jobs.at(i));
TM::threadPool()->tryTake(m_jobs.at(i));
#endif
}
......@@ -219,7 +219,7 @@ void TMView::slotFileLoaded(const QString& filePath)
#if QT_VERSION >= 0x050500
int i = m_jobs.size();
while (--i >= 0)
TM::threadPool()->cancel(m_jobs.at(i));
TM::threadPool()->tryTake(m_jobs.at(i));
#endif
m_jobs.clear();
......@@ -351,7 +351,7 @@ void TMView::slotNewEntryDisplayed(const DocPosition& pos)
#if QT_VERSION >= 0x050500
int i = m_jobs.size();
while (--i >= 0)
TM::threadPool()->cancel(m_currentSelectJob);
TM::threadPool()->tryTake(m_currentSelectJob);
#endif
//update DB
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment