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 680219 - Various fixes and cleanups
Various fixes and cleanups
Status: RESOLVED FIXED
Product: gnome-documents
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: GNOME documents maintainer(s)
GNOME documents maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2012-07-19 01:40 UTC by Jasper St. Pierre (not reading bugmail)
Modified: 2012-07-19 02:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
application: Do not pass extra arguments to GtkClutter.init (773 bytes, patch)
2012-07-19 01:40 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
miners: Port JS proxy code to GDBus (7.84 KB, patch)
2012-07-19 01:40 UTC, Jasper St. Pierre (not reading bugmail)
accepted-commit_now Details | Review
changeMonitor: Port to GDBus (2.40 KB, patch)
2012-07-19 01:40 UTC, Jasper St. Pierre (not reading bugmail)
needs-work Details | Review
application: Port to gjs inheritance (5.69 KB, patch)
2012-07-19 01:40 UTC, Jasper St. Pierre (not reading bugmail)
reviewed Details | Review
miners: Port JS proxy code to GDBus (7.31 KB, patch)
2012-07-19 02:07 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
changeMonitor: Port to GDBus (2.61 KB, patch)
2012-07-19 02:13 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
application: Port to gjs inheritance (5.58 KB, patch)
2012-07-19 02:19 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review

Description Jasper St. Pierre (not reading bugmail) 2012-07-19 01:40:07 UTC
I started by with a very simple fix, and then a half an hour later this happened.
Comment 1 Jasper St. Pierre (not reading bugmail) 2012-07-19 01:40:09 UTC
Created attachment 219180 [details] [review]
application: Do not pass extra arguments to GtkClutter.init
Comment 2 Jasper St. Pierre (not reading bugmail) 2012-07-19 01:40:12 UTC
Created attachment 219181 [details] [review]
miners: Port JS proxy code to GDBus

Make both miners use the same interface so that we can generalize
the code a bit better.
Comment 3 Jasper St. Pierre (not reading bugmail) 2012-07-19 01:40:15 UTC
Created attachment 219182 [details] [review]
changeMonitor: Port to GDBus
Comment 4 Jasper St. Pierre (not reading bugmail) 2012-07-19 01:40:17 UTC
Created attachment 219183 [details] [review]
application: Port to gjs inheritance
Comment 5 Cosimo Cecchi 2012-07-19 01:56:41 UTC
Review of attachment 219180 [details] [review]:

::: src/application.js
@@ +180,3 @@
         String.prototype.format = Format.format;
 
+        GtkClutter.init(null);

Are you sure of this? In C the function is
gtk_clutter_init(int *argc, char ***argv)
Comment 6 Cosimo Cecchi 2012-07-19 02:01:17 UTC
Review of attachment 219181 [details] [review]:

Looks good, thanks!

::: src/miner/gdata-miner-main.c
@@ +169,3 @@
 
