Modified test script. Added networkhandlerprivate and
authorJussi Laitinen <jupe@l3l7588.ixonos.local>
Thu, 27 May 2010 13:05:01 +0000 (16:05 +0300)
committerJussi Laitinen <jupe@l3l7588.ixonos.local>
Thu, 27 May 2010 13:05:01 +0000 (16:05 +0300)
networkhandlerprivatestub classes.

23 files changed:
scripts/run_unit_tests.sh
src/network/networkaccessmanager.cpp
src/network/networkhandler.cpp
src/network/networkhandler.h
src/network/networkhandlerprivate.cpp [new file with mode: 0644]
src/network/networkhandlerprivate.h [new file with mode: 0644]
src/network/networkhandlerprivatestub.cpp [new file with mode: 0644]
src/network/networkhandlerprivatestub.h [new file with mode: 0644]
src/src.pro
src/ui/friendlistitem.cpp
src/ui/imagebutton.cpp
src/ui/userinfo.cpp
src/ui/zoombuttonpanel.cpp
tests/map/friendgroupitem/friendgroupitem.pro
tests/map/friendlocationitem/friendlocationitem.pro
tests/map/gpslocationitem/gpslocationitem.pro
tests/map/mapengine/mapengine.pro
tests/map/mapscene/mapscene.pro
tests/map/maptile/maptile.pro
tests/map/ownlocationitem/ownlocationitem.pro
tests/ui/friendlist/friendlist.pro
tests/ui/friendlist/situare_user.gif [new file with mode: 0644]
tests/ui/friendlist/testfriendlist.cpp

index 0b5de38..06fb597 100755 (executable)
@@ -29,7 +29,7 @@ if [[ -d $REPORT_PATH && -d $UNIT_TESTS_ROOT_DIR ]]; then
     echo "" >> $REPORT
 
     # find all test .pro files pahts, cut .pro extension
-    UNIT_TEST_PROJECTS=(`find $UNIT_TESTS_ROOT_DIR_ABSOLUTE | egrep .pro$ | sed -e s/.pro//g`)
+    UNIT_TEST_PROJECTS=(`find $UNIT_TESTS_ROOT_DIR_ABSOLUTE | egrep \.pro$ | sed -e s,[^/]pro,,g`)
 
     echo "###################################################"
     echo "All unit test executables will be deleted"
index f539c62..76757d5 100644 (file)
@@ -21,6 +21,7 @@
 
 #include <QNetworkRequest>
 #include <QNetworkAccessManager>
+#include <QDebug>
 
 #include "networkhandler.h"
 #include "networkaccessmanager.h"
@@ -32,6 +33,8 @@ NetworkAccessManager::NetworkAccessManager()
     : m_networkHandler(0),
       m_networkAccessManagerPrivate(0)
 {
+    qDebug() << __PRETTY_FUNCTION__;
+
     m_networkHandler = new NetworkHandler(this);
     m_networkAccessManagerPrivate = new QNetworkAccessManager(this);
 
index 68d3ee2..324549b 100644 (file)
    USA.
 */
 
-#include <icd/dbus_api.h>
+#include <QDebug>
 
 #include "networkhandler.h"
 
-const int CONNECTION_STATE_INDEX = 7;
-
-static QDBusConnection dBusConnection = QDBusConnection::systemBus();
+#if defined(Q_WS_MAEMO_5) | defined(Q_WS_SIMULATOR)
+#include "networkhandlerprivate.h"
+#else
+#include "networkhandlerprivatestub.h"
+#endif
 
 NetworkHandler::NetworkHandler(QObject *parent)
-    : QObject(parent),
-      m_connected(false),
-      m_connecting(false)
-{
-    dBusInterface = new QDBusInterface(ICD_DBUS_API_INTERFACE, ICD_DBUS_API_PATH,
-                                       ICD_DBUS_API_INTERFACE, dBusConnection);
-
-    dBusConnection.connect(ICD_DBUS_API_INTERFACE, ICD_DBUS_API_PATH, ICD_DBUS_API_INTERFACE,
-                           ICD_DBUS_API_STATE_SIG,
-                           this, SLOT(stateChanged(const QDBusMessage &)));
-
-    state();
-}
-
-void NetworkHandler::stateChanged(const QDBusMessage &message)
+    : QObject(parent)
 {
-    qDebug() << __PRETTY_FUNCTION__;
-
-    if (message.arguments().count() > CONNECTION_STATE_INDEX) {
-
-        bool conversionOk;
-        int connectionState = message.arguments().at(CONNECTION_STATE_INDEX).toInt(&conversionOk);
-
-        if (conversionOk) {
-            if ((connectionState == ICD_STATE_DISCONNECTED) && (isConnected())) {
-                m_connected = false;
-                m_connecting = false;
-                emit disconnected();
-            }
-            else if ((connectionState == ICD_STATE_CONNECTED) &&(!isConnected())) {
-                m_connected = true;
-                m_connecting = false;
-                emit connected();
-            }
-        }
-    }
+    m_networkHandlerPrivate = new NetworkHandlerPrivate(this);
 }
 
 void NetworkHandler::connect()
 {
     qDebug() << __PRETTY_FUNCTION__;
 
-    if (!m_connecting && !m_connected) {
-        m_connecting = true;
-        dBusInterface->call(ICD_DBUS_API_CONNECT_REQ,
-                            QVariant((unsigned int)ICD_CONNECTION_FLAG_USER_EVENT));
-    }
+    m_networkHandlerPrivate->connect();
 }
 
 void NetworkHandler::disconnect()
 {
     qDebug() << __PRETTY_FUNCTION__;
 
-    dBusInterface->call(ICD_DBUS_API_DISCONNECT_REQ,
-                        QVariant((unsigned int)ICD_CONNECTION_FLAG_USER_EVENT));
+    m_networkHandlerPrivate->disconnect();
 }
 
 bool NetworkHandler::isConnected()
 {
     qDebug() << __PRETTY_FUNCTION__;
 
-    return m_connected;
+    return m_networkHandlerPrivate->isConnected();
 }
 
 void NetworkHandler::state()
 {
     qDebug() << __PRETTY_FUNCTION__;
 
-    dBusInterface->call(ICD_DBUS_API_STATE_REQ);
+    m_networkHandlerPrivate->state();
 }
index f85d156..5eb84ee 100644 (file)
@@ -22,7 +22,9 @@
 #ifndef NETWORKHANDLER_H
 #define NETWORKHANDLER_H
 
-#include <QtDBus>
+#include <QObject>
+
+class NetworkHandlerPrivate;
 
 /**
 * @brief NetworkHandler class.
@@ -36,6 +38,12 @@ class NetworkHandler : public QObject
 
 public:
     /**
+    * @brief Friend class for NetworkHandlerPrivate.
+    */
+    friend class NetworkHandlerPrivate;
+
+
+    /**
     * @brief Constructor.
     *
     * Creates ICD D-Bus interface.
@@ -72,14 +80,6 @@ public:
     */
     void state();
 
-private slots:
-    /**
-    * @brief Slot for ICD D-Bus state change.
-    *
-    * @param message received D-Bus message
-    */
-    void stateChanged(const QDBusMessage &message);
-
 /*******************************************************************************
  * SIGNALS
  ******************************************************************************/
@@ -98,9 +98,7 @@ signals:
  * DATA MEMBERS
  ******************************************************************************/
 private:
-    QDBusInterface *dBusInterface;  ///< D-Bus interface
-    bool m_connected;               ///< Connection state variable
-    bool m_connecting;              ///< Connecting state variable
+    NetworkHandlerPrivate *m_networkHandlerPrivate; ///< Instance of NetworkHandlerPrivate
 };
 
 #endif // NETWORKHANDLER_H
