Skip to content

Commit 7770b68

Browse files
committedMay 24, 2011
Merge branch 'master' of github.com:qgis/Quantum-GIS
2 parents 4d5455f + 0b2317e commit 7770b68

25 files changed

+306
-402
lines changed
 

‎CMakeLists.txt

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -348,27 +348,17 @@ IF(COMMAND cmake_policy)
348348
ENDIF(COMMAND cmake_policy)
349349

350350
IF (WIN32)
351-
# expect that classes are being imported
352-
# Note: MSVC doesn't like when the macros are quotes
353-
# and MSYS doesn't like them unqouted (bacause of braces)
354-
IF (MSVC)
355-
ADD_DEFINITIONS("-DCORE_EXPORT=__declspec(dllimport)")
356-
ADD_DEFINITIONS("-DGUI_EXPORT=__declspec(dllimport)")
357-
ADD_DEFINITIONS("-DPYTHON_EXPORT=__declspec(dllimport)")
358-
ADD_DEFINITIONS("-DANALYSIS_EXPORT=__declspec(dllimport)")
359-
ELSE (MSVC)
360-
ADD_DEFINITIONS("\"-DCORE_EXPORT=__declspec(dllimport)\"")
361-
ADD_DEFINITIONS("\"-DGUI_EXPORT=__declspec(dllimport)\"")
362-
ADD_DEFINITIONS("\"-DPYTHON_EXPORT=__declspec(dllimport)\"")
363-
ADD_DEFINITIONS("\"-DANALYSIS_EXPORT=__declspec(dllimport)\"")
364-
ENDIF (MSVC)
351+
SET(DLLIMPORT "__declspec(dllimport)")
352+
SET(DLLEXPORT "__declspec(dllexport)")
365353
ELSE (WIN32)
366-
# other compilers don't use that MSVC construct
367-
ADD_DEFINITIONS(-DCORE_EXPORT=)
368-
ADD_DEFINITIONS(-DGUI_EXPORT=)
369-
ADD_DEFINITIONS(-DPYTHON_EXPORT=)
370-
ADD_DEFINITIONS(-DANALYSIS_EXPORT=)
371-
ENDIF (WIN32)
354+
SET(DLLIMPORT "")
355+
SET(DLLEXPORT "")
356+
ENDIF(WIN32)
357+
358+
ADD_DEFINITIONS("-DCORE_EXPORT=${DLLIMPORT}")
359+
ADD_DEFINITIONS("-DGUI_EXPORT=${DLLIMPORT}")
360+
ADD_DEFINITIONS("-DPYTHON_EXPORT=${DLLIMPORT}")
361+
ADD_DEFINITIONS("-DANALYSIS_EXPORT=${DLLIMPORT}")
372362

373363
#############################################################
374364
# user-changeable settings which can be used to customize

‎i18n/qgis_it.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24753,7 +24753,7 @@ p, li { white-space: pre-wrap; }
2475324753
<message>
2475424754
<location filename="../src/ui/qgsoptionsbase.ui" line="1531"/>
2475524755
<source>Override system locale</source>
24756-
<translation>Sovascrivi lingua in uso</translation>
24756+
<translation>Sovrascrivi lingua in uso</translation>
2475724757
</message>
2475824758
<message>
2475924759
<location filename="../src/ui/qgsoptionsbase.ui" line="1550"/>
@@ -26832,7 +26832,7 @@ Result: %3 (%4)</translation>
2683226832
The error message from the database was:
2683326833
%2.
2683426834
SQL: %3</source>
26835-
<translation>Impossibiel accedere alla tabella %1.
26835+
<translation>Impossibile accedere alla tabella %1.
2683626836
Questo il messaggio di errore dal database:
2683726837
%2.
2683826838
SQL: %3</translation>

‎src/browser/qgsbrowsermodel.cpp

100755100644
File mode changed.

‎src/core/qgscredentials.cpp

100644100755
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ QgsCredentials *QgsCredentials::smInstance = 0;
2525
void QgsCredentials::setInstance( QgsCredentials *theInstance )
2626
{
2727
if ( smInstance )
28+
{
2829
QgsDebugMsg( "already registered an instance of QgsCredentials" );
30+
}
2931

3032
smInstance = theInstance;
3133
}

‎src/core/qgsdataitem.cpp

100755100644
Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
***************************************************************************/
1717
/* $Id$ */
1818

19-
#include <typeinfo>
20-
2119
#include <QApplication>
2220
#include <QDateTime>
2321
#include <QDir>
@@ -258,12 +256,12 @@ void QgsDataItem::refresh()
258256

259257
bool QgsDataItem::equal( const QgsDataItem *other )
260258
{
261-
if ( typeid ( this ) == typeid ( other ) &&
262-
mPath == other->path() )
263-
{
264-
return true;
265-
}
266-
return false;
259+
if ( metaObject()->className() == other->metaObject()->className() &&
260+
mPath == other->path() )
261+
{
262+
return true;
263+
}
264+
return false;
267265
}
268266

