summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorBerthold Krevert <berthold.krevert@basyskom.com>2012-08-08 18:38:37 +0200
committerQt by Nokia <qt-info@nokia.com>2012-08-22 09:08:02 +0200
commit8fb8011e6ac6352cf60cdd59d840779f0d9c52a6 (patch)
tree14ca84cecf20be3a2af82f2f622443c065fbaa41 /src/gui
parent5eb230615df6623897f0c8fc4bfd457bede49799 (diff)
Make Qt compile with -DQDND_DEBUG and fix debug messages
Change-Id: Idf34880179e27cdd48ea3365108d2c7bca07e596 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/kernel/qdnd.cpp56
-rw-r--r--src/gui/kernel/qplatformdrag.cpp59
2 files changed, 56 insertions, 59 deletions
diff --git a/src/gui/kernel/qdnd.cpp b/src/gui/kernel/qdnd.cpp
index a97583b4ef..bb1d0a1c60 100644
--- a/src/gui/kernel/qdnd.cpp
+++ b/src/gui/kernel/qdnd.cpp
@@ -68,62 +68,6 @@
QT_BEGIN_NAMESPACE
-//#define QDND_DEBUG
-
-#ifdef QDND_DEBUG
-QString dragActionsToString(Qt::DropActions actions)
-{
- QString str;
- if (actions == Qt::IgnoreAction) {
- if (!str.isEmpty())
- str += " | ";
- str += "IgnoreAction";
- }
- if (actions & Qt::LinkAction) {
- if (!str.isEmpty())
- str += " | ";
- str += "LinkAction";
- }
- if (actions & Qt::CopyAction) {
- if (!str.isEmpty())
- str += " | ";
- str += "CopyAction";
- }
- if (actions & Qt::MoveAction) {
- if (!str.isEmpty())
- str += " | ";
- str += "MoveAction";
- }
- if ((actions & Qt::TargetMoveAction) == Qt::TargetMoveAction ) {
- if (!str.isEmpty())
- str += " | ";
- str += "TargetMoveAction";
- }
- return str;
-}
-
-QString KeyboardModifiersToString(Qt::KeyboardModifiers moderfies)
-{
- QString str;
- if (moderfies & Qt::ControlModifier) {
- if (!str.isEmpty())
- str += " | ";
- str += Qt::ControlModifier;
- }
- if (moderfies & Qt::AltModifier) {
- if (!str.isEmpty())
- str += " | ";
- str += Qt::AltModifier;
- }
- if (moderfies & Qt::ShiftModifier) {
- if (!str.isEmpty())
- str += " | ";
- str += Qt::ShiftModifier;
- }
- return str;
-}
-#endif
-
// the universe's only drag manager
QDragManager *QDragManager::m_instance = 0;
diff --git a/src/gui/kernel/qplatformdrag.cpp b/src/gui/kernel/qplatformdrag.cpp
index 068dfabf7b..a4d8465ca2 100644
--- a/src/gui/kernel/qplatformdrag.cpp
+++ b/src/gui/kernel/qplatformdrag.cpp
@@ -49,6 +49,59 @@
QT_BEGIN_NAMESPACE
#ifndef QT_NO_DRAGANDDROP
+#ifdef QDND_DEBUG
+QString dragActionsToString(Qt::DropActions actions)
+{
+ QString str;
+ if (actions == Qt::IgnoreAction) {
+ if (!str.isEmpty())
+ str += QLatin1String(" | ");
+ str += QLatin1String("IgnoreAction");
+ }
+ if (actions & Qt::LinkAction) {
+ if (!str.isEmpty())
+ str += QLatin1String(" | ");
+ str += QLatin1String("LinkAction");
+ }
+ if (actions & Qt::CopyAction) {
+ if (!str.isEmpty())
+ str += QLatin1String(" | ");
+ str += QLatin1String("CopyAction");
+ }
+ if (actions & Qt::MoveAction) {
+ if (!str.isEmpty())
+ str += QLatin1String(" | ");
+ str += QLatin1String("MoveAction");
+ }
+ if ((actions & Qt::TargetMoveAction) == Qt::TargetMoveAction ) {
+ if (!str.isEmpty())
+ str += QLatin1String(" | ");
+ str += QLatin1String("TargetMoveAction");
+ }
+ return str;
+}
+
+QString KeyboardModifiersToString(Qt::KeyboardModifiers modifiers)
+{
+ QString str;
+ if (modifiers & Qt::ControlModifier) {
+ if (!str.isEmpty())
+ str += QLatin1String(" | ");
+ str += QLatin1String("ControlModifier");
+ }
+ if (modifiers & Qt::AltModifier) {
+ if (!str.isEmpty())
+ str += QLatin1String(" | ");
+ str += QLatin1String("AltModifier");
+ }
+ if (modifiers & Qt::ShiftModifier) {
+ if (!str.isEmpty())
+ str += QLatin1String(" | ");
+ str += QLatin1String("ShiftModifier");
+ }
+ return str;
+}
+#endif
QPlatformDropQtResponse::QPlatformDropQtResponse(bool accepted, Qt::DropAction acceptedAction)
: m_accepted(accepted)
@@ -112,7 +165,7 @@ Qt::DropAction QPlatformDrag::defaultAction(Qt::DropActions possibleActions,
{
#ifdef QDND_DEBUG
qDebug("QDragManager::defaultAction(Qt::DropActions possibleActions)");
- qDebug("keyboard modifiers : %s", KeyboardModifiersToString(modifiers).latin1());
+ qDebug("keyboard modifiers : %s", qPrintable(KeyboardModifiersToString(modifiers)));
#endif
Qt::DropAction default_action = Qt::IgnoreAction;
@@ -138,7 +191,7 @@ Qt::DropAction QPlatformDrag::defaultAction(Qt::DropActions possibleActions,
default_action = Qt::LinkAction;
#ifdef QDND_DEBUG
- qDebug("possible actions : %s", dragActionsToString(possibleActions).latin1());
+ qDebug("possible actions : %s", qPrintable(dragActionsToString(possibleActions)));
#endif
// Check if the action determined is allowed
@@ -154,7 +207,7 @@ Qt::DropAction QPlatformDrag::defaultAction(Qt::DropActions possibleActions,
}
#ifdef QDND_DEBUG
- qDebug("default action : %s", dragActionsToString(defaultAction).latin1());
+ qDebug("default action : %s", qPrintable(dragActionsToString(default_action)));
#endif
return default_action;