| 12 | using namespace Mobi; |
| 13 | |
| 14 | MobiDocument::MobiDocument(const QString &fileName) |
| 15 | : QTextDocument() |
| 16 | #if QMOBIPOCKET_VERSION_MAJOR < 3 |
| 17 | , m_file(Mobipocket::QFileStream(fileName)) |
| 18 | { |
| 19 | #else |
| 20 | , m_file(QFile(fileName)) |
| 21 | { |
| 22 | if (!m_file.open(QIODeviceBase::ReadOnly)) { |
| 23 | return; |
| 24 | } |
| 25 | #endif |
| 26 | doc = std::make_unique<Mobipocket::Document>(&m_file); |
| 27 | if (doc->isValid()) { |