After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 735935 - main: Fix opening files
main: Fix opening files
Status: RESOLVED FIXED
Product: totem
Classification: Core
Component: Movie player
unspecified
Other All
: Normal normal
: ---
Assigned To: General Totem maintainer(s)
General Totem maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2014-09-02 22:17 UTC by Bastien Nocera
Modified: 2014-09-03 12:08 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
main: Fix opening files (1.99 KB, patch)
2014-09-02 22:17 UTC, Bastien Nocera
none Details | Review
main: Fix opening files (2.04 KB, patch)
2014-09-02 22:39 UTC, Bastien Nocera
reviewed Details | Review
main: Fix opening files (2.06 KB, patch)
2014-09-03 10:20 UTC, Bastien Nocera
committed Details | Review

Description Bastien Nocera 2014-09-02 22:17:15 UTC
.
Comment 1 Bastien Nocera 2014-09-02 22:17:27 UTC
Created attachment 285209 [details] [review]
main: Fix opening files

Caused by the switch to D-Bus activation.
Comment 2 Bastien Nocera 2014-09-02 22:19:18 UTC
Can you please test, Elad?
Comment 3 Elad Alfassa 2014-09-02 22:26:08 UTC
It works (ie. I can open a file) but things are extremely slow, so I guess the workaround from bug #728716 would need to be used for this codepath as well.
Comment 4 Bastien Nocera 2014-09-02 22:39:43 UTC
Created attachment 285212 [details] [review]
main: Fix opening files

Caused by the switch to D-Bus activation.
Comment 5 Philip Withnall 2014-09-03 07:32:25 UTC
Review of attachment 285212 [details] [review]:

::: src/totem.c
@@ +255,3 @@
 	totem = g_object_new (TOTEM_TYPE_OBJECT,
 			      "application-id", "org.gnome.Totem",
+			      "flags", G_APPLICATION_HANDLES_COMMAND_LINE | G_APPLICATION_HANDLES_OPEN,

The docs for G_APPLICATION_HANDLES_OPEN say it has no effect when G_APPLICATION_HANDLES_COMMAND_LINE is set. So I guess this hunk can be removed, since we do handle local file opening in app_command_line().
Comment 6 Elad Alfassa 2014-09-03 09:39:31 UTC
The latest patch doesn't even build, 

totem-object.c: In function 'totem_object_app_open':
totem-object.c:148:30: error: 'totem' undeclared (first use in this function)
  totem_object_set_main_page (totem, "player");
Comment 7 Bastien Nocera 2014-09-03 10:20:17 UTC
Created attachment 285242 [details] [review]
main: Fix opening files

Caused by the switch to D-Bus activation.
Comment 8 Bastien Nocera 2014-09-03 10:25:34 UTC
(In reply to comment #6)
> The latest patch doesn't even build, 

The "even" is not needed.

(In reply to comment #5)
> Review of attachment 285212 [details] [review]:
> 
> ::: src/totem.c
> @@ +255,3 @@
>      totem = g_object_new (TOTEM_TYPE_OBJECT,
>                    "application-id", "org.gnome.Totem",
> +                  "flags", G_APPLICATION_HANDLES_COMMAND_LINE |
> G_APPLICATION_HANDLES_OPEN,
> 
> The docs for G_APPLICATION_HANDLES_OPEN say it has no effect when
> G_APPLICATION_HANDLES_COMMAND_LINE is set. So I guess this hunk can be removed,
> since we do handle local file opening in app_command_line().

I'm guessing that's not the case when the command-line isn't used though, and g_application_open() is called directly. gedit uses the same combination of flags, to the same effect (opening a file works again after a port to using D-Bus activation).
Comment 9 Elad Alfassa 2014-09-03 11:08:35 UTC
Sorry for the bad phrasing on my part, I meant no offense.

The latest patch works, and I also think it is correct to use G_APPLICATION_HANDLES_OPEN as the command line is not what handles the file opening when you launch using gapplication and dbus activation.


Thanks for fixing this so quickly, and sorry for not filing this bug sooner.
Comment 10 Bastien Nocera 2014-09-03 12:07:57 UTC
Attachment 285242 [details] pushed as ed8485f - main: Fix opening files