diff --git a/project/abstractfilemanagerplugin.h b/project/abstractfilemanagerplugin.h --- a/project/abstractfilemanagerplugin.h +++ b/project/abstractfilemanagerplugin.h @@ -120,12 +120,10 @@ // friend class Private; Private* const d; - Q_PRIVATE_SLOT(d, KJob* eventuallyReadFolder( ProjectFolderItem* item, - const bool forceRecursion = false )) + Q_PRIVATE_SLOT(d, KJob* eventuallyReadFolder( ProjectFolderItem* item )) Q_PRIVATE_SLOT(d, void addJobItems(FileManagerListJob* job, ProjectFolderItem* baseItem, - const KIO::UDSEntryList& entries, - const bool forceRecursion)) + const KIO::UDSEntryList& entries)) Q_PRIVATE_SLOT(d, void deleted(const QString &path)) Q_PRIVATE_SLOT(d, void created(const QString &path)) diff --git a/project/abstractfilemanagerplugin.cpp b/project/abstractfilemanagerplugin.cpp --- a/project/abstractfilemanagerplugin.cpp +++ b/project/abstractfilemanagerplugin.cpp @@ -74,13 +74,10 @@ AbstractFileManagerPlugin* q; - /// @p forceRecursion if true, existing folders will be re-read no matter what - KIO::Job* eventuallyReadFolder( ProjectFolderItem* item, - const bool forceRecursion = false ); + KIO::Job* eventuallyReadFolder( ProjectFolderItem* item ); void addJobItems(FileManagerListJob* job, ProjectFolderItem* baseItem, - const KIO::UDSEntryList& entries, - const bool forceRecursion); + const KIO::UDSEntryList& entries); void deleted(const QString &path); void created(const QString &path); @@ -118,19 +115,18 @@ m_filters.remove(project); } -KIO::Job* AbstractFileManagerPlugin::Private::eventuallyReadFolder( ProjectFolderItem* item, - const bool forceRecursion ) +KIO::Job* AbstractFileManagerPlugin::Private::eventuallyReadFolder( ProjectFolderItem* item ) { - FileManagerListJob* listJob = new FileManagerListJob( item, forceRecursion ); + FileManagerListJob* listJob = new FileManagerListJob( item ); m_projectJobs[ item->project() ] << listJob; qCDebug(FILEMANAGER) << "adding job" << listJob << item << item->path() << "for project" << item->project(); q->connect( listJob, &FileManagerListJob::finished, q, [&] (KJob* job) { jobFinished(job); } ); q->connect( listJob, &FileManagerListJob::entries, - q, [&] (FileManagerListJob* job, ProjectFolderItem* baseItem, const KIO::UDSEntryList& entries, bool forceRecursion) { - addJobItems(job, baseItem, entries, forceRecursion); } ); + q, [&] (FileManagerListJob* job, ProjectFolderItem* baseItem, const KIO::UDSEntryList& entries) { + addJobItems(job, baseItem, entries); } ); return listJob; } @@ -154,8 +150,7 @@ void AbstractFileManagerPlugin::Private::addJobItems(FileManagerListJob* job, ProjectFolderItem* baseItem, - const KIO::UDSEntryList& entries, - const bool forceRecursion) + const KIO::UDSEntryList& entries) { if ( entries.empty() ) { return; @@ -210,10 +205,8 @@ } else { // this folder already exists in the view folders.remove( index ); - if ( forceRecursion ) { - //no need to add this item, but we still want to recurse into it - job->addSubDir( f ); - } + // no need to add this item, but we still want to recurse into it + job->addSubDir( f ); emit q->reloadedFolderItem( f ); } } else if ( ProjectFileItem* f = baseItem->child(j)->file() ) { @@ -273,7 +266,7 @@ // exists already in this project, happens e.g. when we restart the dirwatcher // or if we delete and remove folders consecutively https://bugs.kde.org/show_bug.cgi?id=260741 qCDebug(FILEMANAGER) << "force reload of" << path << folder; - eventuallyReadFolder( folder, true ); + eventuallyReadFolder( folder ); found = true; } if ( found ) { @@ -494,7 +487,7 @@ bool AbstractFileManagerPlugin::reload( ProjectFolderItem* item ) { qCDebug(FILEMANAGER) << "reloading item" << item->path(); - d->eventuallyReadFolder( item->folder(), true ); + d->eventuallyReadFolder( item->folder() ); return true; } diff --git a/project/filemanagerlistjob.h b/project/filemanagerlistjob.h --- a/project/filemanagerlistjob.h +++ b/project/filemanagerlistjob.h @@ -39,7 +39,7 @@ Q_OBJECT public: - FileManagerListJob(ProjectFolderItem* item, const bool forceRecursion); + FileManagerListJob(ProjectFolderItem* item); ProjectFolderItem* item() const; void addSubDir(ProjectFolderItem* item); @@ -50,7 +50,7 @@ signals: void entries(FileManagerListJob* job, ProjectFolderItem* baseItem, - const KIO::UDSEntryList& entries, const bool forceRecursion); + const KIO::UDSEntryList& entries); void nextJob(); private slots: @@ -63,7 +63,6 @@ /// current base dir ProjectFolderItem* m_item; KIO::UDSEntryList entryList; - const bool m_forceRecursion; // kill does not delete the job instantaniously bool m_aborted; diff --git a/project/filemanagerlistjob.cpp b/project/filemanagerlistjob.cpp --- a/project/filemanagerlistjob.cpp +++ b/project/filemanagerlistjob.cpp @@ -28,8 +28,8 @@ using namespace KDevelop; -FileManagerListJob::FileManagerListJob(ProjectFolderItem* item, const bool forceRecursion) - : KIO::Job(), m_item(item), m_forceRecursion(forceRecursion), m_aborted(false) +FileManagerListJob::FileManagerListJob(ProjectFolderItem* item) + : KIO::Job(), m_item(item), m_aborted(false) { /* the following line is not an error in judgment, apparently starting a * listJob while the previous one hasn't self-destructed takes a lot of time, @@ -87,7 +87,7 @@ return; } - emit entries(this, m_item, entryList, m_forceRecursion); + emit entries(this, m_item, entryList); entryList.clear(); if( job->error() ) {