Skip to content

Commit

Permalink
Make preset list retrieval usable even if core produces extra warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Shengjie Xu committed Dec 25, 2024
1 parent def1154 commit ba2f0cb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tooldialog/imagepacktooldialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,10 @@ void ImagePackToolDialog::startRetrievePresetInfo()
void ImagePackToolDialog::handlePresetInfo()
{
// qDebug() << "ImagePackToolDialog::handlePresetInfo(): " << presetQueryData;
QByteArray jsonDump = presetQueryData.toUtf8();
// 有可能会在 JSON 对象之前有报错内容(比如没找到 ffmpeg)
int startpos = presetQueryData.indexOf('{');
QString actualData = presetQueryData.mid(startpos);
QByteArray jsonDump = actualData.toUtf8();
QJsonDocument d = QJsonDocument::fromJson(jsonDump);
QJsonObject topobj = d.object();
int anonymousCount = 0;
Expand Down

0 comments on commit ba2f0cb

Please sign in to comment.