[pan2] patch from Steve Davies (thanks!)



commit c2cf461fa59aa174a39f89521772d941df644f2d
Author: Heinrich MÃller <henmull src gnome org>
Date:   Tue Jun 19 06:58:10 2012 +0200

    patch from Steve Davies (thanks!)

 pan/data-impl/data-impl.h        |    3 ++-
 pan/data-impl/data-io.cc         |    4 +++-
 pan/data/cert-store.cc           |    3 ++-
 pan/gui/body-pane.cc             |    5 -----
 pan/gui/gui.cc                   |    3 +--
 pan/gui/header-pane.cc           |    1 +
 pan/gui/header-pane.h            |    1 +
 pan/gui/server-ui.cc             |    3 ++-
 pan/tasks/socket-impl-openssl.cc |   15 +++++++--------
 9 files changed, 19 insertions(+), 19 deletions(-)
---
diff --git a/pan/data-impl/data-impl.h b/pan/data-impl/data-impl.h
index 5859bd6..9f8faa6 100644
--- a/pan/data-impl/data-impl.h
+++ b/pan/data-impl/data-impl.h
@@ -27,6 +27,7 @@
 #include <vector>
 #include <deque>
 
+#include <pan/tasks/queue.h>
 #include <pan/general/quark.h>
 #include <pan/general/macros.h>
 #include <pan/general/map-vector.h>
@@ -38,7 +39,7 @@
 #include <pan/data/article-cache.h>
 #include <pan/data/encode-cache.h>
 #include <pan/data/data.h>
-#include <pan/tasks/queue.h>
+
 #include <pan/data-impl/data-io.h>
 #include <pan/data-impl/article-filter.h>
 #include <pan/data-impl/rules-filter.h>
diff --git a/pan/data-impl/data-io.cc b/pan/data-impl/data-io.cc
index 17398b2..8f3aa8f 100644
--- a/pan/data-impl/data-io.cc
+++ b/pan/data-impl/data-io.cc
@@ -202,7 +202,9 @@ namespace
 
     const std::string tmpfile (filename + ".tmp");
     if (ok) {
-      remove (filename.c_str());
+#if defined(G_OS_WIN32)
+      ::remove (filename.c_str());
+#endif
       int ret = 0;
       if ((ret = rename (tmpfile.c_str(), filename.c_str())))
       {
diff --git a/pan/data/cert-store.cc b/pan/data/cert-store.cc
index 7bd92cd..65ee25e 100644
--- a/pan/data/cert-store.cc
+++ b/pan/data/cert-store.cc
@@ -340,7 +340,8 @@ namespace pan
   {
     gnutls_certificate_free_credentials (_creds);
     foreach (certs_m, _cert_to_server, it)
-      gnutls_x509_crt_deinit(it->second);
+      if (it->second)
+        gnutls_x509_crt_deinit(it->second);
   }
 
 
diff --git a/pan/gui/body-pane.cc b/pan/gui/body-pane.cc
index 329377b..f1b8493 100644
--- a/pan/gui/body-pane.cc
+++ b/pan/gui/body-pane.cc
@@ -1782,11 +1782,6 @@ BodyPane :: BodyPane (Data& data, ArticleCache& cache, Prefs& prefs, GroupPrefs
   gtk_widget_show_all (_root);
 }
 
-namespace
-{
-
-}
-
 BodyPane :: ~BodyPane ()
 {
   _prefs.remove_listener (this);
diff --git a/pan/gui/gui.cc b/pan/gui/gui.cc
index d0222f1..2e01ae8 100644
--- a/pan/gui/gui.cc
+++ b/pan/gui/gui.cc
@@ -1008,8 +1008,7 @@ void GUI :: do_download_selected_article ()
 void GUI :: do_clear_header_pane ()
 {
   gtk_window_set_title (get_window(_root), _("Pan"));
-  _header_pane->set_group (Quark());
-//  _header_pane->set_cleared(true);
+  _header_pane->clear ();
 }
 
 void GUI :: do_clear_body_pane ()
diff --git a/pan/gui/header-pane.cc b/pan/gui/header-pane.cc
index d782671..68e4a29 100644
--- a/pan/gui/header-pane.cc
+++ b/pan/gui/header-pane.cc
@@ -1767,6 +1767,7 @@ HeaderPane :: ~HeaderPane ()
   _prefs.set_string("last-visited-group", get_cleared() ? "" : _group.to_view());
   set_group (Quark());
 
+
   for (guint i=0; i<ICON_QTY; ++i)
     g_object_unref (G_OBJECT(_icons[i].pixbuf));
 }
diff --git a/pan/gui/header-pane.h b/pan/gui/header-pane.h
index 461d088..25ef6a1 100644
--- a/pan/gui/header-pane.h
+++ b/pan/gui/header-pane.h
@@ -386,6 +386,7 @@ namespace pan
       bool _cleared;
 
     public:
+      void clear() { set_group(Quark()); set_cleared(true); }
       void set_cleared(bool val) { _cleared = val; }
       bool get_cleared() { return _cleared; }
   };
diff --git a/pan/gui/server-ui.cc b/pan/gui/server-ui.cc
index e0d9c8b..4c32098 100644
--- a/pan/gui/server-ui.cc
+++ b/pan/gui/server-ui.cc
@@ -131,7 +131,6 @@ namespace
     }
 
     pan_entry_set_text (d->address_entry, addr);
