diff --git a/CMakeLists.txt b/CMakeLists.txt index 200bf180ea9..f0db54a93ef 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -60,6 +60,9 @@ SET (WITH_MAPSERVER FALSE CACHE BOOL "Determines whether QGIS mapserver should b # include doxygen documentation SET (WITH_APIDOC FALSE CACHE BOOL "Determines whether the QGIS API doxygen documentation should be built") +# build our version of astyle +SET (WITH_ASTYLE FALSE CACHE BOOL "If you plan to contribute you should reindent with scripts/prepare-commit.sh (using 'our' astyle)") + # try to configure and build POSTGRESQL support SET (WITH_POSTGRESQL TRUE CACHE BOOL "Determines whether POSTGRESQL support should be built") IF (WITH_POSTGRESQL) @@ -446,12 +449,21 @@ FIND_FILE(GIT_MARKER index PATHS ${CMAKE_SOURCE_DIR}/.git) IF (GIT_MARKER) FIND_PROGRAM(GIT git PATHS c:/cygwin/bin) IF(GIT) - ADD_CUSTOM_COMMAND( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/qgsversion.h - COMMAND echo \\\#define QGSVERSION \\\"$$\( ${GIT} log -n1 --pretty=%h \)\\\" >${CMAKE_CURRENT_BINARY_DIR}/qgsversion.h - MAIN_DEPENDENCY ${GIT_MARKER} - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} - ) + IF(MSVC) + ADD_CUSTOM_COMMAND( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/qgsversion.h + COMMAND for /f \"usebackq tokens=1\" %%a in (`\"${GIT}\" log -n1 --oneline`) do echo \#define QGSVERSION \"%%a\" >${CMAKE_CURRENT_BINARY_DIR}/qgsversion.h + MAIN_DEPENDENCY ${GIT_MARKER} + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + ) + ELSE(MSVC) + ADD_CUSTOM_COMMAND( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/qgsversion.h + COMMAND echo \\\#define QGSVERSION \\\"$$\( ${GIT} log -n1 --pretty=%h \)\\\" >${CMAKE_CURRENT_BINARY_DIR}/qgsversion.h + MAIN_DEPENDENCY ${GIT_MARKER} + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + ) + ENDIF(MSVC) ELSE(GIT) MESSAGE(STATUS "git marker, but no git found - version will be unknown") FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/qgsversion.h "#define QGSVERSION \"unknown\"") diff --git a/ms-windows/osgeo4w/package-nightly.cmd b/ms-windows/osgeo4w/package-nightly.cmd index 8dae52d1d5e..88a353a7414 100755 --- a/ms-windows/osgeo4w/package-nightly.cmd +++ b/ms-windows/osgeo4w/package-nightly.cmd @@ -90,6 +90,7 @@ cmake -G "Visual Studio 9 2008" ^ -D PEDANTIC=TRUE ^ -D WITH_SPATIALITE=TRUE ^ -D WITH_MAPSERVER=TRUE ^ + -D WITH_ASTYLE=TRUE ^ -D WITH_INTERNAL_SPATIALITE=TRUE ^ -D CMAKE_BUILD_TYPE=%BUILDCONF% ^ -D CMAKE_CONFIGURATION_TYPES=%BUILDCONF% ^ diff --git a/python/core/qgsgeometry.sip b/python/core/qgsgeometry.sip index 2d620ca51c9..ae805d8a060 100644 --- a/python/core/qgsgeometry.sip +++ b/python/core/qgsgeometry.sip @@ -214,7 +214,8 @@ class QgsGeometry /**Adds a new island polygon to a multipolygon feature @return 0 in case of success, 1 if not a multipolygon, 2 if ring is not a valid geometry, 3 if new polygon ring \ not disjoint with existing polygons of the feature*/ - int addIsland(const QList& ring); + int addPart(const QList& ring); + int addIsland( const QList &ring ) /Deprecated/; /**Translate this geometry by dx, dy @return 0 in case of success*/ diff --git a/python/utils.py b/python/utils.py index b630201587e..f6711ab3977 100755 --- a/python/utils.py +++ b/python/utils.py @@ -24,7 +24,7 @@ def showException(type, value, tb, msg): for s in lst: txt += s.decode('utf-8', 'replace') txt += '
%s
%s

' % (QCoreApplication.translate('Python','Python version:'), sys.version) - txt += '
%s
%s %s, %s

' % (QCoreApplication.translate('Python','QGIS version:'), QGis.QGIS_VERSION, QGis.QGIS_RELEASE_NAME, QGis.QGIS_SVN_VERSION) + txt += '
%s
%s %s, %s

' % (QCoreApplication.translate('Python','QGIS version:'), QGis.QGIS_VERSION, QGis.QGIS_RELEASE_NAME, QGis.QGIS_DEV_VERSION) txt += '%s %s' % (QCoreApplication.translate('Python','Python path:'), str(sys.path)) txt = txt.replace('\n', '
') txt = txt.replace(' ', '  ') # preserve whitespaces for nicer output diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 115b6398f7b..f433e004888 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,4 +1,4 @@ -SUBDIRS(astyle core analysis ui gui app providers plugins helpviewer crssync) +SUBDIRS(core analysis ui gui app providers plugins helpviewer crssync) IF (WITH_BINDINGS) SUBDIRS(python) @@ -8,6 +8,10 @@ IF (WITH_MAPSERVER) SUBDIRS(mapserver) ENDIF (WITH_MAPSERVER) +IF (WITH_ASTYLE) + SUBDIRS(astyle) +ENDIF(WITH_ASTYLE) + IF (APPLE) SUBDIRS(mac) ENDIF(APPLE) diff --git a/src/app/attributetable/qgsattributetabledialog.cpp b/src/app/attributetable/qgsattributetabledialog.cpp index ab10eaca028..64662fdf70a 100644 --- a/src/app/attributetable/qgsattributetabledialog.cpp +++ b/src/app/attributetable/qgsattributetabledialog.cpp @@ -84,17 +84,17 @@ QgsAttributeTableDialog::QgsAttributeTableDialog( QgsVectorLayer *theLayer, QWid updateTitle(); - mRemoveSelectionButton->setIcon( getThemeIcon( "/mActionUnselectAttributes.png" ) ); - mSelectedToTopButton->setIcon( getThemeIcon( "/mActionSelectedToTop.png" ) ); - mCopySelectedRowsButton->setIcon( getThemeIcon( "/mActionCopySelected.png" ) ); - mZoomMapToSelectedRowsButton->setIcon( getThemeIcon( "/mActionZoomToSelected.png" ) ); - mInvertSelectionButton->setIcon( getThemeIcon( "/mActionInvertSelection.png" ) ); - mToggleEditingButton->setIcon( getThemeIcon( "/mActionToggleEditing.png" ) ); - mSaveEditsButton->setIcon( getThemeIcon( "/mActionSaveEdits.png" ) ); - mDeleteSelectedButton->setIcon( getThemeIcon( "/mActionDeleteSelected.png" ) ); - mOpenFieldCalculator->setIcon( getThemeIcon( "/mActionCalculateField.png" ) ); - mAddAttribute->setIcon( getThemeIcon( "/mActionNewAttribute.png" ) ); - mRemoveAttribute->setIcon( getThemeIcon( "/mActionDeleteAttribute.png" ) ); + mRemoveSelectionButton->setIcon( QgisApp::getThemeIcon( "/mActionUnselectAttributes.png" ) ); + mSelectedToTopButton->setIcon( QgisApp::getThemeIcon( "/mActionSelectedToTop.png" ) ); + mCopySelectedRowsButton->setIcon( QgisApp::getThemeIcon( "/mActionCopySelected.png" ) ); + mZoomMapToSelectedRowsButton->setIcon( QgisApp::getThemeIcon( "/mActionZoomToSelected.png" ) ); + mInvertSelectionButton->setIcon( QgisApp::getThemeIcon( "/mActionInvertSelection.png" ) ); + mToggleEditingButton->setIcon( QgisApp::getThemeIcon( "/mActionToggleEditing.png" ) ); + mSaveEditsButton->setIcon( QgisApp::getThemeIcon( "/mActionSaveEdits.png" ) ); + mDeleteSelectedButton->setIcon( QgisApp::getThemeIcon( "/mActionDeleteSelected.png" ) ); + mOpenFieldCalculator->setIcon( QgisApp::getThemeIcon( "/mActionCalculateField.png" ) ); + mAddAttribute->setIcon( QgisApp::getThemeIcon( "/mActionNewAttribute.png" ) ); + mRemoveAttribute->setIcon( QgisApp::getThemeIcon( "/mActionDeleteAttribute.png" ) ); // toggle editing bool canChangeAttributes = mLayer->dataProvider()->capabilities() & QgsVectorDataProvider::ChangeAttributeValues; @@ -173,28 +173,6 @@ void QgsAttributeTableDialog::closeEvent( QCloseEvent* event ) } -QIcon QgsAttributeTableDialog::getThemeIcon( const QString theName ) -{ - // copied from QgisApp::getThemeIcon. To be removed when merged to SVN - - QString myPreferredPath = QgsApplication::activeThemePath() + QDir::separator() + theName; - QString myDefaultPath = QgsApplication::defaultThemePath() + QDir::separator() + theName; - if ( QFile::exists( myPreferredPath ) ) - { - return QIcon( myPreferredPath ); - } - else if ( QFile::exists( myDefaultPath ) ) - { - //could still return an empty icon if it - //doesnt exist in the default theme either! - return QIcon( myDefaultPath ); - } - else - { - return QIcon(); - } -} - void QgsAttributeTableDialog::showAdvanced() { mMenuActions->exec( QCursor::pos() ); diff --git a/src/app/attributetable/qgsattributetabledialog.h b/src/app/attributetable/qgsattributetabledialog.h index a4904d73998..26dc25b5b7f 100644 --- a/src/app/attributetable/qgsattributetabledialog.h +++ b/src/app/attributetable/qgsattributetabledialog.h @@ -202,8 +202,6 @@ class QgsAttributeTableDialog : public QDialog, private Ui::QgsAttributeTableDia */ void updateTitle(); - QIcon getThemeIcon( const QString theName ); - QLineEdit *mQuery; QComboBox *mColumnBox; QComboBox *mShowBox; diff --git a/src/app/qgisapp.cpp b/src/app/qgisapp.cpp old mode 100644 new mode 100755 index 0b7ce3f647b..39f650d3d78 --- a/src/app/qgisapp.cpp +++ b/src/app/qgisapp.cpp @@ -274,7 +274,7 @@ static void setTitleBarText_( QWidget & qgisApp ) if ( QString( QGis::QGIS_VERSION ).endsWith( "Trunk" ) ) { - caption += QString( "r%1" ).arg( QGis::QGIS_DEV_VERSION ); + caption += QString( "%1" ).arg( QGis::QGIS_DEV_VERSION ); } else { @@ -4724,7 +4724,7 @@ void QgisApp::socketConnectionClosed() { // show more info QgsMessageViewer *mv = new QgsMessageViewer( this ); - mv->setWindowTitle( tr( "QGIS - Changes in SVN since last release" ) ); + mv->setWindowTitle( tr( "QGIS - Changes since last release" ) ); mv->setMessageAsHtml( parts[2] ); mv->exec(); } diff --git a/src/app/qgsmaptooladdfeature.cpp b/src/app/qgsmaptooladdfeature.cpp index 385cf8b5e00..ba231136135 100644 --- a/src/app/qgsmaptooladdfeature.cpp +++ b/src/app/qgsmaptooladdfeature.cpp @@ -119,7 +119,7 @@ void QgsMapToolAddFeature::canvasReleaseEvent( QMouseEvent * e ) { QgsFeature* f = new QgsFeature( 0, "WKBPoint" ); - QgsGeometry *g; + QgsGeometry *g = 0; if ( layerWKBType == QGis::WKBPoint || layerWKBType == QGis::WKBPoint25D ) { g = QgsGeometry::fromPoint( savePoint ); diff --git a/src/core/qgis.cpp b/src/core/qgis.cpp index 202b6e252fe..4304750952c 100644 --- a/src/core/qgis.cpp +++ b/src/core/qgis.cpp @@ -16,7 +16,7 @@ * * ***************************************************************************/ #include "qgis.h" -#ifndef QGSSVNVERSION +#ifndef QGSVERSION #include "qgsversion.h" #endif @@ -28,7 +28,7 @@ // Version string const char* QGis::QGIS_VERSION = VERSION; -// SVN version +// development version const char* QGis::QGIS_DEV_VERSION = QGSVERSION; // Version number used for comparing versions using the diff --git a/src/core/qgscoordinatereferencesystem.cpp b/src/core/qgscoordinatereferencesystem.cpp index 9b99c76622f..509b65f38d2 100644 --- a/src/core/qgscoordinatereferencesystem.cpp +++ b/src/core/qgscoordinatereferencesystem.cpp @@ -1411,7 +1411,7 @@ int QgsCoordinateReferenceSystem::syncDb() // 4.7.0 has a bug that crashes after 16 consecutive pj_init_plus with different strings else { - input = QString( "+init=%1:%2" ).arg( QString( auth_name ).toLower() ).arg( auth_id ); + QString input = QString( "+init=%1:%2" ).arg( QString( auth_name ).toLower() ).arg( auth_id ); projPJ pj = pj_init_plus( input.toAscii() ); if ( !pj ) { diff --git a/src/core/qgsgeometry.h b/src/core/qgsgeometry.h index 138f25be8aa..be790412324 100644 --- a/src/core/qgsgeometry.h +++ b/src/core/qgsgeometry.h @@ -255,7 +255,7 @@ class CORE_EXPORT QgsGeometry @return 0 in case of success, 1 if not a multipolygon, 2 if ring is not a valid geometry, 3 if new polygon ring not disjoint with existing polygons of the feature*/ int addPart( const QList &points ); - Q_DECL_DEPRECATED int addIsland( const QList &points ); + Q_DECL_DEPRECATED int addIsland( const QList &points ) { return addPart( points ); } /**Translate this geometry by dx, dy @return 0 in case of success*/