Changeset View
Changeset View
Standalone View
Standalone View
src/tm/tmscanapi.cpp
Context not available. | |||||
73 | 73 | | |||
---|---|---|---|---|---|
74 | void RecursiveScanJob::scanJobFinished(ScanJobFeedingBack* j) | 74 | void RecursiveScanJob::scanJobFinished(ScanJobFeedingBack* j) | ||
75 | { | 75 | { | ||
76 | j->deleteLater(); | | |||
77 | ScanJob* job = static_cast<ScanJob*>(j); | 76 | ScanJob* job = static_cast<ScanJob*>(j); | ||
78 | 77 | | |||
79 | setProcessedAmount(KJob::Files, processedAmount(KJob::Files) + 1); | 78 | setProcessedAmount(KJob::Files, processedAmount(KJob::Files) + 1); | ||
Context not available. | |||||
89 | } | 88 | } | ||
90 | } | 89 | } | ||
91 | 90 | | |||
91 | void RecursiveScanJob::scanJobDestroyed() | ||||
92 | { | ||||
93 | m_destroyedJobs += 1; | ||||
94 | if (m_destroyedJobs == totalAmount(KJob::Files)) { | ||||
95 | emitResult(); | ||||
96 | } | ||||
97 | } | ||||
98 | | ||||
92 | void RecursiveScanJob::start() | 99 | void RecursiveScanJob::start() | ||
93 | { | 100 | { | ||
94 | m_time.start(); | 101 | m_time.start(); | ||
Context not available. | |||||
114 | if (Catalog::extIsSupported(filePath)) { | 121 | if (Catalog::extIsSupported(filePath)) { | ||
115 | ScanJobFeedingBack* job = new ScanJobFeedingBack(filePath, dbName); | 122 | ScanJobFeedingBack* job = new ScanJobFeedingBack(filePath, dbName); | ||
116 | QObject::connect(job, &ScanJobFeedingBack::done, metaJob, &RecursiveScanJob::scanJobFinished); | 123 | QObject::connect(job, &ScanJobFeedingBack::done, metaJob, &RecursiveScanJob::scanJobFinished); | ||
124 | QObject::connect(job, &QObject::destroyed, metaJob, &RecursiveScanJob::scanJobDestroyed); | ||||
117 | TM::threadPool()->start(job, SCAN); | 125 | TM::threadPool()->start(job, SCAN); | ||
118 | result.append(job); | 126 | result.append(job); | ||
119 | } else | 127 | } else | ||
Context not available. |