Skip to content
Permalink
Browse files
Fix can not delete geonode instance from browser.
  • Loading branch information
ismailsunni authored and nyalldawson committed Sep 12, 2017
1 parent 3016158 commit cad8fa8
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 11 deletions.
@@ -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.