- gboolean auto_features = FALSE;
- if ( a_vik_very_first_run () ) {
-
- GtkWidget *win = gtk_window_new ( GTK_WINDOW_TOPLEVEL );
-
- if ( a_dialog_yes_or_no ( GTK_WINDOW(win),
- _("This appears to be Viking's very first run.\n\nDo you wish to enable automatic internet features?\n\nIndividual settings can be controlled in the Preferences."), NULL ) )
- auto_features = TRUE;
- }
-
- if ( auto_features ) {
- // Set Maps to autodownload
- // Ensure the default is true
- maps_layer_set_autodownload_default ( TRUE );
-
- // Simplistic repeat of preference settings
- // Only the name & type are important for setting a preference via this 'external' way
-
- // Enable auto add map +
- // Enable IP lookup
- VikLayerParam pref_add_map[] = { { VIK_LAYER_NUM_TYPES, VIKING_PREFERENCES_STARTUP_NAMESPACE "add_default_map_layer", VIK_LAYER_PARAM_BOOLEAN, VIK_LAYER_GROUP_NONE, NULL, VIK_LAYER_WIDGET_CHECKBUTTON, NULL, NULL, NULL, NULL, NULL, NULL, }, };
- VikLayerParam pref_startup_method[] = { { VIK_LAYER_NUM_TYPES, VIKING_PREFERENCES_STARTUP_NAMESPACE "startup_method", VIK_LAYER_PARAM_UINT, VIK_LAYER_GROUP_NONE, NULL, VIK_LAYER_WIDGET_COMBOBOX, NULL, NULL, NULL, NULL, NULL, NULL}, };
-
- VikLayerParamData vlp_data;
- vlp_data.b = TRUE;
- a_preferences_run_setparam ( vlp_data, pref_add_map );
-
- vlp_data.u = VIK_STARTUP_METHOD_AUTO_LOCATION;
- a_preferences_run_setparam ( vlp_data, pref_startup_method );
-
- // Only on Windows make checking for the latest version on by default
- // For other systems it's expected a Package manager or similar controls the installation, so leave it off
-#ifdef WINDOWS
- VikLayerParam pref_startup_version_check[] = { { VIK_LAYER_NUM_TYPES, VIKING_PREFERENCES_STARTUP_NAMESPACE "check_version", VIK_LAYER_PARAM_BOOLEAN, VIK_LAYER_GROUP_NONE, NULL, VIK_LAYER_WIDGET_CHECKBUTTON, NULL, NULL, NULL, NULL, }, };
- vlp_data.b = TRUE;
- a_preferences_run_setparam ( vlp_data, pref_startup_version_check );
-#endif
+ if ( !dirpath ) return NULL;
+
+ // Is it ready absolute?
+ if ( g_path_is_absolute ( filename ) ) {
+ return NULL;
+ }
+ else {
+ // Otherwise create the absolute filename from the given directory and filename
+ gchar *full = g_strconcat ( dirpath, G_DIR_SEPARATOR_S, filename, NULL );
+ gchar *absolute = file_realpath_dup ( full ); // resolved into the canonical name
+ g_free ( full );
+ return absolute;
+ }
+}