Commit 5e5a8c71 authored by flypig's avatar flypig

Merge branch 'jb46819' into 'master'

Align with libwbxml 0.11.6 API

See merge request !2
parents 2e5199f4 6d05ea5c
......@@ -12,7 +12,7 @@ BuildRequires: pkgconfig(Qt5XmlPatterns)
BuildRequires: pkgconfig(Qt5Xml)
BuildRequires: pkgconfig(Qt5Sql)
BuildRequires: pkgconfig(Qt5Test)
BuildRequires: pkgconfig(libwbxml2)
BuildRequires: pkgconfig(libwbxml2) >= 0.11.6
BuildRequires: pkgconfig(sqlite3)
BuildRequires: pkgconfig(openobex)
BuildRequires: pkgconfig(buteosyncfw5) >= 0.6.24
......
......@@ -16,7 +16,8 @@ CONFIG += dll \
create_prl \
link_pkgconfig
PKGCONFIG = buteosyncfw5
PKGCONFIG = buteosyncfw5 \
libwbxml2
INCLUDEPATH += . \
syncelements \
......@@ -114,7 +115,7 @@ HEADERS += SyncItem.h \
OTHER_FILES += config/meego-syncml-conf.xsd \
config/meego-syncml-conf.xml
LIBS += -lsqlite3 -lwbxml2 -lopenobex
LIBS += -lsqlite3 -lopenobex
QTDIR = /usr/lib/qt5
......
......@@ -35,6 +35,7 @@
#include "SyncMLMessage.h"
#include "datatypes.h"
#include <wbxml/wbxml_encoder.h>
#include "LogMacros.h"
......@@ -174,19 +175,28 @@ bool LibWbXML2Encoder::decodeFromWbXML( const QByteArray& aWbXMLDocument, QByteA
LOG_DEBUG("Converting WbXML to XML");
WBXMLGenXMLParams params;
params.lang = WBXML_LANG_UNKNOWN;
WBXMLError error = WBXML_OK;
WBXMLConvWBXML2XML *conv = NULL;
error = wbxml_conv_wbxml2xml_create( &conv );
if (error != WBXML_OK) {
LOG_DEBUG("WbXML to XML conversion failed: " << (const char* )wbxml_errors_string( error ) );
return false;
}
wbxml_conv_wbxml2xml_set_language( conv, WBXML_LANG_UNKNOWN );
if( aPrettyPrint ) {
params.gen_type = WBXML_GEN_XML_INDENT;
params.indent = 3;
wbxml_conv_wbxml2xml_set_gen_type( conv, WBXML_GEN_XML_INDENT );
wbxml_conv_wbxml2xml_set_indent( conv, 3 );
}
else {
params.gen_type = WBXML_GEN_XML_COMPACT;
params.indent = 0;
wbxml_conv_wbxml2xml_set_gen_type( conv, WBXML_GEN_XML_COMPACT );
wbxml_conv_wbxml2xml_set_indent( conv, 0 );
}
params.keep_ignorable_ws = TRUE;
wbxml_conv_wbxml2xml_enable_preserve_whitespaces( conv );
wbxml_conv_wbxml2xml_set_charset( conv, WBXML_CHARSET_UNKNOWN );
const WB_UTINY* wbxml = reinterpret_cast<const WB_UTINY*>( aWbXMLDocument.constData() );
WB_ULONG wbxml_len = aWbXMLDocument.size();
......@@ -196,9 +206,9 @@ bool LibWbXML2Encoder::decodeFromWbXML( const QByteArray& aWbXMLDocument, QByteA
LOG_DEBUG( "WbXML buffer size: " << wbxml_len );
WBXMLError error = wbxml_conv_wbxml2xml_withlen( const_cast<WB_UTINY*>( wbxml ), wbxml_len,
&xml, &xml_len,
&params );
error = wbxml_conv_wbxml2xml_run( conv, const_cast<WB_UTINY*>( wbxml ), wbxml_len,
&xml, &xml_len);
wbxml_conv_wbxml2xml_destroy(conv);
QByteArray data;
......
......@@ -39,10 +39,14 @@
// libwbxml2-0 includes wbxml_config.h in wbxml.h.
#define WBXML_SUPPORT_SYNCML
#include <wbxml.h>
#include <wbxml/wbxml.h>
#include "SyncAgentConsts.h"
// Defined opaquely to match the full definitions in <wbxml/wbxml_tree.h>
typedef struct WBXMLTree_s WBXMLTree;
typedef struct WBXMLTreeNode_s WBXMLTreeNode;
namespace DataSync {
class SyncMLCmdObject;
......
......@@ -14,7 +14,8 @@ CONFIG += link_prl link_pkgconfig
# So if remember to compile them when debugging
LIBS += -L$${OUT_PWD}/$${tests_subdir_r}/../src/
PKGCONFIG += buteosyncfw5
PKGCONFIG += buteosyncfw5 \
libwbxml2
LIBS += -lbuteosyncml5
# This is needed to avoid adding the /usr/lib link directory before the
......
include(tests_common.pri)
TEMPLATE = subdirs
CONFIG += ordered
PKGCONFIG = libwbxml2
SUBDIRS = \
TestUtils.pro \
generaltests.pro \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment