Skip to content

Commit ad5b0fb

Browse files
committed
Delete removes folders correctly
1 parent 45fcfcb commit ad5b0fb

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

src/NotepadNext/docks/FolderAsWorkspaceDock.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -154,20 +154,13 @@ void FolderAsWorkspaceDock::onFileRenamed(const QString &path, const QString &ol
154154

155155
void FolderAsWorkspaceDock::on_actionDelete_triggered()
156156
{
157-
bool ret;
158157
QString path(model->filePath(lastSelectedItem));
159158
QMessageBox::StandardButton reply = QMessageBox::question(this, tr("Delete Item"),
160159
tr("Are you sure you want to delete <b>%1</b>?").arg(path));
161160

162161
if (reply == QMessageBox::Yes)
163162
{
164-
if (model->isDir(lastSelectedItem)) {
165-
ret = model->rmdir(lastSelectedItem);
166-
}
167-
else {
168-
ret = model->remove(lastSelectedItem);
169-
}
170-
if (!ret)
163+
if (!model->remove(lastSelectedItem))
171164
{
172165
qWarning("Unable to delete %s", path.toUtf8().constData());
173166
}

0 commit comments

Comments
 (0)