[gnome-builder: 98/139] ls: port to libide-editor



commit 002cfe54689c2f9288bd1c096b4c069bb5f69cbf
Author: Christian Hergert <chergert redhat com>
Date:   Wed Jan 9 17:28:27 2019 -0800

    ls: port to libide-editor

 src/plugins/ls/gbp-ls-model.c                     |   2 +-
 src/plugins/ls/{gbp-ls-view.c => gbp-ls-page.c}   | 112 +++++++++++-----------
 src/plugins/ls/{gbp-ls-view.h => gbp-ls-page.h}   |  14 +--
 src/plugins/ls/{gbp-ls-view.ui => gbp-ls-page.ui} |   2 +-
 src/plugins/ls/gbp-ls-workbench-addin.c           |  46 ++++-----
 src/plugins/ls/gbp-ls-workbench-addin.h           |   2 +-
 src/plugins/ls/{gbp-ls-plugin.c => ls-plugin.c}   |   8 +-
 src/plugins/ls/ls.gresource.xml                   |   6 +-
 src/plugins/ls/ls.plugin                          |  11 ++-
 src/plugins/ls/meson.build                        |  21 ++--
 10 files changed, 104 insertions(+), 120 deletions(-)
---
diff --git a/src/plugins/ls/gbp-ls-model.c b/src/plugins/ls/gbp-ls-model.c
index 1e59dab71..ba81e51ac 100644
--- a/src/plugins/ls/gbp-ls-model.c
+++ b/src/plugins/ls/gbp-ls-model.c
@@ -22,7 +22,7 @@
 
 #include "config.h"
 
-#include <ide.h>
+#include <libide-gui.h>
 
 #include "gbp-ls-model.h"
 
diff --git a/src/plugins/ls/gbp-ls-view.c b/src/plugins/ls/gbp-ls-page.c
similarity index 72%
rename from src/plugins/ls/gbp-ls-view.c
rename to src/plugins/ls/gbp-ls-page.c
index c409882e9..2b86bc75c 100644
--- a/src/plugins/ls/gbp-ls-view.c
+++ b/src/plugins/ls/gbp-ls-page.c
@@ -1,4 +1,4 @@
-/* gbp-ls-view.c
+/* gbp-ls-page.c
  *
  * Copyright 2018-2019 Christian Hergert <chergert redhat com>
  *
@@ -18,18 +18,18 @@
  * SPDX-License-Identifier: GPL-3.0-or-later
  */
 
-#define G_LOG_DOMAIN "gbp-ls-view"
+#define G_LOG_DOMAIN "gbp-ls-page"
 
 #include "config.h"
 
 #include <glib/gi18n.h>
 
 #include "gbp-ls-model.h"
-#include "gbp-ls-view.h"
+#include "gbp-ls-page.h"
 
