[libcloudproviders/wip/rename-exporter: 1/2] libcloudproviders: Rename CloudProviderAccount to CloudProviderAccountExporter
- From: Gitlab System User <gitlab src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libcloudproviders/wip/rename-exporter: 1/2] libcloudproviders: Rename CloudProviderAccount to CloudProviderAccountExporter
- Date: Fri, 1 Sep 2017 17:47:31 +0000 (UTC)
commit 846a6db07625025fa077b99553aa937524fe44ff
Author: Julius Härtl <jus bitgrid net>
Date: Fri Sep 1 18:28:15 2017 +0200
libcloudproviders: Rename CloudProviderAccount to CloudProviderAccountExporter
src/cloudprovider.c | 10 +--
src/cloudprovider.h | 6 +-
src/cloudprovideraccount.h | 56 -------------
...deraccount.c => cloudprovideraccountexporter.c} | 92 +++++++++++-----------
src/cloudprovideraccountexporter.h | 56 +++++++++++++
...ntpriv.h => cloudprovideraccountexporterpriv.h} | 12 +--
src/meson.build | 4 +-
test/testcloudproviderserver.c | 26 +++---
8 files changed, 131 insertions(+), 131 deletions(-)
---
diff --git a/src/cloudprovider.c b/src/cloudprovider.c
index 3cd956b..8e63770 100644
--- a/src/cloudprovider.c
+++ b/src/cloudprovider.c
@@ -18,7 +18,7 @@
*/
#include "cloudprovider.h"
-#include "cloudprovideraccountpriv.h"
+#include "cloudprovideraccountexporterpriv.h"
#include "cloudprovider-generated.h"
#include <gio/gio.h>
@@ -58,14 +58,14 @@ G_DEFINE_TYPE_WITH_PRIVATE (CloudProvider, cloud_provider, G_TYPE_OBJECT)
* function to export the accounts the user set up.
*/
void
-cloud_provider_add_account (CloudProvider *cloud_provider,
- CloudProviderAccount *account)
+cloud_provider_add_account (CloudProvider *cloud_provider,
+ CloudProviderAccountExporter *account)
{
CloudProviderPrivate *priv = cloud_provider_get_instance_private(cloud_provider);
CloudProviderObjectSkeleton *object;
- gchar *object_path = g_strconcat (priv->object_path, "/", cloud_provider_account_get_object_name
(account), NULL);
+ gchar *object_path = g_strconcat (priv->object_path, "/", cloud_provider_account_exporter_get_object_name
(account), NULL);
object = cloud_provider_object_skeleton_new(object_path);
- cloud_provider_object_skeleton_set_account1(object, CLOUD_PROVIDER_ACCOUNT1
(cloud_provider_account_get_skeleton (account)));
+ cloud_provider_object_skeleton_set_account1(object, CLOUD_PROVIDER_ACCOUNT1
(cloud_provider_account_exporter_get_skeleton (account)));
g_dbus_object_manager_server_export (priv->manager, G_DBUS_OBJECT_SKELETON(object));
g_free(object_path);
}
diff --git a/src/cloudprovider.h b/src/cloudprovider.h
index cadb7f6..34ff46e 100644
--- a/src/cloudprovider.h
+++ b/src/cloudprovider.h
@@ -22,7 +22,7 @@
#include "cloudprovider-generated.h"
/* for CloudProviderStatus enum */
#include "cloudproviderproxy.h"
-#include "cloudprovideraccount.h"
+#include "cloudprovideraccountexporter.h"
G_BEGIN_DECLS
@@ -72,8 +72,8 @@ cloud_provider_unexport_action_group (CloudProvider *cloud_provider,
const gchar *account_name);
void
-cloud_provider_add_account (CloudProvider* cloud_provider,
- CloudProviderAccount *account);
+cloud_provider_add_account (CloudProvider *cloud_provider,
+ CloudProviderAccountExporter *account);
void
cloud_provider_export_objects (CloudProvider* cloud_provider);
diff --git a/src/cloudprovideraccount.c b/src/cloudprovideraccountexporter.c
similarity index 53%
rename from src/cloudprovideraccount.c
rename to src/cloudprovideraccountexporter.c
index 9c950e0..97bd6dd 100644
--- a/src/cloudprovideraccount.c
+++ b/src/cloudprovideraccountexporter.c
@@ -1,4 +1,4 @@
-/* cloudprovideraccount.c
+/* cloudprovideraccountexporter.c
*
* Copyright (C) 2017 Julius Haertl <jus bitgrid net>
*
@@ -17,95 +17,95 @@
*/
#include <gio/gio.h>
-#include "cloudprovideraccount.h"
+#include "cloudprovideraccountexporter.h"
#include "cloudprovider-generated.h"
typedef struct
{
gchar *object_name;
CloudProviderAccount1 *skeleton;
-} CloudProviderAccountPrivate;
+} CloudProviderAccountExporterPrivate;
-G_DEFINE_TYPE_WITH_PRIVATE (CloudProviderAccount, cloud_provider_account, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (CloudProviderAccountExporter, cloud_provider_account_exporter, G_TYPE_OBJECT)
gchar *
-cloud_provider_account_get_object_name (CloudProviderAccount *self)
+cloud_provider_account_exporter_get_object_name (CloudProviderAccountExporter *self)
{
- CloudProviderAccountPrivate *priv = cloud_provider_account_get_instance_private (self);
+ CloudProviderAccountExporterPrivate *priv = cloud_provider_account_exporter_get_instance_private (self);
return priv->object_name;
}
GDBusInterfaceSkeleton*
-cloud_provider_account_get_skeleton (CloudProviderAccount *self)
+cloud_provider_account_exporter_get_skeleton (CloudProviderAccountExporter *self)
{
- CloudProviderAccountPrivate *priv = cloud_provider_account_get_instance_private (self);
+ CloudProviderAccountExporterPrivate *priv = cloud_provider_account_exporter_get_instance_private (self);
return G_DBUS_INTERFACE_SKELETON(priv->skeleton);
}
static void
-on_get_name (CloudProviderAccount *self,
- GDBusMethodInvocation *invocation,
- gpointer user_data)
+on_get_name (CloudProviderAccountExporter *self,
+ GDBusMethodInvocation *invocation,
+ gpointer user_data)
{
- CloudProviderAccountPrivate *priv = cloud_provider_account_get_instance_private (self);
+ CloudProviderAccountExporterPrivate *priv = cloud_provider_account_exporter_get_instance_private (self);
gchar *name;
- g_signal_emit_by_name (CLOUD_PROVIDER_ACCOUNT(self), "handle_get_name", &name);
+ g_signal_emit_by_name (CLOUD_PROVIDER_ACCOUNT_EXPORTER(self), "handle_get_name", &name);
cloud_provider_account1_complete_get_name (priv->skeleton, invocation, name);
}
static void
-on_get_icon (CloudProviderAccount *self,
- GDBusMethodInvocation *invocation,
- gpointer user_data)
+on_get_icon (CloudProviderAccountExporter *self,
+ GDBusMethodInvocation *invocation,
+ gpointer user_data)
{
- CloudProviderAccountPrivate *priv = cloud_provider_account_get_instance_private (self);
+ CloudProviderAccountExporterPrivate *priv = cloud_provider_account_exporter_get_instance_private (self);
GIcon *icon = NULL;
- g_signal_emit_by_name (CLOUD_PROVIDER_ACCOUNT(self), "handle_get_icon", &icon);
+ g_signal_emit_by_name (CLOUD_PROVIDER_ACCOUNT_EXPORTER(self), "handle_get_icon", &icon);
cloud_provider_account1_complete_get_icon (priv->skeleton, invocation, g_variant_new("v",
g_icon_serialize(icon)));
}
static void
-on_get_path (CloudProviderAccount *self,
- GDBusMethodInvocation *invocation,
- gpointer user_data)
+on_get_path (CloudProviderAccountExporter *self,
+ GDBusMethodInvocation *invocation,
+ gpointer user_data)
{
- CloudProviderAccountPrivate *priv = cloud_provider_account_get_instance_private (self);
+ CloudProviderAccountExporterPrivate *priv = cloud_provider_account_exporter_get_instance_private (self);
gchar *path = NULL;
- g_signal_emit_by_name (CLOUD_PROVIDER_ACCOUNT(self), "handle_get_path", &path);
+ g_signal_emit_by_name (CLOUD_PROVIDER_ACCOUNT_EXPORTER(self), "handle_get_path", &path);
cloud_provider_account1_complete_get_path (priv->skeleton, invocation, path);
}
static void
-on_get_status (CloudProviderAccount *self,
- GDBusMethodInvocation *invocation,
- gpointer user_data)
+on_get_status (CloudProviderAccountExporter *self,
+ GDBusMethodInvocation *invocation,
+ gpointer user_data)
{
- CloudProviderAccountPrivate *priv = cloud_provider_account_get_instance_private (self);
+ CloudProviderAccountExporterPrivate *priv = cloud_provider_account_exporter_get_instance_private (self);
gint *status = g_new0(gint, 1);
- g_signal_emit_by_name (CLOUD_PROVIDER_ACCOUNT(self), "handle_get_status", status);
+ g_signal_emit_by_name (CLOUD_PROVIDER_ACCOUNT_EXPORTER(self), "handle_get_status", status);
cloud_provider_account1_complete_get_status (priv->skeleton, invocation, *status);
g_free(status);
}
static void
-on_get_status_details (CloudProviderAccount *self,
- GDBusMethodInvocation *invocation,
- gpointer user_data)
+on_get_status_details (CloudProviderAccountExporter *self,
+ GDBusMethodInvocation *invocation,
+ gpointer user_data)
{
- CloudProviderAccountPrivate *priv = cloud_provider_account_get_instance_private (self);
+ CloudProviderAccountExporterPrivate *priv = cloud_provider_account_exporter_get_instance_private (self);
gchar *status_details = NULL;
- g_signal_emit_by_name (CLOUD_PROVIDER_ACCOUNT(self), "handle_get_status_details", &status_details);
+ g_signal_emit_by_name (CLOUD_PROVIDER_ACCOUNT_EXPORTER(self), "handle_get_status_details",
&status_details);
cloud_provider_account1_complete_get_status_details (priv->skeleton, invocation, status_details);
}
-CloudProviderAccount*
-cloud_provider_account_new (const gchar *object_name)
+CloudProviderAccountExporter*
+cloud_provider_account_exporter_new (const gchar *object_name)
{
- CloudProviderAccount *self;
- CloudProviderAccountPrivate *priv;
+ CloudProviderAccountExporter *self;
+ CloudProviderAccountExporterPrivate *priv;
- self = g_object_new (TYPE_CLOUD_PROVIDER_ACCOUNT, NULL);
- priv = cloud_provider_account_get_instance_private (self);
+ self = g_object_new (TYPE_CLOUD_PROVIDER_ACCOUNT_EXPORTER, NULL);
+ priv = cloud_provider_account_exporter_get_instance_private (self);
priv->skeleton = cloud_provider_account1_skeleton_new ();
@@ -121,23 +121,23 @@ cloud_provider_account_new (const gchar *object_name)
}
static void
-cloud_provider_account_finalize (GObject *object)
+cloud_provider_account_exporter_finalize (GObject *object)
{
- CloudProviderAccount *self = (CloudProviderAccount *)object;
- CloudProviderAccountPrivate *priv = cloud_provider_account_get_instance_private (self);
+ CloudProviderAccountExporter *self = (CloudProviderAccountExporter *)object;
+ CloudProviderAccountExporterPrivate *priv = cloud_provider_account_exporter_get_instance_private (self);
g_free (priv->object_name);
g_object_unref (priv->skeleton);
- G_OBJECT_CLASS (cloud_provider_account_parent_class)->finalize (object);
+ G_OBJECT_CLASS (cloud_provider_account_exporter_parent_class)->finalize (object);
}
static void
-cloud_provider_account_class_init (CloudProviderAccountClass *klass)
+cloud_provider_account_exporter_class_init (CloudProviderAccountExporterClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
- object_class->finalize = cloud_provider_account_finalize;
+ object_class->finalize = cloud_provider_account_exporter_finalize;
g_signal_new ("handle_get_name",
G_TYPE_FROM_CLASS (klass),
@@ -187,6 +187,6 @@ cloud_provider_account_class_init (CloudProviderAccountClass *klass)
}
static void
-cloud_provider_account_init (CloudProviderAccount *self)
+cloud_provider_account_exporter_init (CloudProviderAccountExporter *self)
{
}
diff --git a/src/cloudprovideraccountexporter.h b/src/cloudprovideraccountexporter.h
new file mode 100644
index 0000000..0879de9
--- /dev/null
+++ b/src/cloudprovideraccountexporter.h
@@ -0,0 +1,56 @@
+/* cloudprovideraccount.h
+ *
+ * Copyright (C) 2017 Julius Haertl <jus bitgrid net>
+ *
+ * This file is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This file is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef CLOUD_PROVIDER_ACCOUNT_EXPORTER_H
+#define CLOUD_PROVIDER_ACCOUNT_EXPORTER_H
+
+G_BEGIN_DECLS
+
+#define TYPE_CLOUD_PROVIDER_ACCOUNT_EXPORTER (cloud_provider_account_exporter_get_type())
+#define CLOUD_PROVIDER_ACCOUNT_EXPORTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj),
TYPE_CLOUD_PROVIDER_ACCOUNT_EXPORTER, CloudProviderAccountExporter))
+#define CLOUD_PROVIDER_ACCOUNT_EXPORTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass),
TYPE_CLOUD_PROVIDER_ACCOUNT_EXPORTER, CloudProviderAccountExporterClass))
+#define IS_CLOUD_PROVIDER_ACCOUNT_EXPORTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj),
TYPE_CLOUD_PROVIDER_ACCOUNT_EXPORTER))
+#define IS_CLOUD_PROVIDER_ACCOUNT_EXPORTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),
TYPE_CLOUD_PROVIDER_ACCOUNT_EXPORTER))
+#define CLOUD_PROVIDER_ACCOUNT_EXPORTER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj),
TYPE_CLOUD_PROVIDER_ACCOUNT_EXPORTER, CloudProviderAccountExporterClass))
+
+typedef struct _CloudProviderAccountExporter CloudProviderAccountExporter;
+typedef struct _CloudProviderAccountExporterClass CloudProviderAccountExporterClass;
+
+
+struct _CloudProviderAccountExporterClass
+{
+ GObjectClass parent_class;
+};
+
+struct _CloudProviderAccountExporter
+{
+ GObject parent_instance;
+};
+
+GType
+cloud_provider_account_exporter_get_type (void) G_GNUC_CONST;
+
+void
+cloud_provider_account_exporter_emit_changed (CloudProviderAccountExporter *cloud_provider_account);
+
+CloudProviderAccountExporter*
+cloud_provider_account_exporter_new (const gchar *account_object_name);
+
+G_END_DECLS
+
+#endif /* CLOUD_PROVIDER_ACCOUNT_EXPORTER_H */
diff --git a/src/cloudprovideraccountpriv.h b/src/cloudprovideraccountexporterpriv.h
similarity index 69%
rename from src/cloudprovideraccountpriv.h
rename to src/cloudprovideraccountexporterpriv.h
index 77908d3..01f256b 100644
--- a/src/cloudprovideraccountpriv.h
+++ b/src/cloudprovideraccountexporterpriv.h
@@ -1,4 +1,4 @@
-/* cloudprovideraccountpriv.h
+/* cloudprovideraccountexporterpriv.h
*
* Copyright (C) 2017 Julius Haertl <jus bitgrid net>
*
@@ -16,17 +16,17 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef CLOUD_PROVIDER_ACCOUNT_PRIV_H
-#define CLOUD_PROVIDER_ACCOUNT_PRIV_H
+#ifndef CLOUD_PROVIDER_ACCOUNT_EXPORTER_PRIV_H
+#define CLOUD_PROVIDER_ACCOUNT_EXPORTER_PRIV_H
-#include "cloudprovideraccount.h"
+#include "cloudprovideraccountexporter.h"
#include <gio/gio.h>
G_BEGIN_DECLS
GDBusInterfaceSkeleton*
-cloud_provider_account_get_skeleton (CloudProviderAccount *self);
+cloud_provider_account_exporter_get_skeleton (CloudProviderAccountExporter *self);
gchar *
-cloud_provider_account_get_object_name (CloudProviderAccount *self);
+cloud_provider_account_exporter_get_object_name (CloudProviderAccountExporter *self);
#endif
diff --git a/src/meson.build b/src/meson.build
index 10273a6..f33ae9e 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -3,7 +3,7 @@ libcloudproviders_headers = [
'cloudproviderproxy.h',
'cloudproviders.h',
'cloudprovider.h',
- 'cloudprovideraccount.h',
+ 'cloudprovideraccountexporter.h',
]
libcloudproviders_sources = [
@@ -11,7 +11,7 @@ libcloudproviders_sources = [
'cloudproviderproxy.c',
'cloudproviders.c',
'cloudprovider.c',
- 'cloudprovideraccount.c',
+ 'cloudprovideraccountexporter.c',
]
libcloudproviders_deps = [glib, gio, gio_unix]
diff --git a/test/testcloudproviderserver.c b/test/testcloudproviderserver.c
index 6ade8fb..b7490da 100644
--- a/test/testcloudproviderserver.c
+++ b/test/testcloudproviderserver.c
@@ -2,7 +2,7 @@
#include <stdlib.h>
#include <gio/gio.h>
#include <cloudprovider.h>
-#include <cloudprovideraccount.h>
+#include <cloudprovideraccountexporter.h>
/* for CLoudProviderStatus enum */
#include <cloudproviderproxy.h>
@@ -238,7 +238,7 @@ change_random_cloud_provider_state (gpointer user_data)
static gchar *
-on_get_name (CloudProviderAccount *account,
+on_get_name (CloudProviderAccountExporter *account,
gpointer user_data)
{
gchar *name = (gchar*)user_data;
@@ -246,7 +246,7 @@ on_get_name (CloudProviderAccount *account,
}
static GIcon *
-on_get_icon (CloudProviderAccount *account,
+on_get_icon (CloudProviderAccountExporter *account,
gpointer user_data)
{
TestCloudProvider *self = user_data;
@@ -254,7 +254,7 @@ on_get_icon (CloudProviderAccount *account,
}
static gchar *
-on_get_path (CloudProviderAccount *account,
+on_get_path (CloudProviderAccountExporter *account,
gpointer user_data)
{
TestCloudProvider *self = user_data;
@@ -262,7 +262,7 @@ on_get_path (CloudProviderAccount *account,
}
static guint
-on_get_status (CloudProviderAccount *account,
+on_get_status (CloudProviderAccountExporter *account,
gpointer user_data)
{
TestCloudProvider *self = user_data;
@@ -270,7 +270,7 @@ on_get_status (CloudProviderAccount *account,
}
static gchar *
-on_get_status_details (CloudProviderAccount *account,
+on_get_status_details (CloudProviderAccountExporter *account,
gpointer user_data)
{
gchar *description = "";
@@ -310,14 +310,14 @@ on_bus_acquired (GDBusConnection *connection,
gchar *account_object_name = g_strdup_printf ("MyCloud%d", n);
gchar *account_name = g_strdup_printf ("MyCloud %d", n);
- CloudProviderAccount *cloud_provider_account = cloud_provider_account_new(account_object_name);
- g_signal_connect(cloud_provider_account, "handle_get_name", G_CALLBACK (on_get_name), account_name);
- g_signal_connect(cloud_provider_account, "handle_get_icon", G_CALLBACK (on_get_icon), self);
- g_signal_connect(cloud_provider_account, "handle_get_path", G_CALLBACK (on_get_path), self);
- g_signal_connect(cloud_provider_account, "handle_get_status", G_CALLBACK (on_get_status), self);
- g_signal_connect(cloud_provider_account, "handle_get_status_details", G_CALLBACK
(on_get_status_details), self);
+ CloudProviderAccountExporter *cloud_provider_account_exporter =
cloud_provider_account_exporter_new(account_object_name);
+ g_signal_connect(cloud_provider_account_exporter, "handle_get_name", G_CALLBACK (on_get_name),
account_name);
+ g_signal_connect(cloud_provider_account_exporter, "handle_get_icon", G_CALLBACK (on_get_icon), self);
+ g_signal_connect(cloud_provider_account_exporter, "handle_get_path", G_CALLBACK (on_get_path), self);
+ g_signal_connect(cloud_provider_account_exporter, "handle_get_status", G_CALLBACK (on_get_status),
self);
+ g_signal_connect(cloud_provider_account_exporter, "handle_get_status_details", G_CALLBACK
(on_get_status_details), self);
- cloud_provider_add_account(self->cloud_provider, cloud_provider_account);
+ cloud_provider_add_account(self->cloud_provider, cloud_provider_account_exporter);
cloud_provider_export_menu (self->cloud_provider, account_object_name, get_model ());
cloud_provider_export_action_group (self->cloud_provider, account_object_name, get_action_group ());
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]