Fixing defects found in the review
authorKatri Kaikkonen <katri.kaikkonen@ixonos.com>
Wed, 11 Aug 2010 06:35:57 +0000 (09:35 +0300)
committerKatri Kaikkonen <katri.kaikkonen@ixonos.com>
Wed, 11 Aug 2010 06:35:57 +0000 (09:35 +0300)
Reviewed by Sami Rämö

Doxyfile
src/engine/engine.cpp
src/engine/engine.h
src/map/mapengine.h
src/ui/indicatorbutton.cpp
src/ui/indicatorbutton.h
src/ui/indicatorbuttonpanel.cpp
src/ui/indicatorbuttonpanel.h
src/ui/mainwindow.cpp
src/ui/mainwindow.h

index 1665bc2..fb4fb6c 100644 (file)
--- a/Doxyfile
+++ b/Doxyfile
@@ -25,7 +25,7 @@ DOXYFILE_ENCODING      = UTF-8
 # The PROJECT_NAME tag is a single word (or a sequence of words surrounded
 # by quotes) that should identify the project.
 
-PROJECT_NAME           = "Situare client for Maemo"
+PROJECT_NAME           =
 
 # The PROJECT_NUMBER tag can be used to enter a project or revision number.
 # This could be handy for archiving the generated documentation or
@@ -38,7 +38,7 @@ PROJECT_NUMBER         =
 # If a relative path is entered, it will be relative to the location
 # where doxygen was started. If left blank the current directory will be used.
 
-OUTPUT_DIRECTORY       = doc/doxygen/
+OUTPUT_DIRECTORY       =
 
 # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
 # 4096 sub-directories (in 2 levels) under the output directory of each output
@@ -302,12 +302,12 @@ EXTRACT_ALL            = NO
 # If the EXTRACT_PRIVATE tag is set to YES all private members of a class
 # will be included in the documentation.
 
-EXTRACT_PRIVATE        = YES
+EXTRACT_PRIVATE        = NO
 
 # If the EXTRACT_STATIC tag is set to YES all static members of a file
 # will be included in the documentation.
 
-EXTRACT_STATIC         = YES
+EXTRACT_STATIC         = NO
 
 # If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
 # defined locally in source files will be included in the documentation.
@@ -568,7 +568,7 @@ WARN_LOGFILE           =
 # directories like "/usr/src/myproject". Separate the files or directories
 # with spaces.
 
-INPUT                  = src/
+INPUT                  =
 
 # This tag can be used to specify the character encoding of the source files
 # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
@@ -591,7 +591,7 @@ FILE_PATTERNS          =
 # should be searched for input files as well. Possible values are YES and NO.
 # If left blank NO is used.
 
-RECURSIVE              = YES
+RECURSIVE              = NO
 
 # The EXCLUDE tag can be used to specify files and/or directories that should
 # excluded from the INPUT source files. This way you can easily exclude a
@@ -611,7 +611,7 @@ EXCLUDE_SYMLINKS       = NO
 # against the file with absolute path, so to exclude all test directories
 # for example use the pattern */test/*
 
-EXCLUDE_PATTERNS       = */moc_*
+EXCLUDE_PATTERNS       =
 
 # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
 # (namespaces, classes, functions, etc.) that should be excluded from the
@@ -739,7 +739,7 @@ VERBATIM_HEADERS       = YES
 # of all compounds will be generated. Enable this if the project
 # contains a lot of classes, structs, unions or interfaces.
 
-ALPHABETICAL_INDEX     = YES
+ALPHABETICAL_INDEX     = NO
 
 # If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
 # the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
@@ -948,12 +948,12 @@ ENUM_VALUES_PER_LINE   = 4
 # JavaScript, DHTML, CSS and frames is required (i.e. any modern browser).
 # Windows users are probably better off using the HTML help feature.
 
-GENERATE_TREEVIEW      = YES
+GENERATE_TREEVIEW      = NO
 
 # By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories,
 # and Class Hierarchy pages using a tree view instead of an ordered list.
 
-USE_INLINE_TREES       = YES
+USE_INLINE_TREES       = NO
 
 # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
 # used to set the initial width (in pixels) of the frame in which the tree
