Skip to content

Commit 298f9ab

Browse files
author
g_j_m
committed
Fix for ticket #5
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@5279 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 8d91c39 commit 298f9ab

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/core/qgis.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ class QGis
6363
{
6464
Point,
6565
Line,
66-
Polygon
66+
Polygon,
67+
Unknown
6768
};
6869
static const char *qgisVectorGeometryType[];
6970

src/gui/qgsvectorlayer.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1249,6 +1249,17 @@ QGis::VectorType QgsVectorLayer::vectorType() const
12491249
#endif
12501250

12511251
}
1252+
1253+
// We shouldn't get here, and if we have, other things are likely to
1254+
// go wrong. Code that uses the vectorType() return value should be
1255+
// rewritten to cope with a value of QGis::Unknown. To make this
1256+
// need known, the following message is printed every time we get
1257+
// here.
1258+
std::cerr << "WARNING: This code (file " << __FILE__ << ", line "
1259+
<< __LINE__ << ") should never be reached. "
1260+
<< "Problems may occur...\n";
1261+
1262+
return QGis::Unknown;
12521263
}
12531264

12541265
QgsVectorLayerProperties *QgsVectorLayer::propertiesDialog()

0 commit comments

Comments
 (0)