diff view/Pane.cpp @ 586:1ae54a29e59e

Merge from debug-output branch
author Chris Cannam
date Tue, 14 Jun 2011 14:48:29 +0100
parents f4960f8ce798
children 4806715f7a19
line wrap: on
line diff
--- a/view/Pane.cpp	Thu Apr 14 15:21:21 2011 +0100
+++ b/view/Pane.cpp	Tue Jun 14 14:48:29 2011 +0100
@@ -85,7 +85,7 @@
     updateHeadsUpDisplay();
 
 
-//    std::cerr << "Pane::Pane(" << this << ") returning" << std::endl;
+//    DEBUG << "Pane::Pane(" << this << ") returning" << endl;
 }
 
 void
@@ -624,7 +624,7 @@
 
 //	    Profiler profiler("Pane::paintEvent - painting vertical scale", true);
 
-//	    std::cerr << "Pane::paintEvent: calling paint.save() in vertical scale block" << std::endl;
+//	    DEBUG << "Pane::paintEvent: calling paint.save() in vertical scale block" << endl;
         paint.save();
             
         paint.setPen(getForeground());
@@ -827,8 +827,7 @@
 {
     QString title = model->getTitle();
     QString maker = model->getMaker();
-//std::cerr << "Pane::drawWorkTitle: title=\"" << title.toStdString()
-//<< "\", maker=\"" << maker.toStdString() << "\"" << std::endl;
+//DEBUG << "Pane::drawWorkTitle: title=\"" << title//<< "\", maker=\"" << maker << "\"" << endl;
     if (title == "") return;
 
     QString text = title;
@@ -875,7 +874,7 @@
     for (LayerList::iterator i = m_layers.begin(); i != m_layers.end(); ++i) {
         texts.push_back((*i)->getLayerPresentationName());
 //        std::cerr << "Pane " << this << ": Layer presentation name for " << *i << ": "
-//                  << texts[texts.size()-1].toStdString() << std::endl;
+//                  << texts[texts.size()-1] << std::endl;
         pixmaps.push_back((*i)->getLayerPresentationPixmap
                           (QSize(fontAscent, fontAscent)));
     }
@@ -892,7 +891,7 @@
 	
         for (size_t i = 0; i < texts.size(); ++i) {
 
-//            std::cerr << "Pane "<< this << ": text " << i << ": " << texts[i].toStdString() << std::endl;
+//            std::cerr << "Pane "<< this << ": text " << i << ": " << texts[i] << std::endl;
             
             if (i + 1 == texts.size()) {
                 paint.setPen(getForeground());
@@ -1724,7 +1723,7 @@
             rmin = powf(10, rmin);
             rmax = powf(10, rmax);
         }
-        std::cerr << "finally: rmin: " << rmin << ", rmax: " << rmax << " " << unit.toStdString() << std::endl;
+        std::cerr << "finally: rmin: " << rmin << ", rmax: " << rmax << " " << unit << std::endl;
 
         layer->setDisplayExtents(rmin, rmax);
         updateVerticalPanner();
@@ -1784,8 +1783,8 @@
         }
 
 #ifdef DEBUG_PANE	    
-        std::cerr << "Pane::dragTopLayer: newCentreFrame = " << newCentreFrame <<
-            ", models end frame = " << getModelsEndFrame() << std::endl;
+        DEBUG << "Pane::dragTopLayer: newCentreFrame = " << newCentreFrame <<
+            ", models end frame = " << getModelsEndFrame() << endl;
 #endif
 
         if (newCentreFrame >= getModelsEndFrame()) {
@@ -1850,26 +1849,26 @@
 
     int smallThreshold = 10, bigThreshold = 80;
 
-//    std::cerr << "Pane::updateDragMode: xdiff = " << xdiff << ", ydiff = "
-//              << ydiff << ", canMoveVertical = " << canMoveVertical << ", drag mode = " << m_dragMode << std::endl;
+//    DEBUG << "Pane::updateDragMode: xdiff = " << xdiff << ", ydiff = "
+//              << ydiff << ", canMoveVertical = " << canMoveVertical << ", drag mode = " << m_dragMode << endl;
 
     if (dragMode == UnresolvedDrag) {
 
         if (abs(ydiff) > smallThreshold &&
             abs(ydiff) > abs(xdiff) * 2 &&
             canMoveVertical) {
-//            std::cerr << "Pane::updateDragMode: passed vertical threshold" << std::endl;
+//            DEBUG << "Pane::updateDragMode: passed vertical threshold" << endl;
             dragMode = VerticalDrag;
         } else if (abs(xdiff) > smallThreshold &&
                    abs(xdiff) > abs(ydiff) * 2 &&
                    canMoveHorizontal) {
-//            std::cerr << "Pane::updateDragMode: passed horizontal threshold" << std::endl;
+//            DEBUG << "Pane::updateDragMode: passed horizontal threshold" << endl;
             dragMode = HorizontalDrag;
         } else if (abs(xdiff) > smallThreshold &&
                    abs(ydiff) > smallThreshold &&
                    canMoveVertical &&
                    canMoveHorizontal) {
-//            std::cerr << "Pane::updateDragMode: passed both thresholds" << std::endl;
+//            DEBUG << "Pane::updateDragMode: passed both thresholds" << endl;
             dragMode = FreeDrag;
         }
     }
@@ -2278,7 +2277,7 @@
 
         if (e->provides("text/uri-list")) {
 
-            std::cerr << "accepting... data is \"" << e->encodedData("text/uri-list").data() << "\"" << std::endl;
+            DEBUG << "accepting... data is \"" << e->encodedData("text/uri-list").data() << "\"" << endl;
             emit dropAccepted(QString::fromLocal8Bit
                               (e->encodedData("text/uri-list").data())
                               .split(QRegExp("[\\r\\n]+"), 
@@ -2373,7 +2372,7 @@
 Pane::toolModeChanged()
 {
     ViewManager::ToolMode mode = m_manager->getToolMode();
-//    std::cerr << "Pane::toolModeChanged(" << mode << ")" << std::endl;
+//    DEBUG << "Pane::toolModeChanged(" << mode << ")" << endl;
 
     if (mode == ViewManager::MeasureMode && !m_measureCursor1) {
         m_measureCursor1 = new QCursor(QBitmap(":/icons/measure1cursor.xbm"),