diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index df24c019..9776ccc4 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -1,120 +1,121 @@ set(KNewStuffCore_SRCS author.cpp cache.cpp downloadmanager.cpp engine.cpp entryinternal.cpp imageloader.cpp installation.cpp itemsmodel.cpp provider.cpp security.cpp tagsfilterchecker.cpp xmlloader.cpp + errorcode.cpp # A system by which queries can be passed to the user, and responses # gathered, depending on implementation. See question.h for details. question.cpp questionmanager.cpp questionlistener.cpp # A set of minimal KJob based classes, designed to replace the # more powerful KIO based system in places where KIO is not available # for one reason or another. jobs/downloadjob.cpp jobs/filecopyjob.cpp jobs/filecopyworker.cpp jobs/httpjob.cpp jobs/httpworker.cpp ../attica/atticaprovider.cpp ../staticxml/staticxmlprovider.cpp ../upload/atticahelper.cpp ) ecm_qt_declare_logging_category(KNewStuffCore_SRCS HEADER knewstuffcore_debug.h IDENTIFIER KNEWSTUFFCORE CATEGORY_NAME org.kde.knewstuff.core) add_library(KF5NewStuffCore ${KNewStuffCore_SRCS} ) add_library(KF5::NewStuffCore ALIAS KF5NewStuffCore ) generate_export_header(KF5NewStuffCore BASE_NAME KNewStuffCore EXPORT_FILE_NAME knewstuffcore_export.h) # The src/ dir is needed for the entry.h header. This only happens because some # code in Core uses an enum from KNS3::Entry target_include_directories(KF5NewStuffCore PUBLIC "$" INTERFACE "$") target_link_libraries(KF5NewStuffCore PUBLIC KF5::Attica # For interacting with ocs providers, public for uploaddialog slots KF5::CoreAddons Qt5::Xml PRIVATE KF5::Archive # For decompressing archives KF5::I18n # For translations KF5::ConfigCore Qt5::Gui # For QImage ) set_target_properties(KF5NewStuffCore PROPERTIES VERSION ${KNEWSTUFF_VERSION_STRING} SOVERSION ${KNEWSTUFF_SOVERSION} EXPORT_NAME NewStuffCore ) ecm_generate_headers(KNewStuffCore_CamelCase_HEADERS HEADER_NAMES Author Cache DownloadManager Engine EntryInternal ErrorCode Installation ItemsModel Provider Question QuestionListener QuestionManager Security TagsFilterChecker XmlLoader REQUIRED_HEADERS KNewStuffCore_HEADERS PREFIX KNSCore ) install(TARGETS KF5NewStuffCore EXPORT KF5NewStuffCoreTargets ${KF5_INSTALL_TARGETS_DEFAULT_ARGS}) install(FILES ${KNewStuffCore_CamelCase_HEADERS} DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/KNewStuff3/KNSCore COMPONENT Devel) install(FILES ${KNewStuffCore_HEADERS} ${CMAKE_CURRENT_BINARY_DIR}/knewstuffcore_export.h DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/KNewStuff3/knscore COMPONENT Devel) if(BUILD_QCH) ecm_add_qch( KF5NewStuffCore_QCH NAME KNewStuffCore BASE_NAME KF5NewStuffCore VERSION ${KF5_VERSION} ORG_DOMAIN org.kde SOURCES ${KNewStuffCore_HEADERS} LINK_QCHS KF5Attica_QCH KF5CoreAddons_QCH BLANK_MACROS KNEWSTUFFCORE_EXPORT KNEWSTUFFCORE_DEPRECATED KNEWSTUFFCORE_DEPRECATED_EXPORT TAGFILE_INSTALL_DESTINATION ${KDE_INSTALL_QTQCHDIR} QCH_INSTALL_DESTINATION ${KDE_INSTALL_QTQCHDIR} COMPONENT Devel ) endif() include(ECMGeneratePriFile) ecm_generate_pri_file(BASE_NAME KNewStuffCore LIB_NAME KF5NewStuffCore DEPS "Attica" FILENAME_VAR COREPRI_FILENAME INCLUDE_INSTALL_DIR ${KDE_INSTALL_INCLUDEDIR_KF5}/KNewStuff3) install(FILES ${COREPRI_FILENAME} DESTINATION ${ECM_MKSPECS_INSTALL_DIR}) diff --git a/src/core/errorcode.h b/src/core/errorcode.h index 918ca07e..5889f7f2 100644 --- a/src/core/errorcode.h +++ b/src/core/errorcode.h @@ -1,40 +1,46 @@ /* knewstuff3/errorcode.h. Copyright (c) 2018 Dan Leinir Turthra Jensen This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ #ifndef KNSCORE_ERRORCODE_H #define KNSCORE_ERRORCODE_H -namespace KNSCore { +#include "knewstuffcore_export.h" +#include + +namespace KNSCore +{ + KNEWSTUFFCORE_EXPORT Q_NAMESPACE /** * An enumeration of specific error conditions which might occur and which * users of KNewStuff would want to react to. It is used by both the Engine and * Provider classes. * @since 5.53 */ enum ErrorCode { UnknownError, ///< An unknown error (this should not be used, an error report of this nature should be considered a bug) NetworkError, ///< A network error. In signalErrorCode, this will be accompanied by the QtNetwork error code in the metadata OcsError, ///< An error reported by the OCS API server. In signalErrorCode, this will be accompanied by the OCS error code in the metadata ConfigFileError, ///< The configuration file is missing or somehow incorrect. The configuration file filename will be held in the metadata ProviderError, ///< A provider has failed to load or initialize. The provider file URL or provider URL will be held in the metadata InstallationError, ///< Installation of a content item has failed ImageError ///< Loading an image has failed. The entry name and preview type which failed will be held in the metadata as a QVariantList }; + Q_ENUM_NS(ErrorCode); } #endif//KNSCORE_ERRORCODE_H