diff view/Pane.cpp @ 663:1a0fdad4af4d tonioni

Merge from the default branch
author Chris Cannam
date Fri, 12 Jul 2013 13:25:22 +0100
parents 8663a831838f 7cb6112c59ca
children 917039d333bb
line wrap: on
line diff
--- a/view/Pane.cpp	Thu Jun 20 13:47:36 2013 +0100
+++ b/view/Pane.cpp	Fri Jul 12 13:25:22 2013 +0100
@@ -40,6 +40,7 @@
 #include <QDropEvent>
 #include <QCursor>
 #include <QTextStream>
+#include <QMimeData>
 
 #include <iostream>
 #include <cmath>
@@ -1124,7 +1125,6 @@
     if (m_manager && m_manager->shouldShowVerticalScale()) {
         for (LayerList::iterator vi = m_layers.end(); vi != m_layers.begin(); ) {
             --vi;
-            QPainter paint(image);
             sw = (*vi)->getVerticalScaleWidth
                 (this, m_manager->shouldShowVerticalColourScale(), paint);
             break;
@@ -1540,7 +1540,8 @@
 
 //    std::cerr << "mouseMoveEvent" << std::endl;
 
-    updateContextHelp(&e->pos());
+    QPoint pos = e->pos();
+    updateContextHelp(&pos);
 
     if (m_navigating && m_clickedInRange && !m_releasing) {
 
@@ -2374,7 +2375,8 @@
               << ", possibleActions: " << e->possibleActions()
               << ", proposedAction: " << e->proposedAction() << std::endl;
     
-    if (e->provides("text/uri-list") || e->provides("text/plain")) {
+    if (e->mimeData()->hasFormat("text/uri-list") ||
+        e->mimeData()->hasFormat("text/plain")) {
 
         if (e->proposedAction() & Qt::CopyAction) {
             e->acceptProposedAction();
@@ -2391,7 +2393,8 @@
     std::cerr << "dropEvent: text: \"" << e->mimeData()->text().toStdString()
               << "\"" << std::endl;
 
-    if (e->provides("text/uri-list") || e->provides("text/plain")) {
+    if (e->mimeData()->hasFormat("text/uri-list") || 
+        e->mimeData()->hasFormat("text/plain")) {
 
         if (e->proposedAction() & Qt::CopyAction) {
             e->acceptProposedAction();
@@ -2400,16 +2403,16 @@
             e->accept();
         }
 
-        if (e->provides("text/uri-list")) {
-
-            SVDEBUG << "accepting... data is \"" << e->encodedData("text/uri-list").data() << "\"" << endl;
+        if (e->mimeData()->hasFormat("text/uri-list")) {
+
+            SVDEBUG << "accepting... data is \"" << e->mimeData()->data("text/uri-list").data() << "\"" << endl;
             emit dropAccepted(QString::fromLocal8Bit
-                              (e->encodedData("text/uri-list").data())
+                              (e->mimeData()->data("text/uri-list").data())
                               .split(QRegExp("[\\r\\n]+"), 
                                      QString::SkipEmptyParts));
         } else {
             emit dropAccepted(QString::fromLocal8Bit
-                              (e->encodedData("text/plain").data()));
+                              (e->mimeData()->data("text/plain").data()));
         }
     }
 }