triage: small tweaks
This commit is contained in:
parent
4c490b599b
commit
3b6fbd067e
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -55,25 +55,25 @@ 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;
|
||||
if (url.endsWith(".tar.gz"))
|
||||
args << "xzvf";
|
||||
else if (url.endsWith(".tar.bz2"))
|
||||
args << "xjvf";
|
||||
else if (url.endsWith(".tar.xz"))
|
||||
args << "xJvf";
|
||||
args << archiveName;
|
||||
process.start("tar", args);
|
||||
if (!process.waitForFinished(-1))
|
||||
return;
|
||||
// Unpack archive
|
||||
QStringList args;
|
||||
if (url.endsWith(".tar.gz"))
|
||||
args << "xzvf";
|
||||
else if (url.endsWith(".tar.bz2"))
|
||||
args << "xjvf";
|
||||
else if (url.endsWith(".tar.xz"))
|
||||
args << "xJvf";
|
||||
args << archiveName;
|
||||
process.start("tar", args);
|
||||
if (!process.waitForFinished(-1))
|
||||
return;
|
||||
}
|
||||
|
||||
// Open file
|
||||
ui->code->setFocus();
|
||||
|
|
|
@ -5,11 +5,10 @@
|
|||
#include <QListWidgetItem>
|
||||
|
||||
namespace Ui {
|
||||
class MainWindow;
|
||||
class MainWindow;
|
||||
}
|
||||
|
||||
class MainWindow : public QMainWindow
|
||||
{
|
||||
class MainWindow : public QMainWindow {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
|
|
Loading…
Reference in New Issue