27 changes: 12 additions & 15 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,19 +57,16 @@ SET (WITH_INTERNAL_QWTPOLAR TRUE CACHE BOOL "Use internal build of QwtPolar")

SET (WITH_INTERNAL_QEXTSERIALPORT TRUE CACHE BOOL "Use internal build of Qextserialport")

SET (WITH_SPATIALITE TRUE CACHE BOOL "Determines whether SPATIALITE support should be built")
IF (WITH_SPATIALITE)
SET (WITH_INTERNAL_SPATIALITE FALSE CACHE BOOL "Determines whether SPATIALITE support should be built internally")
SET (WITH_PYSPATIALITE FALSE CACHE BOOL "Determines whether PYSPATIALITE should be built")
SET (WITH_QSPATIALITE FALSE CACHE BOOL "Determines whether QSPATIALITE sql driver should be built")
IF(WITH_INTERNAL_SPATIALITE)
SET(SPATIALITE_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/src/core/spatialite/headers)
SET(HAVE_SPATIALITE TRUE)
IF(WIN32 OR APPLE OR CYGWIN)
FIND_PACKAGE(Iconv REQUIRED)
ENDIF(WIN32 OR APPLE OR CYGWIN)
ENDIF (WITH_INTERNAL_SPATIALITE)
ENDIF (WITH_SPATIALITE)
SET (WITH_INTERNAL_SPATIALITE FALSE CACHE BOOL "Determines whether SPATIALITE support should be built internally")
SET (WITH_PYSPATIALITE FALSE CACHE BOOL "Determines whether PYSPATIALITE should be built")
SET (WITH_QSPATIALITE FALSE CACHE BOOL "Determines whether QSPATIALITE sql driver should be built")
IF(WITH_INTERNAL_SPATIALITE)
SET(SPATIALITE_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/src/core/spatialite/headers)
SET(HAVE_SPATIALITE TRUE)
IF(WIN32 OR APPLE OR CYGWIN)
FIND_PACKAGE(Iconv REQUIRED)
ENDIF(WIN32 OR APPLE OR CYGWIN)
ENDIF (WITH_INTERNAL_SPATIALITE)

SET (WITH_ORACLE FALSE CACHE BOOL "Determines whether Oracle support should be built")
IF(WITH_ORACLE)
Expand Down Expand Up @@ -198,9 +195,9 @@ IF (WITH_POSTGRESQL)
FIND_PACKAGE(Postgres) # PostgreSQL provider, SPIT plugin
ENDIF (WITH_POSTGRESQL)

IF (WITH_SPATIALITE AND NOT WITH_INTERNAL_SPATIALITE)
IF (NOT WITH_INTERNAL_SPATIALITE)
FIND_PACKAGE(SPATIALITE)
ENDIF (WITH_SPATIALITE AND NOT WITH_INTERNAL_SPATIALITE)
ENDIF (NOT WITH_INTERNAL_SPATIALITE)

IF (NOT PROJ_FOUND OR NOT GEOS_FOUND OR NOT GDAL_FOUND)
MESSAGE (SEND_ERROR "Some dependencies were not found!")
Expand Down
6 changes: 3 additions & 3 deletions cmake/FindQGIS.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ IF(WIN32)
#MESSAGE("Searching for QGIS in $ENV{PROGRAMFILES}/Quantum GIS")
IF (MINGW)
FIND_PATH(QGIS_PLUGIN_DIR
NAMES libnortharrowplugin.dll
NAMES libdelimitedtextplugin.dll
PATHS
"$ENV{PROGRAMFILES}/Quantum GIS/plugins"
)
Expand All @@ -38,7 +38,7 @@ IF(WIN32)

