From f783ec5347ac9962d011b2ff470082e083216367 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Tue, 21 Feb 2012 22:18:26 +0100 Subject: Remove use of Q_BROKEN_DEBUG_STREAM. No supported compiler defines it, and it was not used consistently so it didn't work anyway. Change-Id: Icc9e911e22daaedaee3d9316c15d19be26cd2e72 Reviewed-by: Thiago Macieira --- src/gui/kernel/qguivariant.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/gui/kernel/qguivariant.cpp') diff --git a/src/gui/kernel/qguivariant.cpp b/src/gui/kernel/qguivariant.cpp index 8378650dcb..2ebfb32bc3 100644 --- a/src/gui/kernel/qguivariant.cpp +++ b/src/gui/kernel/qguivariant.cpp @@ -342,7 +342,7 @@ static bool convert(const QVariant::Private *d, QVariant::Type t, return qcoreVariantHandler()->convert(d, t, result, ok); } -#if !defined(QT_NO_DEBUG_STREAM) && !defined(Q_BROKEN_DEBUG_STREAM) +#if !defined(QT_NO_DEBUG_STREAM) static void streamDebug(QDebug dbg, const QVariant &v) { QVariant::Private *d = const_cast(&v.data_ptr()); @@ -362,7 +362,7 @@ const QVariant::Handler qt_gui_variant_handler = { compare, convert, 0, -#if !defined(QT_NO_DEBUG_STREAM) && !defined(Q_BROKEN_DEBUG_STREAM) +#if !defined(QT_NO_DEBUG_STREAM) streamDebug #else 0 -- cgit v1.2.3 From 51f2a0c3318549a6f9388e3d4920eb23a60f8b7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Nowacki?= Date: Fri, 10 Feb 2012 12:21:25 +0100 Subject: Cleanup usage of QVariant::Type. QVariant::Type is marked as obsolete. It is not possible to get rid of it completely, in a source compatible way, but at least we can remove it safely from a method arguments list. Change-Id: I26b58099bfa6d32f3a583a8ae0047f0bb36bcd0d Reviewed-by: Thiago Macieira --- src/gui/kernel/qguivariant.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gui/kernel/qguivariant.cpp') diff --git a/src/gui/kernel/qguivariant.cpp b/src/gui/kernel/qguivariant.cpp index 2ebfb32bc3..0492e48bee 100644 --- a/src/gui/kernel/qguivariant.cpp +++ b/src/gui/kernel/qguivariant.cpp @@ -221,7 +221,7 @@ static bool compare(const QVariant::Private *a, const QVariant::Private *b) return QMetaTypeSwitcher::switcher(comparator, a->type, 0); } -static bool convert(const QVariant::Private *d, QVariant::Type t, +static bool convert(const QVariant::Private *d, int t, void *result, bool *ok) { switch (t) { -- cgit v1.2.3 From ec739707d70d6450a261f7dd4726380e59d403ef Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Sat, 25 Feb 2012 11:42:57 +0100 Subject: Remove deprecated usage of QKeySequence from qguivariant MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The implicit conversion operators are deprecated. Change-Id: I0e94c0671413da1ab58c6c7b8bb31614e2696409 Reviewed-by: Jędrzej Nowacki --- src/gui/kernel/qguivariant.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/gui/kernel/qguivariant.cpp') diff --git a/src/gui/kernel/qguivariant.cpp b/src/gui/kernel/qguivariant.cpp index 0492e48bee..50d3f0b7d1 100644 --- a/src/gui/kernel/qguivariant.cpp +++ b/src/gui/kernel/qguivariant.cpp @@ -236,7 +236,7 @@ static bool convert(const QVariant::Private *d, int t, switch (d->type) { #ifndef QT_NO_SHORTCUT case QVariant::KeySequence: - *str = QString(*v_cast(d)); + *str = (*v_cast(d)).toString(QKeySequence::NativeText); return true; #endif case QVariant::Font: @@ -285,7 +285,8 @@ static bool convert(const QVariant::Private *d, int t, #ifndef QT_NO_SHORTCUT case QVariant::Int: if (d->type == QVariant::KeySequence) { - *static_cast(result) = (int)(*(v_cast(d))); + const QKeySequence &seq = *v_cast(d); + *static_cast(result) = seq.isEmpty() ? 0 : seq[0]; return true; } break; -- cgit v1.2.3