Fixed compilation using qjson subtree.

This commit is contained in:
Keith Bennett 2014-03-14 17:57:04 +00:00
parent 21204971ff
commit 2cd6787141
5 changed files with 12 additions and 10 deletions

View File

@ -14,9 +14,9 @@
#include "EntryConfig.h" #include "EntryConfig.h"
#include "core/Entry.h" #include "core/Entry.h"
#include "core/EntryAttributes.h" #include "core/EntryAttributes.h"
#include "qjson/parser.h" #include "qjson/src/parser.h"
#include "qjson/qobjecthelper.h" #include "qjson/src/qobjecthelper.h"
#include "qjson/serializer.h" #include "qjson/src/serializer.h"
static const char KEEPASSHTTP_NAME[] = "KeePassHttp Settings"; //TODO: duplicated string (also in Service.cpp) static const char KEEPASSHTTP_NAME[] = "KeePassHttp Settings"; //TODO: duplicated string (also in Service.cpp)

View File

@ -17,9 +17,9 @@
#include <QtCore/QStringList> #include <QtCore/QStringList>
#include <QtCore/QVariant> #include <QtCore/QVariant>
#include "qjson/parser.h" #include "qjson/src/parser.h"
#include "qjson/qobjecthelper.h" #include "qjson/src/qobjecthelper.h"
#include "qjson/serializer.h" #include "qjson/src/serializer.h"
#include "crypto/Random.h" #include "crypto/Random.h"
#include "crypto/SymmetricCipher.h" #include "crypto/SymmetricCipher.h"

View File

@ -23,7 +23,7 @@ set (qjson_HEADERS parser.h parserrunnable.h qobjecthelper.h serializer.h serial
# Required to use the intree copy of FlexLexer.h # Required to use the intree copy of FlexLexer.h
INCLUDE_DIRECTORIES(.) INCLUDE_DIRECTORIES(.)
add_library (qjson SHARED ${qjson_SRCS} ${qjson_MOC_SRCS} ${qjson_HEADERS}) add_library (qjson STATIC ${qjson_SRCS} ${qjson_MOC_SRCS} ${qjson_HEADERS})
IF (Qt5Core_FOUND) IF (Qt5Core_FOUND)
target_link_libraries( qjson ${Qt5Core_LIBRARIES}) target_link_libraries( qjson ${Qt5Core_LIBRARIES})
ELSE() ELSE()
@ -42,6 +42,8 @@ set_target_properties(qjson PROPERTIES
FRAMEWORK ${OSX_FRAMEWORK} FRAMEWORK ${OSX_FRAMEWORK}
) )
add_gcc_compiler_cxxflags("-fexceptions")
INSTALL(TARGETS qjson EXPORT qjson-export INSTALL(TARGETS qjson EXPORT qjson-export
LIBRARY DESTINATION ${LIB_INSTALL_DIR} LIBRARY DESTINATION ${LIB_INSTALL_DIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin

View File

@ -59,10 +59,10 @@ void ParserRunnable::run()
QVariant result = parser.parse (d->m_data, &ok); QVariant result = parser.parse (d->m_data, &ok);
if (ok) { if (ok) {
qDebug() << "successfully converted json item to QVariant object"; qDebug() << "successfully converted json item to QVariant object";
emit parsingFinished(result, true, QString()); Q_EMIT parsingFinished(result, true, QString());
} else { } else {
const QString errorText = tr("An error occurred while parsing json: %1").arg(parser.errorString()); const QString errorText = tr("An error occurred while parsing json: %1").arg(parser.errorString());
qCritical() << errorText; qCritical() << errorText;
emit parsingFinished(QVariant(), false, errorText); Q_EMIT parsingFinished(QVariant(), false, errorText);
} }
} }

View File

@ -58,5 +58,5 @@ void SerializerRunnable::run()
Serializer serializer; Serializer serializer;
bool ok; bool ok;
const QByteArray serialized = serializer.serialize( d->json, &ok); const QByteArray serialized = serializer.serialize( d->json, &ok);
emit parsingFinished( serialized, ok, serializer.errorMessage() ); Q_EMIT parsingFinished( serialized, ok, serializer.errorMessage() );
} }