backup before test
authorVille Tiensuu <ville.tiensuu@ixonos.com>
Tue, 1 Jun 2010 06:31:30 +0000 (09:31 +0300)
committerVille Tiensuu <ville.tiensuu@ixonos.com>
Tue, 1 Jun 2010 06:31:30 +0000 (09:31 +0300)
src/situareservice/situarecommon.h
src/situareservice/situareservice.cpp
src/ui/avatarimage.cpp
src/ui/sidepanel.h
src/user/user.h

index b047fd0..7cd0e79 100644 (file)
@@ -32,10 +32,14 @@ const QString API_KEY = "4197c64da2fb6b927236feaea32d7d81";
 const QString SITUARE_TEST_URL = "http://emmerichgn.facebook.joyent.us/";
 const QString TEST_API_KEY = "cf77865a5070f2c2ba3b52cbf3371579";
 
+// Situare JSON callback data
+const QString NORMAL_SIZE_PROFILE_IMAGE = "pic";
+
 // Situare PHP scripts
 const QString UPDATE_LOCATION = "updateLocation.php";
 const QString REVERSE_GEO = "reversegeo.php";
-const QString GET_LOCATIONS = "getLocations.php?extra_user_data=pic_big";
+const QString GET_LOCATIONS =
+        QString("getLocations.php?extra_user_data=%1").arg(NORMAL_SIZE_PROFILE_IMAGE);
 
 // Cookies
 const QString COOKIE = "Cookie";
index 7a34ed8..df6ace1 100644 (file)
@@ -326,9 +326,7 @@ void SituareService::parseUserData(const QByteArray &jsonReply)
 
     QPointF coordinates(userMap["longitude"].toReal(), userMap["latitude"].toReal());
 
-    QUrl imageUrl = userMap["pic_big"].toUrl();
-    qWarning() << "IMAGE URL: " << imageUrl;
-
+    QUrl imageUrl = userMap[NORMAL_SIZE_PROFILE_IMAGE].toUrl();
 
     if(imageUrl.isEmpty()) {
         // user doesn't have profile image, so we need to get him a silhouette image
@@ -373,9 +371,10 @@ void SituareService::imageReceived(const QUrl &url, const QPixmap &image)
 
     // assign facebook silhouette image to all who doesn't have a profile image
     if(url == QUrl(SILHOUETTE_URL)) {
-        if(m_user->profileImageUrl().isEmpty()) {            ;
-            m_user->setProfileImage(AvatarImage::create(QPixmap(
-                    ":res/images/big_profile_image.gif")));
+        if(m_user->profileImageUrl().isEmpty()) {            //;
+//            m_user->setProfileImage(AvatarImage::create(QPixmap(
+//                    ":res/images/big_profile_image.gif")));
+            m_user->setProfileImage(AvatarImage::create(image));
         }
         for(int i=0;i < m_friendsList.count();i++) {
             if(m_friendsList.at(i)->profileImageUrl().isEmpty()) {
index 717b3b7..938573d 100644 (file)
@@ -66,12 +66,12 @@ QPixmap AvatarImage::create(const QPixmap &image)
         return avatarImage;
     } else {
 
-        qWarning() << "Avatarimage original size: " << image.width() << image.height();
+        qDebug() << "Avatarimage original size: " << image.width() << image.height();
 
         QPixmap scaledProfileImage = image.scaledToHeight(FORCED_IMAGE_HEIGHT,
                                                           Qt::SmoothTransformation);
 
-        qWarning() << "Avatarimage scaled size:  "
+        qDebug() << "Avatarimage scaled size:  "
                    << scaledProfileImage.width() << scaledProfileImage.height();
 
         //  unsupported image size ratios are drawn without borders.
@@ -89,8 +89,8 @@ QPixmap AvatarImage::create(const QPixmap &image)
             QPainter painter(&avatarImage);           
 
             QPainterPath roundedRect;
-            roundedRect.addRoundedRect(BORDER_OFFSET-1, BORDER_OFFSET-1, scaledProfileImage.width()+1,
-                                       FORCED_IMAGE_HEIGHT+1, ROUNDNESS, ROUNDNESS);
+            roundedRect.addRoundedRect(BORDER_OFFSET, BORDER_OFFSET, scaledProfileImage.width(),
+                                       FORCED_IMAGE_HEIGHT, ROUNDNESS, ROUNDNESS);
             painter.save();
             painter.setClipPath(roundedRect);
             painter.drawPixmap(QPointF(BORDER_OFFSET, BORDER_OFFSET), scaledProfileImage);
index a34cfb5..1b98734 100644 (file)
@@ -19,7 +19,6 @@
     USA.
  */
 
-
 #ifndef SIDEPANEL_H
 #define SIDEPANEL_H
 
index 6f166cd..35d4cf3 100644 (file)
@@ -182,17 +182,16 @@ public:
      ******************************************************************************/
 
 private:
-    bool m_type; ///< placeholder for user type
-    double m_value; ///< placeholder for distance value
-
+    QString m_address; ///< placeholder for address information
     QPointF m_coordinates; ///< placeholder for coordinates
-    QString m_address; ///< placeholder for address information    
     QString m_name; ///< placeholder for name
-    QString m_note; ///< placeholder for note    
-    QString m_timestamp; ///< placeholer for timestamp    
+    QString m_note; ///< placeholder for note
+    QUrl m_profileImageUrl; ///< placeholder for image url
+    QString m_timestamp; ///< placeholer for timestamp
+    bool m_type; ///< placeholder for user type
     QString m_units; ///< placeholder for distance unit type
     QString m_userId; ///< placeholder for userId
-    QUrl m_profileImageUrl; ///< placeholder for image url
+    double m_value; ///< placeholder for distance value
     QPixmap m_profileImage; ///< placeholder for image
 };