Skip to content

Commit

Permalink
qt5 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Nov 17, 2015
1 parent a6a2982 commit 1675703
Show file tree
Hide file tree
Showing 21 changed files with 54 additions and 38 deletions.
4 changes: 2 additions & 2 deletions cmake/FindPyQt4.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ IF(EXISTS PYQT4_VERSION)
SET(PYQT4_FOUND TRUE)
ELSE(EXISTS PYQT4_VERSION)

FIND_FILE(_find_pyqt_py FindPyQt.py --version=4 PATHS ${CMAKE_MODULE_PATH})
FIND_FILE(_find_pyqt_py FindPyQt.py PATHS ${CMAKE_MODULE_PATH})

EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} ${_find_pyqt_py} OUTPUT_VARIABLE pyqt_config)
EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} ${_find_pyqt_py} --version=4 OUTPUT_VARIABLE pyqt_config)
IF(pyqt_config)
STRING(REGEX REPLACE "^pyqt_version:([^\n]+).*$" "\\1" PYQT4_VERSION ${pyqt_config})
STRING(REGEX REPLACE ".*\npyqt_version_str:([^\n]+).*$" "\\1" PYQT4_VERSION_STR ${pyqt_config})
Expand Down
4 changes: 2 additions & 2 deletions cmake/FindPyQt5.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ IF(EXISTS PYQT5_VERSION)
SET(PYQT5_FOUND TRUE)
ELSE(EXISTS PYQT5_VERSION)

FIND_FILE(_find_pyqt_py FindPyQt.py --version=5 PATHS ${CMAKE_MODULE_PATH})
FIND_FILE(_find_pyqt_py FindPyQt.py PATHS ${CMAKE_MODULE_PATH})

EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} ${_find_pyqt_py} OUTPUT_VARIABLE pyqt_config)
EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} ${_find_pyqt_py} --version=5 OUTPUT_VARIABLE pyqt_config)
IF(pyqt_config)
STRING(REGEX REPLACE "^pyqt_version:([^\n]+).*$" "\\1" PYQT5_VERSION ${pyqt_config})
STRING(REGEX REPLACE ".*\npyqt_version_str:([^\n]+).*$" "\\1" PYQT5_VERSION_STR ${pyqt_config})
Expand Down
15 changes: 11 additions & 4 deletions cmake/FindQsci.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,17 @@ ELSE(EXISTS QSCI_MOD_VERSION_STR)
ENDIF(qsci_ver)

IF(QSCI_FOUND)
FIND_PATH(QSCI_SIP_DIR
NAMES Qsci/qscimod4.sip
PATHS ${PYQT4_SIP_DIR}
)
IF(ENABLE_QT5)
FIND_PATH(QSCI_SIP_DIR
NAMES Qsci/qscimod5.sip
PATHS ${PYQT5_SIP_DIR}
)
ELSE(ENABLE_QT5)
FIND_PATH(QSCI_SIP_DIR
NAMES Qsci/qscimod4.sip
PATHS ${PYQT4_SIP_DIR}
)
ENDIF(ENABLE_QT5)

IF(NOT QSCI_FIND_QUIETLY)
MESSAGE(STATUS "Found QScintilla2 PyQt module: ${QSCI_MOD_VERSION_STR}")
Expand Down
2 changes: 1 addition & 1 deletion python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ INCLUDE_DIRECTORIES(
)

IF(NOT ENABLE_QT5)
SET(SIP_DISABLE_FEATURES ${SIP_DISALE_FEATURES} QT5_SUPPORT)
SET(SIP_DISABLE_FEATURES ${SIP_DISABLE_FEATURES} QT5_SUPPORT)
ENDIF(NOT ENABLE_QT5)

IF(NOT ANDROID)
Expand Down
Empty file added python/PyQt/__init__.py
Empty file.
4 changes: 2 additions & 2 deletions src/analysis/raster/qgsrelief.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ bool QgsRelief::exportFrequencyDistributionToCsv( const QString& file )

