@@ -314,7 +314,8 @@ QgisApp *QgisApp::smInstance = 0;
314
314
QgisApp::QgisApp (QSplashScreen *splash, QWidget * parent, Qt::WFlags fl)
315
315
: QMainWindow(parent,fl),
316
316
mSplash(splash),
317
- mPythonUtils(NULL ), mPythonConsole(NULL )
317
+ mPythonConsole(NULL ),
318
+ mPythonUtils(NULL )
318
319
{
319
320
if (smInstance) {
320
321
QMessageBox::critical (
@@ -1662,9 +1663,9 @@ void QgisApp::restoreSessionPlugins(QString thePluginDirString)
1662
1663
if (loaded)
1663
1664
{
1664
1665
1665
- name_t * myName =(name_t *) myLib->resolve (" name" );
1666
- description_t * myDescription = (description_t *) myLib->resolve (" description" );
1667
- version_t * myVersion = (version_t *) myLib->resolve (" version" );
1666
+ name_t * myName =(name_t *) cast_to_fptr ( myLib->resolve (" name" ) );
1667
+ description_t * myDescription = (description_t *) cast_to_fptr ( myLib->resolve (" description" ) );
1668
+ version_t * myVersion = (version_t *) cast_to_fptr ( myLib->resolve (" version" ) );
1668
1669
if (myName && myDescription && myVersion )
1669
1670
{
1670
1671
// check if the plugin was active on last session
@@ -2451,7 +2452,7 @@ findLayer_( QString const & fileFilters, QDomNode const & constLayerNode )
2451
2452
break ;
2452
2453
}
2453
2454
2454
- }; // findLayer_
2455
+ } // findLayer_
2455
2456
2456
2457
2457
2458
@@ -2661,7 +2662,7 @@ void QgisApp::newVectorLayer()
2661
2662
2662
2663
typedef bool (*createEmptyDataSourceProc)(const QString&, const QString&, const QString&, QGis::WKBTYPE, \
2663
2664
const std::list<std::pair<QString, QString> >&);
2664
- createEmptyDataSourceProc createEmptyDataSource=(createEmptyDataSourceProc)myLib->resolve (" createEmptyDataSource" );
2665
+ createEmptyDataSourceProc createEmptyDataSource=(createEmptyDataSourceProc) cast_to_fptr ( myLib->resolve (" createEmptyDataSource" ) );
2665
2666
if (createEmptyDataSource)
2666
2667
{
2667
2668
#if 0
@@ -3926,7 +3927,7 @@ void QgisApp::loadPythonSupport()
3926
3927
{
3927
3928
// QgsDebugMsg("Python support library loaded successfully.");
3928
3929
typedef QgsPythonUtils* (*inst)();
3929
- inst pythonlib_inst = (inst) pythonlib.resolve (" instance" );
3930
+ inst pythonlib_inst = (inst) cast_to_fptr ( pythonlib.resolve (" instance" ) );
3930
3931
if (pythonlib_inst)
3931
3932
{
3932
3933
// QgsDebugMsg("Python support library's instance() symbol resolved.");
@@ -4009,15 +4010,15 @@ void QgisApp::loadPlugin(QString name, QString description, QString theFullPathN
4009
4010
{
4010
4011
myError += " Attempting to resolve the classFactory function " + QString (__LINE__) + " in " + QString (__FUNCTION__ ) + " \n " ;
4011
4012
4012
- type_t *pType = (type_t *) myLib->resolve (" type" );
4013
+ type_t *pType = (type_t *) cast_to_fptr ( myLib->resolve (" type" ) );
4013
4014
4014
4015
switch (pType ())
4015
4016
{
4016
4017
case QgisPlugin::RENDERER:
4017
4018
case QgisPlugin::UI:
4018
4019
{
4019
4020
// UI only -- doesn't use mapcanvas
4020
- create_ui *cf = (create_ui *) myLib->resolve (" classFactory" );
4021
+ create_ui *cf = (create_ui *) cast_to_fptr ( myLib->resolve (" classFactory" ) );
4021
4022
if (cf)
4022
4023
{
4023
4024
QgisPlugin *pl = cf (mQgisInterface );
@@ -4049,7 +4050,7 @@ void QgisApp::loadPlugin(QString name, QString description, QString theFullPathN
4049
4050
case QgisPlugin::MAPLAYER:
4050
4051
{
4051
4052
// Map layer - requires interaction with the canvas
4052
- create_it *cf = (create_it *) myLib->resolve (" classFactory" );
4053
+ create_it *cf = (create_it *) cast_to_fptr ( myLib->resolve (" classFactory" ) );
4053
4054
if (cf)
4054
4055
{
4055
4056
QgsMapLayerInterface *pl = cf ();
@@ -4412,7 +4413,7 @@ bool QgisApp::saveDirty()
4412
4413
QSettings settings;
4413
4414
bool askThem = settings.value (" qgis/askToSaveProjectChanges" , true ).toBool ();
4414
4415
4415
- if (askThem && (QgsProject::instance ()->isDirty () || ( mMapCanvas ->isDirty ()) && mMapCanvas ->layerCount () > 0 ) )
4416
+ if (askThem && (QgsProject::instance ()->isDirty () || mMapCanvas ->isDirty ()) && mMapCanvas ->layerCount () > 0 )
4416
4417
{
4417
4418
// flag project as dirty since dirty state of canvas is reset if "dirty"
4418
4419
// is based on a zoom or pan
0 commit comments