[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdeedu/marble/src/plugins/render/twitter
From: Shashank Singh <shashank.personal () gmail ! com>
Date: 2009-02-05 11:45:57
Message-ID: 1233834357.816887.26530.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 921637 by ssingh:
This will atleast make twitter plugina valid plugin , and marble will
load it without complaining though i have commented most of the code in
plugin..and
twitter plugin is itself commented in CmakeLists.txt of
src/plugin/render ..i am still working on reviving this plugin :)
M +3 -3 jsonparser.cpp
M +4 -3 jsonparser.h
M +21 -21 twitterPlugin.cpp
M +7 -6 twitterPlugin.h
--- trunk/KDE/kdeedu/marble/src/plugins/render/twitter/jsonparser.cpp #921636:921637
@@ -15,7 +15,7 @@
{
}
-twitterDataStructure jsonParser::parseObjectOnPosition(const QString &content , int \
requiredObjectPosition) +/*twitterDataStructure \
jsonParser::parseObjectOnPosition(const QString &content , int \
requiredObjectPosition) {
QString temp = "var myJSONObject =" + content;
@@ -53,7 +53,7 @@
+ QString("].text;")).toString();
parsedJsonOutput.insert(iterator , dataStorage);
- /*qDebug() << "in json parser" << myEngine.evaluate(QString("return \
myJSONObject.twitter[" + QString::number(iterator) + "].user.location")).toString() \
<< dataStorage.location;*/ + //qDebug() << "in json parser" << \
myEngine.evaluate(QString("return myJSONObject.twitter[" + QString::number(iterator) \
+ "].user.location")).toString() << dataStorage.location; ++iterator;
}
@@ -73,5 +73,5 @@
// qDebug() << "twitter lan lon text=" << returnStructure.lat << \
returnStructure.lon; return returnStructure;
}
+*/
-
--- trunk/KDE/kdeedu/marble/src/plugins/render/twitter/jsonparser.h #921636:921637
@@ -39,15 +39,15 @@
qreal lon;
};
-class jsonParser : public QObject
+class jsonParser
{
- Q_OBJECT
+
public:
jsonParser();
~jsonParser();
- twitterDataStructure parseObjectOnPosition(const QString &content, int \
requiredObjectPosition); //for parsing single object + /* twitterDataStructure \
parseObjectOnPosition(const QString &content, int requiredObjectPosition); //for \
parsing single object
QList<twitterDataStructure> parseAllObjects(const QString &content, int \
numberOfObjects); //for parsing a list objects
@@ -59,6 +59,7 @@
twitterDataStructure dataStorage;
QScriptEngine myEngine;
+*/
};
--- trunk/KDE/kdeedu/marble/src/plugins/render/twitter/twitterPlugin.cpp \
#921636:921637 @@ -16,15 +16,15 @@
#include <QSize>
#include <QRegExp>
-namespace Marble
-{
+using namespace Marble;
+
/**
Right now this plugin displays public twit from Twitter , and gecocodes [i.e getting \
lat lon from a given street address] using Google Map API , i plan to extend it to \
use OSM GeoCoding in net few days :) [The API key has been taken for my personal \
website , please don't misuse it :) ]
*/
twitterPlugin::~twitterPlugin()
{
- delete m_storagePolicy;
+// delete m_storagePolicy;
}
QStringList twitterPlugin::backendTypes() const
@@ -70,10 +70,10 @@
void twitterPlugin::initialize()
{
- privateFlagForRenderingTwitts = 0;
- m_storagePolicy = new CacheStoragePolicy(MarbleDirs::localPath() + "/cache/");
- m_downloadManager = new HttpDownloadManager(QUrl("http://twiter.com"), \
m_storagePolicy);
- downloadtwitter(0, 0, 0.0, 0.0, 0.0, 0.0);
+// privateFlagForRenderingTwitts = 0;
+ // m_storagePolicy = new CacheStoragePolicy(MarbleDirs::localPath() + "/cache/");
+// m_downloadManager = new HttpDownloadManager(QUrl("http://twiter.com"), \
m_storagePolicy); + // downloadtwitter(0, 0, 0.0, 0.0, 0.0, 0.0);
// qDebug() << "twitter plugin was started";
}
@@ -91,32 +91,32 @@
brush.setStyle(Qt::SolidPattern);
painter->setBrush(brush);
- if (privateFlagForRenderingTwitts >= 1) {
- for (int counter = 0;counter < 4;counter++)
- painter->drawAnnotation(twitsWithLocation[counter].location,
+ if (/*privateFlagForRenderingTwitts >= */1) {
+ for (int counter = 0;counter < 4;counter++);
+ /*painter->drawAnnotation(twitsWithLocation[counter].location,
parsedData[counter].user + " said \n"
+ parsedData[counter].text,
- QSize(140, 140));
+ QSize(140, 140) ;*/
} else {
- painter->drawAnnotation(GeoDataCoordinates(0.0, 0.0, 0.0,
+ /*painter->drawAnnotation(oDataCoordinates(0.0, 0.0, 0.0,
GeoDataCoordinates::Degree),
- "Twitts are being Downlaoded @Twitter Plugin");
+ "Twitts are being Downlaoded @Twitter Plugin");*/
}
return true;
}
-
+/*
void twitterPlugin::slotJsonDownloadComplete(QString relativeUrlString, QString id)
{
// temp.twitter = parsedData[counter].text ;
- parsedData = twitterJsonParser.parseAllObjects(QString::fromUtf8(m_storagePolicy->data(id)), \
20); + // parsedData = \
twitterJsonParser.parseAllObjects(QString::fromUtf8(m_storagePolicy->data(id)), 20); \
disconnect(m_downloadManager, SIGNAL(downloadComplete(QString, QString)), this, \
SLOT(slotJsonDownloadComplete(QString , QString)));
connect(m_downloadManager, SIGNAL(downloadComplete(QString, QString)), this, \
SLOT(slotGeoCodingReplyRecieved(QString , QString))); for (int counter = 0;counter < \
10;counter++) {
- if (parsedData[counter].location != "null") {
- parsedData[counter].location.replace(QRegExp("[?,:!/\\s]+"), \
"+");//remove whitespace and replace it with + for query api
- findLatLonOfStreetAddress(parsedData [ counter ].location) ; //this \
will set temp + // if (parsedData[counter].location != "null") {
+ // parsedData[counter].location.replace(QRegExp("[?,:!/\\s]+"), \
"+");//remove whitespace and replace it with + for query api +// \
findLatLonOfStreetAddress(parsedData [ counter ].location) ; //this will set temp \
} }
}
@@ -143,7 +143,7 @@
twitterStructure twitterData;
googleMapDataStructure geoCodedData;
- geoCodedData = twitterJsonParser.geoCodingAPIparseObject(QString::fromUtf8(m_storagePolicy->data(id))) \
; + // geoCodedData = \
twitterJsonParser.geoCodingAPIparseObject(QString::fromUtf8(m_storagePolicy->data(id))) \
; // twitterData.twit = "hi" ;
twitterData.location = GeoDataCoordinates(geoCodedData.lat, geoCodedData.lon, \
1.0, GeoDataCoordinates::Degree); twitsWithLocation.append(twitterData);
@@ -153,8 +153,8 @@
privateFlagForRenderingTwitts = 1;//1 means unblock
}
-}
+*/
Q_EXPORT_PLUGIN2(twitterPlugin, Marble::twitterPlugin)
-// #include "twitterPlugin.moc"
+ #include "twitterPlugin.moc"
--- trunk/KDE/kdeedu/marble/src/plugins/render/twitter/twitterPlugin.h #921636:921637
@@ -19,9 +19,9 @@
#include <QtCore/QObject>
#include <QFile>
#include <QTextStream>
-#include "../lib/HttpDownloadManager.h"
-#include "../lib/CacheStoragePolicy.h"
-#include "jsonparser.h"
+//#include "../lib/HttpDownloadManager.h"
+//#include "../lib/CacheStoragePolicy.h"
+//#include "jsonparser.h"
#include "MarbleRenderPlugin.h"
#include "MarbleDirs.h"
#include "GeoPainter.h"
@@ -34,10 +34,10 @@
* @short The class that specifies the a simple panormaio plugin
*
*/
-struct twitterStructure {
+/*struct twitterStructure {
QString twitter ;
GeoDataCoordinates location;
-};
+};*/
class twitterPlugin : public MarbleRenderPlugin
{
@@ -70,6 +70,7 @@
bool render(GeoPainter *painter, ViewportParams *viewport, const QString& \
renderPos, GeoSceneLayer * layer = 0);
~twitterPlugin();
+/*
public slots:
void slotJsonDownloadComplete(QString , QString); //completed download of json \
reply fom panoramio
void slotGeoCodingReplyRecieved(QString , QString); //completed download of \
image @@ -85,7 +86,7 @@
QList <twitterDataStructure> parsedData;
void findLatLonOfStreetAddress(QString streetAddress);
int privateFlagForRenderingTwitts;//this flag is one when globe has an Image \
(downloaded or already there in cache)
-
+*/
};
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic