remove new found flags when do a automatic scan and "clear before scan" was
[enigma2.git] / lib / components / file_eraser.cpp
index 6cacf04..eb9c82f 100644 (file)
@@ -1,4 +1,5 @@
 #include <lib/components/file_eraser.h>
 #include <lib/components/file_eraser.h>
+#include <lib/base/ioprio.h>
 #include <lib/base/eerror.h>
 #include <lib/base/init.h>
 #include <lib/base/init_num.h>
 #include <lib/base/eerror.h>
 #include <lib/base/init.h>
 #include <lib/base/init_num.h>
@@ -28,14 +29,21 @@ eBackgroundFileEraser::~eBackgroundFileEraser()
        messages.send(Message::quit);
        if (instance==this)
                instance=0;
        messages.send(Message::quit);
        if (instance==this)
                instance=0;
+       kill();  // i dont understand why this is needed .. in ~eThread::eThread is a kill() to..
 }
 
 void eBackgroundFileEraser::thread()
 {
        hasStarted();
 }
 
 void eBackgroundFileEraser::thread()
 {
        hasStarted();
+
        nice(5);
        nice(5);
+
+       setIoPrio(IOPRIO_CLASS_BE, 7);
+
        reset();
        reset();
+
        runLoop();
        runLoop();
+
        stop_thread_timer.stop();
 }
 
        stop_thread_timer.stop();
 }
 
@@ -68,7 +76,7 @@ void eBackgroundFileEraser::gotMessage(const Message &msg )
                                        eDebug("file %s erased", msg.filename);
                                free((char*)msg.filename);
                        }
                                        eDebug("file %s erased", msg.filename);
                                free((char*)msg.filename);
                        }
-                       stop_thread_timer.start(2000, true); // stop thread in two seconds
+                       stop_thread_timer.start(1000, true); // stop thread in one seconds
                        break;
                case Message::quit:
                        quit(0);
                        break;
                case Message::quit:
                        quit(0);