Count the number of files we were able to successfully recover.
authordooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Thu, 7 Feb 2008 09:32:29 +0000 (09:32 +0000)
committerdooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Thu, 7 Feb 2008 09:32:29 +0000 (09:32 +0000)
git-svn-id: http://svn.voria.com/code@1614 1f10aa63-cdf2-0310-b900-c93c546f37ac

synfig-studio/trunk/src/gtkmm/autorecover.cpp
synfig-studio/trunk/src/gtkmm/autorecover.h

index ed30406..339fba7 100644 (file)
@@ -277,10 +277,11 @@ AutoRecover::recovery_needed()const
 }
 
 bool
-AutoRecover::recover()
+AutoRecover::recover(int& number_recovered)
 {
        std::string filename=App::get_config_file("autorecovery");
        std::ifstream file(filename.c_str());
+       number_recovered = 0;
        if(!file)
                return false;
        bool success=true;
@@ -300,6 +301,8 @@ AutoRecover::recover()
 
                        // This file isn't saved! mark it as such
                        App::instance_list.back()->inc_action_count();
+
+                       number_recovered++;
                }
                else
                        success=false;
index 7375dd9..8d744bd 100644 (file)
@@ -60,7 +60,7 @@ public:
        static synfig::String get_shadow_directory();
 
        bool recovery_needed()const;
-       bool recover();
+       bool recover(int& number_recovered);
 
        void normal_shutdown();