Changeset View
Changeset View
Standalone View
Standalone View
krusader/Archive/abstractthreadedjob.cpp
Show All 33 Lines | |||||
34 | #include <KIO/JobUiDelegate> | 34 | #include <KIO/JobUiDelegate> | ||
35 | #include <KWidgetsAddons/KMessageBox> | 35 | #include <KWidgetsAddons/KMessageBox> | ||
36 | 36 | | |||
37 | #include "krarchandler.h" | 37 | #include "krarchandler.h" | ||
38 | #include "../krglobal.h" | 38 | #include "../krglobal.h" | ||
39 | #include "../krservices.h" | 39 | #include "../krservices.h" | ||
40 | #include "../FileSystem/filesystemprovider.h" | 40 | #include "../FileSystem/filesystemprovider.h" | ||
41 | 41 | | |||
42 | extern KRarcHandler arcHandler; | | |||
43 | | ||||
44 | AbstractThreadedJob::AbstractThreadedJob() : _maxProgressValue(0), | 42 | AbstractThreadedJob::AbstractThreadedJob() : _maxProgressValue(0), | ||
45 | _currentProgress(0), _exiting(false), _jobThread(nullptr) | 43 | _currentProgress(0), _exiting(false), _jobThread(nullptr) | ||
46 | { | 44 | { | ||
47 | } | 45 | } | ||
48 | 46 | | |||
49 | void AbstractThreadedJob::startAbstractJobThread(AbstractJobThread * jobThread) | 47 | void AbstractThreadedJob::startAbstractJobThread(AbstractJobThread * jobThread) | ||
50 | { | 48 | { | ||
51 | _jobThread = jobThread; | 49 | _jobThread = jobThread; | ||
▲ Show 20 Lines • Show All 593 Lines • ▼ Show 20 Line(s) | 635 | { | |||
645 | url.setPath(url.path() + '/' + arcName); | 643 | url.setPath(url.path() + '/' + arcName); | ||
646 | 644 | | |||
647 | path = url.adjusted(QUrl::StripTrailingSlash).path(); | 645 | path = url.adjusted(QUrl::StripTrailingSlash).path(); | ||
648 | 646 | | |||
649 | QMimeDatabase db; | 647 | QMimeDatabase db; | ||
650 | QMimeType mt = db.mimeTypeForUrl(url); | 648 | QMimeType mt = db.mimeTypeForUrl(url); | ||
651 | QString mime = mt.isValid() ? mt.name() : QString(); | 649 | QString mime = mt.isValid() ? mt.name() : QString(); | ||
652 | bool encrypted = false; | 650 | bool encrypted = false; | ||
653 | type = arcHandler.getType(encrypted, path, mime); | 651 | type = krArcMan.getType(encrypted, path, mime); | ||
654 | 652 | | |||
655 | // Check that the archive is supported | 653 | // Check that the archive is supported | ||
656 | if (!KRarcHandler::arcSupported(type)) { | 654 | if (!KRarcHandler::arcSupported(type)) { | ||
657 | sendError(KIO::ERR_NO_CONTENT, i18nc("%1=archive filename", "%1, unsupported archive type.", arcName)); | 655 | sendError(KIO::ERR_NO_CONTENT, i18nc("%1=archive filename", "%1, unsupported archive type.", arcName)); | ||
658 | return false; | 656 | return false; | ||
659 | } | 657 | } | ||
660 | 658 | | |||
661 | password = encrypted ? getPassword(path) : QString(); | 659 | password = encrypted ? getPassword(path) : QString(); | ||
662 | 660 | | |||
663 | return true; | 661 | return true; | ||
664 | } | 662 | } |