From ea6292168a6acd4c263913f0ccd7dd64daf4f5cf Mon Sep 17 00:00:00 2001 From: Sandro Jäckel Date: Fri, 23 Feb 2018 01:45:58 +0100 Subject: Revert "Applied clang-format on source" This reverts commit 5e5c9c07291f6b09623d31c92b1fb61c4ede576e. --- src/aboutdialog.cpp | 95 ++++++++++++++++++++++++++++++----------------------- 1 file changed, 53 insertions(+), 42 deletions(-) (limited to 'src/aboutdialog.cpp') diff --git a/src/aboutdialog.cpp b/src/aboutdialog.cpp index e79109ad..ed57a217 100644 --- a/src/aboutdialog.cpp +++ b/src/aboutdialog.cpp @@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License along with Mod Organizer. If not, see . */ + #include "aboutdialog.h" #include "ui_aboutdialog.h" #include @@ -29,55 +30,65 @@ along with Mod Organizer. If not, see . #include #include -AboutDialog::AboutDialog(const QString& version, QWidget* parent) : QDialog(parent), ui(new Ui::AboutDialog) { - ui->setupUi(this); - - m_LicenseFiles[LICENSE_LGPL3] = "lgpl-3.0.txt"; - m_LicenseFiles[LICENSE_GPL3] = "gpl-3.0.txt"; - m_LicenseFiles[LICENSE_BSD3] = "bsd3.txt"; - m_LicenseFiles[LICENSE_BOOST] = "boost.txt"; - m_LicenseFiles[LICENSE_CCBY3] = "by-sa3.txt"; - m_LicenseFiles[LICENSE_ZLIB] = "zlib.txt"; - m_LicenseFiles[LICENSE_APACHE2] = "apache-license-2.0.txt"; - - addLicense("Qt", LICENSE_LGPL3); - addLicense("Qt Json", LICENSE_GPL3); - addLicense("Boost Library", LICENSE_BOOST); - addLicense("7-zip", LICENSE_LGPL3); - addLicense("ZLib", LICENSE_ZLIB); - addLicense("Tango Icon Theme", LICENSE_NONE); - addLicense("RRZE Icon Set", LICENSE_CCBY3); - addLicense("Icons by Lorc, Delapouite and sbed available on http://game-icons.net", LICENSE_CCBY3); - addLicense("Castle Core", LICENSE_APACHE2); - addLicense("LOOT", LICENSE_GPL3); - - ui->nameLabel->setText(QString("%1 %2") - .arg(ui->nameLabel->text()) - .arg(version)); + +AboutDialog::AboutDialog(const QString &version, QWidget *parent) + : QDialog(parent) + , ui(new Ui::AboutDialog) +{ + ui->setupUi(this); + + m_LicenseFiles[LICENSE_LGPL3] = "lgpl-3.0.txt"; + m_LicenseFiles[LICENSE_GPL3] = "gpl-3.0.txt"; + m_LicenseFiles[LICENSE_BSD3] = "bsd3.txt"; + m_LicenseFiles[LICENSE_BOOST] = "boost.txt"; + m_LicenseFiles[LICENSE_CCBY3] = "by-sa3.txt"; + m_LicenseFiles[LICENSE_ZLIB] = "zlib.txt"; + m_LicenseFiles[LICENSE_APACHE2] = "apache-license-2.0.txt"; + + addLicense("Qt", LICENSE_LGPL3); + addLicense("Qt Json", LICENSE_GPL3); + addLicense("Boost Library", LICENSE_BOOST); + addLicense("7-zip", LICENSE_LGPL3); + addLicense("ZLib", LICENSE_ZLIB); + addLicense("Tango Icon Theme", LICENSE_NONE); + addLicense("RRZE Icon Set", LICENSE_CCBY3); + addLicense("Icons by Lorc, Delapouite and sbed available on http://game-icons.net", LICENSE_CCBY3); + addLicense("Castle Core", LICENSE_APACHE2); + addLicense("LOOT", LICENSE_GPL3); + + ui->nameLabel->setText(QString("%1 %2").arg(ui->nameLabel->text()).arg(version)); #if defined(HGID) - ui->revisionLabel->setText(ui->revisionLabel->text() + " " + HGID); + ui->revisionLabel->setText(ui->revisionLabel->text() + " " + HGID); #elif defined(GITID) - ui->revisionLabel->setText(ui->revisionLabel->text() + " " + GITID); + ui->revisionLabel->setText(ui->revisionLabel->text() + " " + GITID); #else - ui->revisionLabel->setText(ui->revisionLabel->text() + " unknown"); + ui->revisionLabel->setText(ui->revisionLabel->text() + " unknown"); #endif } -AboutDialog::~AboutDialog() { delete ui; } -void AboutDialog::addLicense(const QString& name, Licenses license) { - QListWidgetItem* item = new QListWidgetItem(name); - item->setData(Qt::UserRole, license); - ui->creditsList->addItem(item); +AboutDialog::~AboutDialog() +{ + delete ui; } -void AboutDialog::on_creditsList_currentItemChanged(QListWidgetItem* current, QListWidgetItem*) { - auto iter = m_LicenseFiles.find(current->data(Qt::UserRole).toInt()); - if (iter != m_LicenseFiles.end()) { - QString filePath = qApp->applicationDirPath() + "/license/" + iter->second; - QString text = MOBase::readFileText(filePath); - ui->licenseText->setText(text); - } else { - ui->licenseText->setText(tr("No license")); - } + +void AboutDialog::addLicense(const QString &name, Licenses license) +{ + QListWidgetItem *item = new QListWidgetItem(name); + item->setData(Qt::UserRole, license); + ui->creditsList->addItem(item); +} + + +void AboutDialog::on_creditsList_currentItemChanged(QListWidgetItem *current, QListWidgetItem*) +{ + auto iter = m_LicenseFiles.find(current->data(Qt::UserRole).toInt()); + if (iter != m_LicenseFiles.end()) { + QString filePath = qApp->applicationDirPath() + "/license/" + iter->second; + QString text = MOBase::readFileText(filePath); + ui->licenseText->setText(text); + } else { + ui->licenseText->setText(tr("No license")); + } } -- cgit v1.3.1