diff --git a/NEWS.md b/NEWS.md index 640bb224..fd871abf 100644 --- a/NEWS.md +++ b/NEWS.md @@ -7,6 +7,7 @@ Red Panda C++ Version 2.9 - enhancement: Create a temporary copy of the current file when saving files (it's removed after the saving sucessfully finished). - enhancement: Auto backup editing contents. (Save editing contents 3 seconds after input stopped. Auto delete when editor successfully closed) - enhancement: Add "Auto backup editing contents" option in options/editor/auto save + - fix: rename project file will wrongly set it's encoding to 'ASCII'; Red Panda C++ Version 2.8 diff --git a/RedPandaIDE/project.cpp b/RedPandaIDE/project.cpp index 85750f05..ddd8a9ec 100644 --- a/RedPandaIDE/project.cpp +++ b/RedPandaIDE/project.cpp @@ -1219,7 +1219,7 @@ PProjectUnit Project::internalAddUnit(const QString &inFileName, PProjectModelNo newUnit->setFileName(QDir(directory()).filePath(inFileName)); Editor * e= unitEditor(newUnit); if (e) { - newUnit->setEncoding(e->fileEncoding()); + newUnit->setEncoding(e->encodingOption()); e->setProject(this); } else { newUnit->setEncoding(options().encoding.toUtf8()); diff --git a/libs/redpanda_qt_utils/qt_utils/utils.cpp b/libs/redpanda_qt_utils/qt_utils/utils.cpp index 0ce6faee..878ec41a 100644 --- a/libs/redpanda_qt_utils/qt_utils/utils.cpp +++ b/libs/redpanda_qt_utils/qt_utils/utils.cpp @@ -395,7 +395,7 @@ bool stringToFile(const QString &str, const QString &fileName) bool stringsToFile(const QStringList &list, const QString &fileName) { QFile file(fileName); - if (file.open(QIODevice::WriteOnly | QIODevice::Truncate)) + if (!file.open(QIODevice::WriteOnly | QIODevice::Truncate)) return false; QTextStream stream(&file); for (const QString& s:list) {