finally implement bug reporting (#104)

This commit is contained in:
2016-08-25 13:33:08 +03:00
parent 5b9984d950
commit 80d926290c
10 changed files with 137 additions and 31 deletions

View File

@ -21,6 +21,7 @@
#include <KNotifications/KNotification>
#include <QDesktopServices>
#include <QFile>
#include <QProcess>
#include <QUrl>
@ -56,6 +57,23 @@ void AWActions::checkUpdates(const bool showAnyway)
}
QString AWActions::getFileContent(const QString path) const
{
qCDebug(LOG_AW) << "Get content from file" << path;
QFile inputFile(path);
if (!inputFile.open(QIODevice::ReadOnly | QIODevice::Text)) {
qCWarning(LOG_AW) << "Could not open file as text"
<< inputFile.fileName();
return QString();
}
QString output = inputFile.readAll();
inputFile.close();
return output;
}
// HACK: since QML could not use QLoggingCategory I need this hack
bool AWActions::isDebugEnabled() const
{