-    pan_spin_button_set (d->port_spin, port);
     pan_spin_button_set (d->connection_limit_spin, max_conn);
     pan_entry_set_text (d->auth_username_entry, user);
     pan_entry_set_text (d->auth_password_entry, pass);
@@ -177,6 +176,8 @@ namespace
 
     gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(d->always_trust_checkbox), trust);
 #endif
+
+    pan_spin_button_set (d->port_spin, port);
   }
 
   void
diff --git a/pan/tasks/socket-impl-openssl.cc b/pan/tasks/socket-impl-openssl.cc
index f7035c9..97ba8d5 100644
--- a/pan/tasks/socket-impl-openssl.cc
+++ b/pan/tasks/socket-impl-openssl.cc
@@ -305,11 +305,11 @@ namespace
   {
     GIOGnuTLSChannel *chan = (GIOGnuTLSChannel *)handle;
     g_io_channel_unref(chan->giochan);
+    // free callback struct
+    delete (mydata_t*)gnutls_session_get_ptr (chan->session);
     gnutls_deinit (chan->session);
     g_free(chan->host);
     g_free(chan);
-    // free callback struct
-    delete (mydata_t*)gnutls_session_get_ptr (chan->session);
   }
 }
 
@@ -325,10 +325,9 @@ GIOChannelSocketGnuTLS :: ~GIOChannelSocketGnuTLS ()
 
   if (_channel)
   {
-    GIOGnuTLSChannel *chan = (GIOGnuTLSChannel *)_channel;
     g_io_channel_shutdown (_channel, true, 0);
-    _gnutls_free(_channel);
     g_string_free(_channel->read_buf,true);
+    _gnutls_free(_channel);
     _channel = 0;
   }
 
@@ -375,7 +374,8 @@ namespace
 
   static void set_blocking(gnutls_session_t& session, bool val)
   {
-    int fd(-1), flags;
+//    int fd(-1), flags;
+    int fd(-1);
     gnutls_transport_ptr_t tmp = gnutls_transport_get_ptr (session);
     fd = GPOINTER_TO_INT (tmp);
 
@@ -601,7 +601,7 @@ GIOChannelSocketGnuTLS :: do_read ()
 
   bool more (true);
 
-  GIOGnuTLSChannel * chan = (GIOGnuTLSChannel*)_channel;
+//  GIOGnuTLSChannel * chan = (GIOGnuTLSChannel*)_channel;
 
   while (more && !_abort_flag)
   {
@@ -787,7 +787,7 @@ GIOChannelSocketGnuTLS :: gnutls_get_iochannel(GIOChannel* channel, const char*
 
 	GIOGnuTLSChannel *chan(0);
 	GIOChannel *gchan(0);
-	int err(0), fd(0);
+	int fd(0);
 
 	chan = g_new0(GIOGnuTLSChannel, 1);
 	g_return_val_if_fail(chan, 0);
@@ -820,7 +820,6 @@ GIOChannelSocketGnuTLS :: gnutls_get_iochannel(GIOChannel* channel, const char*
 	g_io_channel_init(gchan);
   gchan->read_buf = g_string_sized_new(4096*128);
 
-  int ret;
   set_blocking(session, true);
 
   if (_gnutls_handshake(gchan) == G_IO_STATUS_NORMAL)



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