~ubuntu-branches/ubuntu/natty/file-browser-applet/natty

« back to all changes in this revision

Viewing changes to src/utils.c

  • Committer: Bazaar Package Importer
  • Author(s): Andrew Starr-Bochicchio
  • Date: 2009-07-01 17:43:20 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20090701174320-47ghs6125y9in9e3
Tags: 0.6.4-0ubuntu1
* New upstream release.
 - Added option to display thumbnails (if available) instead of icons.
 - Usability improvements.
 - Code cleanups.
* debian/control:
 - Bump standards version to 3.8.2, no changes needed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
/******************************************************************************/
32
32
void
33
33
garbage_init (Garbage *garabage) {
34
 
    if (DEBUG) g_printf ("In %s\n", __FUNCTION__);
35
 
    
36
34
    if (*garabage == NULL) {
37
35
        GPtrArray **_garbage = (GPtrArray**)garabage;
38
36
        *_garbage = g_ptr_array_new();
41
39
/******************************************************************************/
42
40
void
43
41
garbage_empty (Garbage *garabage, gboolean reuse) {
44
 
    if (DEBUG) g_printf ("In %s\n", __FUNCTION__);
45
 
 
46
42
    if (*garabage == NULL)
47
43
        return;
48
44
 
55
51
/******************************************************************************/
56
52
void
57
53
garbage_add_item (Garbage garabage, gpointer item) {
58
 
    if (DEBUG) g_printf ("In %s\n", __FUNCTION__);
59
 
 
60
54
    if (garabage) {
61
55
        GPtrArray *_garbage = (GPtrArray*)garabage;
62
56
        g_ptr_array_add (_garbage, item);
65
59
/******************************************************************************/
66
60
gboolean
67
61
utils_gerror_ok (GError **error, gboolean show_error) {
68
 
    if (DEBUG) g_printf ("In %s\n", __FUNCTION__);
69
 
 
70
62
    if (*error) {
71
 
        if (DEBUG) g_printf ("error: %s\n", (*error)->message);
 
63
        g_printerr ("Error::%s\n", (*error)->message);
72
64
 
73
65
        if (show_error)
74
66
            utils_show_dialog (_("Error"), (*error)->message, GTK_MESSAGE_ERROR);
82
74
/******************************************************************************/
83
75
void
84
76
utils_show_dialog (const gchar *title, const gchar *message, GtkMessageType type) {
85
 
    if (DEBUG) g_printf ("In %s\n", __FUNCTION__);
86
 
 
87
77
    GtkWidget *dialog = gtk_message_dialog_new (NULL,
88
78
                                                0,
89
79
                                                type,
102
92
/******************************************************************************/
103
93
GtkWidget*
104
94
utils_get_scaled_image_from_file (const gchar *file_name, int size) {
105
 
    if (DEBUG) g_printf ("In %s\n", __FUNCTION__);
106
 
 
107
95
    GdkPixbuf *pixbuf   = gdk_pixbuf_new_from_file_at_size (file_name,
108
96
                                                            size,
109
97
                                                            size,
117
105
/******************************************************************************/
118
106
GSList *
119
107
g_slist_swap_data (GSList *list, guint index) {
120
 
    if (DEBUG) g_printf ("In %s\n", __FUNCTION__);
121
 
 
122
108
    gpointer tmp   = NULL;
123
109
    GSList *first  = g_slist_nth (list, index);
124
110
    GSList *second = first->next;