Skip to content

Commit

Permalink
merge fixes from trunk:
Browse files Browse the repository at this point in the history
r10117: fix #1532
r10116: skip labels with size<=0 - otherwise the size is ignored d
r10094: fix #1523
r10084: fix #1516
r10078: add -Wformat-security to PEDANTIC 
r10073: update desktop integration in debian package
r10068: fix comparision 
r9943: fix postgres <8.3 support
r9916: speed up QgsRubberBand::setToGeometry()
r9914: update trac link in about box
r9908: apply patch #1447 from smizuno (thanks!)
r9894+9895: update debian packaging
r9880: update german translation


git-svn-id: http://svn.osgeo.org/qgis/branches/Version-1_0@10136 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Feb 8, 2009
1 parent 126bb08 commit c2e6c35
Show file tree
Hide file tree
Showing 41 changed files with 202 additions and 138 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Expand Up @@ -179,7 +179,7 @@ IF (PEDANTIC)
ADD_DEFINITIONS( /wd4512 ) # assignment operator could not be generated (sqlite3_index_info)
ADD_DEFINITIONS( /wd4610 ) # user defined constructor required (sqlite3_index_info)
ELSE (MSVC)
ADD_DEFINITIONS( -Wall -Wno-long-long )
ADD_DEFINITIONS( -Wall -Wno-long-long -Wformat-security )
# Qt produces lots of warnings with strict aliasing (as of Qt 4.4.0 & GCC 4.3)
# ADD_DEFINITIONS( -fstrict-aliasing -Wstrict-aliasing=1 )
ENDIF (MSVC)
Expand Down
9 changes: 8 additions & 1 deletion cmake/FindPostgres.cmake
Expand Up @@ -61,6 +61,13 @@ ENDIF(WIN32)

IF (POSTGRES_INCLUDE_DIR AND POSTGRES_LIBRARY)
SET(POSTGRES_FOUND TRUE)

IF(EXISTS "${POSTGRES_INCLUDE_DIR}/pg_config.h")
SET(HAVE_PGCONFIG TRUE)
ELSE(EXISTS "${POSTGRES_INCLUDE_DIR}/pg_config.h")
SET(HAVE_PGCONFIG FALSE)
ENDIF(EXISTS "${POSTGRES_INCLUDE_DIR}/pg_config.h")

ENDIF (POSTGRES_INCLUDE_DIR AND POSTGRES_LIBRARY)


Expand All @@ -80,5 +87,5 @@ ELSE (POSTGRES_FOUND)
ELSE (POSTGRES_FIND_REQUIRED)
MESSAGE(STATUS "Could not find PostgreSQL")
ENDIF (POSTGRES_FIND_REQUIRED)

ENDIF (POSTGRES_FOUND)
11 changes: 11 additions & 0 deletions debian/changelog
@@ -1,3 +1,14 @@
qgis (1.0.0) experimental; urgency=low

* new upstream release
* update qgis.mime
* add qgis.desktop and qgis.xml
* add mime types for KDE
* don't ignore errors in preinst and postrm
* run ldconfig in postrm

-- Jürgen E. Fischer <jef@norbit.de> Tue, 23 Dec 2008 20:42:21 +0100

qgis (1.0preview18) experimental; urgency=low

* add suggestion for gpsbabel
Expand Down
5 changes: 5 additions & 0 deletions debian/qgis-plugin-grass.postrm
@@ -1,5 +1,10 @@
#!/bin/sh

set -e

if [ "$1" = "remove" ]; then
dpkg-divert --package qgis-plugin-grass --remove --rename --divert /usr/bin/qgis.bin /usr/bin/qgis
ldconfig
fi

exit 0
4 changes: 4 additions & 0 deletions debian/qgis-plugin-grass.preinst
@@ -1,5 +1,9 @@
#!/bin/sh

set -e

if [ "$1" = "install" -o "$1" = "upgrade" ]; then
dpkg-divert --package qgis-plugin-grass --add --rename --divert /usr/bin/qgis.bin /usr/bin/qgis
fi

