forked from qt-creator/qt-creator
Version control: Compile with QT_NO_CAST_FROM_ASCII.
Change-Id: I85c007045efdb207f397b42fbce7a554ac9c9819 Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
This commit is contained in:
committed by
Tobias Hunger
parent
cdae5f2102
commit
e2ace515e2
@@ -2,6 +2,7 @@ TARGET = Bazaar
|
|||||||
TEMPLATE = lib
|
TEMPLATE = lib
|
||||||
include(../../qtcreatorplugin.pri)
|
include(../../qtcreatorplugin.pri)
|
||||||
include(bazaar_dependencies.pri)
|
include(bazaar_dependencies.pri)
|
||||||
|
DEFINES += QT_NO_CAST_FROM_ASCII
|
||||||
SOURCES += \
|
SOURCES += \
|
||||||
bazaarclient.cpp \
|
bazaarclient.cpp \
|
||||||
bazaarcontrol.cpp \
|
bazaarcontrol.cpp \
|
||||||
|
@@ -62,9 +62,8 @@ bool BazaarClient::synchronousSetUserId()
|
|||||||
{
|
{
|
||||||
QStringList args;
|
QStringList args;
|
||||||
args << QLatin1String("whoami")
|
args << QLatin1String("whoami")
|
||||||
<< QString("%1 <%2>")
|
<< (settings()->stringValue(BazaarSettings::userNameKey) + QLatin1String(" <")
|
||||||
.arg(settings()->stringValue(BazaarSettings::userNameKey))
|
+ settings()->stringValue(BazaarSettings::userEmailKey) + QLatin1Char('>'));
|
||||||
.arg(settings()->stringValue(BazaarSettings::userEmailKey));
|
|
||||||
QByteArray stdOut;
|
QByteArray stdOut;
|
||||||
return vcsFullySynchronousExec(QDir::currentPath(), args, &stdOut);
|
return vcsFullySynchronousExec(QDir::currentPath(), args, &stdOut);
|
||||||
}
|
}
|
||||||
@@ -80,8 +79,8 @@ BranchInfo BazaarClient::synchronousBranchQuery(const QString &repositoryRoot) c
|
|||||||
QTextStream ts(&branchConfFile);
|
QTextStream ts(&branchConfFile);
|
||||||
QString branchLocation;
|
QString branchLocation;
|
||||||
QString isBranchBound;
|
QString isBranchBound;
|
||||||
const QRegExp branchLocationRx("bound_location\\s*=\\s*(.+)$");
|
const QRegExp branchLocationRx(QLatin1String("bound_location\\s*=\\s*(.+)$"));
|
||||||
const QRegExp isBranchBoundRx("bound\\s*=\\s*(.+)$");
|
const QRegExp isBranchBoundRx(QLatin1String("bound\\s*=\\s*(.+)$"));
|
||||||
while (!ts.atEnd() && (branchLocation.isEmpty() || isBranchBound.isEmpty())) {
|
while (!ts.atEnd() && (branchLocation.isEmpty() || isBranchBound.isEmpty())) {
|
||||||
const QString line = ts.readLine();
|
const QString line = ts.readLine();
|
||||||
if (branchLocationRx.indexIn(line) != -1)
|
if (branchLocationRx.indexIn(line) != -1)
|
||||||
|
@@ -153,7 +153,7 @@ QString BazaarCommitWidget::committer() const
|
|||||||
|
|
||||||
QStringList BazaarCommitWidget::fixedBugs() const
|
QStringList BazaarCommitWidget::fixedBugs() const
|
||||||
{
|
{
|
||||||
return m_bazaarCommitPanelUi.fixedBugsLineEdit->text().split(QRegExp("\\s+"));
|
return m_bazaarCommitPanelUi.fixedBugsLineEdit->text().split(QRegExp(QLatin1String("\\s+")));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BazaarCommitWidget::isLocalOptionEnabled() const
|
bool BazaarCommitWidget::isLocalOptionEnabled() const
|
||||||
|
@@ -388,7 +388,7 @@ void BazaarPlugin::logRepository()
|
|||||||
const VcsBase::VcsBasePluginState state = currentState();
|
const VcsBase::VcsBasePluginState state = currentState();
|
||||||
QTC_ASSERT(state.hasTopLevel(), return);
|
QTC_ASSERT(state.hasTopLevel(), return);
|
||||||
QStringList extraOptions;
|
QStringList extraOptions;
|
||||||
extraOptions += QString("--limit=%1").arg(settings().intValue(BazaarSettings::logCountKey));
|
extraOptions += QLatin1String("--limit=") + QString::number(settings().intValue(BazaarSettings::logCountKey));
|
||||||
m_client->log(state.topLevel(), QStringList(), extraOptions);
|
m_client->log(state.topLevel(), QStringList(), extraOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -647,7 +647,7 @@ bool BazaarPlugin::submitEditorAboutToClose(VcsBase::VcsBaseSubmitEditor *submit
|
|||||||
//rewrite entries of the form 'file => newfile' to 'newfile' because
|
//rewrite entries of the form 'file => newfile' to 'newfile' because
|
||||||
//this would mess the commit command
|
//this would mess the commit command
|
||||||
for (QStringList::iterator iFile = files.begin(); iFile != files.end(); ++iFile) {
|
for (QStringList::iterator iFile = files.begin(); iFile != files.end(); ++iFile) {
|
||||||
const QStringList parts = iFile->split(" => ", QString::SkipEmptyParts);
|
const QStringList parts = iFile->split(QLatin1String(" => "), QString::SkipEmptyParts);
|
||||||
if (!parts.isEmpty())
|
if (!parts.isEmpty())
|
||||||
*iFile = parts.last();
|
*iFile = parts.last();
|
||||||
}
|
}
|
||||||
|
@@ -8,6 +8,7 @@ include(../../plugins/coreplugin/coreplugin.pri)
|
|||||||
include(../../plugins/vcsbase/vcsbase.pri)
|
include(../../plugins/vcsbase/vcsbase.pri)
|
||||||
include(../../libs/utils/utils.pri)
|
include(../../libs/utils/utils.pri)
|
||||||
|
|
||||||
|
DEFINES += QT_NO_CAST_FROM_ASCII
|
||||||
HEADERS += annotationhighlighter.h \
|
HEADERS += annotationhighlighter.h \
|
||||||
cvsplugin.h \
|
cvsplugin.h \
|
||||||
cvscontrol.h \
|
cvscontrol.h \
|
||||||
|
@@ -1293,7 +1293,7 @@ IEditor *CvsPlugin::showOutputInEditor(const QString& title, const QString &outp
|
|||||||
qDebug() << "CVSPlugin::showOutputInEditor" << title << id.name()
|
qDebug() << "CVSPlugin::showOutputInEditor" << title << id.name()
|
||||||
<< "source=" << source << "Size= " << output.size() << " Type=" << editorType << debugCodec(codec);
|
<< "source=" << source << "Size= " << output.size() << " Type=" << editorType << debugCodec(codec);
|
||||||
QString s = title;
|
QString s = title;
|
||||||
IEditor *editor = EditorManager::instance()->openEditorWithContents(id, &s, output.toLocal8Bit());
|
IEditor *editor = EditorManager::instance()->openEditorWithContents(id, &s, output);
|
||||||
connect(editor, SIGNAL(annotateRevisionRequested(QString,QString,int)),
|
connect(editor, SIGNAL(annotateRevisionRequested(QString,QString,int)),
|
||||||
this, SLOT(vcsAnnotate(QString,QString,int)));
|
this, SLOT(vcsAnnotate(QString,QString,int)));
|
||||||
CvsEditor *e = qobject_cast<CvsEditor*>(editor->widget());
|
CvsEditor *e = qobject_cast<CvsEditor*>(editor->widget());
|
||||||
|
@@ -152,7 +152,7 @@ public:
|
|||||||
}
|
}
|
||||||
return names;
|
return names;
|
||||||
}
|
}
|
||||||
return QStringList(fullName().join(QString('/')));
|
return QStringList(fullName().join(QString(QLatin1Char('/'))));
|
||||||
}
|
}
|
||||||
|
|
||||||
BranchNode *parent;
|
BranchNode *parent;
|
||||||
@@ -371,7 +371,7 @@ QString BranchModel::branchName(const QModelIndex &idx) const
|
|||||||
if (!node->isLeaf())
|
if (!node->isLeaf())
|
||||||
return QString();
|
return QString();
|
||||||
QStringList path = node->fullName();
|
QStringList path = node->fullName();
|
||||||
return path.join(QString('/'));
|
return path.join(QString(QLatin1Char('/')));
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList BranchModel::localBranchNames() const
|
QStringList BranchModel::localBranchNames() const
|
||||||
@@ -520,7 +520,7 @@ QModelIndex BranchModel::addBranch(const QString &branchName, bool track, const
|
|||||||
output = toolTip(branchName); // abuse toolTip to get the data;-)
|
output = toolTip(branchName); // abuse toolTip to get the data;-)
|
||||||
QStringList lines = output.split(QLatin1Char('\n'));
|
QStringList lines = output.split(QLatin1Char('\n'));
|
||||||
foreach (const QString &l, lines) {
|
foreach (const QString &l, lines) {
|
||||||
if (l.startsWith("commit ")) {
|
if (l.startsWith(QLatin1String("commit "))) {
|
||||||
newNode->sha = l.mid(7, 8);
|
newNode->sha = l.mid(7, 8);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@@ -65,7 +65,7 @@ bool CloneWizardPagePrivate::urlIsLocal(const QString &url)
|
|||||||
{
|
{
|
||||||
if (url.startsWith(QLatin1String("file://"))
|
if (url.startsWith(QLatin1String("file://"))
|
||||||
|| url.startsWith(QLatin1Char('/'))
|
|| url.startsWith(QLatin1Char('/'))
|
||||||
|| (url.at(0).isLetter() && url.at(1) == QChar(':') && url.at(2) == QChar('\\')))
|
|| (url.at(0).isLetter() && url.at(1) == QLatin1Char(':') && url.at(2) == QLatin1Char('\\')))
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -103,10 +103,9 @@ QString CloneWizardPage::directoryFromRepository(const QString &urlIn) const
|
|||||||
/* Try to figure out a good directory name from something like:
|
/* Try to figure out a good directory name from something like:
|
||||||
* 'user@host:qt/qt.git', 'http://host/qt/qt.git' 'local repo'
|
* 'user@host:qt/qt.git', 'http://host/qt/qt.git' 'local repo'
|
||||||
* ------> 'qt' . */
|
* ------> 'qt' . */
|
||||||
|
|
||||||
QString url = urlIn.trimmed().replace(QChar('\\'), QChar('/'));
|
|
||||||
|
|
||||||
const QChar slash = QLatin1Char('/');
|
const QChar slash = QLatin1Char('/');
|
||||||
|
QString url = urlIn.trimmed().replace(QLatin1Char('\\'), slash);
|
||||||
|
|
||||||
// remove host
|
// remove host
|
||||||
const int protocolDelimiterPos = url.indexOf(d->protocolDelimiter); // "://"
|
const int protocolDelimiterPos = url.indexOf(d->protocolDelimiter); // "://"
|
||||||
const int startRepoSearchPos = protocolDelimiterPos == -1 ? 0 : protocolDelimiterPos + d->protocolDelimiter.size();
|
const int startRepoSearchPos = protocolDelimiterPos == -1 ? 0 : protocolDelimiterPos + d->protocolDelimiter.size();
|
||||||
|
@@ -116,7 +116,7 @@ static bool checkLine(const QString &stateInfo, const QString &file, QList<Commi
|
|||||||
QTC_ASSERT(stateInfo.count() == 2, return false);
|
QTC_ASSERT(stateInfo.count() == 2, return false);
|
||||||
QTC_ASSERT(files, return false);
|
QTC_ASSERT(files, return false);
|
||||||
|
|
||||||
if (stateInfo == "??") {
|
if (stateInfo == QLatin1String("??")) {
|
||||||
files->append(qMakePair(CommitData::UntrackedFile, file));
|
files->append(qMakePair(CommitData::UntrackedFile, file));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -157,12 +157,12 @@ bool CommitData::parseFilesFromStatus(const QString &output)
|
|||||||
if (line.isEmpty())
|
if (line.isEmpty())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (line.startsWith("## ")) {
|
if (line.startsWith(QLatin1String("## "))) {
|
||||||
// Branch indication:
|
// Branch indication:
|
||||||
panelInfo.branch = line.mid(3);
|
panelInfo.branch = line.mid(3);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
QTC_ASSERT(line.at(2) == ' ', continue);
|
QTC_ASSERT(line.at(2) == QLatin1Char(' '), continue);
|
||||||
if (!checkLine(line.mid(0, 2), line.mid(3), &files))
|
if (!checkLine(line.mid(0, 2), line.mid(3), &files))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
TEMPLATE = lib
|
TEMPLATE = lib
|
||||||
TARGET = ScmGit
|
TARGET = ScmGit
|
||||||
|
DEFINES += QT_NO_CAST_FROM_ASCII
|
||||||
include(../../qtcreatorplugin.pri)
|
include(../../qtcreatorplugin.pri)
|
||||||
include(../../plugins/projectexplorer/projectexplorer.pri)
|
include(../../plugins/projectexplorer/projectexplorer.pri)
|
||||||
include(../../plugins/texteditor/texteditor.pri)
|
include(../../plugins/texteditor/texteditor.pri)
|
||||||
|
@@ -99,7 +99,7 @@ public:
|
|||||||
m_patienceButton = addToggleButton(QLatin1String("--patience"), tr("Patience"),
|
m_patienceButton = addToggleButton(QLatin1String("--patience"), tr("Patience"),
|
||||||
tr("Use the patience algorithm for calculating the differences."));
|
tr("Use the patience algorithm for calculating the differences."));
|
||||||
mapSetting(m_patienceButton, client->settings()->boolPointer(GitSettings::diffPatienceKey));
|
mapSetting(m_patienceButton, client->settings()->boolPointer(GitSettings::diffPatienceKey));
|
||||||
m_ignoreWSButton = addToggleButton("--ignore-space-change", tr("Ignore Whitespace"),
|
m_ignoreWSButton = addToggleButton(QLatin1String("--ignore-space-change"), tr("Ignore Whitespace"),
|
||||||
tr("Ignore whitespace only changes."));
|
tr("Ignore whitespace only changes."));
|
||||||
mapSetting(m_ignoreWSButton, m_client->settings()->boolPointer(GitSettings::ignoreSpaceChangesInDiffKey));
|
mapSetting(m_ignoreWSButton, m_client->settings()->boolPointer(GitSettings::ignoreSpaceChangesInDiffKey));
|
||||||
|
|
||||||
@@ -229,7 +229,7 @@ public:
|
|||||||
mapSetting(addToggleButton(QString(), tr("Omit Date"),
|
mapSetting(addToggleButton(QString(), tr("Omit Date"),
|
||||||
tr("Hide the date of a change from the output.")),
|
tr("Hide the date of a change from the output.")),
|
||||||
m_client->settings()->boolPointer(GitSettings::omitAnnotationDateKey));
|
m_client->settings()->boolPointer(GitSettings::omitAnnotationDateKey));
|
||||||
mapSetting(addToggleButton(QString("-w"), tr("Ignore Whitespace"),
|
mapSetting(addToggleButton(QLatin1String("-w"), tr("Ignore Whitespace"),
|
||||||
tr("Ignore whitespace only changes.")),
|
tr("Ignore whitespace only changes.")),
|
||||||
m_client->settings()->boolPointer(GitSettings::ignoreSpaceChangesInBlameKey));
|
m_client->settings()->boolPointer(GitSettings::ignoreSpaceChangesInBlameKey));
|
||||||
|
|
||||||
@@ -385,7 +385,7 @@ QString GitClient::findRepositoryForDirectory(const QString &dir)
|
|||||||
QStringList arguments;
|
QStringList arguments;
|
||||||
arguments << QLatin1String("rev-parse") << QLatin1String("--show-toplevel");
|
arguments << QLatin1String("rev-parse") << QLatin1String("--show-toplevel");
|
||||||
fullySynchronousGit(directory.absolutePath(), arguments, &outputText, 0, false);
|
fullySynchronousGit(directory.absolutePath(), arguments, &outputText, 0, false);
|
||||||
return outputText.trimmed();
|
return QString::fromLocal8Bit(outputText.trimmed());
|
||||||
} else {
|
} else {
|
||||||
// Check for ".git/config"
|
// Check for ".git/config"
|
||||||
const QString checkFile = QLatin1String(GIT_DIRECTORY) + QLatin1String("/config");
|
const QString checkFile = QLatin1String(GIT_DIRECTORY) + QLatin1String("/config");
|
||||||
@@ -612,7 +612,7 @@ void GitClient::log(const QString &workingDirectory, const QStringList &fileName
|
|||||||
bool enableAnnotationContextMenu, const QStringList &args)
|
bool enableAnnotationContextMenu, const QStringList &args)
|
||||||
{
|
{
|
||||||
const QString msgArg = fileNames.empty() ? workingDirectory :
|
const QString msgArg = fileNames.empty() ? workingDirectory :
|
||||||
fileNames.join(QString(", "));
|
fileNames.join(QLatin1String(", "));
|
||||||
const QString title = tr("Git Log \"%1\"").arg(msgArg);
|
const QString title = tr("Git Log \"%1\"").arg(msgArg);
|
||||||
const Core::Id editorId = Git::Constants::GIT_LOG_EDITOR_ID;
|
const Core::Id editorId = Git::Constants::GIT_LOG_EDITOR_ID;
|
||||||
const QString sourceFile = VcsBase::VcsBaseEditorWidget::getSource(workingDirectory, fileNames);
|
const QString sourceFile = VcsBase::VcsBaseEditorWidget::getSource(workingDirectory, fileNames);
|
||||||
@@ -1559,14 +1559,14 @@ QStringList GitClient::synchronousRepositoryBranches(const QString &repositoryUR
|
|||||||
VcsBase::VcsBasePlugin::SuppressFailMessageInLogWindow;
|
VcsBase::VcsBasePlugin::SuppressFailMessageInLogWindow;
|
||||||
const Utils::SynchronousProcessResponse resp = synchronousGit(QString(), arguments, flags);
|
const Utils::SynchronousProcessResponse resp = synchronousGit(QString(), arguments, flags);
|
||||||
QStringList branches;
|
QStringList branches;
|
||||||
branches << "<detached HEAD>";
|
branches << QLatin1String("<detached HEAD>");
|
||||||
QString headSha;
|
QString headSha;
|
||||||
if (resp.result == Utils::SynchronousProcessResponse::Finished) {
|
if (resp.result == Utils::SynchronousProcessResponse::Finished) {
|
||||||
// split "82bfad2f51d34e98b18982211c82220b8db049b<tab>refs/heads/master"
|
// split "82bfad2f51d34e98b18982211c82220b8db049b<tab>refs/heads/master"
|
||||||
foreach(const QString &line, resp.stdOut.split(QLatin1Char('\n'))) {
|
foreach(const QString &line, resp.stdOut.split(QLatin1Char('\n'))) {
|
||||||
if (line.endsWith("\tHEAD")) {
|
if (line.endsWith(QLatin1String("\tHEAD"))) {
|
||||||
QTC_CHECK(headSha.isNull());
|
QTC_CHECK(headSha.isNull());
|
||||||
headSha = line.left(line.indexOf(QChar('\t')));
|
headSha = line.left(line.indexOf(QLatin1Char('\t')));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1588,14 +1588,14 @@ void GitClient::launchGitK(const QString &workingDirectory)
|
|||||||
{
|
{
|
||||||
const QFileInfo binaryInfo(gitBinaryPath());
|
const QFileInfo binaryInfo(gitBinaryPath());
|
||||||
QDir foundBinDir(binaryInfo.dir());
|
QDir foundBinDir(binaryInfo.dir());
|
||||||
const bool foundBinDirIsCmdDir = foundBinDir.dirName() == "cmd";
|
const bool foundBinDirIsCmdDir = foundBinDir.dirName() == QLatin1String("cmd");
|
||||||
QProcessEnvironment env = processEnvironment();
|
QProcessEnvironment env = processEnvironment();
|
||||||
if (tryLauchingGitK(env, workingDirectory, foundBinDir.path(), foundBinDirIsCmdDir))
|
if (tryLauchingGitK(env, workingDirectory, foundBinDir.path(), foundBinDirIsCmdDir))
|
||||||
return;
|
return;
|
||||||
if (!foundBinDirIsCmdDir)
|
if (!foundBinDirIsCmdDir)
|
||||||
return;
|
return;
|
||||||
foundBinDir.cdUp();
|
foundBinDir.cdUp();
|
||||||
tryLauchingGitK(env, workingDirectory, foundBinDir.path() + "/bin", false);
|
tryLauchingGitK(env, workingDirectory, foundBinDir.path() + QLatin1String("/bin"), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GitClient::tryLauchingGitK(const QProcessEnvironment &env,
|
bool GitClient::tryLauchingGitK(const QProcessEnvironment &env,
|
||||||
@@ -1739,7 +1739,9 @@ bool GitClient::getCommitData(const QString &workingDirectory,
|
|||||||
if (amend) {
|
if (amend) {
|
||||||
// Amend: get last commit data as "SHA1@message".
|
// Amend: get last commit data as "SHA1@message".
|
||||||
QStringList args(QLatin1String("log"));
|
QStringList args(QLatin1String("log"));
|
||||||
const QString format = synchronousGitVersion(true) > 0x010701 ? "%h@%B" : "%h@%s%n%n%b";
|
const QString format = synchronousGitVersion(true) > 0x010701 ?
|
||||||
|
QLatin1String("%h@%B") :
|
||||||
|
QLatin1String("%h@%s%n%n%b");
|
||||||
args << QLatin1String("--max-count=1") << QLatin1String("--pretty=format:") + format;
|
args << QLatin1String("--max-count=1") << QLatin1String("--pretty=format:") + format;
|
||||||
QTextCodec *codec = QTextCodec::codecForName(commitData->commitEncoding.toLocal8Bit());
|
QTextCodec *codec = QTextCodec::codecForName(commitData->commitEncoding.toLocal8Bit());
|
||||||
const Utils::SynchronousProcessResponse sp = synchronousGit(repoDirectory, args, 0, codec);
|
const Utils::SynchronousProcessResponse sp = synchronousGit(repoDirectory, args, 0, codec);
|
||||||
@@ -2228,7 +2230,7 @@ bool GitClient::cloneRepository(const QString &directory,const QByteArray &url)
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
QStringList arguments(QLatin1String("remote"));
|
QStringList arguments(QLatin1String("remote"));
|
||||||
arguments << QLatin1String("add") << QLatin1String("origin") << url;
|
arguments << QLatin1String("add") << QLatin1String("origin") << QLatin1String(url);
|
||||||
if (!fullySynchronousGit(workingDirectory.path(), arguments, 0, 0, true))
|
if (!fullySynchronousGit(workingDirectory.path(), arguments, 0, 0, true))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@@ -2256,7 +2258,7 @@ bool GitClient::cloneRepository(const QString &directory,const QByteArray &url)
|
|||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
QStringList arguments(QLatin1String("clone"));
|
QStringList arguments(QLatin1String("clone"));
|
||||||
arguments << url << workingDirectory.dirName();
|
arguments << QLatin1String(url) << workingDirectory.dirName();
|
||||||
workingDirectory.cdUp();
|
workingDirectory.cdUp();
|
||||||
const Utils::SynchronousProcessResponse resp =
|
const Utils::SynchronousProcessResponse resp =
|
||||||
synchronousGit(workingDirectory.path(), arguments, flags);
|
synchronousGit(workingDirectory.path(), arguments, flags);
|
||||||
@@ -2326,7 +2328,7 @@ unsigned GitClient::synchronousGitVersion(bool silent, QString *errorMessage) co
|
|||||||
// run git --version
|
// run git --version
|
||||||
QByteArray outputText;
|
QByteArray outputText;
|
||||||
QByteArray errorText;
|
QByteArray errorText;
|
||||||
const bool rc = fullySynchronousGit(QString(), QStringList("--version"), &outputText, &errorText);
|
const bool rc = fullySynchronousGit(QString(), QStringList(QLatin1String("--version")), &outputText, &errorText);
|
||||||
if (!rc) {
|
if (!rc) {
|
||||||
const QString msg = tr("Cannot determine git version: %1").arg(commandOutputFromLocal8Bit(errorText));
|
const QString msg = tr("Cannot determine git version: %1").arg(commandOutputFromLocal8Bit(errorText));
|
||||||
if (errorMessage) {
|
if (errorMessage) {
|
||||||
|
@@ -98,7 +98,7 @@ GitoriousHostWidget::GitoriousHostWidget(QWidget *parent) :
|
|||||||
ui->browseToolButton->setIcon(style()->standardIcon(QStyle::SP_MessageBoxInformation));
|
ui->browseToolButton->setIcon(style()->standardIcon(QStyle::SP_MessageBoxInformation));
|
||||||
connect(ui->browseToolButton, SIGNAL(clicked()), this, SLOT(slotBrowse()));
|
connect(ui->browseToolButton, SIGNAL(clicked()), this, SLOT(slotBrowse()));
|
||||||
ui->browseToolButton->setEnabled(false);
|
ui->browseToolButton->setEnabled(false);
|
||||||
ui->deleteToolButton->setIcon(QIcon(Core::Constants::ICON_MINUS));
|
ui->deleteToolButton->setIcon(QIcon(QLatin1String(Core::Constants::ICON_MINUS)));
|
||||||
connect(ui->deleteToolButton, SIGNAL(clicked()), this, SLOT(slotDelete()));
|
connect(ui->deleteToolButton, SIGNAL(clicked()), this, SLOT(slotDelete()));
|
||||||
ui->deleteToolButton->setEnabled(false);
|
ui->deleteToolButton->setEnabled(false);
|
||||||
|
|
||||||
|
@@ -378,7 +378,7 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
|||||||
Core::Id("Git.DiffProject"),
|
Core::Id("Git.DiffProject"),
|
||||||
globalcontext, true,
|
globalcontext, true,
|
||||||
SLOT(diffCurrentProject()));
|
SLOT(diffCurrentProject()));
|
||||||
parameterActionCommand.second->setDefaultKeySequence(QKeySequence("Alt+G,Alt+Shift+D"));
|
parameterActionCommand.second->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+Shift+D")));
|
||||||
|
|
||||||
parameterActionCommand
|
parameterActionCommand
|
||||||
= createProjectAction(actionManager, gitContainer,
|
= createProjectAction(actionManager, gitContainer,
|
||||||
|
@@ -39,10 +39,10 @@ namespace Internal {
|
|||||||
// Parse a branch line: " *name sha description".
|
// Parse a branch line: " *name sha description".
|
||||||
bool RemoteModel::Remote::parse(const QString &line)
|
bool RemoteModel::Remote::parse(const QString &line)
|
||||||
{
|
{
|
||||||
if (!line.endsWith(" (fetch)"))
|
if (!line.endsWith(QLatin1String(" (fetch)")))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
QStringList tokens = line.split(QRegExp("\\s"), QString::SkipEmptyParts);
|
QStringList tokens = line.split(QRegExp(QLatin1String("\\s")), QString::SkipEmptyParts);
|
||||||
if (tokens.count() != 3)
|
if (tokens.count() != 3)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@@ -2,6 +2,7 @@ TARGET = Mercurial
|
|||||||
TEMPLATE = lib
|
TEMPLATE = lib
|
||||||
include(../../qtcreatorplugin.pri)
|
include(../../qtcreatorplugin.pri)
|
||||||
include(mercurial_dependencies.pri)
|
include(mercurial_dependencies.pri)
|
||||||
|
DEFINES += QT_NO_CAST_FROM_ASCII
|
||||||
SOURCES += mercurialplugin.cpp \
|
SOURCES += mercurialplugin.cpp \
|
||||||
optionspage.cpp \
|
optionspage.cpp \
|
||||||
mercurialcontrol.cpp \
|
mercurialcontrol.cpp \
|
||||||
|
@@ -111,8 +111,9 @@ bool MercurialClient::synchronousClone(const QString &workingDir,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// By now, there is no hgrc file -> create it
|
// By now, there is no hgrc file -> create it
|
||||||
Utils::FileSaver saver(workingDirectory.path()+"/.hg/hgrc");
|
Utils::FileSaver saver(workingDirectory.path() + QLatin1String("/.hg/hgrc"));
|
||||||
saver.write(QString("[paths]\ndefault = %1\n").arg(dstLocation).toUtf8());
|
const QString hgrc = QLatin1String("[paths]\ndefault = ") + dstLocation + QLatin1Char('\n');
|
||||||
|
saver.write(hgrc.toUtf8());
|
||||||
if (!saver.finalize()) {
|
if (!saver.finalize()) {
|
||||||
VcsBase::VcsBaseOutputWindow::instance()->appendError(saver.errorString());
|
VcsBase::VcsBaseOutputWindow::instance()->appendError(saver.errorString());
|
||||||
return false;
|
return false;
|
||||||
|
@@ -168,7 +168,7 @@ bool MercurialControl::sccManaged(const QString &filename)
|
|||||||
|
|
||||||
bool MercurialControl::vcsCheckout(const QString &directory, const QByteArray &url)
|
bool MercurialControl::vcsCheckout(const QString &directory, const QByteArray &url)
|
||||||
{
|
{
|
||||||
return mercurialClient->synchronousClone(QString(), directory, url);
|
return mercurialClient->synchronousClone(QString(), directory, QLatin1String(url));
|
||||||
}
|
}
|
||||||
|
|
||||||
QString MercurialControl::vcsGetRepositoryURL(const QString &directory)
|
QString MercurialControl::vcsGetRepositoryURL(const QString &directory)
|
||||||
|
@@ -41,7 +41,7 @@ PendingChangesDialog::PendingChangesDialog(const QString &data, QWidget *parent)
|
|||||||
{
|
{
|
||||||
m_ui.setupUi(this);
|
m_ui.setupUi(this);
|
||||||
if (!data.isEmpty()) {
|
if (!data.isEmpty()) {
|
||||||
QRegExp r("Change\\s(\\d+).*\\s\\*pending\\*\\s(.+)\n");
|
QRegExp r(QLatin1String("Change\\s(\\d+).*\\s\\*pending\\*\\s(.+)\n"));
|
||||||
r.setMinimal(true);
|
r.setMinimal(true);
|
||||||
int pos = 0;
|
int pos = 0;
|
||||||
QListWidgetItem *item;
|
QListWidgetItem *item;
|
||||||
|
@@ -4,6 +4,8 @@ TARGET = Perforce
|
|||||||
include(../../qtcreatorplugin.pri)
|
include(../../qtcreatorplugin.pri)
|
||||||
include(perforce_dependencies.pri)
|
include(perforce_dependencies.pri)
|
||||||
|
|
||||||
|
DEFINES += QT_NO_CAST_FROM_ASCII
|
||||||
|
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
perforceplugin.h \
|
perforceplugin.h \
|
||||||
perforcechecker.h \
|
perforcechecker.h \
|
||||||
|
@@ -883,7 +883,8 @@ bool PerforcePlugin::managesDirectoryFstat(const QString &directory)
|
|||||||
args << QLatin1String("fstat") << QLatin1String("-m1") << perforceRelativeFileArguments(relativeDirArgs);
|
args << QLatin1String("fstat") << QLatin1String("-m1") << perforceRelativeFileArguments(relativeDirArgs);
|
||||||
const PerforceResponse result = runP4Cmd(m_settings.topLevel(), args,
|
const PerforceResponse result = runP4Cmd(m_settings.topLevel(), args,
|
||||||
RunFullySynchronous);
|
RunFullySynchronous);
|
||||||
managed = result.stdOut.contains("depotFile") || result.stdErr.contains("... - no such file(s)");
|
managed = result.stdOut.contains(QLatin1String("depotFile"))
|
||||||
|
|| result.stdErr.contains(QLatin1String("... - no such file(s)"));
|
||||||
} while(false);
|
} while(false);
|
||||||
|
|
||||||
m_managedDirectoryCache.insert(directory, managed);
|
m_managedDirectoryCache.insert(directory, managed);
|
||||||
|
@@ -8,6 +8,8 @@ include(../../plugins/coreplugin/coreplugin.pri)
|
|||||||
include(../../plugins/vcsbase/vcsbase.pri)
|
include(../../plugins/vcsbase/vcsbase.pri)
|
||||||
include(../../libs/utils/utils.pri)
|
include(../../libs/utils/utils.pri)
|
||||||
|
|
||||||
|
DEFINES += QT_NO_CAST_FROM_ASCII
|
||||||
|
|
||||||
HEADERS += annotationhighlighter.h \
|
HEADERS += annotationhighlighter.h \
|
||||||
subversionplugin.h \
|
subversionplugin.h \
|
||||||
subversioncontrol.h \
|
subversioncontrol.h \
|
||||||
|
@@ -1304,14 +1304,14 @@ bool SubversionPlugin::vcsCheckout(const QString &directory, const QByteArray &u
|
|||||||
// authentication will always fail (if the username and password data are not stored locally),
|
// authentication will always fail (if the username and password data are not stored locally),
|
||||||
// if for example we are logging into a new host for the first time using svn. There seems to
|
// if for example we are logging into a new host for the first time using svn. There seems to
|
||||||
// be a bug in subversion, so this might get fixed in the future.
|
// be a bug in subversion, so this might get fixed in the future.
|
||||||
tempUrl.setUserInfo("");
|
tempUrl.setUserInfo(QString());
|
||||||
args << tempUrl.toEncoded() << directory;
|
args << QLatin1String(tempUrl.toEncoded()) << directory;
|
||||||
const SubversionResponse response = runSvn(directory, username, password, args,
|
const SubversionResponse response = runSvn(directory, username, password, args,
|
||||||
m_settings.longTimeOutMS(),
|
m_settings.longTimeOutMS(),
|
||||||
VcsBase::VcsBasePlugin::SshPasswordPrompt);
|
VcsBase::VcsBasePlugin::SshPasswordPrompt);
|
||||||
return !response.error;
|
return !response.error;
|
||||||
} else {
|
} else {
|
||||||
args << url << directory;
|
args << QLatin1String(url) << directory;
|
||||||
const SubversionResponse response = runSvn(directory, args, m_settings.longTimeOutMS(),
|
const SubversionResponse response = runSvn(directory, args, m_settings.longTimeOutMS(),
|
||||||
VcsBase::VcsBasePlugin::SshPasswordPrompt);
|
VcsBase::VcsBasePlugin::SshPasswordPrompt);
|
||||||
return !response.error;
|
return !response.error;
|
||||||
|
@@ -53,7 +53,7 @@ public:
|
|||||||
BaseVcsSubmitEditorFactoryPrivate::BaseVcsSubmitEditorFactoryPrivate(const VcsBaseSubmitEditorParameters *parameters) :
|
BaseVcsSubmitEditorFactoryPrivate::BaseVcsSubmitEditorFactoryPrivate(const VcsBaseSubmitEditorParameters *parameters) :
|
||||||
m_parameters(parameters),
|
m_parameters(parameters),
|
||||||
m_id(parameters->id),
|
m_id(parameters->id),
|
||||||
m_displayName(parameters->displayName),
|
m_displayName(QLatin1String(parameters->displayName)),
|
||||||
m_mimeTypes(QLatin1String(parameters->mimeType))
|
m_mimeTypes(QLatin1String(parameters->mimeType))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
TEMPLATE = lib
|
TEMPLATE = lib
|
||||||
TARGET = VCSBase
|
TARGET = VCSBase
|
||||||
DEFINES += VCSBASE_LIBRARY
|
DEFINES += VCSBASE_LIBRARY QT_NO_CAST_FROM_ASCII
|
||||||
include(../../qtcreatorplugin.pri)
|
include(../../qtcreatorplugin.pri)
|
||||||
include(vcsbase_dependencies.pri)
|
include(vcsbase_dependencies.pri)
|
||||||
HEADERS += vcsbase_global.h \
|
HEADERS += vcsbase_global.h \
|
||||||
|
@@ -1397,7 +1397,7 @@ void VcsBaseEditorWidget::slotPaste()
|
|||||||
// Retrieve service by soft dependency.
|
// Retrieve service by soft dependency.
|
||||||
QObject *pasteService =
|
QObject *pasteService =
|
||||||
ExtensionSystem::PluginManager::instance()
|
ExtensionSystem::PluginManager::instance()
|
||||||
->getObjectByClassName("CodePaster::CodePasterService");
|
->getObjectByClassName(QLatin1String("CodePaster::CodePasterService"));
|
||||||
if (pasteService) {
|
if (pasteService) {
|
||||||
QMetaObject::invokeMethod(pasteService, "postCurrentEditor");
|
QMetaObject::invokeMethod(pasteService, "postCurrentEditor");
|
||||||
} else {
|
} else {
|
||||||
|
@@ -823,14 +823,14 @@ static SynchronousProcessResponse runVcsFullySynchronously(const QString &workin
|
|||||||
&stdOut, &stdErr, true);
|
&stdOut, &stdErr, true);
|
||||||
|
|
||||||
if (!stdErr.isEmpty()) {
|
if (!stdErr.isEmpty()) {
|
||||||
response.stdErr = QString::fromLocal8Bit(stdErr).remove('\r');
|
response.stdErr = QString::fromLocal8Bit(stdErr).remove(QLatin1Char('\r'));
|
||||||
if (!(flags & VcsBasePlugin::SuppressStdErrInLogWindow))
|
if (!(flags & VcsBasePlugin::SuppressStdErrInLogWindow))
|
||||||
outputWindow->append(response.stdErr);
|
outputWindow->append(response.stdErr);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!stdOut.isEmpty()) {
|
if (!stdOut.isEmpty()) {
|
||||||
response.stdOut = (outputCodec ? outputCodec->toUnicode(stdOut) : QString::fromLocal8Bit(stdOut))
|
response.stdOut = (outputCodec ? outputCodec->toUnicode(stdOut) : QString::fromLocal8Bit(stdOut))
|
||||||
.remove('\r');
|
.remove(QLatin1Char('\r'));
|
||||||
if (flags & VcsBasePlugin::ShowStdOutInLogWindow)
|
if (flags & VcsBasePlugin::ShowStdOutInLogWindow)
|
||||||
outputWindow->append(response.stdOut);
|
outputWindow->append(response.stdOut);
|
||||||
}
|
}
|
||||||
|
@@ -510,14 +510,14 @@ void VcsBaseSubmitEditor::setFileModel(QAbstractItemModel *m, const QString &rep
|
|||||||
if ((sym->isClass() || sym->isFunction() || sym->isNamespace())
|
if ((sym->isClass() || sym->isFunction() || sym->isNamespace())
|
||||||
&& (symId != 0 && acceptsWordForCompletion(symId->chars())))
|
&& (symId != 0 && acceptsWordForCompletion(symId->chars())))
|
||||||
{
|
{
|
||||||
uniqueSymbols.insert(symId->chars());
|
uniqueSymbols.insert(QString::fromUtf8(symId->chars()));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle specific case : get "Foo" in "void Foo::function() {}"
|
// Handle specific case : get "Foo" in "void Foo::function() {}"
|
||||||
if (sym->isFunction() && !sym->asFunction()->isDeclaration()) {
|
if (sym->isFunction() && !sym->asFunction()->isDeclaration()) {
|
||||||
const char *className = belongingClassName(sym->asFunction());
|
const char *className = belongingClassName(sym->asFunction());
|
||||||
if (acceptsWordForCompletion(className))
|
if (acceptsWordForCompletion(className))
|
||||||
uniqueSymbols.insert(className);
|
uniqueSymbols.insert(QString::fromUtf8(className));
|
||||||
}
|
}
|
||||||
|
|
||||||
++symPtr;
|
++symPtr;
|
||||||
|
@@ -94,7 +94,8 @@ bool VcsConfigurationPage::isComplete() const
|
|||||||
|
|
||||||
void VcsConfigurationPage::openConfiguration()
|
void VcsConfigurationPage::openConfiguration()
|
||||||
{
|
{
|
||||||
Core::ICore::showOptionsDialog(VcsBase::Constants::VCS_SETTINGS_CATEGORY, d->m_versionControl->id().toString());
|
Core::ICore::showOptionsDialog(QLatin1String(VcsBase::Constants::VCS_SETTINGS_CATEGORY),
|
||||||
|
d->m_versionControl->id().toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace VcsBase
|
} // namespace VcsBase
|
||||||
|
Reference in New Issue
Block a user