2 changes: 1 addition & 1 deletion cmake/SIPMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ MACRO(ADD_SIP_PYTHON_MODULE MODULE_NAME MODULE_SIP)
ADD_DEFINITIONS( /wd4996 /wd4701 /wd4702 )
ELSE(MSVC)
# disable all warnings
ADD_DEFINITIONS( -w )
ADD_DEFINITIONS( -w -fpermissive )
ENDIF(MSVC)
ENDIF(PEDANTIC)

Expand Down
1 change: 0 additions & 1 deletion python/analysis/analysis.sip
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

%Module qgis.analysis 0

%Import QtCore/QtCoremod.sip
Expand Down
1 change: 0 additions & 1 deletion python/core/core.sip
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

%Module qgis.core 0

%Import QtCore/QtCoremod.sip
Expand Down
4 changes: 3 additions & 1 deletion python/core/qgsvectordataprovider.sip
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ class QgsVectorDataProvider : QgsDataProvider
ChangeGeometries = 256,
SelectGeometryAtId = 512,
RandomSelectGeometryAtId = 1024,
SequentialSelectGeometryAtId = 2048
SequentialSelectGeometryAtId = 2048,
CreateAttributeIndex = 4096,
SetEncoding = 8192,
};

/** bitmask of all provider's editing capabilities */
Expand Down
4 changes: 2 additions & 2 deletions python/core/symbology-ng-core.sip
Original file line number Diff line number Diff line change
Expand Up @@ -619,10 +619,10 @@ class QgsSymbolV2RenderContext
void setAlpha( qreal alpha );

bool selected() const;
void setSelected( bool selected ) const;
void setSelected( bool selected );

//! @note added in 1.5
int renderHints() const;
int renderHints();
//! @note added in 1.5
void setRenderHints( int hints );

Expand Down
2 changes: 1 addition & 1 deletion src/app/attributetable/qgsattributetabledialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,7 @@ void QgsAttributeTableDialog::addFeature()
return;

QgsFeature f;
QgsFeatureAction action( tr( "Geometryless feature added" ), f, mLayer, -1, this );
QgsFeatureAction action( tr( "Geometryless feature added" ), f, mLayer, -1, -1, this );
if ( action.addFeature() )
{
mModel->reload( mModel->index( 0, 0 ), mModel->index( mModel->rowCount(), mModel->columnCount() ) );
Expand Down
8 changes: 4 additions & 4 deletions src/app/attributetable/qgsattributetablemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -424,9 +424,9 @@ QVariant QgsAttributeTableModel::data( const QModelIndex &index, int role ) cons
}
}

if ( role == Qt::DisplayRole && mValueMaps.contains( index.column() ) )
if ( role == Qt::DisplayRole && mValueMaps.contains( fieldId ) )
{
return mValueMaps[ index.column()]->key( val.toString(), QString( "(%1)" ).arg( val.toString() ) );
return mValueMaps[ fieldId ]->key( val.toString(), QString( "(%1)" ).arg( val.toString() ) );
}

return val.toString();
Expand Down Expand Up @@ -492,7 +492,7 @@ void QgsAttributeTableModel::executeAction( int action, const QModelIndex &idx )

for ( int i = 0; i < mAttributes.size(); i++ )
{
attributes.insert( i, data( index( idx.row(), i ), Qt::EditRole ) );
attributes.insert( mAttributes[i], data( index( idx.row(), i ), Qt::EditRole ) );
}

mLayer->actions()->doAction( action, attributes, fieldIdx( idx.column() ) );
Expand All @@ -509,7 +509,7 @@ void QgsAttributeTableModel::featureForm( QModelIndex &idx )
f.changeAttribute( mAttributes[i], data( index( idx.row(), i ), Qt::EditRole ) );
}

QgsFeatureAction action( tr( "Attributes changed" ), f, mLayer, -1, this );
QgsFeatureAction action( tr( "Attributes changed" ), f, mLayer, -1, -1, this );
if ( mLayer->isEditable() )
action.editFeature();
else
Expand Down
6 changes: 3 additions & 3 deletions src/app/gps/qgsgpsinformationwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ void QgsGPSInformationWidget::connectGps()

