evince r3347 - in trunk: . shell
- From: carlosgc svn gnome org
- To: svn-commits-list gnome org
- Subject: evince r3347 - in trunk: . shell
- Date: Sun, 18 Jan 2009 10:28:37 +0000 (UTC)
Author: carlosgc
Date: Sun Jan 18 10:28:37 2009
New Revision: 3347
URL: http://svn.gnome.org/viewvc/evince?rev=3347&view=rev
Log:
2009-01-18 Carlos Garcia Campos <carlosgc gnome org>
* shell/ev-jobs.[ch]: (ev_job_load_dispose), (ev_job_load_new):
* shell/ev-window.c: (ev_window_load_job_cb),
(ev_window_load_job_cb), (ev_window_open_uri),
(ev_window_reload_local), (ev_window_dispose):
Remove dest, mode and search_string from EvJobLoad since they are
not really needed by the job, but for the window.
Modified:
trunk/ChangeLog
trunk/shell/ev-jobs.c
trunk/shell/ev-jobs.h
trunk/shell/ev-window.c
Modified: trunk/shell/ev-jobs.c
==============================================================================
--- trunk/shell/ev-jobs.c (original)
+++ trunk/shell/ev-jobs.c Sun Jan 18 10:28:37 2009
@@ -803,16 +803,6 @@
job->password = NULL;
}
- if (job->dest) {
- g_object_unref (job->dest);
- job->dest = NULL;
- }
-
- if (job->search_string) {
- g_free (job->search_string);
- job->search_string = NULL;
- }
-
(* G_OBJECT_CLASS (ev_job_load_parent_class)->dispose) (object);
}
@@ -871,21 +861,14 @@
}
EvJob *
-ev_job_load_new (const gchar *uri,
- EvLinkDest *dest,
- EvWindowRunMode mode,
- const gchar *search_string)
+ev_job_load_new (const gchar *uri)
{
EvJobLoad *job;
ev_debug_message (DEBUG_JOBS, "%s", uri);
job = g_object_new (EV_TYPE_JOB_LOAD, NULL);
-
job->uri = g_strdup (uri);
- job->dest = dest ? g_object_ref (dest) : NULL;
- job->mode = mode;
- job->search_string = search_string ? g_strdup (search_string) : NULL;
return EV_JOB (job);
}
Modified: trunk/shell/ev-jobs.h
==============================================================================
--- trunk/shell/ev-jobs.h (original)
+++ trunk/shell/ev-jobs.h Sun Jan 18 10:28:37 2009
@@ -27,7 +27,6 @@
#include "ev-document.h"
#include "ev-selection.h"
#include "ev-render-context.h"
-#include "ev-window.h"
G_BEGIN_DECLS
@@ -259,10 +258,7 @@
struct _EvJobLoad
{
EvJob parent;
-
- EvLinkDest *dest;
- EvWindowRunMode mode;
- gchar *search_string;
+
gchar *uri;
gchar *password;
};
@@ -385,10 +381,7 @@
/* EvJobLoad */
GType ev_job_load_get_type (void) G_GNUC_CONST;
-EvJob *ev_job_load_new (const gchar *uri,
- EvLinkDest *dest,
- EvWindowRunMode mode,
- const gchar *search_string);
+EvJob *ev_job_load_new (const gchar *uri);
void ev_job_load_set_uri (EvJobLoad *load,
const gchar *uri);
void ev_job_load_set_password (EvJobLoad *job,
Modified: trunk/shell/ev-window.c
==============================================================================
--- trunk/shell/ev-window.c (original)
+++ trunk/shell/ev-window.c Sun Jan 18 10:28:37 2009
@@ -181,7 +181,6 @@
char *uri;
glong uri_mtime;
char *local_uri;
- EvLinkDest *dest;
gboolean unlink_temp_file;
gboolean in_reload;
EvFileMonitor *monitor;
@@ -193,6 +192,11 @@
EvWindowPageMode page_mode;
EvWindowTitle *title;
+ /* Load params */
+ EvLinkDest *dest;
+ gchar *search_string;
+ EvWindowRunMode window_mode;
+
EvJob *load_job;
EvJob *reload_job;
EvJob *thumbnail_job;
@@ -1372,7 +1376,7 @@
if (!ev_job_is_failed (job)) {
ev_window_set_document (ev_window, document);
- if (job_load->mode != EV_WINDOW_MODE_PREVIEW) {
+ if (ev_window->priv->window_mode != EV_WINDOW_MODE_PREVIEW) {
setup_view_from_metadata (ev_window);
}
@@ -1392,17 +1396,23 @@
flags);
}
- if (job_load->dest) {
+ if (ev_window->priv->dest) {
EvLink *link;
EvLinkAction *link_action;
- link_action = ev_link_action_new_dest (g_object_ref (job_load->dest));
+ link_action = ev_link_action_new_dest (ev_window->priv->dest);
link = ev_link_new (NULL, link_action);
ev_view_handle_link (EV_VIEW (ev_window->priv->view), link);
g_object_unref (link);
+
+ /* Already unrefed by ev_link_action
+ * FIXME: link action should inc dest ref counting
+ * or not unref it at all
+ */
+ ev_window->priv->dest = NULL;
}
- switch (job_load->mode) {
+ switch (ev_window->priv->window_mode) {
case EV_WINDOW_MODE_FULLSCREEN:
ev_window_run_fullscreen (ev_window);
break;
@@ -1416,12 +1426,15 @@
break;
}
- if (job_load->search_string && EV_IS_DOCUMENT_FIND (document)) {
+ if (ev_window->priv->search_string && EV_IS_DOCUMENT_FIND (document)) {
ev_window_cmd_edit_find (NULL, ev_window);
egg_find_bar_set_search_string (EGG_FIND_BAR (ev_window->priv->find_bar),
- job_load->search_string);
+ ev_window->priv->search_string);
}
+ g_free (ev_window->priv->search_string);
+ ev_window->priv->search_string = NULL;
+
/* Create a monitor for the document */
ev_window->priv->monitor = ev_file_monitor_new (ev_window->priv->uri);
g_signal_connect_swapped (G_OBJECT (ev_window->priv->monitor), "changed",
@@ -1807,6 +1820,7 @@
ev_view_set_loading (EV_VIEW (ev_window->priv->view), TRUE);
ev_window->priv->unlink_temp_file = unlink_temp_file;
+ ev_window->priv->window_mode = mode;
if (mode == EV_WINDOW_MODE_PREVIEW) {
ev_window->priv->print_settings_file = print_settings ?
@@ -1817,9 +1831,18 @@
g_free (ev_window->priv->uri);
ev_window->priv->uri = g_strdup (uri);
+ if (ev_window->priv->search_string)
+ g_free (ev_window->priv->search_string);
+ ev_window->priv->search_string = search_string ?
+ g_strdup (search_string) : NULL;
+
+ if (ev_window->priv->dest)
+ g_object_unref (ev_window->priv->dest);
+ ev_window->priv->dest = dest ? g_object_ref (dest) : NULL;
+
setup_size_from_metadata (ev_window);
- ev_window->priv->load_job = ev_job_load_new (uri, dest, mode, search_string);
+ ev_window->priv->load_job = ev_job_load_new (uri);
g_signal_connect (ev_window->priv->load_job,
"finished",
G_CALLBACK (ev_window_load_job_cb),
@@ -1840,7 +1863,7 @@
const gchar *uri;
uri = ev_window->priv->local_uri ? ev_window->priv->local_uri : ev_window->priv->uri;
- ev_window->priv->reload_job = ev_job_load_new (uri, NULL, 0, NULL);
+ ev_window->priv->reload_job = ev_job_load_new (uri);
g_signal_connect (ev_window->priv->reload_job, "finished",
G_CALLBACK (ev_window_reload_job_cb),
ev_window);
@@ -4898,6 +4921,11 @@
priv->uri = NULL;
}
+ if (priv->search_string) {
+ g_free (priv->search_string);
+ priv->search_string = NULL;
+ }
+
if (priv->dest) {
g_object_unref (priv->dest);
priv->dest = NULL;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]