Changeset View
Changeset View
Standalone View
Standalone View
generators/markdown/converter.cpp
Show First 20 Lines • Show All 46 Lines • ▼ Show 20 Line(s) | |||||
47 | 47 | | |||
48 | Converter::~Converter() | 48 | Converter::~Converter() | ||
49 | { | 49 | { | ||
50 | } | 50 | } | ||
51 | 51 | | |||
52 | QTextDocument* Converter::convert( const QString &fileName ) | 52 | QTextDocument* Converter::convert( const QString &fileName ) | ||
53 | { | 53 | { | ||
54 | FILE *markdownFile = fopen( fileName.toLocal8Bit(), "rb" ); | 54 | FILE *markdownFile = fopen( fileName.toLocal8Bit(), "rb" ); | ||
55 | if ( !markdownFile ) { | ||||
56 | emit error( i18n( "Failed to open the document" ), -1 ); | ||||
57 | return nullptr; | ||||
58 | } | ||||
59 | | ||||
55 | const QDir dir = QDir( fileName.left( fileName.lastIndexOf( '/' ) ) ); | 60 | const QDir dir = QDir( fileName.left( fileName.lastIndexOf( '/' ) ) ); | ||
56 | 61 | | |||
57 | MMIOT *markdownHandle = mkd_in( markdownFile, 0 ); | 62 | MMIOT *markdownHandle = mkd_in( markdownFile, 0 ); | ||
58 | 63 | | |||
59 | if ( !mkd_compile( markdownHandle, MKD_FENCEDCODE | MKD_GITHUBTAGS | MKD_AUTOLINK ) ) { | 64 | if ( !mkd_compile( markdownHandle, MKD_FENCEDCODE | MKD_GITHUBTAGS | MKD_AUTOLINK ) ) { | ||
60 | emit error( i18n( "Failed to compile the Markdown document." ), -1 ); | 65 | emit error( i18n( "Failed to compile the Markdown document." ), -1 ); | ||
61 | return 0; | 66 | return 0; | ||
62 | } | 67 | } | ||
▲ Show 20 Lines • Show All 101 Lines • Show Last 20 Lines |