mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-03-30 12:23:06 +02:00
macos: Fill appUrl directly
No need to convert it to a char* first. This also avoids threading issues with OsxAppInfo's get_filename() method.
This commit is contained in:
parent
71e87fc29c
commit
9f0ff882c1
@ -278,16 +278,11 @@ create_urlspec_for_appinfo (GOsxAppInfo *info,
|
|||||||
gboolean are_files)
|
gboolean are_files)
|
||||||
{
|
{
|
||||||
LSLaunchURLSpec *urlspec = NULL;
|
LSLaunchURLSpec *urlspec = NULL;
|
||||||
const gchar *app_cstr;
|
|
||||||
|
|
||||||
g_return_val_if_fail (G_IS_OSX_APP_INFO (info), NULL);
|
g_return_val_if_fail (G_IS_OSX_APP_INFO (info), NULL);
|
||||||
|
|
||||||
urlspec = g_new0 (LSLaunchURLSpec, 1);
|
urlspec = g_new0 (LSLaunchURLSpec, 1);
|
||||||
app_cstr = g_osx_app_info_get_filename (info);
|
urlspec->appURL = CFURLCreateWithFileSystemPath (NULL, CFBridgingRetain([info->bundle bundlePath]), kCFURLPOSIXPathStyle, FALSE);
|
||||||
g_assert (app_cstr != NULL);
|
|
||||||
|
|
||||||
/* Strip file:// from app url but ensure filesystem url */
|
|
||||||
urlspec->appURL = create_url_from_cstr (app_cstr + strlen ("file://"), TRUE);
|
|
||||||
urlspec->launchFlags = kLSLaunchDefaults;
|
urlspec->launchFlags = kLSLaunchDefaults;
|
||||||
urlspec->itemURLs = create_url_list_from_glist (uris, are_files);
|
urlspec->itemURLs = create_url_list_from_glist (uris, are_files);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user