Model-class for performing search on comments about a profile. This is supposed to act as an underlying data-container for an user-interface view (QListView etc.)  
 More...
#include <profilecommentlistingmodel.h>
Model-class for performing search on comments about a profile. This is supposed to act as an underlying data-container for an user-interface view (QListView etc.) 
 
◆ ProfileCommentListingModel()
      
        
          | ProfileCommentListingModel::ProfileCommentListingModel  | 
          ( | 
          Model &  | 
          aModel,  | 
        
        
           | 
           | 
          MController &  | 
          aController  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
 
◆ ~ProfileCommentListingModel()
      
        
          | ProfileCommentListingModel::~ProfileCommentListingModel  | 
          ( | 
           | ) | 
           | 
        
      
 
 
◆ columnCount()
  
  
      
        
          | virtual int ProfileCommentListingModel::columnCount  | 
          ( | 
          const QModelIndex &  | 
          parent = QModelIndex() | ) | 
           const | 
         
       
   | 
  
virtual   | 
  
 
re-implemented from QAbstractTableModel 
- Returns
 - number of columns in view 
 
 
 
◆ data()
  
  
      
        
          | virtual QVariant ProfileCommentListingModel::data  | 
          ( | 
          const QModelIndex &  | 
          index,  | 
         
        
           | 
           | 
          int  | 
          role = Qt::DisplayRole  | 
         
        
           | 
          ) | 
           |  const | 
         
       
   | 
  
virtual   | 
  
 
re-implemented from QAbstractListModel 
- Returns
 - data to display in list. If Qt::UserRole+1 is used to obtain data, html of the comment is returned, Qt::UserRole returns comment hash as QVariant. UserRole+2 returns header data as single string, intended for list displays. UserRole+3 returns number of attached files as unsigned. 
 
 
 
◆ doUpdateDataOnIdle
  
  
      
        
          | void ProfileCommentListingModel::doUpdateDataOnIdle  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
slot   | 
  
 
method called via QTimer::singleShot() that is used for filling missing parts (message subjects etc.) from data that model is listing 
 
 
◆ error
◆ headerData()
  
  
      
        
          | virtual QVariant ProfileCommentListingModel::headerData  | 
          ( | 
          int  | 
          section,  | 
         
        
           | 
           | 
          Qt::Orientation  | 
          orientation,  | 
         
        
           | 
           | 
          int  | 
          role = Qt::DisplayRole  | 
         
        
           | 
          ) | 
           |  const | 
         
       
   | 
  
virtual   | 
  
 
 
◆ newCommentReceived() [1/2]
      
        
          | void ProfileCommentListingModel::newCommentReceived  | 
          ( | 
          const Hash &  | 
          aComment,  | 
        
        
           | 
           | 
          const Hash &  | 
          aCommentedProfile  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
notification method called when new comment is inserted into database 
 
 
◆ newCommentReceived() [2/2]
      
        
          | void ProfileCommentListingModel::newCommentReceived  | 
          ( | 
          const ProfileComment &  | 
          aComment | ) | 
           | 
        
      
 
notification method called when new comment is inserted into database , this variant is called from UI 
 
 
◆ performSearch()
  
  
      
        
          | void ProfileCommentListingModel::performSearch  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
private   | 
  
 
 
◆ profileSelected
  
  
      
        
          | void ProfileCommentListingModel::profileSelected  | 
          ( | 
          const Hash &  | 
           | ) | 
           | 
         
       
   | 
  
slot   | 
  
 
called from controller when user profile is selected 
 
 
◆ rowCount()
  
  
      
        
          | virtual int ProfileCommentListingModel::rowCount  | 
          ( | 
          const QModelIndex &  | 
          parent = QModelIndex() | ) | 
           const | 
         
       
   | 
  
virtual   | 
  
 
re-implemented from QAbstractTableModel 
- Returns
 - number of rows in list 
 
 
 
◆ setAsRead()
      
        
          | void ProfileCommentListingModel::setAsRead  | 
          ( | 
          const Hash &  | 
          aComment,  | 
        
        
           | 
           | 
          bool  | 
          aIsRead  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
 
◆ setSearchHash()
      
        
          | void ProfileCommentListingModel::setSearchHash  | 
          ( | 
          const Hash &  | 
          aSearch | ) | 
           | 
        
      
 
Calling this method will populate the model with messages that are either sent by profile given in parameter, or comment a given profile. 
- Parameters
 - 
  
    | aSearch | profile fingerprint whose messages are the item of interest  | 
  
   
- Returns
 - no thing, always succeeds 
 
 
 
◆ updateSenderAndSubjectOfMsg()
updates profile comment subject etc. from dabase. 
- Returns
 - false if update was not success indicating that comment should be removed from list 
 
 
 
◆ iController
◆ iModel
  
  
      
        
          | Model& ProfileCommentListingModel::iModel | 
         
       
   | 
  
private   | 
  
 
 
◆ iProfileComments
◆ iSearchHash
  
  
      
        
          | Hash ProfileCommentListingModel::iSearchHash | 
         
       
   | 
  
private   | 
  
 
 
The documentation for this class was generated from the following file: