| 192 | } |
| 193 | |
| 194 | void FileSelectionWidget::onRenameRequested() |
| 195 | { |
| 196 | if (ui->fileview->selectedItems().count() < 1) |
| 197 | { |
| 198 | return; |
| 199 | } |
| 200 | |
| 201 | bool ok; |
| 202 | QString name = QInputDialog::getText(this, "Rename", |
| 203 | "New name", QLineEdit::Normal, |
| 204 | ui->fileview->selectedItems().first()->text(), &ok); |
| 205 | QString src = currentDirectory().filePath(currentFile().value()); |
| 206 | QString dest = currentDirectory().filePath(name); |
| 207 | |
| 208 | if (ok && !name.isEmpty()) |
| 209 | { |
| 210 | QFile::rename(src, dest); |
| 211 | } |
| 212 | |
| 213 | enumerateFiles(); |
| 214 | } |
| 215 | |
| 216 | void FileSelectionWidget::onRemoveRequested() |
| 217 | { |
nothing calls this directly
no test coverage detected