[blam/gtk3] Separate adding a channel from refreshing it
- From: Carlos Martín Nieto <cmartin src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [blam/gtk3] Separate adding a channel from refreshing it
- Date: Mon, 14 Oct 2013 09:58:55 +0000 (UTC)
commit c7dea4f13ac2df2f69df7e932ee04d56c07cbda8
Author: Carlos Martín Nieto <cmn dwim me>
Date: Sun Oct 13 21:20:41 2013 +0200
Separate adding a channel from refreshing it
src/Blam.cs | 11 +++--------
src/ChannelCollection.cs | 9 +--------
src/ChannelList.cs | 6 +++---
3 files changed, 7 insertions(+), 19 deletions(-)
---
diff --git a/src/Blam.cs b/src/Blam.cs
index c276398..e20c7cc 100644
--- a/src/Blam.cs
+++ b/src/Blam.cs
@@ -151,7 +151,7 @@ namespace Blam
});
}
- void addChannel(AddChannelDialog dialog)
+ async void addChannel(AddChannelDialog dialog)
{
var res = dialog.Run();
if (!res)
@@ -162,7 +162,8 @@ namespace Blam
chan.http_username = dialog.Username;
chan.http_password = dialog.Password;
- channels.Add(chan, true);
+ channels.Add(chan);
+ await chan.RefreshAsync();
}
public void Run()
@@ -182,12 +183,6 @@ namespace Blam
args.RetVal = true;
}
- void OnDelete(object sender, DeleteEventArgs args)
- {
- Application.Quit();
- args.RetVal = true;
- }
-
void restoreWindowState()
{
int width, height;
diff --git a/src/ChannelCollection.cs b/src/ChannelCollection.cs
index ca8b877..9dc799a 100644
--- a/src/ChannelCollection.cs
+++ b/src/ChannelCollection.cs
@@ -200,7 +200,7 @@ namespace Imendio.Blam {
}
}
- public async Task Add (IChannel channel, bool update = false)
+ public void Add (IChannel channel)
{
// If we already have this feed, simply return
if (mChannels.Any(channel.Url.Equals))
@@ -211,14 +211,7 @@ namespace Imendio.Blam {
}
ObservableChannels.Add((Channel)channel);
- if (update) {
- var updated = await channel.RefreshAsync();
- if (updated)
- MarkAsDirty();
- }
-
NotifyAdd(channel);
-
}
public void Add(ChannelGroup grp)
diff --git a/src/ChannelList.cs b/src/ChannelList.cs
index a2dc22f..53fa17d 100644
--- a/src/ChannelList.cs
+++ b/src/ChannelList.cs
@@ -313,12 +313,12 @@ namespace Imendio.Blam {
// Add the groups and chanels to the view
foreach (IChannel channel in channels) {
- Collection.Add(channel, false).Wait();
- Add (channel);
+ Collection.Add(channel);
+ Add(channel);
}
foreach (IChannel group in groups) {
- Collection.Add(group, false).Wait();
+ Collection.Add(group);
AddGroup(group);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]