Skip to content
Permalink
Browse files

Merge branch 'master' of git://github.com/qgis/Quantum-GIS into android

  • Loading branch information
mbernasocchi committed Jul 29, 2011
2 parents bfb5f2c + f3d5387 commit 5676b3b9f400b39ebfe25d46b701400267e4d9aa
Showing with 1,173 additions and 136 deletions.
  1. +10 −0 CMakeLists.txt
  2. +3 −1 i18n/CMakeLists.txt
  3. +2 −0 images/images.qrc
  4. +11 −0 python/CMakeLists.txt
  5. +25 −0 python/core/qgsapplication.sip
  6. +16 −0 python/pyspatialite/CMakeLists.txt
  7. +0 −15 src/app/main.cpp
  8. +19 −16 src/app/qgisapp.cpp
  9. +3 −0 src/app/qgsbrowserdockwidget.cpp
  10. +71 −15 src/core/qgsapplication.cpp
  11. +29 −1 src/core/qgsapplication.h
  12. +1 −1 src/core/qgspoint.h
  13. +1 −1 src/core/symbology-ng/qgsellipsesymbollayerv2.cpp
  14. +3 −1 src/core/symbology-ng/qgsellipsesymbollayerv2.h
  15. +406 −59 src/core/symbology-ng/qgsfillsymbollayerv2.cpp
  16. +98 −12 src/core/symbology-ng/qgsfillsymbollayerv2.h
  17. +4 −0 src/core/symbology-ng/qgssymbollayerv2registry.cpp
  18. +1 −1 src/core/symbology-ng/qgssymbollayerv2registry.h
  19. +3 −0 src/crssync/CMakeLists.txt
  20. +2 −2 src/gui/qgscomposerview.cpp
  21. +177 −0 src/gui/symbology-ng/qgssymbollayerv2widget.cpp
  22. +57 −0 src/gui/symbology-ng/qgssymbollayerv2widget.h
  23. +2 −0 src/gui/symbology-ng/qgssymbolv2propertiesdialog.cpp
  24. +2 −0 src/helpviewer/CMakeLists.txt
  25. +10 −0 src/mapserver/qgsprojectparser.cpp
  26. +4 −0 src/plugins/CMakeLists.txt
  27. +4 −0 src/plugins/grass/CMakeLists.txt
  28. +1 −1 src/plugins/grass/qgsgrassmodule.cpp
  29. +1 −1 src/plugins/grass/qgsgrassshell.cpp
  30. +1 −1 src/plugins/grass/qgsgrasstools.cpp
  31. +4 −0 src/providers/CMakeLists.txt
  32. +4 −0 src/providers/grass/CMakeLists.txt
  33. +1 −1 src/providers/grass/qgsgrass.cpp
  34. +4 −4 src/providers/grass/qgsgrassrasterprovider.cpp
  35. +8 −3 src/python/qgspythonutilsimpl.cpp
  36. +91 −0 src/ui/symbollayer/widget_linepatternfill.ui
  37. +94 −0 src/ui/symbollayer/widget_pointpatternfill.ui
@@ -378,6 +378,16 @@ SET (QGIS_DATA_DIR ${QGIS_DATA_SUBDIR})
SET (QGIS_PLUGIN_DIR ${QGIS_PLUGIN_SUBDIR})
SET (QGIS_INCLUDE_DIR ${QGIS_INCLUDE_SUBDIR})

# set the default locations where the targets (executables, libraries) will land when compiled
# this is to allow running qgis from the source tree without having to actually do a "make install"
SET (QGIS_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/output)
SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${QGIS_OUTPUT_DIRECTORY}/${QGIS_BIN_SUBDIR})
SET (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${QGIS_OUTPUT_DIRECTORY}/${QGIS_LIB_SUBDIR})

# write a marker with source directory path into the output's bin directory
# if run from the build directory QGIS will detect it and alter the paths
FILE(WRITE ${QGIS_OUTPUT_DIRECTORY}/${QGIS_BIN_SUBDIR}/source_path.txt "${CMAKE_SOURCE_DIR}")

