[Prime-cvs] CVS update: prime/lib/engine

Back to archive index

Hiroyuki Komatsu komat****@users*****
2005年 2月 24日 (木) 14:27:54 JST


Index: prime/lib/engine/engine-personaldict.rb
diff -u prime/lib/engine/engine-personaldict.rb:1.2 prime/lib/engine/engine-personaldict.rb:1.2.4.1
--- prime/lib/engine/engine-personaldict.rb:1.2	Fri Mar 26 02:19:50 2004
+++ prime/lib/engine/engine-personaldict.rb	Thu Feb 24 14:27:54 2005
@@ -1,5 +1,5 @@
 # prime/engine/engine-personaldict.rb
-# $Id: engine-personaldict.rb,v 1.2 2004/03/25 17:19:50 komatsu Exp $
+# $Id: engine-personaldict.rb,v 1.2.4.1 2005/02/24 05:27:54 komatsu Exp $
 #
 # Copyright (C) 2004 Hiroyuki Komatsu <komat****@taiya*****>
 #     All rights reserved.
@@ -31,19 +31,25 @@
   def initialize_dict ()
     flag_create = false
 
+    ## @dict_file is defined in the parent class PrimeEngineSary,
+    ## its value should be @dict_dir + '/' + @dict_name.
     if File::exist?(@dict_file) then
       mtime = File::mtime(@dict_file)
-      Dir::foreach(@src_dir) {|src_dict|
-        if src_dict =~ /.dict$/ and 
-            File::mtime(@src_dir + '/' + src_dict) > mtime then
-          flag_create = true
-          break
-        end
-      }
     else
-      flag_create = true
+      ## The below mtime means a sentinel.
+      mtime = Time::now()
     end
 
+    Dir::foreach(@src_dir) { | src_dict |
+      ## Matching the filename src_dict with (.dict|.skkdict|.cannadict)
+      ## and comparing the timestamp with the index file.
+      if src_dict =~ /dict$/ and 
+          File::mtime(@src_dir + '/' + src_dict) > mtime then
+        flag_create = true
+        break
+      end
+    }
+
     ## FIXME: Move the following codes to prime-dict-convert.
     ## FIXME: <komat****@taiya*****> (2004-02-06)
     if flag_create then
@@ -72,6 +78,7 @@
           File::rename(tmp_dir + '/' + file, @dict_dir + '/' + file)
         end
       }
+      ## This might exec the command "prime-refresh".
       system("#{PRIME_COMMAND_REFRESH}")
     end
 
Index: prime/lib/engine/engine-userdict2.rb
diff -u prime/lib/engine/engine-userdict2.rb:1.1.2.3 prime/lib/engine/engine-userdict2.rb:1.1.2.4
--- prime/lib/engine/engine-userdict2.rb:1.1.2.3	Tue Jun  1 15:41:27 2004
+++ prime/lib/engine/engine-userdict2.rb	Thu Feb 24 14:27:54 2005
@@ -1,5 +1,5 @@
 # prime/engine/engine-userdict2.rb
-# $Id: engine-userdict2.rb,v 1.1.2.3 2004/06/01 06:41:27 komatsu Exp $
+# $Id: engine-userdict2.rb,v 1.1.2.4 2005/02/24 05:27:54 komatsu Exp $
 #
 # Copyright (C) 2002 Hiroyuki Komatsu <komat****@taiya*****>
 #     All rights reserved.
@@ -37,6 +37,10 @@
     initialize_log()
 
     @max_candidates = 10
+
+    ## FIXME: To make this a singleton class, the following values are 
+    ## FIXME: ideally set on each session.
+    ## FIXME: (2005-02-21) <Hiroyuki Komatsu>
     @last_context_literal = ""
     @last_context_index   = nil
   end


Prime-cvs メーリングリストの案内
Back to archive index