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




commit dbdc9ca9959c01d2fced578ecc1f18b3cc86eb2d
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]