From 3f0d2a135f84c2b357e9a157da3713ce099f1857 Mon Sep 17 00:00:00 2001 From: NeoTheFox Date: Sat, 14 Mar 2015 01:11:54 +0300 Subject: [PATCH] Monor structure tweaks --- mainwindow.cpp | 6 +++--- sender.cpp | 2 +- sender.h | 3 +-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index 95a5d08..d8bf4ee 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -531,7 +531,7 @@ void MainWindow::printMsg(const char* text) cursor.insertText(text); ui->terminal->setTextCursor(cursor); -; + } void MainWindow::printMsg(QString text) @@ -835,9 +835,9 @@ void MainWindow::updateFileProgress(FileProgress p) ui->pauseBtn->setEnabled(true); sending = true; } - ui->filelines->setText(QString::number(p.P) + ui->filelines->setText(QString::number(p.T) + QString("/") - + QString::number(p.T) + + QString::number(p.P) + QString(" Lines")); ui->progressBar->setValue(((float)p.P/p.T) * 100); } diff --git a/sender.cpp b/sender.cpp index 0b9ff4e..adf2c15 100644 --- a/sender.cpp +++ b/sender.cpp @@ -156,7 +156,7 @@ void Sender::setFile(QVector f) void Sender::injectCommand(QString command) { - userCommands.enqueue(command); + if(userCommands.contains(command)) userCommands.enqueue(command); } void Sender::recievedOkWait() diff --git a/sender.h b/sender.h index 9a1b5b6..8782ff3 100644 --- a/sender.h +++ b/sender.h @@ -20,9 +20,8 @@ public: explicit Sender(QObject *parent = 0); ~Sender(); - QSerialPort *printer; - protected: + QSerialPort *printer; int currentLine; int totalLineNum; int baudrate;