@@ -983,7 +983,7 @@ SEARCHENGINE           = YES
 # If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
 # generate Latex output.
 
-GENERATE_LATEX         = NO
+GENERATE_LATEX         = YES
 
 # The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
 # If a relative path is entered the value of OUTPUT_DIRECTORY will be
@@ -1352,7 +1352,7 @@ HIDE_UNDOC_RELATIONS   = YES
 # toolkit from AT&T and Lucent Bell Labs. The other options in this section
 # have no effect if this option is set to NO (the default)
 
-HAVE_DOT               = YES
+HAVE_DOT               = NO
 
 # By default doxygen will write a font called FreeSans.ttf to the output
 # directory and reference it in all dot files that doxygen generates. This
@@ -1400,7 +1400,7 @@ GROUP_GRAPHS           = YES
 # collaboration diagrams in a style similar to the OMG's Unified Modeling
 # Language.
 
-UML_LOOK               = YES
+UML_LOOK               = NO
 
 # If set to YES, the inheritance and collaboration graphs will show the
 # relations between templates and their instances.
index e7eed41..9906d1a 100644 (file)
@@ -167,6 +167,8 @@ void SituareEngine::disableAutoCentering()
 
 void SituareEngine::draggingModeTriggered()
 {
+    qDebug() << __PRETTY_FUNCTION__;
+
     if (m_mce)
         m_mce->vibrationFeedback();
 }
index 77f6e23..e2af9b4 100644 (file)
@@ -307,7 +307,7 @@ signals:
     *        location is changed
     *
     * @param direction Direction in degrees
-    * @param distance Distance in kilometers
+    * @param distance Distance in meters
     * @param draw Should the indicator triangle be drawn or not
     */
     void directionIndicatorValuesUpdate(qreal direction, qreal distance, bool draw);
index 5f54435..f05254e 100644 (file)
@@ -233,6 +233,11 @@ private:
      */
     void setTilesGridSize(const QSize &viewSize);
 
+    /**
+     * @brief Updates direction and distance values to indicator button
+     *
+     * Calculate and update direction and distance values and send those to indicator button
+     */
     void updateDirectionIndicator();
 
     /**
@@ -292,20 +297,20 @@ private slots:
     void mapImageReceived(int zoomLevel, int x, int y, const QPixmap &image);
 
     /**
-    * @brief Called when MapScroller state is changed
-    *
-    * Does check if the smooth scroll effect was interrupted and should the auto centering
-    * feature to be disabled.
-    *
-    * @param newState New state
-    */
+     * @brief Called when MapScroller state is changed
+     *
+     * Does check if the smooth scroll effect was interrupted and should the auto centering
+     * feature to be disabled.
+     *
+     * @param newState New state
+     */
     void scrollerStateChanged(QAbstractAnimation::State newState);
 
     /**
-    * @brief Scroll smoothly to given scene position
-    *
-    * @param coordinate Target position in the scene
-    */
+     * @brief Scroll smoothly to given scene position
+     *
+     * @param coordinate Target position in the scene
+     */
     void scrollToPosition(SceneCoordinate coordinate);
 
     /**
@@ -349,7 +354,7 @@ signals:
     *        location is changed
     *
     * @param direction Direction in degrees
-    * @param distance Distance in kilometers
+    * @param distance Distance in meters
     * @param draw Should the indicator triangle be drawn or not
     */
     void directionIndicatorValuesUpdate(qreal direction, qreal distance, bool draw);
@@ -447,7 +452,7 @@ private:
     QSize m_viewSize;               ///< Current view size
 
     FriendItemsHandler *m_friendItemsHandler;   ///< Handler for friend and group items
-    GeoCoordinate m_gpsPosition;                ///< Lates GPS position
+    GeoCoordinate m_gpsPosition;                ///< Latest GPS position
     GPSLocationItem *m_gpsLocationItem;         ///< Item pointing current location from GPS
     MapFetcher *m_mapFetcher;                   ///< Fetcher for map tiles
     MapRouteItem *m_mapRouteItem;               ///< Map route item
index 6312965..e392bef 100644 (file)
    USA.
 */
 
-#include <QSettings>
-#include <QPainter>
 #include <QDebug>