if ( mRadUserPath->isChecked() )
{
port = mCboDevices->itemData( mCboDevices->currentIndex() ).toString();
port = mCboDevices->currentText();

if ( port.isEmpty() )
{
Expand Down Expand Up @@ -672,7 +672,7 @@ void QgsGPSInformationWidget::on_mBtnCloseFeature_clicked( )

f->setGeometryAndOwnership( &wkb[0], size );

QgsFeatureAction action( tr( "Feature added" ), *f, vlayer, -1, this );
QgsFeatureAction action( tr( "Feature added" ), *f, vlayer, -1, -1, this );
if ( action.addFeature() )
mpCanvas->refresh();

Expand Down Expand Up @@ -784,7 +784,7 @@ void QgsGPSInformationWidget::on_mBtnCloseFeature_clicked( )
return; //unknown wkbtype
}

QgsFeatureAction action( tr( "Feature added" ), *f, vlayer, -1, this );
QgsFeatureAction action( tr( "Feature added" ), *f, vlayer, -1, -1, this );
if ( action.addFeature() )
mpCanvas->refresh();

Expand Down
9 changes: 9 additions & 0 deletions src/app/legend/qgslegend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -765,11 +765,20 @@ void QgsLegend::legendGroupRemove()
return;
}

// Turn off rendering to improve speed.
bool renderFlagState = mMapCanvas->renderFlag();
if ( renderFlagState )
mMapCanvas->setRenderFlag( false );

QgsLegendGroup* lg = dynamic_cast<QgsLegendGroup *>( currentItem() );
if ( lg )
{
removeGroup( lg );
}

// Turn on rendering (if it was on previously)
if ( renderFlagState )
mMapCanvas->setRenderFlag( true );
}

void QgsLegend::legendGroupSetCRS()
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgisappinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,6 @@ bool QgisAppInterface::openFeatureForm( QgsVectorLayer *vlayer, QgsFeature &f, b
if ( !vlayer )
return false;

QgsFeatureAction action( tr( "Attributes changed" ), f, vlayer, -1, QgisApp::instance() );
QgsFeatureAction action( tr( "Attributes changed" ), f, vlayer, -1, -1, QgisApp::instance() );
return action.editFeature();
}
5 changes: 3 additions & 2 deletions src/app/qgsfeatureaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@
#include <QPushButton>
#include <QSettings>

QgsFeatureAction::QgsFeatureAction( const QString &name, QgsFeature &f, QgsVectorLayer *layer, int action, QObject *parent )
QgsFeatureAction::QgsFeatureAction( const QString &name, QgsFeature &f, QgsVectorLayer *layer, int action, int defaultAttr, QObject *parent )
: QAction( name, parent )
, mLayer( layer )
, mFeature( f )
, mAction( action )
, mIdx( defaultAttr )
{
}

Expand Down Expand Up @@ -59,7 +60,7 @@ QgsAttributeDialog *QgsFeatureAction::newDialog( bool cloneFeature )
if ( !action.runable() )
continue;

QgsFeatureAction *a = new QgsFeatureAction( action.name(), *f, mLayer, i, dialog->dialog() );
QgsFeatureAction *a = new QgsFeatureAction( action.name(), *f, mLayer, i, -1, dialog->dialog() );
dialog->dialog()->addAction( a );
connect( a, SIGNAL( triggered() ), a, SLOT( execute() ) );

Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsfeatureaction.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class QgsFeatureAction : public QAction
Q_OBJECT

public:
QgsFeatureAction( const QString &name, QgsFeature &f, QgsVectorLayer *vl, int action, QObject *parent );
QgsFeatureAction( const QString &name, QgsFeature &f, QgsVectorLayer *vl, int action, int defaultAttr, QObject *parent );

public slots:
void execute();
Expand Down
9 changes: 7 additions & 2 deletions src/app/qgsidentifyresults.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,7 @@ void QgsIdentifyResults::contextMenuEvent( QContextMenuEvent* event )
if ( !item )
return;

