[gnome-builder] buildsystem: Add get_display_name function
- From: Matthew Leeds <mwleeds src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] buildsystem: Add get_display_name function
- Date: Thu, 30 Mar 2017 00:04:16 +0000 (UTC)
commit 1613f763dddf8d13479a262eac18ecc64e46b9f4
Author: Matthew Leeds <mleeds redhat com>
Date: Wed Mar 29 18:39:30 2017 -0500
buildsystem: Add get_display_name function
libide/buildsystem/ide-build-system.c | 11 +++++++++++
libide/buildsystem/ide-build-system.h | 2 ++
libide/directory/ide-directory-build-system.c | 7 +++++++
plugins/autotools/ide-autotools-build-system.c | 7 +++++++
plugins/cargo/cargo_plugin.py | 3 +++
plugins/cmake/cmake_plugin/__init__.py | 3 +++
plugins/make/make_plugin/__init__.py | 3 +++
plugins/meson/meson_plugin/__init__.py | 3 +++
plugins/phpize/phpize_plugin.py | 3 +++
9 files changed, 42 insertions(+), 0 deletions(-)
---
diff --git a/libide/buildsystem/ide-build-system.c b/libide/buildsystem/ide-build-system.c
index e83fd06..af27c26 100644
--- a/libide/buildsystem/ide-build-system.c
+++ b/libide/buildsystem/ide-build-system.c
@@ -344,3 +344,14 @@ ide_build_system_get_id (IdeBuildSystem *self)
return g_strdup (G_OBJECT_TYPE_NAME (self));
}
+
+gchar *
+ide_build_system_get_display_name (IdeBuildSystem *self)
+{
+ g_return_val_if_fail (IDE_IS_BUILD_SYSTEM (self), NULL);
+
+ if (IDE_BUILD_SYSTEM_GET_IFACE (self)->get_display_name)
+ return IDE_BUILD_SYSTEM_GET_IFACE (self)->get_display_name (self);
+
+ return ide_build_system_get_id (self);
+}
diff --git a/libide/buildsystem/ide-build-system.h b/libide/buildsystem/ide-build-system.h
index 4f1f29a..abc62af 100644
--- a/libide/buildsystem/ide-build-system.h
+++ b/libide/buildsystem/ide-build-system.h
@@ -52,9 +52,11 @@ struct _IdeBuildSystemInterface
gchar *(*get_builddir) (IdeBuildSystem *self,
IdeConfiguration *configuration);
gchar *(*get_id) (IdeBuildSystem *self);
+ gchar *(*get_display_name) (IdeBuildSystem *self);
};
gchar *ide_build_system_get_id (IdeBuildSystem *self);
+gchar *ide_build_system_get_display_name (IdeBuildSystem *self);
void ide_build_system_new_async (IdeContext *context,
GFile *project_file,
const gchar *build_system_hint,
diff --git a/libide/directory/ide-directory-build-system.c b/libide/directory/ide-directory-build-system.c
index 42aeff3..b13f298 100644
--- a/libide/directory/ide-directory-build-system.c
+++ b/libide/directory/ide-directory-build-system.c
@@ -179,9 +179,16 @@ ide_directory_build_system_get_id (IdeBuildSystem *build_system)
return g_strdup ("directory");
}
+static gchar *
+ide_directory_build_system_get_display_name (IdeBuildSystem *build_system)
+{
+ return g_strdup ("Directory");
+}
+
static void
build_system_init (IdeBuildSystemInterface *iface)
{
iface->get_priority = ide_directory_build_system_get_priority;
iface->get_id = ide_directory_build_system_get_id;
+ iface->get_display_name = ide_directory_build_system_get_display_name;
}
diff --git a/plugins/autotools/ide-autotools-build-system.c b/plugins/autotools/ide-autotools-build-system.c
index a08e3ce..0b0c397 100644
--- a/plugins/autotools/ide-autotools-build-system.c
+++ b/plugins/autotools/ide-autotools-build-system.c
@@ -642,6 +642,12 @@ ide_autotools_build_system_get_id (IdeBuildSystem *build_system)
return g_strdup ("autotools");
}
+static gchar *
+ide_autotools_build_system_get_display_name (IdeBuildSystem *build_system)
+{
+ return g_strdup ("Autotools");
+}
+
static void
ide_autotools_build_system_finalize (GObject *object)
{
@@ -707,6 +713,7 @@ build_system_iface_init (IdeBuildSystemInterface *iface)
iface->get_build_targets_async = ide_autotools_build_system_get_build_targets_async;
iface->get_build_targets_finish = ide_autotools_build_system_get_build_targets_finish;
iface->get_id = ide_autotools_build_system_get_id;
+ iface->get_display_name = ide_autotools_build_system_get_display_name;
}
static void
diff --git a/plugins/cargo/cargo_plugin.py b/plugins/cargo/cargo_plugin.py
index b11ea27..75707ca 100644
--- a/plugins/cargo/cargo_plugin.py
+++ b/plugins/cargo/cargo_plugin.py
@@ -38,6 +38,9 @@ class CargoBuildSystem(Ide.Object, Ide.BuildSystem, Gio.AsyncInitable):
def do_get_id(self):
return 'cargo'
+ def do_get_display_name(self):
+ return 'Cargo'
+
def do_init_async(self, io_priority, cancellable, callback, data):
task = Gio.Task.new(self, cancellable, callback)
diff --git a/plugins/cmake/cmake_plugin/__init__.py b/plugins/cmake/cmake_plugin/__init__.py
index c4a49a4..268c9c0 100644
--- a/plugins/cmake/cmake_plugin/__init__.py
+++ b/plugins/cmake/cmake_plugin/__init__.py
@@ -34,6 +34,9 @@ class CMakeBuildSystem(Ide.Object, Ide.BuildSystem, Gio.AsyncInitable):
def do_get_id(self):
return 'cmake'
+ def do_get_display_name(self):
+ return 'Cmake'
+
def do_init_async(self, priority, cancel, callback, data=None):
task = Gio.Task.new(self, cancel, callback)
task.set_priority(priority)
diff --git a/plugins/make/make_plugin/__init__.py b/plugins/make/make_plugin/__init__.py
index 133911f..f9586ac 100644
--- a/plugins/make/make_plugin/__init__.py
+++ b/plugins/make/make_plugin/__init__.py
@@ -34,6 +34,9 @@ class MakeBuildSystem(Ide.Object, Ide.BuildSystem, Gio.AsyncInitable):
def do_get_id(self):
return 'make'
+ def do_get_display_name(self):
+ return 'Make'
+
def do_init_async(self, priority, cancel, callback, data=None):
task = Gio.Task.new(self, cancel, callback)
task.set_priority(priority)
diff --git a/plugins/meson/meson_plugin/__init__.py b/plugins/meson/meson_plugin/__init__.py
index 8a99793..fc34ac6 100644
--- a/plugins/meson/meson_plugin/__init__.py
+++ b/plugins/meson/meson_plugin/__init__.py
@@ -62,6 +62,9 @@ class MesonBuildSystem(Ide.Object, Ide.BuildSystem, Gio.AsyncInitable):
def do_get_id(self):
return 'meson'
+ def do_get_display_name(self):
+ return 'Meson'
+
def do_init_async(self, priority, cancel, callback, data=None):
task = Gio.Task.new(self, cancel, callback)
task.set_priority(priority)
diff --git a/plugins/phpize/phpize_plugin.py b/plugins/phpize/phpize_plugin.py
index c37dc21..7953039 100644
--- a/plugins/phpize/phpize_plugin.py
+++ b/plugins/phpize/phpize_plugin.py
@@ -57,6 +57,9 @@ class PHPizeBuildSystem(Ide.Object, Ide.BuildSystem, Gio.AsyncInitable):
def do_get_id(self):
return 'phpize'
+ def do_get_display_name(self):
+ return 'PHPize'
+
def do_get_priority(self):
return 500
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]