BrowserWindow.vala
[app.webkitpdf] / BrowserWindow.vala
index 60c47b0..7cfbdcd 100644 (file)
@@ -77,8 +77,7 @@ public class BrowserWindow : Object
                 
                              OutputStream ostream = iostream.output_stream;
                              DataOutputStream dostream = new DataOutputStream (ostream);                                            
-                                            dostream.put_string ("%s\tTRUE\t/\t%s\t2147483647\t%s\t%s".printf(uri.get_host(),scheme == "http" ? "FALSE" : "TRUE",cookies[0],cookies[1]));
-                             //dostream.put_string (uri.get_host() + "\tTRUE\t/\t"+ssl+"\t2147483647\t" + cookies[0] + "\t" + cookies[1] );                          
+                                            dostream.put_string ("%s\tTRUE\t/\t%s\t2147483647\t%s\t%s".printf(uri.get_host(),scheme == "http" ? "FALSE" : "TRUE",cookies[0],cookies[1]));                            
                              cookie_manager.set_persistent_storage(file.get_path(), WebKit.CookiePersistentStorage.TEXT);                            
                     } catch (Error e) {
                              stdout.printf ("Error: %s\n", e.message);
@@ -175,6 +174,7 @@ public class BrowserWindow : Object
             // set gobject values
 
             // init method
+            
 
             {
                   this.load_try = 0;
@@ -420,15 +420,19 @@ public class BrowserWindow : Object
         }
         
         public void delete_cookiefile () {
-            print("deleting tmp file %s\n",_this.cookie_file);
-            File file = File.new_for_path (_this.cookie_file);
-                try {
-                    if (file.query_exists () == true) {
-                        file.delete ();                     
+                  // _this -> owner BrowserWindow
+                  // cookie_file is created by BrowserWindow
+                  if(_this.cookie_file.length >0 ){
+                      print("deleting tmp file %s\n",_this.cookie_file);
+                File file = File.new_for_path (_this.cookie_file);
+                    try {
+                        if (file.query_exists () == true) {
+                            file.delete ();                 
+                        }
+                    } catch (Error e) {
+                             stdout.printf ("Error: %s\n", e.message);
                     }
-                } catch (Error e) {
-                         stdout.printf ("Error: %s\n", e.message);
-                }
+                  }            
         }
     }