Changeset View
Changeset View
Standalone View
Standalone View
src/kauthhelpersupport.cpp
Show All 37 Lines | |||||
38 | static inline void openlog(const char*, int, int) {} | 38 | static inline void openlog(const char*, int, int) {} | ||
39 | static inline void closelog() {} | 39 | static inline void closelog() {} | ||
40 | #define syslog(level, ...) fprintf(stderr, __VA_ARGS__) | 40 | #define syslog(level, ...) fprintf(stderr, __VA_ARGS__) | ||
41 | 41 | | |||
42 | #endif | 42 | #endif | ||
43 | 43 | | |||
44 | #include <QCoreApplication> | 44 | #include <QCoreApplication> | ||
45 | #include <QTimer> | 45 | #include <QTimer> | ||
46 | #include <QTextCodec> | ||||
46 | 47 | | |||
47 | #include "BackendsManager.h" | 48 | #include "BackendsManager.h" | ||
48 | 49 | | |||
49 | namespace KAuth | 50 | namespace KAuth | ||
50 | { | 51 | { | ||
51 | 52 | | |||
52 | namespace HelperSupport | 53 | namespace HelperSupport | ||
53 | { | 54 | { | ||
Show All 17 Lines | 62 | { | |||
71 | } | 72 | } | ||
72 | } | 73 | } | ||
73 | #endif | 74 | #endif | ||
74 | 75 | | |||
75 | int HelperSupport::helperMain(int argc, char **argv, const char *id, QObject *responder) | 76 | int HelperSupport::helperMain(int argc, char **argv, const char *id, QObject *responder) | ||
76 | { | 77 | { | ||
77 | #ifdef Q_OS_UNIX | 78 | #ifdef Q_OS_UNIX | ||
78 | fixEnvironment(); | 79 | fixEnvironment(); | ||
80 | //As we don't inherit lang, the locale could be something that doesn't support UTF-8. Force it | ||||
81 | auto utf8Codec = QTextCodec::codecForName("UTF-8"); | ||||
82 | if (utf8Codec) { | ||||
83 | QTextCodec::setCodecForLocale(utf8Codec); | ||||
84 | } | ||||
79 | #endif | 85 | #endif | ||
80 | 86 | | |||
81 | #ifdef Q_OS_OSX | 87 | #ifdef Q_OS_OSX | ||
82 | openlog(id, LOG_CONS|LOG_PID, LOG_USER); | 88 | openlog(id, LOG_CONS|LOG_PID, LOG_USER); | ||
83 | int logLevel = LOG_WARNING; | 89 | int logLevel = LOG_WARNING; | ||
84 | #else | 90 | #else | ||
85 | openlog(id, 0, LOG_USER); | 91 | openlog(id, 0, LOG_USER); | ||
86 | int logLevel = LOG_DEBUG; | 92 | int logLevel = LOG_DEBUG; | ||
▲ Show 20 Lines • Show All 76 Lines • Show Last 20 Lines |