if ( !minOk || !maxOk )
{
GDALComputeRasterMinMax( elevationBand, TRUE, minMax );
GDALComputeRasterMinMax( elevationBand, true, minMax );
}

//2. go through raster cells and get frequency of classes
Expand Down Expand Up @@ -593,7 +593,7 @@ QList< QgsRelief::ReliefColor > QgsRelief::calculateOptimizedReliefClasses()

if ( !minOk || !maxOk )
{
GDALComputeRasterMinMax( elevationBand, TRUE, minMax );
GDALComputeRasterMinMax( elevationBand, true, minMax );
}

//2. go through raster cells and get frequency of classes
Expand Down
1 change: 1 addition & 0 deletions src/core/auth/qgsauthcertutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#ifndef QGSAUTHCERTUTILS_H
#define QGSAUTHCERTUTILS_H

#include <QFile>
#include <QtCrypto>
#include <QSslCertificate>
#include <QSslError>
Expand Down
1 change: 1 addition & 0 deletions src/core/auth/qgsauthcrypto.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#ifndef QGSAUTHCRYPTO_H
#define QGSAUTHCRYPTO_H

#include <QFile>
#include <QString>

/** \ingroup core
Expand Down
2 changes: 2 additions & 0 deletions src/gui/auth/qgsauthcertificateinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
#ifndef QGSAUTHCERTIFICATEINFO_H
#define QGSAUTHCERTIFICATEINFO_H

#include <QFile>

#ifndef QT_NO_OPENSSL
#include <QtCrypto>
#include <QSslCertificate>
Expand Down
8 changes: 4 additions & 4 deletions src/providers/gdal/qgsgdalprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ void QgsGdalProvider::readBlock( int theBandNo, QgsRectangle const & theExtent,
NULL,
myGdalMemDataset,
NULL,
FALSE, 0.0, 1
false, 0.0, 1
);
#if 0
myWarpOptions->pTransformerArg =
Expand Down Expand Up @@ -845,7 +845,7 @@ void QgsGdalProvider::computeMinMax( int theBandNo ) const
adfMinMax[1] = GDALGetRasterMaximum( myGdalBand, &bGotMax );
if ( !( bGotMin && bGotMax ) )
{
GDALComputeRasterMinMax( myGdalBand, TRUE, adfMinMax );
GDALComputeRasterMinMax( myGdalBand, true, adfMinMax );
}
mMinimum[theBandNo-1] = adfMinMax[0];
mMaximum[theBandNo-1] = adfMinMax[1];
Expand Down Expand Up @@ -1429,7 +1429,7 @@ QgsRasterHistogram QgsGdalProvider::histogram( int theBandNo,
{
CPLErr eErr = CE_Failure;
double dfHalfBucket = 0;
eErr = GDALGetRasterStatistics( myGdalBand, TRUE, TRUE, &myMinVal, &myMaxVal, NULL, NULL );
eErr = GDALGetRasterStatistics( myGdalBand, true, true, &myMinVal, &myMaxVal, NULL, NULL );
if ( eErr != CE_None )
{
delete [] myHistogramArray;
Expand Down Expand Up @@ -2878,7 +2878,7 @@ QGISEXTERN QString validateCreationOptionsFormat( const QStringList& createOptio
int ok = GDALValidateCreationOptions( myGdalDriver, papszOptions );
CSLDestroy( papszOptions );

if ( ok == FALSE )
if ( !ok )
return "Failed GDALValidateCreationOptions() test";
return QString();
}
Expand Down
3 changes: 3 additions & 0 deletions src/providers/oracle/ocispatial/qocispatial.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"Keys": [ "QOCISPATIAL8", "QOCISPATIAL" ]
}
3 changes: 3 additions & 0 deletions src/providers/spatialite/qspatialite/qspatialite.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"Keys": [ "QSPATIALITE" ]
}
1 change: 1 addition & 0 deletions src/server/qgsconfigparserutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#ifndef QGSCONFIGPARSERUTILS_H
#define QGSCONFIGPARSERUTILS_H

#include <QMap>
#include <QStringList>

class QgsCoordinateReferenceSystem;
Expand Down
2 changes: 1 addition & 1 deletion src/server/qgsgetrequesthandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
class QgsGetRequestHandler: public QgsHttpRequestHandler
{
public:
explicit QgsGetRequestHandler( const bool captureOutput = FALSE );
explicit QgsGetRequestHandler( const bool captureOutput = false );
void parseInput() override;
};

Expand Down
1 change: 1 addition & 0 deletions src/server/qgshttprequesthandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "qgsrequesthandler.h"
#include <QColor>
#include <QPair>
#include <QHash>

typedef QList< QPair<QRgb, int> > QgsColorBox; //Color / number of pixels
typedef QMultiMap< int, QgsColorBox > QgsColorBoxMap; // sum of pixels / color box
Expand Down
2 changes: 1 addition & 1 deletion src/server/qgspostrequesthandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
class QgsPostRequestHandler: public QgsHttpRequestHandler
{
public:
explicit QgsPostRequestHandler( const bool captureOutput = FALSE );
explicit QgsPostRequestHandler( const bool captureOutput = false );
~QgsPostRequestHandler();

/** Parses the input and creates a request neutral Parameter/Value map*/
Expand Down
2 changes: 0 additions & 2 deletions src/server/qgsremotedatasourcebuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,10 @@

