Vcs: Introduce IVersionControl::unmanagedFiles()

... and use it in VcsManager::promptToAdd().
This is purely a refactoring. The different IVersionControl subclasses
can (and should) override the naive base class implementation in the
future.

Change-Id: Ifdf49852a98f53a95dad1a89131243b21052bc66
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Christian Kandeler
2019-11-14 11:14:11 +01:00
parent 18ecbb9b14
commit bb5727de17
3 changed files with 19 additions and 6 deletions

View File

@@ -26,6 +26,7 @@
#include "iversioncontrol.h"
#include "vcsmanager.h"
#include <utils/algorithm.h>
#include <utils/hostosinfo.h>
#include <utils/qtcassert.h>
@@ -147,6 +148,14 @@ IVersionControl::~IVersionControl()
delete m_topicCache;
}
QStringList IVersionControl::unmanagedFiles(const QString &workingDir,
const QStringList &filePaths) const
{
return Utils::filtered(filePaths, [wd = QDir(workingDir), this](const QString &f) {
return !managesFile(wd.path(), wd.relativeFilePath(f));
});
}
IVersionControl::OpenSupportMode IVersionControl::openSupportMode(const QString &fileName) const
{
Q_UNUSED(fileName)