+#include <QPainter>
+#include <QSettings>
 
-#include "indicatorbutton.h"
-#include "panelcommon.h"
 #include "common.h"
 #include "math.h"
+#include "panelcommon.h"
 
-enum State {OFF, ON};                           ///< Enumerator for led state
-
-const qreal OPACITY = 0.50;                     ///< Opacity of the background in percents
-const int ROUNDING_RADIUS = 9;                  ///< Roundness of the rounded edge
-const int BUTTON_WIDTH = 66;                    ///< Button width
-const int BUTTON_HEIGHT = 66;                   ///< Button height
+#include "indicatorbutton.h"
 
-const qreal M_TO_KM = 1000;                     ///< Meters to kilometers conversion
+enum State {OFF, ON};                       ///< Enumerator for led state
 
 IndicatorButton::IndicatorButton(QWidget *parent)
     : QToolButton(parent),
       m_drawTriangle(false),
       m_direction(0)
 {
+    qDebug() << __PRETTY_FUNCTION__;
+
+    const qreal OPACITY = 0.50;
+    const int BUTTON_WIDTH = 66;
+    const int BUTTON_HEIGHT = 66;
+
     m_indicatorLeds[OFF].load(":res/images/gps_position.png");
     m_indicatorLeds[ON].load(":res/images/gps_position_s.png");
+
     setFixedSize(BUTTON_WIDTH, BUTTON_HEIGHT);
 
     // Normal background
     m_normalColor = new QColor(Qt::black);
     m_normalColor->setAlpha(floor(OPACITY * 255));
 
-    // Selected bakcground
+    // Selected background
     m_selectedGradient = new QLinearGradient(0, 0, 0, this->height());
     m_selectedGradient->setColorAt(0.02, QColor(0, 113, 181));
     m_selectedGradient->setColorAt(0.25, QColor(24, 142, 214));
@@ -74,14 +75,11 @@ IndicatorButton::~IndicatorButton()
     delete m_selectedGradient;
 }
 
-void IndicatorButton::setDirection(qreal direction, bool draw)
+const QPoint& IndicatorButton::eventPosition()
 {
     qDebug() << __PRETTY_FUNCTION__;
 
-    m_direction = direction;
-    m_drawTriangle = draw;
-
-    update();
+    return m_eventPosition;
 }
 
 void IndicatorButton::mouseMoveEvent(QMouseEvent *event)
@@ -111,17 +109,12 @@ void IndicatorButton::mouseReleaseEvent(QMouseEvent *event)
     event->ignore();
 }
 
-const QPoint& IndicatorButton::eventPosition()
-{
-    qDebug() << __PRETTY_FUNCTION__;
-
-    return m_eventPosition;
-}
-
 void IndicatorButton::paintEvent(QPaintEvent *event)
 {
     qDebug() << __PRETTY_FUNCTION__;
 
+    const int ROUNDING_RADIUS = 9;
+
     Q_UNUSED(event);
 
     QPainterPath backgroundPath;
@@ -182,3 +175,13 @@ void IndicatorButton::paintEvent(QPaintEvent *event)
     }
 }
 
+void IndicatorButton::setDirection(qreal direction, bool draw)
+{
+    qDebug() << __PRETTY_FUNCTION__;
+
+    m_direction = direction;
+    m_drawTriangle = draw;
+
+    update();
+}
+
index 2296db6..0380cce 100644 (file)
@@ -2,8 +2,8 @@
     Situare - A location system for Facebook
     Copyright (C) 2010  Ixonos Plc. Authors:
 
-        Kaj Wallin - kaj.wallin@ixonos.com
         Katri Kaikkonen - katri.kaikkonen@ixonos.com
+        Kaj Wallin - kaj.wallin@ixonos.com
         Sami Rämö - sami.ramo@ixonos.com
 
     Situare is free software; you can redistribute it and/or
@@ -25,9 +25,9 @@
 #define INDICATORBUTTON_H
 
 #include <QMouseEvent>
+#include <QTimer>
 #include <QToolButton>
 #include <QWidget>
-#include <QTimer>
 
 /**
  * @brief Indicator button class
index 28e14b6..2d2ada4 100644 (file)
    USA.
 */
 
