Changes from: https://phabricator.kde.org/R231:f72448828270d266acf4fbde69d09bc648337b7f Create an error dialog if the print function is called with empty filename. This checks that the dialog was accepted before sending the filename to the print function preventing the error message from showing.
Details
Details
Diff Detail
Diff Detail
- Repository
- R231 Atelier
- Branch
- removeNoFileWarning
- Lint
No Linters Available - Unit
No Unit Test Coverage - Build Status
Buildable 5324 Build 5342: arc lint + arc unit
src/mainwindow.cpp | ||
---|---|---|
170–171 | Why is this necessary ? |
src/mainwindow.cpp | ||
---|---|---|
170–171 | There is a check in print that will make an error dialog if print is called with an empty file . So by checking here we prevent this if the user hits cancel. |
src/mainwindow.cpp | ||
---|---|---|
170–171 | int result = dialog.exec(); if (result == QDialog::Rejected) { return; } if (result == QDialog::Accepted) { file = dialog.choosenFile(); } Why not like this ? int result = dialog.exec(); if (result != QDialog::Accepted) { return; } file = dialog.choosenFile(); |
src/mainwindow.cpp | ||
---|---|---|
168–169 | != accept makes more senses if new or a undefined behaviour happens,. |