| 416 | } |
| 417 | |
| 418 | UBDocumentProxyTreeItem::UBDocumentProxyTreeItem(QTreeWidgetItem * parent, UBDocumentProxy* proxy, bool isEditable) |
| 419 | : QTreeWidgetItem() |
| 420 | , mProxy(proxy) |
| 421 | { |
| 422 | Qt::ItemFlags flags = Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsDragEnabled; |
| 423 | |
| 424 | if (isEditable) |
| 425 | flags |= Qt::ItemIsEditable; |
| 426 | |
| 427 | setFlags(flags); |
| 428 | |
| 429 | int i = 0; |
| 430 | for (i = 0; i < parent->childCount(); i++) |
| 431 | { |
| 432 | QTreeWidgetItem *ti = parent->child(i); |
| 433 | UBDocumentProxyTreeItem* pi = dynamic_cast<UBDocumentProxyTreeItem*>(ti); |
| 434 | if (pi) |
| 435 | { |
| 436 | if (proxy->metaData(UBSettings::documentDate).toString() >= pi->proxy()->metaData(UBSettings::documentDate).toString()) |
| 437 | { |
| 438 | break; |
| 439 | } |
| 440 | } |
| 441 | } |
| 442 | parent->insertChild(i, this); |
| 443 | } |
| 444 | |
| 445 | bool UBDocumentProxyTreeItem::isInTrash() |
| 446 | { |
nothing calls this directly
no test coverage detected