exit 0
26 changes: 26 additions & 0 deletions debian/qgis.desktop
@@ -0,0 +1,26 @@
[Desktop Entry]
Type=Application
Name=Quantum GIS
Version=1.0
GenericName=Geographical Information System
GenericName[de]=Geographisches Informationssystem
Icon=qgis-icon
TryExec=/usr/bin/qgis
Exec=/usr/bin/qgis %F
Terminal=false
StartupNotify=false
Categories=Qt;Science;GIS;OSGeo;
MimeType=application/x-qgis-project;image/tiff;image/jpeg;image/jp2;application/x-raster-aig;application/x-raster-ecw;application/x-raster-mrsid;application/x-mapinfo-mif;application/x-esri-shape;
[Desktop Entry]
Type=Application
Name=Quantum GIS
Version=1.0
GenericName=Geographical Information System
GenericName[de]=Geographisches Informationssystem
Icon=qgis-icon
TryExec=/usr/bin/qgis
Exec=/usr/bin/qgis %F
Terminal=false
StartupNotify=false
Categories=Education;Geography;Qt;
MimeType=application/x-qgis-project;image/tiff;image/jpeg;image/jp2;application/x-raster-aig;application/x-raster-ecw;application/x-raster-mrsid;application/x-mapinfo-mif;application/x-esri-shape;
11 changes: 11 additions & 0 deletions debian/qgis.install
Expand Up @@ -34,3 +34,14 @@ usr/lib/qgis/libdxf2shpconverterplugin.so
usr/lib/qgis/libinterpolationplugin.so
usr/lib/qgis/libogrconverterplugin.so
usr/lib/qgis/libcoordinatecaptureplugin.so
../qgis.desktop usr/share/applications
../qgis.xml usr/share/mime/packages
../mime/application/x-esri-shape.desktop usr/share/mimelnk/application
../mime/application/x-mapinfo-mif.desktop usr/share/mimelnk/application
../mime/application/x-esri-crs.desktop usr/share/mimelnk/application
../mime/application/x-raster-ecw.desktop usr/share/mimelnk/application
../mime/application/x-adobe-mif.desktop usr/share/mimelnk/application
../mime/application/x-raster-aig.desktop usr/share/mimelnk/application
../mime/application/x-qgis-project.desktop usr/share/mimelnk/application
../mime/application/x-raster-mrsid.desktop usr/share/mimelnk/application
../mime/application/x-qgis-layer-settings.desktop usr/share/mimelnk/application
16 changes: 9 additions & 7 deletions debian/qgis.mime
@@ -1,7 +1,9 @@
application/shp; qgis '%s'; edit=qgis '%s'; test=test "$DISPLAY" != ""; priority=2
application/mif; qgis '%s'; edit=qgis '%s'; test=test "$DISPLAY" != ""; priority=2
application/jpg; qgis '%s'; edit=qgis '%s'; test=test "$DISPLAY" != ""; priority=2
application/tif; qgis '%s'; edit=qgis '%s'; test=test "$DISPLAY" != ""; priority=2
application/aig; qgis '%s'; edit=qgis '%s'; test=test "$DISPLAY" != ""; priority=2
application/ecw; qgis '%s'; edit=qgis '%s'; test=test "$DISPLAY" != ""; priority=2
application/sid; qgis '%s'; edit=qgis '%s'; test=test "$DISPLAY" != ""; priority=2
image/tif; qgis '%s'; description="TIFF Image"; test=test -n "$DISPLAY"; nametemplate=%s.tif; priority=2
image/jpg; qgis '%s'; description="JPEG Image"; test=test -n "$DISPLAY"; nametemplate=%s.jpg; priority=2
image/jp2; qgis '%s'; description="JPEG 2000 Image"; test=test -n "$DISPLAY"; nametempalte=%s.jp2; priority=2
application/x-raster-aig; qgis '%s'; description="AIG raster data"; test=test -n "$DISPLAY"; nametemplate=%s.aig; priority=2
application/x-raster-ecw; qgis '%s'; description="ECW raster data"; test=test -n "$DISPLAY"; nametemplate=%s.ecw; priority=2
application/x-raster-mrsid; qgis '%s'; description="MrSID raster data"; test=test -n "$DISPLAY"; nametemplate=%s.sid; priority=2
application/x-raster-mif; qgis '%s'; description="MapInfo file"; test=test -n "$DISPLAY"; nametemplate=%s.mif; priority=2
application/x-esri-shape; qgis '%s'; description="ESRI shape file"; test=test -n "$DISPLAY"; nametemplate=%s.shp; priority=2
application/x-qgis-project; qgis '%s'; description="Quantum GIS Project"; test=test -n "$DISPLAY"; nametemplate=%s.qgs
4 changes: 4 additions & 0 deletions src/app/CMakeLists.txt
Expand Up @@ -133,6 +133,10 @@ SET (QGIS_APP_MOC_HDRS
)

IF (POSTGRES_FOUND)
IF(HAVE_PGCONFIG)
ADD_DEFINITIONS(-DHAVE_PGCONFIG=1)
ENDIF(HAVE_PGCONFIG)

SET (QGIS_APP_SRCS ${QGIS_APP_SRCS}
qgsdbsourceselect.cpp
qgsnewconnection.cpp
Expand Down
2 changes: 1 addition & 1 deletion src/app/composer/qgscomposer.cpp
Expand Up @@ -550,7 +550,7 @@ void QgsComposer::on_mActionExportAsImage_activated( void )
}

