[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [gluon/creator-distributionsupport-shreya] player/lib/models: Do the check on the Gluonobject array,
From: Shreya Pandit <shreya () shreyapandit ! com>
Date: 2012-08-21 18:18:19
Message-ID: 20120821181819.57E9AA6042 () git ! kde ! org
[Download RAW message or body]
Git commit 5b48a60489c7682bc691b3ea404f371a7970a510 by Shreya Pandit.
Committed on 21/08/2012 at 20:17.
Pushed by pandit into branch 'creator-distributionsupport-shreya'.
Do the check on the Gluonobject array, to find parent instead
M +5 -6 player/lib/models/commentitemsmodel.cpp
M +6 -0 player/lib/models/commentitemsmodel.h
http://commits.kde.org/gluon/5b48a60489c7682bc691b3ea404f371a7970a510
diff --git a/player/lib/models/commentitemsmodel.cpp \
b/player/lib/models/commentitemsmodel.cpp index ad21f94..b5d44e6 100644
--- a/player/lib/models/commentitemsmodel.cpp
+++ b/player/lib/models/commentitemsmodel.cpp
@@ -127,7 +127,6 @@ void CommentItemsModel::addCommentFinished( Attica::BaseJob* job \
)
GluonObject* CommentItemsModel::addComment( CommentItem* comment, GluonObject* \
parent ) {
- // qDebug()<< "This comment has id, in the comment type array" << comment->id();
GluonObject* newComment = new GluonObject( comment->id(), parent );
newComment->setProperty( "Id", comment->id().toInt() );
newComment->setProperty( "Author", comment->user() );
@@ -139,7 +138,6 @@ GluonObject* CommentItemsModel::addComment( CommentItem* comment, \
GluonObject* p newComment->setProperty( "ParentId", parent->name() );
d->m_nodes.append(newComment);
commentsList.append(comment);
-// qDebug()<<"parent id for this comment is, in the gluon object \
array"<<newComment->property("ParentId").toString().toInt();
foreach( QObject *child, comment->children() ) {
addComment( static_cast<CommentItem*>(child), newComment );
@@ -150,18 +148,19 @@ GluonObject* CommentItemsModel::addComment( CommentItem* \
comment, GluonObject* p
void CommentItemsModel::checkLast()
{
- if ((lastcachedDateTime < commentsList.at(commentsList.count()-1)->dateTime()) \
&& (lastCachedText != commentsList.at(commentsList.count()-1)->text())) + \
foreach(GluonCore::GluonObject* obj ,d->m_nodes) {qDebug()<<"comments in order are"<< \
obj->property("Body").toString();} +
+ if ((lastcachedDateTime < \
QDateTime::fromString(d->m_nodes.at(d->m_nodes.count()-1)->property("DateTime").toString(),Qt::TextDate) \
) && (lastCachedText != \
d->m_nodes.at(d->m_nodes.count()-1)->property("Body").toString())) {
if(d->m_nodes.at(d->m_nodes.count()-1)->property("ParentId").toString().toInt())
{
- qDebug()<<"Aha! A new child comment";
+ qDebug()<<"Aha! A new child comment, having title" \
<<d->m_nodes.at(d->m_nodes.count()-1)->property("Title").toString(); foreach( \
CommentItem *testParent, commentsList ) {
- if( testParent->id().toInt() == \
d->m_nodes.at(d->m_nodes.count()-1)->property("ParentId").toString().toInt()){qDebug()<<"With \
parent as "<<testParent->text();} + if( testParent->id().toInt() == \
d->m_nodes.at(d->m_nodes.count()-1)->property("ParentId").toString().toInt()){qDebug()<<" \
parent subject as "<<testParent->subject();}
}
}
- qDebug()<<"Here starts new comments,with content"<< \
commentsList.at(commentsList.count()-1)->text(); qDebug()<<"Newest comment has date \
time"<< commentsList.at(commentsList.count()-1)->dateTime(); emit increment() ;
}
diff --git a/player/lib/models/commentitemsmodel.h \
b/player/lib/models/commentitemsmodel.h index 847187c..84799a5 100644
--- a/player/lib/models/commentitemsmodel.h
+++ b/player/lib/models/commentitemsmodel.h
@@ -69,6 +69,12 @@ namespace GluonPlayer
DepthRole,
ParentIdRole
};
+ enum commentType
+ {
+ FreshParent = 1, ///Game is available on the \
OCS server + FreshChild = 2, ///Game is present \
on the local filesystem +// Installed = \
Downloadable | Local, ///Game was installed from the OCS server + };
/**
* @param gameId The game ID which will be used to perform the lookup in \
the online
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic