eds: Simplify plugin

Move the type registration to eds-plugin.c, and make GtdPluginEds
a static type.
parent b4f106ee
/* eds-plugin.c
*
* Copyright 2020 Georges Basile Stavracas Neto <georges.stavracas@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 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/>.
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#include "gnome-todo.h"
#include "gtd-plugin-eds.h"
G_MODULE_EXPORT void
gtd_plugin_eds_register_types (PeasObjectModule *module)
{
peas_object_module_register_extension_type (module,
GTD_TYPE_ACTIVATABLE,
GTD_TYPE_PLUGIN_EDS);
}
......@@ -64,10 +64,8 @@ const gchar *supported_accounts[] = {
static void gtd_activatable_iface_init (GtdActivatableInterface *iface);
G_DEFINE_DYNAMIC_TYPE_EXTENDED (GtdPluginEds, gtd_plugin_eds, G_TYPE_OBJECT,
0,
G_IMPLEMENT_INTERFACE_DYNAMIC (GTD_TYPE_ACTIVATABLE,
gtd_activatable_iface_init))
G_DEFINE_TYPE_WITH_CODE (GtdPluginEds, gtd_plugin_eds, G_TYPE_OBJECT,
G_IMPLEMENT_INTERFACE (GTD_TYPE_ACTIVATABLE, gtd_activatable_iface_init))
/*
* GtdActivatable interface implementation
......@@ -323,19 +321,3 @@ gtd_plugin_eds_init (GtdPluginEds *self)
(GAsyncReadyCallback) gtd_plugin_eds_source_registry_finish_cb,
self);
}
/* Empty class_finalize method */
static void
gtd_plugin_eds_class_finalize (GtdPluginEdsClass *klass)
{
}
G_MODULE_EXPORT void
gtd_plugin_eds_register_types (PeasObjectModule *module)
{
gtd_plugin_eds_register_type (G_TYPE_MODULE (module));
peas_object_module_register_extension_type (module,
GTD_TYPE_ACTIVATABLE,
GTD_TYPE_PLUGIN_EDS);
}
/* gtd-eds-plugin.h
*
* Copyright (C) 2015 Georges Basile Stavracas Neto <georges.stavracas@gmail.com>
* Copyright (C) 2015-2020 Georges Basile Stavracas Neto <georges.stavracas@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -16,21 +16,13 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GTD_EDS_PLUGIN_H
#define GTD_EDS_PLUGIN_H
#pragma once
#include "gnome-todo.h"
#include <glib.h>
G_BEGIN_DECLS
#define GTD_TYPE_PLUGIN_EDS (gtd_plugin_eds_get_type())
G_DECLARE_FINAL_TYPE (GtdPluginEds, gtd_plugin_eds, GTD, PLUGIN_EDS, PeasExtensionBase)
G_MODULE_EXPORT void gtd_plugin_eds_register_types (PeasObjectModule *module);
G_END_DECLS
#endif /* GTD_EDS_PLUGIN_H */
......@@ -17,6 +17,7 @@ plugins_sources += files(
'gtd-provider-local.c',
'gtd-task-eds.c',
'gtd-task-list-eds.c',
'eds-plugin.c',
)
plugins_sources += gnome.compile_resources(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment