Skip to content

Commit 5a3d14a

Browse files
committed
Merge branch 'master' of github.com:qgis/Quantum-GIS
2 parents d8fd81b + ee4ac59 commit 5a3d14a

35 files changed

Lines changed: 191 additions & 168 deletions

‎cmake/SIPMacros.cmake‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ MACRO(ADD_SIP_PYTHON_MODULE MODULE_NAME MODULE_SIP)
4646
SET(EXTRA_LINK_LIBRARIES ${ARGN})
4747

4848
STRING(REPLACE "." "/" _x ${MODULE_NAME})
49-
GET_FILENAME_COMPONENT(_parent_module_path ${_x} PATH)
49+
GET_FILENAME_COMPONENT(_parent_module_path ${_x} PATH)
5050
GET_FILENAME_COMPONENT(_child_module_name ${_x} NAME)
5151

5252
GET_FILENAME_COMPONENT(_module_path ${MODULE_SIP} PATH)
@@ -127,6 +127,16 @@ MACRO(ADD_SIP_PYTHON_MODULE MODULE_NAME MODULE_SIP)
127127
SET_TARGET_PROPERTIES(${_logical_name} PROPERTIES SUFFIX ".pyd")
128128
ENDIF (WIN32)
129129

130+
IF(WIN32)
131+
GET_TARGET_PROPERTY(_target_location ${_logical_name} LOCATION)
132+
GET_TARGET_PROPERTY(_runtime_output ${_logical_name} RUNTIME_OUTPUT_DIRECTORY)
133+
ADD_CUSTOM_COMMAND(TARGET ${_logical_name} POST_BUILD
134+
COMMAND ${CMAKE_COMMAND} -E echo "Copying extension ${_child_module_name}"
135+
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${_target_location}" "${_runtime_output}/${_child_module_name}.pyd"
136+
DEPENDS ${_logical_name}
137+
)
138+
ENDIF(WIN32)
139+
130140
INSTALL(TARGETS ${_logical_name} DESTINATION "${PYTHON_SITE_PACKAGES_DIR}/${_parent_module_path}")
131141

132142
ENDMACRO(ADD_SIP_PYTHON_MODULE)

‎cmake/UsePythonTest.cmake‎