269267
// ---------------------------------------------------------------------
@@ -349,7 +347,7 @@ QgsDirectoryItem::QgsDirectoryItem( QgsDataItem* parent, QString name, QString p
349347
QgsDebugMsg( library->fileName() + " has NoDataCapabilities" );
350348
continue;
351349
}
352-
QgsDebugMsg( QString ( "%1 dataCapabilities : %2").arg(library->fileName()).arg(dataCapabilities() ) );
350+
QgsDebugMsg( QString( "%1 dataCapabilities : %2" ).arg( library->fileName() ).arg( dataCapabilities() ) );
353351
mLibraries.append( library );
354352
}
355353
else
@@ -380,11 +378,11 @@ QVector<QgsDataItem*> QgsDirectoryItem::createChildren( )
380378
children.append( item );
381379
}
382380

383-
QStringList fileEntries = dir.entryList( QDir::Dirs|QDir::NoDotAndDotDot|QDir::Files, QDir::Name );
381+
QStringList fileEntries = dir.entryList( QDir::Dirs | QDir::NoDotAndDotDot | QDir::Files, QDir::Name );
384382
foreach( QString name, fileEntries )
385383
{
386384
QString path = dir.absoluteFilePath( name );
387-
QFileInfo fileInfo ( path );
385+
QFileInfo fileInfo( path );
388386
foreach( QLibrary *library, mLibraries )
389387
{
390388
// we could/should create separate list of providers for each purpose
@@ -398,10 +396,10 @@ QVector<QgsDataItem*> QgsDirectoryItem::createChildren( )
398396

399397
int capabilities = dataCapabilities();
400398

401-
if ( !( (fileInfo.isFile() && (capabilities & QgsDataProvider::File)) ||
402-
(fileInfo.isDir() && (capabilities & QgsDataProvider::Dir))) )
399+
if ( !(( fileInfo.isFile() && ( capabilities & QgsDataProvider::File ) ) ||
400+
( fileInfo.isDir() && ( capabilities & QgsDataProvider::Dir ) ) ) )
403401
{
404-
continue;
402+
continue;
405403
}
406404

407405
dataItem_t * dataItem = ( dataItem_t * ) cast_to_fptr( library->resolve( "dataItem" ) );

‎src/core/qgsdataitem.h

100755100644
File mode changed.

‎src/core/qgspallabeling.cpp

100644100755
Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -576,9 +576,10 @@ void QgsPalLayerSettings::registerFeature( QgsFeature& f, const QgsRenderContext
576576
xPos, yPos, dataDefinedPosition, angle, dataDefinedRotation ) )
577577
return;
578578
}
579-
catch ( std::exception* e )
579+
catch ( std::exception &e )
580580
{
581-
QgsDebugMsg( QString( "Ignoring feature %1 due PAL exception: " ).arg( f.id() ) + QString::fromLatin1( e->what() ) );
581+
Q_UNUSED( e );
582+
QgsDebugMsg( QString( "Ignoring feature %1 due PAL exception: " ).arg( f.id() ) + QString::fromLatin1( e.what() ) );
582583
return;
583584
}
584585

@@ -869,9 +870,10 @@ void QgsPalLabeling::registerDiagramFeature( QgsVectorLayer* layer, QgsFeature&
869870
return;
870871
}
871872
}
872-
catch ( std::exception* e )
873+
catch ( std::exception &e )
873874
{
874-
QgsDebugMsg( QString( "Ignoring feature %1 due PAL exception: " ).arg( feat.id() ) + QString::fromLatin1( e->what() ) );
875+
Q_UNUSED( e );
876+
QgsDebugMsg( QString( "Ignoring feature %1 due PAL exception: " ).arg( feat.id() ) + QString::fromLatin1( e.what() ) );
875877
return;
876878
}
877879

