clarify logic for openScreenshotsFolder, refactor preferences access, and clarify method names
ClosedPublic

Authored by utecht on Oct 2 2018, 8:08 PM.

Details

Summary

New openScreenshotsFolder logic is to highlight recently saved file, then default save location
(save mode) or last saved file's folder (save as mode) with failsafe as default save location.
SpectacleConfig now stores the last saved files and can determine the last saved file location from the
file name through separate method. Removed extraneous methods and variables from ExportManager.
ExportManager now uses SpectacleConfig to access save location preferences.

BUG: 394182

Diff Detail

Repository
R166 Spectacle
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
utecht created this revision.Oct 2 2018, 8:08 PM
Restricted Application added a project: Spectacle. · View Herald TranscriptOct 2 2018, 8:08 PM
Restricted Application added a subscriber: Spectacle. · View Herald Transcript
utecht requested review of this revision.Oct 2 2018, 8:08 PM
ngraham added a subscriber: ngraham.EditedOct 5 2018, 4:04 AM

Thanks for the patch! I will review it probably tomorrow. In the meantime, could you change the title to match the commit message guidelines outlined at https://community.kde.org/Infrastructure/Phabricator#Formatting_your_patch? This means phrasing it in the imperative mood ("Clarify logic for...") and keeping it short and sweet. Ideally under 80 characters.

Also, BUG 394182 needs to be BUG: 394182

Finally if you add FIXED-IN: 18.12.0 on its own line (typically under the BUG: line), it will automatically populate the appropriate field in the Bugzilla ticket when it lands.

Thanks again!

ngraham requested changes to this revision.Oct 5 2018, 10:48 PM

I've verified that this fixes the bug, good job! No regressions detected with save or screenshot folder locations, with an existing install or when using a fresh config.

Please address the formatting changes I requested in the previous comment, and then this can land!

This revision now requires changes to proceed.Oct 5 2018, 10:48 PM
utecht retitled this revision from clarified logic for openScreenshotsFolder and refactored code to use clearer method names and rely on SpectacleConfig for access to preferences to clarify logic for openScreenshotsFolder, refactor preferences access, and clarify method names.Oct 6 2018, 3:05 AM
utecht edited the summary of this revision. (Show Details)
ngraham accepted this revision.Oct 7 2018, 5:41 AM

Thanks!

This revision is now accepted and ready to land.Oct 7 2018, 5:41 AM

Can you re-base this on master? It no longer cleanly merges when I go to land it. A git pull --rebase origin master should do it, and then afterwards you'll need to re-compile and run so you can verify that the merge was successful.

utecht updated this revision to Diff 43334.Oct 10 2018, 6:29 PM

rebased on origin master I think

Sorry, it didn't work. I get the same merge failure.

utecht updated this revision to Diff 43679.Oct 15 2018, 6:27 PM

merged with origin master to hopefully fix the patch

This revision was automatically updated to reflect the committed changes.

That worked, thanks! I've landed this for you.

Any update on D15059? I feel like we're pretty close to the finish line for that one! It will also need a rebase on master since I re-did the layout of the settings window recently.