[banshee] Clean more cases of 'integer for DB rowid' values (bgo#696520)



commit 998c007e2a681af6b235c2c7bf98b8bc1dec2195
Author: Andrés G. Aragoneses <knocte gmail com>
Date:   Wed Feb 26 23:20:24 2014 +0100

    Clean more cases of 'integer for DB rowid' values (bgo#696520)
    
    The transition from int to long types [1] had some leftovers
    which were working as runtime casts.
    
    [1] https://git.gnome.org/browse/banshee/commit/?id=f847cb0c742b2d993dad71dba373bd81bb457afa

 .../DatabaseImportManager.cs                       |    5 +----
 .../SmartPlaylistQueryValueEntry.cs                |   12 +++++-------
 2 files changed, 6 insertions(+), 11 deletions(-)
---
diff --git a/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseImportManager.cs 
b/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseImportManager.cs
index 8750579..6ae854d 100644
--- a/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseImportManager.cs
+++ b/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseImportManager.cs
@@ -34,13 +34,10 @@ using System.IO;
 using Mono.Unix;
 
 using Hyena;
-using Hyena.Data.Sqlite;
 
-using Banshee.Base;
 using Banshee.Sources;
 using Banshee.Collection;
 using Banshee.Collection.Database;
-using Banshee.Configuration.Schema;
 using Banshee.ServiceStack;
 using Banshee.Streaming;
 
@@ -251,7 +248,7 @@ namespace Banshee.Collection.Database
 
         public void NotifyAllSources ()
         {
-            foreach (int primary_source_id in counts.Keys) {
+            foreach (long primary_source_id in counts.Keys) {
                 PrimarySource.GetById (primary_source_id).NotifyTracksAdded ();
             }
             counts.Clear ();
diff --git a/src/Core/Banshee.ThickClient/Banshee.Query.Gui/SmartPlaylistQueryValueEntry.cs 
b/src/Core/Banshee.ThickClient/Banshee.Query.Gui/SmartPlaylistQueryValueEntry.cs
index f37ba7c..f02bfee 100644
--- a/src/Core/Banshee.ThickClient/Banshee.Query.Gui/SmartPlaylistQueryValueEntry.cs
+++ b/src/Core/Banshee.ThickClient/Banshee.Query.Gui/SmartPlaylistQueryValueEntry.cs
@@ -35,9 +35,7 @@ using Hyena.Query.Gui;
 
 using Banshee.ServiceStack;
 using Banshee.Sources;
-using Banshee.Playlist;
 using Banshee.SmartPlaylist;
-using Banshee.Widgets;
 using Banshee.Query;
 
 namespace Banshee.Query.Gui
@@ -46,8 +44,8 @@ namespace Banshee.Query.Gui
     {
         protected ComboBoxText combo;
         protected SmartPlaylistQueryValue query_value;
-        protected Dictionary<int, int> playlist_id_combo_map = new Dictionary<int, int> ();
-        protected Dictionary<int, int> combo_playlist_id_map = new Dictionary<int, int> ();
+        protected Dictionary<long, int> playlist_id_combo_map = new Dictionary<long, int> ();
+        protected Dictionary<int, long> combo_playlist_id_map = new Dictionary<int, long> ();
 
         public SmartPlaylistQueryValueEntry () : base ()
         {
@@ -61,8 +59,8 @@ namespace Banshee.Query.Gui
                 if (playlist != null && playlist.DbId != null) {
                     if (Editor.CurrentlyEditing == null || (Editor.CurrentlyEditing != playlist && 
!playlist.DependsOn (Editor.CurrentlyEditing))) {
                         combo.AppendText (playlist.Name);
-                        playlist_id_combo_map [(int)playlist.DbId] = count;
-                        combo_playlist_id_map [count++] = (int) playlist.DbId;
+                        playlist_id_combo_map [playlist.DbId.Value] = count;
+                        combo_playlist_id_map [count++] = playlist.DbId.Value;
                     }
                 }
             }
@@ -80,7 +78,7 @@ namespace Banshee.Query.Gui
                 query_value = value as SmartPlaylistQueryValue;
                 if (!query_value.IsEmpty) {
                     try {
-                        combo.Active = playlist_id_combo_map [(int)query_value.IntValue];
+                        combo.Active = playlist_id_combo_map [query_value.IntValue];
                     } catch {}
                 }
 


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