Add worksheet extension (.cws) to name of saved file, if user haven't added it youself.
ClosedPublic

Authored by sirgienko on Mar 25 2018, 9:04 PM.

Details

Summary

It's a little uncomfortable, that when we save cantor worksheet file with name like 'foo' and saved name also have name 'foo', because we use file filter in open file dialog and our 'foo' file will be filtered. So I have added check, that if extension for saved worksheet file don't specify, then we append it.

Test Plan
  1. Create worksheet
  2. Save it with name foo as Cantor worksheet
  3. Check that the file have name foo.cws
  1. Create worksheet
  2. Save it with name foo.cws as Cantor worksheet
  3. Check that the file have name foo.cws

Diff Detail

Repository
R55 Cantor
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
sirgienko created this revision.Mar 25 2018, 9:04 PM
Restricted Application added a project: KDE Edu. · View Herald TranscriptMar 25 2018, 9:04 PM
Restricted Application added a subscriber: KDE Edu. · View Herald Transcript
sirgienko requested review of this revision.Mar 25 2018, 9:04 PM
asemke added a subscriber: asemke.Mar 25 2018, 9:49 PM

you don't always need to define this string. It is only needed if we save to a worksheet file and not to a plain file and no cws-extension was provided. So, simply use file_name += QLatin1String(".cws") here.

sirgienko updated this revision to Diff 30590.Mar 26 2018, 6:53 AM

Well, I have simplified the code.

asemke accepted this revision.Mar 26 2018, 4:10 PM
This revision is now accepted and ready to land.Mar 26 2018, 4:10 PM
aacid added a subscriber: aacid.Mar 26 2018, 5:19 PM

Alexander do you want me to land this in 18.04 or just in master?

Alexander do you want me to land this in 18.04 or just in master?

Yes, let's bring this into 18.04. More important is to bring the fixes in 62ccc7080614d8e56197c66e66625ae4f7b21b78 and 3c0251f120a13a87a21ac6abc8b53cbcfcf820f0 to 18.04 - those are show stoppers for 18.04. Albert, would you take care of this?

Can you not do that? I'm fine with commit this since Nikita doesn't have access, but you do, so you can push your commits around as necessary.

If you need help with the git commands, don't hesitate to ask.

This revision was automatically updated to reflect the committed changes.

Can you not do that? I'm fine with commit this since Nikita doesn't have access, but you do, so you can push your commits around as necessary.

Nikita has the access. You asked about 18.04, so I assumed you kind of managing this and I mentioned two other commits that need to go into 18.04. Anyway, I'll cherry-pick the relevant commits to the 18.04 branch.

@asemke, Only KDE developers have acces to write, isn't it? Because I think, that I not one of them, and I, as common user, have acces only for reading.

@asemke, Only KDE developers have acces to write, isn't it? Because I think, that I not one of them, and I, as common user, have acces only for reading.

Yes, this is correct. I think I was just confused by your name in the git history and I assumed you have a kde account. Sorry.

aacid added a comment.Mar 31 2018, 9:42 PM

Can you not do that? I'm fine with commit this since Nikita doesn't have access, but you do, so you can push your commits around as necessary.

You asked about 18.04, so I assumed you kind of managing this

No, it's the developers responsability to make sure the commits land in the appropiate branches

Anyway, I'll cherry-pick the relevant commits to the 18.04 branch.

Cool :)