6 #include <QtCore/QObject>
7 #include <QtCore/QRegExp>
8 #include <QtCore/QQueue>
9 #include <QtCore/QList>
10 #include <QtCore/QDir>
11 #include <QtCore/QStringList>
19 class KQuery
: public QObject
24 KQuery(QObject
*parent
= 0);
27 void setSizeRange( int mode
, KIO::filesize_t value1
, KIO::filesize_t value2
);
28 void setTimeRange( time_t from
, time_t to
);
29 void setRegExp( const QString
®exp
, bool caseSensitive
);
30 void setRecursive( bool recursive
);
31 void setPath(const KUrl
& url
);
32 void setFileType( int filetype
);
33 void setMimeType( const QStringList
& mimetype
);
34 void setContext( const QString
& context
, bool casesensitive
,
35 bool search_binary
, bool useRegexp
);
36 void setUsername( const QString
&username
);
37 void setGroupname( const QString
&groupname
);
38 void setMetaInfo(const QString
&metainfo
, const QString
&metainfokey
);
39 void setUseFileIndex(bool);
43 const KUrl
& url() {return m_url
;}
46 /* Check if file meets the find's requirements*/
47 inline void processQuery(const KFileItem
&);
50 /* List of files found using slocate */
51 void slotListEntries(QStringList
);
53 /* List of files found using KIO */
54 void slotListEntries(KIO::Job
*, const KIO::UDSEntryList
&);
55 void slotResult(KJob
*);
56 void slotCanceled(KJob
*);
57 void slotreadyReadStandardOutput();
58 void slotreadyReadStandardError();
59 void slotendProcessLocate(int, QProcess::ExitStatus
);
62 void addFile(const KFileItem
&filename
, const QString
& matchingLine
);
70 KIO::filesize_t m_sizeboundary1
;
71 KIO::filesize_t m_sizeboundary2
;
75 QRegExp m_regexp
;// regexp for file content
77 QStringList m_mimetype
;
82 QString m_metainfokey
;
85 bool m_regexpForContent
;
87 QByteArray bufferLocate
;
88 QStringList locateList
;
89 KProcess
*processLocate
;
90 QList
<QRegExp
*> m_regexps
;// regexps for file name
91 // QValueList<bool> m_regexpsContainsGlobs; // what should this be good for ? Alex
93 bool m_insideCheckEntries
;
94 QQueue
<KFileItem
> m_fileItems
;
97 QStringList ignore_mimetypes
;
98 QStringList ooo_mimetypes
; // OpenOffice.org mimetypes
99 QStringList koffice_mimetypes
;