diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-01-11 17:07:22 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-01-11 17:46:00 -0800 |
commit | 6a10700ca59e546c7a05688bdf5bffa388286bff (patch) | |
tree | 1cef21cc47580f1f64b0f186ebb712bca5b0cc24 /linux.c | |
parent | 954290c70ba525cab4fefe83a3e82384ef01ba8c (diff) | |
download | subsurface-6a10700ca59e546c7a05688bdf5bffa388286bff.tar.gz |
Add default filename and divelist font to prefs structure
.. and add the usual logic to not save the default values.
This also simplifies the initial system-specific setup of both of these:
since we have defaults for all the preferences that get set up at
startup, we can just initialize those defaults to the system-specific
fonts then and there.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'linux.c')
-rw-r--r-- | linux.c | 30 |
1 files changed, 12 insertions, 18 deletions
@@ -5,7 +5,7 @@ #include <gconf/gconf-client.h> #include <string.h> -#define DIVELIST_DEFAULT_FONT "Sans 8" +const char system_divelist_default_font[] = "Sans 8"; GConfClient *gconf; @@ -131,22 +131,18 @@ const char *subsurface_icon_name() return "subsurface.svg"; } -const char *subsurface_default_filename() +const char *system_default_filename(void) { - if (default_filename) { - return strdup(default_filename); - } else { - const char *home, *user; - char *buffer; - int len; - - home = g_get_home_dir(); - user = g_get_user_name(); - len = strlen(home) + strlen(user) + 17; - buffer = malloc(len); - snprintf(buffer, len, "%s/subsurface/%s.xml", home, user); - return buffer; - } + const char *home, *user; + char *buffer; + int len; + + home = g_get_home_dir(); + user = g_get_user_name(); + len = strlen(home) + strlen(user) + 17; + buffer = malloc(len); + snprintf(buffer, len, "%s/subsurface/%s.xml", home, user); + return buffer; } const char *subsurface_gettext_domainpath(char *argv0) @@ -163,8 +159,6 @@ const char *subsurface_gettext_domainpath(char *argv0) void subsurface_ui_setup(GtkSettings *settings, GtkWidget *menubar, GtkWidget *vbox, GtkUIManager *ui_manager) { - if (!divelist_font) - divelist_font = strdup(DIVELIST_DEFAULT_FONT); gtk_box_pack_start(GTK_BOX(vbox), menubar, FALSE, FALSE, 0); } |