aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/vcsbase/wizard/vcsjsextension.cpp
blob: 0ed14ace4fdf6d651ec16868c533fc27b99c1345 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0

#include "vcsjsextension.h"

#include <coreplugin/iversioncontrol.h>
#include <coreplugin/vcsmanager.h>

using namespace Core;
using namespace Utils;

namespace VcsBase {
namespace Internal {

bool VcsJsExtension::isConfigured(const QString &vcsId) const
{
    IVersionControl *vc = VcsManager::versionControl(Id::fromString(vcsId));
    return vc && vc->isConfigured();
}

QString VcsJsExtension::displayName(const QString &vcsId) const
{
    IVersionControl *vc = VcsManager::versionControl(Id::fromString(vcsId));
    return vc ? vc->displayName() : QString();
}

bool VcsJsExtension::isValidRepoUrl(const QString &vcsId, const QString &location) const
{
    const IVersionControl * const vc = VcsManager::versionControl(Id::fromString(vcsId));
    return vc && vc->getRepoUrl(location).isValid;
}

} // namespace Internal
} // namespace VcsBase