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 733747 - EvPageCache should notify when a page gets cached
EvPageCache should notify when a page gets cached
Status: RESOLVED FIXED
Product: evince
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Evince Maintainers
Evince Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-07-25 16:26 UTC by Alejandro Piñeiro Iglesias (IRC: infapi00)
Modified: 2014-09-11 12:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Adds new signal EvPageCache::page-cached (1.68 KB, patch)
2014-07-25 16:30 UTC, Alejandro Piñeiro Iglesias (IRC: infapi00)
committed Details | Review
Use page cached signal to initialize children (2.27 KB, patch)
2014-07-25 16:31 UTC, Alejandro Piñeiro Iglesias (IRC: infapi00)
committed Details | Review

Description Alejandro Piñeiro Iglesias (IRC: infapi00) 2014-07-25 16:26:56 UTC
Right now there is a procedure to ask to load a page on the cache, but the procedure is right now asynchronous. Several of the accessible elements depends on the contents of the cache. But right now you only can ask to load a specific page, but you don't know when that will finish. This leads to having several methods trying to initialize the internal children, hoping that at least one of those calls will be used when the cache is loaded.

It would be better to have a signal that notifies when the cache gets the data of a specific page.
Comment 1 Alejandro Piñeiro Iglesias (IRC: infapi00) 2014-07-25 16:30:56 UTC
Created attachment 281708 [details] [review]
Adds new signal EvPageCache::page-cached

Is basically a forward of the EvJobPageData::finished, including the page number
Comment 2 Alejandro Piñeiro Iglesias (IRC: infapi00) 2014-07-25 16:31:47 UTC
Created attachment 281709 [details] [review]
Use page cached signal to initialize children

Now EvPageAccessible tries to initialize the children since the beginning, and if not, it connects to the cache, in order to do that when the page gets cached.
Comment 3 Alejandro Piñeiro Iglesias (IRC: infapi00) 2014-08-18 16:43:57 UTC
Ping: probably this bug and patches were overlooked due the flood of patches during the evince hackfest.
Comment 4 Carlos Garcia Campos 2014-08-29 16:16:54 UTC
Review of attachment 281708 [details] [review]:

LGTM

::: libview/ev-page-cache.c
@@ +201,3 @@
+                                G_SIGNAL_RUN_LAST,
+                                0,
+                                (GSignalAccumulator) NULL, NULL,

I don't think you need the cast
Comment 5 Carlos Garcia Campos 2014-08-29 16:18:09 UTC
Review of attachment 281709 [details] [review]:

Ok
Comment 6 Alejandro Piñeiro Iglesias (IRC: infapi00) 2014-09-01 13:51:29 UTC
(In reply to comment #4)
> Review of attachment 281708 [details] [review]:
> 
> LGTM
> 
> ::: libview/ev-page-cache.c
> @@ +201,3 @@
> +                                G_SIGNAL_RUN_LAST,
> +                                0,
> +                                (GSignalAccumulator) NULL, NULL,
> 
> I don't think you need the cast

Just pushed the patch removing this cast. So as I also pushed the other patch, closing bug.
Comment 7 José Aliste 2014-09-10 23:16:03 UTC
Review of attachment 281708 [details] [review]:

I think there is a typo in this patch. see below

::: libview/ev-page-cache.c
@@ +330,1 @@
 }

Here you are passing the page index as the signal deatail. 
I think it should be: 
g_signal_emit (cache, ev_page_cache_signals[PAGE_CACHED], 0, job_data->page);

no?
Comment 8 Carlos Garcia Campos 2014-09-11 12:07:09 UTC
(In reply to comment #7)
> Review of attachment 281708 [details] [review]:
> 
> I think there is a typo in this patch. see below
> 
> ::: libview/ev-page-cache.c
> @@ +330,1 @@
>  }
> 
> Here you are passing the page index as the signal deatail. 
> I think it should be: 
> g_signal_emit (cache, ev_page_cache_signals[PAGE_CACHED], 0, job_data->page);
> 
> no?

Yes.
Comment 9 José Aliste 2014-09-11 12:13:38 UTC
Fixed and pushed to master