On Thu 19 Dec 2013 at 01:36:13 +0100, Rhialto wrote:
> I sent a message to the pan mailing list
> (http://lists.nongnu.org/archive/html/pan-users/).
> Hopefully a better fix can be created.
and it was! The following additional patches are a packport to Pan
release 0.139, based on
git diff 7161f501ac9c044e993da958f2e7c9e32ad4661c
b1af29b364aacc9766b816b3a5c5da457cec4d98 --
on the repository git://git.gnome.org/pan2.
I did a quick compile+run test, using the pkgsrc clang++ compiler (which
apparently doesn't use the clang++ library, but the already installed
g++ library; so this test isn't identical to the pkgsrc bulk build; but
from inspection it looks like it should fix the issue at hand.)
Dec 21 02:22 2013 patch-pan-general-log.cc Page 1
$NetBSD$
Avoid a std::deque<Entry> inside an Entry.
diff --git a/pan/general/log.cc b/pan/general/log.cc
index aba4177..402d855 100644
--- pan/general/log.cc.orig 2012-06-29 22:24:54.000000000 +0000
+++ pan/general/log.cc
@@ -68,7 +68,11 @@ Log :: add_entry(Entry& e, std::deque<En
a.date = time(NULL);
a.severity = e.severity;
a.message = e.message;
- a.messages = list;
+ foreach (std::deque<Entry>, list, it)
+ {
+ Entry* new_entry = new Entry(*it);
+ a.messages.push_back(new_entry);
+ }
fire_entry_added (a);
}
Dec 21 02:23 2013 patch-pan_general_log.h Page 1
$NetBSD$
Avoid a std::deque<Entry> inside an Entry.
--- pan/general/log.h.orig 2012-06-29 22:24:54.000000000 +0000
+++ pan/general/log.h
@@ -24,6 +24,7 @@
#include <set>
#include <string>
#include <deque>
+#include <pan/general/macros.h>
namespace pan
{
@@ -49,10 +50,11 @@ namespace pan
struct Entry {
time_t date;
Severity severity;
- std::deque<Entry> messages;
+ std::deque<Entry*> messages;
std::string message;
bool is_child;
- Entry() : is_child(false) { }
+ Entry() : is_child(false), severity(PAN_SEVERITY_INFO), date(0) { }
+ virtual ~Entry () { foreach (std::deque<Entry*>, messages, it) delete
*it; }
};
void add_entry(Entry& e, std::deque<Entry>& list);
@@ -66,6 +68,7 @@ namespace pan
};
typedef std::deque<Entry> entries_t;
+ typedef std::deque<Entry*> entries_p;
public:
void add (Severity, const char *);
Dec 21 02:23 2013 patch-pan_gui_log-ui.cc Page 1
$NetBSD$
Avoid a std::deque<Entry> inside an Entry.
--- pan/gui/log-ui.cc.orig 2012-06-29 22:24:54.000000000 +0000
+++ pan/gui/log-ui.cc
@@ -61,13 +61,14 @@ namespace
{
GtkTreeIter child;
- foreach_const (Log::entries_t, e.messages, lit)
+ foreach_const (Log::entries_p, e.messages, lit)
{
+ Log::Entry entry(**lit);
gtk_tree_store_prepend (myStore, &child, &iter );
gtk_tree_store_set (myStore, &child,
COL_HIDDEN, "",
- COL_SEVERITY, (lit->severity &
Log::PAN_SEVERITY_ERROR),
- COL_DATE, (unsigned long)lit->date,
+ COL_SEVERITY, (entry.severity &
Log::PAN_SEVERITY_ERROR),
+ COL_DATE, (unsigned long)entry.date,
COL_MESSAGE, &*lit, -1);
}
}
@@ -157,13 +158,14 @@ namespace
COL_MESSAGE, &*it, -1);
if (!it->messages.empty())
{
- foreach_const (Log::entries_t, it->messages, lit)
+ foreach_const (Log::entries_p, it->messages, lit)
{
+ Log::Entry entry (**lit);
gtk_tree_store_prepend (store, &child, &top );
gtk_tree_store_set (store, &child,
COL_HIDDEN, "",
- COL_SEVERITY, (lit->severity &
Log::PAN_SEVERITY_ERROR),
- COL_DATE, (unsigned long)lit->date,
+ COL_SEVERITY, (entry.severity &
Log::PAN_SEVERITY_ERROR),
+ COL_DATE, (unsigned long)entry.date,
COL_MESSAGE, &*lit, -1);
}
}
-Olaf.
--
___ Olaf 'Rhialto' Seibert -- The Doctor: No, 'eureka' is Greek for
\X/ rhialto/at/xs4all.nl -- 'this bath is too hot.'
Attachment:
pgpx70znT3fes.pgp
Description: PGP signature