FCmdrProfileSource

FCmdrProfileSource — A source for settings profiles

Functions

Properties

FCmdrService * service Read / Write / Construct Only
SoupURI * uri Read / Write / Construct Only

Types and Values

Object Hierarchy

    GObject
    ╰── FCmdrProfileSource

Description

A FCmdrProfileSource describes a location from which to obtain profile data that can be deserialized into FCmdrProfile instances.

The FCmdrProfileSource class itself is abstract. Each subclass handles profile loading for a particular URI scheme, like "http".

Functions

fcmdr_profile_source_try_new ()

FCmdrProfileSource *
fcmdr_profile_source_try_new (FCmdrService *service,
                              SoupURI *uri);

Instantiates a FCmdrProfileSource subclass to handle the given uri . If no suitable subclass is available, the function returns NULL.

Parameters

service

a FCmdrService

 

uri

a SoupURI

 

Returns

a new FCmdrProfileSource, or NULL


fcmdr_profile_source_ref_service ()

FCmdrService *
fcmdr_profile_source_ref_service (FCmdrProfileSource *source);

Returns the FCmdrService passed to fcmdr_profile_source_try_new().

The returned FCmdrService is referenced for thread-safety and must be unreferenced with g_object_unref() when finished with it.

Parameters

source

a FCmdrProfileSource

 

Returns

a referenced FCmdrService


fcmdr_profile_source_dup_uri ()

SoupURI *
fcmdr_profile_source_dup_uri (FCmdrProfileSource *source);

Returns a copy of the SoupURI passed to fcmdr_profile_source_try_new(). Free the returned SoupURI with soup_uri_free().

Parameters

source

a FCmdrProfileSource

 

Returns

a duplicated SoupURI


fcmdr_profile_source_load_remote ()

void
fcmdr_profile_source_load_remote (FCmdrProfileSource *source,
                                  GCancellable *cancellable,
                                  GAsyncReadyCallback callback,
                                  gpointer user_data);

Asynchronously loads remote profile data from the source 's “uri”.

When the operation is finished, callback will be called. You can then call fcmdr_profile_source_load_remote_finish() to get the result of the operation.

Parameters

source

a FCmdrProfileSource

 

cancellable

optional GCancellable object, or NULL

 

callback

a GAsyncReadyCallback to call when the request is satisfied

 

user_data

data to pass to the callback function

 

fcmdr_profile_source_load_remote_finish ()

gboolean
fcmdr_profile_source_load_remote_finish
                               (FCmdrProfileSource *source,
                                GQueue *out_profiles,
                                GAsyncResult *result,
                                GError **error);

Finishes the operation started with fcmdr_profile_source_load_remote().

The out_profiles queue will be populated with freshly loaded FCmdrProfile instances. If an error occurred, the out_profiles queue will remain empty and the function will set error and return FALSE.

Parameters

source

a FCmdrProfileSource

 

out_profiles

a GQueue in which to deposit profiles

 

result

a GAsyncResult

 

error

return location for a GError, or NULL

 

Returns

TRUE on success, FALSE on failure

Types and Values

FCMDR_PROFILE_SOURCE_EXTENSION_POINT_NAME

#define FCMDR_PROFILE_SOURCE_EXTENSION_POINT_NAME "fcmdr-profile-source"

Extension point for methods of obtaining profile data.

When registering extensions for this extension point, the extension name should match the URI scheme to be handled, like "http".


struct FCmdrProfileSource

struct FCmdrProfileSource;

Contains only private data that should be read and manipulated using the functions below.

Property Details

The “service” property

  “service”                  FCmdrService *

The owner of this profile source.

Flags: Read / Write / Construct Only


The “uri” property

  “uri”                      SoupURI *

The URI for this profile source.

Flags: Read / Write / Construct Only