summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Swift/QtUI/QtAboutWidget.cpp23
1 files changed, 15 insertions, 8 deletions
diff --git a/Swift/QtUI/QtAboutWidget.cpp b/Swift/QtUI/QtAboutWidget.cpp
index 2fc8bae..d90e35a 100644
--- a/Swift/QtUI/QtAboutWidget.cpp
+++ b/Swift/QtUI/QtAboutWidget.cpp
@@ -16,8 +16,11 @@
#include <QVBoxLayout>
#include <QtGlobal>
+#include <Swiften/Base/Log.h>
#include <Swiften/Base/Platform.h>
+#include <Swift/QtUI/QtSwiftUtil.h>
+
namespace Swift {
QtAboutWidget::QtAboutWidget() : QDialog() {
@@ -91,14 +94,18 @@ void QtAboutWidget::openPlainTextWindow(const QString& path) {
text->setAttribute(Qt::WA_DeleteOnClose);
text->setReadOnly(true);
QFile file(path);
- file.open(QIODevice::ReadOnly);
- QTextStream in(&file);
- in.setCodec("UTF-8");
- text->setPlainText(in.readAll());
- file.close();
- text->resize(500, 600);
- text->show();
- text->activateWindow();
+ if (file.open(QIODevice::ReadOnly)) {
+ QTextStream in(&file);
+ in.setCodec("UTF-8");
+ text->setPlainText(in.readAll());
+ file.close();
+ text->resize(500, 600);
+ text->show();
+ text->activateWindow();
+ }
+ else {
+ SWIFT_LOG(error) << "Failed to open " << Q2PSTRING(path) << "." << std::endl;
+ }
}
}