From 01be3c518148dd90310bd2df01b3cccc9106537a Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Thu, 28 Jul 2016 12:02:28 +0300 Subject: [PATCH] Try find more about error: "Cannot open %file for input" how was suggested on stackoverflow. --HG-- branch : develop --- src/test/ValentinaTest/abstracttest.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/test/ValentinaTest/abstracttest.cpp b/src/test/ValentinaTest/abstracttest.cpp index 89f12ac69..ecedba3dd 100644 --- a/src/test/ValentinaTest/abstracttest.cpp +++ b/src/test/ValentinaTest/abstracttest.cpp @@ -176,7 +176,16 @@ bool AbstractTest::CopyRecursively(const QString &srcFilePath, const QString &tg } } + // Check error: Cannot open %file for input QFile srcFile(srcFilePath); + if (not srcFile.open(QFile::ReadOnly)) + { + const QString msg = QString("Error: %3").arg(srcFile.errorString()); + QWARN(qUtf8Printable(msg)); + return false; + } + srcFile.close(); + if (not srcFile.copy(tgtFilePath)) { const QString msg = QString("Can't copy file '%1' to '%2'. Error: %3").arg(srcFilePath).arg(tgtFilePath)