void BackupListWidget::removeItems() { if(selectedItems().count() == 0) { // attempt to remove the sender BackupListItem* backupItem = qobject_cast<BackupListItem*>(sender()); if(backupItem) delete backupItem; } else { foreach(QListWidgetItem *item, selectedItems()) { if(item && item->isSelected()) delete item; } } recomputeListTotals(); }
void BackupListWidget::addItemsWithUrls(QList<QUrl> urls) { foreach(QUrl url, urls) addItemWithUrl(url); recomputeListTotals(); }
void BackupListWidget::changeEvent(QEvent *event) { if(event->type() == QEvent::LanguageChange) recomputeListTotals(); QWidget::changeEvent(event); }