Sorted includes alphabetically.
authorJussi Laitinen <jupe@l3l7588.ixonos.local>
Wed, 11 Aug 2010 10:02:40 +0000 (13:02 +0300)
committerJussi Laitinen <jupe@l3l7588.ixonos.local>
Wed, 11 Aug 2010 10:02:40 +0000 (13:02 +0300)
21 files changed:
src/ui/extendedlistitem.cpp
src/ui/extendedlistitem.h
src/ui/extendedlistitemdelegate.cpp
src/ui/extendedlistitemdelegate.h
src/ui/extendedlistitemstore.cpp
src/ui/extendedlistitemstore.h
src/ui/friendlistitem.cpp
src/ui/friendlistitem.h
src/ui/friendlistitemdelegate.h
src/ui/friendlistpanel.cpp
src/ui/friendlistpanel.h
src/ui/friendlistview.cpp
src/ui/friendlistview.h
src/ui/listitem.cpp
src/ui/listitem.h
src/ui/listitemdelegate.cpp
src/ui/listitemdelegate.h
src/ui/listview.cpp
src/ui/listview.h
src/ui/locationlistitem.h
src/ui/locationlistview.h

index f5d18be..a8974b8 100644 (file)
@@ -24,8 +24,8 @@
 #include <QPainter>
 
 #include "../common.h"
-#include "listcommon.h"
 #include "extendedlistitemstore.h"
+#include "listcommon.h"
 
 #include "extendedlistitem.h"
 
