[Xfce4-commits] <ristretto:ristretto-0.0> Fix reference-count on settings-object Set default accelerator on rotation buttons
Stephan Arts
noreply at xfce.org
Sun Oct 23 19:14:17 CEST 2011
Updating branch refs/heads/ristretto-0.0
to 3fdca51f9afb8dc0b8c6d01a6359531ef5545afc (commit)
from 10e6f204a2c38fcd091ca023e10078810719adf0 (commit)
commit 3fdca51f9afb8dc0b8c6d01a6359531ef5545afc
Author: Stephan Arts <stephan at thor.(none)>
Date: Sat May 16 11:08:01 2009 +0200
Fix reference-count on settings-object
Set default accelerator on rotation buttons
ChangeLog | 7 +++++++
src/image_cache.c | 1 +
src/main_window.c | 39 ++++++++++++---------------------------
src/picture_viewer.c | 1 +
4 files changed, 21 insertions(+), 27 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index b41206d..f864745 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2009-05-16 Stephan Arts <stephan at xfce.org>
+ * src/image_cache.c
+ src/picture_viewer.c
+ src/main_window.c: Fix reference-count on settings-object
+ * src/main_window.c: Set default accelerators on rotation buttons
+
+2009-05-16 Stephan Arts <stephan at xfce.org>
+
* src/picture_viewer.c: When an image is rotated upside down, make sure
the horizontal slider works horizontally and the vertical slider works
vertically. These were switched :-p
diff --git a/src/image_cache.c b/src/image_cache.c
index c548be6..2a61380 100644
--- a/src/image_cache.c
+++ b/src/image_cache.c
@@ -160,6 +160,7 @@ rstto_image_cache_push_image (RsttoImageCache *cache, RsttoImage *image, gboolea
}
}
}
+ g_object_unref (settings);
g_value_unset (&val);
return retval;
}
diff --git a/src/main_window.c b/src/main_window.c
index 4e37b7e..09feb7f 100644
--- a/src/main_window.c
+++ b/src/main_window.c
@@ -225,8 +225,8 @@ static GtkActionEntry action_entries[] =
{ "zoom-100", GTK_STOCK_ZOOM_100, N_ ("_Normal Size"), "<control>0", NULL, G_CALLBACK (cb_rstto_main_window_zoom_100), },
/* Rotation submenu */
{ "rotation-menu", NULL, N_ ("_Rotation"), NULL, },
- { "rotate-cw", NULL, N_ ("Rotate _Right"), NULL, NULL, G_CALLBACK (cb_rstto_main_window_rotate_cw), },
- { "rotate-ccw", NULL, N_ ("Rotate _Left"), NULL, NULL, G_CALLBACK (cb_rstto_main_window_rotate_ccw), },
+ { "rotate-cw", NULL, N_ ("Rotate _Right"), "<control>bracketright", NULL, G_CALLBACK (cb_rstto_main_window_rotate_cw), },
+ { "rotate-ccw", NULL, N_ ("Rotate _Left"), "<contron>bracketleft", NULL, G_CALLBACK (cb_rstto_main_window_rotate_ccw), },
/* Go Menu */
{ "go-menu", NULL, N_ ("_Go"), NULL, },
{ "forward", GTK_STOCK_GO_FORWARD, N_ ("_Forward"), "space", NULL, G_CALLBACK (cb_rstto_main_window_next_image), },
@@ -777,12 +777,6 @@ cb_rstto_main_window_rotate_cw (GtkWidget *widget, RsttoMainWindow *window)
{
RsttoImage *image = NULL;
- RsttoSettings *settings_manager = rstto_settings_new();
- GValue max_size = {0,};
-
- g_value_init (&max_size, G_TYPE_UINT);
- g_object_get_property (G_OBJECT(settings_manager), "image-quality", &max_size);
-
if (window->priv->iter)
image = rstto_navigator_iter_get_image (window->priv->iter);
@@ -790,24 +784,21 @@ cb_rstto_main_window_rotate_cw (GtkWidget *widget, RsttoMainWindow *window)
{
switch (rstto_image_get_orientation (image))
{
+ default:
case RSTTO_IMAGE_ORIENT_NONE:
- rstto_image_set_orientation (image, RSTTO_IMAGE_ORIENT_270);
+ rstto_image_set_orientation (image, RSTTO_IMAGE_ORIENT_90);
break;
case RSTTO_IMAGE_ORIENT_90:
- rstto_image_set_orientation (image, RSTTO_IMAGE_ORIENT_NONE);
+ rstto_image_set_orientation (image, RSTTO_IMAGE_ORIENT_180);
break;
case RSTTO_IMAGE_ORIENT_180:
- rstto_image_set_orientation (image, RSTTO_IMAGE_ORIENT_90);
+ rstto_image_set_orientation (image, RSTTO_IMAGE_ORIENT_270);
break;
case RSTTO_IMAGE_ORIENT_270:
- rstto_image_set_orientation (image, RSTTO_IMAGE_ORIENT_180);
+ rstto_image_set_orientation (image, RSTTO_IMAGE_ORIENT_NONE);
break;
- default:
- g_debug ("O: %d", rstto_image_get_orientation (image));
}
}
-
- g_value_unset (&max_size);
}
/**
@@ -822,12 +813,6 @@ cb_rstto_main_window_rotate_ccw (GtkWidget *widget, RsttoMainWindow *window)
{
RsttoImage *image = NULL;
- RsttoSettings *settings_manager = rstto_settings_new();
- GValue max_size = {0,};
-
- g_value_init (&max_size, G_TYPE_UINT);
- g_object_get_property (G_OBJECT(settings_manager), "image-quality", &max_size);
-
if (window->priv->iter)
image = rstto_navigator_iter_get_image (window->priv->iter);
@@ -835,21 +820,21 @@ cb_rstto_main_window_rotate_ccw (GtkWidget *widget, RsttoMainWindow *window)
{
switch (rstto_image_get_orientation (image))
{
+ default:
case RSTTO_IMAGE_ORIENT_NONE:
- rstto_image_set_orientation (image, RSTTO_IMAGE_ORIENT_90);
+ rstto_image_set_orientation (image, RSTTO_IMAGE_ORIENT_270);
break;
case RSTTO_IMAGE_ORIENT_90:
- rstto_image_set_orientation (image, RSTTO_IMAGE_ORIENT_180);
+ rstto_image_set_orientation (image, RSTTO_IMAGE_ORIENT_NONE);
break;
case RSTTO_IMAGE_ORIENT_180:
- rstto_image_set_orientation (image, RSTTO_IMAGE_ORIENT_270);
+ rstto_image_set_orientation (image, RSTTO_IMAGE_ORIENT_90);
break;
case RSTTO_IMAGE_ORIENT_270:
- rstto_image_set_orientation (image, RSTTO_IMAGE_ORIENT_NONE);
+ rstto_image_set_orientation (image, RSTTO_IMAGE_ORIENT_180);
break;
}
}
- g_value_unset (&max_size);
}
diff --git a/src/picture_viewer.c b/src/picture_viewer.c
index 1f9f50b..c2f4bdf 100644
--- a/src/picture_viewer.c
+++ b/src/picture_viewer.c
@@ -1415,6 +1415,7 @@ rstto_picture_viewer_set_image (RsttoPictureViewer *viewer, RsttoImage *image)
{
rstto_picture_viewer_queued_repaint (viewer, TRUE);
}
+ g_object_unref (settings_manager);
}
/**
More information about the Xfce4-commits
mailing list