Skip to content

Commit 92957c3

Browse files
author
jef
committed
fix build errors on windows
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@12124 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 2e0b1de commit 92957c3

File tree

4 files changed

+24
-17
lines changed

4 files changed

+24
-17
lines changed

python/core/qgsattributeaction.sip

+3-3
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class QgsAttributeAction
7171
//! Reads the actions in in XML format
7272
bool readXML( const QDomNode& layer_node );
7373

74-
//! interface to inherited methods from QList<QgsAction>
75-
const QgsAction &at( int idx );
76-
const int size();
74+
int size() const;
75+
QgsAction &at( int idx );
76+
QgsAction &operator[]( int idx );
7777
};

src/app/attributetable/qgsattributetabledialog.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -388,8 +388,8 @@ void QgsAttributeTableDialog::updateRowSelection( int first, int last, int click
388388
// new selection should be created
389389
if ( clickType == 0 ) // Single click
390390
{
391-
if ( mSelectedFeatures.size() == 1 and wasSelected ) // One item selected
392-
return // Click over a selected item doesn't do anything
391+
if ( mSelectedFeatures.size() == 1 && wasSelected ) // One item selected
392+
return; // Click over a selected item doesn't do anything
393393

394394
mView->setCurrentIndex( mFilterModel->index( first, 0 ) );
395395
mView->selectRow( first );

src/core/qgsattributeaction.cpp

+7-7
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ static const char * const ident_ = "$Id$";
3535

3636
void QgsAttributeAction::addAction( QgsAction::ActionType type, QString name, QString action, bool capture )
3737
{
38-
*this << QgsAction( type, name, action, capture );
38+
mActions << QgsAction( type, name, action, capture );
3939
}
4040

4141
void QgsAttributeAction::doAction( int index, const QList< QPair<QString, QString> > &values,
@@ -116,13 +116,13 @@ bool QgsAttributeAction::writeXML( QDomNode& layer_node, QDomDocument& doc ) con
116116
{
117117
QDomElement aActions = doc.createElement( "attributeactions" );
118118

119-
for ( int i = 0; i < size(); i++ )
119+
for ( int i = 0; i < mActions.size(); i++ )
120120
{
121121
QDomElement actionSetting = doc.createElement( "actionsetting" );
122-
actionSetting.setAttribute( "type", at( i ).type() );
123-
actionSetting.setAttribute( "name", at( i ).name() );
124-
actionSetting.setAttribute( "action", at( i ).action() );
125-
actionSetting.setAttribute( "capture", at( i ).capture() );
122+
actionSetting.setAttribute( "type", mActions[i].type() );
123+
actionSetting.setAttribute( "name", mActions[i].name() );
124+
actionSetting.setAttribute( "action", mActions[i].action() );
125+
actionSetting.setAttribute( "capture", mActions[i].capture() );
126126
aActions.appendChild( actionSetting );
127127
}
128128
layer_node.appendChild( aActions );
@@ -132,7 +132,7 @@ bool QgsAttributeAction::writeXML( QDomNode& layer_node, QDomDocument& doc ) con
132132

133133
bool QgsAttributeAction::readXML( const QDomNode& layer_node )
134134
{
135-
clear();
135+
mActions.clear();
136136

137137
QDomNode aaNode = layer_node.namedItem( "attributeactions" );
138138

src/core/qgsattributeaction.h

+12-5
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class CORE_EXPORT QgsAction
6363
//! Whether to capture output for display when this action is run
6464
bool capture() const { return mCaptureOutput; }
6565

66-
//!
66+
//! Wheter the action is runable on the current platform
6767
bool runable() const
6868
{
6969
return mType == Generic ||
@@ -90,14 +90,14 @@ class CORE_EXPORT QgsAction
9090
* attributes.
9191
*/
9292

93-
class CORE_EXPORT QgsAttributeAction : public QList<QgsAction>
93+
class CORE_EXPORT QgsAttributeAction
9494
{
9595
public:
9696
//! Constructor
97-
QgsAttributeAction() {};
97+
QgsAttributeAction() {}
9898

9999
//! Destructor
100-
virtual ~QgsAttributeAction() {};
100+
virtual ~QgsAttributeAction() {}
101101

102102
//! Add an action with the given name and action details.
103103
// Will happily have duplicate names and actions. If
@@ -113,7 +113,7 @@ class CORE_EXPORT QgsAttributeAction : public QList<QgsAction>
113113
int defaultValueIndex = 0, void ( *executePython )( const QString & ) = 0 );
114114

115115
//! Removes all actions
116-
void clearActions() { clear(); }
116+
void clearActions() { mActions.clear(); }
117117

118118
//! Expands the given action, replacing all %'s with the value as
119119
// given.
@@ -125,6 +125,13 @@ class CORE_EXPORT QgsAttributeAction : public QList<QgsAction>
125125

126126
//! Reads the actions in in XML format
127127
bool readXML( const QDomNode& layer_node );
128+
129+
int size() const { return mActions.size(); }
130+
QgsAction &at( int idx ) { return mActions[idx]; }
131+
QgsAction &operator[]( int idx ) { return mActions[idx]; }
132+
133+
private:
134+
QList<QgsAction> mActions;
128135
};
129136

130137
#endif

0 commit comments

Comments
 (0)