index 440d300..5c59c0a 100644 (file)
@@ -1,3 +1,25 @@
+/*
+   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 EXTENDEDLISTITEM_H
 #define EXTENDEDLISTITEM_H
 
@@ -7,6 +29,8 @@ class ExtendedListItemStore;
 
 /**
 * @brief Base class for extended list items.
+*
+* @author Jussi Laitinen - jussi.laitinen (at) ixonos.com
 */
 class ExtendedListItem : public ListItem
 {
index 6826945..13b60bc 100644 (file)
@@ -1,3 +1,24 @@
+/*
+   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 <QPainter>
 #include <QDebug>
 #include <QRect>
@@ -48,7 +69,7 @@ void ExtendedListItemDelegate::paint(QPainter *painter, const QStyleOptionViewIt
                 text = itemStore->shortenedText();
             }
 
-            QRect iconRect = QRect(itemRect.left() + MARGIN*3,
+            QRect iconRect = QRect(itemRect.left() + MARGIN * 3,
                                        previousSubItemTextRectBottom + ICON_MARGIN,
                                        ICON_WIDTH, ICON_HEIGHT);
 
index c5da470..26ba120 100644 (file)
@@ -1,3 +1,24 @@
+/*
+   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 EXTENDEDLISTITEMDELEGATE_H
 #define EXTENDEDLISTITEMDELEGATE_H
 
@@ -5,6 +26,8 @@
 
 /**
 * @brief Defines ExtendedListItem style.
+*
+* @author Jussi Laitinen - jussi.laitinen (at) ixonos.com
 */
 class ExtendedListItemDelegate : public ListItemDelegate
 {
index 1bff51e..603ca8d 100644 (file)
@@ -1,3 +1,24 @@
+/*
+   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 "extendedlistitemstore.h"
index 7e00228..9b37760 100644 (file)
@@ -1,3 +1,25 @@
+/*
+   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 EXTENDEDLISTITEMSTORE_H
 #define EXTENDEDLISTITEMSTORE_H
 
@@ -7,6 +29,8 @@
 
 /**
 * @brief Stores ExtendedListItem data.
+*
+* @author Jussi Laitinen - jussi.laitinen (at) ixonos.com
 */
 class ExtendedListItemStore
 {
index f3ffc68..f2e4e05 100644 (file)
 
 #include "friendlistitem.h"
 
-const int WALK_DISTANCE = 5;        ///< Walk distance limit for distance icon
-const int CAR_DISTANCE = 500;       ///< Car distance limit for distance icon
 const int AEROPLANE_DISTANCE = 5000;///< Aeroplane distance limit for distance icon
+const int CAR_DISTANCE = 500;       ///< Car distance limit for distance icon
+const int WALK_DISTANCE = 5;        ///< Walk distance limit for distance icon
 
 FriendListItem::FriendListItem()
-    : m_user(0)
 {
     qDebug() << __PRETTY_FUNCTION__;
 
@@ -45,14 +44,7 @@ GeoCoordinate FriendListItem::coordinates()
 {
     qDebug() << __PRETTY_FUNCTION__;
 
-    return m_user->coordinates();
-}
-
-QString FriendListItem::id() const
-{
-    qDebug() << __PRETTY_FUNCTION__;
-
-    return m_user->userId();
+    return m_coordinates;
 }
 
 void FriendListItem::setUserData(User *user)
@@ -60,11 +52,10 @@ void FriendListItem::setUserData(User *user)
     qDebug() << __PRETTY_FUNCTION__;
 
     if(user) {
-        m_user = user;
 
         QString unit;
         double value;
-        m_user->distance(value, unit);
+        user->distance(value, unit);
         QString distanceText = QString::number(value) + " " + unit;
         setData(DISTANCE_TEXT_DISPLAY_INDEX, distanceText);
         setDistanceIcon(value, unit);
@@ -77,17 +68,18 @@ void FriendListItem::setUserData(User *user)
         QRect distanceRect = distanceTextFontMetrics.boundingRect(distanceText);
 
         setData(DISTANCE_SIZE_HINT_INDEX, distanceRect);
-        setName(shortenText(m_user->name(), NAME_TEXT_MAX_WIDTH - distanceRect.width() + MARGIN,
+        setName(shortenText(user->name(), NAME_TEXT_MAX_WIDTH - distanceRect.width() + MARGIN,
                             ListItem::TEXT_SIZE_NORMAL));
+        setCoordinates(user->coordinates());
 
-        if (!m_user->profileImage().isNull())
-            setImage(m_user->profileImage());
+        if (!user->profileImage().isNull())
+            setImage(user->profileImage());
 
         clearSubItems();
 
-        addSubItem(m_user->note(), QPixmap(":/res/images/envelope.png"));
-        addSubItem(m_user->address(), QPixmap(":/res/images/compass.png"));
-        addSubItem(m_user->timestamp(), QPixmap(":/res/images/clock.png"));
+        addSubItem(user->note(), QPixmap(":/res/images/envelope.png"));
+        addSubItem(user->address(), QPixmap(":/res/images/compass.png"));
+        addSubItem(user->timestamp(), QPixmap(":/res/images/clock.png"));
     }
 }
 
@@ -99,6 +91,13 @@ void FriendListItem::setAvatarImage(const QPixmap &image)
         setImage(image);
 }
 
+void FriendListItem::setCoordinates(const GeoCoordinate &coordinates)
+{
+    qDebug() << __PRETTY_FUNCTION__;
+
+    m_coordinates = coordinates;
+}
+
 void FriendListItem::setDistanceIcon(double value, const QString &unit)
 {
     qDebug() << __PRETTY_FUNCTION__;
index a83a970..ee39146 100644 (file)
 #ifndef FRIENDLISTITEM_H
 #define FRIENDLISTITEM_H
 
-#include "../user/user.h"
+#include "coordinates/geocoordinate.h"
 #include "extendedlistitem.h"
 
+class User;
+
 /**
 * @brief List item stores information about friends.
+*
+* @author Jussi Laitinen - jussi.laitinen (at) ixonos.com
 */
 class FriendListItem : public ExtendedListItem
 {
@@ -44,17 +48,6 @@ public:
     */
     ~FriendListItem();
 
-/*******************************************************************************
- * BASE CLASS INHERITED AND REIMPLEMENTED MEMBER FUNCTIONS
- ******************************************************************************/
-public:
-    /**
-    * @brief Returns item's ID.
-    *
-    * @return item's ID
-    */
-    QString id() const;
-
 /******************************************************************************
 * MEMBER FUNCTIONS AND SLOTS
 ******************************************************************************/
@@ -67,6 +60,13 @@ public:
     GeoCoordinate coordinates();
 
     /**
+    * @brief Sets item's coordinates.
+    *
+    * @param coordinates GeoCoordinate
+    */
+    void setCoordinates(const GeoCoordinate &coordinates);
+
+    /**
     * @brief Set user data for this item.
     *
     * @param user User pointer
@@ -95,7 +95,7 @@ private:
 * DATA MEMBERS
 ******************************************************************************/
 private:
-    User *m_user;                   ///< User data
+    GeoCoordinate m_coordinates;    ///< User coordinates
 };
 
 #endif // FRIENDLISTITEM_H
index df7355f..e12b30f 100644 (file)
@@ -28,6 +28,8 @@
 * @brief Displays FriendListItem.
 *
 * Class is used to display FriendListItem data.
+*
+* @author Jussi Laitinen - jussi.laitinen (at) ixonos.com
 */
 class FriendListItemDelegate : public ExtendedListItemDelegate
 {
index 56ad1d9..5aeec03 100644 (file)
     USA.
  */
 
+#include "../user/user.h"
 #include "coordinates/geocoordinate.h"
-#include "friendlistview.h"
 #include "friendlistitem.h"
 #include "friendlistitemdelegate.h"
+#include "friendlistview.h"
 #include "panelcommon.h"
 
 #include "friendlistpanel.h"
index 26bf2db..3f49bc2 100644 (file)
@@ -5,6 +5,7 @@
         Kaj Wallin - kaj.wallin@ixonos.com
         Henri Lampela - henri.lampela@ixonos.com
         Pekka Nissinen - pekka.nissinen@ixonos.com
+        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
@@ -40,8 +41,7 @@ class User;
  * @author Kaj Wallin - kaj.wallin (at) ixonos.com
  * @author Henri Lampela - henri.lampela (at) ixonos.com
  * @author Pekka Nissinen - pekka.nissinen (at) ixonos.com
- *
- * @class FriendListPanel friendlistpanel.h "ui/friendlistpanel.h"
+ * @author Jussi Laitinen - jussi.laitinen (at) ixonos.com
  */
 class FriendListPanel : public QWidget
 {
index ec4ae30..0f4a840 100644 (file)
@@ -1,3 +1,26 @@
+/*
+   Situare - A location system for Facebook
+   Copyright (C) 2010  Ixonos Plc. Authors:
+
+       Kaj Wallin - kaj.wallin@ixonos.com
+       Henri Lampela - henri.lampela@ixonos.com
+       Pekka Nissinen - pekka.nissinen@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 "friendlistitem.h"
 
 #include "friendlistview.h"
index 5d0304f..eade9cc 100644 (file)
@@ -1,3 +1,25 @@
+/*
+   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 FRIENDLISTVIEW_H
 #define FRIENDLISTVIEW_H
 
@@ -5,6 +27,8 @@
 
 /**
 * @brief Shows FriendListItems in list view.
+*
+* @author Jussi Laitinen - jussi.laitinen (at) ixonos.com
 */
 class FriendListView : public ListView
 {
index 6ca1b99..71cdccc 100644 (file)
 #include <QDebug>
 #include <QPainter>
 
-#include "listitem.h"
-#include "listcommon.h"
 #include "../common.h"
+#include "listcommon.h"
+
+#include "listitem.h"
 
 ListItem::ListItem()
 {
index 254fafd..60bfdd7 100644 (file)
@@ -28,6 +28,8 @@
 * @brief Base class for list items.
 *
 * Stores item's name and image and includes method to shorten texts.
+*
+* @author Jussi Laitinen - jussi.laitinen (at) ixonos.com
 */
 class ListItem : public QListWidgetItem
 {
@@ -47,13 +49,6 @@ public:
 * MEMBER FUNCTIONS AND SLOTS
 ******************************************************************************/
     /**
-    * @brief Returns item's ID.
-    *
-    * @return item's ID
-    */
-    virtual QString id() const = 0;
-
-    /**
     * @brief Returns item's name.
     *
     * @return item's name
index b350db4..c1d3094 100644 (file)
    USA.
 */
 
-#include <QPainter>
 #include <QDebug>
+#include <QPainter>
 
-#include "listitemdelegate.h"
-#include "listitem.h"
 #include "../common.h"
-#include "listcommon.h"
 #include "avatarimage.h"
+#include "listcommon.h"
+#include "listitem.h"
+
+#include "listitemdelegate.h"
 
-const int BACKGROUND_BOTTOM_HEIGHT = 15;
-const int BACKGROUND_TOP_HEIGHT = 20;
-const int NAME_TOP_MARGIN = 40;
+const int BACKGROUND_BOTTOM_HEIGHT = 15;    ///< Background image bottom height
+const int BACKGROUND_TOP_HEIGHT = 20;       ///< Background image top height
+const int NAME_TOP_MARGIN = 40;             ///< Name text top margin
 
 ListItemDelegate::ListItemDelegate(QWidget *parent) :
     QStyledItemDelegate(parent)
@@ -70,13 +71,13 @@ void ListItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opti
 
     //Image is set, draw image and text
     if (!image.isNull()) {
-        painter->drawPixmap(itemRect.left() + MARGIN*2, itemRect.top(), image);
-        painter->drawText(itemRect.topLeft() + QPoint(MARGIN*2 + IMAGE_WIDTH + MARGIN,
+        painter->drawPixmap(itemRect.left() + MARGIN * 2, itemRect.top(), image);
+        painter->drawText(itemRect.topLeft() + QPoint(MARGIN * 2 + IMAGE_WIDTH + MARGIN,
                                                       NAME_TOP_MARGIN), name);
     }
     //Draw only text
     else {
-        painter->drawText(itemRect.topLeft() + QPoint(MARGIN*3, NAME_TOP_MARGIN), name);
+        painter->drawText(itemRect.topLeft() + QPoint(MARGIN * 3, NAME_TOP_MARGIN), name);
     }
 }
 
index e9a2c64..524b26a 100644 (file)
@@ -28,6 +28,8 @@
 * @brief Displays ListItem.
 *
 * Class is used to display ListItem data.
+*
+* @author Jussi Laitinen - jussi.laitinen (at) ixonos.com
 */
 class ListItemDelegate : public QStyledItemDelegate
 {
index b6f2d20..cc3be74 100644 (file)
@@ -103,7 +103,7 @@ void ListView::filter(const QList<QString> &itemIDs)
     qDebug() << __PRETTY_FUNCTION__;
 
     foreach (ListItem *item, m_listItems) {
-        if (itemIDs.contains(item->id()))
+        if (itemIDs.contains(m_listItems.key(item)))
             setItemHidden(item, false);
         else
             setItemHidden(item, true);
index 7288728..4cbb3d9 100644 (file)
@@ -32,6 +32,8 @@ class ListItem;
 *
 * ListView is used to show ListItems in list view. Items can be added, removed or
 * filtered.
+*
+* @author Jussi Laitinen - jussi.laitinen (at) ixonos.com
 */
 class ListView : public QListWidget
 {
index 90aedb9..b4661bd 100644 (file)
@@ -1,3 +1,24 @@
+/*
+   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 LOCATIONLISTITEM_H
 #define LOCATIONLISTITEM_H
 
@@ -6,6 +27,8 @@
 
 /**
 * @brief List item stores information about location results.
+*
+* @author Jussi Laitinen - jussi.laitinen (at) ixonos.com
 */
 class LocationListItem : public ExtendedListItem
 {
index 19af2a0..c26934e 100644 (file)
@@ -1,3 +1,24 @@
+/*
+   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 LOCATIONLISTVIEW_H
 #define LOCATIONLISTVIEW_H
 
@@ -5,6 +26,8 @@
 
 /**
 * @brief Shows LocationListItems in list view.
+*
+* @author Jussi Laitinen - jussi.laitinen (at) ixonos.com
 */
 class LocationListView : public ListView
 {