MantisBT - Doomseeker
View Issue Details
0003794Doomseeker[All Projects] Cleanuppublic2020-06-05 07:052021-08-16 19:10
WubTheCaptain 
WubTheCaptain 
lowtrivialalways
closedwon't fix 
1.3.1 
1.3.2 
0003794: qt-json is older than aa0930a (stray #include <iostream>)
A stray #include <iostream> in src/core/json.cpp triggered me today:
Nothing in the file depends on standard library header <iostream>. Then
I remembered that file is from Eeli Reilin's JSON library (qt-json). I
then found out upstream had already fixed this issue (e84dce6), but the
copy included in Doomseeker was older and didn't have this patch.
No tags attached.
related to 0003821closed Blzut3 Replacing Eili Reilin's JSON library (qt-json) with JSON support in Qt 
related to 0003803confirmed  C++11 support 
patch 0001-qt-json-Update-to-commit-aa0930a.patch (31,483) 2020-06-05 07:06
/tracker/file_download.php?file_id=2602&type=bug
patch 0002-Update-qt-json-in-wadseeker-too.patch (31,390) 2020-06-05 07:22
/tracker/file_download.php?file_id=2604&type=bug
patch 0003-Fix-QtJson-parse-class-reference-in-freedoominfopars.patch (1,069) 2020-06-05 08:34
/tracker/file_download.php?file_id=2605&type=bug
Issue History
2020-06-05 07:05WubTheCaptainNew Issue
2020-06-05 07:05WubTheCaptainStatusnew => assigned
2020-06-05 07:05WubTheCaptainAssigned To => WubTheCaptain
2020-06-05 07:06WubTheCaptainFile Added: 0001-qt-json-Update-to-commit-aa0930a.patch
2020-06-05 07:06WubTheCaptainStatusassigned => needs review
2020-06-05 07:16WubTheCaptainFile Added: 0002-Update-qt-json-in-wadseeker-too.patch
2020-06-05 07:17WubTheCaptainNote Added: 0021351
2020-06-05 07:19WubTheCaptainFile Deleted: 0002-Update-qt-json-in-wadseeker-too.patch
2020-06-05 07:22WubTheCaptainFile Added: 0002-Update-qt-json-in-wadseeker-too.patch
2020-06-05 07:25WubTheCaptainNote Added: 0021352
2020-06-05 07:33WubTheCaptainAssigned ToWubTheCaptain =>
2020-06-05 07:49WubTheCaptainNote Added: 0021353
2020-06-05 07:49WubTheCaptainNote Edited: 0021353bug_revision_view_page.php?bugnote_id=21353#r13100
2020-06-05 07:50WubTheCaptainNote Edited: 0021353bug_revision_view_page.php?bugnote_id=21353#r13101
2020-06-05 07:51WubTheCaptainNote Added: 0021354
2020-06-05 07:52WubTheCaptainNote Edited: 0021354bug_revision_view_page.php?bugnote_id=21354#r13103
2020-06-05 08:31WubTheCaptainAssigned To => WubTheCaptain
2020-06-05 08:31WubTheCaptainStatusneeds review => assigned
2020-06-05 08:34WubTheCaptainFile Added: 0003-Fix-QtJson-parse-class-reference-in-freedoominfopars.patch
2020-06-05 08:35WubTheCaptainAssigned ToWubTheCaptain =>
2020-06-05 08:35WubTheCaptainStatusassigned => needs review
2020-06-07 02:29WubTheCaptainRelationship addedrelated to 0003803
2020-06-08 01:50Blzut3Note Added: 0021408
2020-06-08 02:31WubTheCaptainNote Added: 0021415
2020-06-08 02:31WubTheCaptainStatusneeds review => resolved
2020-06-08 02:31WubTheCaptainResolutionopen => won't fix
2020-06-08 02:31WubTheCaptainAssigned To => WubTheCaptain
2020-06-08 02:31WubTheCaptainRelationship addedrelated to 0003821
2021-08-07 16:52Blzut3Statusresolved => closed
2021-08-16 19:10WubTheCaptainTarget Version1.3.3 => 1.3.2

Notes
(0021351)
WubTheCaptain   
2020-06-05 07:17   
I got bitten by issue 0003310 after sharing the first patch file, so two patch files are attached.
(0021352)
WubTheCaptain   
2020-06-05 07:25   
(re-attached 0002-Update-qt-json-in-wadseeker-too.patch, because I initially forgot to update Wadseeker's references to the class and that failed to build from source.)
(0021353)
WubTheCaptain   
2020-06-05 07:49   
(edited on: 2020-06-05 07:50)
Quote
 src/core/json.cpp                      | 272 ++++++++++++++++---------
 src/core/json.h                        | 272 ++++++++-----------------

Quote
 src/wadseeker/protocols/json.cpp              | 274 +++++++++++-------
 src/wadseeker/protocols/json.h                | 272 ++++++-----------


I hadn't noticed this before, but huh. Despite the line differences in json.cpp, but show to be the same json.cpp file in the master branch and my patch branch.

(0021354)
WubTheCaptain   
2020-06-05 07:51   
(edited on: 2020-06-05 07:52)
0003794:0021353:
Quote from WubTheCaptain
Despite the line differences in json.cpp, but show to be the same json.cpp file in the master branch and my patch branch.

Nevermind, git diff doesn't catch it but diff -u does.
$ diff -u src/core/json.cpp src/wadseeker/protocols/json.cpp # master branch
--- src/core/json.cpp   2020-06-05 07:48:38.577780264 +0000
+++ src/wadseeker/protocols/json.cpp    2020-06-05 07:48:38.577780264 +0000
@@ -468,11 +468,11 @@
         index = lastIndex + 1;

         if (numberStr.contains('.')) {
-                return QVariant(numberStr.toDouble(NULL));
+                return QVariant(numberStr.toDouble(nullptr));
         } else if (numberStr.startsWith('-')) {
-                return QVariant(numberStr.toLongLong(NULL));
+                return QVariant(numberStr.toLongLong(nullptr));
         } else {
-                return QVariant(numberStr.toULongLong(NULL));
+                return QVariant(numberStr.toULongLong(nullptr));
         }
 }


(0021408)
Blzut3   
2020-06-08 01:50   
Given that Qt JSON was added years before we added support for Qt5 much less dropped Qt4 support, should we instead have a ticket for switching to Qt 5's own JSON classes?
(0021415)
WubTheCaptain   
2020-06-08 02:31   
Quote from Blzut3
Given that Qt JSON was added years before we added support for Qt5 much less dropped Qt4 support, should we instead have a ticket for switching to Qt 5's own JSON classes?

Unaware those existed, yes. 0003821 (excuse the summary).
'https://doc.qt.io/qt-5/json.html [^]'