-#include <QSettings>
-#include <QPainter>
 #include <QDebug>
+#include <QPainter>
+#include <QSettings>
 
-#include "indicatorbuttonpanel.h"
+#include "common.h"
 #include "indicatorbutton.h"
 #include "panelcommon.h"
-#include "common.h"
 
+#include "indicatorbuttonpanel.h"
 
-const int ROUNDING_RADIUS = 9;              ///< Roundness of the background edges
-const qreal OPACITY = 0.50;                 ///< Opacity of the background in percents
+const QString DIRECTION_INDICATOR_BUTTON_POSITION = "DIRECTION_INDICATOR_POSITION";
 
 IndicatorButtonPanel::IndicatorButtonPanel(QWidget *parent)
     : QWidget(parent),
-      m_indicatorButton(0),
       m_isDraggable(false),
       m_distanceText("")
 {
-    /**
-     * @brief Horizontal position of direction indicator button
-     *
-     * @var DIRECTION_INDICATOR_POSITION_X
-     */
-    const int DIRECTION_INDICATOR_POSITION_X = 10 + PANEL_PEEK_AMOUNT;
-    const int DIRECTION_INDICATOR_POSITION_Y = 290;     ///< Vertical position of indicator button
-
-    const QString DIRECTION_INDICATOR_BUTTON_POSITION = "Direction_Indicator_Position";
+    qDebug() << __PRETTY_FUNCTION__;
 
-    const int MARGIN_LEFT = 0;                  ///< Inner margin (left)
-    const int MARGIN_TOP = 3;                   ///< Inner margin (top)
-    const int MARGIN_RIGHT = 0;                 ///< Inner margin (right)
-    const int MARGIN_BOTTOM = 0;                ///< Inner margin (bottom)
-    const int LABEL_MARGIN_TOP = 0;             ///< Distance text label inner margin (top)
+    const int DIRECTION_INDICATOR_POSITION_X = 10 + PANEL_PEEK_AMOUNT;
+    const int DIRECTION_INDICATOR_POSITION_Y = 290;
 
-    const int INDICATOR_BUTTON_PANEL_SPACING = 5;   ///< Size of a indicator button spacing
+    const int INDICATOR_BUTTON_PANEL_SPACING = 5;
 
-    const int PANEL_WIDTH = 90;                 ///< Width of the draggable panel
-    const int PANEL_HEIGHT = 100;               ///< Height of the draggable panel
+    const qreal OPACITY = 0.50;
+    const int MARGIN_LEFT = 0;
+    const int MARGIN_TOP = 3;
+    const int MARGIN_RIGHT = 0;
+    const int MARGIN_BOTTOM = 0;
+    const int LABEL_MARGIN_TOP = 0;
 
-    qDebug() << __PRETTY_FUNCTION__;
+    const int PANEL_WIDTH = 90;
+    const int PANEL_HEIGHT = 100;
 
     QVBoxLayout *verticalLayout = new QVBoxLayout;
     setLayout(verticalLayout);
@@ -107,6 +99,7 @@ IndicatorButtonPanel::IndicatorButtonPanel(QWidget *parent)
 
     connect(m_dragStartTimer, SIGNAL(timeout()),
             this, SLOT(timerExpired()));
+
     connect(m_forceReleaseTimer, SIGNAL(timeout()),
             this, SLOT(forceMouseRelease()));
 
@@ -117,6 +110,14 @@ IndicatorButtonPanel::IndicatorButtonPanel(QWidget *parent)
             this, SIGNAL(autoCenteringTriggered(bool)));
 }
 
+void IndicatorButtonPanel::forceMouseRelease()
+{
+    qDebug() << __PRETTY_FUNCTION__;
+
+    releaseMouse();
+    setDraggable(false);
+}
+
 void IndicatorButtonPanel::mouseMoveEvent(QMouseEvent *event)
 {
     qDebug() << __PRETTY_FUNCTION__;
@@ -147,9 +148,7 @@ void IndicatorButtonPanel::mousePressEvent(QMouseEvent *event)
 {
     qDebug() << __PRETTY_FUNCTION__;
 
-    if (event->button() == Qt::LeftButton)
-        m_dragPosition = event->pos();
-
+    m_dragPosition = event->pos();
     m_dragStartTimer->start();
 }
 
@@ -165,8 +164,6 @@ void IndicatorButtonPanel::mouseReleaseEvent(QMouseEvent *event)
 
         QSettings settings(DIRECTORY_NAME, FILE_NAME);
         settings.setValue(DIRECTION_INDICATOR_BUTTON_POSITION, pos());
-
-        releaseMouse();
     }
 }
 
