Add saving thumbnails for projects
ClosedPublic

Authored by ferenczkovacs on Jun 27 2019, 9:33 AM.

Details

Reviewers
asemke
fkristof

Diff Detail

Repository
R262 LabPlot
Lint
Lint Skipped
Unit
Unit Tests Skipped
ferenczkovacs created this revision.Jun 27 2019, 9:33 AM
Restricted Application added a project: KDE Edu. · View Herald TranscriptJun 27 2019, 9:33 AM
Restricted Application added a subscriber: kde-edu. · View Herald Transcript
ferenczkovacs requested review of this revision.Jun 27 2019, 9:33 AM

The file WelcomeScreenHelper.cpp should't be part of this patch, I guess.

asemke added inline comments.Jun 27 2019, 8:32 PM
src/backend/core/Project.cpp
246 ↗(On Diff #60713)

We need to scale down the pixmap to a reasonable size. Something like 512x512px would be enough for the preview thumbnail. We don't need to save with the full resolution of a 4K monitor.

Fixed previous suggestions

asemke added inline comments.Jun 28 2019, 8:49 AM
src/backend/core/Project.cpp
246

please check the aspectRatioMode parameter in QPixmap::scaled(). The default value is IgnoreAspectRatio. We need KeepAspectRation here I'd say.

ferenczkovacs marked an inline comment as done.

Fixed previous suggestion

asemke accepted this revision.Jun 30 2019, 7:24 AM

Looks good now. Please push it directly to master so we have it as part of the next release soon.

This revision is now accepted and ready to land.Jun 30 2019, 7:24 AM
asemke closed this revision.Jun 30 2019, 5:24 PM
fkristof added inline comments.Jul 1 2019, 12:20 PM
src/backend/core/Project.cpp
247 ↗(On Diff #60713)

add const

src/kdefrontend/MainWin.cpp
1100 ↗(On Diff #60713)

add const

src/kdefrontend/WelcomeScreenHelper.cpp
64 ↗(On Diff #60713)

const function

71 ↗(On Diff #60713)

= nullptr;

106 ↗(On Diff #60713)

QLatin1String("project")