~sethj/ubuntu/wily/unity/fix-for-1445595

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
/*
 * Copyright 2012 Canonical Ltd.
 *
 * This program is free software: you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License version 3, as
 * published by the  Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranties of
 * MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
 * PURPOSE.  See the applicable version of the GNU Lesser General Public
 * License for more details.
 *
 * You should have received a copy of both the GNU Lesser General Public
 * License version 3 along with this program.  If not, see
 * <http://www.gnu.org/licenses/>
 *
 * Authored by: Andrea Azzarone <andrea.azzarone@canonical.com>
 *
 */

#include <glib.h>

#include "gmockmount.h"

static void g_mock_mount_iface_init (GMountIface *iface);

G_DEFINE_TYPE_WITH_CODE (GMockMount, g_mock_mount, G_TYPE_OBJECT,
			 G_IMPLEMENT_INTERFACE (G_TYPE_MOUNT,
						g_mock_mount_iface_init))

static void
g_mock_mount_finalize (GObject *object)
{
  G_OBJECT_CLASS (g_mock_mount_parent_class)->finalize (object);
}

static void
g_mock_mount_dispose (GObject *object)
{
  G_OBJECT_CLASS (g_mock_mount_parent_class)->dispose (object);
}


static void
g_mock_mount_class_init (GMockMountClass *klass)
{
  GObjectClass *gobject_class = G_OBJECT_CLASS (klass);

  gobject_class->finalize = g_mock_mount_finalize;
  gobject_class->dispose = g_mock_mount_dispose;
}

static void
g_mock_mount_init (GMockMount *mock_mount)
{}

GMockMount *
g_mock_mount_new ()
{
  GMockMount *mount;

  mount = g_object_new (G_TYPE_MOCK_MOUNT, NULL);

  return mount;
}

static GFile *
g_mock_mount_get_root (GMount *mount)
{
  return g_file_new_for_path (ROOT_FILE_PATH);
}

static GIcon *
g_mock_mount_get_icon (GMount *mount)
{
  return NULL;
}

static char *
g_mock_mount_get_uuid (GMount *mount)
{
  return g_strdup ("");
}

static char *
g_mock_mount_get_name (GMount *mount)
{
  return g_strdup ("");
}

static GDrive *
g_mock_mount_get_drive (GMount *mount)
{
  return NULL;
}

static GVolume *
g_mock_mount_get_volume (GMount *mount)
{
  return NULL;
}

static gboolean
g_mock_mount_can_unmount (GMount *mount)
{
  return TRUE;
}

static gboolean
g_mock_mount_can_eject (GMount *mount)
{
  return FALSE;
}

static void
g_mock_mount_unmount (GMount             *mount,
                      GMountUnmountFlags flags,
                      GCancellable        *cancellable,
                      GAsyncReadyCallback  callback,
                      gpointer             user_data)
{
}

static gboolean
g_mock_mount_unmount_finish (GMount       *mount,
                             GAsyncResult  *result,
                             GError       **error)
{
  return TRUE;
}

static void
g_mock_mount_eject (GMount             *mount,
                    GMountUnmountFlags flags,
                    GCancellable        *cancellable,
                    GAsyncReadyCallback  callback,
                    gpointer             user_data)
{
}

static gboolean
g_mock_mount_eject_finish (GMount       *mount,
                           GAsyncResult  *result,
                           GError       **error)
{
  return TRUE;
}


static void
g_mock_mount_iface_init (GMountIface *iface)
{
  iface->get_root = g_mock_mount_get_root;
  iface->get_name = g_mock_mount_get_name;
  iface->get_icon = g_mock_mount_get_icon;
  iface->get_uuid = g_mock_mount_get_uuid;
  iface->get_drive = g_mock_mount_get_drive;
  iface->get_volume = g_mock_mount_get_volume;
  iface->can_unmount = g_mock_mount_can_unmount;
  iface->can_eject = g_mock_mount_can_eject;
  iface->unmount = g_mock_mount_unmount;
  iface->unmount_finish = g_mock_mount_unmount_finish;
  iface->eject = g_mock_mount_eject;
  iface->eject_finish = g_mock_mount_eject_finish;
}