[gnome-builder] cmake: fix legacy "context" usage



commit 7740decc1f1b5a5e6c72e3bcd66b65fbdc1c8340
Author: Christian Hergert <chergert redhat com>
Date:   Wed Jan 23 10:12:26 2019 -0800

    cmake: fix legacy "context" usage

 src/plugins/cmake/gbp-cmake-build-target.c | 5 +----
 src/plugins/cmake/gbp-cmake-toolchain.c    | 9 ++++++---
 2 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/src/plugins/cmake/gbp-cmake-build-target.c b/src/plugins/cmake/gbp-cmake-build-target.c
index 6fb7fbdfd..d2c8befa7 100644
--- a/src/plugins/cmake/gbp-cmake-build-target.c
+++ b/src/plugins/cmake/gbp-cmake-build-target.c
@@ -96,10 +96,7 @@ gbp_cmake_build_target_new (IdeContext *context,
   g_return_val_if_fail (G_IS_FILE (install_directory), NULL);
   g_return_val_if_fail (name != NULL, NULL);
 
-  self = g_object_new (GBP_TYPE_CMAKE_BUILD_TARGET,
-                       "context", context,
-                       NULL);
-
+  self = g_object_new (GBP_TYPE_CMAKE_BUILD_TARGET, NULL);
   g_set_object (&self->install_directory, install_directory);
   self->name = g_strdup (name);
 
diff --git a/src/plugins/cmake/gbp-cmake-toolchain.c b/src/plugins/cmake/gbp-cmake-toolchain.c
index a21452ad6..98a2d1070 100644
--- a/src/plugins/cmake/gbp-cmake-toolchain.c
+++ b/src/plugins/cmake/gbp-cmake-toolchain.c
@@ -22,6 +22,8 @@
 
 #define G_LOG_DOMAIN "gbp-cmake-toolchain"
 
+#include "config.h"
+
 #include <glib/gi18n.h>
 #include <glib/gstdio.h>
 
@@ -44,14 +46,15 @@ enum {
 static GParamSpec *properties [N_PROPS];
 
 GbpCMakeToolchain *
-gbp_cmake_toolchain_new (IdeContext   *context)
+gbp_cmake_toolchain_new (IdeContext *context)
 {
   g_autoptr(IdeTriplet) triplet = NULL;
   g_autoptr(GbpCMakeToolchain) toolchain = NULL;
 
+  g_return_val_if_fail (IDE_IS_CONTEXT (context), NULL);
+
   triplet = ide_triplet_new_from_system ();
   toolchain = g_object_new (GBP_TYPE_CMAKE_TOOLCHAIN,
-                            "context", context,
                             "host-triplet", triplet,
                             NULL);
 
@@ -264,6 +267,7 @@ gbp_cmake_toolchain_get_property (GObject    *object,
     case PROP_FILE_PATH:
       g_value_set_string (value, gbp_cmake_toolchain_get_file_path (self));
       break;
+
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
     }
@@ -290,5 +294,4 @@ gbp_cmake_toolchain_class_init (GbpCMakeToolchainClass *klass)
 static void
 gbp_cmake_toolchain_init (GbpCMakeToolchain *self)
 {
-  
 }


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