Skip to content

Commit

Permalink
fixed compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Paolo Bacchilega committed Feb 22, 2010
1 parent 7ebe494 commit a165db7
Show file tree
Hide file tree
Showing 14 changed files with 51 additions and 35 deletions.
1 change: 1 addition & 0 deletions extensions/catalogs/gth-organize-task.c
Expand Up @@ -354,6 +354,7 @@ gth_organize_task_exec (GthTask *base)
attributes = "standard::name,standard::type,time::modified,time::modified-usec,Embedded::Photo::DateTimeOriginal";
break;
case GTH_GROUP_POLICY_MODIFIED_DATE:
default:
attributes = "standard::name,standard::type,time::modified,time::modified-usec";
break;
}
Expand Down
10 changes: 6 additions & 4 deletions extensions/change_date/dlg-change-date.c
Expand Up @@ -69,6 +69,8 @@ ok_button_clicked (GtkWidget *button,
if (IS_ACTIVE (GET_WIDGET ("change_datetimeoriginal_checkbutton")))
change_fields |= GTH_CHANGE_EXIF_DATETIMEORIGINAL_TAG;

change_type = 0;
time_adjustment = 0;
if (IS_ACTIVE (GET_WIDGET ("to_following_date_radiobutton"))) {
change_type = GTH_CHANGE_TO_FOLLOWING_DATE;
date_time = gth_datetime_new ();
Expand Down Expand Up @@ -158,16 +160,16 @@ dlg_change_date (GthBrowser *browser,
gth_time_selector_set_value (GTH_TIME_SELECTOR (data->date_selector), datetime);
gtk_widget_show (data->date_selector);
gtk_box_pack_start (GTK_BOX (GET_WIDGET ("date_selector_box")), data->date_selector, TRUE, TRUE, 0);

gth_datetime_free (datetime);

/* Set widgets data. */

update_sensitivity (data);

/* Set the signals handlers. */
g_signal_connect (G_OBJECT (data->dialog),

g_signal_connect (G_OBJECT (data->dialog),
"destroy",
G_CALLBACK (dialog_destroy_cb),
data);
Expand Down Expand Up @@ -218,7 +220,7 @@ dlg_change_date (GthBrowser *browser,

/* run dialog. */

gtk_window_set_transient_for (GTK_WINDOW (data->dialog),
gtk_window_set_transient_for (GTK_WINDOW (data->dialog),
GTK_WINDOW (browser));
gtk_window_set_modal (GTK_WINDOW (data->dialog), FALSE);
gtk_widget_show (data->dialog);
Expand Down
1 change: 1 addition & 0 deletions extensions/image_print/gth-image-print-job.c
Expand Up @@ -1092,6 +1092,7 @@ unit_combobox_changed_cb (GtkComboBox *combo_box,
digits = 0;
break;
case GTH_METRIC_PIXELS:
default:
digits = 0;
break;
}
Expand Down
1 change: 1 addition & 0 deletions extensions/importer/utils.c
Expand Up @@ -122,6 +122,7 @@ gth_import_utils_get_file_destination (GthFileData *file_data,
break;

case GTH_SUBFOLDER_TYPE_NONE:
default:
child = NULL;
break;
}
Expand Down
1 change: 1 addition & 0 deletions extensions/picasaweb/picasa-web-album.c
Expand Up @@ -83,6 +83,7 @@ picasa_web_album_create_element (DomDomizable *base,
value = "all";
break;
case PICASA_WEB_ACCESS_PRIVATE:
default:
value = "private";
break;
case PICASA_WEB_ACCESS_PUBLIC:
Expand Down
1 change: 1 addition & 0 deletions extensions/picasaweb/picasa-web-photo.c
Expand Up @@ -88,6 +88,7 @@ picasa_web_photo_create_element (DomDomizable *base,
value = "all";
break;
case PICASA_WEB_ACCESS_PRIVATE:
default:
value = "private";
break;
case PICASA_WEB_ACCESS_PUBLIC:
Expand Down
10 changes: 9 additions & 1 deletion extensions/raw_files/main.c
Expand Up @@ -396,7 +396,15 @@ openraw_pixbuf_animation_new_from_file (GthFileData *file_data,
}

if (command != NULL) {
system (command);
if (system (command) == -1) {
g_free (command);
g_free (cache_file_esc);
g_free (local_file_esc);
g_free (cache_file);
g_free (local_file);

return NULL;
}
g_free (command);
}
}
Expand Down
2 changes: 1 addition & 1 deletion gthumb/gio-utils.c
Expand Up @@ -2206,7 +2206,7 @@ _g_file_create_unique (GFile *parent,
GFile *file = NULL;
GError *local_error = NULL;
int n;
GFileOutputStream *stream;
GFileOutputStream *stream = NULL;

file = g_file_get_child_for_display_name (parent, display_name, &local_error);
n = 0;
Expand Down
6 changes: 1 addition & 5 deletions gthumb/gth-file-source-vfs.c
Expand Up @@ -413,6 +413,7 @@ monitor_changed_cb (GFileMonitor *file_monitor,

switch (file_event_type) {
case G_FILE_MONITOR_EVENT_CREATED:
default:
event_type = GTH_MONITOR_EVENT_CREATED;
break;

Expand All @@ -424,11 +425,6 @@ monitor_changed_cb (GFileMonitor *file_monitor,
case G_FILE_MONITOR_EVENT_ATTRIBUTE_CHANGED:
event_type = GTH_MONITOR_EVENT_CHANGED;
break;

case G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT:
case G_FILE_MONITOR_EVENT_PRE_UNMOUNT:
case G_FILE_MONITOR_EVENT_UNMOUNTED:
return;
}

#ifdef DEBUG_MONITOR
Expand Down
49 changes: 25 additions & 24 deletions gthumb/gth-icon-cache.c
Expand Up @@ -19,7 +19,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
*/

#include <config.h>
#include "glib-utils.h"
#include "gth-icon-cache.h"
Expand All @@ -37,35 +37,35 @@ struct _GthIconCache {
};


GthIconCache *
GthIconCache *
gth_icon_cache_new (GtkIconTheme *icon_theme,
int icon_size)
{
GthIconCache *icon_cache;

g_return_val_if_fail (icon_theme != NULL, NULL);

icon_cache = g_new0 (GthIconCache, 1);
icon_cache->icon_theme = icon_theme;
icon_cache->icon_size = icon_size;
icon_cache->cache = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, g_object_unref);

g_hash_table_insert (icon_cache->cache, VOID_PIXBUF_KEY, create_void_pixbuf (icon_cache->icon_size, icon_cache->icon_size));

return icon_cache;
}


GthIconCache *
GthIconCache *
gth_icon_cache_new_for_widget (GtkWidget *widget,
GtkIconSize icon_size)
{
GtkIconTheme *icon_theme;
int pixel_size;

icon_theme = gtk_icon_theme_get_for_screen (gtk_widget_get_screen (widget));
pixel_size = _gtk_icon_get_pixel_size (widget, GTK_ICON_SIZE_MENU);

return gth_icon_cache_new (icon_theme, pixel_size);
}

Expand All @@ -84,57 +84,58 @@ static const char *
_gth_icon_cache_get_icon_key (GIcon *icon)
{
const char *key = NULL;

if (G_IS_THEMED_ICON (icon)) {
char **icon_names;
char *name;

g_object_get (icon, "names", &icon_names, NULL);
name = g_strjoinv (",", icon_names);

key = get_static_string (name);

g_free (name);
g_strfreev (icon_names);
g_strfreev (icon_names);
}
else if (G_IS_FILE_ICON (icon)) {
GFile *file;
char *filename;

file = g_file_icon_get_file (G_FILE_ICON (icon));
filename = g_file_get_path (file);

key = get_static_string (filename);

g_free (filename);
g_object_unref (file);
}

return key;
}


GdkPixbuf *
gth_icon_cache_get_pixbuf (GthIconCache *icon_cache,
GIcon *icon)
{
const char *key;
GdkPixbuf *pixbuf;


key = NULL;
if (icon != NULL)
key = _gth_icon_cache_get_icon_key (icon);

if (key == NULL)
key = VOID_PIXBUF_KEY;

performance (DEBUG_INFO, "get pixbuf for %s", key);

pixbuf = g_hash_table_lookup (icon_cache->cache, key);
if (pixbuf != NULL) {
g_object_ref (pixbuf);
return pixbuf;
}

if (icon == NULL) {
GIcon *unknown_icon;

Expand All @@ -146,8 +147,8 @@ gth_icon_cache_get_pixbuf (GthIconCache *icon_cache,
else
pixbuf = _g_icon_get_pixbuf (icon, icon_cache->icon_size, icon_cache->icon_theme);
g_hash_table_insert (icon_cache->cache, (gpointer) key, g_object_ref (pixbuf));

performance (DEBUG_INFO, "done (not cached)");

return pixbuf;
}
1 change: 1 addition & 0 deletions gthumb/gth-overwrite-dialog.c
Expand Up @@ -218,6 +218,7 @@ gth_overwrite_dialog_construct (GthOverwriteDialog *self,

switch (default_response) {
case GTH_OVERWRITE_RESPONSE_YES:
default:
overwrite_radiobutton = _gtk_builder_get_widget (self->priv->builder, "overwrite_yes_radiobutton");
break;
case GTH_OVERWRITE_RESPONSE_NO:
Expand Down
1 change: 1 addition & 0 deletions gthumb/gth-test-simple.c
Expand Up @@ -752,6 +752,7 @@ gth_test_simple_real_update_from_control (GthTest *base,

switch (self->priv->data_type) {
case GTH_TEST_DATA_TYPE_NONE:
default:
retval = TRUE;
break;
case GTH_TEST_DATA_TYPE_INT:
Expand Down
1 change: 1 addition & 0 deletions gthumb/gth-user-dir.c
Expand Up @@ -37,6 +37,7 @@ gth_user_dir_get_file_va_list (GthDir dir_type,
const char *element;
char *filename;

user_dir = NULL;
switch (dir_type) {
case GTH_DIR_CONFIG:
user_dir = g_get_user_config_dir ();
Expand Down
1 change: 1 addition & 0 deletions gthumb/gtk-utils.c
Expand Up @@ -723,6 +723,7 @@ _g_icon_get_pixbuf (GIcon *icon,
if (icon == NULL)
return NULL;

pixbuf = NULL;
if (G_IS_THEMED_ICON (icon))
pixbuf = get_themed_icon_pixbuf (G_THEMED_ICON (icon), size, theme);
if (G_IS_FILE_ICON (icon))
Expand Down

0 comments on commit a165db7

Please sign in to comment.