* expand dir names (ie. ~/Maildir => /home/user/Maildir); add init/uninit
This commit is contained in:
@ -19,6 +19,8 @@
|
||||
|
||||
#include <glib.h>
|
||||
#include <string.h> /* memset */
|
||||
|
||||
#include "mu-util.h"
|
||||
#include "mu-config.h"
|
||||
|
||||
|
||||
@ -104,7 +106,7 @@ mu_config_options_group_query (MuConfigOptions *opts)
|
||||
|
||||
|
||||
void
|
||||
mu_config_set_defaults (MuConfigOptions *opts)
|
||||
mu_config_init (MuConfigOptions *opts)
|
||||
{
|
||||
g_return_if_fail (opts);
|
||||
|
||||
@ -112,11 +114,12 @@ mu_config_set_defaults (MuConfigOptions *opts)
|
||||
memset (opts, 0, sizeof(MuConfigOptions));
|
||||
|
||||
/* general */
|
||||
opts->quiet = FALSE;
|
||||
opts->debug = FALSE;
|
||||
opts->quiet = FALSE;
|
||||
opts->debug = FALSE;
|
||||
opts->muhome = mu_util_dir_expand ("~/.mu");
|
||||
|
||||
/* indexing */
|
||||
opts->maildir = "/home/djcb/Maildir";
|
||||
opts->maildir = mu_util_dir_expand ("~/Maildir");
|
||||
opts->cleanup = FALSE;
|
||||
opts->reindex = FALSE;
|
||||
|
||||
@ -124,3 +127,15 @@ mu_config_set_defaults (MuConfigOptions *opts)
|
||||
opts->xquery = FALSE;
|
||||
opts->fields = "d f s";
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
mu_config_uninit (MuConfigOptions *opts)
|
||||
{
|
||||
g_return_if_fail (opts);
|
||||
|
||||
/* yes, this is fine -- they are only const
|
||||
* for the 'outside world' */
|
||||
g_free ((gchar*)opts->muhome);
|
||||
g_free ((gchar*)opts->maildir);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user