add Win32 API Unicode converter, other small changes

Qt Example: add file.close() (consistency between GTK example)
RagePhoto: saveFile() checks for good(), more data() -> c_str()
This commit is contained in:
Syping 2021-11-06 20:17:28 +01:00
parent 85ab850895
commit 05890541dc
6 changed files with 122 additions and 21 deletions

View file

@ -34,6 +34,7 @@ bool readPhotoFile(const QString &filename, QMainWindow *mainWindow, QLabel *pho
QFile file(filename);
if (file.open(QIODevice::ReadOnly)) {
const QByteArray fileData = file.readAll();
file.close();
RagePhoto ragePhoto;
const bool loaded = ragePhoto.load(fileData.data(), static_cast<size_t>(fileData.size()));
if (!loaded) {