4 changes: 2 additions & 2 deletions debian/changelog
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ qgis (1.9.90) UNRELEASED; urgency=low
* add mssqlprovider plugin
* copyright & policy update (synced from debiangis)
* run crssync in postinst
* switch from test with check target instead of test
* run tests with xvfb and upload to results to (c)dashboard

-- Jürgen E. Fischer <jef@norbit.de> Sat, 14 Apr 2012 10:39:28 +0200
-- Jürgen E. Fischer <jef@norbit.de> Wed, 18 Apr 2012 20:50:12 +0200

qgis (1.8.0) UNRELEASED; urgency=low

Expand Down
3 changes: 2 additions & 1 deletion debian/control.lucid
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ Build-Depends:
git-core,
doxygen,
graphviz,
txt2tags
txt2tags,
xvfb, xauth, xfonts-base
Build-Conflicts: libqgis-dev, qgis-dev
Standards-Version: 3.8.4
XS-Python-Version: current
Expand Down
3 changes: 2 additions & 1 deletion debian/control.maverick
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ Build-Depends:
git,
doxygen,
graphviz,
txt2tags
txt2tags,
xvfb, xauth, xfonts-base
Build-Conflicts: libqgis-dev, qgis-dev
Standards-Version: 3.8.4
XS-Python-Version: current
Expand Down
3 changes: 2 additions & 1 deletion debian/control.natty
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ Build-Depends:
git,
doxygen,
graphviz,
txt2tags
txt2tags,
xvfb, xauth, xfonts-base
Build-Conflicts: libqgis-dev, qgis-dev
Standards-Version: 3.8.4
XS-Python-Version: current
Expand Down
3 changes: 2 additions & 1 deletion debian/control.oneiric
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ Build-Depends:
git,
doxygen,
graphviz,
txt2tags
txt2tags,
xvfb, xauth, xfonts-base
Build-Conflicts: libqgis-dev, qgis-dev
Standards-Version: 3.8.4
XS-Python-Version: current
Expand Down
3 changes: 2 additions & 1 deletion debian/control.precise
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ Build-Depends:
git,
doxygen,
graphviz,
txt2tags
txt2tags,
xvfb, xauth, xfonts-base
Build-Conflicts: libqgis-dev, qgis-dev
Standards-Version: 3.8.4
XS-Python-Version: current
Expand Down
5 changes: 3 additions & 2 deletions debian/control.sid
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ Build-Depends:
git,
doxygen,
graphviz,
txt2tags
txt2tags,
xvfb, xauth, xfonts-base
Build-Conflicts: libqgis-dev, qgis-dev
Standards-Version: 3.9.3
X-Python-Version: current
Expand Down Expand Up @@ -129,7 +130,7 @@ Description: GRASS plugin for Quantum GIS - architecture-independent data
Package: python-qgis
Section: python
Architecture: any
Depends: python-qt4 (>=4.1.0), python-sip (>= 4.5.0), python-qgis-common (= ${source:Version}), ${shlibs:Depends}, ${misc:Depends}, ${python:Depends}
Depends: python-qt4 (>=4.1.0), python-sip (>= 4.5.0), python-qgis-common (= ${source:Version}), python-pyspatialite, ${shlibs:Depends}, ${misc:Depends}, ${python:Depends}
Description: Python bindings to Quantum GIS
Quantum GIS is a Geographic Information System (GIS) which manages, analyzes
and display databases of geographic information.
Expand Down
3 changes: 2 additions & 1 deletion debian/control.squeeze
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ Build-Depends:
git,
doxygen,
graphviz,
txt2tags
txt2tags,
xvfb, xauth, xfonts-base
Build-Conflicts: libqgis-dev, qgis-dev
Standards-Version: 3.8.4
XS-Python-Version: current
Expand Down
3 changes: 2 additions & 1 deletion debian/control.wheezy
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ Build-Depends:
git,
doxygen,
graphviz,
txt2tags
txt2tags,
xvfb, xauth, xfonts-base
Build-Conflicts: libqgis-dev, qgis-dev
Standards-Version: 3.9.3
X-Python-Version: current
Expand Down
8 changes: 7 additions & 1 deletion debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)

