Fixed error handling of StripFactory

This commit is contained in:
0xFEEDC0DE64 committed 2017-12-11 09:46:14 +01:00
1 parent 7d03c764e8
commit b52a357f67
5 files changed
+26 -22

No files matched your search

+10 -1
View File
@@ -17,6 +17,7 @@
#include "replies/loginpagereply.h"
#include "replies/loginreply.h"
#include "replies/userinforeply.h"
#include "stripfactory.h"
bool loadAndInstallTranslator(QTranslator &translator,
const QLocale &locale,
@@ -198,7 +199,15 @@ int main(int argc, char *argv[])
reply->deleteLater();
}
MainWindow mainWindow(settings, erfassung, userInfo);
StripFactory stripFactory(&app);
if(!stripFactory.load(QDir(QCoreApplication::applicationDirPath()).absoluteFilePath("strips")))
{
QMessageBox::warning(&splashScreen, QCoreApplication::translate("main", "Could not load strips!"),
QCoreApplication::translate("main", "Could not load strips!") % "\n\n" % stripFactory.errorString());
return -1;
}
MainWindow mainWindow(settings, erfassung, userInfo, stripFactory);
mainWindow.show();
splashScreen.finish(&mainWindow);