Fix incapacity open *.cws files
ClosedPublic

Authored by sirgienko on Mar 20 2018, 8:32 PM.

Details

Summary

File filter was incorrect (there wasn't space between '.cws' and '|' symbol), and didn't recognizing *.cws files, so there weren't possibility for users to open any saved files, if they could not specify the file name directly (availability of this feature depends of the particular 'Open File' dialog window).

Test Plan
  1. Write some worksheet (for example, with lua backend)
  2. Save as worksheet with file extention .cws (for example foo.cws)
  3. Try to open, using 'Open File' dialog.

Diff Detail

Repository
R55 Cantor
Lint
Lint Skipped
Unit
Unit Tests Skipped
sirgienko created this revision.Mar 20 2018, 8:32 PM
Restricted Application added a project: KDE Edu. · View Herald TranscriptMar 20 2018, 8:32 PM
Restricted Application added a subscriber: KDE Edu. · View Herald Transcript
sirgienko requested review of this revision.Mar 20 2018, 8:32 PM
aacid added a subscriber: aacid.Mar 20 2018, 9:00 PM

This doesn't seem the correct way to set the filter either, at least not according to http://doc.qt.io/qt-5/qfiledialog.html#getOpenFileName ?

Sorry, what do you mean?
I were thinking about changing filter to "Cantor Worksheet (*.cws)" (it's work), like 'http://doc.qt.io/qt-5/qfiledialog.html#getOpenFileName', but there were reasons to create filter as "*.cws|Cantor Worksheet", aren't it?
So, i have decided only fix bug with bad filtering and don't change filter too much.

aacid added a comment.Mar 20 2018, 9:36 PM

Sorry, what do you mean?
I were thinking about changing filter to "Cantor Worksheet (*.cws)" (it's work), like 'http://doc.qt.io/qt-5/qfiledialog.html#getOpenFileName', but there were reasons to create filter as "*.cws|Cantor Worksheet", aren't it?

Yes, it's the old way to declare the filter in kdelibs4 code, this is a kdelibs4->qt5 porting bug

https://api.kde.org/frameworks/kdelibs4support/html/classKFileDialog.html#a715e45099822135eeab4fd3ba828bc4a

So, i have decided only fix bug with bad filtering and don't change filter too much.

sirgienko updated this revision to Diff 30087.EditedMar 21 2018, 5:56 AM

Well, have changed filter to qt5 format. Thanks @aacid for the explanation.

asemke accepted this revision.Mar 22 2018, 7:35 AM
This revision is now accepted and ready to land.Mar 22 2018, 7:35 AM
This revision was automatically updated to reflect the committed changes.