IF (MSVC)
FIND_PATH(QGIS_PLUGIN_DIR
NAMES northarrowplugin.dll
NAMES delimitedtextplugin.dll
PATHS
"$ENV{OSGEO4W_ROOT}/apps/qgis/plugins"
"$ENV{PROGRAMFILES}/Quantum GIS/plugins"
Expand Down Expand Up @@ -82,7 +82,7 @@ ELSE(WIN32)
SET (QGIS_MAC_PATH /Applications/QGIS.app/Contents)
#MESSAGE("Searching for QGIS in /usr/bin; /usr/local/bin")
FIND_PATH(QGIS_PLUGIN_DIR
NAMES libnortharrowplugin.so
NAMES libdelimitedtextplugin.so
PATHS
/usr/lib64/qgis/plugins
/usr/lib/qgis
Expand Down
1 change: 0 additions & 1 deletion debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ CMAKE_OPTS := \
-D CMAKE_INSTALL_PREFIX=/usr \
-D BINDINGS_GLOBAL_INSTALL=TRUE \
-D PEDANTIC=TRUE \
-D WITH_SPATIALITE=TRUE \
-D WITH_QSPATIALITE=TRUE \
-D WITH_MAPSERVER=TRUE \
-D QGIS_CGIBIN_SUBDIR=/usr/lib/cgi-bin \
Expand Down
1 change: 0 additions & 1 deletion ms-windows/osgeo4w/package-nightly.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ cmake -G "Visual Studio 9 2008" ^
-D BUILDNAME="OSGeo4W-Nightly-VC9" ^
-D SITE="qgis.org" ^
-D PEDANTIC=TRUE ^
-D WITH_SPATIALITE=TRUE ^
-D WITH_QSPATIALITE=TRUE ^
-D WITH_MAPSERVER=TRUE ^
-D WITH_ASTYLE=TRUE ^
Expand Down
1 change: 0 additions & 1 deletion ms-windows/osgeo4w/package.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ set GRASS_PREFIX=%O4W_ROOT%/apps/grass/grass-%GRASS_VERSION%

cmake -G "Visual Studio 9 2008" ^
-D PEDANTIC=TRUE ^
-D WITH_SPATIALITE=TRUE ^
-D WITH_QSPATIALITE=TRUE ^
-D WITH_MAPSERVER=TRUE ^
-D WITH_GLOBE=TRUE ^
Expand Down
6 changes: 3 additions & 3 deletions python/console/console_sci.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@
import os
import code

from qgis.core import QgsApplication

_init_commands = ["from qgis.core import *", "import qgis.utils",
"from qgis.utils import iface"]
_historyFile = os.path.join(str(QDir.homePath()),".qgis","console_history.txt")
_historyFile = unicode( QgsApplication.qgisSettingsDirPath() + "console_history.txt" )

class PythonEdit(QsciScintilla, code.InteractiveInterpreter):
def __init__(self, parent=None):
Expand Down Expand Up @@ -144,8 +146,6 @@ def commandConsole(self, command):
self.setFocus()

def setLexers(self):
from qgis.core import QgsApplication

self.lexer = QsciLexerPython()
settings = QSettings()
loadFont = settings.value("pythonConsole/fontfamilytext", "Monospace").toString()
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/GdalTools/GdalTools.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
# if the plugin is shipped with QGis catch the exception and
# display an error message
import os.path
qgisUserPluginPath = os.path.abspath( os.path.join( str( QgsApplication.qgisSettingsDirPath() ), "python") )
qgisUserPluginPath = os.path.abspath( os.path.join( unicode( QgsApplication.qgisSettingsDirPath() ), "python") )
if not os.path.dirname(__file__).startswith( qgisUserPluginPath ):
title = QCoreApplication.translate( "GdalTools", "Plugin error" )
message = QCoreApplication.translate( "GdalTools", u'Unable to load %1 plugin. \nThe required "%2" module is missing. \nInstall it and try again.' )
Expand Down
4 changes: 2 additions & 2 deletions python/plugins/sextante/grass/GrassUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,10 +340,10 @@ def checkGrassIsInstalled(ignoreRegistrySettings=False):
return ("The specified GRASS folder does not contain a valid set of GRASS modules.\n"
+ "Please, go to the SEXTANTE settings dialog, and check that the GRASS\n"
+ "folder is correctly configured")

settings = QSettings()
if not ignoreRegistrySettings:
GRASS_INSTALLED = "/SextanteQGIS/GrassInstalled"
GRASS_INSTALLED = "/SextanteQGIS/GrassInstalled"
if settings.contains(GRASS_INSTALLED):
return

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@

import os, sys
import otbApplication
from qgis.core import QgsApplication

outputpath= os.path.join( os.environ["HOME"], ".qgis/python/plugins/sextante/otb/description" )
outputpath = unicode( QgsApplication.qgisSettingsDirPath() + "python/plugins/sextante/otb/description" )
endl = os.linesep

def convertendl(s):
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/sextante/saga/SagaUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def checkSagaIsInstalled(ignoreRegistrySettings=False):

settings = QSettings()
if not ignoreRegistrySettings:
SAGA_INSTALLED = "/SextanteQGIS/SagaInstalled"
SAGA_INSTALLED = "/SextanteQGIS/SagaInstalled"
if settings.contains(SAGA_INSTALLED):
return

Expand Down
52 changes: 23 additions & 29 deletions src/analysis/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,30 +37,26 @@ SET(QGIS_ANALYSIS_SRCS
vector/qgsgeometryanalyzer.cpp
vector/qgszonalstatistics.cpp
vector/qgsoverlayanalyzer.cpp
)

IF(HAVE_SPATIALITE)
SET(QGIS_ANALYSIS_SRCS ${QGIS_ANALYSIS_SRCS}
openstreetmap/qgsosmbase.cpp
openstreetmap/qgsosmdatabase.cpp
openstreetmap/qgsosmdownload.cpp
openstreetmap/qgsosmimport.cpp
)
openstreetmap/qgsosmbase.cpp
openstreetmap/qgsosmdatabase.cpp
openstreetmap/qgsosmdownload.cpp
openstreetmap/qgsosmimport.cpp
)

SET(QGIS_ANALYSIS_MOC_HDRS
openstreetmap/qgsosmdownload.h
openstreetmap/qgsosmimport.h
)
SET(QGIS_ANALYSIS_MOC_HDRS
openstreetmap/qgsosmdownload.h
openstreetmap/qgsosmimport.h
)

IF (WITH_INTERNAL_SPATIALITE)
INCLUDE_DIRECTORIES(../core/spatialite/headers)
INCLUDE_DIRECTORIES(../core/spatialite/headers/spatialite)
ELSE (WITH_INTERNAL_SPATIALITE)
INCLUDE_DIRECTORIES(${SPATIALITE_INCLUDE_DIR})
INCLUDE_DIRECTORIES(${SQLITE3_INCLUDE_DIR})
ADD_DEFINITIONS(-DEXTERNAL_SPATIALITE)
ENDIF (WITH_INTERNAL_SPATIALITE)
ENDIF(HAVE_SPATIALITE)
IF (WITH_INTERNAL_SPATIALITE)
INCLUDE_DIRECTORIES(../core/spatialite/headers)
INCLUDE_DIRECTORIES(../core/spatialite/headers/spatialite)
ELSE (WITH_INTERNAL_SPATIALITE)
INCLUDE_DIRECTORIES(${SPATIALITE_INCLUDE_DIR})
INCLUDE_DIRECTORIES(${SQLITE3_INCLUDE_DIR})
ADD_DEFINITIONS(-DEXTERNAL_SPATIALITE)
ENDIF (WITH_INTERNAL_SPATIALITE)

INCLUDE_DIRECTORIES(BEFORE raster)
ADD_FLEX_FILES_PREFIX(QGIS_ANALYSIS_SRCS raster raster/qgsrastercalclexer.ll)
Expand Down Expand Up @@ -107,14 +103,12 @@ SET(QGIS_ANALYSIS_HDRS
interpolation/qgstininterpolator.h
)

IF(HAVE_SPATIALITE)
SET(QGIS_ANALYSIS_HDRS ${QGIS_ANALYSIS_HDRS}
openstreetmap/qgsosmbase.h
openstreetmap/qgsosmdatabase.h
openstreetmap/qgsosmdownload.h
openstreetmap/qgsosmimport.h
)
ENDIF(HAVE_SPATIALITE)
SET(QGIS_ANALYSIS_HDRS ${QGIS_ANALYSIS_HDRS}
openstreetmap/qgsosmbase.h
openstreetmap/qgsosmdatabase.h
openstreetmap/qgsosmdownload.h
openstreetmap/qgsosmimport.h
)

INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_SOURCE_DIR}
Expand Down
32 changes: 12 additions & 20 deletions src/app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ SET(QGIS_APP_SRCS
openstreetmap/qgsosmdownloaddialog.cpp
openstreetmap/qgsosmimportdialog.cpp
openstreetmap/qgsosmexportdialog.cpp

qgsnewspatialitelayerdialog.cpp
)

