From: Ville Tiensuu Date: Mon, 3 May 2010 07:17:30 +0000 (+0300) Subject: final fixing X-Git-Tag: v0.3~2^2~5 X-Git-Url: http://git.maemo.org/git/?a=commitdiff_plain;h=b17f85ed2fd2a53c9707c291fac1d2a1610de727;p=situare final fixing --- diff --git a/src/map/friendlocationitem.cpp b/src/map/friendlocationitem.cpp index 06fb3ec..9df90b0 100644 --- a/src/map/friendlocationitem.cpp +++ b/src/map/friendlocationitem.cpp @@ -29,6 +29,7 @@ FriendLocationItem::FriendLocationItem(const QPixmap &icon, const QPointF &friendsLocation, QObject *parent) { + Q_UNUSED(parent); qDebug() << __PRETTY_FUNCTION__; setPixmap(icon); diff --git a/src/map/friendlocationitem.h b/src/map/friendlocationitem.h index 7481977..e90dd0b 100644 --- a/src/map/friendlocationitem.h +++ b/src/map/friendlocationitem.h @@ -27,23 +27,66 @@ #include "baselocationitem.h" +/** +* @brief Class that shows friends location icons on the map +* +* @class FriendLocationItem friendlocationitem.h "map/friendlocationitem.h" +* @author Ville Tiensuu +*/ class FriendLocationItem : public BaseLocationItem { Q_OBJECT -public: +public: + + /** + * @brief Constructor of FriendLocationItem. + * Sets position to specified location. + * Loads and sets default pixmap that is show on the map. + * Sets default Z-value. + * Sets offset so that achor of the picture is at the origin. this feature is + * needed to center icon on the middle of the location. + * Sets item to ignore transformations. this feature is needed to make icon on the map + * immune to scaling + * + * @param icon friends Facebook profile picture, friendsLocation Position in QPoinF, parent + */ FriendLocationItem(const QPixmap &icon, const QPointF &friendsLocation, QObject *parent = 0); + + /** + * @brief sets friends Facebook profile picture that is show on the map. + * + * @param icon friends Facebook profile picture + */ void setIcon(const QPixmap &icon); + + /** + * @brief sets name for friend. + * + * @param name friends name + */ void setName(const QString &name); signals: + + /** + * @brief signal is emitted when friends icon is clicked on the map + * + * @param name friends name + */ void iconClicked(QString name); protected: + + /** + * @brief method that detects when friend icon is clicked + * + * @param event detects the mouse click (same as touch in maemo) + */ void mousePressEvent(QGraphicsSceneMouseEvent *event); private: - QString *m_name; + QString *m_name; ///< Friends name }; #endif // FRIENDLOCATIONITEM_H diff --git a/src/map/ownlocationitem.h b/src/map/ownlocationitem.h index f5a4063..a1650fc 100644 --- a/src/map/ownlocationitem.h +++ b/src/map/ownlocationitem.h @@ -41,7 +41,7 @@ public: /** * @brief Constructor of OwnLocationItem. - * Sets position to default location. + * Sets position to specified location. * Loads and sets default pixmap that is show on the map. * Sets default Z-value. * Sets offset so that achor of the picture is at the origin. this feature is diff --git a/tests/map/ownlocationitem/testownlocationitem.cpp b/tests/map/ownlocationitem/testownlocationitem.cpp index 7bda338..218ff18 100644 --- a/tests/map/ownlocationitem/testownlocationitem.cpp +++ b/tests/map/ownlocationitem/testownlocationitem.cpp @@ -40,7 +40,7 @@ namespace TestOwnLocation // Test data for function is defined in namespace const QPointF testLocationPoint(65.525, 25.345); const QPointF defaultLocationPoint(DEFAULT_LONGITUDE,DEFAULT_LATITUDE); const QPointF locationIconOffset(-MAP_OWN_LOCATION_ICON_SIZE/2, -MAP_OWN_LOCATION_ICON_SIZE/2); - const int itemIgnoresTransformationsFlagValue = 0x20; + const int itemIgnoresTransformationsFlagValue = 0x20; } using namespace TestOwnLocation; @@ -58,8 +58,7 @@ class TestOwnLocationItem: public QObject /** * @brief Test method for constructors. - * Creates instance of OwnLocationItem using three different constructors and tests - * that positions are set correctly. + * Tests that positions are set correctly. * Tests that Z-values are set correctly. * Tests that offses are set correctly. * Tests that ItemIgnoresTransformations flag is set. @@ -70,7 +69,7 @@ class TestOwnLocationItem: public QObject * @brief Creates instance of OwnLocationItem. * Sets test position for location item in geographic coordinates. * Reads position from location item in scene coordinates and - * verifies that it correctly formed. + * verifies that it is correctly formed. */ void testSetAndGetPosition();