brasero r717 - in trunk: . src
- From: philippr svn gnome org
- To: svn-commits-list gnome org
- Subject: brasero r717 - in trunk: . src
- Date: Mon, 14 Apr 2008 17:17:56 +0100 (BST)
Author: philippr
Date: Mon Apr 14 17:17:55 2008
New Revision: 717
URL: http://svn.gnome.org/viewvc/brasero?rev=717&view=rev
Log:
improvements over last change (put all files in a directory)
* src/brasero-session.c (brasero_session_get_path),
(brasero_session_load), (brasero_session_save):
Modified:
trunk/ChangeLog
trunk/src/brasero-session.c
Modified: trunk/src/brasero-session.c
==============================================================================
--- trunk/src/brasero-session.c (original)
+++ trunk/src/brasero-session.c Mon Apr 14 17:17:55 2008
@@ -43,6 +43,20 @@
#define SESSION_VERSION "0.1"
+static gchar *
+brasero_session_get_path (const gchar *name)
+{
+ gchar *directory;
+
+ directory = g_build_filename (g_get_user_config_dir (),
+ "brasero",
+ NULL);
+ if (!g_file_test (directory, G_FILE_TEST_EXISTS))
+ g_mkdir_with_parents (directory, S_IRWXU);
+
+ return g_build_filename (directory, name, NULL);
+}
+
gboolean
brasero_session_load (BraseroApp *app, gboolean load_project)
{
@@ -72,9 +86,7 @@
width = rect.width / 100 * 85;
height = rect.height / 100 * 85;
- session_path = g_build_filename (g_get_user_config_dir (),
- BRASERO_SESSION_TMP_SESSION_PATH,
- NULL);
+ session_path = brasero_session_get_path (BRASERO_SESSION_TMP_SESSION_PATH);
if (!session_path)
goto end;
@@ -167,9 +179,7 @@
gtk_window_maximize (GTK_WINDOW (app->mainwin));
/* now we start the project if any */
- project_path = g_build_filename (g_get_user_config_dir (),
- BRASERO_SESSION_TMP_PROJECT_PATH,
- NULL);
+ project_path = brasero_session_get_path (BRASERO_SESSION_TMP_PROJECT_PATH);
if (!load_project
|| !g_file_test (project_path,G_FILE_TEST_EXISTS)) {
g_free (project_path);
@@ -200,9 +210,7 @@
xmlTextWriter *session;
if (save_project)
- project_path = g_build_filename (g_get_user_config_dir (),
- BRASERO_SESSION_TMP_PROJECT_PATH,
- NULL);
+ project_path = brasero_session_get_path (BRASERO_SESSION_TMP_PROJECT_PATH);
else
project_path = NULL;
@@ -216,9 +224,7 @@
return TRUE;
/* now save the state of the window */
- session_path = g_build_filename (g_get_user_config_dir (),
- BRASERO_SESSION_TMP_SESSION_PATH,
- NULL);
+ session_path = brasero_session_get_path (BRASERO_SESSION_TMP_SESSION_PATH);
if (!session_path)
return FALSE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]