diff options
Diffstat (limited to 'quanta/parsers/dtd')
| -rw-r--r-- | quanta/parsers/dtd/CMakeLists.txt | 7 | ||||
| -rw-r--r-- | quanta/parsers/dtd/dtdparser.cpp | 17 |
2 files changed, 15 insertions, 9 deletions
diff --git a/quanta/parsers/dtd/CMakeLists.txt b/quanta/parsers/dtd/CMakeLists.txt index 7997cc5a..5d767f5e 100644 --- a/quanta/parsers/dtd/CMakeLists.txt +++ b/quanta/parsers/dtd/CMakeLists.txt @@ -9,13 +9,20 @@ # ################################################# +add_compile_options( ${ICU_CXXFLAGS} ) + + include_directories( ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/quanta/dialogs ${CMAKE_SOURCE_DIR}/lib ${CMAKE_SOURCE_DIR}/quanta/parsers ${CMAKE_SOURCE_DIR}/quanta/utility ${CMAKE_SOURCE_DIR}/quanta/dialogs +) + +include_directories( SYSTEM ${TDE_INCLUDE_DIR} ${TQT_INCLUDE_DIRS} ${LIBXML_INCLUDE_DIRS} diff --git a/quanta/parsers/dtd/dtdparser.cpp b/quanta/parsers/dtd/dtdparser.cpp index 502551fd..9de0f39a 100644 --- a/quanta/parsers/dtd/dtdparser.cpp +++ b/quanta/parsers/dtd/dtdparser.cpp @@ -13,6 +13,10 @@ * * ***************************************************************************/ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + //qt includes #include <tqcheckbox.h> #include <tqfile.h> @@ -32,10 +36,6 @@ #include <tdeio/netaccess.h> //other includes -#ifdef LIBXML_2_5 -#include <libxml/hash.h> -#endif - #include <libxml/parser.h> #include <libxml/valid.h> @@ -82,8 +82,8 @@ bool DTDParser::parse(const TQString &targetDir, bool entitiesOnly) if( DTD::dtd_ptr == NULL ) { TQString errorStr = i18n("Unknown"); -#ifndef LIBXML_2_5 - xmlErrorPtr errorPtr = xmlGetLastError(); + // The type used is either xmlErrorPtr or const xmlError* + auto errorPtr = xmlGetLastError(); if (errorPtr != NULL) { TQString s = TQString::fromLatin1(errorPtr->message); @@ -99,9 +99,8 @@ bool DTDParser::parse(const TQString &targetDir, bool entitiesOnly) if (!s.isEmpty()) errorStr += "<br>" + s; errorStr += TQString("(%1, %2)").arg(errorPtr->line).arg(errorPtr->int2); - xmlResetError(errorPtr); + xmlResetLastError(); } -#endif KMessageBox::error(0, i18n("<qt>Error while parsing the DTD.<br>The error message is:<br><i>%1</i></qt>").arg(errorStr)); return false; } @@ -144,7 +143,7 @@ bool DTDParser::parse(const TQString &targetDir, bool entitiesOnly) TQFile file( DTD::dirName + "entities.tag" ); if ( file.open( IO_WriteOnly ) ) { - DTD::entityStream.setDevice(TQT_TQIODEVICE(&file)); + DTD::entityStream.setDevice(&file); DTD::entityStream.setEncoding(TQTextStream::UnicodeUTF8); DTD::entityStream << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << endl; DTD::entityStream << "<!DOCTYPE TAGS>" << endl |
