[banshee] InternetRadioSource: code cleanup



commit 7a02f3c96983c9600e154da5ff82468f6862921c
Author: Andrés G. Aragoneses <knocte gmail com>
Date:   Mon May 5 14:15:26 2014 +0200

    InternetRadioSource: code cleanup
    
    - Remove unused usings.
    - Shorten a very long line.
    - Switch to lambda delegate syntax.
    - Remove unnecessary if-else blocks.

 .../Banshee.InternetRadio/InternetRadioSource.cs   |   18 ++++--------------
 1 files changed, 4 insertions(+), 14 deletions(-)
---
diff --git a/src/Extensions/Banshee.InternetRadio/Banshee.InternetRadio/InternetRadioSource.cs 
b/src/Extensions/Banshee.InternetRadio/Banshee.InternetRadio/InternetRadioSource.cs
index 8267cb8..f4b0e00 100644
--- a/src/Extensions/Banshee.InternetRadio/Banshee.InternetRadio/InternetRadioSource.cs
+++ b/src/Extensions/Banshee.InternetRadio/Banshee.InternetRadio/InternetRadioSource.cs
@@ -33,13 +33,11 @@ using Gtk;
 
 using Hyena;
 
-using Banshee.Base;
 using Banshee.Sources;
 using Banshee.Streaming;
 using Banshee.ServiceStack;
 using Banshee.Collection;
 using Banshee.Collection.Database;
-using Banshee.Configuration;
 using Banshee.PlaybackController;
 
 using Banshee.Gui;
@@ -138,7 +136,7 @@ namespace Banshee.InternetRadio
             ServiceManager.PlayerEngine.TrackIntercept += OnPlayerEngineTrackIntercept;
             //ServiceManager.PlayerEngine.ConnectEvent (OnTrackInfoUpdated, 
Banshee.MediaEngine.PlayerEvent.TrackInfoUpdated);
 
-            TrackEqualHandler = delegate (DatabaseTrackInfo a, TrackInfo b) {
+            TrackEqualHandler = (DatabaseTrackInfo a, TrackInfo b) => {
                 RadioTrackInfo radio_track = b as RadioTrackInfo;
                 return radio_track != null && DatabaseTrackInfo.TrackEqual (
                     radio_track.ParentTrack as DatabaseTrackInfo, a);
@@ -159,7 +157,7 @@ namespace Banshee.InternetRadio
 
         protected override IEnumerable<IFilterListModel> CreateFiltersFor (DatabaseSource src)
         {
-            DatabaseQueryFilterModel<string> genre_model = new DatabaseQueryFilterModel<string> (src, 
src.DatabaseTrackModel, ServiceManager.DbConnection,
+            var genre_model = new DatabaseQueryFilterModel<string> (src, src.DatabaseTrackModel, 
ServiceManager.DbConnection,
                         Catalog.GetString ("All Genres ({0})"), src.UniqueId, 
Banshee.Query.BansheeQuery.GenreField, "Genre");
 
             if (this == src) {
@@ -302,21 +300,13 @@ namespace Banshee.InternetRadio
                 }
             }
             RadioTrackInfo radio_track = ServiceManager.PlaybackController.CurrentTrack as RadioTrackInfo;
-            if (radio_track != null && radio_track.PlayNextStream ()) {
-                return true;
-            } else {
-                return false;
-            }
+            return radio_track != null && radio_track.PlayNextStream ();
         }
 
         public bool Previous (bool restart)
         {
             RadioTrackInfo radio_track = ServiceManager.PlaybackController.CurrentTrack as RadioTrackInfo;
-            if (radio_track != null && radio_track.PlayPreviousStream ()) {
-                return true;
-            } else {
-                return false;
-            }
+            return radio_track != null && radio_track.PlayPreviousStream ();
         }
 
         #endregion


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]