@@ -961,6 +963,7 @@ void QgsPalLabeling::drawLabeling( QgsRenderContext& context )
961963
}
962964
catch ( std::exception& e )
963965
{
966+
Q_UNUSED( e );
964967
QgsDebugMsg( "PAL EXCEPTION :-( " + QString::fromLatin1( e.what() ) );
965968
//mActiveLayers.clear(); // clean up
966969
return;

‎src/core/qgssearchstring.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
//! global function from parser.y that interfaces parser
2525
extern QgsSearchTreeNode* parseSearchString( const QString& str, QString& parserErrorMsg );
2626

27-
2827
QgsSearchString::QgsSearchString()
2928
{
3029
mTree = NULL;

‎src/core/qgsvectorlayer.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -778,6 +778,7 @@ void QgsVectorLayer::drawRendererV2( QgsRenderContext& rendererContext, bool lab
778778
}
779779
catch ( const QgsCsException &cse )
780780
{
781+
Q_UNUSED( cse );
781782
QgsDebugMsg( QString( "Failed to transform a point while drawing a feature of type '%1'. Ignoring this feature. %2" )
782783
.arg( fet.typeName() ).arg( cse.what() ) );
783784
}
@@ -920,6 +921,7 @@ void QgsVectorLayer::drawRendererV2Levels( QgsRenderContext& rendererContext, bo
920921
}
921922
catch ( const QgsCsException &cse )
922923
{
924+
Q_UNUSED( cse );
923925
QgsDebugMsg( QString( "Failed to transform a point while drawing a feature of type '%1'. Ignoring this feature. %2" )
924926
.arg( fet.typeName() ).arg( cse.what() ) );
925927
}
@@ -1106,6 +1108,7 @@ bool QgsVectorLayer::draw( QgsRenderContext& rendererContext )
11061108
}
11071109
catch ( QgsCsException &cse )
11081110
{
1111+
Q_UNUSED( cse );
11091112
QgsDebugMsg( QString( "Failed to transform a point while drawing a feature of type '%1'. Rendering stopped. %2" )
11101113
.arg( fet.typeName() ).arg( cse.what() ) );
11111114
return false;
@@ -1446,7 +1449,9 @@ void QgsVectorLayer::updateExtents()
14461449
mLayerExtent.setMinimal();
14471450

14481451
if ( !mDataProvider )
1452+
{
14491453
QgsDebugMsg( "invoked with null mDataProvider" );
1454+
}
14501455

14511456
if ( mDeletedFeatureIds.isEmpty() && mChangedGeometries.isEmpty() )
14521457
{
@@ -1739,7 +1744,9 @@ bool QgsVectorLayer::nextFeature( QgsFeature &f )
17391744
}
17401745

17411746
if ( !found )
1747+
{
17421748
QgsDebugMsg( QString( "No attributes for the added feature %1 found" ).arg( f.id() ) );
1749+
}
17431750
}
17441751
else
17451752
{
@@ -1841,7 +1848,9 @@ bool QgsVectorLayer::featureAtId( int featureId, QgsFeature& f, bool fetchGeomet
18411848
}
18421849

18431850
if ( !found )
1851+
{
18441852
QgsDebugMsg( QString( "No attributes for the added feature %1 found" ).arg( f.id() ) );
1853+
}
18451854
}
18461855
else
18471856
{

‎src/plugins/grass/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@ SUBDIRS(modules-common ${GRASS_MODULES_DIR} scripts themes)
1515

1616
ADD_DEFINITIONS(-DGRASS_BASE=\\\"${GRASS_PREFIX}\\\")
1717
ADD_DEFINITIONS(-DHAVE_OPENPTY=${HAVE_OPENPTY})
18+
ADD_DEFINITIONS("-DGRASS_EXPORT=${DLLIMPORT} -DGRASS_LIB_EXPORT=${DLLIMPORT}")
1819

1920
IF (WIN32)
20-
ADD_DEFINITIONS(-DHAVE_GETPT "-DGRASS_EXPORT=__declspec(dllimport)")
21+
ADD_DEFINITIONS(-DHAVE_GETPT)
2122
ELSE (WIN32)
22-
ADD_DEFINITIONS(-DHAVE_POSIX_OPENPT -DGRASS_EXPORT=)
23+
ADD_DEFINITIONS(-DHAVE_POSIX_OPENPT)
2324
ENDIF (WIN32)
2425

2526
########################################################
@@ -151,6 +152,7 @@ INCLUDE_DIRECTORIES(
151152
TARGET_LINK_LIBRARIES(grassplugin
152153
qgisgrass
153154
qgis_gui
155+
grassprovider
154156
${OPENPTY_LIBRARY}
155157
)
156158

‎src/plugins/grass/qgsgrassplugin.cpp

100644100755
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ void QgsGrassPlugin::mapsetChanged()
256256
}
257257
catch ( QgsGrass::Exception &e )
258258
{
259+
Q_UNUSED( e );
259260
QgsDebugMsg( "Cannot read GRASS CRS : " + QString( e.what() ) );
260261
mCrs = QgsCoordinateReferenceSystem();
261262
}

‎src/plugins/grass/qgsgrassplugin.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,11 @@ class QToolBar;
4141
* \brief OpenModeller plugin for QGIS
4242
*
4343
*/
44-
class QgsGrassPlugin: public QObject, public QgisPlugin
44+
class QgsGrassPlugin : public QObject, public QgisPlugin
4545
{
46-
Q_OBJECT public:
46+
Q_OBJECT
47+
48+
public:
4749
/**
4850
* Constructor for a plugin. The QgisInterface pointer is passed by
4951
* QGIS when it attempts to instantiate the plugin.
@@ -68,7 +70,7 @@ class QgsGrassPlugin: public QObject, public QgisPlugin
6870
*/
6971
virtual int type();
7072
//! Destructor
71-
virtual ~ QgsGrassPlugin();
73+
virtual ~QgsGrassPlugin();
7274

7375
//! Get Region Pen
7476
QPen & regionPen( void );

‎src/plugins/grass/qgsgrassselect.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,8 +337,8 @@ void QgsGrassSelect::setLayers()
337337
return;
338338

339339
QStringList layers = QgsGrass::vectorLayers( egisdbase->text(),
340-
elocation->currentText(), emapset->currentText(),
341-
emap->currentText().toUtf8() );
340+
elocation->currentText(), emapset->currentText(),
341+
emap->currentText().toUtf8() );
342342

343343
int idx = 0;
344344
int sel = -1;

0 commit comments

Comments
 (0)
Please sign in to comment.