[gnome-builder/wip/gtk4-port] libide/threading: add helper to return unsupported error



commit 38646a03049b1e10dc021979c8b9151570f0e365
Author: Christian Hergert <chergert redhat com>
Date:   Wed May 25 11:57:42 2022 -0700

    libide/threading: add helper to return unsupported error
    
    We can probably remove a lot of G_IO_ERROR_NOT_SUPPORTED usage from the
    codebase if you're reading this and looking for something to contribute.

 src/libide/threading/ide-task.h | 11 +++++++++++
 1 file changed, 11 insertions(+)
---
diff --git a/src/libide/threading/ide-task.h b/src/libide/threading/ide-task.h
index a069a63f4..d534636cb 100644
--- a/src/libide/threading/ide-task.h
+++ b/src/libide/threading/ide-task.h
@@ -163,6 +163,17 @@ void          ide_task_report_new_error          (gpointer              source_o
                                                   const gchar          *format,
                                                   ...) G_GNUC_PRINTF (7, 8);
 
+static inline void
+ide_task_return_unsupported_error (IdeTask *task)
+{
+  g_assert (IDE_IS_TASK (task));
+
+  ide_task_return_error (task,
+                         g_error_new_literal (G_IO_ERROR,
+                                              G_IO_ERROR_NOT_SUPPORTED,
+                                              "Not Supported"));
+}
+
 #ifdef __GNUC__
 # define ide_task_new(self, cancellable, callback, user_data)                      \
   ({                                                                               \


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