From 0b8632f7bfe197b74d47e1b6aeed6698ced125be Mon Sep 17 00:00:00 2001
From: Romain DERRE <romain.derre@pc228-14.pedago.ensiie.fr>
Date: Fri, 29 Mar 2019 19:04:33 +0100
Subject: [PATCH] quelques modifs

---
 app/app.pro              |  2 --
 app/elements.cpp         | 32 --------------------------------
 app/elements.h           | 23 -----------------------
 app/elementstablemodel.h |  2 --
 app/mainwindow.ui        |  3 +++
 app/task.cpp             |  4 ----
 app/task.h               |  1 -
 7 files changed, 3 insertions(+), 64 deletions(-)
 delete mode 100644 app/elements.cpp
 delete mode 100644 app/elements.h

diff --git a/app/app.pro b/app/app.pro
index a2e48f2..f878542 100644
--- a/app/app.pro
+++ b/app/app.pro
@@ -27,7 +27,6 @@ SOURCES += \
         main.cpp \
         mainwindow.cpp \
     element.cpp \
-    elements.cpp \
     updatable.cpp \
     task.cpp \
     controller.cpp \
@@ -39,7 +38,6 @@ SOURCES += \
 HEADERS += \
         mainwindow.h \
     element.h \
-    elements.h \
     updatable.h \
     task.h \
     controller.h \
diff --git a/app/elements.cpp b/app/elements.cpp
deleted file mode 100644
index 23ce03f..0000000
--- a/app/elements.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-#include "elements.h"
-
-Elements::Elements() : proc("/proc/"), task_list(".listT")
-{
-
-}
-
-QStandardItemModel & Elements::getModel()
-
-{
-    return model;
-}
-
-void Elements::update()
-{
-    system("ls /proc | grep '[0-9]' > .listT");
-    if(!task_list.open(QIODevice::ReadOnly)) {
-        QMessageBox::information(0, "error", task_list.errorString());
-    }
-    QTextStream in(&task_list);
-
-    while(!in.atEnd()) {
-        int pid = in.readLine().toInt();
-
-
-        //model->appendRow(line);
-    }
-
-
-    task_list.close();
-}
-
diff --git a/app/elements.h b/app/elements.h
deleted file mode 100644
index 234b0c2..0000000
--- a/app/elements.h
+++ /dev/null
@@ -1,23 +0,0 @@
-#ifndef ELEMENTS_H
-#define ELEMENTS_H
-
-#include <QStandardItemModel>
-
-#include "updatable.h"
-#include "element.h"
-
-class Elements : public Updatable
-{
-public:
-    Elements();
-    void update();
-    QStandardItemModel & getModel();
-    void addProcess();
-private:
-    QStandardItemModel model;
-    QStandardItem *parent0 = model.invisibleRootItem();
-    QFile proc;
-    QFile task_list;
-};
-
-#endif // ELEMENTS_H
diff --git a/app/elementstablemodel.h b/app/elementstablemodel.h
index cb399e2..14d5e73 100644
--- a/app/elementstablemodel.h
+++ b/app/elementstablemodel.h
@@ -54,8 +54,6 @@ private:
     QVector<Task*> taskVector;
     QFile task_list;
 
-    QMutex mutex;
-
 };
 
 #endif // ELEMENTSTABLEMODEL_H
diff --git a/app/mainwindow.ui b/app/mainwindow.ui
index 18e2448..907477d 100644
--- a/app/mainwindow.ui
+++ b/app/mainwindow.ui
@@ -226,6 +226,9 @@
             </item>
             <item>
              <widget class="QComboBox" name="comboBox">
+              <property name="currentText">
+               <string>Interrupt</string>
+              </property>
               <item>
                <property name="text">
                 <string>Interrupt</string>
diff --git a/app/task.cpp b/app/task.cpp
index 23637cd..ec532f2 100644
--- a/app/task.cpp
+++ b/app/task.cpp
@@ -126,10 +126,6 @@ void Task::update()
     //qDebug() << print();
 }
 
-void Task::sendSignal(int sig)
-{
-    kill(PID, sig);
-}
 
 int Task::getPID() const
 {
diff --git a/app/task.h b/app/task.h
index c5f187b..79685fe 100644
--- a/app/task.h
+++ b/app/task.h
@@ -18,7 +18,6 @@ public:
     void setExist(bool);
 
     void update();
-    void sendSignal(int sig);
 
     int getPID() const;
     double getCPU() const;
-- 
GitLab