Fix windows compilation of gwenview
Needs ReviewPublic

Authored by sdepiets on Oct 9 2018, 5:53 AM.

Details

Reviewers
None
Group Reviewers
Gwenview
Summary

These changes allow compilation of gwenview using the KDE craft building system

Diff Detail

Repository
R260 Gwenview
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 3667
Build 3685: arc lint + arc unit
sdepiets created this revision.Oct 9 2018, 5:53 AM
Restricted Application added a project: Gwenview. ยท View Herald TranscriptOct 9 2018, 5:53 AM
sdepiets requested review of this revision.Oct 9 2018, 5:53 AM
sdepiets edited the summary of this revision. (Show Details)Oct 9 2018, 6:16 AM
sdepiets added a reviewer: Gwenview.
sdepiets added a project: Windows.
kfunk added a subscriber: kfunk.Oct 9 2018, 8:00 AM

Just hijacking this Diff b/c I see several places where this can be improved :)

importer/fileutils.cpp
147

This whole function can probably replaced by some usage of QTemporaryDir.

lib/mpris2/mpris2service.cpp
88

QProcess::processId()?

lib/slideshow.cpp
73

Probably the more modern (and cross-platform way to do this) is to use this instead of the RandomNumberGenerator and std::random_shuffle in initShuffledUrls() file:

auto generator = std::default_random_engine{};
generator.seed(time(0));
std::shuffle(v.begin(), v.end(), generator);

See: https://stackoverflow.com/questions/6926433/how-to-shuffle-a-stdvector

(seed() is needed so the random numbers generated by generator are not the same on consecutive runs of the program)

73

Note that rand() without srand() before will generate the same series of random numbers each program run (cf. https://www.geeksforgeeks.org/rand-and-srand-in-ccpp/) -- not what the Unix version here does!

tests/auto/timeutilstest.cpp
47

There's http://doc.qt.io/qt-5/qfiledevice.html#setFileTime since Qt 5.10 -- but this is too recent... So you can probably leave it like that.