int idx = 0;
QgsVectorLayer *vlayer = vectorLayer( item );
if ( vlayer == 0 )
return;
Expand All @@ -438,6 +439,10 @@ void QgsIdentifyResults::contextMenuEvent( QContextMenuEvent* event )
mActionPopup->addAction( tr( "Copy attribute value" ), this, SLOT( copyAttributeValue() ) );
mActionPopup->addAction( tr( "Copy feature attributes" ), this, SLOT( copyFeatureAttributes() ) );
mActionPopup->addSeparator();
if ( item->parent() == featItem && item->childCount() == 0 )
{
idx = item->data( 0, Qt::UserRole + 1 ).toInt();
}
}

mActionPopup->addAction( tr( "Clear results" ), this, SLOT( clear() ) );
Expand All @@ -464,7 +469,7 @@ void QgsIdentifyResults::contextMenuEvent( QContextMenuEvent* event )
continue;

int idx = featItem->data( 0, Qt::UserRole + 1 ).toInt();
QgsFeatureAction *a = new QgsFeatureAction( action.name(), mFeatures[ idx ], vlayer, i, this );
QgsFeatureAction *a = new QgsFeatureAction( action.name(), mFeatures[ idx ], vlayer, i, idx, this );
mActionPopup->addAction( QgisApp::getThemeIcon( "/mAction.png" ), action.name(), a, SLOT( execute() ) );
}
}
Expand Down Expand Up @@ -877,7 +882,7 @@ void QgsIdentifyResults::featureForm()
if ( !vlayer->featureAtId( fid, f ) )
return;

QgsFeatureAction action( tr( "Attribute changes" ), f, vlayer, idx, this );
QgsFeatureAction action( tr( "Attribute changes" ), f, vlayer, idx, -1, this );
if ( vlayer->isEditable() )
{
if ( action.editFeature() )
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsmaptooladdfeature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ QgsMapToolAddFeature::~QgsMapToolAddFeature()

bool QgsMapToolAddFeature::addFeature( QgsVectorLayer *vlayer, QgsFeature *f )
{
QgsFeatureAction action( tr( "add feature" ), *f, vlayer, -1, this );
QgsFeatureAction action( tr( "add feature" ), *f, vlayer, -1, -1, this );
return action.addFeature();
}

Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsmaptoolidentify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ bool QgsMapToolIdentify::identifyRasterLayer( QgsRasterLayer *layer, int x, int
//if WMS layer does not cover the view origin,
//we need to map the view pixel coordinates
//to WMS layer pixel coordinates
QgsRectangle viewExtent = mCanvas->extent();
QgsRectangle viewExtent = toLayerCoordinates( layer, mCanvas->extent() );
QgsRectangle layerExtent = layer->extent();
double mapUnitsPerPixel = mCanvas->mapUnitsPerPixel();
if ( mapUnitsPerPixel > 0 && viewExtent.intersects( layerExtent ) )
Expand Down
2 changes: 1 addition & 1 deletion src/core/gps/qextserialport/qextserialenumerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ QextSerialEnumerator::~QextSerialEnumerator( )
infoList.append(info);

CloseHandle( hPort );
}
}
#endif
}

Expand Down
2 changes: 1 addition & 1 deletion src/core/gps/qgsgpsdetector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ QList< QPair<QString, QString> > QgsGPSDetector::availablePorts()
QgsGPSDetector::QgsGPSDetector( QString portName )
{
mConn = 0;
mBaudList << BAUD4800 << BAUD9600 << BAUD38400;
mBaudList << BAUD4800 << BAUD9600 << BAUD38400 << BAUD57600 << BAUD115200; //add 57600 for SXBlueII GPS unit

if ( portName.isEmpty() )
{
Expand Down
1 change: 0 additions & 1 deletion src/core/qgsattributeaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ QString QgsAttributeAction::expandAction( QString action, const QgsAttributeMap
}
}


return expanded_action;
}

Expand Down
68 changes: 34 additions & 34 deletions src/core/qgsvectorlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,7 @@ void QgsVectorLayer::drawRendererV2( QgsRenderContext& rendererContext, bool lab
}