DEB_TEST_TARGET ?= Experimental

DISTRIBUTION := $(shell dpkg-parsechangelog --format rfc822 | sed -ne "s/^Distribution: //p")
ifneq ($(DISTRIBUTION),$(findstring $(DISTRIBUTION),"lenny squeeze wheezy lucid maverick natty oneiric precise"))
DISTRIBUTION := sid
Expand All @@ -32,6 +34,10 @@ CMAKE_OPTS := \
-D QGIS_CGIBIN_SUBDIR=/usr/lib/cgi-bin \
-D WITH_APIDOC=TRUE

ifneq (,$(findstring $(DISTRIBUTION),"sid"))
-D WITH_PYSPATIALITE=FALSE
endif

ifneq (,$(findstring $(DISTRIBUTION),"lenny squeeze lucid maverick natty oneiric"))
CMAKE_OPTS += -D WITH_INTERNAL_SPATIALITE=TRUE
else
Expand Down Expand Up @@ -104,7 +110,7 @@ build-stamp: debian/build/CMakeCache.txt

ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
# Code to run the package test suite - and ignore the outcome for now
LD_LIBRARY_PATH=$(PWD)/debian/build/output/lib:$(LD_LIBRARY_PATH) $(MAKE) -C debian/build check || true
LD_LIBRARY_PATH=$(PWD)/debian/build/output/lib:$(LD_LIBRARY_PATH) xvfb-run -a -n 1 -s "-screen 0 1280x1024x24" $(MAKE) -C debian/build $(DEB_TEST_TARGET) || true
else
echo Skipping tests.
endif
Expand Down
19 changes: 14 additions & 5 deletions python/core/qgsrasterlayer.sip
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,15 @@ public:
bool loadDefaultStyleFlag = true );

/** \brief [ data provider interface ] Constructor in provider mode */
QgsRasterLayer( const QString & uri,
const QString & baseName,
const QString & providerKey,
bool loadDefaultStyleFlag = true );
QgsRasterLayer( int dummy,
const QString & baseName = QString(),
const QString & path = QString(),
const QString & providerLib = QString(),
const QStringList & layers = QStringList(),
const QStringList & styles = QStringList(),
const QString & format = QString(),
const QString & crs = QString());


/** \brief The destructor */
~QgsRasterLayer();
Expand Down Expand Up @@ -190,7 +195,11 @@ public:
QString redBandName();

/** [ data provider interface ] Set the data provider */
void setDataProvider( const QString & provider );
void setDataProvider( const QString & provider,
const QStringList & layers,
const QStringList & styles,
const QString & format,
const QString & crs );

/** \brief Mutator for drawing style */
void setDrawingStyle( const DrawingStyle & theDrawingStyle );
Expand Down
2 changes: 1 addition & 1 deletion python/gui/qgisinterface.sip
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class QgisInterface : QObject
//! Add a raster layer given a raster layer file name
virtual QgsRasterLayer* addRasterLayer(QString rasterLayerPath, QString baseName = QString())=0;
//! Add a WMS layer
virtual QgsRasterLayer* addRasterLayer(const QString& uri, const QString& baseName, const QString& providerKey) = 0;
virtual QgsRasterLayer* addRasterLayer(const QString& url, const QString& layerName, const QString& providerKey, const QStringList& layers, const QStringList& styles, const QString& format, const QString& crs) = 0;

