[QGIS Commit] r9397 - trunk/qgis/src/app

svn_qgis at osgeo.org svn_qgis at osgeo.org
Tue Sep 23 21:23:24 EDT 2008


Author: telwertowski
Date: 2008-09-23 21:23:24 -0400 (Tue, 23 Sep 2008)
New Revision: 9397

Modified:
   trunk/qgis/src/app/qgsmaptooladdfeature.cpp
Log:
When digitizing new features, don't delete rubberband image until ready to draw finished feature so that user isn't confused by disappearing image while being prompted for feature attributes. Fix for #1124.


Modified: trunk/qgis/src/app/qgsmaptooladdfeature.cpp
===================================================================
--- trunk/qgis/src/app/qgsmaptooladdfeature.cpp	2008-09-23 22:48:41 UTC (rev 9396)
+++ trunk/qgis/src/app/qgsmaptooladdfeature.cpp	2008-09-24 01:23:24 UTC (rev 9397)
@@ -234,12 +234,11 @@
 
       mCapturing = FALSE;
 
-      delete mRubberBand;
-      mRubberBand = NULL;
-
       //lines: bail out if there are not at least two vertices
       if ( mTool == CaptureLine && mCaptureList.size() < 2 )
       {
+        delete mRubberBand;
+        mRubberBand = NULL;
         mCaptureList.clear();
         return;
       }
@@ -247,6 +246,8 @@
       //polygons: bail out if there are not at least two vertices
       if ( mTool == CapturePolygon && mCaptureList.size() < 3 )
       {
+        delete mRubberBand;
+        mRubberBand = NULL;
         mCaptureList.clear();
         return;
       }
@@ -321,6 +322,9 @@
         else
         {
           QMessageBox::critical( 0, QObject::tr( "Error" ), QObject::tr( "Cannot add feature. Unknown WKB type" ) );
+          delete mRubberBand;
+          mRubberBand = NULL;
+          mCaptureList.clear();
           return; //unknown wkbtype
         }
         f->setGeometryAndOwnership( &wkb[0], size );
@@ -414,6 +418,9 @@
         else
         {
           QMessageBox::critical( 0, QObject::tr( "Error" ), QObject::tr( "Cannot add feature. Unknown WKB type" ) );
+          delete mRubberBand;
+          mRubberBand = NULL;
+          mCaptureList.clear();
           return; //unknown wkbtype
         }
         f->setGeometryAndOwnership( &wkb[0], size );
@@ -453,6 +460,9 @@
       delete f;
       delete mypDialog;
 
+      delete mRubberBand;
+      mRubberBand = NULL;
+
       // delete the elements of mCaptureList
       mCaptureList.clear();
       mCanvas->refresh();



More information about the QGIS-commit mailing list