Index: kdevplatform/project/abstractfilemanagerplugin.h =================================================================== --- kdevplatform/project/abstractfilemanagerplugin.h +++ kdevplatform/project/abstractfilemanagerplugin.h @@ -103,6 +103,20 @@ */ KDirWatch* projectWatcher( IProject* project ) const; + /** + * @return the number of watched directories for the given @p project. + * + * Stock KDirWatch doesn't currently have a method to query the number of items it watches + * but it will be watching just about everything in the project so this returns the file+folder + * count as a reasonable approximation. + */ + int watchedItems( IProject* project ) const; + + /** + * tell the plugin that the given @p project is going to be closed. + */ + void projectClosing( IProject *project ); + Q_SIGNALS: void reloadedFileItem(KDevelop::ProjectFileItem* file); void reloadedFolderItem(KDevelop::ProjectFolderItem* folder); Index: kdevplatform/project/abstractfilemanagerplugin.cpp =================================================================== --- kdevplatform/project/abstractfilemanagerplugin.cpp +++ kdevplatform/project/abstractfilemanagerplugin.cpp @@ -661,6 +661,16 @@ return d->m_watchers.value( project, nullptr ); } +int AbstractFileManagerPlugin::watchedItems( IProject* project ) const +{ + return project->fileSet().size(); +} + +void AbstractFileManagerPlugin::projectClosing( IProject *project ) +{ + d->projectClosing(project); +} + //END Plugin #include "moc_abstractfilemanagerplugin.cpp" Index: kdevplatform/project/tests/CMakeLists.txt =================================================================== --- kdevplatform/project/tests/CMakeLists.txt +++ kdevplatform/project/tests/CMakeLists.txt @@ -21,3 +21,12 @@ KDev::Tests Qt5::QuickWidgets ) + +add_executable(abstractfilemanagerpluginimportbenchmark + abstractfilemanagerpluginimportbenchmark.cpp +) +ecm_mark_nongui_executable(abstractfilemanagerpluginimportbenchmark) +target_link_libraries(abstractfilemanagerpluginimportbenchmark + KDev::Project + KDev::Tests +)