[QGIS Commit] r9938 - trunk/qgis/src/core
svn_qgis at osgeo.org
svn_qgis at osgeo.org
Wed Jan 7 08:38:46 EST 2009
Author: mhugent
Date: 2009-01-07 08:38:46 -0500 (Wed, 07 Jan 2009)
New Revision: 9938
Modified:
trunk/qgis/src/core/qgshttptransaction.cpp
trunk/qgis/src/core/qgshttptransaction.h
Log:
Emit signals from QgsHttpTransaction that allow progress bar and canceling of current transation
Modified: trunk/qgis/src/core/qgshttptransaction.cpp
===================================================================
--- trunk/qgis/src/core/qgshttptransaction.cpp 2009-01-07 13:34:16 UTC (rev 9937)
+++ trunk/qgis/src/core/qgshttptransaction.cpp 2009-01-07 13:38:46 UTC (rev 9938)
@@ -184,7 +184,8 @@
// QgsDebugMsg("Response received; being '" + httpresponsestring + "'.");
#endif
- delete http;
+ delete http;
+ http = 0;
// Did we get an error? If so, bail early
if ( !mError.isNull() )
@@ -287,6 +288,9 @@
// We saw something come back, therefore restart the watchdog timer
mWatchdogTimer->start( NETWORK_TIMEOUT_MSEC );
+ emit dataReadProgress(done);
+ emit totalSteps(total);
+
QString status;
if ( total )
@@ -464,4 +468,12 @@
return mError;
}
+void QgsHttpTransaction::abort()
+{
+ if(http)
+ {
+ http->abort();
+ }
+}
+
// ENDS
Modified: trunk/qgis/src/core/qgshttptransaction.h
===================================================================
--- trunk/qgis/src/core/qgshttptransaction.h 2009-01-07 13:34:16 UTC (rev 9937)
+++ trunk/qgis/src/core/qgshttptransaction.h 2009-01-07 13:38:46 UTC (rev 9938)
@@ -99,11 +99,19 @@
void networkTimedOut();
+ /**Aborts the current transaction*/
+ void abort();
+
signals:
- /** \brief emit a signal to notify of a progress event */
- void setProgress( int theProgress, int theTotalSteps );
+ /**legacy code. This signal is currently not emitted and only kept for API compatibility*/
+ void setProgress(int done, int total);
+ /**Signal for progress update */
+ void dataReadProgress( int theProgress);
+ /**Signal for adjusted number of steps*/
+ void totalSteps(int theTotalSteps);
+
/** \brief emit a signal to be caught by qgisapp and display a msg on status bar */
void statusChanged( QString theStatusQString );
More information about the QGIS-commit
mailing list