Changeset View
Changeset View
Standalone View
Standalone View
krusader/FileSystem/krquery.h
Show First 20 Lines • Show All 46 Lines • ▼ Show 20 Line(s) | 45 | public: | |||
---|---|---|---|---|---|
47 | KRQuery(); | 47 | KRQuery(); | ||
48 | // query only with name filter | 48 | // query only with name filter | ||
49 | explicit KRQuery(const QString &name, bool matchCase = true); | 49 | explicit KRQuery(const QString &name, bool matchCase = true); | ||
50 | // copy constructor | 50 | // copy constructor | ||
51 | KRQuery(const KRQuery &); | 51 | KRQuery(const KRQuery &); | ||
52 | // let operator | 52 | // let operator | ||
53 | KRQuery &operator=(const KRQuery &); | 53 | KRQuery &operator=(const KRQuery &); | ||
54 | // destructor | 54 | // destructor | ||
55 | virtual ~KRQuery(); | 55 | ~KRQuery() override; | ||
56 | 56 | | |||
57 | // load parameters from config | 57 | // load parameters from config | ||
58 | void load(KConfigGroup cfg); | 58 | void load(const KConfigGroup& cfg); | ||
59 | // save parameters to config | 59 | // save parameters to config | ||
60 | void save(KConfigGroup cfg); | 60 | void save(KConfigGroup cfg); | ||
61 | 61 | | |||
62 | // matching a file with the query | 62 | // matching a file with the query | ||
63 | bool match(FileItem *file) const; // checks if the given fileItem object matches the conditions | 63 | bool match(FileItem *file) const; // checks if the given fileItem object matches the conditions | ||
64 | // matching a name with the query | 64 | // matching a name with the query | ||
65 | bool match(const QString &name) const; // matching the filename only | 65 | bool match(const QString &name) const; // matching the filename only | ||
66 | // matching the name of the directory | 66 | // matching the name of the directory | ||
67 | bool matchDirName(const QString &name) const; | 67 | bool matchDirName(const QString &name) const; | ||
68 | 68 | | |||
69 | // sets the text for name filtering | 69 | // sets the text for name filtering | ||
70 | void setNameFilter(const QString &text, bool cs = true); | 70 | void setNameFilter(const QString &text, bool cs = true); | ||
71 | // returns the current filter mask | 71 | // returns the current filter mask | ||
72 | const QString &nameFilter() const { return origFilter; } | 72 | const QString &nameFilter() const { return origFilter; } | ||
73 | // returns whether the filter is case sensitive | 73 | // returns whether the filter is case sensitive | ||
74 | bool isCaseSensitive() { return matchesCaseSensitive; } | 74 | bool isCaseSensitive() { return matchesCaseSensitive; } | ||
75 | 75 | | |||
76 | // returns if the filter is null (was cancelled) | 76 | // returns if the filter is null (was cancelled) | ||
77 | bool isNull() { return bNull; } | 77 | bool isNull() { return bNull; } | ||
78 | 78 | | |||
79 | // sets the content part of the query | 79 | // sets the content part of the query | ||
80 | void setContent(const QString &content, bool cs = true, bool wholeWord = false, | 80 | void setContent(const QString &content, bool cs = true, bool wholeWord = false, | ||
81 | QString encoding = QString(), bool regExp = false); | 81 | const QString& encoding = QString(), bool regExp = false); | ||
82 | const QString content() { return contain; } | 82 | const QString content() { return contain; } | ||
83 | 83 | | |||
84 | // sets the minimum file size limit | 84 | // sets the minimum file size limit | ||
85 | void setMinimumFileSize(KIO::filesize_t); | 85 | void setMinimumFileSize(KIO::filesize_t); | ||
86 | // sets the maximum file size limit | 86 | // sets the maximum file size limit | ||
87 | void setMaximumFileSize(KIO::filesize_t); | 87 | void setMaximumFileSize(KIO::filesize_t); | ||
88 | 88 | | |||
89 | // sets the time the file newer than | 89 | // sets the time the file newer than | ||
▲ Show 20 Lines • Show All 51 Lines • ▼ Show 20 Line(s) | |||||
141 | 141 | | |||
142 | bool checkLine(const QString &line, bool backwards = false) const; | 142 | bool checkLine(const QString &line, bool backwards = false) const; | ||
143 | const QString &foundText() const { return lastSuccessfulGrep; } | 143 | const QString &foundText() const { return lastSuccessfulGrep; } | ||
144 | int matchIndex() const { return lastSuccessfulGrepMatchIndex; } | 144 | int matchIndex() const { return lastSuccessfulGrepMatchIndex; } | ||
145 | int matchLength() const { return lastSuccessfulGrepMatchLength; } | 145 | int matchLength() const { return lastSuccessfulGrepMatchLength; } | ||
146 | 146 | | |||
147 | protected: | 147 | protected: | ||
148 | // important to know whether the event processor is connected | 148 | // important to know whether the event processor is connected | ||
149 | virtual void connectNotify(const QMetaMethod &signal) Q_DECL_OVERRIDE; | 149 | void connectNotify(const QMetaMethod &signal) Q_DECL_OVERRIDE; | ||
150 | // important to know whether the event processor is connected | 150 | // important to know whether the event processor is connected | ||
151 | virtual void disconnectNotify(const QMetaMethod &signal) Q_DECL_OVERRIDE; | 151 | void disconnectNotify(const QMetaMethod &signal) Q_DECL_OVERRIDE; | ||
152 | 152 | | |||
153 | protected: | 153 | protected: | ||
154 | QStringList matches; // what to search | 154 | QStringList matches; // what to search | ||
155 | QStringList excludes; // what to exclude | 155 | QStringList excludes; // what to exclude | ||
156 | QStringList includedDirs; // what dirs to include | 156 | QStringList includedDirs; // what dirs to include | ||
157 | QStringList excludedDirs; // what dirs to exclude | 157 | QStringList excludedDirs; // what dirs to exclude | ||
158 | bool matchesCaseSensitive; | 158 | bool matchesCaseSensitive; | ||
159 | 159 | | |||
Show All 27 Lines | |||||
187 | 187 | | |||
188 | signals: | 188 | signals: | ||
189 | void status(const QString &name); | 189 | void status(const QString &name); | ||
190 | void processEvents(bool &stopped); | 190 | void processEvents(bool &stopped); | ||
191 | 191 | | |||
192 | private: | 192 | private: | ||
193 | bool matchCommon(const QString &, const QStringList &, const QStringList &) const; | 193 | bool matchCommon(const QString &, const QStringList &, const QStringList &) const; | ||
194 | bool checkPerm(QString perm) const; | 194 | bool checkPerm(QString perm) const; | ||
195 | bool checkType(QString mime) const; | 195 | bool checkType(const QString& mime) const; | ||
196 | bool containsContent(QString file) const; | 196 | bool containsContent(const QString& file) const; | ||
197 | bool containsContent(QUrl url) const; | 197 | bool containsContent(const QUrl& url) const; | ||
198 | bool checkBuffer(const char *data, int len) const; | 198 | bool checkBuffer(const char *data, int len) const; | ||
199 | bool checkTimer() const; | 199 | bool checkTimer() const; | ||
200 | QStringList split(QString); | 200 | QStringList split(QString); | ||
201 | 201 | | |||
202 | private slots: | 202 | private slots: | ||
203 | void containsContentData(KIO::Job *, const QByteArray &); | 203 | void containsContentData(KIO::Job *, const QByteArray &); | ||
204 | void containsContentFinished(KJob *); | 204 | void containsContentFinished(KJob *); | ||
205 | 205 | | |||
Show All 23 Lines |