@@ -180,19 +177,20 @@ void IndicatorButtonPanel::paintEvent(QPaintEvent *event)
     painter.setRenderHint(QPainter::Antialiasing);
 
     if (!m_indicatorButton->isChecked()) {
-        const int ADJUST_LEFT = -5;              ///< Pixels added to the rectangle (left)
-        const int ADJUST_TOP = 0;                ///< Pixels added to the rectangle (top)
-        const int ADJUST_RIGHT = +5;             ///< Pixels added to the rectangle (right)
-        const int ADJUST_BOTTOM = 0;             ///< Pixels added to the rectangle (bottom)
+        const int EXTRA_SPACE_LEFT = -5;
+        const int EXTRA_SPACE_TOP = 0;
+        const int EXTRA_SPACE_RIGHT = +5;
+        const int EXTRA_SPACE_BOTTOM = 0;
 
-        const int RADIUS_WIDTH = 5;              ///< Roundness width
-        const int RADIUS_HEIGHT = 5;             ///< Roundness height
+        const int RADIUS_WIDTH = 5;
+        const int RADIUS_HEIGHT = 5;
 
         QPainterPath backgroundPath;
         QRect distanceLabelRect = m_distanceTextLabel->rect();
 
         distanceLabelRect.translate(m_distanceTextLabel->pos());
-        distanceLabelRect.adjust(ADJUST_LEFT, ADJUST_TOP, ADJUST_RIGHT, ADJUST_BOTTOM);
+        distanceLabelRect.adjust(EXTRA_SPACE_LEFT, EXTRA_SPACE_TOP, EXTRA_SPACE_RIGHT
+                                 , EXTRA_SPACE_BOTTOM);
         backgroundPath.addRoundedRect(distanceLabelRect, RADIUS_WIDTH, RADIUS_HEIGHT);
         painter.fillPath(backgroundPath, QBrush(*m_normalColor));
 
@@ -200,9 +198,10 @@ void IndicatorButtonPanel::paintEvent(QPaintEvent *event)
     }
 
     if(m_isDraggable) {
+        const int ROUNDING_RADIUS = 9;
+
         QPainterPath backgroundPath;
         backgroundPath.addRoundedRect(this->rect(), ROUNDING_RADIUS, ROUNDING_RADIUS);
-        painter.setRenderHint(QPainter::Antialiasing);
         painter.fillPath(backgroundPath, QBrush(Qt::Dense4Pattern));
         painter.setPen(Qt::black);
     }
@@ -213,9 +212,9 @@ void IndicatorButtonPanel::setDraggable(bool mode, QPoint eventPosition)
     qDebug() << __PRETTY_FUNCTION__;
 
     m_isDraggable = mode;
-    emit draggingModeTriggered();
 
     if(mode) {
+        emit draggingModeTriggered();
         grabMouse();
         m_forceReleaseTimer->start();
         m_dragPosition = eventPosition;
@@ -227,11 +226,6 @@ void IndicatorButtonPanel::setDraggable(bool mode, QPoint eventPosition)
     update();
 }
 
-void IndicatorButtonPanel::setIndicatorButtonEnabled(bool enabled)
-{
-        m_indicatorButton->setChecked(enabled);
-}
-
 void IndicatorButtonPanel::screenResized(const QSize &newSize)
 {
     qDebug() << __PRETTY_FUNCTION__;
@@ -270,12 +264,10 @@ void IndicatorButtonPanel::screenResized(const QSize &newSize)
     move(resizedPosition);
 }
 
-void IndicatorButtonPanel::forceMouseRelease()
+void IndicatorButtonPanel::setIndicatorButtonEnabled(bool enabled)
 {
-    qDebug() << __PRETTY_FUNCTION__;
-
-    releaseMouse();
-    setDraggable(false);
+        m_indicatorButton->setChecked(enabled);
+        m_distanceTextLabel->setVisible(!enabled);
 }
 
 void IndicatorButtonPanel::timerExpired()
