Example #1
0
bool RemoteModel::refresh(const QString &workingDirectory, QString *errorMessage)
{
    // Run branch command with verbose.
    QStringList remoteArgs;
    remoteArgs << QLatin1String("-v");
    QString output;
    if (!m_client->synchronousRemoteCmd(workingDirectory, remoteArgs, &output, errorMessage))
        return false;
    // Parse output
    m_workingDirectory = workingDirectory;
    m_remotes.clear();
    const QStringList lines = output.split(QLatin1Char('\n'));
    for (int r = 0; r < lines.count(); ++r) {
        Remote newRemote;
        if (newRemote.parse(lines.at(r)))
            m_remotes.push_back(newRemote);
    }
    reset();
    return true;
}