summaryrefslogtreecommitdiff
path: root/LogThread.h
diff options
context:
space:
mode:
authorThomas Preud'homme <robotux@celest.fr>2017-11-24 23:24:09 +0000
committerThomas Preud'homme <robotux@celest.fr>2017-11-24 23:24:09 +0000
commitb3c8bdcc0d1e4b2ab298847a7902b6d60410a5bc (patch)
tree8fce8a51adfb245db8ab2a76831661780c0c713e /LogThread.h
parente297dbd8052ef4e66f069e2dd1865ae7fa8af28e (diff)
New upstream version 1.2.3.6
Diffstat (limited to 'LogThread.h')
-rw-r--r--LogThread.h104
1 files changed, 67 insertions, 37 deletions
diff --git a/LogThread.h b/LogThread.h
index 2366e3e..4b132dd 100644
--- a/LogThread.h
+++ b/LogThread.h
@@ -1,8 +1,6 @@
/** \file LogThread.h
\brief The thread to do the log but not block the main thread
\author alpha_one_x86
-\version 0.3
-\date 2010
\licence GPL3, see the file COPYING */
#ifndef LOGTHREAD_H
@@ -12,8 +10,8 @@
#include <QString>
#include <QDateTime>
#include <QVariant>
+#include <QFile>
-#include "GlobalClass.h"
#include "Environment.h"
#include "StructEnumDefinition.h"
@@ -21,48 +19,80 @@
It use thread based storage to prevent gui thread freeze on log file writing when is out of the disk buffer. That's allow to async the event.
*/
-class LogThread : public QThread, public GlobalClass
+class LogThread : public QThread
{
Q_OBJECT
public:
- explicit LogThread();
- ~LogThread();
+ explicit LogThread();
+ ~LogThread();
+ bool logTransfer() const;
public slots:
- /** method called when new transfer is started */
- void newTransferStart(const ItemOfCopyList &item);
- /** method called when transfer is stopped */
- void newTransferStop(const quint64 &id);
- /** method called when new error is occurred */
- void error(const QString &path,const quint64 &size,const QDateTime &mtime,const QString &error);
- /** method called when the log file need be created */
- void openLogs();
- /** method called when the log file need be closed */
- void closeLogs();
- /** method called when one folder is removed */
- void rmPath(const QString &path);
- /** method called when one folder is created */
- void mkPath(const QString &path);
+ /** method called when new transfer is started */
+ void newTransferStart(const Ultracopier::ItemOfCopyList &item);
+ /** method called when transfer is stopped */
+ void newTransferStop(const Ultracopier::ItemOfCopyList &item);
+ /** method called when new transfer is started */
+ void transferSkip(const Ultracopier::ItemOfCopyList &item);
+ /** method called when new error is occurred */
+ void error(const QString &path,const quint64 &size,const QDateTime &mtime,const QString &error);
+ /** method called when the log file need be created */
+ void openLogs();
+ /** method called when the log file need be closed */
+ void closeLogs();
+ /** method called when one folder is removed */
+ void rmPath(const QString &path);
+ /** method called when one folder is created */
+ void mkPath(const QString &path);
private slots:
- /** \to write the data into the file */
- void realDataWrite(const QString &text);
- /** \to update the options value */
- void newOptionValue(const QString &group,const QString &name,const QVariant &value);
+ /** \to write the data into the file */
+ void realDataWrite(const QString &text);
+ /** \to update the options value */
+ void newOptionValue(const QString &group,const QString &name,const QVariant &value);
signals:
- void newData(const QString &text);
+ void newData(const QString &text) const;
private:
- QString data;
- QString transfer_format;
- QString error_format;
- QString folder_format;
- QFile log;
- QString replaceBaseVar(QString text);
- bool sync;
- bool enabled;
- bool log_enable_transfer;
- bool log_enable_error;
- bool log_enable_folder;
+ QString data;
+ QString transfer_format;
+ QString error_format;
+ QString folder_format;
+ QFile log;
+ QString lineReturn;
+ QString replaceBaseVar(QString text);
+ #ifdef Q_OS_WIN32
+ QString computer;
+ QString user;
+ #endif
+ bool sync;
+ bool enabled;
+ bool log_enable_transfer;
+ bool log_enable_error;
+ bool log_enable_folder;
+
+ static QString text_header_copy;
+ static QString text_header_move;
+ static QString text_header_skip;
+ static QString text_header_stop;
+ static QString text_header_error;
+ static QString text_header_MkPath;
+ static QString text_header_RmPath;
+
+ static QString text_var_source;
+ static QString text_var_size;
+ static QString text_var_destination;
+ static QString text_var_path;
+ static QString text_var_error;
+ static QString text_var_mtime;
+ static QString text_var_time;
+ static QString text_var_timestring;
+ #ifdef Q_OS_WIN32
+ static QString text_var_computer;
+ static QString text_var_user;
+ #endif
+ static QString text_var_operation;
+ static QString text_var_rmPath;
+ static QString text_var_mkPath;
protected:
- void run();
+ void run();
};
#endif // LOGTHREAD_H