Showing with 8,079 additions and 93 deletions.
  1. +14 −0 CMakeLists.txt
  2. +2 −0 cmake_templates/qgsconfig.h.in
  3. +1 −0 images/images.qrc
  4. BIN images/themes/default/mIconZip.png
  5. +7 −2 src/app/qgisapp.cpp
  6. +26 −0 src/app/qgsoptions.cpp
  7. +27 −0 src/core/CMakeLists.txt
  8. +298 −6 src/core/qgsdataitem.cpp
  9. +21 −2 src/core/qgsdataitem.h
  10. +458 −0 src/core/quazip/COPYING
  11. +490 −0 src/core/quazip/JlCompress.cpp
  12. +114 −0 src/core/quazip/JlCompress.h
  13. +66 −0 src/core/quazip/README.txt
  14. +135 −0 src/core/quazip/crypt.h
  15. +77 −0 src/core/quazip/ioapi.h
  16. +145 −0 src/core/quazip/qioapi.cpp
  17. +28 −0 src/core/quazip/quaadler32.cpp
  18. +29 −0 src/core/quazip/quaadler32.h
  19. +54 −0 src/core/quazip/quachecksum32.h
  20. +28 −0 src/core/quazip/quacrc32.cpp
  21. +26 −0 src/core/quazip/quacrc32.h
  22. +546 −0 src/core/quazip/quazip.cpp
  23. +406 −0 src/core/quazip/quazip.h
  24. +55 −0 src/core/quazip/quazip_global.h
  25. +481 −0 src/core/quazip/quazipfile.cpp
  26. +442 −0 src/core/quazip/quazipfile.h
  27. +66 −0 src/core/quazip/quazipfileinfo.h
  28. +51 −0 src/core/quazip/quazipnewinfo.cpp
  29. +102 −0 src/core/quazip/quazipnewinfo.h
  30. +1,603 −0 src/core/quazip/unzip.c
  31. +356 −0 src/core/quazip/unzip.h
  32. +1,281 −0 src/core/quazip/zip.c
  33. +245 −0 src/core/quazip/zip.h
  34. +141 −62 src/providers/gdal/qgsgdaldataitems.cpp
  35. +9 −1 src/providers/gdal/qgsgdaldataitems.h
  36. +62 −11 src/providers/gdal/qgsgdalprovider.cpp
  37. +2 −0 src/providers/gdal/qgsgdalprovider.h
  38. +79 −5 src/providers/ogr/qgsogrdataitems.cpp
  39. +52 −4 src/providers/ogr/qgsogrprovider.cpp
  40. +54 −0 src/ui/qgsoptionsbase.ui
14 changes: 14 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,20 @@ FIND_PROGRAM(QT_LRELEASE_EXECUTABLE
NO_DEFAULT_PATH
)


#############################################################
# search for zlib optional, used by quazip
# this uses script provided by cmake
# if WIN32 should use zlib from QT
FIND_PACKAGE(ZLIB)
IF (ZLIB_FOUND)
MESSAGE(STATUS "Found zlib: ${ZLIB_LIBRARIES}")
SET(HAVE_ZLIB TRUE)
ELSE (ZLIB_FOUND)
MESSAGE(STATUS "Could not find zlib (optional)")
ENDIF(ZLIB_FOUND)


#############################################################
# enable warnings

Expand Down
2 changes: 2 additions & 0 deletions cmake_templates/qgsconfig.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@

#cmakedefine HAVE_SPATIALITE

#cmakedefine HAVE_ZLIB

#cmakedefine HAVE_MSSQL

#cmakedefine HAVE_PYTHON
Expand Down
1 change: 1 addition & 0 deletions images/images.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@
<file>themes/default/mIconWms.png</file>
<file>themes/default/mIconWmsLayer.png</file>
<file>themes/default/mIconWarn.png</file>
<file>themes/default/mIconZip.png</file>
<file>themes/default/mMapserverExport.png</file>
<file>themes/default/plugin.png</file>
<file>themes/default/propertyicons/action.png</file>
Expand Down
Binary file added images/themes/default/mIconZip.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 7 additions & 2 deletions src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2325,8 +2325,10 @@ void QgisApp::askUserForGDALSublayers( QgsRasterLayer *layer )
return;

QStringList sublayers = layer->subLayers();
QgsDebugMsg( QString( "raster has %1 sublayers" ).arg( layer->subLayers().size() ) );

QgsDebugMsg( "sublayers:\n " + sublayers.join( " \n" ) + "\n" );
if ( sublayers.size() < 1 )
return;

// if promptLayers=Load all, load all sublayers without prompting
QSettings settings;
Expand Down Expand Up @@ -2401,6 +2403,7 @@ void QgisApp::loadGDALSublayers( QString uri, QStringList list )
else
delete subLayer;
}

}
}

Expand Down Expand Up @@ -6776,6 +6779,7 @@ QgsRasterLayer* QgisApp::addRasterLayer(
// draw the map
mMapCanvas->freeze( false );
mMapCanvas->refresh();

return layer;
} // QgisApp::addRasterLayer

