Diffstat (limited to 'pwmanager/pwmanager/globalstuff.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | pwmanager/pwmanager/globalstuff.h | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/pwmanager/pwmanager/globalstuff.h b/pwmanager/pwmanager/globalstuff.h index 7bc4173..428ce95 100644 --- a/pwmanager/pwmanager/globalstuff.h +++ b/pwmanager/pwmanager/globalstuff.h @@ -26,8 +26,16 @@ #include "compiler.h" + //US BUG: the following code caused compile errors with certain gcccompilers (2.95). + // Because of that I replaced it with a Qt version, which should do the same. #include <string> + +#ifndef PWM_EMBEDDED #include <sstream> +#else +#include <qstring.h> +#include <qtextstream.h> +#endif #ifndef CONFIG_KEYCARD class QWidget; @@ -72,14 +80,27 @@ void no_keycard_support_msg_box(QWidget *parentWidget); #endif #define array_size(x) (sizeof(x) / sizeof((x)[0])) +//US BUG: the following code caused compile errors with certain gcccompilers (2.95). +// Because of that I replaced it with a Qt version, which should do the same. +#ifndef PWM_EMBEDDED +/** convert something to string using ostringstream */ +template <class T> inline +std::string tostr(const T &t) +{ + std::ostringstream s; + s << t; + return s.str(); +} +#else /** convert something to string using ostringstream */ template <class T> inline std::string tostr(const T &t) { - std::ostringstream s; - s << t; - return s.str(); + QString result; + QTextOStream(&result) << t; + return result.latin1(); } +#endif /** delete the memory and NULL the pointer */ template<class T> inline |