Commit 3adb533a authored by Tobias Hunger's avatar Tobias Hunger

Bazaar: Cleanups

Clean up whitespaces and coding style issues.
parent f9bb4c59
......@@ -113,12 +113,15 @@ QString BazaarClient::findTopLevelForFile(const QFileInfo &file) const
QString BazaarClient::vcsEditorKind(VCSCommand cmd) const
{
switch(cmd) {
case AnnotateCommand : return QLatin1String(Constants::ANNOTATELOG);
case DiffCommand : return QLatin1String(Constants::DIFFLOG);
case LogCommand : return QLatin1String(Constants::FILELOG);
default : return QLatin1String("");
case AnnotateCommand:
return QLatin1String(Constants::ANNOTATELOG);
case DiffCommand:
return QLatin1String(Constants::DIFFLOG);
case LogCommand:
return QLatin1String(Constants::FILELOG);
default:
return QString();
}
return QLatin1String("");
}
QStringList BazaarClient::cloneArguments(const QString &srcLocation,
......
......@@ -147,7 +147,7 @@ BazaarPlugin::~BazaarPlugin()
m_instance = 0;
}
bool BazaarPlugin::initialize(const QStringList &/*arguments*/, QString */*error_message*/)
bool BazaarPlugin::initialize(const QStringList &/*arguments*/, QString * /*error_message*/)
{
typedef VCSBase::VCSEditorFactory<BazaarEditor> BazaarEditorFactory;
......@@ -290,29 +290,29 @@ void BazaarPlugin::createFileActions(const Core::Context &context)
void BazaarPlugin::addCurrentFile()
{
const VCSBase::VCSBasePluginState state = currentState();
QTC_ASSERT(state.hasFile(), return)
m_client->synchronousAdd(state.currentFileTopLevel(), state.relativeCurrentFile());
QTC_ASSERT(state.hasFile(), return);
m_client->synchronousAdd(state.currentFileTopLevel(), state.relativeCurrentFile());
}
void BazaarPlugin::annotateCurrentFile()
{
const VCSBase::VCSBasePluginState state = currentState();
QTC_ASSERT(state.hasFile(), return)
m_client->annotate(state.currentFileTopLevel(), state.relativeCurrentFile());
QTC_ASSERT(state.hasFile(), return);
m_client->annotate(state.currentFileTopLevel(), state.relativeCurrentFile());
}
void BazaarPlugin::diffCurrentFile()
{
const VCSBase::VCSBasePluginState state = currentState();
QTC_ASSERT(state.hasFile(), return)
m_client->diff(state.currentFileTopLevel(), QStringList(state.relativeCurrentFile()));
QTC_ASSERT(state.hasFile(), return);
m_client->diff(state.currentFileTopLevel(), QStringList(state.relativeCurrentFile()));
}
void BazaarPlugin::logCurrentFile()
{
const VCSBase::VCSBasePluginState state = currentState();
QTC_ASSERT(state.hasFile(), return)
m_client->log(state.currentFileTopLevel(), QStringList(state.relativeCurrentFile()), true);
QTC_ASSERT(state.hasFile(), return);
m_client->log(state.currentFileTopLevel(), QStringList(state.relativeCurrentFile()), true);
}
void BazaarPlugin::revertCurrentFile()
......@@ -333,8 +333,8 @@ void BazaarPlugin::revertCurrentFile()
void BazaarPlugin::statusCurrentFile()
{
const VCSBase::VCSBasePluginState state = currentState();
QTC_ASSERT(state.hasFile(), return)
m_client->status(state.currentFileTopLevel(), state.relativeCurrentFile());
QTC_ASSERT(state.hasFile(), return);
m_client->status(state.currentFileTopLevel(), state.relativeCurrentFile());
}
void BazaarPlugin::createDirectoryActions(const Core::Context &context)
......@@ -375,15 +375,15 @@ void BazaarPlugin::createDirectoryActions(const Core::Context &context)
void BazaarPlugin::diffRepository()
{
const VCSBase::VCSBasePluginState state = currentState();
QTC_ASSERT(state.hasTopLevel(), return)
m_client->diff(state.topLevel());
QTC_ASSERT(state.hasTopLevel(), return);
m_client->diff(state.topLevel());
}
void BazaarPlugin::logRepository()
{
const VCSBase::VCSBasePluginState state = currentState();
QTC_ASSERT(state.hasTopLevel(), return)
m_client->log(state.topLevel());
QTC_ASSERT(state.hasTopLevel(), return);
m_client->log(state.topLevel());
}
void BazaarPlugin::revertAll()
......
......@@ -60,11 +60,9 @@ QString CloneWizardPage::directoryFromRepository(const QString &repository) cons
QString repo = repository.trimmed();
if (repo.startsWith(QLatin1String("lp:")))
return repo.mid(3);
else {
const QChar slash = QLatin1Char('/');
if (repo.endsWith(slash))
repo.truncate(repo.size() - 1);
// Take the basename or the repository url
return repo.mid(repo.lastIndexOf(slash) + 1);
}
const QChar slash = QLatin1Char('/');
if (repo.endsWith(slash))
repo.truncate(repo.size() - 1);
// Take the basename or the repository url
return repo.mid(repo.lastIndexOf(slash) + 1);
}
......@@ -44,14 +44,11 @@ PullOrPushDialog::PullOrPushDialog(Mode mode, QWidget *parent) :
{
m_ui->setupUi(this);
m_ui->localPathChooser->setExpectedKind(Utils::PathChooser::Directory);
if (m_mode == PullMode)
{
if (m_mode == PullMode) {
this->setWindowTitle(tr("Pull source"));
m_ui->useExistingDirCheckBox->setVisible(false);
m_ui->createPrefixCheckBox->setVisible(false);
}
else
{
} else {
this->setWindowTitle(tr("Push destination"));
m_ui->localCheckBox->setVisible(false);
}
......@@ -67,18 +64,16 @@ QString PullOrPushDialog::branchLocation() const
{
if (m_ui->defaultButton->isChecked())
return QString();
else if (m_ui->localButton->isChecked())
if (m_ui->localButton->isChecked())
return m_ui->localPathChooser->path();
else
return m_ui->urlLineEdit->text();
return m_ui->urlLineEdit->text();
}
bool PullOrPushDialog::isRememberOptionEnabled() const
{
if (m_ui->defaultButton->isChecked())
return false;
else
return m_ui->rememberCheckBox->isChecked();
return m_ui->rememberCheckBox->isChecked();
}
bool PullOrPushDialog::isOverwriteOptionEnabled() const
......
......@@ -303,7 +303,7 @@ QString MercurialClient::findTopLevelForFile(const QFileInfo &file) const
QString MercurialClient::vcsEditorKind(VCSCommand cmd) const
{
switch(cmd)
switch (cmd)
{
case AnnotateCommand : return QLatin1String(Constants::ANNOTATELOG);
case DiffCommand : return QLatin1String(Constants::DIFFLOG);
......
......@@ -334,24 +334,24 @@ void VCSBaseClient::statusWithSignal(const QString &repositoryRoot)
QString VCSBaseClient::vcsCommandString(VCSCommand cmd) const
{
switch(cmd) {
case CreateRepositoryCommand : return QLatin1String("init");
case CloneCommand : return QLatin1String("clone");
case AddCommand : return QLatin1String("add");
case RemoveCommand : return QLatin1String("remove");
case MoveCommand : return QLatin1String("rename");
case PullCommand : return QLatin1String("pull");
case PushCommand : return QLatin1String("push");
case CommitCommand : return QLatin1String("commit");
case ImportCommand : return QLatin1String("import");
case UpdateCommand : return QLatin1String("update");
case RevertCommand : return QLatin1String("revert");
case AnnotateCommand : return QLatin1String("annotate");
case DiffCommand : return QLatin1String("diff");
case LogCommand : return QLatin1String("log");
case StatusCommand : return QLatin1String("status");
switch (cmd) {
case CreateRepositoryCommand: return QLatin1String("init");
case CloneCommand: return QLatin1String("clone");
case AddCommand: return QLatin1String("add");
case RemoveCommand: return QLatin1String("remove");
case MoveCommand: return QLatin1String("rename");
case PullCommand: return QLatin1String("pull");
case PushCommand: return QLatin1String("push");
case CommitCommand: return QLatin1String("commit");
case ImportCommand: return QLatin1String("import");
case UpdateCommand: return QLatin1String("update");
case RevertCommand: return QLatin1String("revert");
case AnnotateCommand: return QLatin1String("annotate");
case DiffCommand: return QLatin1String("diff");
case LogCommand: return QLatin1String("log");
case StatusCommand: return QLatin1String("status");
}
return QLatin1String("");
return QString();
}
void VCSBaseClient::statusParser(const QByteArray &data)
......
......@@ -119,7 +119,7 @@ void VCSBaseClientSettings::setTimeoutSeconds(int s)
m_timeoutSeconds = s;
}
void VCSBaseClientSettings::writeSettings(QSettings *settings, const QString& group) const
void VCSBaseClientSettings::writeSettings(QSettings *settings, const QString &group) const
{
settings->beginGroup(group);
settings->setValue(QLatin1String("VCS_Path"), m_binary);
......@@ -131,7 +131,7 @@ void VCSBaseClientSettings::writeSettings(QSettings *settings, const QString& gr
settings->endGroup();
}
void VCSBaseClientSettings::readSettings(const QSettings *settings, const QString& group)
void VCSBaseClientSettings::readSettings(const QSettings *settings, const QString &group)
{
const QString keyRoot = group + QLatin1Char('/');
m_binary = settings->value(keyRoot + QLatin1String("VCS_Path"), QString()).toString();
......
......@@ -71,8 +71,8 @@ public:
int timeoutSeconds() const;
void setTimeoutSeconds(int s);
virtual void writeSettings(QSettings *settings, const QString& group) const;
virtual void readSettings(const QSettings *settings, const QString& group);
virtual void writeSettings(QSettings *settings, const QString &group) const;
virtual void readSettings(const QSettings *settings, const QString &group);
virtual bool equals(const VCSBaseClientSettings &rhs) const;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment