Git: Style fixes

Change-Id: I600e939e99de77e92de1ff068a5ebad98eb736ca
Reviewed-by: Petar Perisin <petar.perisin@gmail.com>
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
Orgad Shaneh
2013-06-10 19:49:18 +03:00
committed by Orgad Shaneh
parent 5cb29aec0b
commit 69d0d6cdca
13 changed files with 50 additions and 36 deletions

View File

@@ -136,8 +136,8 @@ bool CommitData::checkLine(const QString &stateInfo, const QString &file)
if (xState == UnknownFileState || yState == UnknownFileState)
return false;
bool isMerge = (xState == UnmergedFile || yState == UnmergedFile ||
((xState == yState) && (xState == AddedFile || xState == DeletedFile)));
bool isMerge = (xState == UnmergedFile || yState == UnmergedFile
|| ((xState == yState) && (xState == AddedFile || xState == DeletedFile)));
if (isMerge) {
if (xState == yState) {
if (xState == UnmergedFile)

View File

@@ -2369,10 +2369,9 @@ QStringList GitClient::synchronousRepositoryBranches(const QString &repositoryUR
{
QStringList arguments(QLatin1String("ls-remote"));
arguments << repositoryURL << QLatin1String(HEAD) << QLatin1String("refs/heads/*");
const unsigned flags =
VcsBasePlugin::SshPasswordPrompt|
VcsBasePlugin::SuppressStdErrInLogWindow|
VcsBasePlugin::SuppressFailMessageInLogWindow;
const unsigned flags = VcsBasePlugin::SshPasswordPrompt
| VcsBasePlugin::SuppressStdErrInLogWindow
| VcsBasePlugin::SuppressFailMessageInLogWindow;
const Utils::SynchronousProcessResponse resp = synchronousGit(QString(), arguments, flags);
QStringList branches;
branches << tr("<Detached HEAD>");
@@ -2832,7 +2831,8 @@ bool GitClient::executeAndHandleConflicts(const QString &workingDirectory,
const QString &abortCommand)
{
// Disable UNIX terminals to suppress SSH prompting.
const unsigned flags = VcsBasePlugin::SshPasswordPrompt | VcsBasePlugin::ShowStdOutInLogWindow
const unsigned flags = VcsBasePlugin::SshPasswordPrompt
| VcsBasePlugin::ShowStdOutInLogWindow
| VcsBasePlugin::ExpectRepoChanges;
const Utils::SynchronousProcessResponse resp = synchronousGit(workingDirectory, arguments, flags);
ConflictHandler conflictHandler(0, workingDirectory, abortCommand);
@@ -2936,7 +2936,8 @@ void GitClient::synchronousSubversionFetch(const QString &workingDirectory)
QStringList args;
args << QLatin1String("svn") << QLatin1String("fetch");
// Disable UNIX terminals to suppress SSH prompting.
const unsigned flags = VcsBasePlugin::SshPasswordPrompt|VcsBasePlugin::ShowStdOutInLogWindow
const unsigned flags = VcsBasePlugin::SshPasswordPrompt
| VcsBasePlugin::ShowStdOutInLogWindow
| VcsBasePlugin::ShowSuccessMessage;
synchronousGit(workingDirectory, args, flags);
}
@@ -3198,9 +3199,9 @@ QString GitClient::readConfigValue(const QString &workingDirectory, const QStrin
bool GitClient::cloneRepository(const QString &directory,const QByteArray &url)
{
QDir workingDirectory(directory);
const unsigned flags = VcsBasePlugin::SshPasswordPrompt |
VcsBasePlugin::ShowStdOutInLogWindow|
VcsBasePlugin::ShowSuccessMessage;
const unsigned flags = VcsBasePlugin::SshPasswordPrompt
| VcsBasePlugin::ShowStdOutInLogWindow
| VcsBasePlugin::ShowSuccessMessage;
if (workingDirectory.exists()) {
if (!synchronousInit(workingDirectory.path()))

View File

@@ -154,7 +154,10 @@ void GitoriousHostWidget::selectRow(int r)
{
if (r >= 0 && r != selectedRow()) {
const QModelIndex index = m_model->index(r, 0);
ui->hostView->selectionModel()->setCurrentIndex(index, QItemSelectionModel::Select|QItemSelectionModel::Current|QItemSelectionModel::Rows);
ui->hostView->selectionModel()->setCurrentIndex(index,
QItemSelectionModel::Select
| QItemSelectionModel::Current
| QItemSelectionModel::Rows);
}
}

View File

@@ -100,7 +100,10 @@ GitoriousProjectWidget::GitoriousProjectWidget(int hostIndex,
ui->projectTreeView->resizeColumnToContents(r);
// Select first
const QModelIndex index = m_filterModel->index(0, 0);
ui->projectTreeView->selectionModel()->setCurrentIndex(index, QItemSelectionModel::Select|QItemSelectionModel::Current|QItemSelectionModel::Rows);
ui->projectTreeView->selectionModel()->setCurrentIndex(index,
QItemSelectionModel::Select
| QItemSelectionModel::Current
| QItemSelectionModel::Rows);
}
// Continuous update

View File

@@ -182,7 +182,10 @@ void GitoriousRepositoryWizardPage::initializePage()
// Select first
if (firstEntry) {
const QModelIndex filterIndex = m_filterModel->mapFromSource(m_model->indexFromItem(firstEntry));
ui->repositoryTreeView->selectionModel()->setCurrentIndex(filterIndex, QItemSelectionModel::Select|QItemSelectionModel::Current|QItemSelectionModel::Rows);
ui->repositoryTreeView->selectionModel()->setCurrentIndex(filterIndex,
QItemSelectionModel::Select
| QItemSelectionModel::Current
| QItemSelectionModel::Rows);
}
ui->repositoryTreeView->setFocus();
}

View File

@@ -142,7 +142,8 @@ QString GitVersionControl::vcsCreateSnapshot(const QString &topLevel)
QString keyword = QLatin1String(stashMessageKeywordC) + QString::number(n++);
const QString stashMessage =
m_client->synchronousStash(topLevel, keyword,
GitClient::StashImmediateRestore|GitClient::StashIgnoreUnchanged,
GitClient::StashImmediateRestore
| GitClient::StashIgnoreUnchanged,
&repositoryUnchanged);
if (!stashMessage.isEmpty())
return stashMessage;

View File

@@ -248,7 +248,8 @@ void MergeTool::readData()
} else if (m_merging && line.startsWith("Continue merging")) {
if (QMessageBox::question(0, tr("Continue Merging"),
tr("Continue merging other unresolved paths?"),
QMessageBox::Yes|QMessageBox::No, QMessageBox::No) == QMessageBox::Yes) {
QMessageBox::Yes | QMessageBox::No,
QMessageBox::No) == QMessageBox::Yes) {
m_process->write("y\n");
} else {
m_process->write("n\n");

View File

@@ -159,7 +159,8 @@ void RemoteDialog::removeRemote()
const QString remoteName = m_remoteModel->remoteName(row);
if (QMessageBox::question(this, tr("Delete Remote"),
tr("Would you like to delete the remote \"%1\"?").arg(remoteName),
QMessageBox::Yes|QMessageBox::No, QMessageBox::Yes) == QMessageBox::Yes) {
QMessageBox::Yes | QMessageBox::No,
QMessageBox::Yes) == QMessageBox::Yes) {
m_remoteModel->removeRemote(row);
}
}

View File

@@ -402,7 +402,8 @@ void StashDialog::warning(const QString &title, const QString &what, const QStri
bool StashDialog::ask(const QString &title, const QString &what, bool defaultButton)
{
return QMessageBox::question(this, title, what, QMessageBox::Yes|QMessageBox::No,
return QMessageBox::question(
this, title, what, QMessageBox::Yes | QMessageBox::No,
defaultButton ? QMessageBox::Yes : QMessageBox::No) == QMessageBox::Yes;
}