~ubuntu-branches/ubuntu/hardy/gnome-commander/hardy

« back to all changes in this revision

Viewing changes to libgcmd/gnome-cmd-file-info.c

  • Committer: Bazaar Package Importer
  • Author(s): Michael Vogt
  • Date: 2006-06-13 15:39:48 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20060613153948-gvrt3mb2ddk5u62o
Tags: 1.2.0-3
added --disable-scrollkeeper on build

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
    GNOME Commander - A GNOME based file manager 
 
2
    GNOME Commander - A GNOME based file manager
3
3
    Copyright (C) 2001-2006 Marcus Bjurman
4
4
 
5
5
    This program is free software; you can redistribute it and/or modify
15
15
    You should have received a copy of the GNU General Public License
16
16
    along with this program; if not, write to the Free Software
17
17
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18
 
*/ 
 
18
*/
19
19
#include <config.h>
20
20
#include "libgcmd-deps.h"
21
21
#include "gnome-cmd-file-info.h"
34
34
static void
35
35
destroy (GtkObject *object)
36
36
{
37
 
        GnomeCmdFileInfo *file = GNOME_CMD_FILE_INFO (object);
38
 
 
39
 
        gnome_vfs_file_info_unref (file->info);
40
 
        if (file->uri)
41
 
                gnome_vfs_uri_unref (file->uri);
42
 
 
43
 
        g_free (file->priv);
44
 
        
45
 
        if (GTK_OBJECT_CLASS (parent_class)->destroy)
46
 
                (*GTK_OBJECT_CLASS (parent_class)->destroy) (object);
 
37
    GnomeCmdFileInfo *file = GNOME_CMD_FILE_INFO (object);
 
38
 
 
39
    gnome_vfs_file_info_unref (file->info);
 
40
    if (file->uri)
 
41
        gnome_vfs_uri_unref (file->uri);
 
42
 
 
43
    g_free (file->priv);
 
44
 
 
45
    if (GTK_OBJECT_CLASS (parent_class)->destroy)
 
46
        (*GTK_OBJECT_CLASS (parent_class)->destroy) (object);
47
47
}
48
48
 
49
49
 
50
50
static void
51
51
class_init (GnomeCmdFileInfoClass *class)
52
52
{
53
 
        GtkObjectClass *object_class;
54
 
 
55
 
        object_class = GTK_OBJECT_CLASS (class);
56
 
        parent_class = gtk_type_class (gtk_object_get_type ());
57
 
 
58
 
        object_class->destroy = destroy;
 
53
    GtkObjectClass *object_class;
 
54
 
 
55
    object_class = GTK_OBJECT_CLASS (class);
 
56
    parent_class = gtk_type_class (gtk_object_get_type ());
 
57
 
 
58
    object_class->destroy = destroy;
59
59
}
60
60
 
61
61
static void
62
62
init (GnomeCmdFileInfo *file)
63
63
{
64
 
        file->info = NULL;
65
 
        file->uri = NULL;
66
 
        
67
 
        file->priv = g_new0 (GnomeCmdFileInfoPrivate, 1);
 
64
    file->info = NULL;
 
65
    file->uri = NULL;
 
66
 
 
67
    file->priv = g_new0 (GnomeCmdFileInfoPrivate, 1);
68
68
}
69
69
 
70
70
 
76
76
GtkType
77
77
gnome_cmd_file_info_get_type         (void)
78
78
{
79
 
        static GtkType type = 0;
80
 
 
81
 
        if (type == 0)
82
 
        {
83
 
                GtkTypeInfo info =
84
 
                {
85
 
                        "GnomeCmdFileInfo",
86
 
                        sizeof (GnomeCmdFileInfo),
87
 
                        sizeof (GnomeCmdFileInfoClass),
88
 
                        (GtkClassInitFunc) class_init,
89
 
                        (GtkObjectInitFunc) init,
90
 
                        /* reserved_1 */ NULL,
91
 
                        /* reserved_2 */ NULL,
92
 
                        (GtkClassInitFunc) NULL
93
 
                };
94
 
 
95
 
                type = gtk_type_unique (gtk_object_get_type (), &info);
96
 
        }
97
 
        return type;
 
79
    static GtkType type = 0;
 
80
 
 
81
    if (type == 0)
 
82
    {
 
83
        GtkTypeInfo info =
 
84
        {
 
85
            "GnomeCmdFileInfo",
 
86
            sizeof (GnomeCmdFileInfo),
 
87
            sizeof (GnomeCmdFileInfoClass),
 
88
            (GtkClassInitFunc) class_init,
 
89
            (GtkObjectInitFunc) init,
 
90
            /* reserved_1 */ NULL,
 
91
            /* reserved_2 */ NULL,
 
92
            (GtkClassInitFunc) NULL
 
93
        };
 
94
 
 
95
        type = gtk_type_unique (gtk_object_get_type (), &info);
 
96
    }
 
97
    return type;
98
98
}
99
99
 
100
100
 
101
101
void
102
102
gnome_cmd_file_info_setup (GnomeCmdFileInfo *finfo, GnomeVFSURI *uri, GnomeVFSFileInfo *info)
103
103
{
104
 
        g_return_if_fail (GNOME_CMD_IS_FILE_INFO (finfo));
105
 
        
106
 
        finfo->info = info;
107
 
        finfo->uri = uri;
 
104
    g_return_if_fail (GNOME_CMD_IS_FILE_INFO (finfo));
 
105
 
 
106
    finfo->info = info;
 
107
    finfo->uri = uri;
108
108
}
109
109
 
110
110