Skip to content

Commit

Permalink
fix build errors on windows
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@12124 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Nov 15, 2009
1 parent 293d95b commit 4e182fc
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 17 deletions.
6 changes: 3 additions & 3 deletions python/core/qgsattributeaction.sip
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class QgsAttributeAction
//! 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 );
};
4 changes: 2 additions & 2 deletions src/app/attributetable/qgsattributetabledialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -388,8 +388,8 @@ void QgsAttributeTableDialog::updateRowSelection( int first, int last, int click
// 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 );
Expand Down
14 changes: 7 additions & 7 deletions src/core/qgsattributeaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ static const char * const ident_ = "$Id$";

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,
Expand Down Expand Up @@ -116,13 +116,13 @@ bool QgsAttributeAction::writeXML( QDomNode& layer_node, QDomDocument& doc ) con
{
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 );
Expand All @@ -132,7 +132,7 @@ bool QgsAttributeAction::writeXML( QDomNode& layer_node, QDomDocument& doc ) con

bool QgsAttributeAction::readXML( const QDomNode& layer_node )
{
clear();
mActions.clear();

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

Expand Down
17 changes: 12 additions & 5 deletions src/core/qgsattributeaction.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class CORE_EXPORT QgsAction
//! 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 ||
Expand All @@ -90,14 +90,14 @@ class CORE_EXPORT QgsAction
* 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
Expand All @@ -113,7 +113,7 @@ class CORE_EXPORT QgsAttributeAction : public QList<QgsAction>
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.
Expand All @@ -125,6 +125,13 @@ class CORE_EXPORT QgsAttributeAction : public QList<QgsAction>

//! 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

0 comments on commit 4e182fc

Please sign in to comment.