diff options
author | 2012-09-17 21:27:43 -0400 | |
---|---|---|
committer | 2012-09-17 21:44:28 -0400 | |
commit | 3835faa8fb02df8edb299278f4258389d3e99bda (patch) | |
tree | 6ac1697a5f7343157f73ad5063b2cefa23395e20 /linux.c | |
parent | febae4d165866ca4a4e28347aebe446d65ed44e5 (diff) | |
parent | d7465129bb7fc912ec89671051192983b80711c4 (diff) | |
download | subsurface-3835faa8fb02df8edb299278f4258389d3e99bda.tar.gz |
Merge branch 'defaultfile'
By now the default file code seems quite matured, so in preparation for
2.0 we'll bring it back into master.
I made a few small clean-ups during the merge, but the merge itself is
very much straight forward.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'linux.c')
-rw-r--r-- | linux.c | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -1,7 +1,10 @@ /* linux.c */ /* implements Linux specific functions */ +#include "dive.h" #include "display-gtk.h" #include <gconf/gconf-client.h> +#include <string.h> + #define DIVELIST_DEFAULT_FONT "Sans 8" GConfClient *gconf; @@ -63,6 +66,24 @@ const char *subsurface_icon_name() return "subsurface.svg"; } +const char *subsurface_default_filename() +{ + 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; + } +} + void subsurface_ui_setup(GtkSettings *settings, GtkWidget *menubar, GtkWidget *vbox, GtkUIManager *ui_manager) { |