Changeset View
Changeset View
Standalone View
Standalone View
krusader/Synchronizer/synchronizerdirlist.h
Show All 16 Lines | |||||
17 | * You should have received a copy of the GNU General Public License * | 17 | * You should have received a copy of the GNU General Public License * | ||
18 | * along with Krusader. If not, see [http://www.gnu.org/licenses/]. * | 18 | * along with Krusader. If not, see [http://www.gnu.org/licenses/]. * | ||
19 | *****************************************************************************/ | 19 | *****************************************************************************/ | ||
20 | 20 | | |||
21 | #ifndef SYNCHRONIZERDIRLIST_H | 21 | #ifndef SYNCHRONIZERDIRLIST_H | ||
22 | #define SYNCHRONIZERDIRLIST_H | 22 | #define SYNCHRONIZERDIRLIST_H | ||
23 | 23 | | |||
24 | // QtCore | 24 | // QtCore | ||
25 | #include <QObject> | | |||
26 | #include <QHash> | 25 | #include <QHash> | ||
26 | #include <QObject> | ||||
27 | 27 | | |||
28 | #include <KIO/Job> | 28 | #include <KIO/Job> | ||
29 | 29 | | |||
30 | #include "../FileSystem/fileitem.h" | 30 | class FileItem; | ||
31 | 31 | | |||
32 | class SynchronizerDirList : public QObject, public QHash<QString, FileItem *> | 32 | class SynchronizerDirList : public QObject, public QHash<QString, FileItem *> | ||
33 | { | 33 | { | ||
34 | Q_OBJECT | 34 | Q_OBJECT | ||
35 | 35 | | |||
36 | public: | 36 | public: | ||
37 | SynchronizerDirList(QWidget *w, bool ignoreHidden); | 37 | SynchronizerDirList(QWidget *w, bool ignoreHidden); | ||
38 | ~SynchronizerDirList(); | 38 | ~SynchronizerDirList(); | ||
39 | 39 | | |||
40 | FileItem *search(const QString &name, bool ignoreCase = false); | 40 | FileItem *search(const QString &name, bool ignoreCase = false); | ||
41 | FileItem *first(); | 41 | FileItem *first(); | ||
42 | FileItem *next(); | 42 | FileItem *next(); | ||
43 | 43 | | |||
44 | inline const QString & url() { | 44 | inline const QUrl &url() { return currentUrl; } | ||
45 | return currentUrl; | 45 | bool load(const QUrl &url, bool wait = false); | ||
46 | } | | |||
47 | bool load(const QString &urlIn, bool wait = false); | | |||
48 | 46 | | |||
49 | public slots: | 47 | public slots: | ||
50 | 48 | | |||
51 | void slotEntries(KIO::Job * job, const KIO::UDSEntryList& entries); | 49 | void slotEntries(KIO::Job *job, const KIO::UDSEntryList &entries); | ||
52 | void slotListResult(KJob *job); | 50 | void slotListResult(KJob *job); | ||
53 | 51 | | |||
54 | signals: | 52 | signals: | ||
55 | void finished(bool err); | 53 | void finished(bool err); | ||
56 | 54 | | |||
57 | private: | 55 | private: | ||
58 | QHashIterator<QString, FileItem *> *fileIterator; //< Point to a dictionary of file items | 56 | QHashIterator<QString, FileItem *> *fileIterator; //< Point to a dictionary of file items | ||
59 | QWidget *parentWidget; | 57 | QWidget *parentWidget; | ||
60 | bool busy; | 58 | bool busy; | ||
61 | bool result; | 59 | bool result; | ||
62 | bool ignoreHidden; | 60 | bool ignoreHidden; | ||
63 | QString currentUrl; | 61 | QUrl currentUrl; | ||
64 | }; | 62 | }; | ||
65 | 63 | | |||
66 | #endif /* __SYNCHRONIZER_DIR_LIST_H__ */ | 64 | #endif /* __SYNCHRONIZER_DIR_LIST_H__ */ |