Changeset View
Changeset View
Standalone View
Standalone View
krusader/Archive/abstractthreadedjob.cpp
Show First 20 Lines • Show All 252 Lines • ▼ Show 20 Line(s) | |||||
253 | class AbstractJobObserver : public KRarcObserver | 253 | class AbstractJobObserver : public KRarcObserver | ||
254 | { | 254 | { | ||
255 | protected: | 255 | protected: | ||
256 | AbstractJobThread * _jobThread; | 256 | AbstractJobThread * _jobThread; | ||
257 | public: | 257 | public: | ||
258 | explicit AbstractJobObserver(AbstractJobThread * thread): _jobThread(thread) {} | 258 | explicit AbstractJobObserver(AbstractJobThread * thread): _jobThread(thread) {} | ||
259 | ~AbstractJobObserver() override = default; | 259 | ~AbstractJobObserver() override = default; | ||
260 | 260 | | |||
261 | void processEvents() Q_DECL_OVERRIDE { | 261 | void processEvents() override { | ||
262 | usleep(1000); | 262 | usleep(1000); | ||
263 | qApp->processEvents(); | 263 | qApp->processEvents(); | ||
264 | } | 264 | } | ||
265 | 265 | | |||
266 | void subJobStarted(const QString & jobTitle, int count) Q_DECL_OVERRIDE { | 266 | void subJobStarted(const QString & jobTitle, int count) override { | ||
267 | _jobThread->sendReset(jobTitle); | 267 | _jobThread->sendReset(jobTitle); | ||
268 | _jobThread->sendMaxProgressValue(count); | 268 | _jobThread->sendMaxProgressValue(count); | ||
269 | } | 269 | } | ||
270 | 270 | | |||
271 | void subJobStopped() Q_DECL_OVERRIDE { | 271 | void subJobStopped() override { | ||
272 | } | 272 | } | ||
273 | 273 | | |||
274 | bool wasCancelled() Q_DECL_OVERRIDE { | 274 | bool wasCancelled() override { | ||
275 | return _jobThread->_exited; | 275 | return _jobThread->_exited; | ||
276 | } | 276 | } | ||
277 | 277 | | |||
278 | void error(const QString & error) Q_DECL_OVERRIDE { | 278 | void error(const QString & error) override { | ||
279 | _jobThread->sendError(KIO::ERR_NO_CONTENT, error); | 279 | _jobThread->sendError(KIO::ERR_NO_CONTENT, error); | ||
280 | } | 280 | } | ||
281 | 281 | | |||
282 | void detailedError(const QString & error, const QString & details) Q_DECL_OVERRIDE { | 282 | void detailedError(const QString & error, const QString & details) override { | ||
283 | _jobThread->sendError(KIO::ERR_NO_CONTENT, error + '\n' + details); | 283 | _jobThread->sendError(KIO::ERR_NO_CONTENT, error + '\n' + details); | ||
284 | } | 284 | } | ||
285 | 285 | | |||
286 | void incrementProgress(int c) Q_DECL_OVERRIDE { | 286 | void incrementProgress(int c) override { | ||
287 | _jobThread->sendAddProgress(c, _jobThread->_progressTitle); | 287 | _jobThread->sendAddProgress(c, _jobThread->_progressTitle); | ||
288 | } | 288 | } | ||
289 | }; | 289 | }; | ||
290 | 290 | | |||
291 | 291 | | |||
292 | AbstractJobThread::AbstractJobThread() : _job(nullptr), _downloadTempDir(nullptr), _observer(nullptr), _tempFile(nullptr), | 292 | AbstractJobThread::AbstractJobThread() : _job(nullptr), _downloadTempDir(nullptr), _observer(nullptr), _tempFile(nullptr), | ||
293 | _tempDir(nullptr), _exited(false) | 293 | _tempDir(nullptr), _exited(false) | ||
294 | { | 294 | { | ||
▲ Show 20 Lines • Show All 370 Lines • Show Last 20 Lines |