myOutputFileNameQString = myQFileDialog->selectedFiles().last();
qWarning( myOutputFileNameQString.toLocal8Bit().data() );
qWarning( "%s", myOutputFileNameQString.toLocal8Bit().constData() );
QString myFilterString = myQFileDialog->selectedFilter();
QgsDebugMsg( QString( "Selected filter: %1" ).arg( myFilterString ) );
QgsDebugMsg( QString( "Image type: %1" ).arg( myFilterMap[myFilterString] ) );
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgisapp.cpp
Expand Up @@ -5500,7 +5500,7 @@ void QgisApp::oldProjectVersionWarning( QString oldVersion )
tr( "<p>Version of the project file: %1<br>Current version of QGIS: %2" ) )
.arg( oldVersion )
.arg( QGis::QGIS_VERSION )
.arg( "<a href=https://svn.qgis.org/trac/wiki>http://svn.qgis.org/trac/wiki</a> " )
.arg( "<a href=\"https://trac.osgeo.org/qgis\">http://trac.osgeo.org/qgis</a> " )
.arg( tr( "<tt>Settings:Options:General</tt>", "Menu path to setting options" ) )
.arg( tr( "Warn me when opening a project file saved with an older version of QGIS" ) )
);
Expand Down
8 changes: 4 additions & 4 deletions src/app/qgsabout.cpp
Expand Up @@ -56,8 +56,8 @@ void QgsAbout::init()

QFile file( QgsApplication::authorsFilePath() );
#ifdef QGISDEBUG
printf(( "Reading authors file " + file.fileName() +
".............................................\n" ).toLocal8Bit().constData() );
printf( "Reading authors file %s.............................................\n",
file.fileName().toLocal8Bit().constData() );
#endif
if ( file.open( QIODevice::ReadOnly ) )
{
Expand Down Expand Up @@ -103,8 +103,8 @@ void QgsAbout::init()
// read the SPONSORS file and populate the text widget
QFile sponsorFile( QgsApplication::sponsorsFilePath() );
#ifdef QGISDEBUG
printf(( "Reading sponsors file " + sponsorFile.fileName() +
".............................................\n" ).toLocal8Bit().constData() );
printf( "Reading sponsors file %s.............................................\n",
sponsorFile.fileName().toLocal8Bit().constData() );
#endif
if ( sponsorFile.open( QIODevice::ReadOnly ) )
{
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsattributetable.cpp
Expand Up @@ -264,7 +264,7 @@ int QgsAttributeTable::compareItems( QString s1, QString s2, bool ascending, boo
return 1;
}
}
else if ( compareValue = 0 )
else if ( compareValue == 0 )
{
return 0;
}
Expand Down
3 changes: 3 additions & 0 deletions src/app/qgsattributetabledisplay.cpp
Expand Up @@ -296,6 +296,9 @@ void QgsAttributeTableDisplay::zoomMapToSelectedRows()

void QgsAttributeTableDisplay::search()
{
if ( tblAttributes->rowCount() == 0 )
return;

int type = tblAttributes->item( 0, mSearchColumns->currentIndex() )->data( QgsAttributeTable::AttributeType ).toInt();
bool numeric = ( type == QVariant::Int || type == QVariant::Double );

Expand Down
7 changes: 4 additions & 3 deletions src/app/qgsdbsourceselect.cpp
Expand Up @@ -38,7 +38,9 @@ email : sherman at mrcc.com
#include <cassert>
#include <iostream>

#ifdef HAVE_PGCONFIG
#include <pg_config.h>
#endif

QgsDbSourceSelect::QgsDbSourceSelect( QWidget *parent, Qt::WFlags fl )
: QDialog( parent, fl ), mColumnTypeThread( NULL ), pd( 0 )
Expand Down Expand Up @@ -440,8 +442,7 @@ void QgsDbSourceSelect::on_btnConnect_clicked()
}
else
{
qDebug( "Unable to get list of spatially enabled tables from the database" );
qDebug( PQerrorMessage( pd ) );
qDebug( "Unable to get list of spatially enabled tables from the database\n%s", PQerrorMessage( pd ) );
}
// BEGIN CHANGES ECOS
if ( cmbConnections->count() > 0 )
Expand Down Expand Up @@ -509,7 +510,7 @@ void QgsDbSourceSelect::setSql( const QModelIndex& index )
QString schemaName = mTableModel.itemFromIndex( mProxyModel.mapToSource( schemaSibling ) )->text();
QString tableName = mTableModel.itemFromIndex( mProxyModel.mapToSource( tableSibling ) )->text();
QString tableString = "\"" + schemaName + "\".\"" + tableName + "\"";
qWarning( tableString.toUtf8() );
qWarning( "%s", tableString.toUtf8().constData() );

QString currentSql;
QModelIndex sqlSibling = index.sibling( index.row(), 4 );
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsgeomtypedialog.cpp
Expand Up @@ -96,7 +96,7 @@ void QgsGeomTypeDialog::attributes( std::list<std::pair<QString, QString> >& at
QTreeWidgetItem *item = *it;
at.push_back( std::make_pair( item->text( 0 ), item->text( 1 ) ) );
#ifdef QGISDEBUG
qWarning(( "appending " + item->text( 0 ) + "//" + item->text( 1 ) ).toLocal8Bit().data() );
qWarning( "appending %s//%s", item->text( 0 ).toLocal8Bit().constData(), item->text( 1 ).toLocal8Bit().constData() );
#endif
++it;
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsgraduatedsymboldialog.cpp
Expand Up @@ -332,7 +332,7 @@ void QgsGraduatedSymbolDialog::adjustClassification()
pen.setColor( Qt::black );
}

pen.setWidth( 0.1 );
pen.setWidthF( symbol->lineWidth() );
brush.setStyle( Qt::SolidPattern );
symbol->setPen( pen );
symbol->setBrush( brush );
Expand Down
6 changes: 3 additions & 3 deletions src/app/qgsuniquevaluedialog.cpp
Expand Up @@ -183,15 +183,15 @@ void QgsUniqueValueDialog::setSymbolColor( QgsSymbol *symbol, QColor thecolor )
{
pen.setColor( thecolor );
pen.setStyle( Qt::SolidLine );
pen.setWidthF( 0.1 );
pen.setWidthF( symbol->lineWidth() );
}
else
{
brush.setColor( thecolor );
brush.setStyle( Qt::SolidPattern );
pen.setColor( Qt::black );
pen.setStyle( Qt::SolidLine );
pen.setWidthF( 0.1 );
pen.setWidthF( symbol->lineWidth() );
}
symbol->setPen( pen );
symbol->setBrush( brush );
Expand Down Expand Up @@ -247,7 +247,7 @@ void QgsUniqueValueDialog::randomizeColors()
void QgsUniqueValueDialog::resetColors()
{
QColor white;
white.setRgb( 255.0, 255.0, 255.0 );
white.setRgb( 255, 255, 255 );

QList<QListWidgetItem *> selection = mClassListWidget->selectedItems();
if ( selection.size() == 0 )
Expand Down
8 changes: 4 additions & 4 deletions src/core/composer/qgscomposition.cpp
Expand Up @@ -197,7 +197,7 @@ void QgsComposition::addItemToZList( QgsComposerItem* item )
return;
}
mItemZList.push_back( item );
qWarning( QString::number( mItemZList.size() ).toLocal8Bit().data() );
qWarning( "%d", mItemZList.size() );
item->setZValue( mItemZList.size() );
}

