diff options
Diffstat (limited to 'utils/wpseditor/gui/src/utils.cpp')
-rw-r--r-- | utils/wpseditor/gui/src/utils.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/utils/wpseditor/gui/src/utils.cpp b/utils/wpseditor/gui/src/utils.cpp new file mode 100644 index 0000000000..f18442555b --- /dev/null +++ b/utils/wpseditor/gui/src/utils.cpp | |||
@@ -0,0 +1,28 @@ | |||
1 | #include "utils.h" | ||
2 | #include <QPointer> | ||
3 | #include <QtGlobal> | ||
4 | #include "qwpseditorwindow.h" | ||
5 | |||
6 | extern QPointer<QWpsEditorWindow> win; | ||
7 | |||
8 | int qlogger(const char* fmt,...) { | ||
9 | va_list ap; | ||
10 | va_start(ap, fmt); | ||
11 | QString s; | ||
12 | s.vsprintf(fmt,ap); | ||
13 | va_end(ap); | ||
14 | s.replace("\n",""); | ||
15 | //qDebug()<<s; | ||
16 | if (win==0) | ||
17 | qDebug()<<s; | ||
18 | if (s.indexOf("ERR")>=0) | ||
19 | s = "<font color=red>"+s+"</font>"; | ||
20 | if (win!=0) | ||
21 | win->logMsg(s); | ||
22 | va_end(ap); | ||
23 | return s.length(); | ||
24 | } | ||
25 | |||
26 | int qlogger(const QString& s) { | ||
27 | return qlogger(s.toAscii().data()); | ||
28 | } | ||