Expand Down Expand Up @@ -6817,7 +6821,8 @@ bool QgisApp::addRasterLayers( QStringList const &theFileNameQStringList, bool g
QFileInfo myFileInfo( *myIterator );
// get the directory the .adf file was in
QString myDirNameQString = myFileInfo.path();
QString myBaseNameQString = myFileInfo.completeBaseName();
//extract basename with extension
QString myBaseNameQString = myFileInfo.completeBaseName() + "." + myFileInfo.suffix();
//only allow one copy of a ai grid file to be loaded at a
//time to prevent the user selecting all adfs in 1 dir which
//actually represent 1 coverage,
Expand Down
26 changes: 26 additions & 0 deletions src/app/qgsoptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@
#include <gdal.h>
#include <geos_c.h>

#include "qgsconfig.h"

/**
* \class QgsOptions - Set user options and preferences
* Constructor
Expand Down Expand Up @@ -198,6 +200,28 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WFlags fl ) :
cmbPromptRasterSublayers->addItem( tr( "Load all" ) );
cmbPromptRasterSublayers->setCurrentIndex( settings.value( "/qgis/promptForRasterSublayers", 0 ).toInt() );

// Scan for valid items in the browser dock
cmbScanItemsInBrowser->clear();
cmbScanItemsInBrowser->addItem( tr( "Check file contents" ) ); // 0
cmbScanItemsInBrowser->addItem( tr( "Check extension" ) ); // 1
cmbScanItemsInBrowser->setCurrentIndex( settings.value( "/qgis/scanItemsInBrowser", 1 ).toInt() );

// Scan for contents of compressed files (.zip) in browser dock
cmbScanZipInBrowser->clear();
cmbScanZipInBrowser->addItem( tr( "No" ) ); // 0
cmbScanZipInBrowser->addItem( tr( "Passthru" ) ); // 1
// only add these options if zlib is available
#ifdef HAVE_ZLIB
cmbScanZipInBrowser->addItem( tr( "Basic scan" ) ); // 2
cmbScanZipInBrowser->addItem( tr( "Full scan" ) ); // 3
cmbScanZipInBrowser->setCurrentIndex( settings.value( "/qgis/scanZipInBrowser", 1 ).toInt() );
#else
if ( settings.value( "/qgis/scanZipInBrowser", 1 ) == 0 )
cmbScanZipInBrowser->setCurrentIndex( 0 );
else
cmbScanZipInBrowser->setCurrentIndex( 1 );
#endif

// set the display update threshold
spinBoxUpdateThreshold->setValue( settings.value( "/Map/updateThreshold" ).toInt() );
//set the default projection behaviour radio buttongs
Expand Down Expand Up @@ -684,6 +708,8 @@ void QgsOptions::saveOptions()
settings.setValue( "/qgis/attributeTableBehaviour", cmbAttrTableBehaviour->currentIndex() );
settings.setValue( "/qgis/attributeTableRowCache", spinBoxAttrTableRowCache->value() );
settings.setValue( "/qgis/promptForRasterSublayers", cmbPromptRasterSublayers->currentIndex() );
settings.setValue( "/qgis/scanItemsInBrowser", cmbScanItemsInBrowser->currentIndex() );
settings.setValue( "/qgis/scanZipInBrowser", cmbScanZipInBrowser->currentIndex() );
settings.setValue( "/qgis/dockIdentifyResults", cbxIdentifyResultsDocked->isChecked() );
settings.setValue( "/qgis/dockSnapping", cbxSnappingOptionsDocked->isChecked() );
settings.setValue( "/qgis/addPostgisDC", cbxAddPostgisDC->isChecked() );
Expand Down
27 changes: 27 additions & 0 deletions src/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,21 @@ SET(QGIS_CORE_SRCS
qgsspatialindex.cpp
)

IF(HAVE_ZLIB)
SET(QGIS_CORE_SRCS
${QGIS_CORE_SRCS}
quazip/unzip.c
quazip/zip.c
quazip/JlCompress.cpp
quazip/qioapi.cpp
quazip/quaadler32.cpp
quazip/quacrc32.cpp
quazip/quazip.cpp
quazip/quazipfile.cpp
quazip/quazipnewinfo.cpp
)
ENDIF(HAVE_ZLIB)

IF(WIN32)
SET(QGIS_CORE_SRCS
${QGIS_CORE_SRCS}
Expand Down Expand Up @@ -281,6 +296,14 @@ SET(QGIS_CORE_MOC_HDRS
gps/qextserialport/qextserialenumerator.h
)

IF (HAVE_ZLIB)
SET(QGIS_CORE_MOC_HDRS
${QGIS_CORE_MOC_HDRS}
quazip/quazipfile.h
)
ENDIF(HAVE_ZLIB)


IF (QT_MOBILITY_LOCATION_FOUND)
SET(QGIS_CORE_MOC_HDRS
${QGIS_CORE_MOC_HDRS}
Expand Down Expand Up @@ -550,6 +573,10 @@ IF (NOT WITH_INTERNAL_SPATIALINDEX)
TARGET_LINK_LIBRARIES(qgis_core ${SPATIALINDEX_LIBRARY})
ENDIF (NOT WITH_INTERNAL_SPATIALINDEX)

IF (HAVE_ZLIB)
INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIRS})
TARGET_LINK_LIBRARIES(qgis_core ${ZLIB_LIBRARIES})
ENDIF (HAVE_ZLIB)

IF (APPLE)
SET_TARGET_PROPERTIES(qgis_core PROPERTIES BUILD_WITH_INSTALL_RPATH TRUE )
Expand Down
Loading