diff --git a/src/network/networkhandlerprivate.cpp b/src/network/networkhandlerprivate.cpp
new file mode 100644 (file)
index 0000000..55265b3
--- /dev/null
@@ -0,0 +1,103 @@
+/*
+   Situare - A location system for Facebook
+   Copyright (C) 2010  Ixonos Plc. Authors:
+
+       Jussi Laitinen - jussi.laitinen@ixonos.com
+
+   Situare is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public License
+   version 2 as published by the Free Software Foundation.
+
+   Situare is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with Situare; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
+   USA.
+*/
+
+#include <icd/dbus_api.h>
+
+#include "networkhandler.h"
+#include "networkhandlerprivate.h"
+
+const int CONNECTION_STATE_INDEX = 7;
+
+static QDBusConnection dBusConnection = QDBusConnection::systemBus();
+
+NetworkHandlerPrivate::NetworkHandlerPrivate(QObject *parent)
+    : QObject(parent),
+      m_connected(false),
+      m_connecting(false)
+{
+    m_parent = static_cast<NetworkHandler*>(parent);
+
+    dBusInterface = new QDBusInterface(ICD_DBUS_API_INTERFACE, ICD_DBUS_API_PATH,
+                                       ICD_DBUS_API_INTERFACE, dBusConnection);
+
+    dBusConnection.connect(ICD_DBUS_API_INTERFACE, ICD_DBUS_API_PATH, ICD_DBUS_API_INTERFACE,
+                           ICD_DBUS_API_STATE_SIG,
+                           this, SLOT(stateChanged(const QDBusMessage &)));
+
+    state();
+}
+
+void NetworkHandlerPrivate::stateChanged(const QDBusMessage &message)
+{
+    qDebug() << __PRETTY_FUNCTION__;
+
+    if (message.arguments().count() > CONNECTION_STATE_INDEX) {
+
+        bool conversionOk;
+        int connectionState = message.arguments().at(CONNECTION_STATE_INDEX).toInt(&conversionOk);
+
+        if (conversionOk) {
+            if ((connectionState == ICD_STATE_DISCONNECTED) && (isConnected())) {
+                m_connected = false;
+                m_connecting = false;
+                emit m_parent->disconnected();
+            }
+            else if ((connectionState == ICD_STATE_CONNECTED) &&(!isConnected())) {
+                m_connected = true;
+                m_connecting = false;
+                emit m_parent->connected();
+            }
+        }
+    }
+}
+
+void NetworkHandlerPrivate::connect()
+{
+    qDebug() << __PRETTY_FUNCTION__;
+
+    if (!m_connecting && !m_connected) {
+        m_connecting = true;
+        dBusInterface->call(ICD_DBUS_API_CONNECT_REQ,
+                            QVariant((unsigned int)ICD_CONNECTION_FLAG_USER_EVENT));
+    }
+}
+
+void NetworkHandlerPrivate::disconnect()
+{
+    qDebug() << __PRETTY_FUNCTION__;
+
+    dBusInterface->call(ICD_DBUS_API_DISCONNECT_REQ,
+                        QVariant((unsigned int)ICD_CONNECTION_FLAG_USER_EVENT));
+}
+
+bool NetworkHandlerPrivate::isConnected()
+{
+    qDebug() << __PRETTY_FUNCTION__;
+
+    return m_connected;
+}
+
+void NetworkHandlerPrivate::state()
+{
+    qDebug() << __PRETTY_FUNCTION__;
+
+    dBusInterface->call(ICD_DBUS_API_STATE_REQ);
+}
diff --git a/src/network/networkhandlerprivate.h b/src/network/networkhandlerprivate.h
new file mode 100644 (file)
index 0000000..054b179
--- /dev/null
@@ -0,0 +1,96 @@
+/*
+   Situare - A location system for Facebook
+   Copyright (C) 2010  Ixonos Plc. Authors:
+
+       Jussi Laitinen - jussi.laitinen@ixonos.com
+
+   Situare is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public License
+   version 2 as published by the Free Software Foundation.
+
+   Situare is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with Situare; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
+   USA.
+*/
+
+#ifndef NETWORKHANDLERPRIVATE_H
+#define NETWORKHANDLERPRIVATE_H
+
+#include <QtDBus>
+
+class NetworkHandler;
+
+/**
+* @brief NetworkHandlerPrivate class.
+*
+* This class handles network connection. Class notifies about
+* network connection states.
+*/
+class NetworkHandlerPrivate : public QObject
+{
+    Q_OBJECT
+
+public:
+    /**
+    * @brief Constructor.
+    *
+    * Creates ICD D-Bus interface.
+    */
+    NetworkHandlerPrivate(QObject *parent);
+
+/*******************************************************************************
+ * MEMBER FUNCTIONS AND SLOTS
+ ******************************************************************************/
+public:
+    /**
+    * @brief Requests network connection.
+    *
+    * Request is done via ICD D-Bus.
+    */
+    void connect();
+
+    /**
+    * @brief Requests to disconnect a connection.
+    *
+    * Request is done via ICD D-Bus.
+    */
+    void disconnect();
+
+    /**
+    * @brief Checks if connected to network.
+    *
+    * @return true if connected, false otherwise
+    */
+    bool isConnected();
+
+    /**
+    * @brief Requests network state.
+    */
+    void state();
+
+private slots:
+    /**
+    * @brief Slot for ICD D-Bus state change.
+    *
+    * @param message received D-Bus message
+    */
+    void stateChanged(const QDBusMessage &message);
+
+/*******************************************************************************
+ * DATA MEMBERS
+ ******************************************************************************/
+private:
+    QDBusInterface *dBusInterface;  ///< D-Bus interface
+    bool m_connected;               ///< Connection state variable
+    bool m_connecting;              ///< Connecting state variable
+
+    NetworkHandler *m_parent;       ///< Parent object
+};
+
+#endif // NETWORKHANDLERPRIVATE_H
diff --git a/src/network/networkhandlerprivatestub.cpp b/src/network/networkhandlerprivatestub.cpp
new file mode 100644 (file)
index 0000000..b85dc91
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+   Situare - A location system for Facebook
+   Copyright (C) 2010  Ixonos Plc. Authors:
+
+       Jussi Laitinen - jussi.laitinen@ixonos.com
+
+   Situare is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public License
+   version 2 as published by the Free Software Foundation.
+
+   Situare is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with Situare; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
+   USA.
+*/
+
+#include <QDebug>
+
+#include "networkhandler.h"
+#include "networkhandlerprivatestub.h"
+
+
+NetworkHandlerPrivate::NetworkHandlerPrivate(QObject *parent)
+    : QObject(parent)
+{
+    qDebug() << __PRETTY_FUNCTION__;
+}
+
+void NetworkHandlerPrivate::connect()
+{
+    qDebug() << __PRETTY_FUNCTION__;
+}
+
+void NetworkHandlerPrivate::disconnect()
+{
+    qDebug() << __PRETTY_FUNCTION__;
+}
+
+bool NetworkHandlerPrivate::isConnected()
+{
+    qDebug() << __PRETTY_FUNCTION__;
+
+    return true;
+}
+
+void NetworkHandlerPrivate::state()
+{
+    qDebug() << __PRETTY_FUNCTION__;
+}
diff --git a/src/network/networkhandlerprivatestub.h b/src/network/networkhandlerprivatestub.h
new file mode 100644 (file)
index 0000000..d66327a
--- /dev/null
@@ -0,0 +1,75 @@
+/*
+   Situare - A location system for Facebook
+   Copyright (C) 2010  Ixonos Plc. Authors:
+
+       Jussi Laitinen - jussi.laitinen@ixonos.com
+
+   Situare is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public License
+   version 2 as published by the Free Software Foundation.
+
+   Situare is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with Situare; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
+   USA.
+*/
+
+#ifndef NETWORKHANDLERPRIVATESTUB_H
+#define NETWORKHANDLERPRIVATESTUB_H
+
+#include <QObject>
+
+/**
+* @brief NetworkHandlerPrivate class does nothing.
+*
+* Class is used when compiling in desktop.
+*/
+class NetworkHandlerPrivate : public QObject
+{
+public:
+    /**
+    * @brief Constructor.
+    *
+    * @param parent QObject
+    */
+    NetworkHandlerPrivate(QObject *parent);
+
+/*******************************************************************************
+ * MEMBER FUNCTIONS AND SLOTS
+ ******************************************************************************/
+public:
+    /**
+    * @brief Requests network connection.
+    *
+    * DOES NOTHING.
+    */
+    void connect();
+
+    /**
+    * @brief Requests to disconnect a connection.
+    *
+    * DOES NOTHING.
+    */
+    void disconnect();
+
+    /**
+    * @brief Checks if connected to network.
+    *
+    * RETURNS TRUE.
+    */
+    bool isConnected();
+
+    /**
+    * @brief Requests network state.
+    *
+    * DOES NOTHING.
+    */
+    void state();
+};
+
+#endif // NETWORKHANDLERPRIVATESTUB_H
index 3c3833d..a5ce065 100644 (file)
@@ -3,10 +3,8 @@
 # -------------------------------------------------
 TARGET = ../situare
 TEMPLATE = app
