YourDefrag
SVN
|
Defragmenter GUI application class. More...
#include <YDGuiApplication.h>
Public Slots | |
void | threadFinished (QThread *thread) |
Defragmenter thread finish slot function. | |
void | cleanup () |
Defragmenter cleanup slot function. | |
Public Member Functions | |
YDGuiApplication (int &argc, char **argv) | |
Application class constructor. | |
~YDGuiApplication () | |
Application class destructor. | |
void | startDefrag () |
Start defragmantation. | |
int | wait () |
Wait for the end. | |
Private Member Functions | |
virtual void | showUsage () |
Show usage message. | |
void | parseArguments () |
Parse arguments. | |
void | addAllDisks () |
Add all disks. | |
Static Private Member Functions | |
static void | handleSignal (int sigNum) |
Defragmenter signal handler. | |
Private Attributes | |
YDWorkThreadList | m_threadList |
List of worker threads. | |
QWaitCondition | m_end |
End-of-work wait condition. | |
QMutex | m_mutex |
Protective mutex. | |
QStringList | m_args |
List of command line arguments. | |
QStringList | m_tasks |
List of disks to defragment. | |
QStringList | m_excludes |
List of excludes to be used for all defragmented disks. | |
QStringList | m_spaceHogs |
List of space hogs to be used for all defragmented disks. | |
int | m_verbose |
Application verbosity level. | |
int | m_mode |
Application defragment mode. | |
int | m_speed |
Application speed in percents. | |
int | m_freeSpace |
Application free space in percents. | |
int | m_write |
Write config flag. | |
int | m_ignore |
Ignore config flag. | |
QFile * | m_logFile |
Logging file. | |
QTextStream * | m_logStream |
Logging text stream. |
Defragmenter GUI application class.
This class handles basic behavior of defragmenter application.
YDGuiApplication::YDGuiApplication | ( | int & | argc, |
char ** | argv | ||
) |
Application class constructor.
This function prepares application connections and starts defragmenter threads for each of command line arguments. ODD IMPLEMENTATION!!!
[in] | argc | Count of command line arguments. |
[in] | argv | List of command line arguments. |
YDGuiApplication::~YDGuiApplication | ( | ) |
Application class destructor.
This function makes cleanup and deinitializes connections.
void YDGuiApplication::addAllDisks | ( | ) | [private] |
Add all disks.
This function finds all disks in the system and adds them to the task list.
void YDGuiApplication::cleanup | ( | ) | [slot] |
Defragmenter cleanup slot function.
This function is called to perform an application cleanup. This function tries to stop all remaining defragmenter threads.
void YDGuiApplication::handleSignal | ( | int | sigNum | ) | [static, private] |
Defragmenter signal handler.
This function is called when application receives one of unix signals registered by application. This function triggers application cleanup.
[in] | sigNum | Signal number. |
void YDGuiApplication::parseArguments | ( | ) | [private] |
Parse arguments.
This function parses command line arguments.
void YDGuiApplication::showUsage | ( | ) | [private, virtual] |
Show usage message.
This function prints usage information to console.
void YDGuiApplication::startDefrag | ( | ) |
Start defragmantation.
This function starts all defragmenter threads.
void YDGuiApplication::threadFinished | ( | QThread * | thread | ) | [slot] |
Defragmenter thread finish slot function.
This function is called by meta-object code in case when one of defragmenter threads has finish it's task.
[in] | thread | Pointer to finished thread object. |
int YDGuiApplication::wait | ( | ) |
Wait for the end.
This function blocks execution of caller thread till the moment when all defragmenter threads will end. It's intended to call this function from main().
QStringList YDGuiApplication::m_args [private] |
List of command line arguments.
QWaitCondition YDGuiApplication::m_end [private] |
End-of-work wait condition.
QStringList YDGuiApplication::m_excludes [private] |
List of excludes to be used for all defragmented disks.
int YDGuiApplication::m_freeSpace [private] |
Application free space in percents.
int YDGuiApplication::m_ignore [private] |
Ignore config flag.
QFile * YDGuiApplication::m_logFile [private] |
Logging file.
QTextStream * YDGuiApplication::m_logStream [private] |
Logging text stream.
int YDGuiApplication::m_mode [private] |
Application defragment mode.
QMutex YDGuiApplication::m_mutex [private] |
Protective mutex.
QStringList YDGuiApplication::m_spaceHogs [private] |
List of space hogs to be used for all defragmented disks.
int YDGuiApplication::m_speed [private] |
Application speed in percents.
QStringList YDGuiApplication::m_tasks [private] |
List of disks to defragment.
List of worker threads.
int YDGuiApplication::m_verbose [private] |
Application verbosity level.
int YDGuiApplication::m_write [private] |
Write config flag.