# manual page - makes sense only on unix systems
IF (UNIX AND NOT APPLE)
SET (DEFAULT_MANUAL_SUBDIR man)
@@ -6,7 +6,7 @@ MACRO(ADD_TRANSLATION_FILES _sources )
GET_FILENAME_COMPONENT(_in ${_current_FILE} ABSOLUTE)
GET_FILENAME_COMPONENT(_basename ${_current_FILE} NAME_WE)

SET(_out ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.qm)
SET(_out ${QGIS_OUTPUT_DIRECTORY}/i18n/${_basename}.qm)

ADD_CUSTOM_COMMAND(
OUTPUT ${_out}
@@ -19,6 +19,8 @@ MACRO(ADD_TRANSLATION_FILES _sources )
ENDFOREACH (_current_FILE)
ENDMACRO(ADD_TRANSLATION_FILES)

# make sure the output directory exists
file(MAKE_DIRECTORY ${QGIS_OUTPUT_DIRECTORY}/i18n)

FILE (GLOB TS_FILES *.ts)

@@ -348,6 +348,8 @@
<file>themes/gis/plugins/wfs.png</file>
<file>splash/splash.png</file>
<file>north_arrows/default.png</file>
<file>themes/default/locked.png</file>
<file>themes/default/unlocked.png</file>
</qresource>
<qresource prefix="/images/tips">
<file alias="symbol_levels.png">qgis_tips/symbol_levels.png</file>
@@ -1,5 +1,9 @@
ADD_SUBDIRECTORY(plugins)


SET (PYTHON_OUTPUT_DIRECTORY ${QGIS_OUTPUT_DIRECTORY}/python)
SET (QGIS_PYTHON_OUTPUT_DIRECTORY ${PYTHON_OUTPUT_DIRECTORY}/qgis)

IF (WITH_INTERNAL_SPATIALITE)
ADD_SUBDIRECTORY(pyspatialite)

@@ -9,6 +13,12 @@ IF (WITH_INTERNAL_SPATIALITE)
)
ENDIF (WITH_INTERNAL_SPATIALITE)


SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${QGIS_PYTHON_OUTPUT_DIRECTORY})
SET (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${QGIS_PYTHON_OUTPUT_DIRECTORY})
file(COPY __init__.py utils.py console.py DESTINATION ${QGIS_PYTHON_OUTPUT_DIRECTORY})


INCLUDE_DIRECTORIES(
${PYTHON_INCLUDE_PATH}
${SIP_INCLUDE_DIR}
@@ -49,6 +59,7 @@ IF(NOT PYQT4_VERSION_NUM LESS 264194) # 0x040802
SET(SIP_DISABLE_FEATURES ${SIP_DISABLE_FEATURES} QSETTYPE_CONVERSION)
ENDIF(NOT PYQT4_VERSION_NUM LESS 264194)


# core module
FILE(GLOB sip_files_core core/*.sip)
SET(SIP_EXTRA_FILES_DEPEND ${sip_files_core})
@@ -185,6 +185,14 @@ static void qtgui_UpdatePyArgv(PyObject *argvlist, int argc, char **argv)
//! Returns the path to default style (works as a starting point). Added in QGIS 1.4
static const QString defaultStyleV2Path();

//! Returns the path containing qgis_core, qgis_gui, qgispython (and other) libraries
//! @note Added in 2.0
static const QString libraryPath();

//! Returns the path with utility executables (help viewer, crssync, ...)
//! @note Added in 2.0
static const QString libexecPath();

//! Alters prefix path - used by 3rd party apps
static void setPrefixPath(const QString thePrefixPath, bool useDefaultPaths = FALSE);

@@ -235,5 +243,22 @@ static void qtgui_UpdatePyArgv(PyObject *argvlist, int argc, char **argv)
*/
static void registerOgrDrivers();

/**Converts absolute path to path relative to target
@note: this method was added in version 1.6*/
static QString absolutePathToRelativePath( QString apath, QString targetPath );
/**Converts path relative to target to an absolute path
@note: this method was added in version 1.6*/
static QString relativePathToAbsolutePath( QString rpath, QString targetPath );

/** Indicates whether running from build directory (not installed)
@note added in 2.0 */
static bool isRunningFromBuildDir();
/** Returns path to the source directory. Valid only when running from build directory
@note added in 2.0 */
static QString buildSourcePath();
/** Returns path to the build output directory. Valid only when running from build directory
@note added in 2.0 */
static QString buildOutputPath();

};

@@ -1,3 +1,7 @@
SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PYTHON_OUTPUT_DIRECTORY}/pyspatialite)
SET (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PYTHON_OUTPUT_DIRECTORY}/pyspatialite)


