| 22 | |
| 23 | namespace { |
| 24 | static QString readFile(const QString &filePath, const QByteArray &codec = QByteArrayLiteral("UTF-8")) |
| 25 | { |
| 26 | QFile file(filePath); |
| 27 | |
| 28 | if (!file.exists()) { |
| 29 | qWarning("%s: File does not exists", Q_FUNC_INFO); |
| 30 | return QString(); |
| 31 | } |
| 32 | |
| 33 | if (!file.open(QIODevice::ReadOnly)) { |
| 34 | qWarning("%s: File can not be opened", Q_FUNC_INFO); |
| 35 | return QString(); |
| 36 | } |
| 37 | |
| 38 | return QStringDecoder(codec).decode(file.readAll()); |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | using namespace GammaRay; |
no test coverage detected