summaryrefslogtreecommitdiffstats
path: root/qt-gui.cpp
diff options
context:
space:
mode:
authorGravatar Thiago Macieira <thiago@macieira.org>2013-04-13 00:41:14 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-04-23 08:06:00 -0700
commit72ad76fc2613e4cb51f7677d760985915cd25cbf (patch)
tree36b8cbc93a0d1835e59d11fae89c77e942740ccc /qt-gui.cpp
parent9ffb707d9d9d478b7538a8cd9ef9ef7c6edae25c (diff)
downloadsubsurface-72ad76fc2613e4cb51f7677d760985915cd25cbf.tar.gz
Fix compilation: in C++, enums don't have operator++
To use ++, we need to declare the variable as int. But then we need to cast to the enum type. This is using C-style casts because this is still C-like code. Signed-off-by: Thiago Macieira <thiago@macieira.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-gui.cpp')
-rw-r--r--qt-gui.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/qt-gui.cpp b/qt-gui.cpp
index 5da140765..d68071d35 100644
--- a/qt-gui.cpp
+++ b/qt-gui.cpp
@@ -765,14 +765,14 @@ static void pick_default_file(GtkWidget *w, GtkButton *button)
#if HAVE_OSM_GPS_MAP
static GtkWidget * map_provider_widget()
{
- OsmGpsMapSource_t i;
+ int i;
#if GTK_CHECK_VERSION(2,24,0)
GtkWidget *combobox = gtk_combo_box_text_new();
/* several of the providers seem to be redundant or non-functional;
* we may have to skip more than just the last three eventually */
for (i = OSM_GPS_MAP_SOURCE_OPENSTREETMAP; i < OSM_GPS_MAP_SOURCE_LAST; i++)
- gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combobox), osm_gps_map_source_get_friendly_name(i));
+ gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combobox), osm_gps_map_source_get_friendly_name((OsmGpsMapSource_t)i));
#else
GtkWidget *combobox = gtk_combo_box_new_text();
for (i = OSM_GPS_MAP_SOURCE_OPENSTREETMAP; i < OSM_GPS_MAP_SOURCE_LAST; i++)
@@ -1099,14 +1099,14 @@ static void preferences_dialog(GtkWidget *w, gpointer data)
}
#if HAVE_OSM_GPS_MAP
/* get the map provider selected */
- OsmGpsMapSource_t i;
+ int i;
#if GTK_CHECK_VERSION(2,24,0)
char *provider = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(map_provider));
#else
char *provider = gtk_combo_box_get_active_text(GTK_COMBO_BOX(map_provider));
#endif
for (i = OSM_GPS_MAP_SOURCE_OPENSTREETMAP; i <= OSM_GPS_MAP_SOURCE_YAHOO_STREET; i++)
- if (!strcmp(provider,osm_gps_map_source_get_friendly_name(i))) {
+ if (!strcmp(provider,osm_gps_map_source_get_friendly_name((OsmGpsMapSource_t)i))) {
prefs.map_provider = i;
break;
}