comparison src/ui_pathsel.c @ 702:e07895754e65

Drop concat_dir_and_file() and use g_build_filename() instead.
author zas_
date Tue, 20 May 2008 22:09:04 +0000
parents 651ae2be1031
children aae956e84de4
comparison
equal deleted inserted replaced
701:28af4b6dd9ef 702:e07895754e65
229 if (p - 1 != filepath) p--; 229 if (p - 1 != filepath) p--;
230 p[0] = '\0'; 230 p[0] = '\0';
231 } 231 }
232 else 232 else
233 { 233 {
234 filepath = concat_dir_and_file(path, list->data); 234 filepath = g_build_filename(path, list->data, NULL);
235 } 235 }
236 236
237 gtk_list_store_append(store, &iter); 237 gtk_list_store_append(store, &iter);
238 gtk_list_store_set(store, &iter, 0, list->data, 1, filepath, -1); 238 gtk_list_store_set(store, &iter, 0, list->data, 1, filepath, -1);
239 239
254 { 254 {
255 GtkTreeIter iter; 255 GtkTreeIter iter;
256 gchar *filepath; 256 gchar *filepath;
257 const gchar *name = list->data; 257 const gchar *name = list->data;
258 258
259 filepath = concat_dir_and_file(path, name); 259 filepath = g_build_filename(path, name, NULL);
260 260
261 gtk_list_store_append(store, &iter); 261 gtk_list_store_append(store, &iter);
262 gtk_list_store_set(store, &iter, 0, name, 1, filepath, -1); 262 gtk_list_store_set(store, &iter, 0, name, 1, filepath, -1);
263 263
264 g_free(filepath); 264 g_free(filepath);
422 422
423 gtk_tree_model_get(model, &iter, 1, &old_path, -1); 423 gtk_tree_model_get(model, &iter, 1, &old_path, -1);
424 if (!old_path) return FALSE; 424 if (!old_path) return FALSE;
425 425
426 buf = remove_level_from_path(old_path); 426 buf = remove_level_from_path(old_path);
427 new_path = concat_dir_and_file(buf, new); 427 new_path = g_build_filename(buf, new, NULL);
428 g_free(buf); 428 g_free(buf);
429 429
430 if (isname(new_path)) 430 if (isname(new_path))
431 { 431 {
432 buf = g_strdup_printf(_("A file with name %s already exists."), new); 432 buf = g_strdup_printf(_("A file with name %s already exists."), new);
743 path = g_strdup(tmp); 743 path = g_strdup(tmp);
744 from_text = TRUE; 744 from_text = TRUE;
745 } 745 }
746 else 746 else
747 { 747 {
748 buf = concat_dir_and_file(dd->path, _("New folder")); 748 buf = g_build_filename(dd->path, _("New folder"), NULL);
749 path = unique_filename(buf, NULL, " ", FALSE); 749 path = unique_filename(buf, NULL, " ", FALSE);
750 g_free(buf); 750 g_free(buf);
751 } 751 }
752 752
753 if (!mkdir_utf8(path, 0755)) 753 if (!mkdir_utf8(path, 0755))