core: merge MMPluginBase' and MMPlugin'
There's no real point in maintaining a separate `MMPlugin' interface, as all the plugins will inherit from `MMPluginBase', so just merge them and simplify everything.
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
#include "mm-plugin-gobi.h"
|
||||
#include "mm-broadband-modem-gobi.h"
|
||||
|
||||
G_DEFINE_TYPE (MMPluginGobi, mm_plugin_gobi, MM_TYPE_PLUGIN_BASE)
|
||||
G_DEFINE_TYPE (MMPluginGobi, mm_plugin_gobi, MM_TYPE_PLUGIN)
|
||||
|
||||
int mm_plugin_major_version = MM_PLUGIN_MAJOR_VERSION;
|
||||
int mm_plugin_minor_version = MM_PLUGIN_MINOR_VERSION;
|
||||
@@ -30,7 +30,7 @@ int mm_plugin_minor_version = MM_PLUGIN_MINOR_VERSION;
|
||||
/*****************************************************************************/
|
||||
|
||||
static MMBaseModem *
|
||||
create_modem (MMPluginBase *plugin,
|
||||
create_modem (MMPlugin *self,
|
||||
const gchar *sysfs_path,
|
||||
const gchar *driver,
|
||||
guint16 vendor,
|
||||
@@ -40,13 +40,13 @@ create_modem (MMPluginBase *plugin,
|
||||
{
|
||||
return MM_BASE_MODEM (mm_broadband_modem_gobi_new (sysfs_path,
|
||||
driver,
|
||||
mm_plugin_get_name (MM_PLUGIN (plugin)),
|
||||
mm_plugin_get_name (self),
|
||||
vendor,
|
||||
product));
|
||||
}
|
||||
|
||||
static gboolean
|
||||
grab_port (MMPluginBase *base,
|
||||
grab_port (MMPlugin *self,
|
||||
MMBaseModem *modem,
|
||||
MMPortProbe *probe,
|
||||
GError **error)
|
||||
@@ -78,11 +78,11 @@ mm_plugin_create (void)
|
||||
|
||||
return MM_PLUGIN (
|
||||
g_object_new (MM_TYPE_PLUGIN_GOBI,
|
||||
MM_PLUGIN_BASE_NAME, "Gobi",
|
||||
MM_PLUGIN_BASE_ALLOWED_SUBSYSTEMS, subsystems,
|
||||
MM_PLUGIN_BASE_ALLOWED_DRIVERS, drivers,
|
||||
MM_PLUGIN_BASE_ALLOWED_AT, TRUE,
|
||||
MM_PLUGIN_BASE_ALLOWED_QCDM, TRUE,
|
||||
MM_PLUGIN_NAME, "Gobi",
|
||||
MM_PLUGIN_ALLOWED_SUBSYSTEMS, subsystems,
|
||||
MM_PLUGIN_ALLOWED_DRIVERS, drivers,
|
||||
MM_PLUGIN_ALLOWED_AT, TRUE,
|
||||
MM_PLUGIN_ALLOWED_QCDM, TRUE,
|
||||
NULL));
|
||||
}
|
||||
|
||||
@@ -94,8 +94,8 @@ mm_plugin_gobi_init (MMPluginGobi *self)
|
||||
static void
|
||||
mm_plugin_gobi_class_init (MMPluginGobiClass *klass)
|
||||
{
|
||||
MMPluginBaseClass *pb_class = MM_PLUGIN_BASE_CLASS (klass);
|
||||
MMPluginClass *plugin_class = MM_PLUGIN_CLASS (klass);
|
||||
|
||||
pb_class->create_modem = create_modem;
|
||||
pb_class->grab_port = grab_port;
|
||||
plugin_class->create_modem = create_modem;
|
||||
plugin_class->grab_port = grab_port;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
#ifndef MM_PLUGIN_GOBI_H
|
||||
#define MM_PLUGIN_GOBI_H
|
||||
|
||||
#include "mm-plugin-base.h"
|
||||
#include "mm-plugin.h"
|
||||
|
||||
#define MM_TYPE_PLUGIN_GOBI (mm_plugin_gobi_get_type ())
|
||||
#define MM_PLUGIN_GOBI(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_GOBI, MMPluginGobi))
|
||||
@@ -27,11 +27,11 @@
|
||||
#define MM_PLUGIN_GOBI_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_GOBI, MMPluginGobiClass))
|
||||
|
||||
typedef struct {
|
||||
MMPluginBase parent;
|
||||
MMPlugin parent;
|
||||
} MMPluginGobi;
|
||||
|
||||
typedef struct {
|
||||
MMPluginBaseClass parent;
|
||||
MMPluginClass parent;
|
||||
} MMPluginGobiClass;
|
||||
|
||||
GType mm_plugin_gobi_get_type (void);
|
||||
@@ -39,4 +39,3 @@ GType mm_plugin_gobi_get_type (void);
|
||||
G_MODULE_EXPORT MMPlugin *mm_plugin_create (void);
|
||||
|
||||
#endif /* MM_PLUGIN_GOBI_H */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user