Changeset View
Changeset View
Standalone View
Standalone View
krusader/Search/krsearchmod.cpp
Show All 26 Lines | |||||
27 | #include <QMimeType> | 27 | #include <QMimeType> | ||
28 | #include <QRegExp> | 28 | #include <QRegExp> | ||
29 | // QtWidgets | 29 | // QtWidgets | ||
30 | #include <QApplication> | 30 | #include <QApplication> | ||
31 | #include <qplatformdefs.h> | 31 | #include <qplatformdefs.h> | ||
32 | 32 | | |||
33 | #include <KIO/Global> | 33 | #include <KIO/Global> | ||
34 | 34 | | |||
35 | #include "../krglobal.h" | ||||
35 | #include "../Archive/krarchandler.h" | 36 | #include "../Archive/krarchandler.h" | ||
36 | #include "../FileSystem/defaultfilesystem.h" | 37 | #include "../FileSystem/defaultfilesystem.h" | ||
37 | #include "../FileSystem/fileitem.h" | 38 | #include "../FileSystem/fileitem.h" | ||
38 | #include "../FileSystem/krpermhandler.h" | 39 | #include "../FileSystem/krpermhandler.h" | ||
39 | #include "../FileSystem/krquery.h" | 40 | #include "../FileSystem/krquery.h" | ||
40 | #include "../FileSystem/virtualfilesystem.h" | 41 | #include "../FileSystem/virtualfilesystem.h" | ||
41 | 42 | | |||
42 | #define EVENT_PROCESS_DELAY 250 // milliseconds | 43 | #define EVENT_PROCESS_DELAY 250 // milliseconds | ||
43 | 44 | | |||
44 | static const QStringList TAR_TYPES = QStringList() << "tbz" << "tgz" << "tarz" << "tar" << "tlz"; | 45 | static const QStringList TAR_TYPES = QStringList() << "tbz" << "tgz" << "tarz" << "tar" << "tlz"; | ||
45 | 46 | | |||
46 | extern KRarcHandler arcHandler; | | |||
47 | | ||||
48 | KRSearchMod::KRSearchMod(const KRQuery *query) | 47 | KRSearchMod::KRSearchMod(const KRQuery *query) | ||
49 | : m_defaultFileSystem(nullptr), m_virtualFileSystem(nullptr), m_stopSearch(false) | 48 | : m_defaultFileSystem(nullptr), m_virtualFileSystem(nullptr), m_stopSearch(false) | ||
50 | { | 49 | { | ||
51 | m_query = new KRQuery(*query); | 50 | m_query = new KRQuery(*query); | ||
52 | connect(m_query, &KRQuery::status, this, &KRSearchMod::searching); | 51 | connect(m_query, &KRQuery::status, this, &KRSearchMod::searching); | ||
53 | connect(m_query, &KRQuery::processEvents, this, &KRSearchMod::slotProcessEvents); | 52 | connect(m_query, &KRQuery::processEvents, this, &KRSearchMod::slotProcessEvents); | ||
54 | } | 53 | } | ||
55 | 54 | | |||
▲ Show 20 Lines • Show All 72 Lines • ▼ Show 20 Line(s) | 124 | if (m_query->isRecursive() && | |||
128 | m_unScannedUrls.push(fileUrl); | 127 | m_unScannedUrls.push(fileUrl); | ||
129 | } | 128 | } | ||
130 | 129 | | |||
131 | if (m_query->searchInArchives() && fileUrl.isLocalFile() && | 130 | if (m_query->searchInArchives() && fileUrl.isLocalFile() && | ||
132 | KRarcHandler::arcSupported(fileItem->getMime())) { | 131 | KRarcHandler::arcSupported(fileItem->getMime())) { | ||
133 | // query search in archive; NOTE: only supported for local files | 132 | // query search in archive; NOTE: only supported for local files | ||
134 | QUrl archiveURL = fileUrl; | 133 | QUrl archiveURL = fileUrl; | ||
135 | bool encrypted; | 134 | bool encrypted; | ||
136 | const QString type = arcHandler.getType(encrypted, fileUrl.path(), fileItem->getMime()); | 135 | const QString type = krArcMan.getType(encrypted, fileUrl.path(), fileItem->getMime()); | ||
137 | 136 | | |||
138 | if (!encrypted) { | 137 | if (!encrypted) { | ||
139 | archiveURL.setScheme(TAR_TYPES.contains(type) ? "tar" : "krarc"); | 138 | archiveURL.setScheme(TAR_TYPES.contains(type) ? "tar" : "krarc"); | ||
140 | m_unScannedUrls.push(archiveURL); | 139 | m_unScannedUrls.push(archiveURL); | ||
141 | } | 140 | } | ||
142 | } | 141 | } | ||
143 | 142 | | |||
144 | if (m_query->match(fileItem)) { | 143 | if (m_query->match(fileItem)) { | ||
Show All 33 Lines |