Expand Down Expand Up @@ -330,7 +330,7 @@ void QgsComposition::updateZValues()
currentItem = *it;
if ( currentItem )
{
qWarning( QString::number( counter ).toLocal8Bit().data() );
qWarning( "%d", counter );
currentItem->setZValue( counter );
}
++counter;
Expand All @@ -344,7 +344,7 @@ void QgsComposition::sortZList()
QLinkedList<QgsComposerItem*>::iterator before_it = mItemZList.begin();
for ( ; before_it != mItemZList.end(); ++before_it )
{
qWarning( QString::number(( *before_it )->zValue() ).toLocal8Bit().data() );
qWarning( "%lf", ( *before_it )->zValue() );
}

QMutableLinkedListIterator<QgsComposerItem*> it( mItemZList );
Expand Down Expand Up @@ -398,6 +398,6 @@ void QgsComposition::sortZList()
QLinkedList<QgsComposerItem*>::iterator after_it = mItemZList.begin();
for ( ; after_it != mItemZList.end(); ++after_it )
{
qWarning( QString::number(( *after_it )->zValue() ).toLocal8Bit().data() );
qWarning( "%lf", ( *after_it )->zValue() );
}
}
10 changes: 5 additions & 5 deletions src/core/qgslabel.cpp
Expand Up @@ -91,7 +91,6 @@ void QgsLabel::renderLabel( QPainter * painter, const QgsRectangle& viewExtent,
QgsFeature &feature, bool selected, QgsLabelAttributes *classAttributes,
double sizeScale, double rasterScaleFactor )
{

QPen pen;
QFont font;
QString value;
Expand Down Expand Up @@ -163,10 +162,11 @@ void QgsLabel::renderLabel( QPainter * painter, const QgsRectangle& viewExtent,
//and scale the painter down by rasterScaleFactor when drawing the label
size *= rasterScaleFactor;

if ( size > 0.0 )
{
font.setPixelSize( size );
}
if (( int )size <= 0 )
// skip too small labels
return;

font.setPixelSize( size );

value = fieldValue( Color, feature );
if ( value.isEmpty() )
Expand Down

0 comments on commit c2e6c35

Please sign in to comment.