forked from qt-creator/qt-creator
VcsInfo: Remove unneeded c'tor and operator==
Change-Id: I6b2a797290854bd34abc6680d5377749678ef687 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -44,16 +44,6 @@ class VcsManagerPrivate
|
|||||||
public:
|
public:
|
||||||
class VcsInfo {
|
class VcsInfo {
|
||||||
public:
|
public:
|
||||||
VcsInfo() = default;
|
|
||||||
VcsInfo(IVersionControl *vc, const QString &tl) :
|
|
||||||
versionControl(vc), topLevel(tl)
|
|
||||||
{ }
|
|
||||||
|
|
||||||
bool operator == (const VcsInfo &other) const
|
|
||||||
{
|
|
||||||
return versionControl == other.versionControl && topLevel == other.topLevel;
|
|
||||||
}
|
|
||||||
|
|
||||||
IVersionControl *versionControl = nullptr;
|
IVersionControl *versionControl = nullptr;
|
||||||
QString topLevel;
|
QString topLevel;
|
||||||
};
|
};
|
||||||
@@ -99,7 +89,7 @@ public:
|
|||||||
QString tmpDir = dir;
|
QString tmpDir = dir;
|
||||||
const QChar slash = QLatin1Char('/');
|
const QChar slash = QLatin1Char('/');
|
||||||
while (tmpDir.count() >= topLevel.count() && !tmpDir.isEmpty()) {
|
while (tmpDir.count() >= topLevel.count() && !tmpDir.isEmpty()) {
|
||||||
m_cachedMatches.insert(tmpDir, VcsInfo(vc, topLevel));
|
m_cachedMatches.insert(tmpDir, {vc, topLevel});
|
||||||
// if no vc was found, this might mean we're inside a repo internal directory (.git)
|
// if no vc was found, this might mean we're inside a repo internal directory (.git)
|
||||||
// Cache only input directory, not parents
|
// Cache only input directory, not parents
|
||||||
if (!vc)
|
if (!vc)
|
||||||
|
Reference in New Issue
Block a user