[blam] ItemStore: Save when saving ChannelCollection



commit dec408a701681847cc490c14c0ad82a29bd18626
Author: Carlos Martín Nieto <carlos cmartin tk>
Date:   Sat Sep 18 22:08:49 2010 +0100

    ItemStore: Save when saving ChannelCollection

 src/Application.cs       |    1 +
 src/ChannelCollection.cs |    1 +
 src/ItemStore.cs         |    6 +++++-
 3 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/src/Application.cs b/src/Application.cs
index 6b80475..26a00a3 100644
--- a/src/Application.cs
+++ b/src/Application.cs
@@ -552,6 +552,7 @@ namespace Imendio.Blam {
             SaveWindowState();
             mainWindow.Hide();
             mCollection.SaveToFile ();
+            ItemStore.Save();
             mCollection.StopAllThreads();
 
             Quit();
diff --git a/src/ChannelCollection.cs b/src/ChannelCollection.cs
index 543bcf5..b1e5ee0 100644
--- a/src/ChannelCollection.cs
+++ b/src/ChannelCollection.cs
@@ -357,6 +357,7 @@ namespace Imendio.Blam {
 	private bool WriteTimeoutHandler ()
 	{
 	    SaveToFile ();
+            ItemStore.Save();
 	    
 	    return false;
 	}
diff --git a/src/ItemStore.cs b/src/ItemStore.cs
index 0c75e07..3112816 100644
--- a/src/ItemStore.cs
+++ b/src/ItemStore.cs
@@ -55,8 +55,12 @@ namespace Imendio.Blam
             }
         }
 
-        private static void Save()
+        public static void Save()
         {
+            if(instance == null){
+                return;
+            }
+
             Stream writer = new FileStream(itemfile, FileMode.Create);
             serializer.Serialize(writer, instance);
         }



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