common.h

changeset 169
f562323760a2
parent 162
b7d65e89861a
equal deleted inserted replaced
168:96691a009dff 169:f562323760a2
127 return qstr.toStdString ().c_str (); 127 return qstr.toStdString ().c_str ();
128 } 128 }
129 129
130 static const double pi = 3.14159265358979323846f; 130 static const double pi = 3.14159265358979323846f;
131 131
132 #ifdef IN_IDE_PARSER // KDevelop workaround
133 // Current function name
134 static const char* __func__ = "";
135 #endif // IN_IDE_PARSER
136
132 // ----------------------------------------------------------------------------- 137 // -----------------------------------------------------------------------------
133 enum LogType { 138 enum LogType {
134 LOG_Normal, 139 LOG_Normal,
135 LOG_Success,
136 LOG_Info,
137 LOG_Warning, 140 LOG_Warning,
138 LOG_Error, 141 LOG_Error,
139 LOG_Dev, 142 LOG_Dev,
140 }; 143 };
141 144
143 // to include gui.h here and recompile everything every time that file changes. 146 // to include gui.h here and recompile everything every time that file changes.
144 // logf is defined in main.cpp 147 // logf is defined in main.cpp
145 void logf (const char* fmtstr, ...) FORMAT_PRINTF (1, 2); 148 void logf (const char* fmtstr, ...) FORMAT_PRINTF (1, 2);
146 void logf (LogType type, const char* fmtstr, ...) FORMAT_PRINTF (2, 3); 149 void logf (LogType type, const char* fmtstr, ...) FORMAT_PRINTF (2, 3);
147 void warnf (const char* fmtstr, ...) FORMAT_PRINTF (1, 2); 150 void warnf (const char* fmtstr, ...) FORMAT_PRINTF (1, 2);
148 void infof (const char* fmtstr, ...) FORMAT_PRINTF (1, 2);
149 void succf (const char* fmtstr, ...) FORMAT_PRINTF (1, 2);
150 void errf (const char* fmtstr, ...) FORMAT_PRINTF (1, 2); 151 void errf (const char* fmtstr, ...) FORMAT_PRINTF (1, 2);
151 152
152 #ifndef RELEASE 153 #ifndef RELEASE
153 void devf (const char* fmtstr, ...); 154 void devf (const char* fmtstr, ...);
154 #else 155 #else

mercurial