~abreu-alexandre/libunity-webapps/add-apt-xb-domain-parsing

« back to all changes in this revision

Viewing changes to src/context-daemon/unity-webapps-application-info.c

MergeĀ lp:~robertcarr/libunity-webapps/preinstalled-application-info

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
 
53
53
#define UNITY_WEBAPPS_APPLICATION_INFO_GET_PRIVATE(object) (G_TYPE_INSTANCE_GET_PRIVATE ((object), UNITY_WEBAPPS_TYPE_APPLICATION_INFO, UnityWebappsApplicationInfoPrivate))
54
54
 
 
55
static gchar *unity_webapps_application_info_default_get_desktop_file_path (UnityWebappsApplicationInfo *info);
 
56
static gchar *unity_webapps_application_info_default_get_desktop_file_name (UnityWebappsApplicationInfo *info);
 
57
static gboolean unity_webapps_application_info_default_ensure_desktop_file (UnityWebappsApplicationInfo *info, 
 
58
                                                                            GError **error);
 
59
 
55
60
static void
56
61
unity_webapps_application_info_finalize (GObject *object)
57
62
{
135
140
  
136
141
  object_class->get_property = unity_webapps_application_info_get_property;
137
142
  object_class->set_property = unity_webapps_application_info_set_property;
 
143
  
 
144
  klass->get_desktop_file_name = unity_webapps_application_info_default_get_desktop_file_name;
 
145
  klass->get_desktop_file_path = unity_webapps_application_info_default_get_desktop_file_path;
 
146
  klass->ensure_desktop_file = unity_webapps_application_info_default_ensure_desktop_file;
138
147
 
139
148
  g_object_class_install_property (object_class, PROP_NAME,
140
149
                                   g_param_spec_string ("name",
271
280
  return canonical_full_name;
272
281
}
273
282
 
274
 
gchar *
275
 
unity_webapps_application_info_get_desktop_file_name (UnityWebappsApplicationInfo *info)
 
283
static gchar *
 
284
unity_webapps_application_info_default_get_desktop_file_name (UnityWebappsApplicationInfo *info)
276
285
{
277
286
  gchar *desktop_file_name, *canonical_name, *name_spaces_removed;
278
287
 
286
295
  return desktop_file_name;
287
296
}
288
297
 
289
 
gchar *
290
 
unity_webapps_application_info_get_desktop_file_path (UnityWebappsApplicationInfo *info)
 
298
static gchar *
 
299
unity_webapps_application_info_default_get_desktop_file_path (UnityWebappsApplicationInfo *info)
291
300
{
292
301
  gchar *desktop_file_name, *path;
293
302
  
415
424
  return success;
416
425
}
417
426
 
418
 
gboolean
419
 
unity_webapps_application_info_write_desktop_file (UnityWebappsApplicationInfo *info, 
420
 
                                                   GError **error)
 
427
static gboolean
 
428
unity_webapps_application_info_default_ensure_desktop_file (UnityWebappsApplicationInfo *info, 
 
429
                                                            GError **error)
421
430
{
422
431
  gchar *desktop_file_path;
423
432
  gboolean success;
523
532
  
524
533
  return ret;  
525
534
}
 
535
 
 
536
gchar *
 
537
unity_webapps_application_info_get_desktop_file_name (UnityWebappsApplicationInfo *info)
 
538
{
 
539
  g_return_val_if_fail (UNITY_WEBAPPS_IS_APPLICATION_INFO (info), NULL);
 
540
  
 
541
  if (UNITY_WEBAPPS_APPLICATION_INFO_GET_CLASS (info)->get_desktop_file_name != NULL)
 
542
    {
 
543
      return UNITY_WEBAPPS_APPLICATION_INFO_GET_CLASS (info)->get_desktop_file_name (info);
 
544
    }
 
545
  return NULL;
 
546
}
 
547
 
 
548
gchar *
 
549
unity_webapps_application_info_get_desktop_file_path (UnityWebappsApplicationInfo *info)
 
550
{
 
551
  g_return_val_if_fail (UNITY_WEBAPPS_IS_APPLICATION_INFO (info), NULL);
 
552
  
 
553
  if (UNITY_WEBAPPS_APPLICATION_INFO_GET_CLASS (info)->get_desktop_file_path != NULL)
 
554
    {
 
555
      return UNITY_WEBAPPS_APPLICATION_INFO_GET_CLASS (info)->get_desktop_file_path (info);
 
556
    }
 
557
  return NULL;
 
558
}
 
559
 
 
560
gboolean
 
561
unity_webapps_application_info_ensure_desktop_file (UnityWebappsApplicationInfo *info, 
 
562
                                                    GError **error)
 
563
{
 
564
  g_return_val_if_fail (UNITY_WEBAPPS_IS_APPLICATION_INFO (info), FALSE);
 
565
  
 
566
  if (UNITY_WEBAPPS_APPLICATION_INFO_GET_CLASS (info)->ensure_desktop_file != NULL)
 
567
    {
 
568
      return UNITY_WEBAPPS_APPLICATION_INFO_GET_CLASS (info)->ensure_desktop_file (info, error);
 
569
    }
 
570
  return FALSE;
 
571
}