-struct _GbpLsView
+struct _GbpLsPage
 {
-  IdeLayoutView      parent_instance;
+  IdePage            parent_instance;
 
   GCancellable      *model_cancellable;
   GbpLsModel        *model;
@@ -51,12 +51,12 @@ enum {
   N_PROPS
 };
 
-G_DEFINE_TYPE (GbpLsView, gbp_ls_view, IDE_TYPE_LAYOUT_VIEW)
+G_DEFINE_TYPE (GbpLsPage, gbp_ls_page, IDE_TYPE_PAGE)
 
 static GParamSpec *properties [N_PROPS];
 
 static void
-gbp_ls_view_row_activated_cb (GbpLsView         *self,
+gbp_ls_page_row_activated_cb (GbpLsPage         *self,
                               GtkTreePath       *path,
                               GtkTreeViewColumn *column,
                               GtkTreeView       *tree_view)
@@ -64,7 +64,7 @@ gbp_ls_view_row_activated_cb (GbpLsView         *self,
   GtkTreeModel *model;
   GtkTreeIter iter;
 
-  g_assert (GBP_IS_LS_VIEW (self));
+  g_assert (GBP_IS_LS_PAGE (self));
   g_assert (path != NULL);
 
   if ((model = gtk_tree_view_get_model (tree_view)) &&
@@ -79,22 +79,19 @@ gbp_ls_view_row_activated_cb (GbpLsView         *self,
                           -1);
 
       if (file_type == G_FILE_TYPE_DIRECTORY)
-        gbp_ls_view_set_directory (self, file);
+        gbp_ls_page_set_directory (self, file);
       else
         {
-          g_autoptr(IdeUri) uri = ide_uri_new_from_file (file);
           IdeWorkbench *workbench = ide_widget_get_workbench (GTK_WIDGET (self));
 
-          ide_workbench_open_uri_async (workbench,
-                                        uri,
-                                        NULL,
-                                        IDE_WORKBENCH_OPEN_FLAGS_NONE,
-                                        NULL,
-                                        NULL,
-                                        NULL);
+          ide_workbench_open_async (workbench,
+                                    file,
+                                    NULL,
+                                    IDE_BUFFER_OPEN_FLAGS_NONE,
+                                    NULL, NULL, NULL);
 
           if (self->close_on_activate)
-            dzl_gtk_widget_action (GTK_WIDGET (self), "layoutstack", "close-view", NULL);
+            dzl_gtk_widget_action (GTK_WIDGET (self), "frame", "close-page", NULL);
         }
     }
 }
@@ -134,28 +131,28 @@ size_cell_data_func (GtkCellLayout   *cell_layout,
 }
 
 static void
-gbp_ls_view_finalize (GObject *object)
+gbp_ls_page_finalize (GObject *object)
 {
-  GbpLsView *self = (GbpLsView *)object;
+  GbpLsPage *self = (GbpLsPage *)object;
 
   g_clear_object (&self->model_cancellable);
   g_clear_object (&self->model);
 
-  G_OBJECT_CLASS (gbp_ls_view_parent_class)->finalize (object);
+  G_OBJECT_CLASS (gbp_ls_page_parent_class)->finalize (object);
 }
 
 static void
-gbp_ls_view_get_property (GObject    *object,
+gbp_ls_page_get_property (GObject    *object,
                           guint       prop_id,
                           GValue     *value,
                           GParamSpec *pspec)
 {
-  GbpLsView *self = GBP_LS_VIEW (object);
+  GbpLsPage *self = GBP_LS_PAGE (object);
 
   switch (prop_id)
     {
     case PROP_DIRECTORY:
-      g_value_set_object (value, gbp_ls_view_get_directory (self));
+      g_value_set_object (value, gbp_ls_page_get_directory (self));
       break;
 
     case PROP_CLOSE_ON_ACTIVATE:
@@ -168,17 +165,17 @@ gbp_ls_view_get_property (GObject    *object,
 }
 
 static void
-gbp_ls_view_set_property (GObject      *object,
+gbp_ls_page_set_property (GObject      *object,
                           guint         prop_id,
                           const GValue *value,
                           GParamSpec   *pspec)
 {
-  GbpLsView *self = GBP_LS_VIEW (object);
+  GbpLsPage *self = GBP_LS_PAGE (object);
 
   switch (prop_id)
     {
     case PROP_DIRECTORY:
-      gbp_ls_view_set_directory (self, g_value_get_object (value));
+      gbp_ls_page_set_directory (self, g_value_get_object (value));
       break;
 
     case PROP_CLOSE_ON_ACTIVATE:
@@ -191,14 +188,14 @@ gbp_ls_view_set_property (GObject      *object,
 }
 
 static void
-gbp_ls_view_class_init (GbpLsViewClass *klass)
+gbp_ls_page_class_init (GbpLsPageClass *klass)
 {
   GObjectClass *object_class = G_OBJECT_CLASS (klass);
   GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
 
-  object_class->finalize = gbp_ls_view_finalize;
-  object_class->get_property = gbp_ls_view_get_property;
-  object_class->set_property = gbp_ls_view_set_property;
+  object_class->finalize = gbp_ls_page_finalize;
+  object_class->get_property = gbp_ls_page_get_property;
+  object_class->set_property = gbp_ls_page_set_property;
 
   properties [PROP_DIRECTORY] =
     g_param_spec_object ("directory",
@@ -214,25 +211,25 @@ gbp_ls_view_class_init (GbpLsViewClass *klass)
 
   g_object_class_install_properties (object_class, N_PROPS, properties);
 
-  gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/builder/plugins/ls/gbp-ls-view.ui");
-  gtk_widget_class_bind_template_child (widget_class, GbpLsView, modified_cell);
-  gtk_widget_class_bind_template_child (widget_class, GbpLsView, modified_column);
-  gtk_widget_class_bind_template_child (widget_class, GbpLsView, size_cell);
-  gtk_widget_class_bind_template_child (widget_class, GbpLsView, size_column);
-  gtk_widget_class_bind_template_child (widget_class, GbpLsView, scroller);
-  gtk_widget_class_bind_template_child (widget_class, GbpLsView, tree_view);
+  gtk_widget_class_set_template_from_resource (widget_class, "/plugins/ls/gbp-ls-page.ui");
+  gtk_widget_class_bind_template_child (widget_class, GbpLsPage, modified_cell);
+  gtk_widget_class_bind_template_child (widget_class, GbpLsPage, modified_column);
+  gtk_widget_class_bind_template_child (widget_class, GbpLsPage, size_cell);
+  gtk_widget_class_bind_template_child (widget_class, GbpLsPage, size_column);
+  gtk_widget_class_bind_template_child (widget_class, GbpLsPage, scroller);
+  gtk_widget_class_bind_template_child (widget_class, GbpLsPage, tree_view);
 }
 
 static void
-gbp_ls_view_init (GbpLsView *self)
+gbp_ls_page_init (GbpLsPage *self)
 {
   gtk_widget_init_template (GTK_WIDGET (self));
 
-  ide_layout_view_set_icon_name (IDE_LAYOUT_VIEW (self), "folder-symbolic");
+  ide_page_set_icon_name (IDE_PAGE (self), "folder-symbolic");
 
   g_signal_connect_object (self->tree_view,
                            "row-activated",
-                           G_CALLBACK (gbp_ls_view_row_activated_cb),
+                           G_CALLBACK (gbp_ls_page_row_activated_cb),
                            self,
                            G_CONNECT_SWAPPED);
 
@@ -248,15 +245,15 @@ gbp_ls_view_init (GbpLsView *self)
 }
 
 GtkWidget *
-gbp_ls_view_new (void)
+gbp_ls_page_new (void)
 {
-  return g_object_new (GBP_TYPE_LS_VIEW, NULL);
+  return g_object_new (GBP_TYPE_LS_PAGE, NULL);
 }
 
 GFile *
-gbp_ls_view_get_directory (GbpLsView *self)
+gbp_ls_page_get_directory (GbpLsPage *self)
 {
-  g_return_val_if_fail (GBP_IS_LS_VIEW (self), NULL);
+  g_return_val_if_fail (GBP_IS_LS_PAGE (self), NULL);
 
   if (self->model != NULL)
     return gbp_ls_model_get_directory (GBP_LS_MODEL (self->model));
@@ -265,18 +262,18 @@ gbp_ls_view_get_directory (GbpLsView *self)
 }
 
 static void
-gbp_ls_view_init_model_cb (GObject      *object,
+gbp_ls_page_init_model_cb (GObject      *object,
                            GAsyncResult *result,
                            gpointer      user_data)
 {
   GbpLsModel *model = (GbpLsModel *)object;
-  g_autoptr(GbpLsView) self = user_data;
+  g_autoptr(GbpLsPage) self = user_data;
   g_autoptr(GError) error = NULL;
   GtkTreeIter iter;
 
   g_assert (GBP_IS_LS_MODEL (model));
   g_assert (G_IS_ASYNC_RESULT (result));
-  g_assert (GBP_IS_LS_VIEW (self));
+  g_assert (GBP_IS_LS_PAGE (self));
 
   if (model != self->model)
     return;
@@ -284,7 +281,7 @@ gbp_ls_view_init_model_cb (GObject      *object,
   if (!g_async_initable_init_finish (G_ASYNC_INITABLE (model), result, &error))
     {
       if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
-        ide_layout_view_report_error (IDE_LAYOUT_VIEW (self),
+        ide_page_report_error (IDE_PAGE (self),
                                       _("Failed to load directory: %s"),
                                       error->message);
       return;
@@ -304,27 +301,26 @@ gbp_ls_view_init_model_cb (GObject      *object,
 }
 
 void
-gbp_ls_view_set_directory (GbpLsView *self,
+gbp_ls_page_set_directory (GbpLsPage *self,
                            GFile     *directory)
 {
   g_autofree gchar *title = NULL;
   g_autofree gchar *name = NULL;
+  g_autoptr(GFile) local_directory = NULL;
   GFile *old_directory;
 
-  g_return_if_fail (GBP_IS_LS_VIEW (self));
+  g_return_if_fail (GBP_IS_LS_PAGE (self));
   g_return_if_fail (!directory || G_IS_FILE (directory));
 
   if (directory == NULL)
     {
       IdeContext *context = ide_widget_get_context (GTK_WIDGET (self));
-      IdeVcs *vcs = ide_context_get_vcs (context);
-
-      directory = ide_vcs_get_working_directory (vcs);
+      directory = local_directory = ide_context_ref_workdir (context);
     }
 
-  g_assert (directory != NULL);
+  g_assert (G_IS_FILE (directory));
 
-  old_directory = gbp_ls_view_get_directory (self);
+  old_directory = gbp_ls_page_get_directory (self);
 
   if (directory != NULL &&
       old_directory != NULL &&
@@ -342,12 +338,12 @@ gbp_ls_view_set_directory (GbpLsView *self,
   g_async_initable_init_async (G_ASYNC_INITABLE (self->model),
                                G_PRIORITY_DEFAULT,
                                self->model_cancellable,
-                               gbp_ls_view_init_model_cb,
+                               gbp_ls_page_init_model_cb,
                                g_object_ref (self));
 
   name = g_file_get_basename (directory);
   title = g_strdup_printf (_("%s — Directory"), name);
-  ide_layout_view_set_title (IDE_LAYOUT_VIEW (self), title);
+  ide_page_set_title (IDE_PAGE (self), title);
 
   g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_DIRECTORY]);
 }
diff --git a/src/plugins/ls/gbp-ls-view.h b/src/plugins/ls/gbp-ls-page.h
similarity index 73%
rename from src/plugins/ls/gbp-ls-view.h
rename to src/plugins/ls/gbp-ls-page.h
index 29d17e799..070db0690 100644
--- a/src/plugins/ls/gbp-ls-view.h
+++ b/src/plugins/ls/gbp-ls-page.h
@@ -1,4 +1,4 @@
-/* gbp-ls-view.h
+/* gbp-ls-page.h
  *
  * Copyright 2018-2019 Christian Hergert <chergert redhat com>
  *
@@ -20,17 +20,17 @@
 
 #pragma once
 
-#include <ide.h>
+#include <libide-gui.h>
 
 G_BEGIN_DECLS
 
-#define GBP_TYPE_LS_VIEW (gbp_ls_view_get_type())
+#define GBP_TYPE_LS_PAGE (gbp_ls_page_get_type())
 
-G_DECLARE_FINAL_TYPE (GbpLsView, gbp_ls_view, GBP, LS_VIEW, IdeLayoutView)
+G_DECLARE_FINAL_TYPE (GbpLsPage, gbp_ls_page, GBP, LS_PAGE, IdePage)
 
-GtkWidget *gbp_ls_view_new           (void);
-GFile     *gbp_ls_view_get_directory (GbpLsView *self);
-void       gbp_ls_view_set_directory (GbpLsView *self,
+GtkWidget *gbp_ls_page_new           (void);
+GFile     *gbp_ls_page_get_directory (GbpLsPage *self);
+void       gbp_ls_page_set_directory (GbpLsPage *self,
                                       GFile     *directory);
 
 G_END_DECLS
diff --git a/src/plugins/ls/gbp-ls-view.ui b/src/plugins/ls/gbp-ls-page.ui
similarity index 98%
rename from src/plugins/ls/gbp-ls-view.ui
rename to src/plugins/ls/gbp-ls-page.ui
index cc5a797f4..38a50a7d3 100644
--- a/src/plugins/ls/gbp-ls-view.ui
+++ b/src/plugins/ls/gbp-ls-page.ui
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
-  <template class="GbpLsView" parent="IdeLayoutView">
+  <template class="GbpLsPage" parent="IdePage">
     <child>
       <object class="GtkScrolledWindow" id="scroller">
         <property name="vexpand">true</property>
diff --git a/src/plugins/ls/gbp-ls-workbench-addin.c b/src/plugins/ls/gbp-ls-workbench-addin.c
index b7427b7cb..50fdf59ae 100644
--- a/src/plugins/ls/gbp-ls-workbench-addin.c
+++ b/src/plugins/ls/gbp-ls-workbench-addin.c
@@ -23,7 +23,7 @@
 #include "config.h"
 
 #include "gbp-ls-workbench-addin.h"
-#include "gbp-ls-view.h"
+#include "gbp-ls-page.h"
 
 struct _GbpLsWorkbenchAddin
 {
@@ -34,18 +34,12 @@ struct _GbpLsWorkbenchAddin
 typedef struct
 {
   GFile     *file;
-  GbpLsView *view;
+  GbpLsPage *view;
 } LocateView;
 
-static gchar *
-gbp_ls_workbench_addin_get_id (IdeWorkbenchAddin *addin)
-{
-  return g_strdup ("directory");
-}
-
 static gboolean
 gbp_ls_workbench_addin_can_open (IdeWorkbenchAddin *addin,
-                                 IdeUri            *uri,
+                                 GFile             *file,
                                  const gchar       *content_type,
                                  gint              *priority)
 {
@@ -68,63 +62,64 @@ locate_view (GtkWidget *view,
   LocateView *locate = user_data;
   GFile *file;
 
-  g_assert (IDE_IS_LAYOUT_VIEW (view));
+  g_assert (IDE_IS_PAGE (view));
   g_assert (locate != NULL);
 
   if (locate->view != NULL)
     return;
 
-  if (!GBP_IS_LS_VIEW (view))
+  if (!GBP_IS_LS_PAGE (view))
     return;
 
-  file = gbp_ls_view_get_directory (GBP_LS_VIEW (view));
+  file = gbp_ls_page_get_directory (GBP_LS_PAGE (view));
   if (g_file_equal (file, locate->file))
-    locate->view = GBP_LS_VIEW (view);
+    locate->view = GBP_LS_PAGE (view);
 }
 
 static void
 gbp_ls_workbench_addin_open_async (IdeWorkbenchAddin     *addin,
-                                   IdeUri                *uri,
+                                   GFile                 *file,
                                    const gchar           *content_type,
-                                   IdeWorkbenchOpenFlags  flags,
+                                   IdeBufferOpenFlags     flags,
                                    GCancellable          *cancellable,
                                    GAsyncReadyCallback    callback,
                                    gpointer               user_data)
 {
   GbpLsWorkbenchAddin *self = (GbpLsWorkbenchAddin *)addin;
   g_autoptr(IdeTask) task = NULL;
-  g_autoptr(GFile) file = NULL;
-  IdePerspective *editor;
-  GbpLsView *view;
+  IdeWorkspace *workspace;
+  IdeSurface *surface;
+  GbpLsPage *view;
   LocateView locate = { 0 };
 
   g_assert (GBP_IS_LS_WORKBENCH_ADDIN (self));
   g_assert (IDE_IS_WORKBENCH (self->workbench));
-  g_assert (uri != NULL);
+  g_assert (G_IS_FILE (file));
   g_assert (!cancellable || G_IS_CANCELLABLE (cancellable));
 
   task = ide_task_new (self, cancellable, callback, user_data);
   ide_task_set_source_tag (task, gbp_ls_workbench_addin_open_async);
 
-  editor = ide_workbench_get_perspective_by_name (self->workbench, "editor");
-  file = ide_uri_to_file (uri);
+  workspace = ide_workbench_get_current_workspace (self->workbench);
+  if (!(surface = ide_workspace_get_surface_by_name (workspace, "editor")))
+    surface = ide_workspace_get_surface_by_name (workspace, "terminal");
 
   /* First try to find an existing view for the file */
   locate.file = file;
-  ide_workbench_views_foreach (self->workbench, locate_view, &locate);
+  ide_workbench_foreach_page (self->workbench, locate_view, &locate);
   if (locate.view != NULL)
     {
-      ide_workbench_focus (self->workbench, GTK_WIDGET (locate.view));
+      ide_widget_reveal_and_grab (GTK_WIDGET (locate.view));
       ide_task_return_boolean (task, TRUE);
       return;
     }
 
-  view = g_object_new (GBP_TYPE_LS_VIEW,
+  view = g_object_new (GBP_TYPE_LS_PAGE,
                        "close-on-activate", TRUE,
                        "directory", file,
                        "visible", TRUE,
                        NULL);
-  gtk_container_add (GTK_CONTAINER (editor), GTK_WIDGET (view));
+  gtk_container_add (GTK_CONTAINER (surface), GTK_WIDGET (view));
 
   ide_task_return_boolean (task, TRUE);
 }
@@ -157,7 +152,6 @@ gbp_ls_workbench_addin_unload (IdeWorkbenchAddin *addin,
 static void
 workbench_addin_iface_init (IdeWorkbenchAddinInterface *iface)
 {
-  iface->get_id = gbp_ls_workbench_addin_get_id;
   iface->can_open = gbp_ls_workbench_addin_can_open;
   iface->open_async = gbp_ls_workbench_addin_open_async;
   iface->open_finish = gbp_ls_workbench_addin_open_finish;
diff --git a/src/plugins/ls/gbp-ls-workbench-addin.h b/src/plugins/ls/gbp-ls-workbench-addin.h
index e8a701270..e08ddc4aa 100644
--- a/src/plugins/ls/gbp-ls-workbench-addin.h
+++ b/src/plugins/ls/gbp-ls-workbench-addin.h
@@ -20,7 +20,7 @@
 
 #pragma once
 
-#include <ide.h>
+#include <libide-gui.h>
 
 G_BEGIN_DECLS
 
diff --git a/src/plugins/ls/gbp-ls-plugin.c b/src/plugins/ls/ls-plugin.c
similarity index 90%
rename from src/plugins/ls/gbp-ls-plugin.c
rename to src/plugins/ls/ls-plugin.c
index 1de46301c..c078b8906 100644
--- a/src/plugins/ls/gbp-ls-plugin.c
+++ b/src/plugins/ls/ls-plugin.c
@@ -1,4 +1,4 @@
-/* gbp-ls-plugin.c
+/* ls-plugin.c
  *
  * Copyright 2018-2019 Christian Hergert <chergert redhat com>
  *
@@ -21,12 +21,12 @@
 #include "config.h"
 
 #include <libpeas/peas.h>
-#include <ide.h>
+#include <libide-gui.h>
 
 #include "gbp-ls-workbench-addin.h"
 
-void
-gbp_ls_register_types (PeasObjectModule *module)
+_IDE_EXTERN void
+_gbp_ls_register_types (PeasObjectModule *module)
 {
   peas_object_module_register_extension_type (module,
                                               IDE_TYPE_WORKBENCH_ADDIN,
diff --git a/src/plugins/ls/ls.gresource.xml b/src/plugins/ls/ls.gresource.xml
index 26e2dec94..3e9ec28a9 100644
--- a/src/plugins/ls/ls.gresource.xml
+++ b/src/plugins/ls/ls.gresource.xml
@@ -1,9 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <gresources>
-  <gresource prefix="/org/gnome/builder/plugins">
+  <gresource prefix="/plugins/ls">
     <file>ls.plugin</file>
-  </gresource>
-  <gresource prefix="/org/gnome/builder/plugins/ls">
-    <file preprocess="xml-stripblanks">gbp-ls-view.ui</file>
+    <file preprocess="xml-stripblanks">gbp-ls-page.ui</file>
   </gresource>
 </gresources>
diff --git a/src/plugins/ls/ls.plugin b/src/plugins/ls/ls.plugin
index 18af04853..c7bf0b0d9 100644
--- a/src/plugins/ls/ls.plugin
+++ b/src/plugins/ls/ls.plugin
@@ -1,9 +1,10 @@
 [Plugin]
-Module=ls
-Name=View Directory Listings
-Description=List files in a directory as a view
 Authors=Christian Hergert <christian hergert me>
-Copyright=Copyright © 2018 Christian Hergert
 Builtin=true
+Copyright=Copyright © 2018 Christian Hergert
 Depends=editor;
-Embedded=gbp_ls_register_types
+Description=List files in a directory as a view
+Embedded=_gbp_ls_register_types
+Hidden=true
+Module=ls
+Name=View Directory Listings
diff --git a/src/plugins/ls/meson.build b/src/plugins/ls/meson.build
index 1dcea074e..99633be7f 100644
--- a/src/plugins/ls/meson.build
+++ b/src/plugins/ls/meson.build
@@ -1,19 +1,14 @@
-if get_option('with_ls')
+plugins_sources += files([
+  'gbp-ls-model.c',
+  'gbp-ls-page.c',
+  'gbp-ls-workbench-addin.c',
+  'ls-plugin.c',
+])
 
-grep_resources = gnome.compile_resources(
+plugin_ls_resources = gnome.compile_resources(
   'ls-resources',
   'ls.gresource.xml',
   c_name: 'gbp_ls',
 )
 
-grep_sources = [
-  'gbp-ls-model.c',
-  'gbp-ls-plugin.c',
-  'gbp-ls-view.c',
-  'gbp-ls-workbench-addin.c',
-]
-
-gnome_builder_plugins_sources += files(grep_sources)
-gnome_builder_plugins_sources += grep_resources[0]
-
-endif
+plugins_sources += plugin_ls_resources[0]


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]