109
87
path = cheese_fileutil_get_video_path (fileutil);
89
g_mkdir_with_parents (path, 0775);
111
91
if (mode == CHEESE_MEDIA_MODE_PHOTO)
113
filename = g_strdup_printf ("%s%s%s%s", path, G_DIR_SEPARATOR_S, date, PHOTO_NAME_SUFFIX);
93
filename = g_strdup_printf ("%s%s%s%s", path, G_DIR_SEPARATOR_S, date, CHEESE_PHOTO_NAME_SUFFIX);
115
95
else if (mode == CHEESE_MEDIA_MODE_BURST)
118
98
if (strlen (priv->burst_raw_name) == 0)
119
99
priv->burst_raw_name = g_strdup_printf ("%s%s%s", path, G_DIR_SEPARATOR_S, date);
121
filename = g_strdup_printf ("%s_%d%s", priv->burst_raw_name, priv->burst_count, PHOTO_NAME_SUFFIX);
101
filename = g_strdup_printf ("%s_%d%s", priv->burst_raw_name, priv->burst_count, CHEESE_PHOTO_NAME_SUFFIX);
125
filename = g_strdup_printf ("%s%s%s%s", path, G_DIR_SEPARATOR_S, date, VIDEO_NAME_SUFFIX);
105
filename = g_strdup_printf ("%s%s%s%s", path, G_DIR_SEPARATOR_S, date, CHEESE_VIDEO_NAME_SUFFIX);
128
108
file = g_file_new_for_path (filename);
130
if (g_file_query_exists (file, NULL))
111
while (g_file_query_exists (file, NULL))
115
g_object_unref (file);
133
118
if (mode == CHEESE_MEDIA_MODE_PHOTO)
134
filename = g_strdup_printf ("%s%s%s (%d)%s", path, G_DIR_SEPARATOR_S, date, num, PHOTO_NAME_SUFFIX);
119
filename = g_strdup_printf ("%s%s%s (%d)%s", path, G_DIR_SEPARATOR_S, date, num, CHEESE_PHOTO_NAME_SUFFIX);
135
120
else if (mode == CHEESE_MEDIA_MODE_BURST)
136
filename = g_strdup_printf ("%s_%d (%d)%s", priv->burst_raw_name, priv->burst_count, num, PHOTO_NAME_SUFFIX);
121
filename = g_strdup_printf ("%s_%d (%d)%s", priv->burst_raw_name, priv->burst_count, num, CHEESE_PHOTO_NAME_SUFFIX);
138
filename = g_strdup_printf ("%s%s%s (%d)%s", path, G_DIR_SEPARATOR_S, date, num, VIDEO_NAME_SUFFIX);
123
filename = g_strdup_printf ("%s%s%s (%d)%s", path, G_DIR_SEPARATOR_S, date, num, CHEESE_VIDEO_NAME_SUFFIX);
140
125
file = g_file_new_for_path (filename);
142
while (g_file_query_exists (file, NULL))
145
if (mode == CHEESE_MEDIA_MODE_PHOTO)
146
filename = g_strdup_printf ("%s%s%s (%d)%s", path, G_DIR_SEPARATOR_S, date, num, PHOTO_NAME_SUFFIX);
147
else if (mode == CHEESE_MEDIA_MODE_BURST)
148
filename = g_strdup_printf ("%s_%d (%d)%s", priv->burst_raw_name, priv->burst_count, num, PHOTO_NAME_SUFFIX);
150
filename = g_strdup_printf ("%s%s%s (%d)%s", path, G_DIR_SEPARATOR_S, date, num, VIDEO_NAME_SUFFIX);
152
file = g_file_new_for_path (filename);
128
g_object_unref (file);
197
170
priv->burst_count = 0;
198
171
priv->burst_raw_name = "";
202
gconf = cheese_gconf_new ();
204
g_object_get (gconf, "gconf_prop_video_path", &priv->video_path, NULL);
205
g_object_get (gconf, "gconf_prop_photo_path", &priv->photo_path, NULL);
207
/* get the video path from gconf, xdg or hardcoded */
175
settings = g_settings_new ("org.gnome.Cheese");
177
g_settings_get (settings, "video-path", "s", &priv->video_path);
178
g_settings_get (settings, "photo-path", "s", &priv->photo_path);
180
/* get the video path from gsettings, xdg or hardcoded */
208
181
if (!priv->video_path || strcmp (priv->video_path, "") == 0)