summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFriedrich W. H. Kossebau <kossebau@kde.org>2016-10-21 21:49:44 (GMT)
committerFriedrich W. H. Kossebau <kossebau@kde.org>2016-10-21 21:49:44 (GMT)
commit0b84b2f04600a14cfe836e8242e6ca16d9319212 (patch)
treef3a976b21bbe6826dae7e562289261bedf63c5a4
parente49eae6925f342185f891cd9faec0f8e1b4b5b26 (diff)
Fix broken check for name & note field existance in ShpRunner
-rw-r--r--src/plugins/runner/shp/ShpRunner.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/plugins/runner/shp/ShpRunner.cpp b/src/plugins/runner/shp/ShpRunner.cpp
index 3cf86f7..17d039f 100644
--- a/src/plugins/runner/shp/ShpRunner.cpp
+++ b/src/plugins/runner/shp/ShpRunner.cpp
@@ -83,13 +83,15 @@ GeoDataDocument *ShpRunner::parseFile(const QString &fileName, DocumentRole role
document->append( placemark );
SHPObject *shape = SHPReadObject( handle, i );
- if( nameField ) {
+ if (nameField != -1) {
const char* info = DBFReadStringAttribute( dbfhandle, i, nameField );
+ // TODO: defaults to utf-8 encoding, but could be also something else, optionally noted in a .cpg file
placemark->setName( info );
mDebug() << "name " << placemark->name();
}
- if( noteField ) {
+ if (noteField != -1) {
const char* note = DBFReadStringAttribute( dbfhandle, i, noteField );
+ // TODO: defaults to utf-8 encoding, see comment for name
placemark->setDescription( note );
mDebug() << "desc " << placemark->description();
}