Skip to content

Commit 6c364ce

Browse files
Fix file renaming (#1038)
1 parent c53aab6 commit 6c364ce

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/ScintillaNext.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ bool ScintillaNext::rename(const QString &newFilePath)
456456
emit aboutToSave();
457457

458458
// Write out the buffer to the new path
459-
if (saveCopyAs(newFilePath)) {
459+
if (saveCopyAs(newFilePath) == QFileDevice::NoError) {
460460
// Remove the old file
461461
const QString oldPath = fileInfo.canonicalFilePath();
462462
QFile::remove(oldPath);

src/dialogs/MainWindow.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1479,7 +1479,7 @@ void MainWindow::renameFile()
14791479
if (editor->isFile()) {
14801480
const QString filter = app->getFileDialogFilter();
14811481
QString selectedFilter = app->getFileDialogFilterForLanguage(editor->languageName);
1482-
QString fileName = FileDialogHelpers::getSaveFileName(this, tr("Rename"), defaultDirectoryManager->getDefaultDirectory(), filter, &selectedFilter);
1482+
QString fileName = FileDialogHelpers::getSaveFileName(this, tr("Rename"), editor->getFilePath(), filter, &selectedFilter);
14831483

14841484
if (fileName.isEmpty()) {
14851485
return;

0 commit comments

Comments
 (0)