INCLUDE_DIRECTORIES(
../../src/core/spatialite/headers
../../src/core/spatialite/headers/spatialite
@@ -49,6 +53,18 @@ IF (WIN32)
SET_TARGET_PROPERTIES(pyspatialite PROPERTIES SUFFIX ".pyd")
ENDIF (WIN32)

FOREACH(file
lib/__init__.py
lib/dbapi2.py
lib/dump.py
)
ADD_CUSTOM_COMMAND(TARGET pyspatialite
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${file} ${PYTHON_OUTPUT_DIRECTORY}/pyspatialite/${file}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
ENDFOREACH(file)

INSTALL(TARGETS pyspatialite DESTINATION "${PYTHON_SITE_PACKAGES_DIR}/pyspatialite")
INSTALL(FILES
lib/__init__.py
@@ -479,21 +479,6 @@ int main( int argc, char *argv[] )
QApplication::setStyle( new QPlastiqueStyle );
#endif

// Check to see if qgis was started from the source directory.
// This is done by checking whether qgis binary is in 'src/app'
// directory. If running from there, exit gracefully.
// (QGIS might work incorrectly when run from the sources)
QString appDir = qApp->applicationDirPath();

if ( appDir.endsWith( "/src/app" ) )
{
QMessageBox::critical( 0, "QGIS Not Installed",
"You appear to be running QGIS from the source directory.\n"
"You must install QGIS using make install and run it from the "
"installed directory." );
exit( 1 );
}

QString i18nPath = QgsApplication::i18nPath();

/* Translation file for QGIS.
@@ -668,23 +668,26 @@ void QgisApp::dropEvent( QDropEvent *event )
QByteArray encodedData = event->mimeData()->data( "application/x-vnd.qgis.qgis.uri" );
QDataStream stream( &encodedData, QIODevice::ReadOnly );
QString xUri; // extended uri: layer_type:provider_key:uri
stream >> xUri;
QgsDebugMsg( xUri );
QRegExp rx( "^([^:]+):([^:]+):([^:]+):(.+)" );
if ( rx.indexIn( xUri ) != -1 )
while ( !stream.atEnd() )
{
QString layerType = rx.cap( 1 );
QString providerKey = rx.cap( 2 );
QString name = rx.cap( 3 );
QString uri = rx.cap( 4 );
QgsDebugMsg( "type: " + layerType + " key: " + providerKey + " name: " + name + " uri: " + uri );
if ( layerType == "vector" )
stream >> xUri;
QgsDebugMsg( xUri );
QRegExp rx( "^([^:]+):([^:]+):([^:]+):(.+)" );
if ( rx.indexIn( xUri ) != -1 )
{
addVectorLayer( uri, name, providerKey );
}
else if ( layerType == "raster" )
{
addRasterLayer( uri, name, providerKey, QStringList(), QStringList(), QString(), QString() );
QString layerType = rx.cap( 1 );
QString providerKey = rx.cap( 2 );
QString name = rx.cap( 3 );
QString uri = rx.cap( 4 );
QgsDebugMsg( "type: " + layerType + " key: " + providerKey + " name: " + name + " uri: " + uri );
if ( layerType == "vector" )
{
addVectorLayer( uri, name, providerKey );
}
else if ( layerType == "raster" )
{
addRasterLayer( uri, name, providerKey, QStringList(), QStringList(), QString(), QString() );
}
}
}
}
@@ -4616,7 +4619,7 @@ void QgisApp::loadPythonSupport()
{
QString pythonlibName( "qgispython" );
#if defined(Q_WS_MAC) || defined(Q_OS_LINUX)
pythonlibName.prepend( QgsApplication::prefixPath() + "/" + QGIS_LIB_SUBDIR + "/" );
pythonlibName.prepend( QgsApplication::libraryPath() );
#endif
#ifdef __MINGW32__
pythonlibName.prepend( "lib" );
@@ -15,6 +15,9 @@ QgsBrowserDockWidget::QgsBrowserDockWidget( QWidget * parent ) :
setWindowTitle( tr( "Browser" ) );

mBrowserView = new QTreeView( this );
mBrowserView->setDragEnabled( true );
mBrowserView->setDragDropMode( QTreeView::DragOnly );
mBrowserView->setSelectionMode( QAbstractItemView::ExtendedSelection );
setWidget( mBrowserView );

//connect( mBrowserView, SIGNAL( clicked( const QModelIndex& ) ), this, SLOT( itemClicked( const QModelIndex& ) ) );
@@ -40,9 +40,14 @@ QStringList QgsApplication::mFileOpenEventList;
QString QgsApplication::mPrefixPath;
QString QgsApplication::mPluginPath;
QString QgsApplication::mPkgDataPath;
QString QgsApplication::mLibraryPath;
QString QgsApplication::mLibexecPath;
QString QgsApplication::mThemeName;
QStringList QgsApplication::mDefaultSvgPaths;
QString QgsApplication::mConfigPath = QDir::homePath() + QString( "/.qgis/" );
bool QgsApplication::mRunningFromBuildDir = false;
QString QgsApplication::mBuildSourcePath;
QString QgsApplication::mBuildOutputPath;

/*!
\class QgsApplication
@@ -60,14 +65,46 @@ QString QgsApplication::mConfigPath = QDir::homePath() + QString( "/.qgis/" );
QgsApplication::QgsApplication( int & argc, char ** argv, bool GUIenabled, QString customConfigPath )
: QApplication( argc, argv, GUIenabled )
{
// check if QGIS is run from build directory (not the install directory)
QDir appDir( applicationDirPath() );
if ( appDir.exists( "source_path.txt" ) )
{
QFile f( applicationDirPath() + "/source_path.txt" );
if ( f.open( QIODevice::ReadOnly ) )
{
mRunningFromBuildDir = true;
mBuildSourcePath = f.readAll();
#if defined(Q_WS_MACX) || defined(Q_WS_WIN32) || defined(WIN32)
setPrefixPath( applicationDirPath(), true );
mBuildOutputPath = applicationDirPath();
#else
QDir myDir( applicationDirPath() );
myDir.cdUp();
QString myPrefix = myDir.absolutePath();
setPrefixPath( myPrefix, true );
mBuildOutputPath = applicationDirPath() + "/.."; // on linux
#endif
qDebug( "Running from build directory!" );
qDebug( "- source directory: %s", mBuildSourcePath.toAscii().data() );
qDebug( "- output directory of the build: %s", mBuildOutputPath.toAscii().data() );
}
}

if ( mRunningFromBuildDir )
{
// we run from source directory - not installed to destination (specified prefix)
mPrefixPath = QString(); // set invalid path
setPluginPath( mBuildOutputPath + "/" + QString( QGIS_PLUGIN_SUBDIR ) );
setPkgDataPath( mBuildSourcePath ); // directly source path - used for: doc, resources, svg
mLibraryPath = mBuildOutputPath + "/" + QGIS_LIB_SUBDIR + "/";
mLibexecPath = mBuildOutputPath + "/" + QGIS_LIBEXEC_SUBDIR + "/";
}
else
{
#if defined(Q_WS_MACX) || defined(Q_WS_WIN32) || defined(WIN32)
setPrefixPath( applicationDirPath(), true );
#else
QDir myDir( applicationDirPath() );
myDir.cdUp();
QString myPrefix = myDir.absolutePath();
setPrefixPath( myPrefix, true );
#endif
}

if ( !customConfigPath.isEmpty() )
{
@@ -170,6 +207,8 @@ void QgsApplication::setPrefixPath( const QString thePrefixPath, bool useDefault
setPluginPath( mPrefixPath + "/" + QString( QGIS_PLUGIN_SUBDIR ) );
setPkgDataPath( mPrefixPath + "/" + QString( QGIS_DATA_SUBDIR ) );
}
mLibraryPath = mPrefixPath + "/" + QGIS_LIB_SUBDIR + "/";
mLibexecPath = mPrefixPath + "/" + QGIS_LIBEXEC_SUBDIR + "/";
}

void QgsApplication::setPluginPath( const QString thePluginPath )
@@ -180,10 +219,10 @@ void QgsApplication::setPluginPath( const QString thePluginPath )
void QgsApplication::setPkgDataPath( const QString thePkgDataPath )
{
mPkgDataPath = thePkgDataPath;
QString svgPath = mPkgDataPath + QString( "/svg/" );
QString mySvgPath = svgPath();
// avoid duplicate entries
if ( !mDefaultSvgPaths.contains( svgPath ) )
mDefaultSvgPaths << svgPath;
if ( !mDefaultSvgPaths.contains( mySvgPath ) )
mDefaultSvgPaths << mySvgPath;
}

void QgsApplication::setDefaultSvgPaths( const QStringList& pathList )
@@ -193,6 +232,11 @@ void QgsApplication::setDefaultSvgPaths( const QStringList& pathList )

const QString QgsApplication::prefixPath()
{
if ( mRunningFromBuildDir )
{
qWarning( "!!! prefix path was requested, but it is not valid - we do not run from installed path !!!" );
}

return mPrefixPath;
}
const QString QgsApplication::pluginPath()
@@ -285,12 +329,10 @@ const QString QgsApplication::translatorsFilePath()
{
return mPkgDataPath + QString( "/doc/TRANSLATORS" );
}
/*!
Returns the path to the developer image directory.
*/

const QString QgsApplication::developerPath()
{
return mPkgDataPath + QString( "/images/developers/" );
return QString(); // developer images are no longer shipped!
}

/*!
@@ -302,7 +344,7 @@ const QString QgsApplication::helpAppPath()
#ifdef Q_OS_MACX
helpAppPath = applicationDirPath() + "/bin/qgis_help.app/Contents/MacOS";
#else
helpAppPath = prefixPath() + "/" QGIS_LIBEXEC_SUBDIR;
helpAppPath = libexecPath();
#endif
helpAppPath += "/qgis_help";
return helpAppPath;
@@ -312,7 +354,10 @@ const QString QgsApplication::helpAppPath()
*/
const QString QgsApplication::i18nPath()
{
return mPkgDataPath + QString( "/i18n/" );
if ( mRunningFromBuildDir )
return mBuildOutputPath + QString( "/i18n" );
else
return mPkgDataPath + QString( "/i18n/" );
}

/*!
@@ -386,7 +431,8 @@ const QStringList QgsApplication::svgPaths()
*/
const QString QgsApplication::svgPath()
{
return mPkgDataPath + QString( "/svg/" );
QString svgSubDir( mRunningFromBuildDir ? "/images/svg/" : "/svg/" );
return mPkgDataPath + svgSubDir;
}

const QString QgsApplication::userStyleV2Path()
@@ -399,6 +445,16 @@ const QString QgsApplication::defaultStyleV2Path()
return mPkgDataPath + QString( "/resources/symbology-ng-style.xml" );
}

const QString QgsApplication::libraryPath()
{
return mLibraryPath;
}

const QString QgsApplication::libexecPath()
{
return mLibexecPath;
}

QgsApplication::endian_t QgsApplication::endian()
{
return ( htonl( 1 ) == 1 ) ? XDR : NDR ;

0 comments on commit 5676b3b

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