[gthumb] file tools: removed useless code
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gthumb] file tools: removed useless code
- Date: Thu, 23 Aug 2012 18:00:08 +0000 (UTC)
commit 25e75c13dd6243975e02c468d21f09d76c03df11
Author: Paolo Bacchilega <paobac src gnome org>
Date: Thu Aug 23 18:38:40 2012 +0200
file tools: removed useless code
extensions/file_tools/gth-file-tool-resize.c | 16 +++++++---------
extensions/file_tools/gth-file-tool-rotate.c | 1 -
2 files changed, 7 insertions(+), 10 deletions(-)
---
diff --git a/extensions/file_tools/gth-file-tool-resize.c b/extensions/file_tools/gth-file-tool-resize.c
index de15de2..0ce4eb0 100644
--- a/extensions/file_tools/gth-file-tool-resize.c
+++ b/extensions/file_tools/gth-file-tool-resize.c
@@ -56,7 +56,6 @@ struct _GthFileToolResizePrivate {
GthTask *resize_task;
gboolean closing;
gboolean final_resize;
- gboolean task_cancelled;
guint update_size_id;
};
@@ -148,7 +147,6 @@ resize_task_completed_cb (GthTask *task,
GtkWidget *viewer_page;
self->priv->resize_task = NULL;
- self->priv->task_cancelled = FALSE;
if (self->priv->closing) {
g_object_unref (task);
@@ -209,15 +207,10 @@ update_pixbuf_size_cb (gpointer user_data)
self->priv->update_size_id = 0;
if (self->priv->resize_task != NULL) {
- if (! self->priv->task_cancelled) {
- self->priv->task_cancelled = TRUE;
- gth_task_cancel (self->priv->resize_task);
- }
+ gth_task_cancel (self->priv->resize_task);
return FALSE;
}
- self->priv->task_cancelled = FALSE;
-
self->priv->resize_task = gth_image_task_new (_("Resizing images"),
NULL,
resize_task_exec,
@@ -565,7 +558,6 @@ gth_file_tool_resize_get_options (GthFileTool *base)
self->priv->unit = g_settings_get_enum (self->priv->settings, PREF_RESIZE_UNIT);
self->priv->builder = _gtk_builder_new_from_file ("resize-options.ui", "file_tools");
self->priv->final_resize = FALSE;
- self->priv->task_cancelled = FALSE;
update_dimensione_info_label (self,
"original_dimensions_label",
@@ -757,6 +749,11 @@ gth_file_tool_resize_cancel (GthFileTool *base)
return;
}
+ if (self->priv->update_size_id != 0) {
+ g_source_remove (self->priv->update_size_id);
+ self->priv->update_size_id = 0;
+ }
+
window = gth_file_tool_get_window (GTH_FILE_TOOL (self));
viewer_page = gth_browser_get_viewer_page (GTH_BROWSER (window));
gth_image_viewer_page_reset (GTH_IMAGE_VIEWER_PAGE (viewer_page));
@@ -811,3 +808,4 @@ gth_file_tool_resize_init (GthFileToolResize *self)
gth_file_tool_construct (GTH_FILE_TOOL (self), "tool-resize", _("Resize..."), _("Resize"), FALSE);
}
+
diff --git a/extensions/file_tools/gth-file-tool-rotate.c b/extensions/file_tools/gth-file-tool-rotate.c
index e43d912..cbc0a2f 100644
--- a/extensions/file_tools/gth-file-tool-rotate.c
+++ b/extensions/file_tools/gth-file-tool-rotate.c
@@ -556,7 +556,6 @@ gth_file_tool_rotate_destroy_options (GthFileTool *base)
viewer_page = gth_browser_get_viewer_page (GTH_BROWSER (window));
viewer = gth_image_viewer_page_get_image_viewer (GTH_IMAGE_VIEWER_PAGE (viewer_page));
gth_image_viewer_set_tool (GTH_IMAGE_VIEWER (viewer), NULL);
- gth_image_viewer_set_zoom_enabled (GTH_IMAGE_VIEWER (viewer), TRUE);
gth_viewer_page_update_sensitivity (GTH_VIEWER_PAGE (viewer_page));
cairo_surface_destroy (self->priv->image);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]