Changeset View
Changeset View
Standalone View
Standalone View
krusader/Archive/packjob.cpp
Show All 25 Lines | |||||
26 | #include <QMimeDatabase> | 26 | #include <QMimeDatabase> | ||
27 | #include <QMimeType> | 27 | #include <QMimeType> | ||
28 | #include <QTimer> | 28 | #include <QTimer> | ||
29 | 29 | | |||
30 | #include <KI18n/KLocalizedString> | 30 | #include <KI18n/KLocalizedString> | ||
31 | 31 | | |||
32 | extern KRarcHandler arcHandler; | 32 | extern KRarcHandler arcHandler; | ||
33 | 33 | | |||
34 | PackJob::PackJob(const QUrl &srcUrl, const QUrl &destUrl, const QStringList & fileNames, const QString &type, const QMap<QString, QString> &packProps) : AbstractThreadedJob() | 34 | PackJob::PackJob(const QUrl &srcUrl, const QUrl &destUrl, const QStringList & fileNames, const QString &type, const QMap<QString, QString> &packProps) | ||
35 | { | 35 | { | ||
36 | startAbstractJobThread(new PackThread(srcUrl, destUrl, fileNames, type, packProps)); | 36 | startAbstractJobThread(new PackThread(srcUrl, destUrl, fileNames, type, packProps)); | ||
37 | } | 37 | } | ||
38 | 38 | | |||
39 | PackJob * PackJob::createPacker(const QUrl &srcUrl, const QUrl &destUrl, const QStringList & fileNames, const QString &type, const QMap<QString, QString> &packProps) | 39 | PackJob * PackJob::createPacker(const QUrl &srcUrl, const QUrl &destUrl, const QStringList & fileNames, const QString &type, const QMap<QString, QString> &packProps) | ||
40 | { | 40 | { | ||
41 | return new PackJob(srcUrl, destUrl, fileNames, type, packProps); | 41 | return new PackJob(srcUrl, destUrl, fileNames, type, packProps); | ||
42 | } | 42 | } | ||
43 | 43 | | |||
44 | PackThread::PackThread(const QUrl &srcUrl, const QUrl &destUrl, const QStringList & fileNames, | 44 | PackThread::PackThread(const QUrl &srcUrl, const QUrl &destUrl, const QStringList & fileNames, | ||
45 | const QString &type, const QMap<QString, QString> &packProps) : | 45 | const QString &type, const QMap<QString, QString> &packProps) : | ||
46 | AbstractJobThread(), _sourceUrl(srcUrl), _destUrl(destUrl), _fileNames(fileNames), | 46 | _sourceUrl(srcUrl), _destUrl(destUrl), _fileNames(fileNames), | ||
47 | _type(type), _packProperties(packProps) | 47 | _type(type), _packProperties(packProps) | ||
48 | { | 48 | { | ||
49 | } | 49 | } | ||
50 | 50 | | |||
51 | 51 | | |||
52 | void PackThread::slotStart() | 52 | void PackThread::slotStart() | ||
53 | { | 53 | { | ||
54 | QUrl newSource = downloadIfRemote(_sourceUrl, _fileNames); | 54 | QUrl newSource = downloadIfRemote(_sourceUrl, _fileNames); | ||
Show All 22 Lines | |||||
77 | } | 77 | } | ||
78 | 78 | | |||
79 | if (!uploadTempFiles()) | 79 | if (!uploadTempFiles()) | ||
80 | return; | 80 | return; | ||
81 | 81 | | |||
82 | sendSuccess(); | 82 | sendSuccess(); | ||
83 | } | 83 | } | ||
84 | 84 | | |||
85 | TestArchiveJob::TestArchiveJob(const QUrl &srcUrl, const QStringList & fileNames) : AbstractThreadedJob() | 85 | TestArchiveJob::TestArchiveJob(const QUrl &srcUrl, const QStringList & fileNames) | ||
86 | { | 86 | { | ||
87 | startAbstractJobThread(new TestArchiveThread(srcUrl, fileNames)); | 87 | startAbstractJobThread(new TestArchiveThread(srcUrl, fileNames)); | ||
88 | } | 88 | } | ||
89 | 89 | | |||
90 | TestArchiveJob * TestArchiveJob::testArchives(const QUrl &srcUrl, const QStringList & fileNames) | 90 | TestArchiveJob * TestArchiveJob::testArchives(const QUrl &srcUrl, const QStringList & fileNames) | ||
91 | { | 91 | { | ||
92 | return new TestArchiveJob(srcUrl, fileNames); | 92 | return new TestArchiveJob(srcUrl, fileNames); | ||
93 | } | 93 | } | ||
94 | 94 | | |||
95 | TestArchiveThread::TestArchiveThread(const QUrl &srcUrl, const QStringList & fileNames) : AbstractJobThread(), | 95 | TestArchiveThread::TestArchiveThread(const QUrl &srcUrl, const QStringList & fileNames) : | ||
96 | _sourceUrl(srcUrl), _fileNames(fileNames) | 96 | _sourceUrl(srcUrl), _fileNames(fileNames) | ||
97 | { | 97 | { | ||
98 | } | 98 | } | ||
99 | 99 | | |||
100 | void TestArchiveThread::slotStart() | 100 | void TestArchiveThread::slotStart() | ||
101 | { | 101 | { | ||
102 | // Gets a QUrl of the source folder, which may be remote | 102 | // Gets a QUrl of the source folder, which may be remote | ||
103 | QUrl newSource = downloadIfRemote(_sourceUrl, _fileNames); | 103 | QUrl newSource = downloadIfRemote(_sourceUrl, _fileNames); | ||
Show All 12 Lines | 107 | for (int i = 0; i < _fileNames.count(); ++i) { | |||
116 | } | 116 | } | ||
117 | } | 117 | } | ||
118 | 118 | | |||
119 | sendMessage(i18n("Archive tests passed.")); | 119 | sendMessage(i18n("Archive tests passed.")); | ||
120 | sendSuccess(); | 120 | sendSuccess(); | ||
121 | } | 121 | } | ||
122 | 122 | | |||
123 | 123 | | |||
124 | UnpackJob::UnpackJob(const QUrl &srcUrl, const QUrl &destUrl, const QStringList & fileNames) : AbstractThreadedJob() | 124 | UnpackJob::UnpackJob(const QUrl &srcUrl, const QUrl &destUrl, const QStringList & fileNames) | ||
125 | { | 125 | { | ||
126 | startAbstractJobThread(new UnpackThread(srcUrl, destUrl, fileNames)); | 126 | startAbstractJobThread(new UnpackThread(srcUrl, destUrl, fileNames)); | ||
127 | } | 127 | } | ||
128 | 128 | | |||
129 | UnpackJob * UnpackJob::createUnpacker(const QUrl &srcUrl, const QUrl &destUrl, const QStringList & fileNames) | 129 | UnpackJob * UnpackJob::createUnpacker(const QUrl &srcUrl, const QUrl &destUrl, const QStringList & fileNames) | ||
130 | { | 130 | { | ||
131 | return new UnpackJob(srcUrl, destUrl, fileNames); | 131 | return new UnpackJob(srcUrl, destUrl, fileNames); | ||
132 | } | 132 | } | ||
133 | 133 | | |||
134 | UnpackThread::UnpackThread(const QUrl &srcUrl, const QUrl &destUrl, const QStringList & fileNames) : | 134 | UnpackThread::UnpackThread(const QUrl &srcUrl, const QUrl &destUrl, const QStringList & fileNames) : | ||
135 | AbstractJobThread(), _sourceUrl(srcUrl), _destUrl(destUrl), _fileNames(fileNames) | 135 | _sourceUrl(srcUrl), _destUrl(destUrl), _fileNames(fileNames) | ||
136 | { | 136 | { | ||
137 | } | 137 | } | ||
138 | 138 | | |||
139 | void UnpackThread::slotStart() | 139 | void UnpackThread::slotStart() | ||
140 | { | 140 | { | ||
141 | // Gets a QUrl of the source folder, which may be remote | 141 | // Gets a QUrl of the source folder, which may be remote | ||
142 | QUrl newSource = downloadIfRemote(_sourceUrl, _fileNames); | 142 | QUrl newSource = downloadIfRemote(_sourceUrl, _fileNames); | ||
143 | if (newSource.isEmpty()) | 143 | if (newSource.isEmpty()) | ||
Show All 26 Lines |