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;
}
bool FeedsModel::editItem(const QModelIndex &index) {
// TODO: pokračovat
return true;
}
bool FeedsModel::removeItem(const QModelIndex &index) {
if (index.isValid()) {
QModelIndex parent_index = index.parent();
FeedsModelRootItem *deleting_item = itemForIndex(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() &&
parent_item->removeChild(deleting_item)) {
// Free deleted item from the memory
delete deleting_item;
if (parent_item->removeChild(deleting_item)) {
// Free deleted item from the memory
delete deleting_item;
}
endRemoveRows();
}
endRemoveRows();
return true;
}

View File

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

View File

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