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

List:       kde-commits
Subject:    [gluon/creator-distributionsupport-shreya] /: New Replies to comments notified, along with parent re
From:       Shreya Pandit <shreya () shreyapandit ! com>
Date:       2012-08-21 10:22:23
Message-ID: 20120821102223.ABAA3A6042 () git ! kde ! org
[Download RAW message or body]

Git commit 44d773678e91371feeb12c06df260c3af03abb44 by Shreya Pandit.
Committed on 21/08/2012 at 12:22.
Pushed by pandit into branch 'creator-distributionsupport-shreya'.

New Replies to comments notified, along with parent reference

M  +0    -17   creator/plugins/docks/distributiondock/commentitemsviewdelegate.cpp
M  +1    -0    creator/plugins/docks/distributiondock/distributiondock.cpp
M  +3    -16   creator/plugins/docks/distributiondock/distributiondock.ui
M  +14   -2    player/lib/models/commentitemsmodel.cpp

http://commits.kde.org/gluon/44d773678e91371feeb12c06df260c3af03abb44

diff --git a/creator/plugins/docks/distributiondock/commentitemsviewdelegate.cpp \
b/creator/plugins/docks/distributiondock/commentitemsviewdelegate.cpp index \
                6661aeb..3dcef5e 100644
--- a/creator/plugins/docks/distributiondock/commentitemsviewdelegate.cpp
+++ b/creator/plugins/docks/distributiondock/commentitemsviewdelegate.cpp
@@ -190,23 +190,6 @@ void CommentItemsViewDelegate::paint( QPainter* painter, const \
QStyleOptionViewI  painter->setPen( QPen( option.palette.text().color() ) );
     }
 
-    /* const GluonPlayer::GameItemsModel* realmodel = qobject_cast<const \
                GluonPlayer::GameItemsModel*>(index.model());
-
-    int height = option.rect.height();
-    QPoint point(option.rect.left() + margin, option.rect.top() + ((height - \
                PreviewHeight) / 2));
-
-    QImage image = KIcon("gluon-cretor").pixmap(32, 32).toImage();
-    if (!image.isNull()) {
-        point.setX((PreviewWidth - image.width())/2 + 5);
-        point.setY(option.rect.top() + ((height - image.height()) / 2));
-        painter->drawImage(point, image);
-
-        QPoint framePoint(point.x() - 5, point.y() - 5);
-        painter->drawPixmap(framePoint, KIcon("gluon-creator").pixmap(32, \
                32).scaled(image.width() + 10, image.height() + 10));
-    } else {
-        QRect rect(point, QSize(PreviewWidth, PreviewHeight));
-        painter->drawText(rect, Qt::AlignCenter | Qt::TextWordWrap, i18n("Loading \
                Preview"));
-    } */
     painter->restore();
 }
 
diff --git a/creator/plugins/docks/distributiondock/distributiondock.cpp \
b/creator/plugins/docks/distributiondock/distributiondock.cpp index 0f73e14..c2be1fb \
                100644
--- a/creator/plugins/docks/distributiondock/distributiondock.cpp
+++ b/creator/plugins/docks/distributiondock/distributiondock.cpp
@@ -393,6 +393,7 @@ void DistributionDock::showNotifications(int number)
 {
    if(!number)
     {
+      d->ui.notificationsButton->setText(QString::number(number));
       d->ui.notificationsButton->setEnabled(false);;
       d->ui.notificationsButton->setToolTip("You have "+ QString::number(number)+" \
notifications");  }
diff --git a/creator/plugins/docks/distributiondock/distributiondock.ui \
b/creator/plugins/docks/distributiondock/distributiondock.ui index 87bd6de..0a0e74a \
                100644
--- a/creator/plugins/docks/distributiondock/distributiondock.ui
+++ b/creator/plugins/docks/distributiondock/distributiondock.ui
@@ -581,7 +581,7 @@
          <rect>
           <x>0</x>
           <y>60</y>
-          <width>181</width>
+          <width>131</width>
           <height>34</height>
          </rect>
         </property>
@@ -612,19 +612,6 @@
           </spacer>
          </item>
          <item>
-          <spacer name="horizontalSpacer">
-           <property name="orientation">
-            <enum>Qt::Horizontal</enum>
-           </property>
-           <property name="sizeHint" stdset="0">
-            <size>
-             <width>48</width>
-             <height>26</height>
-            </size>
-           </property>
-          </spacer>
-         </item>
-         <item>
           <widget class="KPushButton" name="notificationsButton">
            <property name="minimumSize">
             <size>
@@ -882,8 +869,8 @@
          <rect>
           <x>0</x>
           <y>0</y>
-          <width>421</width>
-          <height>260</height>
+          <width>100</width>
+          <height>30</height>
          </rect>
         </property>
         <attribute name="label">
diff --git a/player/lib/models/commentitemsmodel.cpp \
b/player/lib/models/commentitemsmodel.cpp index 9d2df65..ad21f94 100644
--- a/player/lib/models/commentitemsmodel.cpp
+++ b/player/lib/models/commentitemsmodel.cpp
@@ -127,7 +127,9 @@ 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() );
     newComment->setProperty( "Title", comment->subject() );
     newComment->setProperty( "Body", comment->text() );
@@ -137,7 +139,8 @@ 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 );
     }
@@ -147,8 +150,17 @@ 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()))  +    if \
((lastcachedDateTime < commentsList.at(commentsList.count()-1)->dateTime()) && \
(lastCachedText != commentsList.at(commentsList.count()-1)->text()))   {	
+	if(d->m_nodes.at(d->m_nodes.count()-1)->property("ParentId").toString().toInt())
+	  {
+	    qDebug()<<"Aha! A new child comment";
+	    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();} +	      
+	    }
+	  }
 	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() ;


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

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