fix date calc
[gitlive] / WindowLog.js
index 1410a5e..62fe24e 100644 (file)
@@ -20,6 +20,8 @@ Gtk = imports.gi.Gtk ;
 Spawn = imports.Spawn;
 File  = imports.File.File;
 GLib        = imports.gi.GLib;
+Gio = imports.gi.Gio;
+
 //Gtk.init(Seed.argv);
 xDate = imports.Date;
 xorg = imports.xorg;
@@ -97,9 +99,10 @@ WindowLog = {
         var time  = ctime.format("H:i:s ")
         
         File.append (path, "\n" +time + str + ' ' + cmd );
-        
+
         // copy to gitlive/gitlog (each user should check out their own gitlog!?
-        if (this.lastcopy && this.lastcopy > ctime.add(Date.HOUR, -1)) {
+        if (this.lastcopy && this.lastcopy > ctime.add(xDate.Date.HOUR, -1)) {
             return;
         }
         this.lastcopy = ctime;
@@ -109,7 +112,7 @@ WindowLog = {
         if (!File.isDirectory(cpdir)) {
            File.mkdir(cpdir,true);
         }
-        File.copy(path, cpdir + fname );
+        File.copy(path, cpdir + fname, Gio.FileCopyFlags.OVERWRITE );
         
         
     }