MantisBT - Doomseeker
View Issue Details
0003796Doomseeker[All Projects] Cleanuppublic2020-06-05 07:402022-03-22 11:11
WubTheCaptain 
WubTheCaptain 
noneminorN/A
closedno change required 
1.3.1 
1.3.31.3.3 
0003796: qt-json dependency is duplicated to different files (2nd report)
Quote from WubTheCaptain
qt-json (aka Eeli Reilin's JSON library) has code duplication in the Doomseeker source distribution: Once for Doomseeker, and another time for Wadseeker.


I hit this issue again while submitting patches for issue 0003794. The former issue 0003310 is closed, so I'm reporting this again for more discussion due to changes in circumstances. (E.g.: We've also changed from Mercurial to Git, and can use Git submodules like proposed in 0003795. I've also pointed a trivial reason to change those json.{cpp,h} files since that former report.)
Quote from WubTheCaptain
$ diff -s src/core/json.cpp src/wadseeker/protocols/json.cpp
Files src/core/json.cpp and src/wadseeker/protocols/json.cpp are identical
$ diff -s src/core/json.h src/wadseeker/protocols/json.h
Files src/core/json.h and src/wadseeker/protocols/json.h are identical
No tags attached.
related to 0003310closed  qt-json dependency is duplicated to different files, deduplicate it 
related to 0003821closed Blzut3 Replacing Eili Reilin's JSON library (qt-json) with JSON support in Qt 
Issue History
2020-06-05 07:40WubTheCaptainNew Issue
2020-06-05 07:41WubTheCaptainDescription Updatedbug_revision_view_page.php?rev_id=13098#r13098
2020-06-05 07:41WubTheCaptainRelationship addedrelated to 0003310
2020-06-05 08:04WubTheCaptainNote Added: 0021355
2020-06-08 04:23Blzut3Relationship addedrelated to 0003821
2020-06-08 04:24Blzut3Note Added: 0021422
2020-06-08 04:24Blzut3Assigned To => Blzut3
2020-06-08 04:24Blzut3Statusnew => acknowledged
2020-06-08 04:24Blzut3Assigned ToBlzut3 =>
2020-06-08 05:34WubTheCaptainNote Added: 0021423
2020-06-08 05:34WubTheCaptainStatusacknowledged => resolved
2020-06-08 05:34WubTheCaptainResolutionopen => no change required
2020-06-08 05:34WubTheCaptainAssigned To => WubTheCaptain
2021-08-07 16:52Blzut3Statusresolved => closed
2021-08-16 18:42WubTheCaptainNote Added: 0021730
2021-08-16 18:42WubTheCaptainStatusclosed => resolved
2021-08-16 18:42WubTheCaptainResolutionno change required => fixed
2021-08-16 18:42WubTheCaptainFixed in Version => 1.3.3
2021-08-16 18:42WubTheCaptainTarget Version => 1.3.3
2021-08-16 18:45WubTheCaptainResolutionfixed => no change required
2022-03-22 11:11WubTheCaptainStatusresolved => closed

Notes
(0021355)
WubTheCaptain   
2020-06-05 08:04   
0003794:0021354:
Quote from WubTheCaptain
$ 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));
         }
 }


Though I agree with preferring nullptr over NULL (with little C++ knowledge), my patch in 0003794 would revert this back to NULL to match upstream.

But more importantly, to make my point here, even we haven't been consistent with these duplicated files in our source tree. This wasn't noticed or brought up in 0003310.
(0021422)
Blzut3   
2020-06-08 04:24   
Technically would be done as a result of migrating to Qt 5's JSON support, but I guess this ticket can be resolved when that happens.
(0021423)
WubTheCaptain   
2020-06-08 05:34   
I'll resolve this now. OP assumes it would be resolved so that qt-json becomes available from one place, but 0003821 is the apparent solution here.
And 0003821 fixes this issue too, so technically this is not "won't fix" but "no change required".
(0021730)
WubTheCaptain   
2021-08-16 18:42   
Reopening to resolved status. Addressed in 0003821 with commit fc903e1, QtJson has been replaced.