41 QObject &activitySrv, |
37 QObject &activitySrv, |
42 QObject *parent = 0); |
38 QObject *parent = 0); |
43 ~TsModel(); |
39 ~TsModel(); |
44 |
40 |
45 int rowCount(const QModelIndex &parent = QModelIndex()) const; |
41 int rowCount(const QModelIndex &parent = QModelIndex()) const; |
46 QVariant data(const QModelIndex &index, |
42 QVariant data(const QModelIndex &index, |
47 int role = Qt::DisplayRole) const; |
43 int role = Qt::DisplayRole) const; |
48 int maxRowCount()const; |
44 int maxRowCount()const; |
49 // from QAbstractModel |
45 // from QAbstractModel |
50 virtual bool insertRows(int row, int count, TsModelItem* item, |
46 virtual bool insertRows(int row, int count, TsModelItem *item, |
51 const QModelIndex & parent = QModelIndex()); |
47 const QModelIndex &parent = QModelIndex()); |
52 virtual bool removeRows(int row, int count, |
48 virtual bool removeRows(int row, int count, |
53 const QModelIndex & parent = QModelIndex()); |
49 const QModelIndex &parent = QModelIndex()); |
54 |
50 |
55 |
51 |
56 bool moveRows(int oldPosition, int newPosition, |
52 bool moveRows(int oldPosition, int newPosition, |
57 const QModelIndex & parent = QModelIndex()); |
53 const QModelIndex &parent = QModelIndex()); |
58 bool updateRows(int row, TsModelItem* item); |
54 bool updateRows(int row, TsModelItem *item); |
59 void fullUpdate(); |
55 void fullUpdate(); |
60 |
56 |
61 public slots: |
57 public slots: |
62 void openApplication(const QModelIndex &index); |
58 void openApplication(const QModelIndex &index); |
63 void closeApplication(const QModelIndex &index); |
59 void closeApplication(const QModelIndex &index); |
65 void updateActivities(); |
61 void updateActivities(); |
66 void entryChanged(TsModelItem *); |
62 void entryChanged(TsModelItem *); |
67 private: |
63 private: |
68 TsModelItem *entry(const QModelIndex &index) const; |
64 TsModelItem *entry(const QModelIndex &index) const; |
69 void getApplications(); |
65 void getApplications(); |
70 void getActivities(); |
66 void getActivities(bool fullUpdate = true); |
71 void prepareActivityEntry(QVariantHash &activity); |
|
72 QString getApplicationName(int id); |
|
73 |
67 |
74 private: |
68 private: |
75 /* |
69 /* |
76 * List containing result |
70 * List containing result |
77 */ |
71 */ |