From 87c251c72e14e0719942d3308079d84e72ea245f Mon Sep 17 00:00:00 2001 From: handa Date: Sun, 7 Jun 2009 22:44:45 +0000 Subject: [PATCH] *** empty log message *** --- MDatabase.cs | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/MDatabase.cs b/MDatabase.cs index 83c3db2..a532b96 100644 --- a/MDatabase.cs +++ b/MDatabase.cs @@ -514,6 +514,7 @@ namespace M17N.Core for (int i = 0; i < mdbs.Count; i++) if (mdbs[i].ListIndex == mdb.ListIndex) { + mdbs[i].DBStatus = MDBStatus.INVALID; mdbs[i] = mdb; return; @@ -538,16 +539,14 @@ namespace M17N.Core for (int i = 0; i < mdbs.Count; i++) { mdb = mdbs[i]; - if (mdb.ListIndex == list_idx - && (dir_idx > 0 && dir_idx <= mdb.DirIndex)) + if (mdb.ListIndex == list_idx) { if (mdb.DBStatus == MDBStatus.INVALID) M17n.DebugPrint ("registering: {0}\n", mdb); else M17n.DebugPrint ("updating: {0}\n", mdb); - if (mdb.DBStatus != MDBStatus.DISABLED) - mdb.DBStatus = (dir_idx < 0 - ? MDBStatus.NOT_READY : MDBStatus.READY); + mdb.DBType = dir_idx == -1 ? MDBType.AUTO : MDBType.MULTIPLE; + mdb.DBStatus = MDBStatus.NOT_READY; mdb.DirIndex = dir_idx; mdb.Info = info; return; @@ -749,8 +748,27 @@ namespace M17N.Core mdb.expand_wildcard (); } - private bool check_file () + private bool update_status () { + if (DBType == MDBType.UNKNOWN) + return true; + if (DBStatus == MDBStatus.READY + && FileInfo != null) + { + FileInfo.Refresh (); + if (CheckedTime >= FileInfo.LastWriteTime) + return true; + + + { + FileInfo[] files + = DBDirs[DirIndex].DirInfo.GetFiles (Info.Filename); + if (files.Count > 0) + FileInfo = files[0]; + } + + } + if (DBDirs[DirIndex].DirInfo == null) return false; FileInfo[] files = DBDirs[DirIndex].DirInfo.GetFiles (Info.Filename); -- 1.7.10.4