From 80a112f677c2644f761810ae63b5130737fa398c Mon Sep 17 00:00:00 2001
From: hjk <qtc-committer@nokia.com>
Date: Thu, 12 Nov 2009 09:25:01 +0100
Subject: [PATCH] debugger: make QVariant dumper compile with QT_NO_SHORTCUT

---
 share/qtcreator/gdbmacros/gdbmacros.cpp | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/share/qtcreator/gdbmacros/gdbmacros.cpp b/share/qtcreator/gdbmacros/gdbmacros.cpp
index dd51f806bd7..0af17f99cb3 100644
--- a/share/qtcreator/gdbmacros/gdbmacros.cpp
+++ b/share/qtcreator/gdbmacros/gdbmacros.cpp
@@ -2135,19 +2135,23 @@ static void qDumpQVariantHelper(const QVariant *v, QString *value,
         *value = qvariant_cast<QColor>(*v).name();
         break;
     case QVariant::KeySequence:
+        #ifndef QT_NO_SHORTCUT
         *value = qvariant_cast<QKeySequence>(*v).toString();
+        #else 
+        *value = QString::fromLatin1("Disabled by QT_NO_SHORTCUT");
+        #endif
         break;
     case QVariant::SizePolicy:
         *value = sizePolicyValue(qvariant_cast<QSizePolicy>(*v));
         break;
     #endif
     default: {
-        static const char *qTypeFormat = sizeof(void *) == sizeof(long) ?
-                                            "'"NS"%s "NS"qVariantValue<"NS"%s >'(*('"NS"QVariant'*)0x%lx)" :
-                                            "'"NS"%s "NS"qVariantValue<"NS"%s >'(*('"NS"QVariant'*)0x%llx)";
-        static const char *nonQTypeFormat = sizeof(void *) == sizeof(long) ?
-                                            "'%s "NS"qVariantValue<%s >'(*('"NS"QVariant'*)0x%lx)" :
-                                            "'%s "NS"qVariantValue<%s >'(*('"NS"QVariant'*)0x%llx)";
+        static const char *qTypeFormat = sizeof(void *) == sizeof(long)
+            ? "'"NS"%s "NS"qVariantValue<"NS"%s >'(*('"NS"QVariant'*)0x%lx)"
+            : "'"NS"%s "NS"qVariantValue<"NS"%s >'(*('"NS"QVariant'*)0x%llx)";
+        static const char *nonQTypeFormat = sizeof(void *) == sizeof(long)
+            ? "'%s "NS"qVariantValue<%s >'(*('"NS"QVariant'*)0x%lx)"
+            : "'%s "NS"qVariantValue<%s >'(*('"NS"QVariant'*)0x%llx)";
         char buf[1000];
         const char *format = (v->typeName()[0] == 'Q') ? qTypeFormat : nonQTypeFormat;
         qsnprintf(buf, sizeof(buf) - 1, format, v->typeName(), v->typeName(), v);
-- 
GitLab