Merge branch 'map' into integration
authorSami Rämö <sami.ramo@ixonos.com>
Mon, 3 May 2010 13:13:28 +0000 (16:13 +0300)
committerSami Rämö <sami.ramo@ixonos.com>
Mon, 3 May 2010 13:13:28 +0000 (16:13 +0300)
Conflicts:
src/map/mapengine.cpp
src/map/mapengine.h
src/map/mapfetcher.cpp
src/map/mapfetcher.h
src/map/mapscene.cpp
src/map/maptile.cpp
src/map/mapview.cpp
src/src.pro

1  2 
src/map/mapcommon.h
src/map/mapengine.cpp
src/map/mapengine.h
src/map/mapscene.cpp
src/src.pro
src/ui/mapviewscreen.cpp

@@@ -33,21 -33,6 +33,20 @@@ const int MAX_MAP_ZOOM_LEVEL = 18; ///
  const int MIN_VIEW_ZOOM_LEVEL = 2; ///< Minimum zoom level for MapView
  const int MIN_MAP_SCENE_NORMAL_LEVEL = MAX_MAP_ZOOM_LEVEL + 1;
  
 +/**
- * \var FRIEND_LOCATION_ICON_Z_LEVEL
- * \brief layer of friend location icon
++* @var FRIEND_LOCATION_ICON_Z_LEVEL
++* @brief layer of friend location icon
 +*/
 +const int FRIEND_LOCATION_ICON_Z_LEVEL = MIN_MAP_SCENE_NORMAL_LEVEL + MAX_MAP_ZOOM_LEVEL + 1;
 +
 +/**
- * \var OWN_LOCATION_ICON_Z_LEVEL
- * \brief layer of own location icon
++* @var OWN_LOCATION_ICON_Z_LEVEL
++* @brief layer of own location icon
 +*/
 +const int OWN_LOCATION_ICON_Z_LEVEL = FRIEND_LOCATION_ICON_Z_LEVEL + 1;
 +
 +const int MAP_ZOOM_PANEL_LEVEL = OWN_LOCATION_ICON_Z_LEVEL + 1; ///< Zepth of zoom panel (Z-axis)
 +
  const int ZOOM_FPS = 30; ///< FPS for the zoom effect
  const qreal ZOOM_TIME = 250; ///< Length of the zoom effect (ms)
  
@@@ -57,8 -43,8 +56,7 @@@ static const int MAP_ZOOM_PANEL_POSITIO
  static const int MAP_ZOOM_PANEL_BUTTON_SIZE = 74; ///< Size of a zoom panel button
  
  static const int MAP_OWN_LOCATION_ICON_SIZE = 24; ///< Size of own location item icon
 -static const int OWN_LOCATION_ICON_Z_LEVEL = MAP_ZOOM_PANEL_LEVEL - 1; ///< Z-Level of own location icon
  
  const qreal MAX_LATITUDE = 85.05112877980659237802;  ///< Maximum latitude value
  const qreal MIN_LATITUDE = -MAX_LATITUDE; ///< Minimum latitude value
  const qreal MIN_LONGITUDE = -180.0;  ///< Minimum longitude value
@@@ -73,8 -59,8 +71,8 @@@ const qreal DEFAULT_LATITUDE = 65.0000
  const int GRID_PADDING = 1;  ///< Grid padding used in tile grid calculation
  
  /**
--* \var UNDEFINED
--* \brief Value to be used when zoom level, tile numbers or position are not defined
++* @var UNDEFINED
++* @brief Value to be used when zoom level, tile numbers or position are not defined
  */
  const int UNDEFINED = -1;
  
Simple merge
@@@ -144,20 -140,8 +144,11 @@@ public slots
      */
      void viewResized(const QSize &size);
  
 +    void receiveOwnLocation(User *user);
 +    void receiveFriendLocations(QList<User *> &friendsList);
 +
  private:
      /**
-     * @brief Build URL for donwloading single map tile from OpenStreetMap tile server
-     *
-     * @param zoomLevel Zoom level
-     * @param tileNumbers Tile x & y numbers
-     * @return URL for the required tile
-     */
-     QUrl buildURL(int zoomLevel, QPoint tileNumbers);
-     /**
      * @brief Calculate grid of tile coordinates from current scene coordinate.
      *
      * Grid size is calculated from view size and scene's current center coordinate.
@@@ -129,10 -109,13 +109,12 @@@ void MapScene::removeStackedTiles(MapTi
      foreach (QGraphicsItem *collidingItem, collidingItems) {
          MapTile *collidingTile = dynamic_cast<MapTile *>(collidingItem);
          if (collidingTile) {
-              // remove tile if it is fully obscured by new tile
-             QRectF collidingTileSceneRect = collidingTile->sceneBoundingRect();
-             if (newTileSceneRect.contains(collidingTileSceneRect))
-                 removeTile(collidingTile);
+             if (newTile->zValue() > collidingTile->zValue()) {
+                 // remove tile if it is fully obscured by new tile
+                 QRectF collidingTileSceneRect = collidingTile->sceneBoundingRect();
+                 if (newTileSceneRect.contains(collidingTileSceneRect))
+                     removeTile(collidingTile);
+             }
 -
          }
      }
  }
diff --cc src/src.pro
@@@ -29,9 -27,6 +29,8 @@@ SOURCES += main.cpp 
      ui/infotab.cpp \
      ui/updatelocation/updatelocationdialog.cpp \
      ui/updatelocation/texteditautoresizer.cpp \
 +    ui/friendlistview.cpp \
 +    ui/friendlistitem.cpp \
-     engine/engine.cpp \
      user/user.cpp \
      ui/buttonitem.cpp \
      ui/situareuser.cpp \
@@@ -61,16 -56,15 +62,17 @@@ HEADERS += ui/mainwindow.h 
      facebookservice/facebookcredentials.h \
      facebookservice/facebookauthentication.h \
      facebookservice/facebookcommon.h \
 +    ui/friendlistview.h \
 +    ui/friendlistitem.h \
-     engine/engine.h \
 +    user/user.h \
      ui/buttonitem.h \
      ui/situareuser.h \
-     ui/settingsdialog.h
+     engine/engine.h \
 -    user/user.h \
+     ui/settingsdialog.h \
+     map/maptilerequest.h
  QT += network \
      webkit
+ DEFINES += QT_NO_DEBUG_OUTPUT
  !maemo5 { 
      message(QJson built in)
      message(Make sure you have QJson development headers installed)
Simple merge