Skip to content
Permalink
Browse files

Fix can not delete geonode instance from browser.

  • Loading branch information
ismailsunni authored and nyalldawson committed Aug 31, 2017
1 parent 3016158 commit cad8fa8bb2e4b5125664b6354d698c8e0fd5d6a8
@@ -133,8 +133,6 @@ QgsGeoNodeStyle QgsGeoNodeRequest::getStyle( QString styleID )
void QgsGeoNodeRequest::replyProgress( qint64 bytesReceived, qint64 bytesTotal )
{
QString msg = tr( "%1 of %2 bytes of request downloaded." ).arg( bytesReceived ).arg( bytesTotal < 0 ? QStringLiteral( "unknown number of" ) : QString::number( bytesTotal ) );
QgsDebugMsg( msg );
QgsMessageLog::logMessage( QStringLiteral( "Reply in progress" ), tr( "GeoNode" ) );
QgsMessageLog::logMessage( msg, tr( "GeoNode" ) );
emit statusChanged( msg );
}
@@ -484,10 +482,9 @@ bool QgsGeoNodeRequest::request( QString endPoint )
{
abort();
mIsAborted = false;
QgsMessageLog::logMessage( mBaseUrl, tr( "GeoNode" ) );
// Handle case where the endpoint is full url
QString url = endPoint.startsWith( mBaseUrl ) ? endPoint : mBaseUrl + endPoint;
QgsMessageLog::logMessage( url, tr( "GeoNode" ) );
QgsMessageLog::logMessage( "Requesting to " + url, tr( "GeoNode" ) );
setProtocol( url.split( "://" )[0] );
QUrl layerUrl( url );
layerUrl.setScheme( getProtocol() );
@@ -199,11 +199,11 @@ void QgsGeoNodeSourceSelect::connectToGeonodeConnection()

if ( !layers.empty() )
{
QgsMessageLog::logMessage( QStringLiteral( "Success" ), tr( "GeoNode" ) );
QgsMessageLog::logMessage( QStringLiteral( "Success, non empty layers %1" ).arg( layers.count( ) ), tr( "GeoNode" ) );
}
else
{
QgsMessageLog::logMessage( QStringLiteral( "Failed" ), tr( "GeoNode" ) );
QgsMessageLog::logMessage( QStringLiteral( "Failed, empty layers" ), tr( "GeoNode" ) );
}

if ( mModel )
@@ -217,8 +217,6 @@ void QgsGeoNodeSourceSelect::connectToGeonodeConnection()
{
QUuid uuid = layer.uuid;

QString layerName = layer.name;

QString wmsURL = layer.wmsURL;
QString wfsURL = layer.wfsURL;
QString xyzURL = layer.xyzURL;
@@ -36,7 +36,7 @@ class QgsGeoNodeConnectionItem : public QgsDataCollectionItem
void editConnection();
void deleteConnection()
{
QgsGeoNodeConnection::deleteConnection( mParent->name() );
QgsGeoNodeConnection::deleteConnection( name() );
mParent->refresh();
};

@@ -19,6 +19,7 @@
#include "qgssettings.h"
#include "qgsgeonoderequest.h"
#include "qgslogger.h"
#include "qgsmessagelog.h"

/** \ingroup UnitTests
* This is a unit test for the QgsGeoConnection class.
@@ -46,7 +47,10 @@ class TestQgsGeoNodeConnection: public QObject
// Check if we can create geonode connection from database.
void testCreation();

// Test API
// Test Layer API
void testLayerAPI();

// Test Style API
void testStyleAPI();

private:
@@ -122,9 +126,24 @@ void TestQgsGeoNodeConnection::testCreation()
}

// Test Layer API
void TestQgsGeoNodeConnection::testLayerAPI()
{
if ( mSkipRemoteTest )
{
QSKIP( "Skip remote test for faster testing" );
}

QgsGeoNodeRequest geonodeRequest( mKartozaGeoNodeQGISServerURL, true );
QList<QgsServiceLayerDetail> layers = geonodeRequest.getLayers();
QString msg = QStringLiteral( "Number of layers: %1" ).arg( layers.count() );
QgsDebugMsg( msg );
QVERIFY( layers.count() > 0 );
}

// Test Style API
void TestQgsGeoNodeConnection::testStyleAPI()
{
if ( !mSkipRemoteTest )
if ( mSkipRemoteTest )
{
QSKIP( "Skip remote test for faster testing" );
}

0 comments on commit cad8fa8

Please sign in to comment.
You can’t perform that action at this time.