Lines changed: 35 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
# Add a python test from a python file
2-
# One cannot simply do:
1+
# Add a python test from a python file # One cannot simply do:
32
# SET(ENV{PYTHONPATH} ${LIBRARY_OUTPUT_PATH})
43
# SET(my_test "from test_mymodule import *\;test_mymodule()")
54
# ADD_TEST(PYTHON-TEST-MYMODULE python -c ${my_test})
@@ -26,44 +25,42 @@ MARK_AS_ADVANCED(PYTHON_EXECUTABLE)
2625
MACRO(ADD_PYTHON_TEST TESTNAME FILENAME)
2726
GET_SOURCE_FILE_PROPERTY(loc ${FILENAME} LOCATION)
2827
GET_SOURCE_FILE_PROPERTY(pyenv ${FILENAME} PYTHONPATH)
29-
IF(CMAKE_CONFIGURATION_TYPES)
30-
# I cannot use CMAKE_CFG_INTDIR since it expand to "$(OutDir)"
31-
IF(pyenv)
32-
SET(pyenv "${pyenv};${LIBRARY_OUTPUT_PATH}/${CMAKE_BUILD_TYPE}")
33-
ELSE(pyenv)
34-
SET(pyenv ${LIBRARY_OUTPUT_PATH}/${CMAKE_BUILD_TYPE})
35-
#SET(pyenv ${LIBRARY_OUTPUT_PATH}/${CMAKE_CFG_INTDIR})
36-
#SET(pyenv ${LIBRARY_OUTPUT_PATH}/${CMAKE_CONFIG_TYPE})
37-
#SET(pyenv ${LIBRARY_OUTPUT_PATH}/\${CMAKE_CONFIG_TYPE})
38-
ENDIF(pyenv)
39-
ELSE(CMAKE_CONFIGURATION_TYPES)
40-
IF(pyenv)
41-
SET(pyenv ${pyenv}:${LIBRARY_OUTPUT_PATH})
42-
ELSE(pyenv)
43-
SET(pyenv ${LIBRARY_OUTPUT_PATH})
44-
ENDIF(pyenv)
45-
ENDIF(CMAKE_CONFIGURATION_TYPES)
46-
STRING(REGEX REPLACE ";" " " wo_semicolumn "${ARGN}")
28+
29+
IF(WIN32)
30+
STRING(REGEX REPLACE ":" " " wo_semicolon "${ARGN}")
31+
ELSE(WIN32)
32+
STRING(REGEX REPLACE ";" " " wo_semicolon "${ARGN}")
33+
ENDIF(WIN32)
34+
4735
FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${TESTNAME}.cmake
4836
"
49-
SET(ENV{PYTHONPATH} ${pyenv}:\$ENV{PYTHONPATH})
50-
SET(ENV{LD_LIBRARY_PATH} ${pyenv}:\$ENV{LD_LIBRARY_PATH})
51-
MESSAGE(\"${pyenv}\")
52-
EXECUTE_PROCESS(
53-
COMMAND ${PYTHON_EXECUTABLE} ${loc} ${wo_semicolumn}
54-
#WORKING_DIRECTORY @LIBRARY_OUTPUT_PATH@
55-
RESULT_VARIABLE import_res
56-
OUTPUT_VARIABLE import_output
57-
ERROR_VARIABLE import_output
58-
)
59-
60-
# Pass the output back to ctest
61-
IF(import_output)
62-
MESSAGE("\${import_output}")
63-
ENDIF(import_output)
64-
IF(import_res)
65-
MESSAGE(SEND_ERROR "\${import_res}")
66-
ENDIF(import_res)
37+
IF(WIN32)
38+
SET(ENV{QGIS_PREFIX_PATH} \"${QGIS_OUTPUT_DIRECTORY}/bin/${CMAKE_BUILD_TYPE}\")
39+
SET(ENV{PATH} \"${QGIS_OUTPUT_DIRECTORY}/bin/${CMAKE_BUILD_TYPE};\$ENV{PATH}\")
40+
SET(ENV{PYTHONPATH} \"${QGIS_OUTPUT_DIRECTORY}/python/;\$ENV{PYTHONPATH}\")
41+
MESSAGE(\"PATH:\$ENV{PATH}\")
42+
ELSE(WIN32)
43+
SET(ENV{QGIS_PREFIX_PATH} \"${QGIS_OUTPUT_DIRECTORY}\")
44+
SET(ENV{LD_LIBRARY_PATH} \"${pyenv}:${QGIS_OUTPUT_DIRECTORY}/lib:\$ENV{LD_LIBRARY_PATH}\")
45+
SET(ENV{PYTHONPATH} \"${QGIS_OUTPUT_DIRECTORY}/python/:\$ENV{PYTHONPATH}\")
46+
MESSAGE(\"LD_LIBRARY_PATH:\$ENV{LD_LIBRARY_PATH}\")
47+
ENDIF(WIN32)
48+
MESSAGE(\"PYTHONPATH:\$ENV{PYTHONPATH}\")
49+
MESSAGE(STATUS \"Running ${PYTHON_EXECUTABLE} ${loc} ${wo_semicolon}\")
50+
EXECUTE_PROCESS(
51+
COMMAND ${PYTHON_EXECUTABLE} ${loc} ${wo_semicolumn}
52+
#WORKING_DIRECTORY @LIBRARY_OUTPUT_PATH@
53+
RESULT_VARIABLE import_res
54+
OUTPUT_VARIABLE import_output
55+
ERROR_VARIABLE import_output
56+
)
57+
# Pass the output back to ctest
58+
IF(import_output)
59+
MESSAGE("\${import_output}")
60+
ENDIF(import_output)
61+
IF(import_res)
62+
MESSAGE(SEND_ERROR "\${import_res}")
63+
ENDIF(import_res)
6764
"
6865
)
6966
ADD_TEST(${TESTNAME} ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/${TESTNAME}.cmake)

‎src/app/main.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ int main( int argc, char *argv[] )
269269
QgsDebugMsg( QString( "Android: All params stripped" ) );// Param %1" ).arg( argv[0] ) );
270270
//put all QGIS settings in the same place
271271
configpath = QDir::homePath() + QString( "/.qgis/" );
272-
QgsDebugMsg( QString( "Android: configpath set to %1" ).arg(configpath) );
272+
QgsDebugMsg( QString( "Android: configpath set to %1" ).arg( configpath ) );
273273
#elif defined(Q_WS_WIN)
274274
for ( int i = 1; i < argc; i++ )
275275
{

‎src/app/qgsdecorationitem.cpp‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ QgsDecorationItem::~QgsDecorationItem()
5353

5454
}
5555

56-
void QgsDecorationItem::update()
57-
{
56+
void QgsDecorationItem::update()
57+
{
5858
saveToProject();
59-
QgisApp::instance()->mapCanvas()->refresh();
59+
QgisApp::instance()->mapCanvas()->refresh();
6060
}
6161

6262
void QgsDecorationItem::projectRead()
@@ -70,11 +70,11 @@ void QgsDecorationItem::saveToProject()
7070
QgsDebugMsg( "Entered" );
7171
QgsProject::instance()->writeEntry( mNameConfig, "/Enabled", mEnabled );
7272
}
73-
void QgsDecorationItem::setName( const char *name )
74-
{
75-
mName = name;
73+
void QgsDecorationItem::setName( const char *name )
74+
{
75+
mName = name;
7676
mNameConfig = name;
7777
mNameConfig.remove( " " );
7878
mNameTranslated = tr( name );
79-
QgsDebugMsg( QString( "name=%1 nameconfig=%2 nametrans=%3").arg(mName).arg(mNameConfig).arg(mNameTranslated) );
79+
QgsDebugMsg( QString( "name=%1 nameconfig=%2 nametrans=%3" ).arg( mName ).arg( mNameConfig ).arg( mNameTranslated ) );
8080
}

‎src/app/qgsmaptoolfreezelabels.cpp‎

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,12 @@ void QgsMapToolFreezeLabels::showFrozenLabels( bool show )
118118
mShowFrozen = show;
119119
if ( mShowFrozen )
120120
{
121-
QgsDebugMsg( QString( "Toggling on frozen label highlighting" ));
121+
QgsDebugMsg( QString( "Toggling on frozen label highlighting" ) );
122122
highlightFrozenLabels();
123123
}
124124
else
125125
{
126-
QgsDebugMsg( QString( "Toggling off frozen label highlighting" ));
126+
QgsDebugMsg( QString( "Toggling off frozen label highlighting" ) );
127127
removeFrozenHighlights();
128128
}
129129
}
@@ -133,15 +133,15 @@ void QgsMapToolFreezeLabels::updateFrozenLabels()
133133
{
134134
if ( mShowFrozen )
135135
{
136-
QgsDebugMsg( QString( "Updating highlighting due to layer editing mode change" ));
136+
QgsDebugMsg( QString( "Updating highlighting due to layer editing mode change" ) );
137137
mCanvas->refresh();
138138
}
139139
}
140140

141141
void QgsMapToolFreezeLabels::highlightLabel( QgsVectorLayer* vlayer,
142-
const QgsLabelPosition& labelpos,
143-
const QString& id,
144-
const QColor& color )
142+
const QgsLabelPosition& labelpos,
143+
const QString& id,
144+
const QColor& color )
145145
{
146146
QgsRectangle rect = labelpos.labelRect;
147147

@@ -152,7 +152,7 @@ void QgsMapToolFreezeLabels::highlightLabel( QgsVectorLayer* vlayer,
152152
if ( vlayer->crs() != mRender->destinationCrs() )
153153
{
154154
rect = mRender->mapToLayerCoordinates( vlayer, rect );
155-
QgsDebugMsg( QString( "Reverse transform needed for highlight rectangle" ));
155+
QgsDebugMsg( QString( "Reverse transform needed for highlight rectangle" ) );
156156
}
157157
}
158158

@@ -209,9 +209,9 @@ void QgsMapToolFreezeLabels::highlightFrozenLabels()
209209
{
210210
mCurrentLabelPos = *it;
211211

212-
if( mCurrentLabelPos.isFrozen )
212+
if ( mCurrentLabelPos.isFrozen )
213213
{
214-
QString labelStringID = QString("%0|%1").arg(mCurrentLabelPos.layerID, QString::number( mCurrentLabelPos.featureId ) );
214+
QString labelStringID = QString( "%0|%1" ).arg( mCurrentLabelPos.layerID, QString::number( mCurrentLabelPos.featureId ) );
215215

216216
// don't highlight again
217217
if ( mHighlights.contains( labelStringID ) )
@@ -236,7 +236,7 @@ void QgsMapToolFreezeLabels::highlightFrozenLabels()
236236
lblcolor = QColor( 54, 129, 0, 255 );
237237
}
238238

239-
highlightLabel( vlayer, ( *it ), labelStringID, lblcolor);
239+
highlightLabel( vlayer, ( *it ), labelStringID, lblcolor );
240240
}
241241
}
242242
QApplication::restoreOverrideCursor();
@@ -253,7 +253,7 @@ void QgsMapToolFreezeLabels::removeFrozenHighlights()
253253
QApplication::restoreOverrideCursor();
254254
}
255255

256-
void QgsMapToolFreezeLabels::freezeThawLabels( const QgsRectangle& ext, QMouseEvent * e )
256+
void QgsMapToolFreezeLabels::freezeThawLabels( const QgsRectangle& ext, QMouseEvent * e )
257257
{
258258

259259
bool doThaw = e->modifiers() & Qt::ShiftModifier ? true : false;
@@ -312,10 +312,10 @@ void QgsMapToolFreezeLabels::freezeThawLabels( const QgsRectangle& ext, QMouseEv
312312
continue;
313313
}
314314

315-
QString labelStringID = QString("%0|%1").arg(mCurrentLabelPos.layerID, QString::number( mCurrentLabelPos.featureId ) );
315+
QString labelStringID = QString( "%0|%1" ).arg( mCurrentLabelPos.layerID, QString::number( mCurrentLabelPos.featureId ) );
316316

317317
// thaw label
318-
if ( mCurrentLabelPos.isFrozen && !doHide && ( doThaw || toggleThawOrFreeze ) )
318+
if ( mCurrentLabelPos.isFrozen && !doHide && ( doThaw || toggleThawOrFreeze ) )
319319
{
320320
// thaw previously frozen label (set attribute table fields to NULL)
321321
if ( freezeThawLabel( vlayer, mCurrentLabelPos, false ) )
@@ -370,8 +370,8 @@ void QgsMapToolFreezeLabels::freezeThawLabels( const QgsRectangle& ext, QMouseEv
370370
}
371371

372372
bool QgsMapToolFreezeLabels::freezeThawLabel( QgsVectorLayer* vlayer,
373-
const QgsLabelPosition& labelpos,
374-
bool freeze )
373+
const QgsLabelPosition& labelpos,
374+
bool freeze )
375375
{
376376
// skip diagrams
377377
if ( labelpos.isDiagram )

‎src/app/qgsmaptoolfreezelabels.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#include "qgscoordinatetransform.h"
2525

2626
class QgsHighlight;
27-
class QgsLabelPosition;
27+
struct QgsLabelPosition;
2828

2929
/**A map tool for freezing (writing to attribute table) and thawing label positions and rotation*/
3030
class QgsMapToolFreezeLabels: public QgsMapToolLabel
@@ -89,7 +89,7 @@ class QgsMapToolFreezeLabels: public QgsMapToolLabel
8989
const QColor& color );
9090

9191
//! Select valid labels to freeze or thaw
92-
void freezeThawLabels( const QgsRectangle& ext, QMouseEvent * e );
92+
void freezeThawLabels( const QgsRectangle& ext, QMouseEvent * e );
9393

9494
//! Freeze or thaw label relative to whether its editable
9595
bool freezeThawLabel( QgsVectorLayer* vlayer,

‎src/app/qgsrasterlayerproperties.cpp‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1547,6 +1547,7 @@ void QgsRasterLayerProperties::updatePipeList()
15471547

15481548
void QgsRasterLayerProperties::pipeItemClicked( QTreeWidgetItem * item, int column )
15491549
{
1550+
Q_UNUSED( column );
15501551
QgsDebugMsg( "Entered" );
15511552
int idx = mPipeTreeWidget->indexOfTopLevelItem( item );
15521553

@@ -1566,12 +1567,12 @@ void QgsRasterLayerProperties::updatePipeItems()
15661567
for ( int i = 0; i < pipe->size(); i++ )
15671568
{
15681569
if ( i >= mPipeTreeWidget->topLevelItemCount() ) break;
1569-
QgsRasterInterface * interface = pipe->at( i );
15701570
QTreeWidgetItem *item = mPipeTreeWidget->topLevelItem( i );
15711571
if ( !item ) continue;
15721572
// Checkboxes disabled for now, see above
1573-
/*
1574-
bool on = interface->on();
1573+
#if 0
1574+
QgsRasterInterface * iface = pipe->at( i );
1575+
bool on = iface->on();
15751576
Qt::ItemFlags flags = item->flags();
15761577
if ( pipe->canSetOn( i, !on ) )
15771578
{
@@ -1582,6 +1583,6 @@ void QgsRasterLayerProperties::updatePipeItems()
15821583
flags |= ( Qt::ItemFlags )~Qt::ItemIsUserCheckable;
15831584
}
15841585
item->setFlags( flags );
1585-
*/
1586+
#endif
15861587
}
15871588
}

‎src/app/qgsvectorlayerproperties.cpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,7 +1008,7 @@ void QgsVectorLayerProperties::saveStyleAsMenuTriggered( QAction *action )
10081008
if ( index < 0 )
10091009
return;
10101010

1011-
saveStyleAs( (StyleType) index );
1011+
saveStyleAs(( StyleType ) index );
10121012
}
10131013

10141014
void QgsVectorLayerProperties::saveStyleAs( StyleType styleType )
@@ -1029,7 +1029,7 @@ void QgsVectorLayerProperties::saveStyleAs( StyleType styleType )
10291029
}
10301030

10311031
QString myOutputFileName = QFileDialog::getSaveFileName( this, tr( "Save layer properties as style file" ),
1032-
myLastUsedDir, format );
1032+
myLastUsedDir, format );
10331033
if ( myOutputFileName.isNull() ) //dialog canceled
10341034
{
10351035
return;

‎src/app/qgsvectorlayerproperties.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ class QgsVectorLayerProperties : public QDialog, private Ui::QgsVectorLayerPrope
147147
private slots:
148148

149149
/** save the style based on selected format from the menu */
150-
void saveStyleAsMenuTriggered( QAction * );
150+
void saveStyleAsMenuTriggered( QAction * );
151151

152152
protected:
153153

‎src/core/gps/qgsqtlocationconnection.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ void QgsQtLocationConnection::startGPS()
158158
if ( locationDataSource )
159159
{
160160
locationDataSource->setPreferredPositioningMethods( QGeoPositionInfoSource::SatellitePositioningMethods ); //QGeoPositionInfoSource::AllPositioningMethods
161-
locationDataSource->setUpdateInterval(1000);
161+
locationDataSource->setUpdateInterval( 1000 );
162162
// Whenever the location data source signals that the current
163163
// position is updated, the positionUpdated function is called.
164164
QObject::connect( locationDataSource,

0 commit comments

Comments
 (0)