Changeset View
Standalone View
kdevplatform/project/abstractfilemanagerplugin.h
Show All 28 Lines | |||||
29 | 29 | | |||
30 | #include <interfaces/iplugin.h> | 30 | #include <interfaces/iplugin.h> | ||
31 | 31 | | |||
32 | class KDirWatch; | 32 | class KDirWatch; | ||
33 | 33 | | |||
34 | namespace KDevelop { | 34 | namespace KDevelop { | ||
35 | 35 | | |||
36 | class AbstractFileManagerPluginPrivate; | 36 | class AbstractFileManagerPluginPrivate; | ||
37 | class AFMPBenchmark; | ||||
37 | 38 | | |||
38 | /** | 39 | /** | ||
39 | * This class can be used as a common base for file managers. | 40 | * This class can be used as a common base for file managers. | ||
40 | * | 41 | * | ||
41 | * It supports remote files using KIO and uses KDirWatch to synchronize with on-disk changes. | 42 | * It supports remote files using KIO and uses KDirWatch to synchronize with on-disk changes. | ||
42 | */ | 43 | */ | ||
43 | class KDEVPLATFORMPROJECT_EXPORT AbstractFileManagerPlugin : public IPlugin, public virtual IProjectFileManager | 44 | class KDEVPLATFORMPROJECT_EXPORT AbstractFileManagerPlugin : public IPlugin, public virtual IProjectFileManager | ||
44 | { | 45 | { | ||
▲ Show 20 Lines • Show All 53 Lines • ▼ Show 20 Line(s) | 75 | // | |||
98 | virtual ProjectFileItem* createFileItem( IProject* project, const Path& path, | 99 | virtual ProjectFileItem* createFileItem( IProject* project, const Path& path, | ||
99 | ProjectBaseItem* parent); | 100 | ProjectBaseItem* parent); | ||
100 | 101 | | |||
101 | /** | 102 | /** | ||
102 | * @return the @c KDirWatch for the given @p project. | 103 | * @return the @c KDirWatch for the given @p project. | ||
103 | */ | 104 | */ | ||
104 | KDirWatch* projectWatcher( IProject* project ) const; | 105 | KDirWatch* projectWatcher( IProject* project ) const; | ||
105 | 106 | | |||
106 | Q_SIGNALS: | 107 | Q_SIGNALS: | ||
mwolff: remove this, it's imo not useful to know from the benchmark number and its an approximation… | |||||
The benchmark timings do depend on this number, so they really only means something when printed with the number of watched items. At least when the number is correct, so if I remove it here I'll have to find another way to obtain the info in the follow-up patch. IMHO this is all the more true if the improved algorithm refrains from watching folders that are filtered out because that means you cannot even do a simple find foo -type d | wc -l to determine the number of directories under foo. Actually, I could already introduce the ProjectWatcher class (it no longer needs a mutex), with or without the bit that applies the project filter. That should make the number of watched items available in the benchmark via dynamic_cast<ProjectWatcher*>(m_manager->projectWatcher(m_project)). Not watching likely filter suspects like .git and build should reduce import times a bit already so I like the idea, let me know if that's acceptable? rjvbb: The benchmark timings do depend on this number, so they really only means something when… | |||||
107 | void reloadedFileItem(KDevelop::ProjectFileItem* file); | 108 | void reloadedFileItem(KDevelop::ProjectFileItem* file); | ||
108 | void reloadedFolderItem(KDevelop::ProjectFolderItem* folder); | 109 | void reloadedFolderItem(KDevelop::ProjectFolderItem* folder); | ||
109 | 110 | | |||
110 | void folderAdded(KDevelop::ProjectFolderItem* folder); | 111 | void folderAdded(KDevelop::ProjectFolderItem* folder); | ||
111 | void folderRemoved(KDevelop::ProjectFolderItem* folder); | 112 | void folderRemoved(KDevelop::ProjectFolderItem* folder); | ||
112 | void folderRenamed(const KDevelop::Path& oldFolder, KDevelop::ProjectFolderItem* newFolder); | 113 | void folderRenamed(const KDevelop::Path& oldFolder, KDevelop::ProjectFolderItem* newFolder); | ||
113 | 114 | | |||
114 | void fileAdded(KDevelop::ProjectFileItem* file); | 115 | void fileAdded(KDevelop::ProjectFileItem* file); | ||
115 | void fileRemoved(KDevelop::ProjectFileItem* file); | 116 | void fileRemoved(KDevelop::ProjectFileItem* file); | ||
116 | void fileRenamed(const KDevelop::Path& oldFile, KDevelop::ProjectFileItem* newFile); | 117 | void fileRenamed(const KDevelop::Path& oldFile, KDevelop::ProjectFileItem* newFile); | ||
117 | 118 | | |||
118 | private: | 119 | private: | ||
remove. if necessary connect to IProjectController::projectClosing internally, but don't let others call this directly mwolff: remove. if necessary connect to `IProjectController::projectClosing` internally, but don't let… | |||||
Can you please explain how that would work without creating a ProjectController instance in the benchmark? Is there no other way to call this hidden code without patching code that's otherwise completely unrelated to dirwatching issues? PLEASE don't just look at the patch, *try* it locally, look at the numbers you get with the most relevant KDirWatch methods and decide whether or not the time spent deleting dirwatchers is really irrelevant to you. I honestly don't really understand why AFMP couldn't have a (protected) method that basically does the opposite of what the import method does. rjvbb: Can you please explain how that would work without creating a ProjectController instance in the… | |||||
119 | const QScopedPointer<class AbstractFileManagerPluginPrivate> d; | 120 | const QScopedPointer<class AbstractFileManagerPluginPrivate> d; | ||
The request was for a standalone benchmark. I have thus added these 2 additions to AFMP. I don't mind simply removing them and their application in the benchmark if they're seen as a problem. rjvbb: The request was for a standalone benchmark. I have thus added these 2 additions to AFMP. I… | |||||
120 | friend class AbstractFileManagerPluginPrivate; | 121 | friend class AbstractFileManagerPluginPrivate; | ||
122 | public: | ||||
123 | friend class AFMPBenchmark; | ||||
121 | }; | 124 | }; | ||
122 | 125 | | |||
123 | } | 126 | } | ||
124 | 127 | | |||
125 | #endif // KDEVPLATFORM_ABSTRACTFILEMANAGERPLUGIN_H | 128 | #endif // KDEVPLATFORM_ABSTRACTFILEMANAGERPLUGIN_H |
remove this, it's imo not useful to know from the benchmark number and its an approximation anyways