X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftrunk%2Fsrc%2Fgtkmm%2Fautorecover.cpp;h=1b55eb4a23edd6e38648f0cfdc6128ea6eaa8b1a;hb=9459638ad6797b8139f1e9f0715c96076dbf0890;hp=4235a19c8d4e5369dad9729c9cfc0e7ac1753827;hpb=837b63e9fb829d66d43f4f169861f8979f76820d;p=synfig.git diff --git a/synfig-studio/trunk/src/gtkmm/autorecover.cpp b/synfig-studio/trunk/src/gtkmm/autorecover.cpp index 4235a19..1b55eb4 100644 --- a/synfig-studio/trunk/src/gtkmm/autorecover.cpp +++ b/synfig-studio/trunk/src/gtkmm/autorecover.cpp @@ -6,6 +6,7 @@ ** ** \legal ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley +** Copyright (c) 2008 Chris Moore ** ** This package is free software; you can redistribute it and/or ** modify it under the terms of the GNU General Public License as @@ -62,6 +63,8 @@ #include #endif +#include "general.h" + #endif /* === U S I N G =========================================================== */ @@ -159,7 +162,7 @@ AutoRecover::get_shadow_file_name(const synfig::String& filename) return Glib::build_filename(get_shadow_directory(),strprintf("%08X-%s",hash1,basename(filename).c_str())); -// return dirname(filename) + ETL_DIRECTORY_SEPERATOR + ".shadow_" + basename(filename); +// return dirname(filename) + ETL_DIRECTORY_SEPARATOR + ".shadow_" + basename(filename); } bool @@ -176,8 +179,8 @@ AutoRecover::cleanup_pid(int pid) { synfig::error("Autobackup seems to have failed! (PID=%d)",pid); } - else - synfig::info("PID=%d has been cleaned up",pid); +// else +// synfig::info("PID=%d has been cleaned up",pid); #endif return false; } @@ -222,8 +225,8 @@ AutoRecover::auto_backup() savecount++; } - if(savecount) - synfig::info("AutoRecover::auto_backup(): %d Files backed up.",savecount); +// if(savecount) +// synfig::info("AutoRecover::auto_backup(): %d Files backed up.",savecount); } catch(...) { @@ -275,10 +278,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; @@ -298,6 +302,8 @@ AutoRecover::recover() // This file isn't saved! mark it as such App::instance_list.back()->inc_action_count(); + + number_recovered++; } else success=false;