┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/search/filenamesearchprotocol.h
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2010-11-24 15:51:58 +0000
committerPeter Penz <[email protected]>2010-11-24 15:51:58 +0000
commit32764c9696bcdbaf8136e47376ec6fe7a1c8ce05 (patch)
tree9ae3000ce39a5f52ba0b6ba947bfd59a8457d92c /src/search/filenamesearchprotocol.h
parentcd1ced91584105a53428bc1a23fb9c95cccdd6cb (diff)
Allow to search for filenames + textcontent also for non-local files.
svn path=/trunk/KDE/kdebase/apps/; revision=1200303
Diffstat (limited to 'src/search/filenamesearchprotocol.h')
-rw-r--r--src/search/filenamesearchprotocol.h18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/search/filenamesearchprotocol.h b/src/search/filenamesearchprotocol.h
index 1a2b8ad68..b2d64d6e3 100644
--- a/src/search/filenamesearchprotocol.h
+++ b/src/search/filenamesearchprotocol.h
@@ -19,25 +19,26 @@
#ifndef FILENAMESEARCHPROTOCOL_H
#define FILENAMESEARCHPROTOCOL_H
-
+
#include <kio/slavebase.h>
+class KFileItem;
class KUrl;
class QRegExp;
-
+
/**
* @brief Lists files where the filename matches do a given query.
*
* The query is defined as part of the "search" query item of the URL.
- * Example: The URL filenamesearch:///home/peter?search=hello lists
- * recursively all files inside the directory home/peter, that contain
- * the "hello" as part of their filename.
+ * The directory where the searching is started is defined in the "url" query
+ * item. If the query item "checkContent" is set to "yes", all files with
+ * a text MIME type will be checked for the content.
*/
class FileNameSearchProtocol : public KIO::SlaveBase {
public:
FileNameSearchProtocol(const QByteArray& pool, const QByteArray& app);
virtual ~FileNameSearchProtocol();
-
+
virtual void listDir(const KUrl& url);
private:
@@ -47,10 +48,11 @@ private:
* @return True, if the pattern m_searchPattern is part of
* the file \a fileName.
*/
- bool containsPattern(const KUrl& fileName) const;
+ bool contentContainsPattern(const KUrl& fileName) const;
+
bool m_checkContent;
QRegExp* m_regExp;
};
-
+
#endif