diff --git a/src/core/io/qfile.cpp b/src/core/io/qfile.cpp index 62cdf8df8..1b4b65120 100644 --- a/src/core/io/qfile.cpp +++ b/src/core/io/qfile.cpp @@ -583,49 +583,7 @@ QFile::rename(const QString &newName) d->fileName = newName; return true; } - - if (isSequential()) { - d->setError(QFile::RenameError, tr("Will not rename sequential file using block copy")); - return false; - } - - QFile out(newName); - if (open(QIODevice::ReadOnly)) { - if (out.open(QIODevice::WriteOnly | QIODevice::Truncate)) { - bool error = false; - QSTACKARRAY(char, block, QT_BUFFSIZE); - qint64 bytes; - while ((bytes = read(block, sizeof(block))) > 0) { - if (bytes != out.write(block, bytes)) { - d->setError(QFile::RenameError, out.errorString()); - error = true; - break; - } - } - if (bytes == -1) { - d->setError(QFile::RenameError, errorString()); - error = true; - } - if(!error) { - if (!remove()) { - d->setError(QFile::RenameError, tr("Cannot remove source file")); - error = true; - } - } - if (error) { - out.remove(); - } else { - d->fileEngine->setFileName(newName); - setPermissions(permissions()); - unsetError(); - setFileName(newName); - } - close(); - return !error; - } - close(); - } - d->setError(QFile::RenameError, out.isOpen() ? errorString() : out.errorString()); + d->setError(QFile::RenameError, d->fileEngine->errorString()); } return false; } diff --git a/translations/qt.pot b/translations/qt.pot index f470939a5..e293aaeed 100644 --- a/translations/qt.pot +++ b/translations/qt.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-08-13 19:35+0300\n" +"POT-Creation-Date: 2021-08-13 23:30+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -154,15 +154,7 @@ msgstr "" msgid "Destination file exists" msgstr "" -#: src/core/io/qfile.cpp:588 -msgid "Will not rename sequential file using block copy" -msgstr "" - -#: src/core/io/qfile.cpp:611 -msgid "Cannot remove source file" -msgstr "" - -#: src/core/io/qfile.cpp:1003 +#: src/core/io/qfile.cpp:961 msgid "No file engine available or engine does not support UnMapExtension" msgstr "" diff --git a/translations/qt_tools.pot b/translations/qt_tools.pot index 8008c806e..ab5bc6c16 100644 --- a/translations/qt_tools.pot +++ b/translations/qt_tools.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-08-13 19:35+0300\n" +"POT-Creation-Date: 2021-08-13 23:30+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n"