// labeling - register feature
if ( mRendererV2->symbolForFeature( fet ) != NULL )
if ( mRendererV2->symbolForFeature( fet ) != NULL && rendererContext.labelingEngine() )
{
if ( labeling )
{
Expand Down Expand Up @@ -849,7 +849,7 @@ void QgsVectorLayer::drawRendererV2Levels( QgsRenderContext& rendererContext, bo
mCachedGeometries[fet.id()] = *fet.geometry();
}

if ( sym )
if ( sym && rendererContext.labelingEngine() )
{
if ( labeling )
{
Expand Down Expand Up @@ -1095,7 +1095,7 @@ bool QgsVectorLayer::draw( QgsRenderContext& rendererContext )
//double scale = rendererContext.scaleFactor() / markerScaleFactor;
drawFeature( rendererContext, fet, &marker );

if ( mRenderer->willRenderFeature( &fet ) )
if ( mRenderer->willRenderFeature( &fet ) && rendererContext.labelingEngine() )
{
if ( labeling )
{
Expand Down Expand Up @@ -5218,47 +5218,47 @@ void QgsVectorLayer::updateAttributeMapIndex( QgsAttributeMap& map, int oldIndex

void QgsVectorLayer::prepareLabelingAndDiagrams( QgsRenderContext& rendererContext, QgsAttributeList& attributes, bool& labeling )
{
if ( rendererContext.labelingEngine() )
if ( !rendererContext.labelingEngine() )
return;

QSet<int> attrIndex;
if ( rendererContext.labelingEngine()->prepareLayer( this, attrIndex, rendererContext ) )
{
QSet<int> attrIndex;
if ( rendererContext.labelingEngine()->prepareLayer( this, attrIndex, rendererContext ) )
QSet<int>::const_iterator attIt = attrIndex.constBegin();
for ( ; attIt != attrIndex.constEnd(); ++attIt )
{
QSet<int>::const_iterator attIt = attrIndex.constBegin();
for ( ; attIt != attrIndex.constEnd(); ++attIt )
if ( !attributes.contains( *attIt ) )
{
if ( !attributes.contains( *attIt ) )
{
attributes << *attIt;
}
attributes << *attIt;
}
labeling = true;
}
labeling = true;
}

//register diagram layers
if ( mDiagramRenderer && mDiagramLayerSettings )
//register diagram layers
if ( mDiagramRenderer && mDiagramLayerSettings )
{
mDiagramLayerSettings->renderer = mDiagramRenderer;
rendererContext.labelingEngine()->addDiagramLayer( this, mDiagramLayerSettings );
//add attributes needed by the diagram renderer
QList<int> att = mDiagramRenderer->diagramAttributes();
QList<int>::const_iterator attIt = att.constBegin();
for ( ; attIt != att.constEnd(); ++attIt )
{
mDiagramLayerSettings->renderer = mDiagramRenderer;
rendererContext.labelingEngine()->addDiagramLayer( this, mDiagramLayerSettings );
//add attributes needed by the diagram renderer
QList<int> att = mDiagramRenderer->diagramAttributes();
QList<int>::const_iterator attIt = att.constBegin();
for ( ; attIt != att.constEnd(); ++attIt )
{
if ( !attributes.contains( *attIt ) )
{
attributes << *attIt;
}
}
//and the ones needed for data defined diagram positions
if ( mDiagramLayerSettings->xPosColumn >= 0 && !attributes.contains( mDiagramLayerSettings->xPosColumn ) )
{
attributes << mDiagramLayerSettings->xPosColumn;
}
if ( mDiagramLayerSettings->yPosColumn >= 0 && !attributes.contains( mDiagramLayerSettings->yPosColumn ) )
if ( !attributes.contains( *attIt ) )
{
attributes << mDiagramLayerSettings->yPosColumn;
attributes << *attIt;
}
}
//and the ones needed for data defined diagram positions
if ( mDiagramLayerSettings->xPosColumn >= 0 && !attributes.contains( mDiagramLayerSettings->xPosColumn ) )
{
attributes << mDiagramLayerSettings->xPosColumn;
}
if ( mDiagramLayerSettings->yPosColumn >= 0 && !attributes.contains( mDiagramLayerSettings->yPosColumn ) )
{
attributes << mDiagramLayerSettings->yPosColumn;
}
}
}

Expand Down
Loading