From efd479e278a0dec8edeb76106553238985c1e634 Mon Sep 17 00:00:00 2001 From: kervala Date: Fri, 21 Oct 2016 14:26:31 +0200 Subject: [PATCH] Changed: More warnings --- .../client/ryzom_installer/src/utils.cpp | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/code/ryzom/tools/client/ryzom_installer/src/utils.cpp b/code/ryzom/tools/client/ryzom_installer/src/utils.cpp index 1c0c291e8..927b7f3b2 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/utils.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/utils.cpp @@ -409,11 +409,18 @@ QString appendShortcutExtension(const QString &shortcut) QString getVersionFromExecutable(const QString &path) { // check if file exists - if (!QFile::exists(path)) return ""; + if (!QFile::exists(path)) + { + nlwarning("Unable to find %s", Q2C(path)); + return ""; + } #ifndef Q_OS_WIN32 // fix executable permissions under UNIX - QFile::setPermissions(path, QFile::permissions(path) | QFile::ExeGroup | QFile::ExeUser | QFile::ExeOther); + if (!QFile::setPermissions(path, QFile::permissions(path) | QFile::ExeGroup | QFile::ExeUser | QFile::ExeOther)) + { + nlwarning("Unable to set executable permissions to %s", Q2C(path)); + } #endif // launch executable with --version argument @@ -421,14 +428,22 @@ QString getVersionFromExecutable(const QString &path) process.setProcessChannelMode(QProcess::MergedChannels); process.start(path, QStringList() << "--version", QIODevice::ReadWrite); - if (!process.waitForStarted()) return ""; + if (!process.waitForStarted()) + { + nlwarning("Unable to start %s", Q2C(path)); + return ""; + } QByteArray data; // read all output while (process.waitForReadyRead(1000)) data.append(process.readAll()); - if (!data.isEmpty()) + if (data.isEmpty()) + { + nlwarning("%s --version didn't return any data", Q2C(path)); + } + else { QString versionString = QString::fromUtf8(data);