From 9a851ee8ccf950c23d85d585f2ddf8119271615d Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Sat, 19 Feb 2011 15:19:12 +0000 Subject: [PATCH] Code cleanup --- po/de.po | 40 ++++++++++++++++++++-------------------- po/es.po | 40 ++++++++++++++++++++-------------------- po/fr.po | 40 ++++++++++++++++++++-------------------- po/it.po | 40 ++++++++++++++++++++-------------------- src/properties.c | 23 +++++++++++++---------- 5 files changed, 93 insertions(+), 90 deletions(-) diff --git a/po/de.po b/po/de.po index 54e8da8..192afc4 100644 --- a/po/de.po +++ b/po/de.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Browser 0.1.4\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-02-19 16:07+0100\n" +"POT-Creation-Date: 2011-02-19 16:18+0100\n" "PO-Revision-Date: 2010-03-29 23:28+0200\n" "Last-Translator: Pierre Pronchery \n" "Language-Team: English\n" @@ -188,7 +188,7 @@ msgstr "" #: ../src/browser.c:592 ../src/browser.c:597 ../src/copy.c:668 #: ../src/copy.c:672 ../src/delete.c:421 ../src/delete.c:426 #: ../src/desktop.c:1435 ../src/desktop.c:1440 ../src/move.c:452 -#: ../src/move.c:456 ../src/properties.c:113 ../src/properties.c:117 +#: ../src/move.c:456 ../src/properties.c:116 ../src/properties.c:120 #: ../src/view.c:366 ../src/view.c:371 msgid "Error" msgstr "Fehler" @@ -360,7 +360,7 @@ msgstr "" msgid "Omitting directory" msgstr "" -#: ../src/copy.c:584 ../src/properties.c:475 +#: ../src/copy.c:584 ../src/properties.c:478 msgid "kB" msgstr "" @@ -368,7 +368,7 @@ msgstr "" msgid "0.0 kB/s" msgstr "" -#: ../src/copy.c:609 ../src/properties.c:477 +#: ../src/copy.c:609 ../src/properties.c:480 msgid "MB" msgstr "" @@ -542,67 +542,67 @@ msgid "" " -a\taction to call (default: \"open\")\n" msgstr "" -#: ../src/properties.c:232 +#: ../src/properties.c:235 msgid "Properties of " msgstr "Eigenschaften von " -#: ../src/properties.c:257 +#: ../src/properties.c:260 msgid "Size:" msgstr "Größe:" -#: ../src/properties.c:263 ../src/properties.c:313 +#: ../src/properties.c:266 ../src/properties.c:316 msgid "Owner:" msgstr "" -#: ../src/properties.c:269 ../src/properties.c:316 +#: ../src/properties.c:272 ../src/properties.c:319 msgid "Group:" msgstr "Gruppe:" -#: ../src/properties.c:277 +#: ../src/properties.c:280 msgid "Accessed:" msgstr "" -#: ../src/properties.c:283 +#: ../src/properties.c:286 msgid "Modified:" msgstr "" -#: ../src/properties.c:289 +#: ../src/properties.c:292 msgid "Changed:" msgstr "" -#: ../src/properties.c:295 +#: ../src/properties.c:298 msgid "Permissions:" msgstr "" -#: ../src/properties.c:319 +#: ../src/properties.c:322 msgid "Others:" msgstr "" -#: ../src/properties.c:438 +#: ../src/properties.c:441 msgid "read" msgstr "" -#: ../src/properties.c:442 +#: ../src/properties.c:445 msgid "write" msgstr "" -#: ../src/properties.c:446 +#: ../src/properties.c:449 msgid "execute" msgstr "" -#: ../src/properties.c:469 +#: ../src/properties.c:472 msgid "bytes" msgstr "" -#: ../src/properties.c:479 +#: ../src/properties.c:482 msgid "GB" msgstr "" -#: ../src/properties.c:483 +#: ../src/properties.c:486 msgid "TB" msgstr "" -#: ../src/properties.c:555 +#: ../src/properties.c:558 msgid "Usage: properties file...\n" msgstr "" diff --git a/po/es.po b/po/es.po index 507d39d..c430030 100644 --- a/po/es.po +++ b/po/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Browser 0.1.4\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-02-19 16:07+0100\n" +"POT-Creation-Date: 2011-02-19 16:18+0100\n" "PO-Revision-Date: 2010-03-30 01:04+0200\n" "Last-Translator: Pierre Pronchery \n" "Language-Team: Spanish\n" @@ -188,7 +188,7 @@ msgstr "" #: ../src/browser.c:592 ../src/browser.c:597 ../src/copy.c:668 #: ../src/copy.c:672 ../src/delete.c:421 ../src/delete.c:426 #: ../src/desktop.c:1435 ../src/desktop.c:1440 ../src/move.c:452 -#: ../src/move.c:456 ../src/properties.c:113 ../src/properties.c:117 +#: ../src/move.c:456 ../src/properties.c:116 ../src/properties.c:120 #: ../src/view.c:366 ../src/view.c:371 msgid "Error" msgstr "" @@ -360,7 +360,7 @@ msgstr "" msgid "Omitting directory" msgstr "" -#: ../src/copy.c:584 ../src/properties.c:475 +#: ../src/copy.c:584 ../src/properties.c:478 msgid "kB" msgstr "" @@ -368,7 +368,7 @@ msgstr "" msgid "0.0 kB/s" msgstr "" -#: ../src/copy.c:609 ../src/properties.c:477 +#: ../src/copy.c:609 ../src/properties.c:480 msgid "MB" msgstr "" @@ -542,67 +542,67 @@ msgid "" " -a\taction to call (default: \"open\")\n" msgstr "" -#: ../src/properties.c:232 +#: ../src/properties.c:235 msgid "Properties of " msgstr "Propriedades con " -#: ../src/properties.c:257 +#: ../src/properties.c:260 msgid "Size:" msgstr "" -#: ../src/properties.c:263 ../src/properties.c:313 +#: ../src/properties.c:266 ../src/properties.c:316 msgid "Owner:" msgstr "" -#: ../src/properties.c:269 ../src/properties.c:316 +#: ../src/properties.c:272 ../src/properties.c:319 msgid "Group:" msgstr "" -#: ../src/properties.c:277 +#: ../src/properties.c:280 msgid "Accessed:" msgstr "" -#: ../src/properties.c:283 +#: ../src/properties.c:286 msgid "Modified:" msgstr "" -#: ../src/properties.c:289 +#: ../src/properties.c:292 msgid "Changed:" msgstr "" -#: ../src/properties.c:295 +#: ../src/properties.c:298 msgid "Permissions:" msgstr "" -#: ../src/properties.c:319 +#: ../src/properties.c:322 msgid "Others:" msgstr "" -#: ../src/properties.c:438 +#: ../src/properties.c:441 msgid "read" msgstr "" -#: ../src/properties.c:442 +#: ../src/properties.c:445 msgid "write" msgstr "" -#: ../src/properties.c:446 +#: ../src/properties.c:449 msgid "execute" msgstr "" -#: ../src/properties.c:469 +#: ../src/properties.c:472 msgid "bytes" msgstr "" -#: ../src/properties.c:479 +#: ../src/properties.c:482 msgid "GB" msgstr "" -#: ../src/properties.c:483 +#: ../src/properties.c:486 msgid "TB" msgstr "" -#: ../src/properties.c:555 +#: ../src/properties.c:558 msgid "Usage: properties file...\n" msgstr "" diff --git a/po/fr.po b/po/fr.po index 9e3d0b5..09bf0d8 100644 --- a/po/fr.po +++ b/po/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Browser 0.1.4\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-02-19 16:07+0100\n" +"POT-Creation-Date: 2011-02-19 16:18+0100\n" "PO-Revision-Date: 2010-03-29 23:28+0200\n" "Last-Translator: Pierre Pronchery \n" "Language-Team: French\n" @@ -188,7 +188,7 @@ msgstr " Chemin: " #: ../src/browser.c:592 ../src/browser.c:597 ../src/copy.c:668 #: ../src/copy.c:672 ../src/delete.c:421 ../src/delete.c:426 #: ../src/desktop.c:1435 ../src/desktop.c:1440 ../src/move.c:452 -#: ../src/move.c:456 ../src/properties.c:113 ../src/properties.c:117 +#: ../src/move.c:456 ../src/properties.c:116 ../src/properties.c:120 #: ../src/view.c:366 ../src/view.c:371 msgid "Error" msgstr "Erreur" @@ -360,7 +360,7 @@ msgstr "Fichier %u sur %u" msgid "Omitting directory" msgstr "Omission du dossier" -#: ../src/copy.c:584 ../src/properties.c:475 +#: ../src/copy.c:584 ../src/properties.c:478 msgid "kB" msgstr "Kio" @@ -368,7 +368,7 @@ msgstr "Kio" msgid "0.0 kB/s" msgstr "0.0 Kio/s" -#: ../src/copy.c:609 ../src/properties.c:477 +#: ../src/copy.c:609 ../src/properties.c:480 msgid "MB" msgstr "Mio" @@ -576,67 +576,67 @@ msgstr "" " -m\tType MIME à forcer (défaut: auto-détecté)\n" " -a\taction à appeler (défaut: \"open\")\n" -#: ../src/properties.c:232 +#: ../src/properties.c:235 msgid "Properties of " msgstr "Propriétés de " -#: ../src/properties.c:257 +#: ../src/properties.c:260 msgid "Size:" msgstr "Taille:" -#: ../src/properties.c:263 ../src/properties.c:313 +#: ../src/properties.c:266 ../src/properties.c:316 msgid "Owner:" msgstr "Propriétaire:" -#: ../src/properties.c:269 ../src/properties.c:316 +#: ../src/properties.c:272 ../src/properties.c:319 msgid "Group:" msgstr "Groupe:" -#: ../src/properties.c:277 +#: ../src/properties.c:280 msgid "Accessed:" msgstr "Accédé:" -#: ../src/properties.c:283 +#: ../src/properties.c:286 msgid "Modified:" msgstr "Modifié:" -#: ../src/properties.c:289 +#: ../src/properties.c:292 msgid "Changed:" msgstr "Changé:" -#: ../src/properties.c:295 +#: ../src/properties.c:298 msgid "Permissions:" msgstr "Permissions:" -#: ../src/properties.c:319 +#: ../src/properties.c:322 msgid "Others:" msgstr "Autres:" -#: ../src/properties.c:438 +#: ../src/properties.c:441 msgid "read" msgstr "lecture" -#: ../src/properties.c:442 +#: ../src/properties.c:445 msgid "write" msgstr "écriture" -#: ../src/properties.c:446 +#: ../src/properties.c:449 msgid "execute" msgstr "exécution" -#: ../src/properties.c:469 +#: ../src/properties.c:472 msgid "bytes" msgstr "octets" -#: ../src/properties.c:479 +#: ../src/properties.c:482 msgid "GB" msgstr "Gio" -#: ../src/properties.c:483 +#: ../src/properties.c:486 msgid "TB" msgstr "Tio" -#: ../src/properties.c:555 +#: ../src/properties.c:558 msgid "Usage: properties file...\n" msgstr "Usage: properties fichier...\n" diff --git a/po/it.po b/po/it.po index 900d10c..77eeb1f 100644 --- a/po/it.po +++ b/po/it.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Browser 0.1.4\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-02-19 16:07+0100\n" +"POT-Creation-Date: 2011-02-19 16:18+0100\n" "PO-Revision-Date: 2010-04-07 23:18+0200\n" "Last-Translator: Pierre Pronchery \n" "Language-Team: Italian\n" @@ -188,7 +188,7 @@ msgstr "" #: ../src/browser.c:592 ../src/browser.c:597 ../src/copy.c:668 #: ../src/copy.c:672 ../src/delete.c:421 ../src/delete.c:426 #: ../src/desktop.c:1435 ../src/desktop.c:1440 ../src/move.c:452 -#: ../src/move.c:456 ../src/properties.c:113 ../src/properties.c:117 +#: ../src/move.c:456 ../src/properties.c:116 ../src/properties.c:120 #: ../src/view.c:366 ../src/view.c:371 msgid "Error" msgstr "" @@ -360,7 +360,7 @@ msgstr "" msgid "Omitting directory" msgstr "" -#: ../src/copy.c:584 ../src/properties.c:475 +#: ../src/copy.c:584 ../src/properties.c:478 msgid "kB" msgstr "" @@ -368,7 +368,7 @@ msgstr "" msgid "0.0 kB/s" msgstr "" -#: ../src/copy.c:609 ../src/properties.c:477 +#: ../src/copy.c:609 ../src/properties.c:480 msgid "MB" msgstr "" @@ -542,67 +542,67 @@ msgid "" " -a\taction to call (default: \"open\")\n" msgstr "" -#: ../src/properties.c:232 +#: ../src/properties.c:235 msgid "Properties of " msgstr "" -#: ../src/properties.c:257 +#: ../src/properties.c:260 msgid "Size:" msgstr "" -#: ../src/properties.c:263 ../src/properties.c:313 +#: ../src/properties.c:266 ../src/properties.c:316 msgid "Owner:" msgstr "" -#: ../src/properties.c:269 ../src/properties.c:316 +#: ../src/properties.c:272 ../src/properties.c:319 msgid "Group:" msgstr "" -#: ../src/properties.c:277 +#: ../src/properties.c:280 msgid "Accessed:" msgstr "" -#: ../src/properties.c:283 +#: ../src/properties.c:286 msgid "Modified:" msgstr "" -#: ../src/properties.c:289 +#: ../src/properties.c:292 msgid "Changed:" msgstr "" -#: ../src/properties.c:295 +#: ../src/properties.c:298 msgid "Permissions:" msgstr "" -#: ../src/properties.c:319 +#: ../src/properties.c:322 msgid "Others:" msgstr "" -#: ../src/properties.c:438 +#: ../src/properties.c:441 msgid "read" msgstr "" -#: ../src/properties.c:442 +#: ../src/properties.c:445 msgid "write" msgstr "" -#: ../src/properties.c:446 +#: ../src/properties.c:449 msgid "execute" msgstr "" -#: ../src/properties.c:469 +#: ../src/properties.c:472 msgid "bytes" msgstr "" -#: ../src/properties.c:479 +#: ../src/properties.c:482 msgid "GB" msgstr "" -#: ../src/properties.c:483 +#: ../src/properties.c:486 msgid "TB" msgstr "" -#: ../src/properties.c:555 +#: ../src/properties.c:558 msgid "Usage: properties file...\n" msgstr "" diff --git a/src/properties.c b/src/properties.c index 235d924..759af37 100644 --- a/src/properties.c +++ b/src/properties.c @@ -71,7 +71,8 @@ typedef struct _Properties static unsigned int _properties_cnt = 0; /* XXX set as static in _properties */ /* functions */ -static int _properties_error(GtkWidget * window, char const * message, int ret); +static int _properties_error(Properties * properties, char const * message, + int ret); static int _properties_do(Mime * mime, GtkIconTheme * theme, char const * filename); static int _properties_refresh(Properties * properties); @@ -103,21 +104,23 @@ static int _properties(Mime * mime, int filec, char * const filev[]) /* _properties_error */ static void _error_response(GtkWidget * widget, gint arg, gpointer data); -static int _properties_error(GtkWidget * window, char const * message, int ret) +static int _properties_error(Properties * properties, char const * message, + int ret) { GtkWidget * dialog; - dialog = gtk_message_dialog_new(window != NULL ? GTK_WINDOW(window) - : NULL, 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, + dialog = gtk_message_dialog_new((properties != NULL) + ? GTK_WINDOW(properties->window) : NULL, 0, + GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, #if GTK_CHECK_VERSION(2, 6, 0) "%s", _("Error")); gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog), #endif "%s: %s", message, strerror(errno)); gtk_window_set_title(GTK_WINDOW(dialog), _("Error")); - if(window != NULL) + if(properties != NULL) gtk_window_set_transient_for(GTK_WINDOW(dialog), GTK_WINDOW( - window)); + properties->window)); g_signal_connect(G_OBJECT(dialog), "response", G_CALLBACK( _error_response), (ret != 0) ? &_properties_cnt : NULL); @@ -376,7 +379,7 @@ static GtkWidget * _do_groups(Properties * properties) if((gr = getgrgid(getgid())) == NULL) { - _properties_error(properties->window, properties->filename, 0); + _properties_error(properties, properties->filename, 0); return gtk_label_new(""); } box = gtk_hbox_new(TRUE, 0); @@ -387,7 +390,7 @@ static GtkWidget * _do_groups(Properties * properties) gtk_box_pack_start(GTK_BOX(box), combo, FALSE, FALSE, 0); if((pw = getpwuid(getuid())) == NULL) { - _properties_error(properties->window, properties->filename, 0); + _properties_error(properties, properties->filename, 0); return combo; } setgrent(); @@ -514,7 +517,7 @@ static void _properties_on_apply(gpointer data) p = gtk_combo_box_get_active_text(GTK_COMBO_BOX(properties->combo)); if((gr = getgrnam(p)) == NULL) - _properties_error(properties->window, p, 0); + _properties_error(properties, p, 0); else gid = gr->gr_gid; for(i = 0; i < 9; i++) @@ -522,7 +525,7 @@ static void _properties_on_apply(gpointer data) properties->mode[i])) << i; if(chown(properties->filename, properties->uid, gid) != 0 || chmod(properties->filename, mode) != 0) - _properties_error(properties->window, properties->filename, 0); + _properties_error(properties, properties->filename, 0); } static void _properties_on_close(gpointer data)