Code cleanup

This commit is contained in:
Pierre Pronchery 2012-01-03 23:19:52 +00:00
parent 7a06b25173
commit dd2eec5a9a
2 changed files with 12 additions and 7 deletions

View File

@ -2077,7 +2077,7 @@ static gboolean _on_reset(gpointer data)
else if(hayes->fp != NULL) else if(hayes->fp != NULL)
setvbuf(hayes->fp, NULL, _IONBF, BUFSIZ); setvbuf(hayes->fp, NULL, _IONBF, BUFSIZ);
hayes->channel = g_io_channel_unix_new(fd); hayes->channel = g_io_channel_unix_new(fd);
if((g_io_channel_set_encoding(hayes->channel, NULL, &error)) if(g_io_channel_set_encoding(hayes->channel, NULL, &error)
!= G_IO_STATUS_NORMAL) != G_IO_STATUS_NORMAL)
{ {
modem->helper->error(modem->helper->modem, error->message, 1); modem->helper->error(modem->helper->modem, error->message, 1);

View File

@ -115,7 +115,7 @@ typedef struct _PhonePluginEntry
typedef enum _PhonePluginsColumn typedef enum _PhonePluginsColumn
{ {
PHONE_PLUGINS_COLUMN_PLUGIN, PHONE_PLUGINS_COLUMN_PLUGIN = 0,
PHONE_PLUGINS_COLUMN_ENABLED, PHONE_PLUGINS_COLUMN_ENABLED,
PHONE_PLUGINS_COLUMN_FILENAME, PHONE_PLUGINS_COLUMN_FILENAME,
PHONE_PLUGINS_COLUMN_ICON, PHONE_PLUGINS_COLUMN_ICON,
@ -128,7 +128,7 @@ typedef void (*PhoneSettingsCallback)(Phone * phone, gboolean show, ...);
typedef enum _PhoneSettingsColumn typedef enum _PhoneSettingsColumn
{ {
PHONE_SETTINGS_COLUMN_CALLBACK, PHONE_SETTINGS_COLUMN_CALLBACK = 0,
PHONE_SETTINGS_COLUMN_PLUGIN, PHONE_SETTINGS_COLUMN_PLUGIN,
PHONE_SETTINGS_COLUMN_ICON, PHONE_SETTINGS_COLUMN_ICON,
PHONE_SETTINGS_COLUMN_NAME PHONE_SETTINGS_COLUMN_NAME
@ -2184,7 +2184,7 @@ static void _plugins_on_cancel(gpointer data)
Plugin * p; Plugin * p;
PhonePlugin * pp; PhonePlugin * pp;
size_t i; size_t i;
GdkPixbuf * pixbuf; GdkPixbuf * icon;
gtk_widget_hide(phone->pl_window); gtk_widget_hide(phone->pl_window);
gtk_list_store_clear(phone->pl_store); gtk_list_store_clear(phone->pl_store);
@ -2223,10 +2223,15 @@ static void _plugins_on_cancel(gpointer data)
phone->plugins[i].pp, -1); phone->plugins[i].pp, -1);
break; break;
} }
pixbuf = gtk_icon_theme_load_icon(theme, (pp->icon != NULL) icon = NULL;
? pp->icon : "gnome-settings", 48, 0, NULL); if(pp->icon != NULL)
icon = gtk_icon_theme_load_icon(theme, pp->icon, 48, 0,
NULL);
if(icon == NULL)
icon = gtk_icon_theme_load_icon(theme, "gnome-settings",
48, 0, NULL);
gtk_list_store_set(phone->pl_store, &iter, gtk_list_store_set(phone->pl_store, &iter,
PHONE_PLUGINS_COLUMN_ICON, pixbuf, -1); PHONE_PLUGINS_COLUMN_ICON, icon, -1);
plugin_delete(p); plugin_delete(p);
} }
closedir(dir); closedir(dir);