summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Mollekopf <mollekopf@kolabsys.com>2012-08-10 14:11:56 (GMT)
committerChristian Mollekopf <mollekopf@kolabsys.com>2012-08-10 14:11:56 (GMT)
commit61f5816ecd53c3c62b9f290ede0fb5e09f4381dd (patch)
tree59432f64c24438f7b8c6fc3e0391bdc36b606ba2
parentac710c4b13e324e8b69d0d8f3d7569655766173b (diff)
downloadkolab-utils-61f5816ecd53c3c62b9f290ede0fb5e09f4381dd.tar.gz
return code, use toLatin1 instead of toLocal8Bit
-rw-r--r--upgradetool/upgradetool.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/upgradetool/upgradetool.cpp b/upgradetool/upgradetool.cpp
index 3bb966c..7e25efb 100644
--- a/upgradetool/upgradetool.cpp
+++ b/upgradetool/upgradetool.cpp
@@ -20,6 +20,7 @@
#include <QtCore/qfile.h>
#include <kdebug.h>
#include <kcmdlineargs.h>
+#include <errorhandler.h>
#include "upgradeutilities.h"
#include "imapupgradejob.h"
@@ -58,7 +59,7 @@ int main(int argc, char *argv[])
if (!args->isSet("mime")) {
if (args->count() == 0) {
kWarning() << "specify imap server";
- return 0;
+ return -1;
}
ImapUpgradeJob *upgrader = new ImapUpgradeJob(&app);
QObject::connect(upgrader, SIGNAL(result(KJob*)), &app, SLOT(quit()));
@@ -101,7 +102,10 @@ int main(int argc, char *argv[])
upgrader->connectToAccount(args->arg(0), args->getOption("port").toInt(), args->getOption("user"), args->getOption("proxyauth"), args->getOption("password"), encryptionMode, authenticationMode);
args->clear();
- return app.exec();
+ if (app.exec() || Kolab::ErrorHandler::instance().error() >= Kolab::ErrorHandler::Error) {
+ return -1;
+ }
+ return 0;
}
QTextStream s(stdout);
@@ -116,9 +120,11 @@ int main(int argc, char *argv[])
Q_ASSERT( !data.isEmpty() );
s << Kolab::Upgrade::upgradeMime(data);
} else {
- s << Kolab::Upgrade::upgradeMime(stream.readAll().toLocal8Bit());
+ s << Kolab::Upgrade::upgradeMime(stream.readAll().toLatin1());
}
}
-
+ if (Kolab::ErrorHandler::instance().error() >= Kolab::ErrorHandler::Error) {
+ return -1;
+ }
return 0;
}