[QGIS Commit] r12124 - in trunk/qgis: python/core src/app/attributetable src/core

svn_qgis at osgeo.org svn_qgis at osgeo.org
Sun Nov 15 12:13:22 EST 2009


Author: jef
Date: 2009-11-15 12:13:20 -0500 (Sun, 15 Nov 2009)
New Revision: 12124

Modified:
   trunk/qgis/python/core/qgsattributeaction.sip
   trunk/qgis/src/app/attributetable/qgsattributetabledialog.cpp
   trunk/qgis/src/core/qgsattributeaction.cpp
   trunk/qgis/src/core/qgsattributeaction.h
Log:
fix build errors on windows

Modified: trunk/qgis/python/core/qgsattributeaction.sip
===================================================================
--- trunk/qgis/python/core/qgsattributeaction.sip	2009-11-15 15:19:43 UTC (rev 12123)
+++ trunk/qgis/python/core/qgsattributeaction.sip	2009-11-15 17:13:20 UTC (rev 12124)
@@ -71,7 +71,7 @@
     //! Reads the actions in in XML format
     bool readXML( const QDomNode& layer_node );
 
-    //! interface to inherited methods from QList<QgsAction>
-    const QgsAction &at( int idx );
-    const int size();
+    int size() const;
+    QgsAction &at( int idx );
+    QgsAction &operator[]( int idx );
 };

Modified: trunk/qgis/src/app/attributetable/qgsattributetabledialog.cpp
===================================================================
--- trunk/qgis/src/app/attributetable/qgsattributetabledialog.cpp	2009-11-15 15:19:43 UTC (rev 12123)
+++ trunk/qgis/src/app/attributetable/qgsattributetabledialog.cpp	2009-11-15 17:13:20 UTC (rev 12124)
@@ -388,8 +388,8 @@
   // new selection should be created
   if ( clickType == 0 ) // Single click
   {
-    if ( mSelectedFeatures.size() == 1 and wasSelected ) // One item selected
-        return // Click over a selected item doesn't do anything
+    if ( mSelectedFeatures.size() == 1 && wasSelected ) // One item selected
+        return; // Click over a selected item doesn't do anything
 
     mView->setCurrentIndex( mFilterModel->index( first, 0 ) );
     mView->selectRow( first );

Modified: trunk/qgis/src/core/qgsattributeaction.cpp
===================================================================
--- trunk/qgis/src/core/qgsattributeaction.cpp	2009-11-15 15:19:43 UTC (rev 12123)
+++ trunk/qgis/src/core/qgsattributeaction.cpp	2009-11-15 17:13:20 UTC (rev 12124)
@@ -35,7 +35,7 @@
 
 void QgsAttributeAction::addAction( QgsAction::ActionType type, QString name, QString action, bool capture )
 {
-  *this << QgsAction( type, name, action, capture );
+  mActions << QgsAction( type, name, action, capture );
 }
 
 void QgsAttributeAction::doAction( int index, const QList< QPair<QString, QString> > &values,
@@ -116,13 +116,13 @@
 {
   QDomElement aActions = doc.createElement( "attributeactions" );
 
-  for ( int i = 0; i < size(); i++ )
+  for ( int i = 0; i < mActions.size(); i++ )
   {
     QDomElement actionSetting = doc.createElement( "actionsetting" );
-    actionSetting.setAttribute( "type", at( i ).type() );
-    actionSetting.setAttribute( "name", at( i ).name() );
-    actionSetting.setAttribute( "action", at( i ).action() );
-    actionSetting.setAttribute( "capture", at( i ).capture() );
+    actionSetting.setAttribute( "type", mActions[i].type() );
+    actionSetting.setAttribute( "name", mActions[i].name() );
+    actionSetting.setAttribute( "action", mActions[i].action() );
+    actionSetting.setAttribute( "capture", mActions[i].capture() );
     aActions.appendChild( actionSetting );
   }
   layer_node.appendChild( aActions );
@@ -132,7 +132,7 @@
 
 bool QgsAttributeAction::readXML( const QDomNode& layer_node )
 {
-  clear();
+  mActions.clear();
 
   QDomNode aaNode = layer_node.namedItem( "attributeactions" );
 

Modified: trunk/qgis/src/core/qgsattributeaction.h
===================================================================
--- trunk/qgis/src/core/qgsattributeaction.h	2009-11-15 15:19:43 UTC (rev 12123)
+++ trunk/qgis/src/core/qgsattributeaction.h	2009-11-15 17:13:20 UTC (rev 12124)
@@ -63,7 +63,7 @@
     //! Whether to capture output for display when this action is run
     bool capture() const { return mCaptureOutput; }
 
-    //!
+    //! Wheter the action is runable on the current platform
     bool runable() const
     {
       return mType == Generic ||
@@ -90,14 +90,14 @@
  * attributes.
  */
 
-class  CORE_EXPORT QgsAttributeAction : public QList<QgsAction>
+class  CORE_EXPORT QgsAttributeAction
 {
   public:
     //! Constructor
-    QgsAttributeAction() {};
+    QgsAttributeAction() {}
 
     //! Destructor
-    virtual ~QgsAttributeAction() {};
+    virtual ~QgsAttributeAction() {}
 
     //! Add an action with the given name and action details.
     // Will happily have duplicate names and actions. If
@@ -113,7 +113,7 @@
                    int defaultValueIndex = 0, void ( *executePython )( const QString & ) = 0 );
 
     //! Removes all actions
-    void clearActions() { clear(); }
+    void clearActions() { mActions.clear(); }
 
     //! Expands the given action, replacing all %'s with the value as
     // given.
@@ -125,6 +125,13 @@
 
     //! Reads the actions in in XML format
     bool readXML( const QDomNode& layer_node );
+
+    int size() const { return mActions.size(); }
+    QgsAction &at( int idx ) { return mActions[idx]; }
+    QgsAction &operator[]( int idx ) { return mActions[idx]; }
+
+  private:
+    QList<QgsAction> mActions;
 };
 
 #endif



More information about the QGIS-commit mailing list