summaryrefslogtreecommitdiffstats
path: root/src/corelib/io
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2021-05-02 02:27:51 +0200
committerGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2021-05-16 17:22:30 +0200
commit5a1c3c29aca08e2add63bf294dc6dd0eb26cba4b (patch)
treece23d5f9421870075fbfbc0e6e0c2610976c6824 /src/corelib/io
parent97228214bd63f37563669049bfa13d33efa97c48 (diff)
QSaveFile: code tidies
Turn a cast into a call to QFlags::toInt(), plus a cast. This is in preparation for a future patch that will remove the implicit conversion. So why not casting directly? Because we don't know if the QFlags is backed by int or uint, so using the wrong cast won't compile; and we MUST pass unsigned because of the %x specifier. Granted, one could've used a static_assert, but I prefer a more flexible and idiomatic solution. Change-Id: I32a3e0ed69b925e8d56268ec84d9e668ca540188 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/io')
-rw-r--r--src/corelib/io/qsavefile.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/io/qsavefile.cpp b/src/corelib/io/qsavefile.cpp
index 067ccda3df..afe39287bd 100644
--- a/src/corelib/io/qsavefile.cpp
+++ b/src/corelib/io/qsavefile.cpp
@@ -204,7 +204,7 @@ bool QSaveFile::open(OpenMode mode)
// In the future we could implement ReadWrite by copying from the existing file to the temp file...
// The implications of NewOnly and ExistingOnly when used with QSaveFile need to be considered carefully...
if (mode & (ReadOnly | Append | NewOnly | ExistingOnly)) {
- qWarning("QSaveFile::open: Unsupported open mode 0x%x", int(mode));
+ qWarning("QSaveFile::open: Unsupported open mode 0x%x", uint(mode.toInt()));
return false;
}