Astyle formatting.

This commit is contained in:
Vesa Pikki 2009-05-24 11:55:54 +03:00
parent de0dd0a2bb
commit 9bb0cff511
4 changed files with 24 additions and 18 deletions

View File

@ -109,12 +109,15 @@ QString ApplicationDialog::GetPath()
void ApplicationDialog::Ok()
{
if (mName->text().isEmpty() || mPath->text().isEmpty()) {
if (mName->text().isEmpty() || mPath->text().isEmpty())
{
QMessageBox msgBox;
msgBox.setText("You must specify a name and a path for the application!");
msgBox.exec();
} else {
accept();
}
else
{
accept();
}
}

View File

@ -100,7 +100,8 @@ void ApplicationList::SetApplicationType(const int index,
void ApplicationList::AddApplicationType(const QString &name, const QString &path)
{
if (name.isEmpty() || path.isEmpty()) {
if (name.isEmpty() || path.isEmpty())
{
return;
}

View File

@ -197,7 +197,8 @@ Settings MainWindow::GetCppcheckSettings()
result._security = true;
result._jobs = mSettings.value(tr("Check threads"), 1).toInt();
if (result._jobs <= 0) {
if (result._jobs <= 0)
{
result._jobs = 1;
}
@ -335,17 +336,17 @@ void MainWindow::About()
//TODO make a "GetVersionNumber" function to core cppcheck
CppCheckExecutor exec;
CppCheck check(exec);
const char *argv[] = {"","--version"};
const char *argv[] = {"", "--version"};
QString version = check.parseFromArgs(2, argv).c_str();
version.replace("Cppcheck ","");
version.replace("Cppcheck ", "");
QMessageBox msgBox;
msgBox.setWindowTitle(tr("About..."));
msgBox.setText(QString("Cppcheck - A tool for static C/C++ code analysis.\nVersion %1\n\n" \
"This program is licensed under the terms\n" \
"of the GNU General Public License version 3\n" \
"Available online under:\n" \
"http://www.gnu.org/licenses/gpl-3.0.html\n\nSee AUTHORS file for the list of developers." \
).arg(version));
msgBox.exec();
QMessageBox msgBox;
msgBox.setWindowTitle(tr("About..."));
msgBox.setText(QString("Cppcheck - A tool for static C/C++ code analysis.\nVersion %1\n\n" \
"This program is licensed under the terms\n" \
"of the GNU General Public License version 3\n" \
"Available online under:\n" \
"http://www.gnu.org/licenses/gpl-3.0.html\n\nSee AUTHORS file for the list of developers." \
).arg(version));
msgBox.exec();
}

View File

@ -68,7 +68,7 @@ SettingsDialog::SettingsDialog(QSettings &programSettings, ApplicationList &list
//Number of jobs
QHBoxLayout *jobsLayout = new QHBoxLayout();
mJobs = new QLineEdit(programSettings.value(tr("Check threads"), 1).toString());
mJobs->setValidator(new QIntValidator(1,9999,this));
mJobs->setValidator(new QIntValidator(1, 9999, this));
jobsLayout->addWidget(new QLabel(tr("Number of threads: ")));
jobsLayout->addWidget(mJobs);
@ -174,7 +174,8 @@ void SettingsDialog::SaveSettings()
void SettingsDialog::SaveCheckboxValues()
{
int jobs = mJobs->text().toInt();
if (jobs <= 0) {
if (jobs <= 0)
{
jobs = 1;
}