From 2a5cf1699833f5b58bf7a496a88de9704e953afd Mon Sep 17 00:00:00 2001 From: Martin Brodbeck Date: Mon, 30 Sep 2019 10:39:00 +0200 Subject: [PATCH] code beautifying --- src/gui/mainwindow.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp index 3cd9ccb..40969bb 100644 --- a/src/gui/mainwindow.cpp +++ b/src/gui/mainwindow.cpp @@ -11,8 +11,8 @@ #include -#include #include +#include #include #include @@ -47,7 +47,8 @@ MainWindow::MainWindow() ui_.salesView->header()->setSectionResizeMode(QHeaderView::ResizeToContents); setSaleModel(); - connect(ui_.actionQuit, &QAction::triggered, qApp, QApplication::closeAllWindows, Qt::QueuedConnection); + connect(ui_.actionQuit, &QAction::triggered, qApp, QApplication::closeAllWindows, + Qt::QueuedConnection); connect(ui_.newAction, &QAction::triggered, this, [=]() { if (marketplace_->getSellers().size() == 0 && marketplace_->getSales().size() == 0) { return; @@ -365,14 +366,15 @@ void MainWindow::onCancelSaleButtonClicked([[maybe_unused]] bool checked) } ui_.salesView->collapseAll(); - + QString lastPriceValue(formatCentAsEuroString(0).c_str()); if (ui_.salesView->model()->rowCount() > 0) { - lastPriceValue = ui_.salesView->model()->data(ui_.salesView->model()->index(0, 1)).toString(); + lastPriceValue = + ui_.salesView->model()->data(ui_.salesView->model()->index(0, 1)).toString(); } ui_.lastPriceLabel1->setText(lastPriceValue); ui_.lastPriceLabel2->setText(lastPriceValue); - + updateStatLabel(); } @@ -455,8 +457,9 @@ void MainWindow::onImportSellerExcelActionTriggered() QMessageBox::StandardButton::Ok, this) .exec(); - auto filename = QFileDialog::getOpenFileName(this, "Verkäufer importieren", QString(), - "Alle unterstützte Dateien (*.xlsx *.csv);;Excel Dateien (*.xlsx);;CSV Dateien (*.csv)"); + auto filename = QFileDialog::getOpenFileName( + this, "Verkäufer importieren", QString(), + "Alle unterstützte Dateien (*.xlsx *.csv);;Excel Dateien (*.xlsx);;CSV Dateien (*.csv)"); if (filename.isEmpty()) return; @@ -469,7 +472,7 @@ void MainWindow::onImportSellerExcelActionTriggered() } else { numImported = CsvReader::readSellersFromFile(filePath, marketplace_.get()); } - + updateStatLabel(); using namespace std::string_literals; @@ -595,4 +598,3 @@ void MainWindow::updateStatLabel() ui_.statLabel->setText(statistics.c_str()); } -