TODO changes
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
// TODO: refactor that shit with custom qt widget(line edit + combo box)
|
||||
|
||||
#include "outputdialog.h"
|
||||
#include "check/check.h"
|
||||
#include "output/output_options.h"
|
||||
@@ -24,7 +22,7 @@ bool compare_position(Column &c1, Column &c2) {
|
||||
void OutputDialog::on_buttonBox_accepted() {
|
||||
std::ofstream output_file(this->options.get_path());
|
||||
|
||||
for (int i = 0; i < ui->tableWidget->rowCount(); i ++) {
|
||||
for (int i = 0; i < ui->tableWidget->rowCount(); i++) {
|
||||
int position = ui->tableWidget->item(i, 0)->text().toInt();
|
||||
std::string name = ui->tableWidget->item(i, 1)->text().toStdString();
|
||||
|
||||
@@ -40,7 +38,7 @@ void OutputDialog::on_buttonBox_accepted() {
|
||||
this->options.get_columns().end(), compare_position);
|
||||
|
||||
if (options.get_print_header()) {
|
||||
for (auto& column : this->options.get_columns()) {
|
||||
for (auto &column : this->options.get_columns()) {
|
||||
output_file << column.name
|
||||
<< (column.position == this->options.get_columns().size()
|
||||
? ""
|
||||
@@ -50,7 +48,7 @@ void OutputDialog::on_buttonBox_accepted() {
|
||||
}
|
||||
|
||||
for (auto goods : this->check.get_goods()) {
|
||||
for (auto& column : this->options.get_columns()) {
|
||||
for (auto &column : this->options.get_columns()) {
|
||||
std::string output_str;
|
||||
|
||||
switch (column.type) {
|
||||
@@ -116,4 +114,3 @@ void OutputDialog::on_printHeaderCheckBox_stateChanged(int value) {
|
||||
void OutputDialog::on_printTotalCheckBox_stateChanged(int value) {
|
||||
this->options.set_print_total(value);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user