Save as saves the file to a new path even if there was no changes
ClosedPublic

Authored by sdepiets on Aug 9 2018, 3:12 AM.

Details

Summary

Currently the file is not "saved as" if it hasn't been modified, which can lead to some confusion.
With this revision the file will be saved as long as the new path is different from the old one.

BUG: 364093

Diff Detail

Repository
R456 Lokalize
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 1749
Build 1767: arc lint + arc unit
sdepiets requested review of this revision.Aug 9 2018, 3:12 AM
sdepiets created this revision.
sdepiets edited the summary of this revision. (Show Details)Aug 9 2018, 3:15 AM
sdepiets added a project: Localization.
aacid added inline comments.Aug 9 2018, 6:48 PM
src/editortab.cpp
951

why this weird QString::compare? why not just "filePath == m_catalog->url()" that is imho easier to understnad?

sdepiets updated this revision to Diff 39374.Aug 10 2018, 1:42 AM

Simplified test

aacid added a comment.Aug 11 2018, 4:24 PM

Looks good to me, if you want, maybe it makes sense to put

filePath.isEmpty() ? m_catalog->url() : filePath

into a variable and then use that variable instead of that "complex" code in three places, but if you don't want that, that's ok for me too :)

aacid accepted this revision.Aug 11 2018, 4:24 PM
This revision is now accepted and ready to land.Aug 11 2018, 4:24 PM
sdepiets updated this revision to Diff 39548.Aug 13 2018, 1:07 AM

Put the ternary condition in a variable

sdepiets closed this revision.Aug 13 2018, 1:08 AM