[banshee/gtk3] Fix (almost) all warnings (update hyena to HEAD too)
- From: Andrés Aragoneses <aaragoneses src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [banshee/gtk3] Fix (almost) all warnings (update hyena to HEAD too)
- Date: Sat, 24 Aug 2013 12:28:08 +0000 (UTC)
commit 8b803fdac0d620b38f92cea4318e070b9604ece0
Author: Andrés G. Aragoneses <knocte gmail com>
Date: Sat Aug 24 14:27:40 2013 +0200
Fix (almost) all warnings (update hyena to HEAD too)
Only warning left (to be able to enable WarnAsErrors back) is the version
conflict of glib-sharp 2.12 vs 3.0 whose culprit lies in GConfSharp, I
believe.
.../Banshee.CairoGlyphs/BansheeLineLogo.cs | 4 +-
.../Banshee.Collection.Gui/ArtworkRenderer.cs | 18 ++++++++--------
.../Banshee.Collection.Gui/ColumnCellAlbum.cs | 4 +-
.../Banshee.Collection.Gui/ColumnCellTrack.cs | 2 +-
.../Banshee.Gui.Widgets/ClassicTrackInfoDisplay.cs | 2 +-
.../Banshee.Gui.Widgets/LargeTrackInfoDisplay.cs | 21 ++++++++++---------
.../Banshee.Sources.Gui/SourceRowRenderer.cs | 4 +-
.../Banshee.Widgets/DiscUsageDisplay.cs | 20 +++++++++---------
.../Banshee.NowPlaying/OverlayWindow.cs | 8 +++---
.../Banshee.NowPlaying/VideoDisplay.cs | 10 ++++----
.../Banshee.Podcasting.Gui/ColumnCellPodcast.cs | 4 +-
src/Hyena | 2 +-
12 files changed, 50 insertions(+), 49 deletions(-)
---
diff --git a/src/Core/Banshee.ThickClient/Banshee.CairoGlyphs/BansheeLineLogo.cs
b/src/Core/Banshee.ThickClient/Banshee.CairoGlyphs/BansheeLineLogo.cs
index 3ea41b4..f2efd0c 100644
--- a/src/Core/Banshee.ThickClient/Banshee.CairoGlyphs/BansheeLineLogo.cs
+++ b/src/Core/Banshee.ThickClient/Banshee.CairoGlyphs/BansheeLineLogo.cs
@@ -84,14 +84,14 @@ namespace Banshee.CairoGlyphs
cr.LineJoin = LineJoin.Round;
// inner 'b' note
- cr.Color = innerColor;
+ cr.SetSourceColor (innerColor);
cr.MoveTo (0, 2);
cr.LineTo (2, 0);
cr.Arc (4, 8, 2, Math.PI, Math.PI * 3);
cr.Stroke ();
// outer 'cut' circle
- cr.Color = outerColor;
+ cr.SetSourceColor (outerColor);
cr.Arc (4, 8, 4, Math.PI * 1.5, Math.PI * 1.12);
cr.Stroke ();
diff --git a/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ArtworkRenderer.cs
b/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ArtworkRenderer.cs
index f1ce05c..698d13c 100644
--- a/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ArtworkRenderer.cs
+++ b/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ArtworkRenderer.cs
@@ -74,7 +74,7 @@ namespace Banshee.Collection.Gui
if (image != null) {
if (fill) {
CairoExtensions.RoundedRectangle (cr, x, y, width, height, radius, corners);
- cr.Color = fillColor;
+ cr.SetSourceColor (fillColor);
cr.Fill ();
}
@@ -85,12 +85,12 @@ namespace Banshee.Collection.Gui
CairoExtensions.RoundedRectangle (cr, x, y, width, height, radius, corners);
if (fill) {
- var grad = new LinearGradient (x, y, x, y + height);
- grad.AddColorStop (0, fillColor);
- grad.AddColorStop (1, CairoExtensions.ColorShade (fillColor, 1.3));
- cr.Pattern = grad;
- cr.Fill ();
- grad.Destroy ();
+ using (var grad = new LinearGradient (x, y, x, y + height)) {
+ grad.AddColorStop (0, fillColor);
+ grad.AddColorStop (1, CairoExtensions.ColorShade (fillColor, 1.3));
+ cr.SetSource (grad);
+ cr.Fill ();
+ }
}
Banshee.CairoGlyphs.BansheeLineLogo.Render (cr,
@@ -112,12 +112,12 @@ namespace Banshee.Collection.Gui
cr.Antialias = Antialias.None;
CairoExtensions.RoundedRectangle (cr, x + 1.5, y + 1.5, width - 3, height - 3, radius,
corners);
- cr.Color = cover_border_light_color;
+ cr.SetSourceColor (cover_border_light_color);
cr.Stroke ();
}
CairoExtensions.RoundedRectangle (cr, x + 0.5, y + 0.5, width - 1, height - 1, radius, corners);
- cr.Color = cover_border_dark_color;
+ cr.SetSourceColor (cover_border_dark_color);
cr.Stroke ();
if (dispose && image != null) {
diff --git a/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ColumnCellAlbum.cs
b/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ColumnCellAlbum.cs
index 89063fb..507c01c 100644
--- a/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ColumnCellAlbum.cs
+++ b/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ColumnCellAlbum.cs
@@ -136,7 +136,7 @@ namespace Banshee.Collection.Gui
// Render the second line first since we have that state already
if (!String.IsNullOrEmpty (album.ArtistName)) {
context.Context.MoveTo (x, y + fl_height);
- context.Context.Color = text_color;
+ context.Context.SetSourceColor (text_color);
PangoCairoHelper.ShowLayout (context.Context, layout);
}
@@ -150,7 +150,7 @@ namespace Banshee.Collection.Gui
context.Context.MoveTo (x, y);
text_color.A = 1;
- context.Context.Color = text_color;
+ context.Context.SetSourceColor (text_color);
PangoCairoHelper.ShowLayout (context.Context, layout);
}
diff --git a/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ColumnCellTrack.cs
b/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ColumnCellTrack.cs
index c358ed3..8d8b414 100644
--- a/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ColumnCellTrack.cs
+++ b/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ColumnCellTrack.cs
@@ -83,7 +83,7 @@ namespace Banshee.Collection.Gui
Cairo.Color color = CairoExtensions.GdkRGBAToCairoColor (context.Widget.StyleContext.GetColor
(StateFlags.Selected));
context.Widget.StyleContext.Restore ();
color.A = (!context.Opaque) ? 0.3 : 1.0;
- context.Context.Color = color;
+ context.Context.SetSourceColor (color);
PangoCairoHelper.ShowLayout (context.Context, context.Layout);
}
diff --git a/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/ClassicTrackInfoDisplay.cs
b/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/ClassicTrackInfoDisplay.cs
index e052b68..1fdb6e8 100644
--- a/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/ClassicTrackInfoDisplay.cs
+++ b/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/ClassicTrackInfoDisplay.cs
@@ -212,7 +212,7 @@ namespace Banshee.Gui.Widgets
if (renderTrack) {
cr.MoveTo (x, y);
- cr.Color = TextColor;
+ cr.SetSourceColor (TextColor);
PangoCairoHelper.ShowLayout (cr, first_line_layout);
}
diff --git a/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/LargeTrackInfoDisplay.cs
b/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/LargeTrackInfoDisplay.cs
index 7209f3c..da6a7b1 100644
--- a/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/LargeTrackInfoDisplay.cs
+++ b/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/LargeTrackInfoDisplay.cs
@@ -129,7 +129,7 @@ namespace Banshee.Gui.Widgets
}
cr.Rectangle (x, y, asr, alloc.Height);
- cr.Color = BackgroundColor;
+ cr.SetSourceColor (BackgroundColor);
cr.Fill ();
x += (asr - surface_w) / 2;
@@ -141,7 +141,8 @@ namespace Banshee.Gui.Widgets
private Surface CreateScene (Cairo.Context window_cr, ImageSurface image, int reflect)
{
- Surface surface = window_cr.Target.CreateSimilar (window_cr.Target.Content,
+ var target = window_cr.GetTarget ();
+ Surface surface = target.CreateSimilar (target.Content,
image.Width, image.Height + reflect);
using (var cr = new Context (surface)) {
@@ -166,14 +167,14 @@ namespace Banshee.Gui.Widgets
Color bg_transparent = BackgroundColor;
bg_transparent.A = 0.65;
- LinearGradient mask = new LinearGradient (0, image.Height, 0, image.Height + reflect);
- mask.AddColorStop (0, bg_transparent);
- mask.AddColorStop (1, BackgroundColor);
+ using (var mask = new LinearGradient (0, image.Height, 0, image.Height + reflect)) {
+ mask.AddColorStop (0, bg_transparent);
+ mask.AddColorStop (1, BackgroundColor);
- cr.Rectangle (0, image.Height, image.Width, reflect);
- cr.SetSource (mask);
- cr.Fill ();
- mask.Destroy ();
+ cr.Rectangle (0, image.Height, image.Width, reflect);
+ cr.SetSource (mask);
+ cr.Fill ();
+ }
}
return surface;
@@ -255,7 +256,7 @@ namespace Banshee.Gui.Widgets
if (render_track) {
cr.MoveTo (track_info_alloc.X, track_info_alloc.Y);
- cr.Color = TextColor;
+ cr.SetSourceColor (TextColor);
PangoCairoHelper.ShowLayout (cr, first_line_layout);
RenderTrackRating (cr, track);
diff --git a/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceRowRenderer.cs
b/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceRowRenderer.cs
index 96e10e8..6ba962c 100644
--- a/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceRowRenderer.cs
+++ b/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceRowRenderer.cs
@@ -268,9 +268,9 @@ namespace Banshee.Sources.Gui
// Draw the count
if (!hide_count) {
if (view != null) {
- cr.Color = state == StateFlags.Normal || (view != null && state == StateFlags.Prelight)
+ cr.SetSourceColor (state == StateFlags.Normal || (view != null && state ==
StateFlags.Prelight)
? view.Theme.TextMidColor
- : CairoExtensions.GdkRGBAToCairoColor (view.Theme.Widget.StyleContext.GetColor
(state));
+ : CairoExtensions.GdkRGBAToCairoColor (view.Theme.Widget.StyleContext.GetColor
(state)));
cr.MoveTo (
cell_area.X + cell_area.Width - count_layout_width - 2,
diff --git a/src/Core/Banshee.Widgets/Banshee.Widgets/DiscUsageDisplay.cs
b/src/Core/Banshee.Widgets/Banshee.Widgets/DiscUsageDisplay.cs
index ec8dc77..d76c68c 100644
--- a/src/Core/Banshee.Widgets/Banshee.Widgets/DiscUsageDisplay.cs
+++ b/src/Core/Banshee.Widgets/Banshee.Widgets/DiscUsageDisplay.cs
@@ -125,7 +125,7 @@ namespace Banshee.Widgets
cr.LineWidth = base_line_width / 1.5;
cr.Arc(x, y, radius, 0, 2 * Math.PI);
- cr.Pattern = bg_gradient;
+ cr.SetSource (bg_gradient);
cr.Fill();
/*cr.LineTo(x, y);
@@ -144,31 +144,31 @@ namespace Banshee.Widgets
cr.Arc(x, y, radius, 0, 2 * Math.PI);
}
- cr.Pattern = Fraction >= 1.0 ? fg_gradient_full : fg_gradient;
+ cr.SetSource (Fraction >= 1.0 ? fg_gradient_full : fg_gradient);
cr.FillPreserve();
- cr.Color = stroke_color;
+ cr.SetSourceColor (stroke_color);
cr.Stroke();
}
cr.Arc(x, y, radius / 2.75, 0, 2 * Math.PI);
- cr.Color = fill_color_c;
+ cr.SetSourceColor (fill_color_c);
cr.FillPreserve();
- cr.Color = new Cairo.Color(1, 1, 1, 0.75);
+ cr.SetSourceColor (new Cairo.Color(1, 1, 1, 0.75));
cr.FillPreserve();
cr.LineWidth = base_line_width / 1.5;
- cr.Color = stroke_color;
+ cr.SetSourceColor (stroke_color);
cr.Stroke();
cr.Arc(x, y, radius / 5.5, 0, 2 * Math.PI);
- cr.Color = fill_color_c;
+ cr.SetSourceColor (fill_color_c);
cr.FillPreserve();
cr.LineWidth = base_line_width / 2;
- cr.Color = inner_stroke_color;
+ cr.SetSourceColor (inner_stroke_color);
cr.Stroke();
cr.Arc(x, y, radius, 0, 2 * Math.PI);
@@ -177,11 +177,11 @@ namespace Banshee.Widgets
if(Capacity <= 0) {
// this sucks balls
cr.Rectangle(0, 0, Allocation.Width, Allocation.Height);
- cr.Color = text_bg_color;
+ cr.SetSourceColor (text_bg_color);
cr.FillPreserve();
cr.SelectFontFace("Sans", FontSlant.Normal, FontWeight.Bold);
- cr.Color = text_color;
+ cr.SetSourceColor (text_color);
cr.SetFontSize(Allocation.Width * 0.2);
DrawText(cr, Mono.Unix.Catalog.GetString("Insert\nDisc"), 3);
}
diff --git a/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/OverlayWindow.cs
b/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/OverlayWindow.cs
index ee25b54..4ddf305 100644
--- a/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/OverlayWindow.cs
+++ b/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/OverlayWindow.cs
@@ -158,10 +158,10 @@ namespace Banshee.NowPlaying
protected virtual void ShapeSurface (Cairo.Context cr, Cairo.Color color)
{
cr.Operator = Cairo.Operator.Source;
- Cairo.Pattern pattern = new Cairo.SolidPattern (color, false);
- cr.Source = pattern;
- pattern.Destroy ();
- cr.Paint ();
+ using (var pattern = new Cairo.SolidPattern (color, false)) {
+ cr.SetSource (pattern);
+ cr.Paint ();
+ }
}
private void ShapeWindow ()
diff --git a/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/VideoDisplay.cs
b/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/VideoDisplay.cs
index ef8e785..b34f336 100644
--- a/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/VideoDisplay.cs
+++ b/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/VideoDisplay.cs
@@ -67,11 +67,11 @@ namespace Banshee.NowPlaying
protected override bool OnDrawn (Cairo.Context cr)
{
// We want to draw on RenderWindow so we need another Cairo.Context
- Cairo.Context cr_window = Gdk.CairoHelper.Create (RenderWindow);
- cr_window.SetSourceRGB (0.0, 0.0, 0.0);
- cr_window.Rectangle (0, 0, Allocation.Width, Allocation.Height);
- cr_window.Paint ();
- ((IDisposable)cr_window).Dispose ();
+ using (var cr_window = Gdk.CairoHelper.Create (RenderWindow)) {
+ cr_window.SetSourceRGB (0.0, 0.0, 0.0);
+ cr_window.Rectangle (0, 0, Allocation.Width, Allocation.Height);
+ cr_window.Paint ();
+ }
if (RenderWindow == null || !RenderWindow.IsVisible) {
return true;
diff --git a/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Gui/ColumnCellPodcast.cs
b/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Gui/ColumnCellPodcast.cs
index 9ee1828..d84618b 100644
--- a/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Gui/ColumnCellPodcast.cs
+++ b/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Gui/ColumnCellPodcast.cs
@@ -129,7 +129,7 @@ namespace Banshee.Podcasting.Gui
// Render the second line first since we have that state already
if (feed.DbId > 0) {
context.Context.MoveTo (x, y + fl_height);
- context.Context.Color = text_color;
+ context.Context.SetSourceColor (text_color);
PangoCairoHelper.ShowLayout (context.Context, layout);
}
@@ -143,7 +143,7 @@ namespace Banshee.Podcasting.Gui
context.Context.MoveTo (x, y);
text_color.A = 1;
- context.Context.Color = text_color;
+ context.Context.SetSourceColor (text_color);
PangoCairoHelper.ShowLayout (context.Context, layout);
}
diff --git a/src/Hyena b/src/Hyena
index 0745bfb..650ddcb 160000
--- a/src/Hyena
+++ b/src/Hyena
@@ -1 +1 @@
-Subproject commit 0745bfb75809886925dfa49a57c79e5f71565d08
+Subproject commit 650ddcb0e9eb88d51fbaca7b8b0733cff1c17352
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]