Commit eb7bc79c authored by Christian Hergert's avatar Christian Hergert
Browse files

service: drop context property from IdeService

Now that IdeService can have :context fulfilled from IdeObject when
creating plugins, we can simplify this code.

https://bugzilla.gnome.org/show_bug.cgi?id=779891
parent 48f0e18f
......@@ -21,14 +21,14 @@
#include "ide-context.h"
#include "ide-service.h"
G_DEFINE_INTERFACE (IdeService, ide_service, G_TYPE_OBJECT)
G_DEFINE_INTERFACE (IdeService, ide_service, IDE_TYPE_OBJECT)
enum {
CONTEXT_LOADED,
LAST_SIGNAL
N_SIGNALS
};
static guint signals [LAST_SIGNAL];
static guint signals [N_SIGNALS];
const gchar *
ide_service_get_name (IdeService *service)
......@@ -75,13 +75,6 @@ ide_service_default_init (IdeServiceInterface *iface)
{
iface->get_name = ide_service_real_get_name;
g_object_interface_install_property (iface,
g_param_spec_object ("context",
"Context",
"Context",
IDE_TYPE_CONTEXT,
(G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)));
signals [CONTEXT_LOADED] =
g_signal_new ("context-loaded",
G_TYPE_FROM_INTERFACE (iface),
......
......@@ -25,7 +25,7 @@ G_BEGIN_DECLS
#define IDE_TYPE_SERVICE (ide_service_get_type())
G_DECLARE_INTERFACE (IdeService, ide_service, IDE, SERVICE, GObject)
G_DECLARE_INTERFACE (IdeService, ide_service, IDE, SERVICE, IdeObject)
struct _IdeServiceInterface
{
......@@ -35,8 +35,6 @@ struct _IdeServiceInterface
const gchar *(*get_name) (IdeService *service);
void (*start) (IdeService *service);
void (*stop) (IdeService *service);
void (*set_context) (IdeService *service,
IdeContext *context);
};
const gchar *ide_service_get_name (IdeService *self);
......
......@@ -22,13 +22,9 @@ using Vala;
namespace Ide
{
public class ValaService: GLib.Object, Ide.Service
public class ValaService: Ide.Object, Ide.Service
{
Ide.ValaIndex _index;
Ide.Context? _context;
construct {
}
public ValaIndex index {
get { return this._index; }
......@@ -39,10 +35,10 @@ namespace Ide
}
public void start () {
this._index = new Ide.ValaIndex (this._context);
this._index = new Ide.ValaIndex (this.get_context ());
Ide.ThreadPool.push (Ide.ThreadPoolKind.INDEXER, () => {
Ide.Vcs vcs = this._context.get_vcs ();
Ide.Vcs vcs = this.get_context ().get_vcs ();
var files = new ArrayList<GLib.File> ();
load_directory (vcs.get_working_directory (), null, files);
......@@ -85,17 +81,5 @@ namespace Ide
warning ("%s", err.message);
}
}
// This code shouldn't have to exist.
// If we can fixup libide+vala to not have such weird interaction that
// would be great.
public Ide.Context context {
construct { this._context = value; }
}
public void set_context (Ide.Context context) {
this._context = context;
}
}
}
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