*
*/
-#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;
}
ContactManager::~ContactManager()
{
+ if(book_)
+ {
+ g_object_unref(book_);
+ }
}
bool ContactManager::numberExists(QString const& number)
return false;
}
+ e_book_query_unref(query);
+
if (g_contacts == 0)
{
qDebug() << "no contacts";
return true;
}
- qDebug() << "Loading addressbook";
-
GError *error;
error = 0;
book_ = e_book_new_system_addressbook(&error);
- qDebug() << "Loaded almost";
-
if (!book_)
{
- qDebug() << "Couldn't open addressbook: %s" << error->message;
+ qDebug() << "Couldn't open addressbook: %s" << error->message;
g_error_free(error);
return false;
}
- qDebug() << "Addressbook loaded";
-
/* Open connection to the address book */
if (!e_book_open(book_, FALSE, &error))
{
return false;
}
- qDebug() << "Addressbook opened";
-
return true;
}