summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomas Bzatek <tbzatek@redhat.com>2009-04-30 15:07:30 +0200
committerTomas Bzatek <tbzatek@redhat.com>2009-04-30 15:07:30 +0200
commitbabb9a625f2598227e7b0b2233c78cdfc35b6e5a (patch)
treebdc5fdeee3fd30234f69856874bd76f967fc6cb2
parentecdc91693c8d4f1385ac5919aef6e5b4513c6534 (diff)
downloadgnome-disk-utility-babb9a625f2598227e7b0b2233c78cdfc35b6e5a.tar.gz
gnome-disk-utility-babb9a625f2598227e7b0b2233c78cdfc35b6e5a.tar.xz
gnome-disk-utility-babb9a625f2598227e7b0b2233c78cdfc35b6e5a.zip
code cleanup, part I
http://bugzilla.gnome.org/show_bug.cgi?id=575437#c16
-rw-r--r--src/gdu-format-tool/format-window-operation.c44
-rw-r--r--src/gdu-format-tool/format-window.c10
-rw-r--r--src/gdu-format-tool/gdu-format-tool.c4
-rw-r--r--src/gdu-format-tool/gdu-utils.c6
-rw-r--r--src/gdu-format-tool/gdu-utils.h2
-rw-r--r--src/gdu-nautilus-extension/nautilus-gdu.c4
-rw-r--r--src/gdu-nautilus-extension/nautilus-module.c4
7 files changed, 18 insertions, 56 deletions
diff --git a/src/gdu-format-tool/format-window-operation.c b/src/gdu-format-tool/format-window-operation.c
index a1a61f8..9ba9d8d 100644
--- a/src/gdu-format-tool/format-window-operation.c
+++ b/src/gdu-format-tool/format-window-operation.c
@@ -22,9 +22,7 @@
*
*/
-#ifdef HAVE_CONFIG_H
- #include <config.h> /* for GETTEXT_PACKAGE */
-#endif
+#include "config.h"
#include <glib/gi18n-lib.h>
@@ -59,7 +57,9 @@ device_needs_partition_table (GduDevice *device)
break;
}
}
-// g_strfreev (media_compat); /* so, is this const then? */
+#if 0
+ g_strfreev (media_compat); /* so, is this const then? */
+#endif
g_debug ("device_needs_partition_table = %d", needs);
return needs;
}
@@ -333,7 +333,6 @@ nautilus_gdu_show_error (GtkWidget *parent_window,
char *window_title;
GIcon *window_icon;
va_list args;
- char *error_msg;
GtkWidget *box, *hbox, *expander, *sw, *tv;
GList *children;
GtkTextBuffer *buffer;
@@ -348,33 +347,6 @@ nautilus_gdu_show_error (GtkWidget *parent_window,
error_text = g_strdup_vprintf (primary_markup_format, args);
va_end (args);
- switch (error->code) {
- case GDU_ERROR_FAILED:
- error_msg = _("The operation failed.");
- break;
- case GDU_ERROR_BUSY:
- error_msg = _("The device is busy.");
- break;
- case GDU_ERROR_CANCELLED:
- error_msg = _("The operation was cancelled.");
- break;
- case GDU_ERROR_INHIBITED:
- error_msg = _("The daemon is being inhibited.");
- break;
- case GDU_ERROR_INVALID_OPTION:
- error_msg = _("An invalid option was passed.");
- break;
- case GDU_ERROR_NOT_SUPPORTED:
- error_msg = _("The operation is not supported.");
- break;
- case GDU_ERROR_ATA_SMART_WOULD_WAKEUP:
- error_msg = _("Getting ATA SMART data would wake up the device.");
- break;
- default:
- error_msg = _("Unknown error");
- break;
- }
-
dialog = gtk_message_dialog_new_with_markup (
GTK_WINDOW (parent_window),
GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT,
@@ -382,7 +354,7 @@ nautilus_gdu_show_error (GtkWidget *parent_window,
GTK_BUTTONS_CLOSE,
"<big><b>%s</b></big>",
error_text);
- gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog), "%s", error_msg);
+ gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog), "%s", error->message);
/* Here we cheat a little by poking in the messagedialog internals
* to add the details expander to the inner vbox and arrange things
@@ -438,8 +410,8 @@ nautilus_gdu_show_error (GtkWidget *parent_window,
gtk_window_set_title (GTK_WINDOW (dialog), window_title);
- // TODO: no support for GIcon in GtkWindow
- //gtk_window_set_icon_name (GTK_WINDOW (dialog), window_icon_name);
+ /* TODO: no support for GIcon in GtkWindow */
+ /* gtk_window_set_icon_name (GTK_WINDOW (dialog), window_icon_name); */
g_signal_connect_swapped (dialog,
"response",
@@ -559,7 +531,7 @@ format_action_completed (GduDevice *device,
data->recommended_part_type = gdu_util_get_default_part_type_for_scheme_and_fstype (data->scheme, data->fstype, gdu_device_partition_get_size (device));
g_debug ("format_action_completed: part_type = %s, recommended_part_type = %s", part_type, data->recommended_part_type);
/* Change partition type if necessary */
- if (strcasecmp (part_type, data->recommended_part_type) != 0)
+ if (strcmp (part_type, data->recommended_part_type) != 0)
{
g_debug ("changing part type to %s, device = %s", data->recommended_part_type, gdu_device_get_device_file (device));
gtk_action_activate (GTK_ACTION (data->part_modify_action));
diff --git a/src/gdu-format-tool/format-window.c b/src/gdu-format-tool/format-window.c
index b853a28..9333d46 100644
--- a/src/gdu-format-tool/format-window.c
+++ b/src/gdu-format-tool/format-window.c
@@ -22,9 +22,7 @@
*
*/
-#ifdef HAVE_CONFIG_H
- #include <config.h> /* for GETTEXT_PACKAGE */
-#endif
+#include "config.h"
#include <glib/gi18n-lib.h>
@@ -136,7 +134,7 @@ update_ui (FormatDialogPrivate *priv)
g_object_unref (pixbuf);
presentable_icon = gdu_presentable_get_icon (priv->presentable);
if (presentable_icon) {
- icon_name = g_icon_get_string (presentable_icon);
+ icon_name = _g_icon_get_string (presentable_icon);
gtk_window_set_icon_name (GTK_WINDOW (priv->dialog), icon_name);
g_free (icon_name);
g_object_unref (presentable_icon);
@@ -212,7 +210,7 @@ void
select_new_presentable (FormatDialogPrivate *priv, GduPresentable *presentable)
{
/* TODO: force refresh when no standalone mode ? */
-// if (presentable != priv->presentable)
+/* if (presentable != priv->presentable) */
set_new_presentable (priv, presentable);
}
@@ -417,7 +415,7 @@ nautilus_gdu_spawn_dialog (GduPresentable *presentable)
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
gtk_misc_set_padding (GTK_MISC (label), 10, 10);
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
-// gtk_label_set_width_chars (GTK_LABEL (label), 50);
+/* gtk_label_set_width_chars (GTK_LABEL (label), 50); */
gtk_box_pack_start (GTK_BOX (vbox3), label, FALSE, TRUE, 0);
priv->details_label = label;
diff --git a/src/gdu-format-tool/gdu-format-tool.c b/src/gdu-format-tool/gdu-format-tool.c
index 2730055..032025a 100644
--- a/src/gdu-format-tool/gdu-format-tool.c
+++ b/src/gdu-format-tool/gdu-format-tool.c
@@ -22,9 +22,7 @@
*
*/
-#ifdef HAVE_CONFIG_H
- #include <config.h> /* for GETTEXT_PACKAGE */
-#endif
+#include "config.h"
#include <glib-object.h>
#include <glib/gi18n-lib.h>
diff --git a/src/gdu-format-tool/gdu-utils.c b/src/gdu-format-tool/gdu-utils.c
index a0837c1..9a32ac9 100644
--- a/src/gdu-format-tool/gdu-utils.c
+++ b/src/gdu-format-tool/gdu-utils.c
@@ -22,9 +22,7 @@
*
*/
-#ifdef HAVE_CONFIG_H
- #include <config.h> /* for GETTEXT_PACKAGE */
-#endif
+#include "config.h"
#include <glib/gi18n-lib.h>
#include <gio/gio.h>
@@ -98,7 +96,7 @@ find_presentable_from_device_path (char *device_path)
char *
-g_icon_get_string (GIcon *icon)
+_g_icon_get_string (GIcon *icon)
{
const char *icon_text = NULL;
const char * const *icon_names;
diff --git a/src/gdu-format-tool/gdu-utils.h b/src/gdu-format-tool/gdu-utils.h
index d0b7cda..24be15a 100644
--- a/src/gdu-format-tool/gdu-utils.h
+++ b/src/gdu-format-tool/gdu-utils.h
@@ -37,7 +37,7 @@ GduPresentable * find_presentable_from_mount_path (char *mount_path);
/* caller must unref the returned object */
GduPresentable * find_presentable_from_device_path (char *device_path);
-char * g_icon_get_string (GIcon *icon);
+char * _g_icon_get_string (GIcon *icon);
gboolean is_active_luks (GduPool *pool,
GduPresentable *presentable);
diff --git a/src/gdu-nautilus-extension/nautilus-gdu.c b/src/gdu-nautilus-extension/nautilus-gdu.c
index 0d41b2a..4affd77 100644
--- a/src/gdu-nautilus-extension/nautilus-gdu.c
+++ b/src/gdu-nautilus-extension/nautilus-gdu.c
@@ -22,9 +22,7 @@
*
*/
-#ifdef HAVE_CONFIG_H
- #include <config.h> /* for GETTEXT_PACKAGE */
-#endif
+#include "config.h"
#include "nautilus-gdu.h"
diff --git a/src/gdu-nautilus-extension/nautilus-module.c b/src/gdu-nautilus-extension/nautilus-module.c
index a028144..23f869b 100644
--- a/src/gdu-nautilus-extension/nautilus-module.c
+++ b/src/gdu-nautilus-extension/nautilus-module.c
@@ -22,9 +22,7 @@
*
*/
-#ifdef HAVE_CONFIG_H
- #include <config.h>
-#endif
+#include "config.h"
#include "nautilus-gdu.h"