Signed-off-by: Lays Rodrigues <lays.rodrigues@kde.org>
Details
Diff Detail
- Repository
- R231 Atelier
- Branch
- check_if_path_exists
- Lint
Lint OK - Unit
No Unit Test Coverage - Build Status
Buildable 2305 Build 2323: arc lint + arc unit
src/widgets/atcoreinstancewidget.cpp | ||
---|---|---|
314 | Its a shame QFileInfo does not accept a QUrl :( | |
315 | This is good but the wording of the dialog is not very descriptive of what the error was or why it happened. I would use something more inline with Then for the body "The chosen file can not be printed because it no longer exists" Something like that that is more descriptive of what the error is . And im sure we can come up with even better wording then that too. |
src/widgets/atcoreinstancewidget.cpp | ||
---|---|---|
314–321 | also !QFileInfo(fileName)::isReadable() |
src/widgets/atcoreinstancewidget.cpp | ||
---|---|---|
314–321 | isReadable() cannot receive a file as param. The alternative is to create a QFileInfo obj and do the tests from it. https://doc.qt.io/qt-5/qfileinfo.html#isReadable QFileInfo file(fileName.toString()); if (fileName.isEmpty() || !file.exists() || file.isReadable()) { |
src/widgets/atcoreinstancewidget.cpp | ||
---|---|---|
314–321 | Good point @patrickelectric , If the file does not exist is is also not readable ? if so we should only have to check if QFileInfo::isReadable() to know if its both exsiting and readable. |
src/widgets/atcoreinstancewidget.cpp | ||
---|---|---|
314–321 | Im all for doing something like this where we show a different message for either error. QFileInfo.isReadable() works well as a single check to see if it exists also. if ( fileName.isEmpty() ) { QMessageBox::critical( this , i18n("Filename Empty") , i18n("No fileName sent from calling method."); return; } else if ( !QFileInfo(fileName).isReadable() ) { QMessageBox::critical( this , i18n("File not found") , i18n("%1 \nIs not readable", fileName.toString()); return; } |