HostOsInfo/FileUtils/PersistentSettings: Fix build without QtGui

Interesting for command line tools that want to pull this in but not
QtGui (e.g. sdktool)

Change-Id: Ic2f5c1f3126869cc38bf672345750d7d966560fd
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
This commit is contained in:
Eike Ziller
2017-08-18 14:32:39 +02:00
committed by hjk
parent 19cbd1ac48
commit 51e8a1730a
5 changed files with 48 additions and 12 deletions

View File

@@ -29,14 +29,18 @@
#include "algorithm.h"
#include "qtcassert.h"
#include <QDataStream>
#include <QDir>
#include <QDebug>
#include <QDateTime>
#include <QMessageBox>
#include <QRegExp>
#include <QTimer>
#include <QUrl>
#ifdef QT_GUI_LIB
#include <QMessageBox>
#endif
#ifdef Q_OS_WIN
#include <qt_windows.h>
#include <shlobj.h>
@@ -378,6 +382,7 @@ bool FileReader::fetch(const QString &fileName, QIODevice::OpenMode mode, QStrin
return false;
}
#ifdef QT_GUI_LIB
bool FileReader::fetch(const QString &fileName, QIODevice::OpenMode mode, QWidget *parent)
{
if (fetch(fileName, mode))
@@ -386,7 +391,7 @@ bool FileReader::fetch(const QString &fileName, QIODevice::OpenMode mode, QWidge
QMessageBox::critical(parent, tr("File Error"), m_errorString);
return false;
}
#endif // QT_GUI_LIB
FileSaverBase::FileSaverBase()
: m_hasError(false)
@@ -412,6 +417,7 @@ bool FileSaverBase::finalize(QString *errStr)
return false;
}
#ifdef QT_GUI_LIB
bool FileSaverBase::finalize(QWidget *parent)
{
if (finalize())
@@ -419,6 +425,7 @@ bool FileSaverBase::finalize(QWidget *parent)
QMessageBox::critical(parent, tr("File Error"), errorString());
return false;
}
#endif // QT_GUI_LIB
bool FileSaverBase::write(const char *data, int len)
{