QgsRemoteDataSourceBuilder::QgsRemoteDataSourceBuilder(): QgsMSLayerBuilder()
{

}

QgsRemoteDataSourceBuilder::~QgsRemoteDataSourceBuilder()
{

}

QgsMapLayer* QgsRemoteDataSourceBuilder::createMapLayer( const QDomElement& elem, const QString& layerName, QList<QTemporaryFile*>& filesToRemove, QList<QgsMapLayer*>& layersToRemove, bool allowCaching ) const
Expand Down
22 changes: 11 additions & 11 deletions src/server/qgsserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,17 @@

// Static initialisers, default values for fcgi server
QgsApplication* QgsServer::mQgsApplication = NULL;
bool QgsServer::mInitialised = FALSE;
bool QgsServer::mInitialised = false;
QString QgsServer::mServerName( "qgis_server" );
bool QgsServer::mCaptureOutput = FALSE;
bool QgsServer::mCaptureOutput = false;
char* QgsServer::mArgv[1];
int QgsServer::mArgc = 1;
QString QgsServer::mConfigFilePath;
QgsMapRenderer* QgsServer::mMapRenderer = NULL;
QgsCapabilitiesCache* QgsServer::mCapabilitiesCache;

#ifdef HAVE_SERVER_PYTHON_PLUGINS
bool QgsServer::mInitPython = TRUE;
bool QgsServer::mInitPython = true;
QgsServerInterfaceImpl* QgsServer::mServerInterface = NULL;
#endif

