[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdeedu/marble/src/plugins/render/panoramio
From:       Shashank Singh <shashank.personal () gmail ! com>
Date:       2009-03-07 17:45:22
Message-ID: 1236447922.339479.15246.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 936460 by ssingh:

simple optimization changes , appending only those images to qlist which
are non-zero sized, but still doesn;t seems to be working..would see
rest of it tommroow


 M  +10 -6     PanoramioPlugin.cpp  
 M  +6 -5      jsonparser.cpp  


--- trunk/KDE/kdeedu/marble/src/plugins/render/panoramio/PanoramioPlugin.cpp \
#936459:936460 @@ -104,7 +104,7 @@
             painter->setPen(Qt::Dense1Pattern);
             painter->setPen(Qt::white);
             painter->drawRect(GeoDataCoordinates(parsedData[x].longitude, \
parsedData[x].latitude, 0.0, GeoDataCoordinates::Degree),/*parsedData[x].height , \
                parsedData[x].width*/50, 50);
-             qDebug() <<"Shanky: Coordinates are lon-lat: " << \
parsedData[x].longitude << parsedData[x].latitude; +             qDebug() <<"__func__ \
" << parsedData[x].longitude << parsedData[x].latitude;  }
     }
     //qDebug() << "deltas" << west - deltaWest << east - deltaEast << south - \
deltaSouth << north - deltaNorth; @@ -118,18 +118,22 @@
 
 void PanoramioPlugin::slotJsonDownloadComplete(QString relativeUrlString, QString \
id)  {
+
+	qDebug()<<"::::::::::::::::::::::::::::::::"<<__func__;
     disconnect(m_downloadManager, SIGNAL(downloadComplete(QString, QString)), this, \
                SLOT(slotJsonDownloadComplete(QString , QString)));
     connect(m_downloadManager, SIGNAL(downloadComplete(QString, QString)), this, \
SLOT(slotImageDownloadComplete(QString , QString)));  
     for (int x = 0; x < numberOfImagesToShow; ++x) {
         temp = panoramioJsonParser.parseObjectOnPosition(QString::fromUtf8(m_storagePolicy->data(id)), \
x); +        if (!m_storagePolicy->fileExists(temp.photo_title) || \
temp.photo_file_url != "TypeError: not an object") { +
         parsedData.append(temp);
-//	qDebug()<<temp.photo_file_url;
-        if (!m_storagePolicy->fileExists(temp.photo_title)) {
-            m_downloadManager->addJob(QUrl(temp.photo_file_url), temp.photo_title, \
                QString::number(x));
-           qDebug() << "adding " << temp.photo_title;
+        qDebug()<<__func__<<"url"<<temp.photo_file_url;
+    
+	 m_downloadManager->addJob(QUrl(temp.photo_file_url), temp.photo_title, \
QString::number(x)); +           qDebug() << __func__ <<"adding " << \
temp.photo_title;  }
-       // qDebug() << ":::::::shanky1" << temp.photo_file_url;
+        qDebug() <<__func__<< ":::::::shanky1" << temp.photo_file_url;
     }
 
 //         HttpJob *job = new HttpJob ( sourceUrl, destFileName, id );
--- trunk/KDE/kdeedu/marble/src/plugins/render/panoramio/jsonparser.cpp \
#936459:936460 @@ -9,7 +9,7 @@
 
 jsonParser::jsonParser()
 {
-   myEngine.setProcessEventsInterval(10);//this lets the gui remain responsive
+//   myEngine.setProcessEventsInterval(10);//this lets the gui remain responsive
 }
 
 jsonParser::~jsonParser()
@@ -24,11 +24,11 @@
     myEngine.evaluate(QString("function height(x){return \
                myJSONObject.photos[x].height};"));
     myEngine.evaluate(QString("function latitude(x){return \
                myJSONObject.photos[x].latitude};"));
     myEngine.evaluate(QString("function longitude (x){return \
                myJSONObject.photos[x].longitude};"));
-   myEngine.evaluate(QString("function owner_id(x){return \
                myJSONObject.photos[x].owner_id};"));
-   myEngine.evaluate(QString("function photo_file_url(x){return \
myJSONObject.photos[x].photo_file_url};")); +    myEngine.evaluate(QString("function \
owner_id(x){return myJSONObject.photos[x].owner_id};")); +    \
myEngine.evaluate(QString("function photo_file_url(x){return \
myJSONObject.photos[x].photo_file_url};"));  
 	
-     dataStorage.count = myEngine.evaluate("count();").toInteger();
+    dataStorage.count = myEngine.evaluate("count();").toInteger();
 
 /*    dataStorage.height = myEngine.evaluate(QString("return myJSONObject.photos[")
                                            + QString::number(requiredObjectPosition)
@@ -72,7 +72,8 @@
 	dataStorage.longitude=myEngine.evaluate(QString("longitude(x)")).toNumber();
 	dataStorage.latitude=myEngine.evaluate(QString("latitude(x)")).toNumber();
 	dataStorage.photo_file_url=myEngine.evaluate(QString("photo_file_url(x)")).toString();
                
-//qDebug()<<":::::::"<<myEngine.evaluate("longitude(x)").toNumber();
+
+qDebug()<<":::::::"<<myEngine.evaluate("longitude(x)").toNumber();
     return dataStorage;
 }
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic