From cae3f1b9ab5c69a6f2cf3857ce200f8691efd661 Mon Sep 17 00:00:00 2001 From: Miguel de Icaza Date: Sat, 13 Feb 1999 20:12:35 +0000 Subject: [PATCH] Various typo fixes in gnome-file-property-dialog.c. nd in gdialogs.c. It does not look as it was tested a lot. Miguel v --- gnome/ChangeLog | 15 +++++++++++++++ gnome/gdialogs.c | 2 +- gnome/gmain.c | 1 + gnome/gnome-file-property-dialog.c | 20 ++++++++++++++------ gnome/gnome-file-property-dialog.h | 8 ++++---- po/mc.pot | 10 +++++----- src/listmode.c | 2 +- src/treestore.c | 2 +- src/util.c | 8 ++++++-- 9 files changed, 48 insertions(+), 20 deletions(-) diff --git a/gnome/ChangeLog b/gnome/ChangeLog index 0f4e0d684..9c56eeced 100644 --- a/gnome/ChangeLog +++ b/gnome/ChangeLog @@ -1,3 +1,18 @@ +1999-02-12 Miguel de Icaza + + * gdialogs.c (file_mask_dialog): Renaming files was not working + due to having the "file-must-exist" bit turned on. + + * gnome-file-property-dialog.c (apply_metadata_change): Metadata + rename the file. + + Change fpd->file_name to point to the new name so that any + metadat changes take effect on the new name, not the old name. + + Test return value from move_file_file. + + (init_metadata): Fixed typo. + 1999-02-12 Federico Mena Quintero * mc.metadata.in: Added a regexp for EPS files. diff --git a/gnome/gdialogs.c b/gnome/gdialogs.c index 6282078b7..debc1022f 100644 --- a/gnome/gdialogs.c +++ b/gnome/gdialogs.c @@ -629,7 +629,7 @@ file_mask_dialog (FileOpContext *ctx, FileOperation operation, char *text, char return NULL; } - dest_dir = gnome_file_entry_get_full_path(GNOME_FILE_ENTRY (fentry), TRUE); + dest_dir = gnome_file_entry_get_full_path(GNOME_FILE_ENTRY (fentry), FALSE); gtk_widget_destroy (fmd_win); easy_patterns = 1; if (!dest_dir || !*dest_dir) diff --git a/gnome/gmain.c b/gnome/gmain.c index 2f6eb6079..46d38b9a2 100644 --- a/gnome/gmain.c +++ b/gnome/gmain.c @@ -147,6 +147,7 @@ dialog_key_pressed (GtkWidget *win, GdkEventKey *event, Dlg_head *h) if (i->editing) return FALSE; + } } diff --git a/gnome/gnome-file-property-dialog.c b/gnome/gnome-file-property-dialog.c index e7e5674cd..cd10d56b8 100644 --- a/gnome/gnome-file-property-dialog.c +++ b/gnome/gnome-file-property-dialog.c @@ -16,12 +16,13 @@ * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ - +#include +#include "dir.h" +#include "util.h" #include #include #include #include "gnome-file-property-dialog.h" -#include "dir.h" #include "gdesktop.h" #include #include @@ -32,7 +33,6 @@ #include "../vfs/vfs.h" #include "gicon.h" #include "dialog.h" -#include "util.h" static void gnome_file_property_dialog_init (GnomeFilePropertyDialog *file_property_dialog); static void gnome_file_property_dialog_class_init (GnomeFilePropertyDialogClass *klass); @@ -980,7 +980,7 @@ init_metadata (GnomeFilePropertyDialog *fp_dlg) if (!fp_dlg->mime_fm_view) fp_dlg->mime_fm_view = gnome_mime_get_value (mime_type, "view"); fp_dlg->mime_edit = gnome_mime_get_value (mime_type, "edit"); - fp_dlg->mime_edit = gnome_mime_get_value (mime_type, "drop-target"); + fp_dlg->mime_drop_target = gnome_mime_get_value (mime_type, "drop-target"); gnome_metadata_get (fp_dlg->file_name, "icon-filename", &size, &fp_dlg->icon_filename); if (fp_dlg->icon_filename) @@ -1144,6 +1144,7 @@ apply_name_change (GnomeFilePropertyDialog *fpd) return 0; } else { char *p; + int s; /* create the files. */ base_name = g_strdup (fpd->file_name); @@ -1157,9 +1158,14 @@ apply_name_change (GnomeFilePropertyDialog *fpd) ctx = file_op_context_new (); file_op_context_create_ui (ctx, OP_MOVE, FALSE); - move_file_file (ctx, fpd->file_name, full_target, &count, &bytes); + s = move_file_file (ctx, fpd->file_name, full_target, &count, &bytes); file_op_context_destroy (ctx); - g_free (full_target); + + if (s == FILE_CONT){ + g_free (fpd->file_name); + fpd->file_name = full_target; + } else + g_free (full_target); } } return 1; @@ -1169,6 +1175,7 @@ apply_metadata_change (GnomeFilePropertyDialog *fpd) { gchar *text; gchar *icon_name; + char *filename; /* If we don't have an open_cbox, that means we have no metadata * to set. @@ -1282,6 +1289,7 @@ gint gnome_file_property_dialog_make_changes (GnomeFilePropertyDialog *file_property_dialog) { gint retval = 0; + g_return_val_if_fail (file_property_dialog != NULL, 1); g_return_val_if_fail (GNOME_IS_FILE_PROPERTY_DIALOG (file_property_dialog), 1); diff --git a/gnome/gnome-file-property-dialog.h b/gnome/gnome-file-property-dialog.h index 8cd4d2b5a..23b80ee21 100644 --- a/gnome/gnome-file-property-dialog.h +++ b/gnome/gnome-file-property-dialog.h @@ -75,10 +75,10 @@ struct _GnomeFilePropertyDialog gchar *fm_view; gchar *drop_target; gchar *edit; - gchar *mime_fm_open; - gchar *mime_fm_view; - gchar *mime_drop_target; - gchar *mime_edit; + const gchar *mime_fm_open; + const gchar *mime_fm_view; + const gchar *mime_drop_target; + const gchar *mime_edit; gchar *icon_filename; gchar *desktop_url; gchar *caption; diff --git a/po/mc.pot b/po/mc.pot index a4719b629..5a11be498 100644 --- a/po/mc.pot +++ b/po/mc.pot @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 1999-02-11 20:35-0600\n" +"POT-Creation-Date: 1999-02-12 16:27-0600\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1068,7 +1068,7 @@ msgstr "" #: gtkedit/editcmd.c:482 gtkedit/editcmd.c:801 gtkedit/editcmd.c:831 #: gtkedit/editcmd.c:978 gtkedit/editcmd.c:1075 src/ext.c:294 src/file.c:606 #: src/help.c:318 src/main.c:665 src/screen.c:2064 src/subshell.c:700 -#: src/subshell.c:726 src/utilunix.c:382 src/utilunix.c:386 src/utilunix.c:452 +#: src/subshell.c:726 src/utilunix.c:386 src/utilunix.c:390 src/utilunix.c:456 #: vfs/mcfs.c:169 msgid " Warning " msgstr "" @@ -2279,7 +2279,7 @@ msgstr "" msgid "File exists but can not be stat-ed: %s %s" msgstr "" -#: src/dir.c:643 +#: src/dir.c:647 msgid "Unknown" msgstr "" @@ -4125,11 +4125,11 @@ msgstr "" msgid "name_trunc: too big" msgstr "" -#: src/utilunix.c:382 +#: src/utilunix.c:386 msgid " Pipe failed " msgstr "" -#: src/utilunix.c:386 +#: src/utilunix.c:390 msgid " Dup failed " msgstr "" diff --git a/src/listmode.c b/src/listmode.c index 65886c0c8..a9f9195d6 100644 --- a/src/listmode.c +++ b/src/listmode.c @@ -28,7 +28,7 @@ #include #include #include -#ifndef OS2_NT +#ifndef HAS_NO_GRP_PWD_H # include # include #endif diff --git a/src/treestore.c b/src/treestore.c index 77c84dba8..9a987da98 100644 --- a/src/treestore.c +++ b/src/treestore.c @@ -45,7 +45,7 @@ #include "global.h" #include "treestore.h" #include "../vfs/vfs.h" -#ifdef OS2_NT +#ifdef NEEDS_IO_H # include #endif diff --git a/src/util.c b/src/util.c index 49ac817f8..8b5eeafad 100644 --- a/src/util.c +++ b/src/util.c @@ -23,7 +23,7 @@ #include #include -#if defined(__os2__) /* OS/2 need io.h! .ado */ +#if defined(NEEDS_IO_H) /* OS/2 need io.h! .ado */ # include #endif #include @@ -659,8 +659,12 @@ char *x_basename (char *s) void my_putenv (char *name, char *data) { char *full; + char *len = strlen (name) + strlen (data) + 2; - full = g_strdup_printf ("%s=%s", name, data); + full = malloc (len); + strcpy (full, name); + strcat (full, "="); + strcat (full, data); putenv (full); /* WARNING: NEVER FREE THE full VARIABLE!!!!!!!!!!!!!!!!!!!!!!!! */