Expand Down Expand Up @@ -108,7 +108,7 @@ void QgsServer::setupNetworkAccessManager()
* @param captureOutput
* @return request instance
*/
QgsRequestHandler* QgsServer::createRequestHandler( const bool captureOutput /*= FALSE*/ )
QgsRequestHandler* QgsServer::createRequestHandler( const bool captureOutput /*= false*/ )
{
QgsRequestHandler* requestHandler = 0;
char* requestMethod = getenv( "REQUEST_METHOD" );
Expand Down Expand Up @@ -289,13 +289,13 @@ bool QgsServer::init()
{
if ( mInitialised )
{
return FALSE;
return false;
}
mArgv[0] = mServerName.toUtf8( ).data( );
mArgc = 1;
mCaptureOutput = TRUE;
mCaptureOutput = true;
#ifdef HAVE_SERVER_PYTHON_PLUGINS
mInitPython = FALSE;
mInitPython = false;
#endif
return init( mArgc , mArgv );
}
Expand All @@ -308,7 +308,7 @@ bool QgsServer::init( int & argc, char ** argv )
{
if ( mInitialised )
{
return FALSE;
return false;
}

#ifndef _MSC_VER
Expand All @@ -333,7 +333,7 @@ bool QgsServer::init( int & argc, char ** argv )
QgsApplication::init();
#if !defined(Q_OS_WIN)
// init QGIS's paths - true means that all path will be inited from prefix
QgsApplication::setPrefixPath( CMAKE_INSTALL_PREFIX, TRUE );
QgsApplication::setPrefixPath( CMAKE_INSTALL_PREFIX, true );
#endif

#if defined(SERVER_SKIP_ECW)
Expand Down Expand Up @@ -410,9 +410,9 @@ bool QgsServer::init( int & argc, char ** argv )
QgsServerLogger::instance();

QgsEditorWidgetRegistry::initEditors();
mInitialised = TRUE;
mInitialised = true;
QgsMessageLog::logMessage( "Server intialised", "Server", QgsMessageLog::INFO );
return TRUE;
return true;
}


Expand Down
3 changes: 1 addition & 2 deletions src/server/qgsserver.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,7 @@ class SERVER_EXPORT QgsServer
static QFileInfo defaultAdminSLD();
static void setupNetworkAccessManager();
//! Create and return a request handler instance
static QgsRequestHandler* createRequestHandler(
const bool captureOutput = FALSE );
static QgsRequestHandler* createRequestHandler( const bool captureOutput = false );

// Server status
static QString mConfigFilePath;
Expand Down
10 changes: 5 additions & 5 deletions src/server/qgsserverplugins.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ bool QgsServerPlugins::initPlugins( QgsServerInterface *interface )
if ( !pythonlib.load() )
{
QgsDebugMsg( QString( "Couldn't load Python support library: %1" ).arg( pythonlib.errorString() ) );
return FALSE;
return false;
}
}

Expand All @@ -69,7 +69,7 @@ bool QgsServerPlugins::initPlugins( QgsServerInterface *interface )
{
//using stderr on purpose because we want end users to see this [TS]
QgsDebugMsg( QString( "Couldn't resolve python support library's instance() symbol." ) );
return FALSE;
return false;
}

QgsDebugMsg( "Python support library's instance() symbol resolved." );
Expand All @@ -83,13 +83,13 @@ bool QgsServerPlugins::initPlugins( QgsServerInterface *interface )
else
{
QgsDebugMsg( "Python support FAILED :-(" );
return FALSE;
return false;
}

//Init plugins: loads a list of installed plugins and filter them
//for "server" metadata
QListIterator<QString> plugins( mPythonUtils->pluginList() );
bool atLeastOneEnabled = FALSE;
bool atLeastOneEnabled = false;
while ( plugins.hasNext() )
{
QString pluginName = plugins.next();
Expand All @@ -100,7 +100,7 @@ bool QgsServerPlugins::initPlugins( QgsServerInterface *interface )
{
if ( mPythonUtils->startServerPlugin( pluginName ) )
{
atLeastOneEnabled = TRUE;
atLeastOneEnabled = true;
mServerPlugins.append( pluginName );
QgsMessageLog::logMessage( QString( "Server plugin %1 loaded!" ).arg( pluginName ), "Server", QgsMessageLog::INFO );
}
Expand Down
2 changes: 1 addition & 1 deletion src/server/qgssoaprequesthandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class QDomElement;
class QgsSOAPRequestHandler: public QgsHttpRequestHandler
{
public:
explicit QgsSOAPRequestHandler( const bool captureOutput = FALSE );
explicit QgsSOAPRequestHandler( const bool captureOutput = false );
~QgsSOAPRequestHandler();
void parseInput() override;
void setGetMapResponse( const QString& service, QImage* img );
Expand Down

0 comments on commit 1675703

Please sign in to comment.