From 7e5120d4be2483c6412f92222b8d317104efbf6e Mon Sep 17 00:00:00 2001 From: Yevgen Muntyan <17531749+muntyan@users.noreply.github.com> Date: Thu, 1 Jun 2006 13:50:37 -0500 Subject: [PATCH] Removed auto-loading sessions, it will go into project plugin --- moo/mooapp/mooapp.c | 30 ++++++++++++++++++++++++++++-- moo/mooapp/mooapp.h | 2 +- moo/mooedit/mooeditor.c | 1 - 3 files changed, 29 insertions(+), 4 deletions(-) diff --git a/moo/mooapp/mooapp.c b/moo/mooapp/mooapp.c index 7abd5def..45ec8beb 100644 --- a/moo/mooapp/mooapp.c +++ b/moo/mooapp/mooapp.c @@ -609,14 +609,14 @@ moo_app_set_exit_code (MooApp *app, } -const char* +const char * moo_app_get_input_pipe_name (G_GNUC_UNUSED MooApp *app) { return moo_app_input ? moo_app_input->pipe_name : NULL; } -const char* +const char * moo_app_get_rc_file_name (MooApp *app) { g_return_val_if_fail (MOO_IS_APP (app), NULL); @@ -646,6 +646,32 @@ moo_app_get_rc_file_name (MooApp *app) } +char * +moo_app_create_user_data_dir (MooApp *app) +{ + char *dir; + GError *error = NULL; + + g_return_val_if_fail (MOO_IS_APP (app), NULL); + + dir = moo_get_user_data_dir (); + g_return_val_if_fail (dir != NULL, NULL); + + if (g_file_test (dir, G_FILE_TEST_IS_DIR)) + return dir; + + if (!moo_mkdir (dir, &error)) + { + g_warning ("%s: %s", G_STRLOC, error->message); + g_error_free (error); + g_free (dir); + dir = NULL; + } + + return dir; +} + + #if 0 void moo_app_python_execute_file (G_GNUC_UNUSED GtkWindow *parent_window) diff --git a/moo/mooapp/mooapp.h b/moo/mooapp/mooapp.h index 81c01aed..e55c7efd 100644 --- a/moo/mooapp/mooapp.h +++ b/moo/mooapp/mooapp.h @@ -21,7 +21,6 @@ G_BEGIN_DECLS #define MOO_TYPE_APP_INFO (moo_app_info_get_type ()) - #define MOO_TYPE_APP (moo_app_get_type ()) #define MOO_APP(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), MOO_TYPE_APP, MooApp)) #define MOO_APP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MOO_TYPE_APP, MooAppClass)) @@ -89,6 +88,7 @@ void moo_app_set_exit_code (MooApp *app, const MooAppInfo*moo_app_get_info (MooApp *app); +char *moo_app_create_user_data_dir (MooApp *app); const char *moo_app_get_rc_file_name (MooApp *app); const char *moo_app_get_input_pipe_name (MooApp *app); const char *moo_app_get_output_pipe_name (MooApp *app); diff --git a/moo/mooedit/mooeditor.c b/moo/mooedit/mooeditor.c index 2cf5dcf6..2443aaa9 100644 --- a/moo/mooedit/mooeditor.c +++ b/moo/mooedit/mooeditor.c @@ -302,7 +302,6 @@ moo_editor_init (MooEditor *editor) moo_prefs_new_key_string (moo_edit_setting (MOO_EDIT_PREFS_DEFAULT_LANG), MOO_LANG_NONE); - moo_prefs_new_key_bool (moo_edit_setting (MOO_EDIT_PREFS_SAVE_SESSION), TRUE); editor->priv->prefs_notify = moo_prefs_notify_connect (MOO_EDIT_PREFS_PREFIX "/[^/]*",