triage: small tweaks

This commit is contained in:
Daniel Marjamäki 2018-01-01 10:52:51 +01:00
parent 4c490b599b
commit 3b6fbd067e
3 changed files with 20 additions and 23 deletions

View File

@ -12,12 +12,11 @@ class QWidget;
class LineNumberArea;
class CodeEditor : public QPlainTextEdit
{
class CodeEditor : public QPlainTextEdit {
Q_OBJECT
public:
CodeEditor(QWidget *parent = 0);
explicit CodeEditor(QWidget *parent = 0);
void lineNumberAreaPaintEvent(QPaintEvent *event);
int lineNumberAreaWidth();
@ -35,10 +34,9 @@ private:
};
class LineNumberArea : public QWidget
{
class LineNumberArea : public QWidget {
public:
LineNumberArea(CodeEditor *editor) : QWidget(editor) {
explicit LineNumberArea(CodeEditor *editor) : QWidget(editor) {
codeEditor = editor;
}

View File

@ -55,12 +55,11 @@ void MainWindow::showResult(QListWidgetItem *item)
QProcess process;
process.setWorkingDirectory(WORK_FOLDER);
// Download archive
if (!QFileInfo(WORK_FOLDER + '/' + archiveName).exists()) {
// Download archive
process.start("wget", QStringList()<<url);
if (!process.waitForFinished(-1))
return;
}
// Unpack archive
QStringList args;
@ -74,6 +73,7 @@ void MainWindow::showResult(QListWidgetItem *item)
process.start("tar", args);
if (!process.waitForFinished(-1))
return;
}
// Open file
ui->code->setFocus();

View File

@ -5,11 +5,10 @@
#include <QListWidgetItem>
namespace Ui {
class MainWindow;
class MainWindow;
}
class MainWindow : public QMainWindow
{
class MainWindow : public QMainWindow {
Q_OBJECT
public: