forked from qt-creator/qt-creator
Bazaar: Cleanups
Clean up whitespaces and coding style issues.
This commit is contained in:
@@ -113,12 +113,15 @@ QString BazaarClient::findTopLevelForFile(const QFileInfo &file) const
|
|||||||
QString BazaarClient::vcsEditorKind(VCSCommand cmd) const
|
QString BazaarClient::vcsEditorKind(VCSCommand cmd) const
|
||||||
{
|
{
|
||||||
switch(cmd) {
|
switch(cmd) {
|
||||||
case AnnotateCommand : return QLatin1String(Constants::ANNOTATELOG);
|
case AnnotateCommand:
|
||||||
case DiffCommand : return QLatin1String(Constants::DIFFLOG);
|
return QLatin1String(Constants::ANNOTATELOG);
|
||||||
case LogCommand : return QLatin1String(Constants::FILELOG);
|
case DiffCommand:
|
||||||
default : return QLatin1String("");
|
return QLatin1String(Constants::DIFFLOG);
|
||||||
|
case LogCommand:
|
||||||
|
return QLatin1String(Constants::FILELOG);
|
||||||
|
default:
|
||||||
|
return QString();
|
||||||
}
|
}
|
||||||
return QLatin1String("");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList BazaarClient::cloneArguments(const QString &srcLocation,
|
QStringList BazaarClient::cloneArguments(const QString &srcLocation,
|
||||||
|
@@ -290,28 +290,28 @@ void BazaarPlugin::createFileActions(const Core::Context &context)
|
|||||||
void BazaarPlugin::addCurrentFile()
|
void BazaarPlugin::addCurrentFile()
|
||||||
{
|
{
|
||||||
const VCSBase::VCSBasePluginState state = currentState();
|
const VCSBase::VCSBasePluginState state = currentState();
|
||||||
QTC_ASSERT(state.hasFile(), return)
|
QTC_ASSERT(state.hasFile(), return);
|
||||||
m_client->synchronousAdd(state.currentFileTopLevel(), state.relativeCurrentFile());
|
m_client->synchronousAdd(state.currentFileTopLevel(), state.relativeCurrentFile());
|
||||||
}
|
}
|
||||||
|
|
||||||
void BazaarPlugin::annotateCurrentFile()
|
void BazaarPlugin::annotateCurrentFile()
|
||||||
{
|
{
|
||||||
const VCSBase::VCSBasePluginState state = currentState();
|
const VCSBase::VCSBasePluginState state = currentState();
|
||||||
QTC_ASSERT(state.hasFile(), return)
|
QTC_ASSERT(state.hasFile(), return);
|
||||||
m_client->annotate(state.currentFileTopLevel(), state.relativeCurrentFile());
|
m_client->annotate(state.currentFileTopLevel(), state.relativeCurrentFile());
|
||||||
}
|
}
|
||||||
|
|
||||||
void BazaarPlugin::diffCurrentFile()
|
void BazaarPlugin::diffCurrentFile()
|
||||||
{
|
{
|
||||||
const VCSBase::VCSBasePluginState state = currentState();
|
const VCSBase::VCSBasePluginState state = currentState();
|
||||||
QTC_ASSERT(state.hasFile(), return)
|
QTC_ASSERT(state.hasFile(), return);
|
||||||
m_client->diff(state.currentFileTopLevel(), QStringList(state.relativeCurrentFile()));
|
m_client->diff(state.currentFileTopLevel(), QStringList(state.relativeCurrentFile()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void BazaarPlugin::logCurrentFile()
|
void BazaarPlugin::logCurrentFile()
|
||||||
{
|
{
|
||||||
const VCSBase::VCSBasePluginState state = currentState();
|
const VCSBase::VCSBasePluginState state = currentState();
|
||||||
QTC_ASSERT(state.hasFile(), return)
|
QTC_ASSERT(state.hasFile(), return);
|
||||||
m_client->log(state.currentFileTopLevel(), QStringList(state.relativeCurrentFile()), true);
|
m_client->log(state.currentFileTopLevel(), QStringList(state.relativeCurrentFile()), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -333,7 +333,7 @@ void BazaarPlugin::revertCurrentFile()
|
|||||||
void BazaarPlugin::statusCurrentFile()
|
void BazaarPlugin::statusCurrentFile()
|
||||||
{
|
{
|
||||||
const VCSBase::VCSBasePluginState state = currentState();
|
const VCSBase::VCSBasePluginState state = currentState();
|
||||||
QTC_ASSERT(state.hasFile(), return)
|
QTC_ASSERT(state.hasFile(), return);
|
||||||
m_client->status(state.currentFileTopLevel(), state.relativeCurrentFile());
|
m_client->status(state.currentFileTopLevel(), state.relativeCurrentFile());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -375,14 +375,14 @@ void BazaarPlugin::createDirectoryActions(const Core::Context &context)
|
|||||||
void BazaarPlugin::diffRepository()
|
void BazaarPlugin::diffRepository()
|
||||||
{
|
{
|
||||||
const VCSBase::VCSBasePluginState state = currentState();
|
const VCSBase::VCSBasePluginState state = currentState();
|
||||||
QTC_ASSERT(state.hasTopLevel(), return)
|
QTC_ASSERT(state.hasTopLevel(), return);
|
||||||
m_client->diff(state.topLevel());
|
m_client->diff(state.topLevel());
|
||||||
}
|
}
|
||||||
|
|
||||||
void BazaarPlugin::logRepository()
|
void BazaarPlugin::logRepository()
|
||||||
{
|
{
|
||||||
const VCSBase::VCSBasePluginState state = currentState();
|
const VCSBase::VCSBasePluginState state = currentState();
|
||||||
QTC_ASSERT(state.hasTopLevel(), return)
|
QTC_ASSERT(state.hasTopLevel(), return);
|
||||||
m_client->log(state.topLevel());
|
m_client->log(state.topLevel());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -60,11 +60,9 @@ QString CloneWizardPage::directoryFromRepository(const QString &repository) cons
|
|||||||
QString repo = repository.trimmed();
|
QString repo = repository.trimmed();
|
||||||
if (repo.startsWith(QLatin1String("lp:")))
|
if (repo.startsWith(QLatin1String("lp:")))
|
||||||
return repo.mid(3);
|
return repo.mid(3);
|
||||||
else {
|
|
||||||
const QChar slash = QLatin1Char('/');
|
const QChar slash = QLatin1Char('/');
|
||||||
if (repo.endsWith(slash))
|
if (repo.endsWith(slash))
|
||||||
repo.truncate(repo.size() - 1);
|
repo.truncate(repo.size() - 1);
|
||||||
// Take the basename or the repository url
|
// Take the basename or the repository url
|
||||||
return repo.mid(repo.lastIndexOf(slash) + 1);
|
return repo.mid(repo.lastIndexOf(slash) + 1);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@@ -44,14 +44,11 @@ PullOrPushDialog::PullOrPushDialog(Mode mode, QWidget *parent) :
|
|||||||
{
|
{
|
||||||
m_ui->setupUi(this);
|
m_ui->setupUi(this);
|
||||||
m_ui->localPathChooser->setExpectedKind(Utils::PathChooser::Directory);
|
m_ui->localPathChooser->setExpectedKind(Utils::PathChooser::Directory);
|
||||||
if (m_mode == PullMode)
|
if (m_mode == PullMode) {
|
||||||
{
|
|
||||||
this->setWindowTitle(tr("Pull source"));
|
this->setWindowTitle(tr("Pull source"));
|
||||||
m_ui->useExistingDirCheckBox->setVisible(false);
|
m_ui->useExistingDirCheckBox->setVisible(false);
|
||||||
m_ui->createPrefixCheckBox->setVisible(false);
|
m_ui->createPrefixCheckBox->setVisible(false);
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
this->setWindowTitle(tr("Push destination"));
|
this->setWindowTitle(tr("Push destination"));
|
||||||
m_ui->localCheckBox->setVisible(false);
|
m_ui->localCheckBox->setVisible(false);
|
||||||
}
|
}
|
||||||
@@ -67,9 +64,8 @@ QString PullOrPushDialog::branchLocation() const
|
|||||||
{
|
{
|
||||||
if (m_ui->defaultButton->isChecked())
|
if (m_ui->defaultButton->isChecked())
|
||||||
return QString();
|
return QString();
|
||||||
else if (m_ui->localButton->isChecked())
|
if (m_ui->localButton->isChecked())
|
||||||
return m_ui->localPathChooser->path();
|
return m_ui->localPathChooser->path();
|
||||||
else
|
|
||||||
return m_ui->urlLineEdit->text();
|
return m_ui->urlLineEdit->text();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -77,7 +73,6 @@ bool PullOrPushDialog::isRememberOptionEnabled() const
|
|||||||
{
|
{
|
||||||
if (m_ui->defaultButton->isChecked())
|
if (m_ui->defaultButton->isChecked())
|
||||||
return false;
|
return false;
|
||||||
else
|
|
||||||
return m_ui->rememberCheckBox->isChecked();
|
return m_ui->rememberCheckBox->isChecked();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -351,7 +351,7 @@ QString VCSBaseClient::vcsCommandString(VCSCommand cmd) const
|
|||||||
case LogCommand: return QLatin1String("log");
|
case LogCommand: return QLatin1String("log");
|
||||||
case StatusCommand: return QLatin1String("status");
|
case StatusCommand: return QLatin1String("status");
|
||||||
}
|
}
|
||||||
return QLatin1String("");
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
void VCSBaseClient::statusParser(const QByteArray &data)
|
void VCSBaseClient::statusParser(const QByteArray &data)
|
||||||
|
Reference in New Issue
Block a user