static void
ide_autotools_build_system_tags_build_async (IdeTagsBuilder      *builder,
                                             GFile               *file_or_directory,
                                             gboolean             recursive,
                                             GCancellable        *cancellable,
                                             GAsyncReadyCallback  callback,
                                             gpointer             user_data)
{
  IdeAutotoolsBuildSystem *self = (IdeAutotoolsBuildSystem *)builder;
  IdeConfigurationManager *config_manager;
  IdeConfiguration *configuration;
  IdeContext *context;
  g_autoptr(GTask) task = NULL;

  g_assert (IDE_IS_AUTOTOOLS_BUILD_SYSTEM (self));
  g_assert (G_IS_FILE (file_or_directory));
  g_assert (!cancellable || G_IS_CANCELLABLE (cancellable));

  context = ide_object_get_context (IDE_OBJECT (self));
  config_manager = ide_context_get_configuration_manager (context);
  configuration = ide_configuration_manager_get_current (config_manager);

  task = g_task_new (self, cancellable, callback, user_data);
  simple_make_command (file_or_directory, "ctags", task, configuration);
}
Ejemplo n.º 2
0
static void
do_run_async (IdeRunManager *self,
              GTask         *task)
{
  IdeBuildTarget *build_target;
  IdeContext *context;
  IdeConfigurationManager *config_manager;
  IdeConfiguration *config;
  IdeRuntime *runtime;
  g_autoptr(IdeRunner) runner = NULL;
  GCancellable *cancellable;

  g_assert (IDE_IS_RUN_MANAGER (self));
  g_assert (G_IS_TASK (task));

  build_target = g_task_get_task_data (task);
  context = ide_object_get_context (IDE_OBJECT (self));

  g_assert (IDE_IS_BUILD_TARGET (build_target));
  g_assert (IDE_IS_CONTEXT (context));

  config_manager = ide_context_get_configuration_manager (context);
  config = ide_configuration_manager_get_current (config_manager);
  runtime = ide_configuration_get_runtime (config);

  if (runtime == NULL)
    {
      g_task_return_new_error (task,
                               IDE_RUNTIME_ERROR,
                               IDE_RUNTIME_ERROR_NO_SUCH_RUNTIME,
                               "%s “%s”",
                               _("Failed to locate runtime"),
                               ide_configuration_get_runtime_id (config));
      IDE_EXIT;
    }

  runner = ide_runtime_create_runner (runtime, build_target);
  cancellable = g_task_get_cancellable (task);

  g_assert (IDE_IS_RUNNER (runner));
  g_assert (!cancellable || G_IS_CANCELLABLE (cancellable));

  /*
   * If the current handler has a callback specified (our default "run" handler
   * does not), then we need to allow that handler to prepare the runner.
   */
  if (self->handler != NULL && self->handler->handler != NULL)
    self->handler->handler (self, runner, self->handler->handler_data);

  g_signal_emit (self, signals [RUN], 0, runner);

  ide_runner_run_async (runner,
                        cancellable,
                        ide_run_manager_run_cb,
                        g_object_ref (task));
}
Ejemplo n.º 3
0
static void
ide_omni_bar__config_manager__notify_current (IdeOmniBar              *self,
                                              GParamSpec              *pspec,
                                              IdeConfigurationManager *config_manager)
{
  IdeConfiguration *current;
  IdeRuntime *runtime;

  g_assert (IDE_IS_OMNI_BAR (self));
  g_assert (IDE_IS_CONFIGURATION_MANAGER (config_manager));

  current = ide_configuration_manager_get_current (config_manager);
  runtime = ide_configuration_get_runtime (current);

  if (runtime != NULL)
    gtk_label_set_label (self->popover_runtime_label, ide_runtime_get_display_name (runtime));
  else
    gtk_label_set_label (self->popover_runtime_label, "");

  gtk_label_set_label (self->popover_config_label,
                       ide_configuration_get_display_name (current));
}