[glib/wip/pwithnall/more-macos-fixes] gosxappinfo: Correctly return an error from create_from_commandline()



commit 92e0fcded5aff52bcd9e22dd5c46df4fb89efc57
Author: Philip Withnall <pwithnall endlessos org>
Date:   Fri Jun 24 12:17:37 2022 +0100

    gosxappinfo: Correctly return an error from create_from_commandline()
    
    Creating a `GAppInfo` from a commandline isn’t currently supported on
    macOS, but the implementation was incorrectly returning `NULL` without
    setting the `GError`.
    
    This was being caught by the new tests in `gio/tests/file.c`.
    
    Signed-off-by: Philip Withnall <pwithnall endlessos org>

 gio/gosxappinfo.m | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/gio/gosxappinfo.m b/gio/gosxappinfo.m
index 03c3737788..a0bf722269 100644
--- a/gio/gosxappinfo.m
+++ b/gio/gosxappinfo.m
@@ -587,6 +587,9 @@ g_app_info_create_from_commandline (const char           *commandline,
                                     GAppInfoCreateFlags   flags,
                                     GError              **error)
 {
+  g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
+                       "Creating an app info from a command line not currently supported");
+
   return NULL;
 }
 


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