[f-spot] fix some compilation warnings
- From: Stephane Delcroix <sdelcroix src gnome org>
- To: svn-commits-list gnome org
- Subject: [f-spot] fix some compilation warnings
- Date: Tue, 16 Jun 2009 04:00:20 -0400 (EDT)
commit 6c88a875c427a773a53b86f0390d0447d2c359a5
Author: Stephane Delcroix <stephane delcroix org>
Date: Tue Jun 16 09:47:39 2009 +0200
fix some compilation warnings
src/Widgets/CheckPattern.cs | 12 ++++++++++++
src/Widgets/ImageView.cs | 14 +++++---------
2 files changed, 17 insertions(+), 9 deletions(-)
---
diff --git a/src/Widgets/CheckPattern.cs b/src/Widgets/CheckPattern.cs
index 53fa5eb..79f6444 100644
--- a/src/Widgets/CheckPattern.cs
+++ b/src/Widgets/CheckPattern.cs
@@ -79,6 +79,18 @@ namespace FSpot.Widgets
(left.color1 != left.color2 && left.check_size != right.check_size);
}
+ public override int GetHashCode ()
+ {
+ return (int)color1 ^ (int)color2 ^ check_size;
+ }
+
+ public override bool Equals (object other)
+ {
+ if (!(other is CheckPattern))
+ return false;
+ return this == (CheckPattern)other;
+ }
+
static uint s_to_h (string color)
{
return (uint)(Byte.Parse (color.Substring (1,2), System.Globalization.NumberStyles.AllowHexSpecifier) << 16) +
diff --git a/src/Widgets/ImageView.cs b/src/Widgets/ImageView.cs
index 1b7593b..9209b4f 100644
--- a/src/Widgets/ImageView.cs
+++ b/src/Widgets/ImageView.cs
@@ -550,7 +550,6 @@ namespace FSpot.Widgets
(evnt.Direction == ScrollDirection.Left) ? -x_incr : (evnt.Direction == ScrollDirection.Right) ? x_incr : 0);
return true;
}
- return base.OnScrollEvent (evnt);
}
protected override bool OnKeyPressEvent (EventKey key)
@@ -811,7 +810,6 @@ namespace FSpot.Widgets
void OnSelectionUnrealized ()
{
- selection_gc.Unref ();
selection_gc = null;
}
@@ -821,10 +819,10 @@ namespace FSpot.Widgets
return false;
Rectangle win_selection = ImageCoordsToWindow (selection);
- Region r = new Region ();
- r.UnionWithRect (win_selection);
- evnt.Region.Subtract (r);
- r.Destroy ();
+ using (Region r = new Region ()) {
+ r.UnionWithRect (win_selection);
+ evnt.Region.Subtract (r);
+ }
using (Cairo.Context ctx = CairoHelper.Create (GdkWindow)) {
ctx.SetSourceRGBA (.5, .5, .5, .7);
@@ -862,11 +860,9 @@ namespace FSpot.Widgets
if (evnt.Button != 1)
return false;
- if (evnt.Type == EventType.TwoButtonPress) {
+ if (evnt.Type == EventType.TwoButtonPress)
return false;
- }
- bool is_new_selection;
Point img = WindowCoordsToImage (new Point ((int)evnt.X, (int)evnt.Y));
switch (GetDragMode ((int)evnt.X, (int)evnt.Y)) {
case DragMode.None:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]