[QGIS Commit] r11861 - in trunk/qgis: python/core src/app src/core src/providers/ogr src/providers/postgres src/providers/spatialite

svn_qgis at osgeo.org svn_qgis at osgeo.org
Tue Oct 27 20:51:34 EDT 2009


Author: jef
Date: 2009-10-27 20:51:34 -0400 (Tue, 27 Oct 2009)
New Revision: 11861

Modified:
   trunk/qgis/python/core/qgsdataprovider.sip
   trunk/qgis/src/app/qgsvectorlayerproperties.cpp
   trunk/qgis/src/core/qgsdataprovider.h
   trunk/qgis/src/providers/ogr/qgsogrprovider.h
   trunk/qgis/src/providers/postgres/qgspostgresprovider.h
   trunk/qgis/src/providers/spatialite/qgsspatialiteprovider.h
Log:
fix #2036

Modified: trunk/qgis/python/core/qgsdataprovider.sip
===================================================================
--- trunk/qgis/python/core/qgsdataprovider.sip	2009-10-28 00:49:45 UTC (rev 11860)
+++ trunk/qgis/python/core/qgsdataprovider.sip	2009-10-28 00:51:34 UTC (rev 11861)
@@ -66,6 +66,11 @@
       */
       virtual bool setSubsetString(QString subset);
 
+      /**
+       * provider supports setting of subset strings
+       * @note added in 1.4
+       */
+      virtual bool supportsSubsetString();
 
       /**
        * Returns the subset definition string (typically sql) currently in

Modified: trunk/qgis/src/app/qgsvectorlayerproperties.cpp
===================================================================
--- trunk/qgis/src/app/qgsvectorlayerproperties.cpp	2009-10-28 00:49:45 UTC (rev 11860)
+++ trunk/qgis/src/app/qgsvectorlayerproperties.cpp	2009-10-28 00:51:34 UTC (rev 11861)
@@ -438,7 +438,7 @@
   // on the builder. If the ability to enter a query directly into the box is required,
   // a mechanism to check it must be implemented.
   txtSubsetSQL->setEnabled( false );
-  pbnQueryBuilder->setEnabled( true );
+  pbnQueryBuilder->setEnabled( layer && layer->dataProvider() && layer->dataProvider()->supportsSubsetString() );
 
   //get field list for display field combo
   const QgsFieldMap& myFields = layer->pendingFields();

Modified: trunk/qgis/src/core/qgsdataprovider.h
===================================================================
--- trunk/qgis/src/core/qgsdataprovider.h	2009-10-28 00:49:45 UTC (rev 11860)
+++ trunk/qgis/src/core/qgsdataprovider.h	2009-10-28 00:51:34 UTC (rev 11861)
@@ -122,6 +122,12 @@
 
 
     /**
+     * provider supports setting of subset strings
+     * @note added in 1.4
+     */
+    virtual bool supportsSubsetString() { return false; }
+
+    /**
      * Returns the subset definition string (typically sql) currently in
      * use by the layer and used by the provider to limit the feature set.
      * Must be overridden in the dataprovider, otherwise returns a null

Modified: trunk/qgis/src/providers/ogr/qgsogrprovider.h
===================================================================
--- trunk/qgis/src/providers/ogr/qgsogrprovider.h	2009-10-28 00:49:45 UTC (rev 11860)
+++ trunk/qgis/src/providers/ogr/qgsogrprovider.h	2009-10-28 00:51:34 UTC (rev 11861)
@@ -95,6 +95,8 @@
     /** Accessor for sql where clause used to limit dataset */
     virtual QString subsetString();
 
+    virtual bool supportsSubsetString() { return true; }
+
     /** mutator for sql where clause used to limit dataset size */
     virtual bool setSubsetString( QString theSQL );
 

Modified: trunk/qgis/src/providers/postgres/qgspostgresprovider.h
===================================================================
--- trunk/qgis/src/providers/postgres/qgspostgresprovider.h	2009-10-28 00:49:45 UTC (rev 11860)
+++ trunk/qgis/src/providers/postgres/qgspostgresprovider.h	2009-10-28 00:51:34 UTC (rev 11861)
@@ -255,6 +255,8 @@
     /** mutator for sql where clause used to limit dataset size */
     bool setSubsetString( QString theSQL );
 
+    virtual bool supportsSubsetString() { return true; }
+
     /**Returns a bitmask containing the supported capabilities*/
     int capabilities() const;
 

Modified: trunk/qgis/src/providers/spatialite/qgsspatialiteprovider.h
===================================================================
--- trunk/qgis/src/providers/spatialite/qgsspatialiteprovider.h	2009-10-28 00:49:45 UTC (rev 11860)
+++ trunk/qgis/src/providers/spatialite/qgsspatialiteprovider.h	2009-10-28 00:51:34 UTC (rev 11861)
@@ -81,6 +81,8 @@
     /** mutator for sql where clause used to limit dataset size */
     virtual bool setSubsetString( QString theSQL );
 
+    virtual bool supportsSubsetString() { return true; }
+
     /** Select features based on a bounding rectangle. Features can be retrieved with calls to nextFeature.
      *  @param fetchAttributes list of attributes which should be fetched
      *  @param rect spatial filter



More information about the QGIS-commit mailing list