application: Fix handling commandline arguments
handle_local_options are supposed to be handled only in local instance, and not in remote instance, fix that.
Also, the application isn’t required to handle files to open ‘tel:’ URIs. Handle it better.
Merge request reports
Activity
- Resolved by Mohammed Sadiq
This breaks
gio open tel://+3934545564
added 8 commits
-
37883cfd...19632e42 - 7 commits from branch
Librem5:master
- d6016f66 - application: Fix handling commandline arguments
-
37883cfd...19632e42 - 7 commits from branch
added needswork label
added 161 commits
-
d6016f66...9f295a72 - 160 commits from branch
Librem5:master
- b4b63a4a - application: Fix handling commandline arguments
-
d6016f66...9f295a72 - 160 commits from branch
- Resolved by Mohammed Sadiq
added 5 commits
-
e467e6d7...862e0b5f - 4 commits from branch
Librem5:master
- 2356f085 - application: Fix handling commandline arguments
-
e467e6d7...862e0b5f - 4 commits from branch
437 g_application_activate (application); 477 438 478 open_tel_uri (self, uri); 479 } 480 else 481 { 482 uri = g_file_get_parse_name (files[i]); 483 g_warning ("Don't know how to" 484 " open file `%s', ignoring", 485 uri); 486 } 439 arguments = g_application_command_line_get_arguments (command_line, &argc); 487 440 488 g_free (uri); 489 } 441 /* XXX: Should we handle only the first/last ‘tel:’ item? */ I would say (for the moment):
- Call only the first
tel:
- print a warning for the rest (
Ignoring arg/tel %s
or something)
Edited by Evangelos Ribeiro Tzaras- Call only the first
What do you think @mohammed.sadiq @julian.sparber ?
changed this line in version 7 of the diff
Mh, after rebasing the CI failed with
Run-time dependency libcallaudio-0 found: NO (tried pkgconfig) src/meson.build:31:0: ERROR: Dependency "libcallaudio-0" not found, tried pkgconfig
I wonder if the CI in !230 (merged) succeeds.
Edit: Looks good
Edited by Evangelos Ribeiro Tzarasadded 12 commits
-
2356f085...70c75822 - 11 commits from branch
Librem5:master
- 93ddf9a0 - application: Fix handling commandline arguments
-
2356f085...70c75822 - 11 commits from branch
mentioned in merge request !262 (merged)
added 44 commits
-
93ddf9a0...eda460ac - 43 commits from branch
Librem5:master
- fe56b73a - application: Fix handling commandline arguments
-
93ddf9a0...eda460ac - 43 commits from branch
added 1 commit
- 0e127d49 - application: Fix handling commandline arguments
added 1 commit
- 7f9d9933 - application: Fix handling commandline arguments
I did some testing and there are some issues:
- invoking
gnome-calls tel:+49XXXX
does not start a call (it only starts a call if calls is not yet running - this breaks starting a call from contacts) - invoking
gnome-calls tel:+49XXXX tel:+49YYYY
(when calls is not already running) calls the last number (all other numbers are still shown in the call history) - invoking
gnome-calls tel:+49XXXX tel:+49YYYY
(when calls is already running) caused a segfault:
Stack trace of thread 1919: #0 0x0000007fb96ba458 g_path_is_absolute (libglib-2.0.so.0 + 0x3d458) #1 0x0000007fb8b8a208 new_for_cmdline_arg (libgio-2.0.so.0 + 0x6d208) #2 0x00000055801558bc n/a (gnome-calls + 0x158bc) #3 0x0000007fb8ba7d30 _g_cclosure_marshal_INT__OBJECTv (libgio-2.0.so.0 + 0x8ad30) #4 0x0000007fb97d3444 g_type_class_meta_marshalv (libgobject-2.0.so.0 + 0x13444) #5 0x0000007fb97d5274 _g_closure_invoke_va (libgobject-2.0.so.0 + 0x15274) #6 0x0000007fb97ee10c g_signal_emit_valist (libgobject-2.0.so.0 + 0x2e10c) #7 0x0000007fb97ef098 g_signal_emit_by_name (libgobject-2.0.so.0 + 0x2f098) #8 0x0000007fb8c10dd4 g_application_impl_method_call (libgio-2.0.so.0 + 0xf3dd4) #9 0x0000007fb8c3e724 call_in_idle_cb (libgio-2.0.so.0 + 0x121724) #10 0x0000007fb96d0ab4 g_main_dispatch (libglib-2.0.so.0 + 0x53ab4) #11 0x0000007fb96d0e5c g_main_context_iterate (libglib-2.0.so.0 + 0x53e5c) #12 0x0000007fb96d0f24 g_main_context_iteration (libglib-2.0.so.0 + 0x53f24) #13 0x0000007fb8c0eac8 g_application_run (libgio-2.0.so.0 + 0xf1ac8) #14 0x000000558014d530 main (gnome-calls + 0xd530) #15 0x0000007fb86c6218 __libc_start_main (libc.so.6 + 0x24218) #16 0x000000558014d584 _start (gnome-calls + 0xd584) #17 0x000000558014d584 _start (gnome-calls + 0xd584) .... Core was generated by `gnome-calls tel:+491602997901 tel:+4975424074379 tel:+497548979874844578'. Program terminated with signal SIGSEGV, Segmentation fault. #0 g_path_is_absolute (file_name=file_name@entry=0x5500000003 <error: Cannot access memory at address 0x5500000003>) at ../../../glib/gfileutils.c:2391
I suspect !97 (diffs) is the culprit. Setting
url_list = NULL
might help here (haven't dug too deeply).- invoking
Probably some (most?) of the things I pointed out are fixed by !262 (merged) ?
@mohammed.sadiq I'd appreciate a comment as I'm a bit confused as !262 (merged) also touches similar areas of the code