+  g_dbus_connection_register_object (connection, 
+                                    "/org/gnome/Documents/GDataMiner",

This looks just a stray whitespace change, could you rebase it out of the patch?
Comment 7 Jasper St. Pierre (not reading bugmail) 2012-07-19 02:05:18 UTC
(In reply to comment #5)
> Review of attachment 219180 [details] [review]:
> 
> ::: src/application.js
> @@ +180,3 @@
>          String.prototype.format = Format.format;
> 
> +        GtkClutter.init(null);
> 
> Are you sure of this? In C the function is
> gtk_clutter_init(int *argc, char ***argv)

argv has an (array length=argc) annotation, which means that gjs will fill in argc with argv's length automatically
Comment 8 Jasper St. Pierre (not reading bugmail) 2012-07-19 02:07:07 UTC
Created attachment 219187 [details] [review]
miners: Port JS proxy code to GDBus

Make both miners use the same interface so that we can generalize
the code a bit better.
Comment 9 Cosimo Cecchi 2012-07-19 02:08:51 UTC
Review of attachment 219182 [details] [review]:

::: src/changeMonitor.js
@@ +84,2 @@
         this._resourceService = new TrackerResourcesService();
+        this._resourceService.connectSignal('GraphUpdated', Lang.bind(this, this._onGraphUpdated));

This doesn't work; in the callback I get the following exception

    JS ERROR: !!!   Exception in callback for signal: GraphUpdated
    JS ERROR: !!!     message = '"insertEvents is undefined"'
    JS ERROR: !!!     fileName = '"/opt/jhbuild/share/gnome-documents/js/changeMonitor.js"'
    JS ERROR: !!!     lineNumber = '95'
    JS ERROR: !!!     stack = '"([object _private_Gio_DBusProxy],":1.26",[object Array])@/opt/jhbuild/share/gnome-documents/js/changeMonitor.js:95
wrapper([object _private_Gio_DBusProxy],":1.26",[object Array])@/opt/jhbuild/share/gjs-1.0/lang.js:204
_emit("GraphUpdated",":1.26",[object Array])@/opt/jhbuild/share/gjs-1.0/signals.js:124
_convertToNativeSignal([object _private_Gio_DBusProxy],":1.26","GraphUpdated",[object _private_GLib_Variant])@/opt/jhbuild/share/gjs-1.0/overrides/Gio.js:126
start()@/opt/jhbuild/share/gnome-documents/js/main.js:26
@<command line>:1
"'
Comment 10 Cosimo Cecchi 2012-07-19 02:09:29 UTC
Review of attachment 219180 [details] [review]:

Go for it then
Comment 11 Cosimo Cecchi 2012-07-19 02:09:50 UTC
Review of attachment 219187 [details] [review]:

Sure
Comment 12 Jasper St. Pierre (not reading bugmail) 2012-07-19 02:13:24 UTC
Created attachment 219188 [details] [review]
changeMonitor: Port to GDBus

Try this one, then.
Comment 13 Jasper St. Pierre (not reading bugmail) 2012-07-19 02:14:10 UTC
(I can't get the signal to fire -- what do I need to do)
Comment 14 Cosimo Cecchi 2012-07-19 02:15:11 UTC
Review of attachment 219188 [details] [review]:

Works great now, thanks.
Comment 15 Cosimo Cecchi 2012-07-19 02:15:39 UTC
Review of attachment 219183 [details] [review]:

Looks good, but there was a mid-air collision with some code I just changed in git master, so it doesn't apply anymore.
Comment 16 Cosimo Cecchi 2012-07-19 02:18:30 UTC
(In reply to comment #13)
> (I can't get the signal to fire -- what do I need to do)

Do you have any google docs in a linked online account? If so you should get an updated signal as soon as the miner gets results back from google.
Maybe the miner fails to get autostarted in jhbuild, you can run it with GDATA_MINER_PERSIST=1 in another terminal.
Comment 17 Jasper St. Pierre (not reading bugmail) 2012-07-19 02:19:57 UTC
Created attachment 219189 [details] [review]
application: Port to gjs inheritance

Heh. That's a coincidence.
Comment 18 Cosimo Cecchi 2012-07-19 02:26:12 UTC
Review of attachment 219189 [details] [review]:

Looks good, with the exception of the following...sorry about that, that function wasn't there when you originally wrote the patch. No need to attach another patch again.

::: src/application.js
@@ +140,3 @@
     },
 
     _initAppMenu: function() {

There's another this.application->this to do inside this function
Comment 19 Jasper St. Pierre (not reading bugmail) 2012-07-19 02:29:46 UTC
Attachment 219180 [details] pushed as c122aad - application: Do not pass extra arguments to GtkClutter.init
Attachment 219187 [details] pushed as adef4f4 - miners: Port JS proxy code to GDBus
Attachment 219188 [details] pushed as bec7791 - changeMonitor: Port to GDBus
Attachment 219189 [details] pushed as 3bd66e5 - application: Port to gjs inheritance