[banshee] [SourceManager] Remove duplicate child removing code
- From: Gabriel Burt <gburt src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [banshee] [SourceManager] Remove duplicate child removing code
- Date: Tue, 24 Aug 2010 20:01:14 +0000 (UTC)
commit 29c6296a1618e5d2d255a89b5e6157bc7d8dc995
Author: Gabriel Burt <gabriel burt gmail com>
Date: Tue Aug 24 14:35:20 2010 -0500
[SourceManager] Remove duplicate child removing code
By letting the SourceManager remove the child source in the
ChildSourceRemoved handler, we also get the proxying to main for
SetActiveSource.
.../Banshee.Services/Banshee.Sources/Source.cs | 7 -------
.../Banshee.Sources/SourceManager.cs | 6 +++++-
2 files changed, 5 insertions(+), 8 deletions(-)
---
diff --git a/src/Core/Banshee.Services/Banshee.Sources/Source.cs b/src/Core/Banshee.Services/Banshee.Sources/Source.cs
index a9cbee4..867748f 100644
--- a/src/Core/Banshee.Services/Banshee.Sources/Source.cs
+++ b/src/Core/Banshee.Services/Banshee.Sources/Source.cs
@@ -221,13 +221,6 @@ namespace Banshee.Sources
}
child_sources.Remove (child);
-
- if (ServiceManager.SourceManager.ActiveSource == child) {
- if (CanActivate) {
- ServiceManager.SourceManager.SetActiveSource (this);
- }
- }
-
OnChildSourceRemoved (child);
}
}
diff --git a/src/Core/Banshee.Services/Banshee.Sources/SourceManager.cs b/src/Core/Banshee.Services/Banshee.Sources/SourceManager.cs
index ef35001..542c43f 100644
--- a/src/Core/Banshee.Services/Banshee.Sources/SourceManager.cs
+++ b/src/Core/Banshee.Services/Banshee.Sources/SourceManager.cs
@@ -230,7 +230,11 @@ namespace Banshee.Sources
ThreadAssist.ProxyToMain (delegate {
if(source == active_source) {
- SetActiveSource(default_source);
+ if (source.Parent != null && source.Parent.CanActivate) {
+ SetActiveSource(source.Parent);
+ } else {
+ SetActiveSource(default_source);
+ }
}
SourceEventHandler handler = SourceRemoved;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]