Work on skins.

This commit is contained in:
Martin Rotter 2014-01-25 17:21:13 +01:00
parent 497be388dd
commit e8c063d6e4
5 changed files with 20 additions and 13 deletions

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 343 B

View File

@ -150,22 +150,28 @@ bool FeedsModel::addItem(FeedsModelRootItem *item,
return true; return true;
} }
bool FeedsModel::editItem(const QModelIndex &index) {
// TODO: pokračovat
return true;
}
bool FeedsModel::removeItem(const QModelIndex &index) { bool FeedsModel::removeItem(const QModelIndex &index) {
if (index.isValid()) { if (index.isValid()) {
QModelIndex parent_index = index.parent(); QModelIndex parent_index = index.parent();
FeedsModelRootItem *deleting_item = itemForIndex(index); FeedsModelRootItem *deleting_item = itemForIndex(index);
FeedsModelRootItem *parent_item = itemForIndex(parent_index); FeedsModelRootItem *parent_item = itemForIndex(parent_index);
beginRemoveRows(parent_index, index.row(), index.row()); if (deleting_item->removeItself()) {
beginRemoveRows(parent_index, index.row(), index.row());
if (deleting_item->removeItself() && if (parent_item->removeChild(deleting_item)) {
parent_item->removeChild(deleting_item)) { // Free deleted item from the memory
// Free deleted item from the memory delete deleting_item;
delete deleting_item; }
endRemoveRows();
} }
endRemoveRows();
return true; return true;
} }

View File

@ -48,6 +48,7 @@ class FeedsModel : public QAbstractItemModel {
// Feed/category manipulators. // Feed/category manipulators.
bool addItem(FeedsModelRootItem *item, bool addItem(FeedsModelRootItem *item,
FeedsModelRootItem *parent); FeedsModelRootItem *parent);
bool editItem(const QModelIndex &index);
bool removeItem(const QModelIndex &index); bool removeItem(const QModelIndex &index);
// Returns (undeleted) messages for given feeds. // Returns (undeleted) messages for given feeds.

View File

@ -102,8 +102,8 @@ Authors of this application are NOT responsible for lost data.</string>
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>564</width> <width>100</width>
<height>363</height> <height>30</height>
</rect> </rect>
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout_4"> <layout class="QHBoxLayout" name="horizontalLayout_4">
@ -180,8 +180,8 @@ Authors of this application are NOT responsible for lost data.</string>
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>558</width> <width>167</width>
<height>337</height> <height>219</height>
</rect> </rect>
</property> </property>
<layout class="QFormLayout" name="formLayout"> <layout class="QFormLayout" name="formLayout">
@ -785,7 +785,7 @@ Authors of this application are NOT responsible for lost data.</string>
<bool>false</bool> <bool>false</bool>
</property> </property>
<property name="alternatingRowColors"> <property name="alternatingRowColors">
<bool>true</bool> <bool>false</bool>
</property> </property>
<property name="movement"> <property name="movement">
<enum>QListView::Static</enum> <enum>QListView::Static</enum>