- enhancement: support function arguments like "int (&t)[]"

- change: Don't show error dialog when bookmark/debug configuration json files are empty.
This commit is contained in:
Roy Qu 2023-05-29 10:52:17 +08:00
parent 774d4193b5
commit 11bceaf972
3 changed files with 11 additions and 6 deletions

View File

@ -7,9 +7,10 @@ Red Panda C++ Version 2.22
- fix: lambda expression is not correctly handled.
- fix: '__extension__' should be ignored when parsing C/C++ codes.
- enhancement: show completion for return type of lambda expressions.
- enhancement: support function arguments like "int (&t)[]"
- change: Don't show error dialog when bookmark/debug configuration json files are empty.
- upgrade raylib to 4.5, raygui to 3.6
Red Panda C++ Version 2.21
- change: The option "Check for stack smashing attacks (-fstack-protector)" is turned off by default in the Debug compiler set settings.

View File

@ -809,10 +809,12 @@ PDebugConfig Debugger::load(const QString &filename, bool forProject)
if (!file.exists())
return pConfig;
if (file.open(QFile::ReadOnly)) {
QByteArray content = file.readAll();
QByteArray content = file.readAll().trimmed();
if (content.isEmpty())
return pConfig;
QJsonParseError error;
QJsonDocument doc(QJsonDocument::fromJson(content,&error));
if (error.error != QJsonParseError::NoError) {
if (error.error == QJsonParseError::NoError) {
throw FileError(tr("Error in json file '%1':%2 : %3")
.arg(filename)
.arg(error.offset)

View File

@ -307,7 +307,9 @@ QList<PBookmark> BookmarkModel::load(const QString& filename, qint64 criteriaTim
if (!file.exists())
return bookmarks;
if (file.open(QFile::ReadOnly)) {
QByteArray content = file.readAll();
QByteArray content = file.readAll().trimmed();
if (content.isEmpty())
return bookmarks;
QJsonParseError error;
QJsonDocument doc(QJsonDocument::fromJson(content,&error));
if (error.error != QJsonParseError::NoError) {