@@ -289,41 +281,41 @@ void IndicatorButtonPanel::updateValues(qreal direction, qreal distance, bool dr
 {
     qDebug() << __PRETTY_FUNCTION__;
 
-    const int SMALL_REDUCE = 0.5;                   ///< 0.5 meter reduce
-    const int BIG_REDUCE = 100;                     ///< 100 meter reduce
+    const int MAX_TO_METERS = 1000 - 0.5;
+    const int MAX_FOR_KM_WITH_DESIMAL = 100000 - 50;
+    const int MIN_TO_METERS = 10.0;
     const qreal M_TO_KM = 1000.0;                   ///< Meters to kilometers conversion
 
+    QString UNIT_KILOMETER = " km";
+    QString UNIT_METER = " m";
+
     m_indicatorButton->setDirection(direction, draw);
 
     m_distance = distance;
 
-        if(m_distance < 10.0)
-        {
-            m_distanceText.setNum(10);
-            m_distanceText.prepend("< ");
-            m_distanceText.append(" m");
-        }
-        else if(m_distance < 1000 - SMALL_REDUCE)
-        {
-            m_distanceText.setNum(m_distance, 0 , 0);
-            m_distanceText.append(" m");
-        }
-        else if(m_distance < 100000 - BIG_REDUCE)
-        {
-            m_distanceText.setNum(m_distance / M_TO_KM, 1, 1);
-            m_distanceText.append(" km");
-        }
-        else {
-            m_distanceText.setNum(m_distance / M_TO_KM, 0, 0);
-            m_distanceText.append(" km");
-        }
-
-        if (!m_indicatorButton->isChecked()) {
-            m_distanceTextLabel->setText(m_distanceText);
-        }
-        else {
-            m_distanceTextLabel->setText("");
-        }
-        update();
+    if(m_distance < MIN_TO_METERS)
+    {
+        m_distanceText.setNum(10);
+        m_distanceText.prepend("< ");
+        m_distanceText.append(UNIT_METER);
+    }
+    else if(m_distance < MAX_TO_METERS)
+    {
+        m_distanceText.setNum(m_distance, 0 , 0);
+        m_distanceText.append(UNIT_METER);
     }
+    else if(m_distance < MAX_FOR_KM_WITH_DESIMAL)
+    {
+        m_distanceText.setNum(m_distance / M_TO_KM, 1, 1);
+        m_distanceText.append(UNIT_KILOMETER);
+    }
+    else {
+        m_distanceText.setNum(m_distance / M_TO_KM, 0, 0);
+        m_distanceText.append(UNIT_KILOMETER);
+    }
+
+    m_distanceTextLabel->setText(m_distanceText);
+
+    update();
+}
 
index a64fcfd..d547611 100644 (file)
 
 #include <QGraphicsItem>
 #include <QGridLayout>
+#include <QLabel>
 #include <QMouseEvent>
-#include <QWidget>
 #include <QTimer>
-#include <QLabel>
+#include <QWidget>
 
 #include "indicatorbutton.h"
 
@@ -89,21 +89,28 @@ protected:
  * MEMBER FUNCTIONS AND SLOTS
  ******************************************************************************/
 public slots:
-
     /**
-    * @brief Called when direction and distance from current map center point to current GPS
-    *        location is changed
-    *
-    * @param direction Direction in degrees
-    * @param distance Distance in kilometers
-    * @param draw Should the indicator triangle be drawn or not
-    */
+     * @brief Called when direction and distance from current map center point to current GPS
+     *        location is changed
+     *
+     * @param direction Direction in degrees
+     * @param distance Distance in meters
+     * @param draw Should the indicator triangle be drawn or not
+     */
     void updateValues(qreal direction, qreal distance, bool draw);
 
+    /**
+     * @brief Set indicator button enabled.
+     *
+     * @param enabled true if enabled, false otherwise
+     */
     void setIndicatorButtonEnabled(bool enabled);
 
     /**
      * @brief Toggle zoom panel draggability
+     *
+     * @param mode True if draggable, otherwise false
+     * @param distance Start value for dragging
      */
     void setDraggable(bool mode, QPoint eventPosition = QPoint(0,0));
 
@@ -129,7 +136,6 @@ private slots:
  * SIGNALS
  ******************************************************************************/
 signals:
-
     /**
      * @brief Automatic centering setting changed by user
      *
@@ -138,29 +144,24 @@ signals:
     void autoCenteringTriggered(bool enabled);
 
     /**
-    * @brief Signal when direction and distance from current map center point to current GPS
-    *        location is changed
-    *
-    * @param direction Direction in degrees
-    * @param distance Distance in kilometers
-    * @param draw Should the indicator triangle be drawn or not
-    */
+     * @brief Signal when direction and distance from current map center point to current GPS
+     *        location is changed
+     *
+     * @param direction Direction in degrees
+     * @param distance Distance in meters
+     * @param draw Should the indicator triangle be drawn or not
+     */
     void directionIndicatorValuesUpdate(qreal direction, qreal distance, bool draw);
 
     /**
-    * @brief Dragging mode triggered.
-    */
+     * @brief Dragging mode triggered.
+     */
     void draggingModeTriggered();
 
 /*******************************************************************************
  * DATA MEMBERS
  ******************************************************************************/
-//public:
-//    IndicatorButton *m_indicatorButton;     ///< Indicator button
-
 private:
-    IndicatorButton *m_indicatorButton;     ///< Indicator button
-
     bool m_isDraggable;                     ///< Boolean for tracking the draggability state
 
     qreal m_distance;                       ///< Distance to the GPS position
@@ -178,6 +179,7 @@ private:
     QTimer *m_dragStartTimer;               ///< Timer to init draggability of the zoom panel
     QTimer *m_forceReleaseTimer;            ///< Timer to run forceMouseRelease;
 
+    IndicatorButton *m_indicatorButton;     ///< Indicator button
 };
 
 #endif // INDICATORBUTTONPANEL_H
