Changeset View
Changeset View
Standalone View
Standalone View
kdevplatform/project/filemanagerlistjob.h
Show All 16 Lines | 1 | /* This file is part of KDevelop | |||
---|---|---|---|---|---|
17 | Boston, MA 02110-1301, USA. | 17 | Boston, MA 02110-1301, USA. | ||
18 | */ | 18 | */ | ||
19 | 19 | | |||
20 | #ifndef KDEVPLATFORM_FILEMANAGERLISTJOB_H | 20 | #ifndef KDEVPLATFORM_FILEMANAGERLISTJOB_H | ||
21 | #define KDEVPLATFORM_FILEMANAGERLISTJOB_H | 21 | #define KDEVPLATFORM_FILEMANAGERLISTJOB_H | ||
22 | 22 | | |||
23 | #include <KIO/Job> | 23 | #include <KIO/Job> | ||
24 | #include <QQueue> | 24 | #include <QQueue> | ||
25 | 25 | | |||
mwolff: unused | |||||
26 | // uncomment to time imort jobs | 26 | // uncomment to time imort jobs | ||
27 | // #define TIME_IMPORT_JOB | 27 | // #define TIME_IMPORT_JOB | ||
28 | 28 | | |||
29 | #ifdef TIME_IMPORT_JOB | 29 | #ifdef TIME_IMPORT_JOB | ||
30 | #include <QElapsedTimer> | 30 | #include <QElapsedTimer> | ||
31 | #endif | 31 | #endif | ||
32 | 32 | | |||
33 | namespace KDevelop | 33 | namespace KDevelop | ||
34 | { | 34 | { | ||
35 | class ProjectFolderItem; | 35 | class ProjectFolderItem; | ||
36 | 36 | | |||
37 | class FileManagerListJob : public KIO::Job | 37 | class FileManagerListJob : public KIO::Job | ||
38 | { | 38 | { | ||
39 | Q_OBJECT | 39 | Q_OBJECT | ||
40 | 40 | | |||
41 | public: | 41 | public: | ||
42 | explicit FileManagerListJob(ProjectFolderItem* item); | 42 | explicit FileManagerListJob(ProjectFolderItem* item); | ||
mwolff: why is the watcher optional? | |||||
It no longer has to be, now that I've removed the possibility to turn off dirwatching which I had left in for testing. rjvbb: It no longer has to be, now that I've removed the possibility to turn off dirwatching which I… | |||||
43 | ProjectFolderItem* item() const; | 43 | ProjectFolderItem* item() const; | ||
44 | 44 | | |||
45 | void addSubDir(ProjectFolderItem* item); | 45 | void addSubDir(ProjectFolderItem* item); | ||
46 | void removeSubDir(ProjectFolderItem* item); | 46 | void removeSubDir(ProjectFolderItem* item); | ||
47 | 47 | | |||
48 | void abort(); | 48 | void abort(); | ||
49 | void start() override; | 49 | void start() override; | ||
50 | 50 | | |||
51 | Q_SIGNALS: | 51 | Q_SIGNALS: | ||
52 | void entries(FileManagerListJob* job, ProjectFolderItem* baseItem, | 52 | void entries(FileManagerListJob* job, ProjectFolderItem* baseItem, | ||
53 | const KIO::UDSEntryList& entries); | 53 | const KIO::UDSEntryList& entries); | ||
54 | void nextJob(); | 54 | void nextJob(); | ||
55 | void watchDir(const QString& path); | ||||
55 | 56 | | |||
56 | private Q_SLOTS: | 57 | private Q_SLOTS: | ||
57 | void slotEntries(KIO::Job* job, const KIO::UDSEntryList& entriesIn ); | 58 | void slotEntries(KIO::Job* job, const KIO::UDSEntryList& entriesIn ); | ||
58 | void slotResult(KJob* job) override; | 59 | void slotResult(KJob* job) override; | ||
59 | void handleResults(const KIO::UDSEntryList& entries); | 60 | void handleResults(const KIO::UDSEntryList& entries); | ||
60 | void startNextJob(); | 61 | void startNextJob(); | ||
61 | 62 | | |||
62 | private: | 63 | private: | ||
63 | 64 | | |||
64 | QQueue<ProjectFolderItem*> m_listQueue; | 65 | QQueue<ProjectFolderItem*> m_listQueue; | ||
65 | /// current base dir | 66 | /// current base dir | ||
66 | ProjectFolderItem* m_item; | 67 | ProjectFolderItem* m_item; | ||
67 | KIO::UDSEntryList entryList; | 68 | KIO::UDSEntryList entryList; | ||
68 | // kill does not delete the job instantaniously | 69 | // kill does not delete the job instantaniously | ||
69 | QAtomicInt m_aborted; | 70 | QAtomicInt m_aborted; | ||
70 | 71 | | |||
71 | #ifdef TIME_IMPORT_JOB | 72 | #ifdef TIME_IMPORT_JOB | ||
72 | QElapsedTimer m_timer; | 73 | QElapsedTimer m_timer; | ||
73 | QElapsedTimer m_subTimer; | 74 | QElapsedTimer m_subTimer; | ||
74 | qint64 m_subWaited = 0; | 75 | qint64 m_subWaited = 0; | ||
75 | #endif | 76 | #endif | ||
76 | }; | 77 | }; | ||
77 | 78 | | |||
it's not a copy, it's a reference via pointer (you only copy the pointer). remove the comment, it doesn't add any value mwolff: it's not a copy, it's a reference via pointer (you only copy the pointer). remove the comment… | |||||
78 | } | 79 | } | ||
79 | 80 | | |||
80 | #endif // KDEVPLATFORM_FILEMANAGERLISTJOB_H | 81 | #endif // KDEVPLATFORM_FILEMANAGERLISTJOB_H |
unused