diff src/update.cpp @ 20:226774bf49fc

Small fix.
author pyon@macmini
date Mon, 08 Dec 2014 19:47:42 +0900
parents 1ba97995f642
children
line wrap: on
line diff
--- a/src/update.cpp	Sun Dec 07 20:48:05 2014 +0900
+++ b/src/update.cpp	Mon Dec 08 19:47:42 2014 +0900
@@ -1,9 +1,9 @@
 // Filename   : update.cpp
-// Last Change: 19-Jun-2014.
+// Last Change: 08-Dec-2014.
 
 #include "update.h"
 
-void CheckNewFiles( wxString shared )
+int CheckNewFiles( wxString shared )
 {
     // index
     wxString cfile = wxGetCwd() + wxFILE_SEP_PATH + wxT("db") + wxFILE_SEP_PATH + wxT("ccn.db");
@@ -12,6 +12,10 @@
 
     wxString nfile = shared + wxFILE_SEP_PATH + wxT("ccn.db");
     fn.Assign( nfile );
+    if ( !fn.IsFileReadable() ) {
+        wxMessageBox( wxT("共有ファイルにアクセスできなかったので終了します。") );
+        return 1;
+    }
     wxDateTime nt = fn.GetModificationTime();
 
     if ( nt - ct > wxTimeSpan::Week() ) {
@@ -44,6 +48,8 @@
         if ( ct - nt > wxTimeSpan::Day() )
             PutFile( nfile, cfile );
     }
+
+    return 0;
 }
 
 void GetFile( wxString target, wxString newfile )