diff --git a/kmymoney/CMakeLists.txt b/kmymoney/CMakeLists.txt --- a/kmymoney/CMakeLists.txt +++ b/kmymoney/CMakeLists.txt @@ -30,9 +30,6 @@ ${CMAKE_CURRENT_BINARY_DIR}/icons/ ${CMAKE_CURRENT_SOURCE_DIR}/menus/ ${CMAKE_CURRENT_BINARY_DIR}/menus/ - ${CMAKE_CURRENT_BINARY_DIR}/payeeidentifier/ibanandbic/widgets/ # TODO: this line should be moved to the target it belongs - ${CMAKE_CURRENT_BINARY_DIR}/payeeidentifier/ibanandbic/ - ${CMAKE_CURRENT_BINARY_DIR}/payeeidentifier/nationalaccount/ ) add_subdirectory( mymoney ) @@ -48,7 +45,6 @@ add_subdirectory( html ) add_subdirectory( templates ) add_subdirectory( misc ) -add_subdirectory( payeeidentifier ) add_subdirectory( icons ) add_subdirectory( menus ) if(BUILD_TESTING) diff --git a/kmymoney/models/payeeidentifiercontainermodel.cpp b/kmymoney/models/payeeidentifiercontainermodel.cpp --- a/kmymoney/models/payeeidentifiercontainermodel.cpp +++ b/kmymoney/models/payeeidentifiercontainermodel.cpp @@ -16,8 +16,9 @@ */ #include "payeeidentifiercontainermodel.h" -#include "payeeidentifier/payeeidentifierloader.h" #include "payeeidentifier/payeeidentifier.h" +#include "payeeidentifier/ibanbic/ibanbic.h" +#include "payeeidentifier/nationalaccount/nationalaccount.h" #include @@ -68,10 +69,15 @@ Qt::ItemFlags payeeIdentifierContainerModel::flags(const QModelIndex& index) const { - Qt::ItemFlags flags = QAbstractItemModel::flags(index) | Qt::ItemIsDragEnabled; - const QString type = data(index, payeeIdentifierType).toString(); + static const QVector editableDelegates { + payeeIdentifiers::ibanBic::staticPayeeIdentifierIid(), + payeeIdentifiers::nationalAccount::staticPayeeIdentifierIid() + }; + auto flags = QAbstractItemModel::flags(index) | Qt::ItemIsDragEnabled; + const auto type = data(index, payeeIdentifierType).toString(); + // type.isEmpty() means the type selection can be shown - if (!type.isEmpty() && payeeIdentifierLoader::instance()->hasItemEditDelegate(type)) + if (!type.isEmpty() && editableDelegates.contains(type)) flags |= Qt::ItemIsEditable; return flags; } diff --git a/kmymoney/mymoney/CMakeLists.txt b/kmymoney/mymoney/CMakeLists.txt --- a/kmymoney/mymoney/CMakeLists.txt +++ b/kmymoney/mymoney/CMakeLists.txt @@ -88,7 +88,6 @@ KF5::Service KF5::I18n Alkimia::alkimia - kmm_payeeidentifier_loader kmm_payeeidentifier kmm_plugin # TODO: fix this diff --git a/kmymoney/mymoney/mymoneypayeeidentifiercontainer.cpp b/kmymoney/mymoney/mymoneypayeeidentifiercontainer.cpp --- a/kmymoney/mymoney/mymoneypayeeidentifiercontainer.cpp +++ b/kmymoney/mymoney/mymoneypayeeidentifiercontainer.cpp @@ -19,7 +19,6 @@ #include -#include "payeeidentifier/payeeidentifierloader.h" #include "payeeidentifier/ibanbic/ibanbic.h" #include "payeeidentifier/nationalaccount/nationalaccount.h" #include "payeeidentifier/unavailableplugin/unavailableplugin.h" diff --git a/kmymoney/mymoney/payeeidentifier/CMakeLists.txt b/kmymoney/mymoney/payeeidentifier/CMakeLists.txt --- a/kmymoney/mymoney/payeeidentifier/CMakeLists.txt +++ b/kmymoney/mymoney/payeeidentifier/CMakeLists.txt @@ -28,31 +28,6 @@ install( TARGETS kmm_payeeidentifier ${KDE_INSTALL_TARGETS_DEFAULT_ARGS}) -## Plugin loader - -set ( PAYEEIDENTIFIER_LOADER_SCRS - payeeidentifierloader.cpp -) - -add_library( kmm_payeeidentifier_loader SHARED - ${PAYEEIDENTIFIER_LOADER_SCRS} -) - -generate_export_header(kmm_payeeidentifier_loader BASE_NAME kmm_payeeidentifier_loader) - -target_link_libraries( kmm_payeeidentifier_loader - PUBLIC - Qt5::Core - PRIVATE - Qt5::Widgets - KF5::Service -) - -set_target_properties(kmm_payeeidentifier_loader PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR}) - -install(TARGETS kmm_payeeidentifier_loader - ${KDE_INSTALL_TARGETS_DEFAULT_ARGS} ) - if(BUILD_TESTING) add_subdirectory(tests) endif() diff --git a/kmymoney/mymoney/payeeidentifier/payeeidentifiercontainermodel.h b/kmymoney/mymoney/payeeidentifier/payeeidentifiercontainermodel.h deleted file mode 100644 --- a/kmymoney/mymoney/payeeidentifier/payeeidentifiercontainermodel.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright 2014-2015 Christian Dávid - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef PAYEEIDENTIFIERCONTAINERMODEL_H -#define PAYEEIDENTIFIERCONTAINERMODEL_H - -#include -#include "mymoney/mymoneypayeeidentifiercontainer.h" -#include "payeeidentifier/payeeidentifier.h" - -/** - * @brief Model for MyMoneyPayeeIdentifierContainer - * - * Changes the user does have initernal effect only. - */ -class payeeIdentifierContainerModel : public QAbstractListModel -{ - Q_OBJECT - -public: - enum roles { - payeeIdentifierType = Qt::UserRole, /**< type of payeeIdentifier */ - payeeIdentifier = Qt::UserRole + 1 /**< actual payeeIdentifier */ - }; - - explicit payeeIdentifierContainerModel(QObject* parent = 0); - - virtual QVariant data(const QModelIndex& index, int role) const; - - /** - * This model only supports to edit payeeIdentifier role with a QVariant of type - * payeeIdentifier. - */ - virtual bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole); - - virtual Qt::ItemFlags flags(const QModelIndex& index) const; - - virtual int rowCount(const QModelIndex& parent) const; - - virtual bool insertRows(int row, int count, const QModelIndex& parent); - virtual bool removeRows(int row, int count, const QModelIndex& parent); - - /** - * @brief Set source of data - * - * This makes the model editable. - */ - void setSource(MyMoneyPayeeIdentifierContainer data); - - /** @brief Get stored data */ - QList< ::payeeIdentifier > identifiers() const; - -public Q_SLOTS: - /** - * @brief Removes all data from the model - * - * The model is not editable afterwards. - */ - void closeSource(); - -private: - /** @internal - * The use of a shared pointer makes this future prof. Because using identifier() causes - * some unnecessary work. - */ - QSharedPointer m_data; -}; - -#endif // PAYEEIDENTIFIERMODEL_H diff --git a/kmymoney/mymoney/payeeidentifier/payeeidentifiercontainermodel.cpp b/kmymoney/mymoney/payeeidentifier/payeeidentifiercontainermodel.cpp deleted file mode 100644 --- a/kmymoney/mymoney/payeeidentifier/payeeidentifiercontainermodel.cpp +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Copyright 2014-2015 Christian Dávid - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "payeeidentifiermodel.h" -#include "mymoney/mymoneyfile.h" -#include "payeeidentifier/payeeidentifierloader.h" -#include "payeeidentifier/payeeidentifier.h" - -#include - -#include - -payeeIdentifierContainerModel::payeeIdentifierModel(QObject* parent) - : QAbstractListModel(parent), - m_data(QSharedPointer()) -{ -} - -QVariant payeeIdentifierContainerModel::data(const QModelIndex& index, int role) const -{ - // Needed for the selection box and it prevents a crash if index is out of range - if (m_data.isNull() || index.row() >= rowCount(index.parent()) - 1) - return QVariant(); - - const ::payeeIdentifier ident = m_data->payeeIdentifiers().at(index.row()); - - if (role == payeeIdentifier) { - return QVariant::fromValue< ::payeeIdentifier >(ident); - } else if (ident.isNull()) { - return QVariant(); - } else if (role == payeeIdentifierType) { - return ident.iid(); - } else if (role == Qt::DisplayRole) { - // The custom delegates won't ask for this role - return QVariant::fromValue(i18n("The plugin to show this information could not be found.")); - } - return QVariant(); -} - -bool payeeIdentifierContainerModel::setData(const QModelIndex& index, const QVariant& value, int role) -{ - if (!m_data.isNull() && role == payeeIdentifier) { - ::payeeIdentifier ident = value.value< ::payeeIdentifier >(); - if (index.row() == rowCount(index.parent()) - 1) { - // The new row will be the last but one - beginInsertRows(index.parent(), index.row() - 1, index.row() - 1); - m_data->addPayeeIdentifier(ident); - endInsertRows(); - } else { - m_data->modifyPayeeIdentifier(index.row(), ident); - emit dataChanged(createIndex(index.row(), 0), createIndex(index.row(), 0)); - } - return true; - } - return QAbstractItemModel::setData(index, value, role); -} - -Qt::ItemFlags payeeIdentifierContainerModel::flags(const QModelIndex& index) const -{ - Qt::ItemFlags flags = QAbstractItemModel::flags(index) | Qt::ItemIsDragEnabled; - const QString type = data(index, payeeIdentifierType).toString(); - // type.isEmpty() means the type selection can be shown - if (!type.isEmpty() && payeeIdentifierLoader::instance()->hasItemEditDelegate(type)) - flags |= Qt::ItemIsEditable; - return flags; -} - -int payeeIdentifierContainerModel::rowCount(const QModelIndex& parent) const -{ - Q_UNUSED(parent); - if (m_data.isNull()) - return 0; - // Always a row more which creates new entries - return m_data->payeeIdentifiers().count() + 1; -} - -/** @brief unused at the moment */ -bool payeeIdentifierContainerModel::insertRows(int row, int count, const QModelIndex& parent) -{ - Q_UNUSED(row); - Q_UNUSED(count); - Q_UNUSED(parent); - return false; -} - -bool payeeIdentifierContainerModel::removeRows(int row, int count, const QModelIndex& parent) -{ - if (m_data.isNull()) - return false; - - if (count < 1 || row + count >= rowCount(parent)) - return false; - - beginRemoveRows(parent, row, row + count - 1); - for (int i = row; i < row + count; ++i) { - m_data->removePayeeIdentifier(i); - } - endRemoveRows(); - return true; -} - -void payeeIdentifierContainerModel::setSource(const MyMoneyPayeeIdentifierContainer data) -{ - beginResetModel(); - m_data = QSharedPointer(new MyMoneyPayeeIdentifierContainer(data)); - endResetModel(); -} - -void payeeIdentifierContainerModel::closeSource() -{ - beginResetModel(); - m_data = QSharedPointer(); - endResetModel(); -} - -QList< ::payeeIdentifier > payeeIdentifierContainerModel::identifiers() const -{ - if (m_data.isNull()) - return QList< ::payeeIdentifier >(); - return m_data->payeeIdentifiers(); -} diff --git a/kmymoney/mymoney/payeeidentifier/payeeidentifierloader.h b/kmymoney/mymoney/payeeidentifier/payeeidentifierloader.h deleted file mode 100644 --- a/kmymoney/mymoney/payeeidentifier/payeeidentifierloader.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright 2014-2016 Christian Dávid - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef PAYEEIDENTIFIERLOADER_H -#define PAYEEIDENTIFIERLOADER_H - -#include "kmm_payeeidentifier_loader_export.h" - -class QAbstractItemDelegate; -class QString; -class QObject; -class QStringList; - -/** - * - * @todo Load delegates dynamically - */ -class KMM_PAYEEIDENTIFIER_LOADER_EXPORT payeeIdentifierLoader -{ -public: - payeeIdentifierLoader(); - ~payeeIdentifierLoader(); - - /** - * @brief Create a delegate to show/edit - * - * The payeeIdentifier to edit is identified by payeeIdentifierId. parent is set as parent of the created - * Delegate. - * - * @return a pointer to a delegate or null_ptr. Caller takes ownership. - */ - QAbstractItemDelegate* createItemDelegate(const QString& payeeIdentifierId, QObject* parent = 0); - - /** - * @brief Test if a delegate for editing is available - */ - bool hasItemEditDelegate(const QString& payeeIdentifierId); - - /** - * @brief List availableDelegates delegates - * - * @return a list of payeeIdentifierIds for which a delegate exists. - * @see createItemDelegate() - */ - QStringList availableDelegates(); - - static payeeIdentifierLoader* instance() { - return &m_self; - } - -private: - static payeeIdentifierLoader m_self; -}; - -#endif // PAYEEIDENTIFIERLOADER_H diff --git a/kmymoney/mymoney/payeeidentifier/payeeidentifierloader.cpp b/kmymoney/mymoney/payeeidentifier/payeeidentifierloader.cpp deleted file mode 100644 --- a/kmymoney/mymoney/payeeidentifier/payeeidentifierloader.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright 2014-2016 Christian Dávid - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "payeeidentifier/payeeidentifierloader.h" - -#include -#include - -#include - -payeeIdentifierLoader payeeIdentifierLoader::m_self; - -payeeIdentifierLoader::payeeIdentifierLoader() -{ -} - -payeeIdentifierLoader::~payeeIdentifierLoader() -{ -} - -/** - * @todo enable delegates again - */ -QAbstractItemDelegate* payeeIdentifierLoader::createItemDelegate(const QString& payeeIdentifierId, QObject* parent) -{ - /** @todo escape ' in payeeIdentifierId */ - KService::List offers = KServiceTypeTrader::self()->query(QLatin1String("KMyMoney/PayeeIdentifierDelegate"), QString("'%1' ~in [X-KMyMoney-payeeIdentifierIds]").arg(payeeIdentifierId)); - if (!offers.isEmpty()) { - QString error; - QAbstractItemDelegate* ptr = offers.at(0)->createInstance(parent, QVariantList(), &error); - if (ptr == nullptr) { - qWarning() << "could not load delegate" << error << payeeIdentifierId; - } - return ptr; - } - return nullptr; -} - -bool payeeIdentifierLoader::hasItemEditDelegate(const QString& payeeIdentifierId) -{ - QAbstractItemDelegate* delegate = createItemDelegate(payeeIdentifierId); - const bool ret = (delegate != nullptr); - delete delegate; - return ret; -} - -QStringList payeeIdentifierLoader::availableDelegates() -{ - QStringList list; - KService::List offers = KServiceTypeTrader::self()->query(QLatin1String("KMyMoney/PayeeIdentifierDelegate")); - foreach (KService::Ptr offer, offers) { - list.append(offer->property("X-KMyMoney-payeeIdentifierIds", QVariant::StringList).toStringList()); - } - return list; -} diff --git a/kmymoney/mymoney/payeeidentifier/tests/CMakeLists.txt b/kmymoney/mymoney/payeeidentifier/tests/CMakeLists.txt --- a/kmymoney/mymoney/payeeidentifier/tests/CMakeLists.txt +++ b/kmymoney/mymoney/payeeidentifier/tests/CMakeLists.txt @@ -7,6 +7,5 @@ LINK_LIBRARIES Qt5::Test kmm_payeeidentifier - kmm_payeeidentifier_loader kmm_mymoney ) diff --git a/kmymoney/mymoney/payeeidentifier/tests/payeeidentifier-test.cpp b/kmymoney/mymoney/payeeidentifier/tests/payeeidentifier-test.cpp --- a/kmymoney/mymoney/payeeidentifier/tests/payeeidentifier-test.cpp +++ b/kmymoney/mymoney/payeeidentifier/tests/payeeidentifier-test.cpp @@ -21,7 +21,6 @@ #include "mymoney/payeeidentifier/payeeidentifier.h" #include "mymoney/payeeidentifier/payeeidentifiertyped.h" -#include "mymoney/payeeidentifier/payeeidentifierloader.h" #include "payeeidentifier/ibanbic/ibanbic.h" diff --git a/kmymoney/mymoney/tests/mymoneyfile-test.cpp b/kmymoney/mymoney/tests/mymoneyfile-test.cpp --- a/kmymoney/mymoney/tests/mymoneyfile-test.cpp +++ b/kmymoney/mymoney/tests/mymoneyfile-test.cpp @@ -40,7 +40,6 @@ #include "onlinejob.h" #include "payeeidentifier/ibanbic/ibanbic.h" -#include "payeeidentifier/payeeidentifierloader.h" #include "payeeidentifiertyped.h" QTEST_GUILESS_MAIN(MyMoneyFileTest) diff --git a/kmymoney/payeeidentifier/CMakeLists.txt b/kmymoney/payeeidentifier/CMakeLists.txt deleted file mode 100644 --- a/kmymoney/payeeidentifier/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory( ibanandbic ) -add_subdirectory( nationalaccount ) diff --git a/kmymoney/payeeidentifier/ibanandbic/CMakeLists.txt b/kmymoney/payeeidentifier/ibanandbic/CMakeLists.txt deleted file mode 100644 --- a/kmymoney/payeeidentifier/ibanandbic/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(widgets) diff --git a/kmymoney/payeeidentifier/ibanandbic/widgets/CMakeLists.txt b/kmymoney/payeeidentifier/ibanandbic/widgets/CMakeLists.txt deleted file mode 100644 --- a/kmymoney/payeeidentifier/ibanandbic/widgets/CMakeLists.txt +++ /dev/null @@ -1,77 +0,0 @@ -## Shared library for widgets and modulue for delegate -# Note: all "real" code is in ..._widgets, ..._delegate is only used to load the shared library - -set ( IBAN_BIC_WIDGETS_SCRS - kibanlineedit.cpp - kbicedit.cpp - ibanvalidator.cpp - bicvalidator.cpp - ibanbicitemdelegate.cpp - ibanbicitemedit.cpp -) - -set( IBAN_BIC_WIDGETS_HEADERS - kibanlineedit.h - kbicedit.h - ibanvalidator.h - bicvalidator.h - ibanbicitemdelegate.h - ${CMAKE_CURRENT_BINARY_DIR}/payeeidentifier_iban_bic_widgets_export.h -) - -ki18n_wrap_ui(IBAN_BIC_WIDGETS_SCRS - ibanbicitemedit.ui -) - -add_library( payeeidentifier_iban_bic_widgets SHARED - ${IBAN_BIC_WIDGETS_SCRS} -) - -set_target_properties(payeeidentifier_iban_bic_widgets - PROPERTIES VERSION ${PROJECT_VERSION} - SOVERSION ${PROJECT_VERSION_MAJOR} -) - -target_include_directories(payeeidentifier_iban_bic_widgets - PUBLIC ${CMAKE_CURRENT_BINARY_DIR} -) - -target_link_libraries( payeeidentifier_iban_bic_widgets PUBLIC - Qt5::Core - kmm_mymoney - kmm_widgets - kmm_plugin -) - -generate_export_header( payeeidentifier_iban_bic_widgets ) - -install(TARGETS payeeidentifier_iban_bic_widgets - ${INSTALL_TARGETS_DEFAULT_ARGS} -) - -## Delegate plugin -set (IBAN_BIC_UI_SCRS - pluginfactory.cpp -) - -add_library( payeeidentifier_iban_bic_delegates MODULE - ${IBAN_BIC_UI_SCRS} -) - -target_link_libraries( payeeidentifier_iban_bic_delegates - payeeidentifier_iban_bic_widgets - kmm_widgets - kmm_mymoney - Qt5::Core -) - -configure_file(kmymoney-ibanbic-delegate.desktop.in kmymoney-ibanbic-delegate.desktop) -kcoreaddons_desktop_to_json(payeeidentifier_iban_bic_widgets "${CMAKE_CURRENT_BINARY_DIR}/kmymoney-ibanbic-delegate.desktop") - -install(TARGETS payeeidentifier_iban_bic_delegates - DESTINATION "${KDE_INSTALL_PLUGINDIR}/kmymoney" -) - -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/kmymoney-ibanbic-delegate.desktop - DESTINATION ${SERVICES_INSTALL_DIR} -) diff --git a/kmymoney/payeeidentifier/ibanandbic/widgets/kmymoney-ibanbic-delegate.desktop.in b/kmymoney/payeeidentifier/ibanandbic/widgets/kmymoney-ibanbic-delegate.desktop.in deleted file mode 100644 --- a/kmymoney/payeeidentifier/ibanandbic/widgets/kmymoney-ibanbic-delegate.desktop.in +++ /dev/null @@ -1,19 +0,0 @@ -[Desktop Entry] -Type=Service -ServiceTypes=KMyMoney/PayeeIdentifierDelegate - -X-KMyMoney-payeeIdentifierIds=org.kmymoney.payeeIdentifier.ibanbic - -X-KDE-Library=kmymoney/payeeidentifier_iban_bic_delegates -X-KDE-PluginKeyword=ibanBicDelegate - -X-KDE-PluginInfo-Name=IBAN and BIC support -X-KDE-PluginInfo-Author=Christian David -X-KDE-PluginInfo-Email=christian-david@web.de -X-KDE-PluginInfo-Version=${PROJECT_VERSION}${PROJECT_VERSION_SUFFIX} -X-KDE-PluginInfo-Website=https://kmymoney.org/plugins.html -X-KDE-PluginInfo-License=GPLv2+ -X-KDE-PluginInfo-EnabledByDefault=true - -Name=payeeidentifier_iban_bic_widgets -Comment=Plugin to store international bank account number and business identifier code diff --git a/kmymoney/payeeidentifier/ibanandbic/widgets/pluginfactory.cpp b/kmymoney/payeeidentifier/ibanandbic/widgets/pluginfactory.cpp deleted file mode 100644 --- a/kmymoney/payeeidentifier/ibanandbic/widgets/pluginfactory.cpp +++ /dev/null @@ -1,28 +0,0 @@ -/* - * This file is part of KMyMoney, A Personal Finance Manager by KDE - * Copyright (C) 2014 Christian David - * Copyright (C) 2017 Łukasz Wojniłowicz - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include - -#include "ibanbicitemdelegate.h" - -K_PLUGIN_FACTORY(ibanAndBicPidDelegatesFactory, - registerPlugin("ibanBicDelegate"); - ) - -#include diff --git a/kmymoney/payeeidentifier/nationalaccount/CMakeLists.txt b/kmymoney/payeeidentifier/nationalaccount/CMakeLists.txt deleted file mode 100644 --- a/kmymoney/payeeidentifier/nationalaccount/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/kmymoney-nationalaccountnumberplugin.desktop.in ${CMAKE_CURRENT_BINARY_DIR}/kmymoney-nationalaccountnumberplugin.desktop) - -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/kmymoney-nationalaccountnumberplugin.desktop DESTINATION ${SERVICETYPES_INSTALL_DIR}) - -add_subdirectory( ui ) diff --git a/kmymoney/payeeidentifier/nationalaccount/kmymoney-nationalaccountnumberplugin.desktop.in b/kmymoney/payeeidentifier/nationalaccount/kmymoney-nationalaccountnumberplugin.desktop.in deleted file mode 100644 --- a/kmymoney/payeeidentifier/nationalaccount/kmymoney-nationalaccountnumberplugin.desktop.in +++ /dev/null @@ -1,10 +0,0 @@ -[Desktop Entry] -Type=ServiceType -X-KDE-ServiceType=KMyMoney/NationalAccountNumberPlugin -Name=A plugin which gives access to account number and bank code related information - -[PropertyDef::X-KMyMoney-PluginInfo-CountryCodes] -Type=QStringList - -[PropertyDef::X-KMyMoney-PluginInfo-BIC-CountryCodes] -Type=QStringList diff --git a/kmymoney/payeeidentifier/nationalaccount/ui/CMakeLists.txt b/kmymoney/payeeidentifier/nationalaccount/ui/CMakeLists.txt deleted file mode 100644 --- a/kmymoney/payeeidentifier/nationalaccount/ui/CMakeLists.txt +++ /dev/null @@ -1,28 +0,0 @@ -configure_file(kmymoney-nationalaccount-delegate.desktop.in kmymoney-nationalaccount-delegate.desktop) - -set( PAYEEIDENTIFIER_NATIONALACCOUNT_UI_SCRS - nationalaccountedit.cpp - nationalaccountdelegate.cpp - pluginfactory.cpp -) - -ki18n_wrap_ui( - PAYEEIDENTIFIER_NATIONALACCOUNT_UI_SCRS - nationalaccountedit.ui -) - -add_library( payeeidentifier_nationalAccount_ui MODULE - ${PAYEEIDENTIFIER_NATIONALACCOUNT_UI_SCRS} -) - -target_link_libraries( payeeidentifier_nationalAccount_ui - Qt5::Core - kmm_widgets - kmm_mymoney -) - -install(TARGETS payeeidentifier_nationalAccount_ui - DESTINATION "${KDE_INSTALL_PLUGINDIR}/kmymoney") - -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/kmymoney-nationalaccount-delegate.desktop - DESTINATION ${SERVICES_INSTALL_DIR}) diff --git a/kmymoney/payeeidentifier/nationalaccount/ui/kmymoney-nationalaccount-delegate.desktop.in b/kmymoney/payeeidentifier/nationalaccount/ui/kmymoney-nationalaccount-delegate.desktop.in deleted file mode 100644 --- a/kmymoney/payeeidentifier/nationalaccount/ui/kmymoney-nationalaccount-delegate.desktop.in +++ /dev/null @@ -1,19 +0,0 @@ -[Desktop Entry] -Type=Service -ServiceTypes=KMyMoney/PayeeIdentifierDelegate - -X-KMyMoney-payeeIdentifierIds=org.kmymoney.payeeIdentifier.national - -X-KDE-Library=kmymoney/payeeidentifier_nationalAccount_ui -X-KDE-PluginKeyword=delegate - -X-KDE-PluginInfo-Name=Support for national account numbers -X-KDE-PluginInfo-Author=Christian David -X-KDE-PluginInfo-Email=christian-david@web.de -X-KDE-PluginInfo-Version=${PROJECT_VERSION}${PROJECT_VERSION_SUFFIX} -X-KDE-PluginInfo-Website=https://kmymoney.org/plugins.html -X-KDE-PluginInfo-License=GPLv2+ -X-KDE-PluginInfo-EnabledByDefault=true - -Name=payeeidentifier_nationalAccount_ui -Comment=Plugin to store national account numbers diff --git a/kmymoney/payeeidentifier/nationalaccount/ui/pluginfactory.cpp b/kmymoney/payeeidentifier/nationalaccount/ui/pluginfactory.cpp deleted file mode 100644 --- a/kmymoney/payeeidentifier/nationalaccount/ui/pluginfactory.cpp +++ /dev/null @@ -1,28 +0,0 @@ -/* - * This file is part of KMyMoney, A Personal Finance Manager by KDE - * Copyright (C) 2014 Christian David - * Copyright (C) 2017 Łukasz Wojniłowicz - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include - -#include "nationalaccountdelegate.h" - -K_PLUGIN_FACTORY(ibanAndBicPidWidgetsFactory, - registerPlugin("delegate"); - ) - -#include diff --git a/kmymoney/plugins/onlinetasks/sepa/CMakeLists.txt b/kmymoney/plugins/onlinetasks/sepa/CMakeLists.txt --- a/kmymoney/plugins/onlinetasks/sepa/CMakeLists.txt +++ b/kmymoney/plugins/onlinetasks/sepa/CMakeLists.txt @@ -42,7 +42,6 @@ KF5::Service kmm_settings kmm_utils_validators - payeeidentifier_iban_bic_widgets KF5::ItemModels ) diff --git a/kmymoney/plugins/onlinetasks/sepa/ui/sepacredittransferedit.cpp b/kmymoney/plugins/onlinetasks/sepa/ui/sepacredittransferedit.cpp --- a/kmymoney/plugins/onlinetasks/sepa/ui/sepacredittransferedit.cpp +++ b/kmymoney/plugins/onlinetasks/sepa/ui/sepacredittransferedit.cpp @@ -29,13 +29,13 @@ #include "mymoney/payeeidentifiermodel.h" #include "onlinetasks/sepa/sepaonlinetransfer.h" -#include "payeeidentifier/ibanandbic/widgets/ibanvalidator.h" -#include "payeeidentifier/ibanandbic/widgets/bicvalidator.h" +#include "widgets/payeeidentifier/ibanbic/ibanvalidator.h" +#include "widgets/payeeidentifier/ibanbic/bicvalidator.h" #include "payeeidentifier/payeeidentifiertyped.h" #include "misc/charvalidator.h" #include "payeeidentifier/ibanbic/ibanbic.h" #include "styleditemdelegateforwarder.h" -#include "payeeidentifier/ibanandbic/widgets/ibanbicitemdelegate.h" +#include "widgets/payeeidentifier/ibanbic/ibanbicitemdelegate.h" #include "onlinejobtyped.h" #include "mymoneyaccount.h" #include "widgetenums.h" diff --git a/kmymoney/plugins/onlinetasks/sepa/ui/sepacredittransferedit.ui b/kmymoney/plugins/onlinetasks/sepa/ui/sepacredittransferedit.ui --- a/kmymoney/plugins/onlinetasks/sepa/ui/sepacredittransferedit.ui +++ b/kmymoney/plugins/onlinetasks/sepa/ui/sepacredittransferedit.ui @@ -188,7 +188,7 @@ KBicEdit QLineEdit -
payeeidentifier/ibanandbic/widgets/kbicedit.h
+
widgets/payeeidentifier/ibanbic/kbicedit.h
validatorFeedback(KMyMoneyValidationFeedback::MessageType,QString) @@ -205,7 +205,7 @@ KIbanLineEdit QLineEdit -
payeeidentifier/ibanandbic/widgets/kibanlineedit.h
+
widgets/payeeidentifier/ibanbic/kibanlineedit.h
validatorFeedback(KMyMoneyValidationFeedback::MessageType,QString) diff --git a/kmymoney/plugins/sql/mymoneystoragesql_p.h b/kmymoney/plugins/sql/mymoneystoragesql_p.h --- a/kmymoney/plugins/sql/mymoneystoragesql_p.h +++ b/kmymoney/plugins/sql/mymoneystoragesql_p.h @@ -58,7 +58,6 @@ #include "mymoneystoragemgr.h" #include "kmymoneystorageplugin.h" #include "onlinejobadministration.h" -#include "payeeidentifier/payeeidentifierloader.h" #include "onlinetasks/interfaces/tasks/onlinetask.h" #include "mymoneycostcenter.h" #include "mymoneyexception.h" diff --git a/kmymoney/views/kpayeeidentifierview.cpp b/kmymoney/views/kpayeeidentifierview.cpp --- a/kmymoney/views/kpayeeidentifierview.cpp +++ b/kmymoney/views/kpayeeidentifierview.cpp @@ -25,9 +25,10 @@ #include #include -#include "payeeidentifier/payeeidentifierloader.h" #include "payeeidentifiercontainermodel.h" #include "payeeidentifierselectiondelegate.h" +#include "widgets/payeeidentifier/ibanbic/ibanbicitemdelegate.h" +#include "widgets/payeeidentifier/nationalaccount/nationalaccountdelegate.h" payeeIdentifierDelegate::payeeIdentifierDelegate(QObject* parent) : StyledItemDelegateForwarder(parent) @@ -45,8 +46,13 @@ return delegate; } + QAbstractItemDelegate* delegate = nullptr; // Use this->parent() as parent because "this" is const - QAbstractItemDelegate* delegate = payeeIdentifierLoader::instance()->createItemDelegate(type, this->parent()); + if (type == payeeIdentifiers::ibanBic::staticPayeeIdentifierIid()) { + delegate = new ibanBicItemDelegate(this->parent()); + } else if (type == payeeIdentifiers::nationalAccount::staticPayeeIdentifierIid()) { + delegate = new nationalAccountDelegate(this->parent()); + } if (delegate == 0) { if (defaultDelegate == 0) diff --git a/kmymoney/views/payeeidentifierselectiondelegate.cpp b/kmymoney/views/payeeidentifierselectiondelegate.cpp --- a/kmymoney/views/payeeidentifierselectiondelegate.cpp +++ b/kmymoney/views/payeeidentifierselectiondelegate.cpp @@ -20,7 +20,6 @@ #include -#include "payeeidentifier/payeeidentifierloader.h" #include "models/payeeidentifiercontainermodel.h" #include "payeeidentifier/ibanbic/ibanbic.h" #include "payeeidentifier/nationalaccount/nationalaccount.h" @@ -55,16 +54,14 @@ connect(comboBox, SIGNAL(commitData(QWidget*)), this, SIGNAL(commitData(QWidget*))); comboBox->addItem(i18n("Please select the account number type")); - payeeIdentifierLoader *const loader = payeeIdentifierLoader::instance(); - - for (const auto &pidid : loader->availableDelegates()) { - QString delegateName; - if (pidid == payeeIdentifiers::ibanBic::staticPayeeIdentifierIid()) - delegateName = i18n("IBAN and BIC"); - else if (pidid == payeeIdentifiers::nationalAccount::staticPayeeIdentifierIid()) - delegateName = i18n("National Account Number"); - comboBox->addItem(delegateName, QVariant(pidid)); - } + + const QMap availableDelegates { + {payeeIdentifiers::ibanBic::staticPayeeIdentifierIid(), i18n("IBAN and BIC")}, + {payeeIdentifiers::nationalAccount::staticPayeeIdentifierIid(), i18n("National Account Number")} + }; + + for (auto delegate = availableDelegates.cbegin(); delegate != availableDelegates.cend(); ++delegate ) + comboBox->addItem(delegate.value(), delegate.key()); return comboBox; } diff --git a/kmymoney/widgets/CMakeLists.txt b/kmymoney/widgets/CMakeLists.txt --- a/kmymoney/widgets/CMakeLists.txt +++ b/kmymoney/widgets/CMakeLists.txt @@ -61,11 +61,46 @@ kmymoneyaccountsviewbase.cpp ) +set(nationalAccountWidget_SOURCES + ./payeeidentifier/nationalaccount/nationalaccountedit.cpp + ./payeeidentifier/nationalaccount/nationalaccountdelegate.cpp +) + +set(nationalAccountWidget_HEADERS + ./payeeidentifier/nationalaccount/nationalaccountdelegate.h + ./payeeidentifier/nationalaccount/nationalaccountedit.h +) + +set(IBANBICWidget_SOURCES + ./payeeidentifier/ibanbic/kibanlineedit.cpp + ./payeeidentifier/ibanbic/kbicedit.cpp + ./payeeidentifier/ibanbic/ibanvalidator.cpp + ./payeeidentifier/ibanbic/bicvalidator.cpp + ./payeeidentifier/ibanbic/ibanbicitemdelegate.cpp + ./payeeidentifier/ibanbic/ibanbicitemedit.cpp +) + +set(IBANBICWidget_HEADERS + ./payeeidentifier/ibanbic/kibanlineedit.h + ./payeeidentifier/ibanbic/kbicedit.h + ./payeeidentifier/ibanbic/ibanvalidator.h + ./payeeidentifier/ibanbic/bicvalidator.h + ./payeeidentifier/ibanbic/ibanbicitemdelegate.h +) + +list(APPEND kmm_widgets_sources ${nationalAccountWidget_SOURCES}) +list(APPEND kmymoney_STAT_HEADERS ${nationalAccountWidget_HEADERS}) + +list(APPEND kmm_widgets_sources ${IBANBICWidget_SOURCES}) +list(APPEND kmymoney_STAT_HEADERS ${IBANBICWidget_HEADERS}) + ki18n_wrap_ui(kmm_widgets_sources kmymoneyvalidationfeedback.ui onlinejobmessagesview.ui daterangedlg.ui ktransactionfilter.ui + ./payeeidentifier/nationalaccount/nationalaccountedit.ui + ./payeeidentifier/ibanbic/ibanbicitemedit.ui ) add_library(kmm_widgets SHARED ${kmm_widgets_sources}) @@ -82,6 +117,7 @@ Alkimia::alkimia kmm_mymoney kmm_models + kmm_plugin ) set_target_properties(kmm_widgets PROPERTIES diff --git a/kmymoney/payeeidentifier/ibanandbic/widgets/bicvalidator.h b/kmymoney/widgets/payeeidentifier/ibanbic/bicvalidator.h rename from kmymoney/payeeidentifier/ibanandbic/widgets/bicvalidator.h rename to kmymoney/widgets/payeeidentifier/ibanbic/bicvalidator.h --- a/kmymoney/payeeidentifier/ibanandbic/widgets/bicvalidator.h +++ b/kmymoney/widgets/payeeidentifier/ibanbic/bicvalidator.h @@ -1,11 +1,10 @@ /* - * This file is part of KMyMoney, A Personal Finance Manager by KDE - * Copyright (C) 2014 Christian David + * Copyright 2013-2015 Christian Dávid * * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -20,12 +19,12 @@ #define BICVALIDATOR_H #include -#include "payeeidentifier_iban_bic_widgets_export.h" +#include "kmm_widgets_export.h" #include "kmymoneyvalidationfeedback.h" namespace eWidgets { namespace ValidationFeedback { enum class MessageType; } } -class PAYEEIDENTIFIER_IBAN_BIC_WIDGETS_EXPORT bicValidator : public QValidator +class KMM_WIDGETS_EXPORT bicValidator : public QValidator { Q_OBJECT diff --git a/kmymoney/payeeidentifier/ibanandbic/widgets/bicvalidator.cpp b/kmymoney/widgets/payeeidentifier/ibanbic/bicvalidator.cpp rename from kmymoney/payeeidentifier/ibanandbic/widgets/bicvalidator.cpp rename to kmymoney/widgets/payeeidentifier/ibanbic/bicvalidator.cpp --- a/kmymoney/payeeidentifier/ibanandbic/widgets/bicvalidator.cpp +++ b/kmymoney/widgets/payeeidentifier/ibanbic/bicvalidator.cpp @@ -1,11 +1,10 @@ /* - * This file is part of KMyMoney, A Personal Finance Manager by KDE - * Copyright (C) 2014 Christian David + * Copyright 2013-2015 Christian Dávid * * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/kmymoney/payeeidentifier/ibanandbic/widgets/ibanbicitemdelegate.h b/kmymoney/widgets/payeeidentifier/ibanbic/ibanbicitemdelegate.h rename from kmymoney/payeeidentifier/ibanandbic/widgets/ibanbicitemdelegate.h rename to kmymoney/widgets/payeeidentifier/ibanbic/ibanbicitemdelegate.h --- a/kmymoney/payeeidentifier/ibanandbic/widgets/ibanbicitemdelegate.h +++ b/kmymoney/widgets/payeeidentifier/ibanbic/ibanbicitemdelegate.h @@ -1,11 +1,10 @@ /* - * This file is part of KMyMoney, A Personal Finance Manager by KDE - * Copyright (C) 2014 Christian Dávid + * Copyright 2014-2016 Christian Dávid * * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -19,16 +18,16 @@ #ifndef IBANBICITEMDELEGATE_H #define IBANBICITEMDELEGATE_H -#include "payeeidentifier_iban_bic_widgets_export.h" +#include "kmm_widgets_export.h" #include + #include "payeeidentifier/payeeidentifiertyped.h" #include "payeeidentifier/ibanbic/ibanbic.h" -class PAYEEIDENTIFIER_IBAN_BIC_WIDGETS_EXPORT ibanBicItemDelegate : public QStyledItemDelegate +class KMM_WIDGETS_EXPORT ibanBicItemDelegate : public QStyledItemDelegate { Q_OBJECT - Q_PLUGIN_METADATA(IID "org.kmymoney.payeeIdentifier.ibanbic.delegate" FILE "kmymoney-ibanbic-delegate.json") public: explicit ibanBicItemDelegate(QObject* parent = nullptr, const QVariantList& args = QVariantList()); diff --git a/kmymoney/payeeidentifier/ibanandbic/widgets/ibanbicitemdelegate.cpp b/kmymoney/widgets/payeeidentifier/ibanbic/ibanbicitemdelegate.cpp rename from kmymoney/payeeidentifier/ibanandbic/widgets/ibanbicitemdelegate.cpp rename to kmymoney/widgets/payeeidentifier/ibanbic/ibanbicitemdelegate.cpp --- a/kmymoney/payeeidentifier/ibanandbic/widgets/ibanbicitemdelegate.cpp +++ b/kmymoney/widgets/payeeidentifier/ibanbic/ibanbicitemdelegate.cpp @@ -1,11 +1,10 @@ /* - * This file is part of KMyMoney, A Personal Finance Manager by KDE - * Copyright (C) 2014 Christian Dávid + * Copyright 2014-2016 Christian Dávid * * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/kmymoney/payeeidentifier/ibanandbic/widgets/ibanbicitemedit.h b/kmymoney/widgets/payeeidentifier/ibanbic/ibanbicitemedit.h rename from kmymoney/payeeidentifier/ibanandbic/widgets/ibanbicitemedit.h rename to kmymoney/widgets/payeeidentifier/ibanbic/ibanbicitemedit.h --- a/kmymoney/payeeidentifier/ibanandbic/widgets/ibanbicitemedit.h +++ b/kmymoney/widgets/payeeidentifier/ibanbic/ibanbicitemedit.h @@ -1,11 +1,10 @@ /* - * This file is part of KMyMoney, A Personal Finance Manager by KDE - * Copyright (C) 2014 Christian Dávid + * Copyright 2014-2015 Christian Dávid * * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/kmymoney/payeeidentifier/ibanandbic/widgets/ibanbicitemedit.cpp b/kmymoney/widgets/payeeidentifier/ibanbic/ibanbicitemedit.cpp rename from kmymoney/payeeidentifier/ibanandbic/widgets/ibanbicitemedit.cpp rename to kmymoney/widgets/payeeidentifier/ibanbic/ibanbicitemedit.cpp --- a/kmymoney/payeeidentifier/ibanandbic/widgets/ibanbicitemedit.cpp +++ b/kmymoney/widgets/payeeidentifier/ibanbic/ibanbicitemedit.cpp @@ -1,11 +1,10 @@ /* - * This file is part of KMyMoney, A Personal Finance Manager by KDE - * Copyright (C) 2014 Christian Dávid + * Copyright 2014-2015 Christian Dávid * * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/kmymoney/payeeidentifier/ibanandbic/widgets/ibanbicitemedit.ui b/kmymoney/widgets/payeeidentifier/ibanbic/ibanbicitemedit.ui rename from kmymoney/payeeidentifier/ibanandbic/widgets/ibanbicitemedit.ui rename to kmymoney/widgets/payeeidentifier/ibanbic/ibanbicitemedit.ui --- a/kmymoney/payeeidentifier/ibanandbic/widgets/ibanbicitemedit.ui +++ b/kmymoney/widgets/payeeidentifier/ibanbic/ibanbicitemedit.ui @@ -37,12 +37,12 @@ KIbanLineEdit QLineEdit -
kibanlineedit.h
+
widgets/payeeidentifier/ibanbic/kibanlineedit.h
KBicEdit QLineEdit -
kbicedit.h
+
widgets/payeeidentifier/ibanbic/kbicedit.h
KMyMoneyValidationFeedback diff --git a/kmymoney/payeeidentifier/ibanandbic/widgets/ibanvalidator.h b/kmymoney/widgets/payeeidentifier/ibanbic/ibanvalidator.h rename from kmymoney/payeeidentifier/ibanandbic/widgets/ibanvalidator.h rename to kmymoney/widgets/payeeidentifier/ibanbic/ibanvalidator.h --- a/kmymoney/payeeidentifier/ibanandbic/widgets/ibanvalidator.h +++ b/kmymoney/widgets/payeeidentifier/ibanbic/ibanvalidator.h @@ -1,11 +1,10 @@ /* - * This file is part of KMyMoney, A Personal Finance Manager by KDE - * Copyright (C) 2014 Christian David + * Copyright 2013-2015 Christian Dávid * * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -19,15 +18,15 @@ #ifndef IBANVALIDATOR_H #define IBANVALIDATOR_H -#include "payeeidentifier_iban_bic_widgets_export.h" +#include "kmm_widgets_export.h" #include #include "kmymoneyvalidationfeedback.h" namespace eWidgets { namespace ValidationFeedback { enum class MessageType; } } -class PAYEEIDENTIFIER_IBAN_BIC_WIDGETS_EXPORT ibanValidator : public QValidator +class KMM_WIDGETS_EXPORT ibanValidator : public QValidator { Q_OBJECT diff --git a/kmymoney/payeeidentifier/ibanandbic/widgets/ibanvalidator.cpp b/kmymoney/widgets/payeeidentifier/ibanbic/ibanvalidator.cpp rename from kmymoney/payeeidentifier/ibanandbic/widgets/ibanvalidator.cpp rename to kmymoney/widgets/payeeidentifier/ibanbic/ibanvalidator.cpp --- a/kmymoney/payeeidentifier/ibanandbic/widgets/ibanvalidator.cpp +++ b/kmymoney/widgets/payeeidentifier/ibanbic/ibanvalidator.cpp @@ -1,11 +1,10 @@ /* - * This file is part of KMyMoney, A Personal Finance Manager by KDE - * Copyright (C) 2014 Christian David + * Copyright 2013-2015 Christian Dávid * * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/kmymoney/payeeidentifier/ibanandbic/widgets/kbicedit.h b/kmymoney/widgets/payeeidentifier/ibanbic/kbicedit.h rename from kmymoney/payeeidentifier/ibanandbic/widgets/kbicedit.h rename to kmymoney/widgets/payeeidentifier/ibanbic/kbicedit.h --- a/kmymoney/payeeidentifier/ibanandbic/widgets/kbicedit.h +++ b/kmymoney/widgets/payeeidentifier/ibanbic/kbicedit.h @@ -1,11 +1,10 @@ /* - * This file is part of KMyMoney, A Personal Finance Manager by KDE - * Copyright (C) 2014 Christian Dávid + * Copyright 2014-2015 Christian Dávid * * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -22,11 +21,11 @@ #include #include -#include "payeeidentifier_iban_bic_widgets_export.h" +#include "kmm_widgets_export.h" class QAbstractItemDelegate; -class PAYEEIDENTIFIER_IBAN_BIC_WIDGETS_EXPORT KBicEdit : public KLineEdit +class KMM_WIDGETS_EXPORT KBicEdit : public KLineEdit { Q_OBJECT diff --git a/kmymoney/payeeidentifier/ibanandbic/widgets/kbicedit.cpp b/kmymoney/widgets/payeeidentifier/ibanbic/kbicedit.cpp rename from kmymoney/payeeidentifier/ibanandbic/widgets/kbicedit.cpp rename to kmymoney/widgets/payeeidentifier/ibanbic/kbicedit.cpp --- a/kmymoney/payeeidentifier/ibanandbic/widgets/kbicedit.cpp +++ b/kmymoney/widgets/payeeidentifier/ibanbic/kbicedit.cpp @@ -1,11 +1,10 @@ /* - * This file is part of KMyMoney, A Personal Finance Manager by KDE - * Copyright (C) 2014 Christian Dávid + * Copyright 2014-2015 Christian Dávid * * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/kmymoney/payeeidentifier/ibanandbic/widgets/kibanlineedit.h b/kmymoney/widgets/payeeidentifier/ibanbic/kibanlineedit.h rename from kmymoney/payeeidentifier/ibanandbic/widgets/kibanlineedit.h rename to kmymoney/widgets/payeeidentifier/ibanbic/kibanlineedit.h --- a/kmymoney/payeeidentifier/ibanandbic/widgets/kibanlineedit.h +++ b/kmymoney/widgets/payeeidentifier/ibanbic/kibanlineedit.h @@ -1,11 +1,10 @@ /* - * This file is part of KMyMoney, A Personal Finance Manager by KDE - * Copyright (C) 2014 Christian David + * Copyright 2013-2015 Christian Dávid * * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -19,13 +18,13 @@ #ifndef KIBANLINEEDIT_H #define KIBANLINEEDIT_H -#include "payeeidentifier_iban_bic_widgets_export.h" +#include "kmm_widgets_export.h" #include class ibanValidator; -class PAYEEIDENTIFIER_IBAN_BIC_WIDGETS_EXPORT KIbanLineEdit : public KLineEdit +class KMM_WIDGETS_EXPORT KIbanLineEdit : public KLineEdit { Q_OBJECT diff --git a/kmymoney/payeeidentifier/ibanandbic/widgets/kibanlineedit.cpp b/kmymoney/widgets/payeeidentifier/ibanbic/kibanlineedit.cpp rename from kmymoney/payeeidentifier/ibanandbic/widgets/kibanlineedit.cpp rename to kmymoney/widgets/payeeidentifier/ibanbic/kibanlineedit.cpp --- a/kmymoney/payeeidentifier/ibanandbic/widgets/kibanlineedit.cpp +++ b/kmymoney/widgets/payeeidentifier/ibanbic/kibanlineedit.cpp @@ -1,11 +1,10 @@ /* - * This file is part of KMyMoney, A Personal Finance Manager by KDE - * Copyright (C) 2014 Christian Dávid + * Copyright 2013-2015 Christian Dávid * * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/kmymoney/payeeidentifier/nationalaccount/ui/nationalaccountdelegate.h b/kmymoney/widgets/payeeidentifier/nationalaccount/nationalaccountdelegate.h rename from kmymoney/payeeidentifier/nationalaccount/ui/nationalaccountdelegate.h rename to kmymoney/widgets/payeeidentifier/nationalaccount/nationalaccountdelegate.h --- a/kmymoney/payeeidentifier/nationalaccount/ui/nationalaccountdelegate.h +++ b/kmymoney/widgets/payeeidentifier/nationalaccount/nationalaccountdelegate.h @@ -1,11 +1,10 @@ /* - * This file is part of KMyMoney, A Personal Finance Manager by KDE - * Copyright (C) 2014 Christian Dávid + * Copyright 2014-2015 Christian Dávid * * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -19,12 +18,14 @@ #ifndef NATIONALACCOUNTDELEGATE_H #define NATIONALACCOUNTDELEGATE_H +#include "kmm_widgets_export.h" + #include #include "payeeidentifier/nationalaccount/nationalaccount.h" #include "payeeidentifier/payeeidentifiertyped.h" -class nationalAccountDelegate : public QStyledItemDelegate +class KMM_WIDGETS_EXPORT nationalAccountDelegate : public QStyledItemDelegate { Q_OBJECT public: diff --git a/kmymoney/payeeidentifier/nationalaccount/ui/nationalaccountdelegate.cpp b/kmymoney/widgets/payeeidentifier/nationalaccount/nationalaccountdelegate.cpp rename from kmymoney/payeeidentifier/nationalaccount/ui/nationalaccountdelegate.cpp rename to kmymoney/widgets/payeeidentifier/nationalaccount/nationalaccountdelegate.cpp --- a/kmymoney/payeeidentifier/nationalaccount/ui/nationalaccountdelegate.cpp +++ b/kmymoney/widgets/payeeidentifier/nationalaccount/nationalaccountdelegate.cpp @@ -1,11 +1,10 @@ /* - * This file is part of KMyMoney, A Personal Finance Manager by KDE - * Copyright (C) 2014 Christian Dávid + * Copyright 2014-2015 Christian Dávid * * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/kmymoney/payeeidentifier/nationalaccount/ui/nationalaccountedit.h b/kmymoney/widgets/payeeidentifier/nationalaccount/nationalaccountedit.h rename from kmymoney/payeeidentifier/nationalaccount/ui/nationalaccountedit.h rename to kmymoney/widgets/payeeidentifier/nationalaccount/nationalaccountedit.h --- a/kmymoney/payeeidentifier/nationalaccount/ui/nationalaccountedit.h +++ b/kmymoney/widgets/payeeidentifier/nationalaccount/nationalaccountedit.h @@ -1,11 +1,10 @@ /* - * This file is part of KMyMoney, A Personal Finance Manager by KDE - * Copyright (C) 2014 Christian Dávid + * Copyright 2014-2015 Christian Dávid * * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/kmymoney/payeeidentifier/nationalaccount/ui/nationalaccountedit.cpp b/kmymoney/widgets/payeeidentifier/nationalaccount/nationalaccountedit.cpp rename from kmymoney/payeeidentifier/nationalaccount/ui/nationalaccountedit.cpp rename to kmymoney/widgets/payeeidentifier/nationalaccount/nationalaccountedit.cpp --- a/kmymoney/payeeidentifier/nationalaccount/ui/nationalaccountedit.cpp +++ b/kmymoney/widgets/payeeidentifier/nationalaccount/nationalaccountedit.cpp @@ -1,11 +1,10 @@ /* - * This file is part of KMyMoney, A Personal Finance Manager by KDE - * Copyright (C) 2014 Christian Dávid + * Copyright 2014-2015 Christian Dávid * * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/kmymoney/payeeidentifier/nationalaccount/ui/nationalaccountedit.ui b/kmymoney/widgets/payeeidentifier/nationalaccount/nationalaccountedit.ui rename from kmymoney/payeeidentifier/nationalaccount/ui/nationalaccountedit.ui rename to kmymoney/widgets/payeeidentifier/nationalaccount/nationalaccountedit.ui