8 changes: 4 additions & 4 deletions scripts/prepare-commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ fi

# save original changes
if [ -d .svn ]; then
REV=$(svn info | sed -ne "s/Revision: //p")
svn diff >r$REV.diff
REV=r$(svn info | sed -ne "s/Revision: //p")
svn diff >rev-$REV.diff
elif [ -d .git ]; then
REV=$(git svn info | sed -ne "s/Revision: //p")
git diff >r$REV.diff
REV=$(git log -n1 --pretty=%H)
git diff >sha-$REV.diff
fi

ASTYLEDIFF=astyle.r$REV.diff
Expand Down
4 changes: 0 additions & 4 deletions src/app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,10 @@ SET(QGIS_APP_SRCS
qgsrastercalcdialog.cpp
qgsrasterlayerproperties.cpp
qgstextannotationdialog.cpp
qgswmssourceselect.cpp
qgsshortcutsmanager.cpp
qgssinglesymboldialog.cpp
qgssnappingdialog.cpp
qgsundowidget.cpp
qgstilescalewidget.cpp
qgstipgui.cpp
qgstipfactory.cpp
qgsuniquevaluedialog.cpp
Expand Down Expand Up @@ -212,13 +210,11 @@ SET (QGIS_APP_MOC_HDRS
qgssnappingdialog.h
qgssponsors.h
qgstextannotationdialog.h
qgstilescalewidget.h
qgstipgui.h
qgstipfactory.h
qgsundowidget.h
qgsuniquevaluedialog.h
qgsvectorlayerproperties.h
qgswmssourceselect.h
qgshandlebadlayers.h

composer/qgsattributeselectiondialog.h
Expand Down
47 changes: 2 additions & 45 deletions src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@
#include "qgssnappingdialog.h"
#include "qgssponsors.h"
#include "qgstextannotationitem.h"
#include "qgstilescalewidget.h"
#include "qgstipgui.h"
#include "qgsundowidget.h"
#include "qgsvectordataprovider.h"
Expand Down Expand Up @@ -375,7 +374,6 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, QWidget * parent,
, mSplash( splash )
, mShowProjectionTab( false )
, mPythonUtils( NULL )
, mpTileScaleWidget( NULL )
#ifdef Q_OS_WIN
, mSkipNextContextMenuEvent( 0 )
#endif
Expand Down Expand Up @@ -577,6 +575,8 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, QWidget * parent,
// request notification of FileOpen events (double clicking a file icon in Mac OS X Finder)
QgsApplication::setFileOpenEventReceiver( this );

QgsProviderRegistry::instance()->registerGuis( this );

// update windows
qApp->processEvents();

Expand Down Expand Up @@ -694,11 +694,6 @@ void QgisApp::readSettings()
// Add the recently accessed project file paths to the File menu
mRecentProjectPaths = settings.value( "/UI/recentProjectsList" ).toStringList();

// Restore state of tile scale widget
if ( settings.value( "/UI/tileScaleEnabled", false ).toBool() )
{
showTileScale();
}
// Restore state of GPS Tracker
if ( settings.value( "/gps/widgetEnabled", false ).toBool() )
{
Expand Down Expand Up @@ -800,7 +795,6 @@ void QgisApp::createActions()
connect( mActionRemoveLayer, SIGNAL( triggered() ), this, SLOT( removeLayer() ) );
connect( mActionSetLayerCRS, SIGNAL( triggered() ), this, SLOT( setLayerCRS() ) );
connect( mActionSetProjectCRSFromLayer, SIGNAL( triggered() ), this, SLOT( setProjectCRSFromLayer() ) );
connect( mActionTileScale, SIGNAL( triggered() ), this, SLOT( showTileScale() ) );
connect( mActionGpsTool, SIGNAL( triggered() ), this, SLOT( showGpsTool() ) );
connect( mActionLayerProperties, SIGNAL( triggered() ), this, SLOT( layerProperties() ) );
connect( mActionLayerSubsetString, SIGNAL( triggered() ), this, SLOT( layerSubsetString() ) );
Expand Down Expand Up @@ -1850,17 +1844,6 @@ void QgisApp::saveWindowState()
// store window geometry
settings.setValue( "/UI/geometry", saveGeometry() );

// Persist state of tile scale slider
if ( mpTileScaleWidget )
{
settings.setValue( "/UI/tileScaleEnabled", true );
delete mpTileScaleWidget;
}
else
{
settings.setValue( "/UI/tileScaleEnabled", false );
}

// Persist state of GPS Tracker
if ( mpGpsWidget )
{
Expand Down Expand Up @@ -4503,32 +4486,6 @@ void QgisApp::showGpsTool()
}
}

void QgisApp::showTileScale()
{
if ( !mpTileScaleWidget )
{
mpTileScaleWidget = new QgsTileScaleWidget( mMapCanvas );
//create the dock widget
mpTileScaleDock = new QDockWidget( tr( "Tile scale" ), this );
mpTileScaleDock->setObjectName( "TileScale" );
mpTileScaleDock->setAllowedAreas( Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea );
addDockWidget( Qt::RightDockWidgetArea, mpTileScaleDock );
// add to the Panel submenu
mPanelMenu->addAction( mpTileScaleDock->toggleViewAction() );
// now add our widget to the dock - ownership of the widget is passed to the dock
mpTileScaleDock->setWidget( mpTileScaleWidget );
mpTileScaleDock->show();

connect( mMapLegend, SIGNAL( currentLayerChanged( QgsMapLayer* ) ),
mpTileScaleWidget, SLOT( layerChanged( QgsMapLayer* ) ) );

}
else
{
mpTileScaleDock->setVisible( mpTileScaleDock->isHidden() );
}
}

void QgisApp::zoomToLayerExtent()
{
mMapLegend->legendLayerZoom();
Expand Down
8 changes: 0 additions & 8 deletions src/app/qgisapp.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ class QgsRasterLayer;
class QgsRectangle;
class QgsUndoWidget;
class QgsVectorLayer;
class QgsTileScaleWidget;

class QDomDocument;
class QNetworkReply;
Expand Down Expand Up @@ -277,7 +276,6 @@ class QgisApp : public QMainWindow, private Ui::MainWindow
QAction *actionRemoveLayer() { return mActionRemoveLayer; }
QAction *actionSetLayerCRS() { return mActionSetLayerCRS; }
QAction *actionSetProjectCRSFromLayer() { return mActionSetProjectCRSFromLayer; }
QAction *actionTileScale() { return mActionTileScale; }
QAction *actionGpsTool() { return mActionGpsTool; }
QAction *actionLayerProperties() { return mActionLayerProperties; }
QAction *actionLayerSubsetString() { return mActionLayerSubsetString; }
Expand Down Expand Up @@ -487,8 +485,6 @@ class QgisApp : public QMainWindow, private Ui::MainWindow
void setProjectCRSFromLayer();
//! Show GPS tool
void showGpsTool();
//! Show tile scale slider
void showTileScale();
//! zoom to extent of layer
void zoomToLayerExtent();
//! zoom to actual size of raster layer
Expand Down Expand Up @@ -904,7 +900,6 @@ class QgisApp : public QMainWindow, private Ui::MainWindow
// docks ------------------------------------------
QDockWidget *mLegendDock;
QDockWidget *mOverviewDock;
QDockWidget *mpTileScaleDock;
QDockWidget *mpGpsDock;


Expand Down Expand Up @@ -1063,9 +1058,6 @@ class QgisApp : public QMainWindow, private Ui::MainWindow

QgsSnappingDialog* mSnappingDialog;

//! Persistent tile scale slider
QgsTileScaleWidget * mpTileScaleWidget;

int mLastComposerId;

#ifdef Q_OS_WIN
Expand Down
35 changes: 31 additions & 4 deletions src/core/qgscoordinatereferencesystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,16 +128,25 @@ bool QgsCoordinateReferenceSystem::createFromString( const QString theDefinition

bool QgsCoordinateReferenceSystem::createFromOgcWmsCrs( QString theCrs )
{
QRegExp re( "(user|custom|qgis):(\\d+)", Qt::CaseInsensitive );
if ( re.exactMatch( theCrs ) && createFromSrsId( re.cap( 2 ).toInt() ) )
QRegExp re( "urn:ogc:def:crs:([^:]+).+([^:]+)", Qt::CaseInsensitive );
if ( re.exactMatch( theCrs ) )
{
return true;
theCrs = re.cap( 1 ) + ":" + re.cap( 2 );
}
else
{
re.setPattern( "(user|custom|qgis):(\\d+)" );
if ( re.exactMatch( theCrs ) && createFromSrsId( re.cap( 2 ).toInt() ) )
{
return true;
}
}

if ( loadFromDb( QgsApplication::srsDbFilePath(), "lower(auth_name||':'||auth_id)", theCrs.toLower() ) )
return true;

if ( theCrs.compare( "CRS:84", Qt::CaseInsensitive ) == 0 )
if ( theCrs.compare( "CRS:84", Qt::CaseInsensitive ) == 0 ||
theCrs.compare( "OGC:CRS84", Qt::CaseInsensitive ) == 0 )
{
createFromSrsId( GEOCRS_ID );
return true;
Expand All @@ -161,6 +170,7 @@ QgsCoordinateReferenceSystem& QgsCoordinateReferenceSystem::operator=( const Qgs
mDescription = srs.mDescription;
mProjectionAcronym = srs.mProjectionAcronym;
mEllipsoidAcronym = srs.mEllipsoidAcronym;
mAxisInverted = srs.mAxisInverted;
mGeoFlag = srs.mGeoFlag;
mMapUnits = srs.mMapUnits;
mSRID = srs.mSRID;
Expand Down Expand Up @@ -258,6 +268,7 @@ bool QgsCoordinateReferenceSystem::loadFromDb( QString db, QString expression, Q
mSRID = QString::fromUtf8(( char * )sqlite3_column_text( myPreparedStatement, 5 ) ).toLong();
mAuthId = QString::fromUtf8(( char * )sqlite3_column_text( myPreparedStatement, 6 ) );
mGeoFlag = QString::fromUtf8(( char * )sqlite3_column_text( myPreparedStatement, 7 ) ).toInt() != 0;
mAxisInverted = -1;

if ( mSrsId >= USER_CRS_START_ID && mAuthId.isEmpty() )
{
Expand Down Expand Up @@ -745,6 +756,22 @@ bool QgsCoordinateReferenceSystem::geographicFlag() const
return mGeoFlag;
}

bool QgsCoordinateReferenceSystem::axisInverted() const
{
if ( mAxisInverted == -1 )
{
OGRAxisOrientation orientation;
const char *axis0 = OSRGetAxis( mCRS, mGeoFlag ? "GEOGCS" : "PROJCS", 0, &orientation );
mAxisInverted = mGeoFlag
? ( orientation == OAO_East || orientation == OAO_West || orientation == OAO_Other )
: ( orientation == OAO_North || orientation == OAO_South );
QgsDebugMsg( QString( "srid:%1 axis0:%2 orientation:%3 inverted:%4" ).arg( mSRID ).arg( axis0 ).arg( OSRAxisEnumToName( orientation ) ).arg( mAxisInverted ) );
Q_UNUSED( axis0 );
}

return mAxisInverted != 0;
}

QGis::UnitType QgsCoordinateReferenceSystem::mapUnits() const
{
return mMapUnits;
Expand Down
9 changes: 9 additions & 0 deletions src/core/qgscoordinatereferencesystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,12 @@ class CORE_EXPORT QgsCoordinateReferenceSystem
*/
bool geographicFlag() const;

/*! return if axis is inverted (eg. for WMS 1.3)
* @return bool Whether this is crs axis is inverted
* @note added in 1.9.90
*/
bool axisInverted() const;

/*! Get the units that the projection is in
* @return QGis::UnitType that gives the units for the coordinate system
*/
Expand Down Expand Up @@ -426,6 +432,9 @@ class CORE_EXPORT QgsCoordinateReferenceSystem

QString mValidationHint;

//!Whether this is a coordinate system has inverted axis
mutable int mAxisInverted;

static CUSTOM_CRS_VALIDATION mCustomSrsValidation;
};

Expand Down
2 changes: 2 additions & 0 deletions src/core/qgsproviderregistry.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ class CORE_EXPORT QgsProviderRegistry
/** type for data provider metadata associative container */
typedef std::map<QString, QgsProviderMetadata*> Providers;

void registerGuis( QWidget *widget );

private:

/** ctor private since instance() creates it */
Expand Down
1 change: 1 addition & 0 deletions src/core/spatialindex/storagemanager/DiskStorageManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
#include <unistd.h>
#include <cstring>

#ifdef WIN32
Expand Down
1 change: 1 addition & 0 deletions src/core/spatialindex/tools/TemporaryFile.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
// mhadji@gmail.com

#include <stdio.h>
#include <unistd.h>

#include <Tools.h>

Expand Down
1 change: 1 addition & 0 deletions src/gui/qgsmapcanvas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ QgsMapCanvas::QgsMapCanvas( QWidget * parent, const char *name )
, mPainting( false )
, mAntiAliasing( false )
{
setObjectName( name );
//disable the update that leads to the resize crash
if ( viewport() )
{
Expand Down
24 changes: 21 additions & 3 deletions src/providers/wms/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,37 @@

SET (WMS_SRCS qgswmsprovider.cpp)
SET (WMS_MOC_HDRS qgswmsprovider.h)
SET (WMS_SRCS
qgswmsprovider.cpp
qgswmssourceselect.cpp
qgstilescalewidget.cpp
qgswmtsdimensions.cpp
../../app/qgsnewhttpconnection.cpp
../../app/qgsnumericsortlistviewitem.cpp
../../app/qgsmanageconnectionsdialog.cpp
)
SET (WMS_MOC_HDRS
qgswmsprovider.h
qgswmssourceselect.h
qgstilescalewidget.h
qgswmtsdimensions.h
../../app/qgsnewhttpconnection.h
../../app/qgsnumericsortlistviewitem.h
../../app/qgsmanageconnectionsdialog.h
)

QT4_WRAP_CPP (WMS_MOC_SRCS ${WMS_MOC_HDRS})

INCLUDE_DIRECTORIES( .
${CMAKE_CURRENT_BINARY_DIR}/../../ui
../../core
../../core/raster
../../gui
${GDAL_INCLUDE_DIR}
)

ADD_LIBRARY(wmsprovider MODULE ${WMS_SRCS} ${WMS_MOC_SRCS})

TARGET_LINK_LIBRARIES(wmsprovider
qgis_core
qgis_gui
)

INSTALL (TARGETS wmsprovider
Expand Down
Loading