-INCLUDEPATH += /usr/include/qjson /usr/include/glib-2.0 /usr/lib/glib-2.0/include
+INCLUDEPATH += /usr/include/qjson
 LIBS += -lqjson
-CONFIG += icd2
-QT += dbus
 RESOURCES += ../images.qrc
 SOURCES += main.cpp \
     ui/mainwindow.cpp \
@@ -99,10 +97,13 @@ QT += network \
 DEFINES += QT_NO_DEBUG_OUTPUT
 
 maemo5 | simulator {
-    SOURCES += gps/gpspositionprivate.cpp
-    HEADERS += gps/gpspositionprivate.h
-    QT += maemo5
-    CONFIG += mobility
+    INCLUDEPATH += /usr/include/glib-2.0 /usr/lib/glib-2.0/include
+    SOURCES += gps/gpspositionprivate.cpp \
+               network/networkhandlerprivate.cpp
+    HEADERS += gps/gpspositionprivate.h \
+               network/networkhandlerprivate.h
+    QT += maemo5 dbus
+    CONFIG += mobility icd2
     MOBILITY = location
     message([QJson])
     message(Make sure you have QJson development headers installed)
@@ -114,8 +115,10 @@ maemo5 | simulator {
     message(Make sure you have QtMobility development headers installed)
     message(install headers with: apt-get install libqtm-dev)
 } else {
-    SOURCES += gps/gpspositionprivatestub.cpp
-    HEADERS += gps/gpspositionprivatestub.h
+    SOURCES += gps/gpspositionprivatestub.cpp \
+               network/networkhandlerprivatestub.cpp
+    HEADERS += gps/gpspositionprivatestub.h \
+               network/networkhandlerprivatestub.h
     message(QJson built in)
     message(Make sure you have QJson development headers installed)
     message(install headers with: sudo apt-get install libqjson-dev)
index c3cd297..909f421 100644 (file)
@@ -170,7 +170,8 @@ void FriendListItem::setData(User *user)
     if(user) {
         m_user = user;
 
-        m_findButton->setButtonIcon(m_user->profileImage());
+        if (!m_user->profileImage().isNull())
+            m_findButton->setButtonIcon(m_user->profileImage());
 
         QString unit;
         double value;
index 321423d..bd48668 100644 (file)
@@ -34,13 +34,13 @@ ImageButton::ImageButton(QWidget *parent, QString normalIconPictureFileName,
     qDebug() << __PRETTY_FUNCTION__;
 
     // If there is a file name provided for icon image, use it as the icon for the button
-    if (normalIconPictureFileName != "") {
+    if (!normalIconPictureFileName.isEmpty()) {
         QPixmap iconPixmap(normalIconPictureFileName);
         QSize buttonSize = iconPixmap.size(); // Get the button size from the normal state icon picture
         QIcon icon(iconPixmap);
 
         // If there is a picture for selected state, use it instead of a simple highlight change
-        if(selectedIconPictureFileName != "")
+        if(!selectedIconPictureFileName.isEmpty())
             icon.addFile(selectedIconPictureFileName, buttonSize, QIcon::Selected);
 
         setIcon(icon);
@@ -51,6 +51,8 @@ ImageButton::ImageButton(QWidget *parent, QString normalIconPictureFileName,
 
 void ImageButton::setButtonIcon(const QPixmap &image)
 {
+    qDebug() << __PRETTY_FUNCTION__;
+
     QSize buttonSize = image.size(); // Get the button size from the normal state icon picture
     QIcon icon(image);
 
index 05ea5fb..4cdc9ed 100644 (file)
@@ -157,7 +157,7 @@ void UserInfo::setProfileImage(const QPixmap &image)
 {
     qDebug() << __PRETTY_FUNCTION__;
 
-    m_findButton->setIcon(image);
+    m_findButton->setButtonIcon(image);
 }
 
 void UserInfo::setTime(const QString &time)
index b77f6d1..7757918 100644 (file)
@@ -123,13 +123,14 @@ void ZoomButtonPanel::mouseReleaseEvent(QMouseEvent *event)
 {
     qDebug() << __PRETTY_FUNCTION__;
     
+    m_dragStartTimer->stop();
+
     Q_UNUSED(event);
     if(m_isDraggable) {
         setDraggable(false);
         QSettings settings(DIRECTORY_NAME, FILE_NAME);
         settings.setValue(ZOOMPANEL_POSITION, pos());
         releaseMouse();
-        m_dragStartTimer->stop();
         m_zoomInButton->setDown(false);
         m_zoomOutButton->setDown(false);
     }
index f80ac96..eb2060c 100644 (file)
@@ -2,12 +2,12 @@
 # Automatically generated by qmake (2.01a) Fri Mar 26 15:09:16 2010
 # #####################################################################
 CONFIG += qtestlib
-QT += network
+QT += network dbus
 TEMPLATE = app
-TARGET = 
 DEPENDPATH += .
 INCLUDEPATH += . \
-    ../../../src/
+    ../../../src/ \
+    /usr/include/glib-2.0 /usr/lib/glib-2.0/include
 
 # Input
 SOURCES += testfriendgroupitem.cpp \
@@ -22,7 +22,10 @@ SOURCES += testfriendgroupitem.cpp \
     ../../../src/map/mapfetcher.cpp \
     ../../../src/map/frienditemshandler.cpp \
     ../../../src/user/user.cpp \
-    ../../../src/map/gpslocationitem.cpp
+    ../../../src/map/gpslocationitem.cpp \
+    ../../../src/network/networkaccessmanager.cpp \
+    ../../../src/network/networkhandler.cpp \
+    ../../../src/network/networkreply.cpp
 HEADERS += ../../../src/map/friendgroupitem.h \
     ../../../src/map/friendlocationitem.h \
     ../../../src/map/baselocationitem.h \
@@ -35,6 +38,32 @@ HEADERS += ../../../src/map/friendgroupitem.h \
     ../../../src/map/mapcommon.h \
     ../../../src/map/frienditemshandler.h \
     ../../../src/user/user.h \
-    ../../../src/map/gpslocationitem.h
+    ../../../src/map/gpslocationitem.h \
+    ../../../src/network/networkaccessmanager.h \
+    ../../../src/network/networkhandler.h \
+    ../../../src/network/networkreply.h
 DEFINES += QT_NO_DEBUG_OUTPUT
 RESOURCES += ../../../images.qrc
+
+maemo5 | simulator {
+    INCLUDEPATH += /usr/include/glib-2.0 /usr/lib/glib-2.0/include
+    SOURCES += ../../../src/network/networkhandlerprivate.cpp
+    HEADERS += ../../../src/network/networkhandlerprivate.h
+    QT += maemo5 dbus
+    CONFIG += icd2
+    message([QJson])
+    message(Make sure you have QJson development headers installed)
+    message(add: deb http://repository.maemo.org/extras-devel fremantle free non-free)
+    message(to Scratchbox's sources.list in /etc/apt)
+    message(run: apt-get update)
+    message(install headers with: apt-get install libqjson-dev)
+    message([QtMobility])
+    message(Make sure you have QtMobility development headers installed)
+    message(install headers with: apt-get install libqtm-dev)
+} else {
+    SOURCES += ../../../src/network/networkhandlerprivatestub.cpp
+    HEADERS += ../../../src/network/networkhandlerprivatestub.h
+    message(QJson built in)
+    message(Make sure you have QJson development headers installed)
+    message(install headers with: sudo apt-get install libqjson-dev)
+}
index e62134f..45dba5e 100644 (file)
@@ -2,11 +2,12 @@
 # Automatically generated by qmake (2.01a) Tue Apr 27 14:52:31 2010
 # #####################################################################
 CONFIG += qtestlib
-QT += network
+QT += network dbus
 TEMPLATE = app
 DEPENDPATH += .
 INCLUDEPATH += . \
-    ../../../src/
+    ../../../src/ \
+    /usr/include/glib-2.0 /usr/lib/glib-2.0/include
 RESOURCES += ../../../images.qrc
 
 # Input
@@ -23,7 +24,10 @@ SOURCES += testfriendlocationitem.cpp \
     ../../../src/map/maptilerequest.cpp \
     ../../../src/map/frienditemshandler.cpp \
     ../../../src/map/friendgroupitem.cpp \
-    ../../../src/map/gpslocationitem.cpp
+    ../../../src/map/gpslocationitem.cpp \
+    ../../../src/network/networkaccessmanager.cpp \
+    ../../../src/network/networkhandler.cpp \
+    ../../../src/network/networkreply.cpp
 HEADERS += ../../../src/map/ownlocationitem.h \
     ../../../src/map/mapscene.h \
     ../../../src/map/maptile.h \
@@ -37,6 +41,33 @@ HEADERS += ../../../src/map/ownlocationitem.h \
     ../../../src/map/maptilerequest.h \
     ../../../src/map/frienditemshandler.h \
     ../../../src/map/friendgroupitem.h \
-    ../../../src/map/gpslocationitem.h
+    ../../../src/map/gpslocationitem.h \
+    ../../../src/network/networkaccessmanager.h \
+    ../../../src/network/networkhandler.h \
+    ../../../src/network/networkreply.h
 
 DEFINES += QT_NO_DEBUG_OUTPUT
+
+maemo5 | simulator {
+    INCLUDEPATH += /usr/include/glib-2.0 /usr/lib/glib-2.0/include
+    SOURCES += ../../../src/network/networkhandlerprivate.cpp
+    HEADERS += ../../../src/network/networkhandlerprivate.h
+    QT += maemo5 dbus
+    CONFIG += icd2
+    message([QJson])
+    message(Make sure you have QJson development headers installed)
+    message(add: deb http://repository.maemo.org/extras-devel fremantle free non-free)
+    message(to Scratchbox's sources.list in /etc/apt)
+    message(run: apt-get update)
+    message(install headers with: apt-get install libqjson-dev)
+    message([QtMobility])
+    message(Make sure you have QtMobility development headers installed)
+    message(install headers with: apt-get install libqtm-dev)
+} else {
+    SOURCES += ../../../src/network/networkhandlerprivatestub.cpp
+    HEADERS += ../../../src/network/networkhandlerprivatestub.h
+    message(QJson built in)
+    message(Make sure you have QJson development headers installed)
+    message(install headers with: sudo apt-get install libqjson-dev)
+}
+
index 9f0579c..575514c 100644 (file)
@@ -16,3 +16,27 @@ HEADERS += \
     ../../../src/map/gpslocationitem.h
 DEFINES += QT_NO_DEBUG_OUTPUT
 RESOURCES += ../../../images.qrc
+
+maemo5 | simulator {
+    INCLUDEPATH += /usr/include/glib-2.0 /usr/lib/glib-2.0/include
+    SOURCES += ../../../src/network/networkhandlerprivate.cpp
+    HEADERS += ../../../src/network/networkhandlerprivate.h
+    QT += maemo5 dbus
+    CONFIG += icd2
+    message([QJson])
+    message(Make sure you have QJson development headers installed)
+    message(add: deb http://repository.maemo.org/extras-devel fremantle free non-free)
+    message(to Scratchbox's sources.list in /etc/apt)
+    message(run: apt-get update)
+    message(install headers with: apt-get install libqjson-dev)
+    message([QtMobility])
+    message(Make sure you have QtMobility development headers installed)
+    message(install headers with: apt-get install libqtm-dev)
+} else {
+    SOURCES += ../../../src/network/networkhandlerprivatestub.cpp
+    HEADERS += ../../../src/network/networkhandlerprivatestub.h
+    message(QJson built in)
+    message(Make sure you have QJson development headers installed)
+    message(install headers with: sudo apt-get install libqjson-dev)
+}
+
index a1b6bb3..380f4bd 100644 (file)
@@ -24,9 +24,9 @@ SOURCES += testmapengine.cpp \
     ../../../src/user/user.cpp \
     ../../../src/map/friendlocationitem.cpp \
     ../../../src/map/gpslocationitem.cpp \
-    ../../../src/engine/networkaccessmanager.cpp \
-    ../../../src/engine/networkhandler.cpp \
-    ../../../src/engine/networkreply.cpp
+    ../../../src/network/networkaccessmanager.cpp \
+    ../../../src/network/networkhandler.cpp \
+    ../../../src/network/networkreply.cpp
 HEADERS += ../../../src/map/mapengine.h \
     ../../../src/map/mapscene.h \
     ../../../src/map/maptile.h \
@@ -41,7 +41,31 @@ HEADERS += ../../../src/map/mapengine.h \
     ../../../src/user/user.h \
     ../../../src/map/friendlocationitem.h \
     ../../../src/map/gpslocationitem.h \
-    ../../../src/engine/networkaccessmanager.h \
-    ../../../src/engine/networkhandler.h \
-    ../../../src/engine/networkreply.h
+    ../../../src/network/networkaccessmanager.h \
+    ../../../src/network/networkhandler.h \
+    ../../../src/network/networkreply.h
 DEFINES += QT_NO_DEBUG_OUTPUT
+
+maemo5 | simulator {
+    INCLUDEPATH += /usr/include/glib-2.0 /usr/lib/glib-2.0/include
+    SOURCES += ../../../src/network/networkhandlerprivate.cpp
+    HEADERS += ../../../src/network/networkhandlerprivate.h
+    QT += maemo5 dbus
+    CONFIG += icd2
+    message([QJson])
+    message(Make sure you have QJson development headers installed)
+    message(add: deb http://repository.maemo.org/extras-devel fremantle free non-free)
+    message(to Scratchbox's sources.list in /etc/apt)
+    message(run: apt-get update)
+    message(install headers with: apt-get install libqjson-dev)
+    message([QtMobility])
+    message(Make sure you have QtMobility development headers installed)
+    message(install headers with: apt-get install libqtm-dev)
+} else {
+    SOURCES += ../../../src/network/networkhandlerprivatestub.cpp
+    HEADERS += ../../../src/network/networkhandlerprivatestub.h
+    message(QJson built in)
+    message(Make sure you have QJson development headers installed)
+    message(install headers with: sudo apt-get install libqjson-dev)
+}
+
index 9cea0ce..92fa786 100644 (file)
@@ -2,12 +2,12 @@
 # Automatically generated by qmake (2.01a) Mon Mar 29 10:06:28 2010
 # #####################################################################
 CONFIG += qtestlib
-QT += network
+QT += network dbus
 TEMPLATE = app
-TARGET = 
 DEPENDPATH += .
 INCLUDEPATH += . \
-    ../../../src/
+    ../../../src/ \
+    /usr/include/glib-2.0 /usr/lib/glib-2.0/include
 
 # Input
 SOURCES += testmapscene.cpp \
@@ -22,7 +22,10 @@ SOURCES += testmapscene.cpp \
     ../../../src/map/frienditemshandler.cpp \
     ../../../src/map/friendgroupitem.cpp \
     ../../../src/map/baselocationitem.cpp \
-    ../../../src/map/gpslocationitem.cpp
+    ../../../src/map/gpslocationitem.cpp \
+    ../../../src/network/networkaccessmanager.cpp \
+    ../../../src/network/networkhandler.cpp \
+    ../../../src/network/networkreply.cpp
 HEADERS += ../../../src/map/mapscene.h \
     ../../../src/map/maptile.h \
     ../../../src/map/mapengine.h \
@@ -34,5 +37,31 @@ HEADERS += ../../../src/map/mapscene.h \
     ../../../src/map/frienditemshandler.h \
     ../../../src/map/friendgroupitem.h \
     ../../../src/map/baselocationitem.h \
-    ../../../src/map/gpslocationitem.h
+    ../../../src/map/gpslocationitem.h \
+    ../../../src/network/networkaccessmanager.h \
+    ../../../src/network/networkhandler.h \
+    ../../../src/network/networkreply.h
 DEFINES += QT_NO_DEBUG_OUTPUT
+
+maemo5 | simulator {
+    INCLUDEPATH += /usr/include/glib-2.0 /usr/lib/glib-2.0/include
+    SOURCES += ../../../src/network/networkhandlerprivate.cpp
+    HEADERS += ../../../src/network/networkhandlerprivate.h
+    QT += maemo5 dbus
+    CONFIG += icd2
+    message([QJson])
+    message(Make sure you have QJson development headers installed)
+    message(add: deb http://repository.maemo.org/extras-devel fremantle free non-free)
+    message(to Scratchbox's sources.list in /etc/apt)
+    message(run: apt-get update)
+    message(install headers with: apt-get install libqjson-dev)
+    message([QtMobility])
+    message(Make sure you have QtMobility development headers installed)
+    message(install headers with: apt-get install libqtm-dev)
+} else {
+    SOURCES += ../../../src/network/networkhandlerprivatestub.cpp
+    HEADERS += ../../../src/network/networkhandlerprivatestub.h
+    message(QJson built in)
+    message(Make sure you have QJson development headers installed)
+    message(install headers with: sudo apt-get install libqjson-dev)
+}
index 6baaf4f..9bc4918 100644 (file)
@@ -2,12 +2,13 @@
 # Automatically generated by qmake (2.01a) Mon Mar 29 10:06:28 2010
 # #####################################################################
 CONFIG += qtestlib
-QT += network
+QT += network dbus
 TEMPLATE = app
 TARGET = 
 DEPENDPATH += .
 INCLUDEPATH += . \
-    ../../../src/
+    ../../../src/ \
+    /usr/include/glib-2.0 /usr/lib/glib-2.0/include
 
 # Input
 SOURCES += testmaptile.cpp \
@@ -22,7 +23,10 @@ SOURCES += testmaptile.cpp \
     ../../../src/map/friendgroupitem.cpp \
     ../../../src/map/baselocationitem.cpp \
     ../../../src/user/user.cpp \
-    ../../../src/map/gpslocationitem.cpp
+    ../../../src/map/gpslocationitem.cpp \
+    ../../../src/network/networkaccessmanager.cpp \
+    ../../../src/network/networkhandler.cpp \
+    ../../../src/network/networkreply.cpp
 HEADERS += ../../../src/map/maptile.h \
     ../../../src/map/mapfetcher.h \
     ../../../src/map/mapengine.h \
@@ -34,5 +38,31 @@ HEADERS += ../../../src/map/maptile.h \
     ../../../src/map/friendgroupitem.h \
     ../../../src/map/baselocationitem.h \
     ../../../src/user/user.h \
-    ../../../src/map/gpslocationitem.h
+    ../../../src/map/gpslocationitem.h \
+    ../../../src/network/networkaccessmanager.h \
+    ../../../src/network/networkhandler.h \
+    ../../../src/network/networkreply.h
 DEFINES += QT_NO_DEBUG_OUTPUT
+
+maemo5 | simulator {
+    INCLUDEPATH += /usr/include/glib-2.0 /usr/lib/glib-2.0/include
+    SOURCES += ../../../src/network/networkhandlerprivate.cpp
+    HEADERS += ../../../src/network/networkhandlerprivate.h
+    QT += maemo5 dbus
+    CONFIG += icd2
+    message([QJson])
+    message(Make sure you have QJson development headers installed)
+    message(add: deb http://repository.maemo.org/extras-devel fremantle free non-free)
+    message(to Scratchbox's sources.list in /etc/apt)
+    message(run: apt-get update)
+    message(install headers with: apt-get install libqjson-dev)
+    message([QtMobility])
+    message(Make sure you have QtMobility development headers installed)
+    message(install headers with: apt-get install libqtm-dev)
+} else {
+    SOURCES += ../../../src/network/networkhandlerprivatestub.cpp
+    HEADERS += ../../../src/network/networkhandlerprivatestub.h
+    message(QJson built in)
+    message(Make sure you have QJson development headers installed)
+    message(install headers with: sudo apt-get install libqjson-dev)
+}
index 97e42d8..a2292f6 100644 (file)
@@ -25,9 +25,9 @@ SOURCES += testownlocationitem.cpp \
     ../../../src/map/frienditemshandler.cpp \
     ../../../src/map/friendgroupitem.cpp \
     ../../../src/map/gpslocationitem.cpp \
-    ../../../src/engine/networkaccessmanager.cpp \
-    ../../../src/engine/networkhandler.cpp \
-    ../../../src/engine/networkreply.cpp
+    ../../../src/network/networkaccessmanager.cpp \
+    ../../../src/network/networkhandler.cpp \
+    ../../../src/network/networkreply.cpp
 HEADERS += ../../../src/map/ownlocationitem.h \
     ../../../src/map/mapscene.h \
     ../../../src/map/maptile.h \
@@ -42,7 +42,30 @@ HEADERS += ../../../src/map/ownlocationitem.h \
     ../../../src/map/frienditemshandler.h \
     ../../../src/map/friendgroupitem.h \
     ../../../src/map/gpslocationitem.h \
-    ../../../src/engine/networkaccessmanager.h \
-    ../../../src/engine/networkhandler.h \
-    ../../../src/engine/networkreply.h
+    ../../../src/network/networkaccessmanager.h \
+    ../../../src/network/networkhandler.h \
+    ../../../src/network/networkreply.h
 DEFINES += QT_NO_DEBUG_OUTPUT
+
+maemo5 | simulator {
+    INCLUDEPATH += /usr/include/glib-2.0 /usr/lib/glib-2.0/include
+    SOURCES += ../../../src/network/networkhandlerprivate.cpp
+    HEADERS += ../../../src/network/networkhandlerprivate.h
+    QT += maemo5 dbus
+    CONFIG += icd2
+    message([QJson])
+    message(Make sure you have QJson development headers installed)
+    message(add: deb http://repository.maemo.org/extras-devel fremantle free non-free)
+    message(to Scratchbox's sources.list in /etc/apt)
+    message(run: apt-get update)
+    message(install headers with: apt-get install libqjson-dev)
+    message([QtMobility])
+    message(Make sure you have QtMobility development headers installed)
+    message(install headers with: apt-get install libqtm-dev)
+} else {
+    SOURCES += ../../../src/network/networkhandlerprivatestub.cpp
+    HEADERS += ../../../src/network/networkhandlerprivatestub.h
+    message(QJson built in)
+    message(Make sure you have QJson development headers installed)
+    message(install headers with: sudo apt-get install libqjson-dev)
+}
index 94de6d8..ce737c4 100644 (file)
@@ -13,3 +13,4 @@ SOURCES += ../../../src/ui/friendlistview.cpp \
     ../../../src/ui/avatarimage.cpp \
     ../../../src/ui/imagebutton.cpp \
     testfriendlist.cpp
+RESOURCES += ../../../images.qrc
diff --git a/tests/ui/friendlist/situare_user.gif b/tests/ui/friendlist/situare_user.gif
new file mode 100644 (file)
index 0000000..cd34a82
Binary files /dev/null and b/tests/ui/friendlist/situare_user.gif differ
index 351dbb2..c8d3d7d 100644 (file)
@@ -51,9 +51,11 @@ void TestFriendList::friendListViewAddWidget()
     User *user1 = new User(QString("Address"), QPointF(12.22, 23.33), QString("Name"),
                            QString("Note"), QUrl("http://image.url"), QString("Timestamp"), true,
                            QString("UserID1"), QString("Units"), 44.12);
+    user1->setProfileImage(QPixmap("situare_user.gif"));
     User *user2 = new User(QString("Address"), QPointF(12.22, 23.33), QString("Name"),
                            QString("Note"), QUrl("http://image.url"), QString("Timestamp"), true,
                            QString("UserID2"), QString("Units"), 44.12);
+    user2->setProfileImage(QPixmap("situare_user.gif"));
 
     FriendListItem *item1 = new FriendListItem(view);
     item1->setData(user1);
@@ -68,6 +70,7 @@ void TestFriendList::friendListViewAddWidget()
     User *user3 = new User(QString("Address"), QPointF(12.22, 23.33), QString("Name"),
                            QString("Note"), QUrl("http://image.url"), QString("Timestamp"), true,
                            QString("UserID3"), QString("Units"), 44.12);
+    user3->setProfileImage(QPixmap("situare_user.gif"));
 
     FriendListItem *item3 = new FriendListItem(view);
     item3->setData(user3);
@@ -87,9 +90,11 @@ void TestFriendList::friendListViewClearUnused()
     User *user1 = new User(QString("Address"), QPointF(12.22, 23.33), QString("Name"),
                            QString("Note"), QUrl("http://image.url"), QString("Timestamp"), true,
                            QString("UserID1"), QString("Units"), 44.12);
+    user1->setProfileImage(QPixmap("situare_user.gif"));
     User *user2 = new User(QString("Address"), QPointF(12.22, 23.33), QString("Name"),
                            QString("Note"), QUrl("http://image.url"), QString("Timestamp"), true,
                            QString("UserID2"), QString("Units"), 44.12);
+    user2->setProfileImage(QPixmap("situare_user.gif"));
 
     FriendListItem *item1 = new FriendListItem(view);
     item1->setData(user1);