~ubuntu-branches/ubuntu/quantal/kdevplatform/quantal-proposed

« back to all changes in this revision

Viewing changes to plugins/grepview/grepfindthread.h

  • Committer: Bazaar Package Importer
  • Author(s): Bhargav Mangipudi
  • Date: 2010-12-16 19:31:23 UTC
  • mfrom: (0.3.10 upstream)
  • Revision ID: james.westby@ubuntu.com-20101216193123-xe2keh5754zwsn1t
Tags: 1.1.80-0ubuntu1
* New upstream release
  - kdevplatform2-libs is now kdevplatform3-libs due to ABI changes
  - Update kdevplatform3-libs.install to include l10n files
  - Update kdevplatform-dev.install
* Removed localization packages

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef GREPFINDTHREAD_H
 
2
#define GREPFINDTHREAD_H
 
3
 
 
4
#include <QThread>
 
5
#include <KUrl>
 
6
 
 
7
class GrepFindFilesThread : public QThread
 
8
{
 
9
    Q_OBJECT
 
10
public:
 
11
    /**
 
12
     * @brief Constructor
 
13
     * @param[in] parent Parent
 
14
     * @param[in] startDir Root directory of the search
 
15
     * @param[in] recursive Whether the search should be recursive
 
16
     * @param[in] patterns Space-separated list of wildcard patterns to search for
 
17
     * @param[in] exclusions Space-separated list of wildcard patterns to exclude. Matches the whole path.
 
18
     * @param[in] onlyProject Whether the search should only consider project files.
 
19
     */
 
20
    GrepFindFilesThread(QObject *parent, const KUrl &startDir, bool recursive,
 
21
                    const QString &patterns, const QString &exclusions,
 
22
                    bool onlyProject);
 
23
    /**
 
24
     * @brief Returns the list of found files
 
25
     * @return List of found files
 
26
     */
 
27
    KUrl::List files() const;
 
28
    /**
 
29
     * @brief Sets the internal m_tryAbort flag to @c true
 
30
     * @note It is not guaranteed that the thread stops its work immediately.
 
31
     * Check this via QThread::isRunning() or QThread::isFinished().
 
32
     */
 
33
    void tryAbort();
 
34
    /**
 
35
     * @brief Check if the internal m_tryAbort flag is set
 
36
     * @return Whether the thread is going to abort its work.
 
37
     */
 
38
    bool triesToAbort() const;
 
39
    
 
40
    /**
 
41
     * @brief Parses include string to a list suitable for QDir::match
 
42
     */
 
43
    static QStringList parseInclude(QString inc);
 
44
    
 
45
    /**
 
46
     * @brief Parses exclude string to a list suitable for QDir::match
 
47
     */
 
48
    static QStringList parseExclude(QString excl);
 
49
    
 
50
protected:
 
51
    void run();
 
52
private:
 
53
    KUrl m_directory;
 
54
    QString m_patString;
 
55
    QString m_exclString;
 
56
    bool m_recursive;
 
57
    bool m_project;
 
58
    KUrl::List m_files;
 
59
    volatile bool m_tryAbort;
 
60
    // creating with no parameters would be bad
 
61
    GrepFindFilesThread();
 
62
};
 
63
 
 
64
#endif
 
 
b'\\ No newline at end of file'