| 85 | } |
| 86 | |
| 87 | void BackupManagerForm::removeEntry(BackupItem *item) |
| 88 | { |
| 89 | ConfirmDialog msgBox; |
| 90 | |
| 91 | msgBox.setMessageText(tr("Are you sure to remove the backup of the following entry?"), item->title); |
| 92 | msgBox.setMessagePixmap(item->getIconPixmap(), item->getIconWidth()); |
| 93 | |
| 94 | if(msgBox.exec() == 0) { |
| 95 | return; |
| 96 | } |
| 97 | |
| 98 | QMutexLocker locker(&m_db->mutex); |
| 99 | |
| 100 | int parent_ohfi = m_db->getParentId(item->ohfi); |
| 101 | removeRecursively(m_db->getAbsolutePath(item->ohfi)); |
| 102 | m_db->deleteEntry(item->ohfi); |
| 103 | |
| 104 | for(int i = 0; i < ui->tableWidget->rowCount(); ++i) { |
| 105 | BackupItem *iter_item = static_cast<BackupItem *>(ui->tableWidget->cellWidget(i, 0)); |
| 106 | if(iter_item == item) { |
| 107 | ui->tableWidget->removeRow(i); |
| 108 | break; |
| 109 | } |
| 110 | } |
| 111 | |
| 112 | if(parent_ohfi > 0) { |
| 113 | setBackupUsage(m_db->getObjectSize(parent_ohfi)); |
| 114 | } |
| 115 | } |
| 116 | |
| 117 | void BackupManagerForm::setBackupUsage(qint64 usage_size) |
| 118 | { |
nothing calls this directly
no test coverage detected