Removed d-bus paths from service class
This commit is contained in:
@ -38,9 +38,7 @@
|
||||
#define CSH 480
|
||||
|
||||
enum {
|
||||
PROP_0,
|
||||
PROP_OBJECT_PATH,
|
||||
PROP_CLIENT_NAME,
|
||||
PROP_0, // Magic: without this, keyboard is not useable in g_object_notify
|
||||
PROP_KEYBOARD,
|
||||
PROP_VISIBLE,
|
||||
PROP_FULLSCREEN,
|
||||
@ -220,16 +218,6 @@ eekboard_context_service_set_property (GObject *object,
|
||||
EekboardContextService *context = EEKBOARD_CONTEXT_SERVICE(object);
|
||||
|
||||
switch (prop_id) {
|
||||
case PROP_OBJECT_PATH:
|
||||
if (context->priv->object_path)
|
||||
g_free (context->priv->object_path);
|
||||
context->priv->object_path = g_value_dup_string (value);
|
||||
break;
|
||||
case PROP_CLIENT_NAME:
|
||||
if (context->priv->client_name)
|
||||
g_free (context->priv->client_name);
|
||||
context->priv->client_name = g_value_dup_string (value);
|
||||
break;
|
||||
case PROP_KEYBOARD:
|
||||
if (context->priv->keyboard)
|
||||
g_object_unref (context->priv->keyboard);
|
||||
@ -261,12 +249,6 @@ eekboard_context_service_get_property (GObject *object,
|
||||
EekboardContextService *context = EEKBOARD_CONTEXT_SERVICE(object);
|
||||
|
||||
switch (prop_id) {
|
||||
case PROP_OBJECT_PATH:
|
||||
g_value_set_string (value, context->priv->object_path);
|
||||
break;
|
||||
case PROP_CLIENT_NAME:
|
||||
g_value_set_string (value, context->priv->client_name);
|
||||
break;
|
||||
case PROP_KEYBOARD:
|
||||
g_value_set_object (value, context->priv->keyboard);
|
||||
break;
|
||||
@ -466,34 +448,6 @@ eekboard_context_service_class_init (EekboardContextServiceClass *klass)
|
||||
G_TYPE_NONE,
|
||||
0);
|
||||
|
||||
/**
|
||||
* EekboardContextService:object-path:
|
||||
*
|
||||
* D-Bus object path.
|
||||
*/
|
||||
pspec = g_param_spec_string ("object-path",
|
||||
"Object-path",
|
||||
"Object-path",
|
||||
NULL,
|
||||
G_PARAM_CONSTRUCT | G_PARAM_READWRITE);
|
||||
g_object_class_install_property (gobject_class,
|
||||
PROP_OBJECT_PATH,
|
||||
pspec);
|
||||
|
||||
/**
|
||||
* EekboardContextService:client-name:
|
||||
*
|
||||
* Name of a client who created this context service.
|
||||
*/
|
||||
pspec = g_param_spec_string ("client-name",
|
||||
"Client-name",
|
||||
"Client-name",
|
||||
NULL,
|
||||
G_PARAM_READWRITE);
|
||||
g_object_class_install_property (gobject_class,
|
||||
PROP_CLIENT_NAME,
|
||||
pspec);
|
||||
|
||||
/**
|
||||
* EekboardContextService:keyboard:
|
||||
*
|
||||
|
||||
@ -208,7 +208,7 @@ eekboard_service_constructed (GObject *object)
|
||||
EekboardContextService *context;
|
||||
|
||||
g_assert (klass->create_context);
|
||||
context = klass->create_context (service, "client_name", "object_path");
|
||||
context = klass->create_context (service);
|
||||
g_object_set_data_full (G_OBJECT(context),
|
||||
"owner", g_strdup ("sender"),
|
||||
(GDestroyNotify)g_free);
|
||||
|
||||
@ -60,9 +60,7 @@ struct _EekboardServiceClass {
|
||||
GObjectClass parent_class;
|
||||
|
||||
/*< public >*/
|
||||
EekboardContextService *(*create_context) (EekboardService *self,
|
||||
const gchar *client_name,
|
||||
const gchar *object_path);
|
||||
EekboardContextService *(*create_context) (EekboardService *self);
|
||||
|
||||
/*< private >*/
|
||||
/* padding */
|
||||
|
||||
@ -491,11 +491,8 @@ server_context_service_init (ServerContextService *context)
|
||||
}
|
||||
|
||||
ServerContextService *
|
||||
server_context_service_new (const gchar *client_name,
|
||||
const gchar *object_path)
|
||||
server_context_service_new ()
|
||||
{
|
||||
return g_object_new (SERVER_TYPE_CONTEXT_SERVICE,
|
||||
"client-name", client_name,
|
||||
"object-path", object_path,
|
||||
NULL);
|
||||
}
|
||||
|
||||
@ -31,8 +31,7 @@ G_BEGIN_DECLS
|
||||
|
||||
typedef struct _ServerContextService ServerContextService;
|
||||
|
||||
ServerContextService *server_context_service_new (const gchar *client_name,
|
||||
const gchar *object_path);
|
||||
ServerContextService *server_context_service_new ();
|
||||
|
||||
G_END_DECLS
|
||||
#endif /* SERVER_CONTEXT_SERVICE_H */
|
||||
|
||||
@ -35,16 +35,10 @@ struct _ServerServiceClass {
|
||||
G_DEFINE_TYPE (ServerService, server_service, EEKBOARD_TYPE_SERVICE);
|
||||
|
||||
static EekboardContextService *
|
||||
server_service_real_create_context (EekboardService *self,
|
||||
const gchar *client_name,
|
||||
const gchar *object_path)
|
||||
server_service_real_create_context (EekboardService *self)
|
||||
{
|
||||
GDBusConnection *connection;
|
||||
ServerContextService *context;
|
||||
|
||||
context = server_context_service_new (client_name, object_path);
|
||||
|
||||
return EEKBOARD_CONTEXT_SERVICE(context);
|
||||
(void)self;
|
||||
return EEKBOARD_CONTEXT_SERVICE(server_context_service_new ());
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
Reference in New Issue
Block a user