[pan2] -quick fix for gnome-keyring -few quick cleanups



commit 2728ed8e7a4fcf83e9487fc493ce662715c3b734
Author: Heinrich MÃller <henmull src gnome org>
Date:   Fri Jan 13 01:11:18 2012 +0100

    -quick fix for gnome-keyring
    -few quick cleanups

 pan/data-impl/data-impl.cc |    4 +++-
 pan/data-impl/data-io.cc   |    2 +-
 pan/gui/pan.cc             |    2 +-
 3 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/pan/data-impl/data-impl.cc b/pan/data-impl/data-impl.cc
index 60e76b5..f290035 100644
--- a/pan/data-impl/data-impl.cc
+++ b/pan/data-impl/data-impl.cc
@@ -162,8 +162,10 @@ DataImpl :: password_decrypt (PasswordData* pw) const
     "server", pw->server.c_str(),
     NULL);
 
-  if (pwd) pw->pw = pwd;
+  std::string tmp;
+  if (pwd) tmp = pwd;
   gnome_keyring_free_password(pwd);
+  pw->pw = tmp;
 
   return ret;
 }
diff --git a/pan/data-impl/data-io.cc b/pan/data-impl/data-io.cc
index 0b5c29c..9fd9802 100644
--- a/pan/data-impl/data-io.cc
+++ b/pan/data-impl/data-io.cc
@@ -214,7 +214,7 @@ namespace
 
     const std::string tmpfile (filename + ".tmp");
     if (ok) {
-//      unlink (filename.c_str());
+      remove (filename.c_str());
       if (rename (tmpfile.c_str(), filename.c_str()))
         std::cerr << LINE_ID << " ERROR renaming from [" << tmpfile << "] to [" << filename << "]: " << g_strerror(errno) << '\n';
       if (chmod (filename.c_str(), 0600))
diff --git a/pan/gui/pan.cc b/pan/gui/pan.cc
index 4a5a391..e7820f8 100644
--- a/pan/gui/pan.cc
+++ b/pan/gui/pan.cc
@@ -73,7 +73,7 @@ extern "C" {
   #include <gnome-keyring-1/gnome-keyring-memory.h>
 #endif
 
-#define DEBUG_LOCALE 1
+//#define DEBUG_LOCALE 1
 //#define DEBUG_PARALLEL 1
 
 using namespace pan;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]