Subversion Repositories Scribus

Rev

Rev 14691 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
13669 pierre 1
/*****************************************************************
2
* Copyright (C) 2009  Pierre Marchand
3
 
4
* This program is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU General Public License
6
* as published by the Free Software Foundation; either version 2
7
* of the License, or (at your option) any later version.
8
 
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
* GNU General Public License for more details.
13
 
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
*
17
******************************************************************/
18
 
19
#ifndef FINDIMAGE_H
20
#define FINDIMAGE_H
21
 
22
#include <QDir>
23
#include <QString>
24
#include <QStringList>
25
#include <QThread>
26
 
27
//thread to search images in a folder and subfolders
28
class findImagesThread : public QThread
29
{
30
        public:
31
                //parameters:
32
                //const QString& path2: path to be searched
33
                //const QStringList& nameFilters2: namefilters for the images
34
                //QDir::SortFlags sort2: sortflags
35
                //bool searchSubfolders2: tells wether to search subfolders
36
                findImagesThread ( const QString& path2, const QStringList& nameFilters2, QDir::SortFlags sort2, bool searchSubfolders2 );
37
                //called after thread has been started
38
                void run();
39
                //called when the thread should be restarted
40
                void restart();
41
 
42
                //finds the images in a given folder
43
                void findFiles ( const QString& path );
44
 
45
                //contains the images which have been found
46
                QStringList imageFiles;
47
                //tells wether the thread should restart
48
                volatile bool restartThread;
49
 
50
        private:
51
                //path to start searching
52
                QString startPath;
53
                //namefilters for search
54
                QStringList nameFilters;
55
                //sortflags for search
56
                QDir::SortFlags sort;
57
                //tells wether to search subfolders
58
                bool searchSubfolders;
59
};
60
 
61
 
62
#endif // FINDIMAGE_H