diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -264,6 +264,12 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU") set(IS_GNU 1) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wlogical-op") + + # TODO: remove multiple definitions of payeeIdentifierLoader::createPayeeIdentifierFromSqlDatabase + if(CMAKE_SYSTEM_NAME MATCHES "Windows") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Xlinker --allow-multiple-definition") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Xlinker --allow-multiple-definition") + endif() endif() # DebugKMM, Debugfull, Profile diff --git a/kmymoney/CMakeLists.txt b/kmymoney/CMakeLists.txt --- a/kmymoney/CMakeLists.txt +++ b/kmymoney/CMakeLists.txt @@ -127,7 +127,6 @@ models kmm_settings kmm_widgets - kmm_storage kmm_mymoney kgpgfile interfaces diff --git a/kmymoney/icons/icons.cpp b/kmymoney/icons/icons.cpp --- a/kmymoney/icons/icons.cpp +++ b/kmymoney/icons/icons.cpp @@ -304,20 +304,25 @@ KMM_ICONS_EXPORT void setIconThemeNames(const QString &_themeName) { sStandardIcons = getCommonNames(); + auto isWindows = false; + +#ifdef Q_OS_WIN + isWindows = true; +#endif QStringList kdeThemes {QStringLiteral("oxygen"), QStringLiteral("breeze"), QStringLiteral("breeze-dark")}; QHash iconNames; - if (kdeThemes.contains(_themeName)) { + if (kdeThemes.contains(_themeName) || isWindows) { // on Craft build system there is breeze icon theme, but it's in no way discoverable iconNames = getKDENames(); for (auto it = iconNames.cbegin(); it != iconNames.cend(); ++it) sStandardIcons.insert(it.key(), it.value()); } // get icon replacements for specific theme if (_themeName == kdeThemes.at(0)) iconNames = getOxygenNames(); - else if (_themeName == kdeThemes.at(1) || _themeName == kdeThemes.at(2)) + else if (_themeName == kdeThemes.at(1) || _themeName == kdeThemes.at(2) || isWindows) iconNames = getBreezeNames(); else if (_themeName == QLatin1String("Tango")) iconNames = getTangoNames(); diff --git a/kmymoney/kmymoney.cpp b/kmymoney/kmymoney.cpp --- a/kmymoney/kmymoney.cpp +++ b/kmymoney/kmymoney.cpp @@ -394,7 +394,11 @@ layout->setSpacing(6); { + #ifdef Q_OS_WIN + QString themeName = QLatin1Literal("system") // using QIcon::setThemeName on Craft build system causes icons to disappear + #else QString themeName = KMyMoneySettings::iconsTheme(); // get theme user wants + #endif if (!themeName.isEmpty() && themeName != QLatin1Literal("system")) // if it isn't default theme then set it QIcon::setThemeName(themeName); Icons::setIconThemeNames(QIcon::themeName()); // get whatever theme user ends up with and hope our icon names will fit that theme diff --git a/kmymoney/misc/CMakeLists.txt b/kmymoney/misc/CMakeLists.txt --- a/kmymoney/misc/CMakeLists.txt +++ b/kmymoney/misc/CMakeLists.txt @@ -10,11 +10,11 @@ webconnect.cpp ) -if( ${HAVE_UNISTD_H} AND ${HAVE_PWD_H} ) +if( "${HAVE_UNISTD_H}" AND "${HAVE_PWD_H}" ) set( kmm_utils_platformtools_SRCS platformtools_gnu.cpp ) -elseif( ${HAVE_WINDOWS_H} AND ${HAVE_LMCONS_H} AND ${HAVE_PROCESS_H} ) +elseif( "${HAVE_WINDOWS_H}" AND "${HAVE_LMCONS_H}" AND "${HAVE_PROCESS_H}" ) set( kmm_utils_platformtools_SRCS platformtools_nognu.cpp ) diff --git a/kmymoney/mymoney/CMakeLists.txt b/kmymoney/mymoney/CMakeLists.txt --- a/kmymoney/mymoney/CMakeLists.txt +++ b/kmymoney/mymoney/CMakeLists.txt @@ -28,6 +28,23 @@ payeeidentifiermodel.cpp ) + # storage_a_SOURCES cannot be set in storage directory on MS Windows + # because, while building kmm_storage, linker reports many undefined symbols + # which are in fact available in kmm_mymoney + set(storage_a_SOURCES + ./storage/imymoneystorageformat.cpp + ./storage/mymoneystoragexml.cpp + ./storage/mymoneystoragemgr.cpp + ./storage/mymoneystorageanon.cpp + ./storage/kmymoneystorageplugin.cpp + ./storage/mymoneystoragenames.cpp + ) + + if(KMM_DEBUG) + list(APPEND storage_a_SOURCES ./storage/mymoneystoragedump.cpp) + endif() + +list(APPEND kmm_mymoney_LIB_SRCS ${storage_a_SOURCES}) set(mymoney_HEADERS ${CMAKE_CURRENT_BINARY_DIR}/kmm_mymoney_export.h mymoneyobject.h mymoneyaccount.h mymoneycategory.h mymoneyexception.h @@ -48,6 +65,7 @@ ) add_library(kmm_mymoney SHARED ${kmm_mymoney_LIB_SRCS}) +kde_target_enable_exceptions(kmm_mymoney PUBLIC) target_compile_features(kmm_mymoney PUBLIC cxx_nullptr PRIVATE cxx_decltype cxx_lambdas cxx_constexpr cxx_range_for) @@ -58,9 +76,11 @@ kmm_icons Qt5::Xml Qt5::Core + Qt5::Gui + Qt5::Sql KF5::Service + KF5::I18n Alkimia::alkimia - kmm_storage kmm_payeeidentifier_loader kmm_payeeidentifier payeeidentifier_iban_bic diff --git a/kmymoney/mymoney/storage/CMakeLists.txt b/kmymoney/mymoney/storage/CMakeLists.txt --- a/kmymoney/mymoney/storage/CMakeLists.txt +++ b/kmymoney/mymoney/storage/CMakeLists.txt @@ -9,35 +9,6 @@ databasestoreableobject.h ) -set(storage_a_SOURCES - imymoneystorageformat.cpp - mymoneystoragexml.cpp - mymoneystoragemgr.cpp - mymoneystorageanon.cpp - kmymoneystorageplugin.cpp - mymoneystoragenames.cpp - ) - -if(KMM_DEBUG) - list(APPEND storage_a_SOURCES mymoneystoragedump.cpp) -endif() - -# This library is actually not needed. It is built just for -# convenience, and then linked into kmm_mymoney. -add_library( kmm_storage STATIC ${storage_a_SOURCES} ) -kde_target_enable_exceptions(kmm_storage PUBLIC) - -target_link_libraries( kmm_storage - PUBLIC - KF5::Service - KF5::I18n - Qt5::Core - Qt5::Xml - Qt5::Sql - Qt5::Gui - Alkimia::alkimia -) - ########### install files ############### install(FILES ${storage_HEADERS} diff --git a/kmymoney/mymoney/storage/imymoneystorageformat.h b/kmymoney/mymoney/storage/imymoneystorageformat.h --- a/kmymoney/mymoney/storage/imymoneystorageformat.h +++ b/kmymoney/mymoney/storage/imymoneystorageformat.h @@ -28,6 +28,8 @@ * @author Kevin Tambascio (ktambascio@yahoo.com) */ +#include "kmm_mymoney_export.h" + // ---------------------------------------------------------------------------- // QT Includes @@ -39,7 +41,7 @@ class MyMoneyStorageMgr; -class IMyMoneyOperationsFormat +class KMM_MYMONEY_EXPORT IMyMoneyOperationsFormat { public: IMyMoneyOperationsFormat(); diff --git a/kmymoney/mymoney/storage/kmymoneystorageplugin.h b/kmymoney/mymoney/storage/kmymoneystorageplugin.h --- a/kmymoney/mymoney/storage/kmymoneystorageplugin.h +++ b/kmymoney/mymoney/storage/kmymoneystorageplugin.h @@ -19,6 +19,8 @@ #ifndef KMYMONEYSTORAGEPLUGIN_H #define KMYMONEYSTORAGEPLUGIN_H +#include "kmm_mymoney_export.h" + #include #include @@ -30,7 +32,7 @@ * @brief Interface for plugins which store data in an sql database * */ -class storagePlugin : public QObject +class KMM_MYMONEY_EXPORT storagePlugin : public QObject { Q_OBJECT diff --git a/kmymoney/mymoney/storage/mymoneystorageanon.h b/kmymoney/mymoney/storage/mymoneystorageanon.h --- a/kmymoney/mymoney/storage/mymoneystorageanon.h +++ b/kmymoney/mymoney/storage/mymoneystorageanon.h @@ -24,6 +24,8 @@ #ifndef MYMONEYSTORAGEANON_H #define MYMONEYSTORAGEANON_H +#include "kmm_mymoney_export.h" + // ---------------------------------------------------------------------------- // QT Includes @@ -60,7 +62,7 @@ * @author Ace Jones */ -class MyMoneyStorageANON : public MyMoneyStorageXML +class KMM_MYMONEY_EXPORT MyMoneyStorageANON : public MyMoneyStorageXML { public: MyMoneyStorageANON(); diff --git a/kmymoney/mymoney/storage/mymoneystoragemgr.h b/kmymoney/mymoney/storage/mymoneystoragemgr.h --- a/kmymoney/mymoney/storage/mymoneystoragemgr.h +++ b/kmymoney/mymoney/storage/mymoneystoragemgr.h @@ -23,6 +23,8 @@ #ifndef MYMONEYSTORAGEMGR_H #define MYMONEYSTORAGEMGR_H +#include "kmm_mymoney_export.h" + // ---------------------------------------------------------------------------- // QT Includes @@ -87,7 +89,7 @@ */ class MyMoneyStorageMgrPrivate; -class MyMoneyStorageMgr : public MyMoneyKeyValueContainer +class KMM_MYMONEY_EXPORT MyMoneyStorageMgr : public MyMoneyKeyValueContainer { Q_DISABLE_COPY(MyMoneyStorageMgr) KMM_MYMONEY_UNIT_TESTABLE diff --git a/kmymoney/mymoney/storage/mymoneystoragenames.h b/kmymoney/mymoney/storage/mymoneystoragenames.h --- a/kmymoney/mymoney/storage/mymoneystoragenames.h +++ b/kmymoney/mymoney/storage/mymoneystoragenames.h @@ -18,6 +18,8 @@ #ifndef MYMONEYSTORAGENAMES_H #define MYMONEYSTORAGENAMES_H +#include "kmm_mymoney_export.h" + // ---------------------------------------------------------------------------- // QT Includes @@ -65,7 +67,7 @@ enum idNameE { stdAccLiability, stdAccAsset, stdAccExpense, stdAccIncome, stdAccEquity }; -extern const QHash stdAccNames; +extern const KMM_MYMONEY_EXPORT QHash stdAccNames; } #endif diff --git a/kmymoney/mymoney/storage/mymoneystoragexml.h b/kmymoney/mymoney/storage/mymoneystoragexml.h --- a/kmymoney/mymoney/storage/mymoneystoragexml.h +++ b/kmymoney/mymoney/storage/mymoneystoragexml.h @@ -20,6 +20,8 @@ #ifndef MYMONEYSTORAGEXML_H #define MYMONEYSTORAGEXML_H +#include "kmm_mymoney_export.h" + // ---------------------------------------------------------------------------- // QT Includes @@ -63,7 +65,7 @@ typedef QMap MyMoneyPriceEntries; typedef QMap MyMoneyPriceList; -class MyMoneyStorageXML : public IMyMoneyOperationsFormat +class KMM_MYMONEY_EXPORT MyMoneyStorageXML : public IMyMoneyOperationsFormat { friend class MyMoneyXmlContentHandler; public: diff --git a/kmymoney/plugins/kbanking/kbanking.cpp b/kmymoney/plugins/kbanking/kbanking.cpp --- a/kmymoney/plugins/kbanking/kbanking.cpp +++ b/kmymoney/plugins/kbanking/kbanking.cpp @@ -121,7 +121,7 @@ if (exp.exactMatch(proxy)) { proxy = exp.cap(2); qDebug("Setting GWEN_PROXY to '%s'", qPrintable(proxy)); - if (setenv("GWEN_PROXY", qPrintable(proxy), 1) == -1) { + if (!qputenv("GWEN_PROXY", qPrintable(proxy))) { qDebug("Unable to setup GWEN_PROXY"); } }