SET (QGIS_APP_MOC_HDRS
Expand Down Expand Up @@ -289,6 +291,8 @@ SET (QGIS_APP_MOC_HDRS
openstreetmap/qgsosmdownloaddialog.h
openstreetmap/qgsosmimportdialog.h
openstreetmap/qgsosmexportdialog.h

qgsnewspatialitelayerdialog.h
)

IF(WITH_INTERNAL_QWTPOLAR)
Expand Down Expand Up @@ -365,16 +369,6 @@ IF (POSTGRES_FOUND)
ENDIF(HAVE_PGCONFIG)
ENDIF (POSTGRES_FOUND)

IF (HAVE_SPATIALITE)
SET (QGIS_APP_SRCS ${QGIS_APP_SRCS}
qgsnewspatialitelayerdialog.cpp
)
SET (QGIS_APP_MOC_HDRS ${QGIS_APP_MOC_HDRS}
qgsnewspatialitelayerdialog.h
)
ENDIF(HAVE_SPATIALITE)


SET(IMAGE_RCCS ../../images/images.qrc)

QT4_ADD_RESOURCES(IMAGE_RCC_SRCS ${IMAGE_RCCS})
Expand Down Expand Up @@ -435,16 +429,14 @@ IF (ANDROID)
INCLUDE_DIRECTORIES(${ANDROID_NDK_TOOLCHAIN_ROOT}/sysroot/usr/include)
ENDIF (ANDROID)

IF (HAVE_SPATIALITE)
IF (WITH_INTERNAL_SPATIALITE)
INCLUDE_DIRECTORIES(../core/spatialite/headers)
INCLUDE_DIRECTORIES(../core/spatialite/headers/spatialite)
ELSE (WITH_INTERNAL_SPATIALITE)
INCLUDE_DIRECTORIES(${SPATIALITE_INCLUDE_DIR})
INCLUDE_DIRECTORIES(${SQLITE3_INCLUDE_DIR})
ADD_DEFINITIONS(-DEXTERNAL_SPATIALITE)
ENDIF (WITH_INTERNAL_SPATIALITE)
ENDIF (HAVE_SPATIALITE)
IF (WITH_INTERNAL_SPATIALITE)
INCLUDE_DIRECTORIES(../core/spatialite/headers)
INCLUDE_DIRECTORIES(../core/spatialite/headers/spatialite)
ELSE (WITH_INTERNAL_SPATIALITE)
INCLUDE_DIRECTORIES(${SPATIALITE_INCLUDE_DIR})
INCLUDE_DIRECTORIES(${SQLITE3_INCLUDE_DIR})
ADD_DEFINITIONS(-DEXTERNAL_SPATIALITE)
ENDIF (WITH_INTERNAL_SPATIALITE)

INCLUDE_DIRECTORIES(
${PROJ_INCLUDE_DIR}
Expand Down
2 changes: 1 addition & 1 deletion src/app/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ int main( int argc, char *argv[] )
#if defined(ANDROID)
QgsDebugMsg( QString( "Android: All params stripped" ) );// Param %1" ).arg( argv[0] ) );
//put all QGIS settings in the same place
configpath = QDir::homePath() + QString( "/.qgis/" );
configpath = QgsApplication::qgisSettingsPath();
QgsDebugMsg( QString( "Android: configpath set to %1" ).arg( configpath ) );
#elif defined(Q_WS_WIN)
for ( int i = 1; i < argc; i++ )
Expand Down
19 changes: 0 additions & 19 deletions src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,13 +273,11 @@

#include <sqlite3.h>

#ifdef HAVE_SPATIALITE
extern "C"
{
#include <spatialite.h>
}
#include "qgsnewspatialitelayerdialog.h"
#endif

#include "qgspythonutils.h"

Expand Down Expand Up @@ -1093,13 +1091,6 @@ void QgisApp::createActions()
connect( mActionRotateLabel, SIGNAL( triggered() ), this, SLOT( rotateLabel() ) );
connect( mActionChangeLabelProperties, SIGNAL( triggered() ), this, SLOT( changeLabelProperties() ) );

#ifndef HAVE_SPATIALITE
delete mActionNewSpatialiteLayer;
mActionNewSpatialiteLayer = 0;
delete mActionAddSpatiaLiteLayer;
mActionAddSpatiaLiteLayer = 0;
#endif

#ifndef HAVE_POSTGRESQL
delete mActionAddPgLayer;
mActionAddPgLayer = 0;
Expand Down Expand Up @@ -1659,10 +1650,8 @@ void QgisApp::setTheme( QString theThemeName )
#ifdef HAVE_POSTGRESQL
mActionAddPgLayer->setIcon( QgsApplication::getThemeIcon( "/mActionAddLayer.png" ) );
#endif
#ifdef HAVE_SPATIALITE
mActionNewSpatialiteLayer->setIcon( QgsApplication::getThemeIcon( "/mActionNewVectorLayer.png" ) );
mActionAddSpatiaLiteLayer->setIcon( QgsApplication::getThemeIcon( "/mActionAddSpatiaLiteLayer.png" ) );
#endif
#ifdef HAVE_MSSQL
mActionAddMssqlLayer->setIcon( QgsApplication::getThemeIcon( "/mActionAddMssqlLayer.png" ) );
#endif
Expand Down Expand Up @@ -2415,11 +2404,7 @@ void QgisApp::about()
versionString += "</tr><tr>";

versionString += "<td>" + tr( "SpatiaLite Version" ) + "</td><td>";
#ifdef HAVE_SPATIALITE
versionString += spatialite_version();
#else
versionString += tr( "No support." );
#endif
versionString += "</td>";

versionString += "<td>" + tr( "QWT Version" ) + "</td><td>" + QWT_VERSION_STR + "</td>";
Expand Down Expand Up @@ -2961,7 +2946,6 @@ void QgisApp::addDatabaseLayers( QStringList const & layerPathList, QString cons

void QgisApp::addSpatiaLiteLayer()
{
#ifdef HAVE_SPATIALITE
if ( mMapCanvas && mMapCanvas->isDrawing() )
{
return;
Expand All @@ -2978,7 +2962,6 @@ void QgisApp::addSpatiaLiteLayer()
this , SLOT( addDatabaseLayers( QStringList const &, QString const & ) ) );
dbs->exec();
delete dbs;
#endif
} // QgisApp::addSpatiaLiteLayer()

void QgisApp::addMssqlLayer()
Expand Down Expand Up @@ -3438,7 +3421,6 @@ void QgisApp::newVectorLayer()
}
}

#ifdef HAVE_SPATIALITE
void QgisApp::newSpatialiteLayer()
{
if ( mMapCanvas && mMapCanvas->isDrawing() )
Expand All @@ -3448,7 +3430,6 @@ void QgisApp::newSpatialiteLayer()
QgsNewSpatialiteLayerDialog spatialiteDialog( this );
spatialiteDialog.exec();
}
#endif

void QgisApp::showRasterCalculator()
{
Expand Down
4 changes: 0 additions & 4 deletions src/app/qgisapp.h
Original file line number Diff line number Diff line change
Expand Up @@ -621,10 +621,8 @@ class QgisApp : public QMainWindow, private Ui::MainWindow
//#endif
//! Add a list of database layers to the map
void addDatabaseLayers( QStringList const & layerPathList, QString const & providerKey );
//#ifdef HAVE_SPATIALITE
//! Add a SpatiaLite layer to the map
void addSpatiaLiteLayer();
//#endif
//#ifdef HAVE_MSSQL
//! Add a MSSQL layer to the map
void addMssqlLayer();
Expand Down Expand Up @@ -781,10 +779,8 @@ class QgisApp : public QMainWindow, private Ui::MainWindow

//! Create a new empty vector layer
void newVectorLayer();
#ifdef HAVE_SPATIALITE
//! Create a new empty spatialite layer
void newSpatialiteLayer();
#endif
//! Print the current map view frame
void newPrintComposer();
void showComposerManager();
Expand Down
Loading