Holger Hans Peter Freyther <holger.freyther@trolltech.com>
[WebKit-https.git] / WebCore / platform / NotImplemented.h
index f942065..dd815ab 100644 (file)
@@ -31,6 +31,8 @@
 
 #if PLATFORM(GTK)
     #define supressNotImplementedWarning() getenv("DISABLE_NI_WARNING")
+#elif PLATFORM(QT)
+    #define supressNotImplementedWarning() !qgetenv("DISABLE_NI_WARNING").isEmpty()
 #else
     #define supressNotImplementedWarning() false
 #endif
 #elif PLATFORM(QT)
     #include <qglobal.h>
     #include <qbytearray.h>
-    #define notImplemented() \
-        if (qgetenv("DISABLE_NI_WARNING").isEmpty()) \
-            qDebug("FIXME: UNIMPLEMENTED: %s:%d (%s)", __FILE__, __LINE__, WTF_PRETTY_FUNCTION)
+    #define notImplemented() do { \
+        static bool havePrinted = false; \
+        if (!havePrinted && !supressNotImplementedWarning()) { \
+            qDebug("FIXME: UNIMPLEMENTED: %s:%d (%s)", __FILE__, __LINE__, WTF_PRETTY_FUNCTION); \
+            havePrinted = true; \
+        } \
+    } while (0)
 
 #else