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 | #ifdef Q_OS_UNIX | ||||
47 | #include <QTextCodec> | ||||
48 | #endif | ||||
46 | 49 | | |||
47 | #include "BackendsManager.h" | 50 | #include "BackendsManager.h" | ||
48 | 51 | | |||
49 | namespace KAuth | 52 | namespace KAuth | ||
50 | { | 53 | { | ||
51 | 54 | | |||
52 | namespace HelperSupport | 55 | namespace HelperSupport | ||
53 | { | 56 | { | ||
Show All 17 Lines | 64 | { | |||
71 | } | 74 | } | ||
72 | } | 75 | } | ||
73 | #endif | 76 | #endif | ||
74 | 77 | | |||
75 | int HelperSupport::helperMain(int argc, char **argv, const char *id, QObject *responder) | 78 | int HelperSupport::helperMain(int argc, char **argv, const char *id, QObject *responder) | ||
76 | { | 79 | { | ||
77 | #ifdef Q_OS_UNIX | 80 | #ifdef Q_OS_UNIX | ||
78 | fixEnvironment(); | 81 | fixEnvironment(); | ||
82 | //As we don't inherit lang, the locale could be something that doesn't support UTF-8. Force it | ||||
83 | auto utf8Codec = QTextCodec::codecForName("UTF-8"); | ||||
84 | if (utf8Codec) { | ||||
85 | QTextCodec::setCodecForLocale(utf8Codec); | ||||
86 | } | ||||
79 | #endif | 87 | #endif | ||
80 | 88 | | |||
81 | #ifdef Q_OS_OSX | 89 | #ifdef Q_OS_OSX | ||
82 | openlog(id, LOG_CONS|LOG_PID, LOG_USER); | 90 | openlog(id, LOG_CONS|LOG_PID, LOG_USER); | ||
83 | int logLevel = LOG_WARNING; | 91 | int logLevel = LOG_WARNING; | ||
84 | #else | 92 | #else | ||
85 | openlog(id, 0, LOG_USER); | 93 | openlog(id, 0, LOG_USER); | ||
86 | int logLevel = LOG_DEBUG; | 94 | int logLevel = LOG_DEBUG; | ||
▲ Show 20 Lines • Show All 76 Lines • Show Last 20 Lines |