Fixed problems with special html characters and entities in Norwegian version.
[jenirok] / src / common / contactmanager.cpp
index 1289f1a..114c2d3 100644 (file)
  *
  */
 
-#include <QDebug>
+#include <QtCore/QDebug>
 #include "contactmanager.h"
 
 namespace
 {
-    const int COUNTRY_CODES[] = {358, 45, 46, 47};
+    const int COUNTRY_CODES[] = {358, 45, 46, 47, 354};
     const int NUM_OF_CODES = 4;
 }
 
@@ -31,6 +31,10 @@ ContactManager::ContactManager(): book_(0)
 
 ContactManager::~ContactManager()
 {
+    if(book_)
+    {
+        g_object_unref(book_);
+    }
 }
 
 bool ContactManager::numberExists(QString const& number)
@@ -54,6 +58,8 @@ bool ContactManager::numberExists(QString const& number)
         return false;
     }
 
+    e_book_query_unref(query);
+
     if (g_contacts == 0)
     {
         qDebug() << "no contacts";
@@ -112,12 +118,13 @@ bool ContactManager::load()
         return true;
     }
 
-    GError* error = NULL;
+    GError *error;
+    error = 0;
     book_ = e_book_new_system_addressbook(&error);
 
     if (!book_)
     {
-        qDebug() << "Couldn't open addressbook: %s" <<  error->message;
+        qDebug() << "Couldn't open addressbook: %s" << error->message;
         g_error_free(error);
         return false;
     }