1 #include "timelinehandler.h"
6 TimelineHandler::TimelineHandler()
8 status
= new QStandardItem();
12 bool TimelineHandler::startElement(const QString
& /* namespaceURI */,
13 const QString
&localName
,
14 const QString
&,//qName
15 const QXmlAttributes
&) //Attributes
17 if (localName
== "status")
18 status
= new QStandardItem();
19 if (localName
== "user")
22 // qDebug() << "Startelement " << localName ;
27 bool TimelineHandler::endElement(const QString
& /* namespaceURI */,
28 const QString
&localName
,
29 const QString
&) //qName
31 if (localName
== "status")
36 if (localName
== "user")
38 if (localName
== "id")
39 status
->setData( currentText
.toInt(), UserId
);
40 if (localName
== "name")
41 status
->setData( currentText
, Name
);
42 if (localName
== "screen_name")
43 status
->setData( currentText
, Screen_name
);
44 if (localName
== "location")
45 status
->setData( currentText
, Location
);
46 if (localName
== "description")
47 status
->setData( currentText
, Description
);
48 if (localName
== "profile_image_url")
49 status
->setData( currentText
, Profile_image_url
);
50 if (localName
== "url")
51 status
->setData( currentText
, Url
);
55 if (localName
== "created_at")
56 status
->setData( QDateTime::fromString(currentText
, "ddd MMM dd hh:mm:ss +0000 yyyy"), Created_at
);
57 if (localName
== "text")
58 status
->setData( currentText
, Text
);
59 if (localName
== "id")
60 status
->setData( currentText
.toInt(), Id
);
63 // qDebug() << "EndElement " << qName << "and " << currentText;
67 bool TimelineHandler::fatalError(const QXmlParseException
&) //exception
69 qDebug() << "Fatal XML error occured";
73 QString
TimelineHandler::errorString() const
78 bool TimelineHandler::characters(const QString
&str
)