summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Mollekopf <mollekopf@kolabsys.com>2012-08-15 11:41:17 (GMT)
committerChristian Mollekopf <mollekopf@kolabsys.com>2012-08-15 11:41:17 (GMT)
commitb222214e7542075da9bf6dae8f1b079af78a91b9 (patch)
treea6f8331a405ab29a34d905a56c7631c4248c5668
parent3d4a383a2e803fa1cf16fbe18019bb6e4d9b934d (diff)
downloadkolab-utils-b222214e7542075da9bf6dae8f1b079af78a91b9.tar.gz
Error if we fail to open a file.
-rw-r--r--upgradetool/upgradetool.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/upgradetool/upgradetool.cpp b/upgradetool/upgradetool.cpp
index e13ce17..0c816fc 100644
--- a/upgradetool/upgradetool.cpp
+++ b/upgradetool/upgradetool.cpp
@@ -146,7 +146,10 @@ int main(int argc, char *argv[])
if (args->count() > 0) {
const QString &filename = args->arg(0);
QFile file( filename );
- file.open( QFile::ReadOnly );
+ if (!file.open( QFile::ReadOnly )) {
+ kWarning() << "failed to open the file: " << filename;
+ return -1;
+ }
const QByteArray data = file.readAll();
Q_ASSERT( !data.isEmpty() );
s << Kolab::Upgrade::upgradeMime(data, overrideType);