path: root/DebugEngine.h
diff options
authorThomas Preud'homme <>2018-02-23 23:49:48 +0000
committerThomas Preud'homme <>2018-02-23 23:49:48 +0000
commitbd56579c7d9de94c17287adefa118290e6b7ba33 (patch)
tree666d7d0b6945b442573b7a3145969f66a53aa460 /DebugEngine.h
parentb3c8bdcc0d1e4b2ab298847a7902b6d60410a5bc (diff)
New upstream version
Diffstat (limited to 'DebugEngine.h')
1 files changed, 18 insertions, 16 deletions
diff --git a/DebugEngine.h b/DebugEngine.h
index e39470e..7a75264 100644
--- a/DebugEngine.h
+++ b/DebugEngine.h
@@ -9,6 +9,7 @@
#include <QObject>
#include <QString>
+#include <string>
#include <QFile>
#include <QMutex>
#include <QTime>
@@ -17,6 +18,7 @@
#include <QCoreApplication>
#include <QAbstractTableModel>
#include <QRegularExpression>
+#include <regex>
#include "Variable.h"
#include "PlatformMacro.h"
@@ -32,12 +34,12 @@ public:
/// \brief the transfer item displayed
struct DebugItem
- int time;
+ unsigned int time;
DebugLevel_custom level;
- QString function;
- QString text;
- QString file;
- QString location;
+ std::string function;
+ std::string text;
+ std::string file;
+ std::string location;
static DebugModel *debugModel;
@@ -50,13 +52,13 @@ public:
virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
virtual bool setData(const QModelIndex&, const QVariant&, int = Qt::EditRole);
- void addDebugInformation(const int &time, const DebugLevel_custom &level, const QString& function, const QString& text, const QString &file="", const int& ligne=-1, const QString& location="Core");
+ void addDebugInformation(const int &time, const DebugLevel_custom &level, const std::string& function, const std::string& text, const std::string &file="", const unsigned int& ligne=0, const std::string& location="Core");
void setupTheTimer();
QTimer *updateDisplayTimer;
bool displayed;
bool inWaitOfDisplay;
- QList<DebugItem> list;
+ std::vector<DebugItem> list;
private slots:
void updateDisplay();
@@ -75,7 +77,7 @@ class DebugEngine : public QObject
/** \brief Get the html text info for re-show it
\note This function is thread safe */
- QString getTheDebugHtml();
+ std::string getTheDebugHtml();
/// \brief Enumeration of backend
enum Backend
@@ -85,17 +87,17 @@ class DebugEngine : public QObject
/// \brief return the current backend
Backend getCurrentBackend();
/// \brief Get the html end
- QString getTheDebugEnd();
+ std::string getTheDebugEnd();
/** \brief For add message info, this function
\note This function is reentrant */
- static void addDebugInformationStatic(const Ultracopier::DebugLevel &level,const QString& function,const QString& text,const QString& file="",const int& ligne=-1,const QString& location="Core");
- static void addDebugNote(const QString& text);
+ static void addDebugInformationStatic(const Ultracopier::DebugLevel &level,const std::string& function,const std::string& text,const std::string& file="",const int& ligne=-1,const std::string& location="Core");
+ static void addDebugNote(const std::string& text);
static DebugEngine *debugEngine;
public slots:
/** \brief ask to the user where save the bug report
\warning This function can be only call by the graphical thread */
void saveBugReport();
- void addDebugInformation(const DebugLevel_custom &level,const QString& fonction,const QString& text,QString file="",const int& ligne=-1,const QString& location="Core");
+ void addDebugInformation(const DebugLevel_custom &level,const std::string& fonction,const std::string& text,std::string file="",const int& ligne=-1,const std::string& location="Core");
/// \brief Path for log file
QFile logFile;
@@ -110,18 +112,18 @@ class DebugEngine : public QObject
/// \brief For record the start time
QTime startTime;
/// \brief String for the end of log file
- QString endOfLogFile;
+ std::string endOfLogFile;
/// \brief Drop the html entities
- QString htmlEntities(const QString &text);
+ std::string htmlEntities(const std::string &text);
/// \brief To store the debug informations
- QString debugHtmlContent;
+ std::string debugHtmlContent;
/// \brief The current backend
Backend currentBackend;
/// try connect to send to the current running instance the arguements
bool tryConnect();
int addDebugInformationCallNumber;
bool quit;
- QRegularExpression fileNameCleaner;
+ //std::regex fileNameCleaner;don't clean, too many performance heart