summaryrefslogtreecommitdiff
path: root/src/previewdialog.cpp
diff options
context:
space:
mode:
authorSandro Jäckel <sandro.jaeckel@gmail.com>2018-02-23 01:45:58 +0100
committerSandro Jäckel <sandro.jaeckel@gmail.com>2018-02-23 01:45:58 +0100
commitea6292168a6acd4c263913f0ccd7dd64daf4f5cf (patch)
tree312024abbd7c3c100274f3a8031d49096480b654 /src/previewdialog.cpp
parent5e5c9c07291f6b09623d31c92b1fb61c4ede576e (diff)
Revert "Applied clang-format on source"
This reverts commit 5e5c9c07291f6b09623d31c92b1fb61c4ede576e.
Diffstat (limited to 'src/previewdialog.cpp')
-rw-r--r--src/previewdialog.cpp66
1 files changed, 41 insertions, 25 deletions
diff --git a/src/previewdialog.cpp b/src/previewdialog.cpp
index 4a50ace3..de33cdd0 100644
--- a/src/previewdialog.cpp
+++ b/src/previewdialog.cpp
@@ -2,40 +2,56 @@
#include "ui_previewdialog.h"
#include <QFileInfo>
-PreviewDialog::PreviewDialog(const QString& fileName, QWidget* parent) : QDialog(parent), ui(new Ui::PreviewDialog) {
- ui->setupUi(this);
- ui->nameLabel->setText(QFileInfo(fileName).fileName());
- ui->nextButton->setEnabled(false);
- ui->previousButton->setEnabled(false);
+PreviewDialog::PreviewDialog(const QString &fileName, QWidget *parent) :
+ QDialog(parent),
+ ui(new Ui::PreviewDialog)
+{
+ ui->setupUi(this);
+ ui->nameLabel->setText(QFileInfo(fileName).fileName());
+ ui->nextButton->setEnabled(false);
+ ui->previousButton->setEnabled(false);
}
-PreviewDialog::~PreviewDialog() { delete ui; }
+PreviewDialog::~PreviewDialog()
+{
+ delete ui;
+}
-void PreviewDialog::addVariant(const QString& modName, QWidget* widget) {
- widget->setProperty("modName", modName);
- ui->variantsStack->addWidget(widget);
- if (ui->variantsStack->count() > 1) {
- ui->nextButton->setEnabled(true);
- ui->previousButton->setEnabled(true);
- }
+void PreviewDialog::addVariant(const QString &modName, QWidget *widget)
+{
+ widget->setProperty("modName", modName);
+ ui->variantsStack->addWidget(widget);
+ if (ui->variantsStack->count() > 1) {
+ ui->nextButton->setEnabled(true);
+ ui->previousButton->setEnabled(true);
+ }
}
-int PreviewDialog::numVariants() const { return ui->variantsStack->count(); }
+int PreviewDialog::numVariants() const
+{
+ return ui->variantsStack->count();
+}
-void PreviewDialog::on_variantsStack_currentChanged(int index) {
- ui->modLabel->setText(ui->variantsStack->widget(index)->property("modName").toString());
+void PreviewDialog::on_variantsStack_currentChanged(int index)
+{
+ ui->modLabel->setText(ui->variantsStack->widget(index)->property("modName").toString());
}
-void PreviewDialog::on_closeButton_clicked() { this->accept(); }
+void PreviewDialog::on_closeButton_clicked()
+{
+ this->accept();
+}
-void PreviewDialog::on_previousButton_clicked() {
- int i = ui->variantsStack->currentIndex() - 1;
- if (i < 0) {
- i = ui->variantsStack->count() - 1;
- }
- ui->variantsStack->setCurrentIndex(i);
+void PreviewDialog::on_previousButton_clicked()
+{
+ int i = ui->variantsStack->currentIndex() - 1;
+ if (i < 0) {
+ i = ui->variantsStack->count() - 1;
+ }
+ ui->variantsStack->setCurrentIndex(i);
}
-void PreviewDialog::on_nextButton_clicked() {
- ui->variantsStack->setCurrentIndex((ui->variantsStack->currentIndex() + 1) % ui->variantsStack->count());
+void PreviewDialog::on_nextButton_clicked()
+{
+ ui->variantsStack->setCurrentIndex((ui->variantsStack->currentIndex() + 1) % ui->variantsStack->count());
}