//! Add a project
virtual bool addProject(QString theProject)=0;
Expand Down
52 changes: 42 additions & 10 deletions src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,7 @@ void QgisApp::dropEvent( QDropEvent *event )
}
else if ( u.layerType == "raster" )
{
addRasterLayer( u.uri, u.name, u.providerKey );
addRasterLayer( u.uri, u.name, u.providerKey, QStringList(), QStringList(), QString(), QString() );
}
}
}
Expand Down Expand Up @@ -2631,8 +2631,10 @@ void QgisApp::addWmsLayer()
QMessageBox::warning( this, tr( "WMS" ), tr( "Cannot get WMS select dialog from provider." ) );
return;
}
connect( wmss , SIGNAL( addRasterLayer( QString const &, QString const &, QString const & ) ),
this , SLOT( addRasterLayer( QString const &, QString const &, QString const & ) ) );
connect( wmss , SIGNAL( addRasterLayer( QString const &, QString const &, QString const &, QStringList const &, QStringList const &, QString const &,
QString const & ) ),
this , SLOT( addRasterLayer( QString const &, QString const &, QString const &, QStringList const &, QStringList const &, QString const &,
QString const & ) ) );
wmss->exec();
delete wmss;
}
Expand Down Expand Up @@ -6803,17 +6805,22 @@ QgsRasterLayer* QgisApp::addRasterLayer( QString const & rasterFile, QString con

/** Add a raster layer directly without prompting user for location
The caller must provide information compatible with the provider plugin
using the uri and baseName. The provider can use these
using the rasterLayerPath and baseName. The provider can use these
parameters in any way necessary to initialize the layer. The baseName
parameter is used in the Map Legend so it should be formed in a meaningful
way.
\note Copied from the equivalent addVectorLayer function in this file
TODO Make it work for rasters specifically.
*/
QgsRasterLayer* QgisApp::addRasterLayer(
QString const &uri,
QString const &rasterLayerPath,
QString const &baseName,
QString const &providerKey )
QString const &providerKey,
QStringList const & layers,
QStringList const & styles,
QString const &format,
QString const &crs )
{
QgsDebugMsg( "about to get library for " + providerKey );

Expand All @@ -6824,21 +6831,42 @@ QgsRasterLayer* QgisApp::addRasterLayer(

mMapCanvas->freeze();

// Let render() do its own cursor management
// QApplication::setOverrideCursor(Qt::WaitCursor);

// create the layer
QgsRasterLayer *layer;
QgsDebugMsg( "Creating new raster layer using " + uri
+ " with baseName of " + baseName );
/* Eliminate the need to instantiate the layer based on provider type.
The caller is responsible for cobbling together the needed information to
open the layer
*/
QgsDebugMsg( "Creating new raster layer using " + rasterLayerPath
+ " with baseName of " + baseName
+ " and layer list of " + layers.join( ", " )
+ " and style list of " + styles.join( ", " )
+ " and format of " + format
+ " and providerKey of " + providerKey
+ " and CRS of " + crs );

// TODO: Remove the 0 when the raster layer becomes a full provider gateway.
layer = new QgsRasterLayer( uri, baseName, providerKey );
layer = new QgsRasterLayer( 0, rasterLayerPath, baseName, providerKey, layers, styles, format, crs );

QgsDebugMsg( "Constructed new layer." );

if ( layer && layer->isValid() )
if ( layer && shouldAskUserForGDALSublayers( layer ) )
{
askUserForGDALSublayers( layer );

// The first layer loaded is not useful in that case. The user can select it in
// the list if he wants to load it.
delete layer;
}
else if ( layer && layer->isValid() )
{
addRasterLayer( layer );

statusBar()->showMessage( mMapCanvas->extent().toString( 2 ) );

}
else
{
Expand All @@ -6853,6 +6881,10 @@ QgsRasterLayer* QgisApp::addRasterLayer(
mMapCanvas->refresh();

return layer;

// Let render() do its own cursor management
// QApplication::restoreOverrideCursor();

} // QgisApp::addRasterLayer


Expand Down
15 changes: 11 additions & 4 deletions src/app/qgisapp.h
Original file line number Diff line number Diff line change
Expand Up @@ -469,9 +469,16 @@ class QgisApp : public QMainWindow, private Ui::MainWindow
virtual bool event( QEvent * event );

/** Open a raster layer using the Raster Data Provider.
* \note added in 1.9
* Note this is included to support WMS layers only at this stage,
* GDAL layer support via a Provider is not yet implemented.
*/
QgsRasterLayer* addRasterLayer( QString const & uri, QString const & baseName, QString const & providerKey );
QgsRasterLayer* addRasterLayer( QString const & rasterLayerPath,
QString const & baseName,
QString const & providerKey,
QStringList const & layers,
QStringList const & styles,
QString const & format,
QString const & crs );

void addWfsLayer( QString uri, QString typeName );

Expand Down Expand Up @@ -1194,8 +1201,8 @@ class QgisApp : public QMainWindow, private Ui::MainWindow
QString mOldScale;

#ifdef HAVE_TOUCH
bool gestureEvent( QGestureEvent *event );
void tapAndHoldTriggered( QTapAndHoldGesture *gesture );
bool gestureEvent(QGestureEvent *event);
void tapAndHoldTriggered(QTapAndHoldGesture *gesture);
#endif
};

Expand Down
5 changes: 3 additions & 2 deletions src/app/qgisappinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,10 @@ QgsRasterLayer* QgisAppInterface::addRasterLayer( QString rasterLayerPath, QStri
return qgis->addRasterLayer( rasterLayerPath, baseName );
}

QgsRasterLayer* QgisAppInterface::addRasterLayer( const QString& url, const QString& baseName, const QString& providerKey )
QgsRasterLayer* QgisAppInterface::addRasterLayer( const QString& url, const QString& baseName, const QString& providerKey,
const QStringList& layers, const QStringList& styles, const QString& format, const QString& crs )
{
return qgis->addRasterLayer( url, baseName, providerKey );
return qgis->addRasterLayer( url, baseName, providerKey, layers, styles, format, crs );
}

bool QgisAppInterface::addProject( QString theProjectName )
Expand Down
3 changes: 2 additions & 1 deletion src/app/qgisappinterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ class QgisAppInterface : public QgisInterface
//! Add a raster layer given its file name
QgsRasterLayer* addRasterLayer( QString rasterLayerPath, QString baseName );
//! Add a WMS layer
QgsRasterLayer* addRasterLayer( const QString& url, const QString& baseName, const QString& providerKey );
QgsRasterLayer* addRasterLayer( const QString& url, const QString& baseName, const QString& providerKey,
const QStringList& layers, const QStringList& styles, const QString& format, const QString& crs );

//! Add a project
bool addProject( QString theProjectName );
Expand Down
30 changes: 28 additions & 2 deletions src/app/qgsbrowserdockwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,33 @@ void QgsBrowserDockWidget::addLayer( QgsLayerItem *layerItem )
}
if ( type == QgsMapLayer::RasterLayer )
{
QgisApp::instance()->addRasterLayer( uri, layerItem->name(), providerKey );
// This should go to WMS provider
QStringList URIParts = uri.split( "|" );
QString rasterLayerPath = URIParts.at( 0 );
QStringList layers;
QStringList styles;
QString format;
QString crs;
for ( int i = 1 ; i < URIParts.size(); i++ )
{
QString part = URIParts.at( i );
int pos = part.indexOf( "=" );
QString field = part.left( pos );
QString value = part.mid( pos + 1 );

if ( field == "layers" )
layers = value.split( "," );
if ( field == "styles" )
styles = value.split( "," );
if ( field == "format" )
format = value;
if ( field == "crs" )
crs = value;
}
QgsDebugMsg( "rasterLayerPath = " + rasterLayerPath );
QgsDebugMsg( "layers = " + layers.join( " " ) );

QgisApp::instance()->addRasterLayer( rasterLayerPath, layerItem->name(), providerKey, layers, styles, format, crs );
}
}

Expand Down Expand Up @@ -373,7 +399,7 @@ void QgsBrowserDockWidget::showProperties( )
{
QgsDebugMsg( "creating raster layer" );
// should copy code from addLayer() to split uri ?
QgsRasterLayer* layer = new QgsRasterLayer( layerItem->uri(), layerItem->uri(), layerItem->providerKey() );
QgsRasterLayer* layer = new QgsRasterLayer( 0, layerItem->uri(), layerItem->uri(), layerItem->providerKey() );
if ( layer != NULL )
{
layerCrs = layer->crs();
Expand Down
Loading