index 500e5b5..dce7243 100644 (file)
@@ -7,6 +7,7 @@
       Jussi Laitinen jussi.laitinen@ixonos.com
       Sami Rämö - sami.ramo@ixonos.com
       Ville Tiensuu - ville.tiensuu@ixonos.com
+      Katri Kaikkonen - katri.kaikkonen@ixonos.com
 
    Situare is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
@@ -34,7 +35,6 @@
 #include "error.h"
 #include "friendlistpanel.h"
 #include "fullscreenbutton.h"
-#include "indicatorbutton.h"
 #include "logindialog.h"
 #include "mapscale.h"
 #include "searchdialog.h"
@@ -64,7 +64,6 @@ MainWindow::MainWindow(QWidget *parent)
     m_password(),
     m_webView(0),
     m_fullScreenButton(0),
-//    m_indicatorButton(0),
     m_indicatorButtonPanel(0),
     m_mapScale(0),
     m_cookieJar(0)
index b61ff22..9c7a95a 100644 (file)
@@ -151,9 +151,8 @@ public:
     const QString username();
 
 public slots:
-
     /**
-     * @brief Build direction indicator button and connect slots
+     * @brief Build direction indicator button panel and connect signals
      */
     void buildIndicatorButtonPanel();
 
@@ -429,7 +428,7 @@ signals:
     *        location is changed
     *
     * @param direction Direction in degrees
-    * @param distance Distance in kilometers
+    * @param distance Distance in meters
     * @param draw Should the indicator triangle be drawn or not
     */
     void directionIndicatorValuesUpdate(qreal direction, qreal distance, bool draw);
@@ -653,7 +652,6 @@ private:
 
     FriendListPanel *m_friendsListPanel;    ///< Instance of friends list panel
     FullScreenButton *m_fullScreenButton;   ///< Instance of the fullscreen toggle button
-//    IndicatorButton *m_indicatorButton;     ///< Instance of direction indicator button
     IndicatorButtonPanel *m_indicatorButtonPanel;     ///< Instance of direction indicator button
     MapScale *m_mapScale;                   ///< Instance of the map scale
     MapView *m_mapView;                     ///< Instance of the map view