diff --git a/examples/viewer/viewer.cpp b/examples/viewer/viewer.cpp index 2f80b33c..64076af7 100644 --- a/examples/viewer/viewer.cpp +++ b/examples/viewer/viewer.cpp @@ -44,18 +44,18 @@ GtkWidget* textArea = NULL; GtkTreeStore* treeModel = NULL; -vmime::message* currentMessage = NULL; +vmime::ref currentMessage = NULL; -void insertRowInModel(GtkTreeStore* model, const vmime::component* comp, GtkTreeIter* parent = NULL) +void insertRowInModel(GtkTreeStore* model, vmime::ref comp, GtkTreeIter* parent = NULL) { GtkTreeIter iter; gtk_tree_store_append(model, &iter, parent); - gtk_tree_store_set(model, &iter, 0, typeid(*comp).name(), 1, comp, -1); + gtk_tree_store_set(model, &iter, 0, typeid(*comp).name(), 1, comp.get(), -1); - const std::vector children = comp->getChildComponents(); + const std::vector > children = comp->getChildComponents(); for (int i = 0 ; i < children.size() ; ++i) { @@ -134,10 +134,9 @@ void openFile(const std::string& filename) } while (file.gcount()); - vmime::message* msg = new vmime::message(); + vmime::ref msg = vmime::create (); msg->parse(data); - delete (currentMessage); currentMessage = msg; char* convData = g_convert_with_fallback(data.c_str(), data.length(),