[Pkg-kde-extras] Bug#593933: kmymoney: Please build with AqBanking 5
Micha Lenk
micha at debian.org
Sun Aug 22 12:09:04 UTC 2010
Package: kmymoney
Version: 4.5-1
Severity: wishlist
Tags: experimental patch
Hi,
the current version apparently build without support for AqBanking: The build
log shows that the KBanking is disabled:
-------- KMyMoney 4.5.0 --------
Configure results (user options):
--------------------------------------------
OFX plugin: yes
KBanking plugin: no
iCalendar export plugin: yes
--------------------------------------------
With the attached patch kmymoney should build with AqBanking 5 too, which is
available in experimental. Additional to the patch you need to change the build
dependencies to build depend on libaqbanking32-dev.
Regards,
Micha
-- System Information:
Debian Release: squeeze/sid
APT prefers unstable
APT policy: (500, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: i386 (i686)
Kernel: Linux 2.6.26-2-686 (SMP w/2 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages kmymoney depends on:
ii kdebase-runtime 4:4.4.5-1 runtime components from the offici
ii kdepim-runtime 4:4.4.5-1 Runtime components for akonadi-kde
ii kmymoney-common 4.5-1 KMyMoney architecture independent
ii libc6 2.11.2-2 Embedded GNU C Library: Shared lib
ii libgcc1 1:4.4.4-9 GCC support library
ii libgpgme++2 4:4.4.5-1 c++ wrapper library for gpgme
ii libical0 0.44-3 iCalendar library implementation i
ii libkabc4 4:4.4.5-1 library for handling address book
ii libkdecore5 4:4.4.5-1 the KDE Platform Core Library
ii libkdeui5 4:4.4.5-1 the KDE Platform User Interface Li
ii libkfile4 4:4.4.5-1 the File Selection Dialog Library
ii libkholidays4 4:4.4.5-1 holidays calculation library
ii libkhtml5 4:4.4.5-1 the KHTML Web Content Rendering En
ii libkio5 4:4.4.5-1 the Network-enabled File Managemen
ii libkutils4 4:4.4.5-1 various utility classes for the KD
ii libofx4 1:0.9.0-3 library to support Open Financial
ii libqt4-dbus 4:4.6.3-1 Qt 4 D-Bus module
ii libqt4-network 4:4.6.3-1 Qt 4 network module
ii libqt4-sql 4:4.6.3-1 Qt 4 SQL module
ii libqt4-svg 4:4.6.3-1 Qt 4 SVG module
ii libqt4-xml 4:4.6.3-1 Qt 4 XML module
ii libqtcore4 4:4.6.3-1 Qt 4 core module
ii libqtgui4 4:4.6.3-1 Qt 4 GUI module
ii libstdc++6 4.4.4-9 The GNU Standard C++ Library v3
kmymoney recommends no packages.
kmymoney suggests no packages.
-- no debconf information
-------------- next part --------------
Description: Add support for release candidates of AqBanking 5
Origin: other, http://lists.aqbanking.de/cgi-bin/mailman/private/aqbanking-user/2010-August/000637.html
Author: Sebastian Held <sebastian.held at gmx.de>
Last-Updated: 2010-08-22
Index: cmake/modules/FindAqBanking.cmake
===================================================================
--- cmake/modules/FindAqBanking.cmake (Revision 1164451)
+++ cmake/modules/FindAqBanking.cmake (Arbeitskopie)
@@ -15,7 +15,7 @@
# for some unknown reason, we need to give a micro version number
# with an offset of 1 to the PKG_CHECK_MODULES macro. The actual
# version KBanking will work with is 4.99.8
- set(AQBANKING_MAX_VERSION "4.99.9")
+ set(AQBANKING_MAX_VERSION "5.00.0")
endif(NOT AQBANKING_MAX_VERSION)
if(AQBANKING_INCLUDE_DIRS AND AQBANKING_LIBRARIES)
@@ -26,8 +26,7 @@
PKG_CHECK_MODULES(AQBANKING aqbanking>=${AQBANKING_MIN_VERSION} aqbanking<=${AQBANKING_MAX_VERSION})
if(${AQBANKING_FOUND})
- # if AqBanking has been found make sure to add the q4banking lib
- set(AQBANKING_LIBRARIES ${AQBANKING_LIBRARIES} q4banking)
+ set(AQBANKING_LIBRARIES ${AQBANKING_LIBRARIES} Qt3Support kde3support)
endif(${AQBANKING_FOUND})
mark_as_advanced(AQBANKING_INCLUDE_DIRS AQBANKING_LIBRARIES)
Index: kmymoney/plugins/kbanking/dialogs/kbpickstartdate.cpp
===================================================================
--- kmymoney/plugins/kbanking/dialogs/kbpickstartdate.cpp (Revision 1164451)
+++ kmymoney/plugins/kbanking/dialogs/kbpickstartdate.cpp (Arbeitskopie)
@@ -25,7 +25,6 @@
// QBanking includes
#include "kbpickstartdate.h"
-#include <q4banking/qbanking.h>
// Gwenhywfar includes
#include <gwenhywfar/debug.h>
@@ -46,14 +45,12 @@
-KBPickStartDate::KBPickStartDate(QBanking *qb,
- const QDate &firstPossible,
+KBPickStartDate::KBPickStartDate(const QDate &firstPossible,
const QDate &lastUpdate,
const QString& accountName,
int defaultChoice,
QWidget* parent, bool modal) :
QDialog(parent),
- _banking(qb),
_firstPossible(firstPossible),
_lastUpdate(lastUpdate)
{
@@ -139,6 +136,5 @@
void KBPickStartDate::slotHelpClicked()
{
- _banking->invokeHelp("KBPickStartDate", "none");
}
Index: kmymoney/plugins/kbanking/dialogs/kbsettings.h
===================================================================
--- kmymoney/plugins/kbanking/dialogs/kbsettings.h (Revision 1164451)
+++ kmymoney/plugins/kbanking/dialogs/kbsettings.h (Arbeitskopie)
@@ -21,6 +21,8 @@
#ifndef KBANKING_KBSETTINGS_H
#define KBANKING_KBSETTINGS_H
+#if 0
+
#include "kbanking.h"
#include <q4banking/qbcfgtabsettings.h>
@@ -37,4 +39,7 @@
int fini();
};
+
+#endif
+
#endif /* KBANKING_KBSETTINGS_H */
Index: kmymoney/plugins/kbanking/dialogs/kbpickstartdate.h
===================================================================
--- kmymoney/plugins/kbanking/dialogs/kbpickstartdate.h (Revision 1164451)
+++ kmymoney/plugins/kbanking/dialogs/kbpickstartdate.h (Arbeitskopie)
@@ -43,8 +43,7 @@
const QDate &_firstPossible;
const QDate &_lastUpdate;
public:
- KBPickStartDate(QBanking *banking,
- const QDate &firstPossible,
+ KBPickStartDate(const QDate &firstPossible,
const QDate &lastUpdate,
const QString& accountName,
int defaultChoice,
Index: kmymoney/plugins/kbanking/dialogs/CMakeLists.txt
===================================================================
--- kmymoney/plugins/kbanking/dialogs/CMakeLists.txt (Revision 1164451)
+++ kmymoney/plugins/kbanking/dialogs/CMakeLists.txt (Arbeitskopie)
@@ -5,11 +5,13 @@
kbaccountsettings.cpp
kbpickstartdate.cpp
kbsettings.cpp
+ kbmapaccount.cpp
)
SET(kmm_kbanking_dialogs_UI
kbaccountsettings.ui
kbpickstartdate.ui
+ kbmapaccount.ui
)
KDE4_ADD_UI_FILES(kmm_kbanking_dialogs_la_SOURCES
Index: kmymoney/plugins/kbanking/dialogs/kbsettings.cpp
===================================================================
--- kmymoney/plugins/kbanking/dialogs/kbsettings.cpp (Revision 1164451)
+++ kmymoney/plugins/kbanking/dialogs/kbsettings.cpp (Arbeitskopie)
@@ -22,6 +22,9 @@
# include <config-kmymoney.h>
#endif
+
+#if 0
+
#include "kbsettings.h"
#include <gwenhywfar/debug.h>
@@ -56,3 +59,6 @@
return -1;
return 0;
}
+
+#endif
+
Index: kmymoney/plugins/kbanking/kbanking.cpp
===================================================================
--- kmymoney/plugins/kbanking/kbanking.cpp (Revision 1164451)
+++ kmymoney/plugins/kbanking/kbanking.cpp (Arbeitskopie)
@@ -24,6 +24,7 @@
#include "kbanking.h"
+#include "kbmapaccount.h"
#include <assert.h>
#include <QString>
@@ -33,12 +34,15 @@
#include <QDateTime>
#include <QWidget>
+#include <aqbanking/dlg_importer.h>
+
#include <gwenhywfar/debug.h>
#include <gwenhywfar/text.h>
+#include <gwenhywfar/gui.h>
KBanking::KBanking(const char *appname,
const char *cfgDir) :
- QBanking(appname, cfgDir),
+ AB_Banking(appname, cfgDir),
_jobQueue(0)
{
}
@@ -55,14 +59,14 @@
{
int rv;
- rv = QBanking::init();
+ rv = AB_Banking::init();
if (rv < 0)
return rv;
rv = onlineInit();
if (rv) {
fprintf(stderr, "Error on online init (%d).\n", rv);
- QBanking::fini();
+ AB_Banking::fini();
return rv;
}
@@ -84,10 +88,10 @@
rv = onlineFini();
if (rv) {
- QBanking::fini();
+ AB_Banking::fini();
return rv;
}
- return QBanking::fini();
+ return AB_Banking::fini();
}
@@ -100,8 +104,11 @@
rv = AB_BANKING_QBANKING_EXECUTE_JOBS(_jobQueue, ctx);
oldQ = _jobQueue;
_jobQueue = AB_Job_List2_new();
- flagStaff()->queueUpdated();
AB_Job_List2_FreeAll(oldQ);
+
+ /* clear password DB */
+ GWEN_Gui_SetPasswordStatus(NULL, NULL, GWEN_Gui_PasswordStatus_Remove, 0);
+
return rv;
}
@@ -138,7 +145,6 @@
assert(j);
AB_Job_Attach(j);
AB_Job_List2_PushBack(_jobQueue, j);
- flagStaff()->queueUpdated();
return 0;
}
@@ -149,14 +155,72 @@
assert(_jobQueue);
AB_Job_List2_Remove(_jobQueue, j);
AB_Job_free(j);
- flagStaff()->queueUpdated();
return 0;
}
+bool KBanking::askMapAccount(const char *id,
+ const char *bankCode,
+ const char *accountId){
+ KBMapAccount *w;
+ w=new KBMapAccount(this, bankCode, accountId);
+ if (w->exec()==QDialog::Accepted) {
+ AB_ACCOUNT *a;
+ a=w->getAccount();
+ assert(a);
+ DBG_NOTICE(0,
+ "Mapping application account \"%s\" to "
+ "online account \"%s/%s\"",
+ id,
+ AB_Account_GetBankCode(a),
+ AB_Account_GetAccountNumber(a));
+ setAccountAlias(a, id);
+ delete w;
+ return true;
+ }
+ delete w;
+ return false;
+}
+
+bool KBanking::interactiveImport() {
+ AB_IMEXPORTER_CONTEXT *ctx;
+ GWEN_DIALOG *dlg;
+ int rv;
+
+ ctx=AB_ImExporterContext_new();
+ dlg=AB_ImporterDialog_new(getCInterface(), ctx, NULL);
+ if (dlg==NULL) {
+ DBG_ERROR(0, "Could not create importer dialog.");
+ AB_ImExporterContext_free(ctx);
+ return false;
+ }
+
+ rv=GWEN_Gui_ExecDialog(dlg, 0);
+ if (rv==0) {
+ DBG_ERROR(0, "Aborted by user");
+ GWEN_Dialog_free(dlg);
+ AB_ImExporterContext_free(ctx);
+ return false;
+ }
+
+ if (!importContext(ctx, 0)) {
+ DBG_ERROR(0, "Error on importContext");
+ GWEN_Dialog_free(dlg);
+ AB_ImExporterContext_free(ctx);
+ return false;
+ }
+
+ GWEN_Dialog_free(dlg);
+ AB_ImExporterContext_free(ctx);
+ return true;
+}
+
+
+
+
Index: kmymoney/plugins/kbanking/widgets/CMakeLists.txt
===================================================================
--- kmymoney/plugins/kbanking/widgets/CMakeLists.txt (Revision 1164451)
+++ kmymoney/plugins/kbanking/widgets/CMakeLists.txt (Arbeitskopie)
@@ -2,6 +2,7 @@
########### next target ###############
SET(kmm_kbanking_widgets_la_SOURCES
+ kbaccountlist.cpp
kbjoblist.cpp
)
Index: kmymoney/plugins/kbanking/mymoneybanking.cpp
===================================================================
--- kmymoney/plugins/kbanking/mymoneybanking.cpp (Revision 1164451)
+++ kmymoney/plugins/kbanking/mymoneybanking.cpp (Arbeitskopie)
@@ -59,9 +59,11 @@
#include <aqbanking/jobgettransactions.h>
#include <aqbanking/jobgetbalance.h>
#include <aqbanking/job.h>
-#include <q4banking/qbgui.h>
+#include <aqbanking/abgui.h>
+#include <aqbanking/dlg_setup.h>
#include <gwenhywfar/logger.h>
#include <gwenhywfar/debug.h>
+#include <gwen-gui-qt4/qt4_gui.hpp>
// ----------------------------------------------------------------------------
// Project Includes
@@ -123,7 +125,7 @@
m_kbanking = new KMyMoneyBanking(this, "KMyMoney");
if (m_kbanking) {
- QBGui *gui;
+ QT4_Gui *gui;
#if AQB_IS_VERSION(4,99,0,0)
if (AB_Banking_HasConf4(m_kbanking->getCInterface())) {
@@ -155,17 +157,19 @@
}
#endif
- gui = new QBGui(m_kbanking);
+ gui = new QT4_Gui();
GWEN_Gui_SetGui(gui->getCInterface());
GWEN_Logger_SetLevel(0, GWEN_LoggerLevel_Info);
GWEN_Logger_SetLevel(AQBANKING_LOGDOMAIN, GWEN_LoggerLevel_Debug);
- m_kbanking->setGui(gui);
if (m_kbanking->init() == 0) {
// Tell the host application to load my GUI component
setComponentData(KGenericFactory<KBankingPlugin>::componentData());
setXMLFile("kmm_kbanking.rc");
qDebug("KMyMoney kbanking plugin loaded");
+ // get certificate handling and dialog settings management
+ AB_Gui_Extend(gui->getCInterface(), m_kbanking->getCInterface());
+
// create view
createJobView();
@@ -298,15 +302,24 @@
void KBankingPlugin::slotSettings(void)
{
- QPointer<KBankingSettings> bs = new KBankingSettings(m_kbanking);
- if (bs->init())
- qWarning("Error on ini of settings dialog.");
- else {
- bs->exec();
- if (bs && bs->fini())
- qWarning("Error on fini of settings dialog.");
+ if (m_kbanking) {
+ GWEN_DIALOG *dlg;
+ int rv;
+
+ dlg=AB_SetupDialog_new(m_kbanking->getCInterface());
+ if (dlg==NULL) {
+ DBG_ERROR(0, "Could not create setup dialog.");
+ return;
+ }
+
+ rv=GWEN_Gui_ExecDialog(dlg, 0);
+ if (rv==0) {
+ DBG_ERROR(0, "Aborted by user");
+ GWEN_Dialog_free(dlg);
+ return;
+ }
+ GWEN_Dialog_free(dlg);
}
- delete bs;
}
bool KBankingPlugin::mapAccount(const MyMoneyAccount& acc, MyMoneyKeyValueContainer& settings)
@@ -506,8 +519,8 @@
// and the qd is invalid
if (dateOption == 0
|| (dateOption > 1 && !qd.isValid())) {
- QPointer<KBPickStartDate> psd = new KBPickStartDate(m_kbanking, qd, lastUpdate, acc.name(),
- lastUpdate.isValid() ? 2 : 3, 0, true);
+ QPointer<KBPickStartDate> psd = new KBPickStartDate(qd, lastUpdate, acc.name(),
+ lastUpdate.isValid() ? 2 : 3, 0, true);
if (psd->exec() != QDialog::Accepted) {
AB_Job_free(job);
delete psd;
@@ -607,9 +620,6 @@
DBG_ERROR(0, "Error: %d", rv);
}
AB_ImExporterContext_free(ctx);
-
- // let application emit signals to inform views
- m_kbanking->accountsUpdated();
}
rc = true;
}
Index: kmymoney/plugins/kbanking/kbanking.h
===================================================================
--- kmymoney/plugins/kbanking/kbanking.h (Revision 1164451)
+++ kmymoney/plugins/kbanking/kbanking.h (Arbeitskopie)
@@ -23,7 +23,7 @@
#include <aqbanking/version.h>
#include <aqbanking/banking.h>
-#include <q4banking/qbanking.h>
+#include "banking.hpp"
#ifndef AQB_MAKE_VERSION
#define AQB_MAKE_VERSION(a,b,c,d) (((a)<<24) | ((b)<<16) | (c<<8) | (d))
@@ -39,13 +39,13 @@
#ifndef KBANKING_GUIID
#if AQB_IS_VERSION(4,99,0,0)
-# define AB_BANKING_QBANKING_EXECUTE_JOBS(a, b) QBanking::executeJobs(a, b)
+# define AB_BANKING_QBANKING_EXECUTE_JOBS(a, b) AB_Banking::executeJobs(a, b)
# define AB_BANKING_JOB_CHECKAVAILABILITY(a) AB_Job_CheckAvailability(a)
# define AB_BANKING_GETACCOUNTBYALIAS(a, b) AB_Banking_GetAccountByAlias(a, b)
#elif AQB_IS_VERSION(3,9,0,0)
# define onlineInit() onlineInit(0)
# define onlineFini() onlineFini(0)
-# define AB_BANKING_QBANKING_EXECUTE_JOBS(a, b) QBanking::executeJobs(a, b, 0)
+# define AB_BANKING_QBANKING_EXECUTE_JOBS(a, b) AB_Banking::executeJobs(a, b, 0)
# define AB_BANKING_GETACCOUNTBYALIAS(a, b) AB_Banking_GetAccountByAlias(a, b, 0)
# define AB_BANKING_JOB_CHECKAVAILABILITY(a) AB_Job_CheckAvailability(a, 0)
#else
@@ -57,7 +57,7 @@
#include <list>
-class KBanking: public QBanking
+class KBanking: public AB_Banking
{
private:
AB_JOB_LIST2 *_jobQueue;
@@ -76,6 +76,11 @@
int dequeueJob(AB_JOB *j);
std::list<AB_JOB*> getEnqueuedJobs();
+ bool askMapAccount(const char *id,
+ const char *bankCode,
+ const char *accountId);
+
+ virtual bool interactiveImport();
};
Index: kmymoney/plugins/kbanking/views/kbjobview.cpp
===================================================================
--- kmymoney/plugins/kbanking/views/kbjobview.cpp (Revision 1164451)
+++ kmymoney/plugins/kbanking/views/kbjobview.cpp (Arbeitskopie)
@@ -64,8 +64,6 @@
m_jobList = new KBJobListView(jobBox);
jobBoxLayout->addWidget(m_jobList);
- QObject::connect(m_app->flagStaff(), SIGNAL(signalQueueUpdated()),
- this, SLOT(slotQueueUpdated()));
QObject::connect(executeButton, SIGNAL(clicked()),
this, SLOT(slotExecute()));
QObject::connect(dequeueButton, SIGNAL(clicked()),
@@ -154,9 +152,6 @@
DBG_ERROR(0, "Error: %d", rv);
}
AB_ImExporterContext_free(ctx);
-
- // let App emit signals to inform account views
- m_app->accountsUpdated();
}
Index: kmymoney/plugins/kbanking/CMakeLists.txt
===================================================================
--- kmymoney/plugins/kbanking/CMakeLists.txt (Revision 1164451)
+++ kmymoney/plugins/kbanking/CMakeLists.txt (Arbeitskopie)
@@ -17,7 +17,11 @@
########### next target ###############
-SET(kmm_kbanking_PART_SRCS kbanking.cpp mymoneybanking.cpp)
+SET(kmm_kbanking_PART_SRCS
+ kbanking.cpp
+ mymoneybanking.cpp
+ banking.cpp
+ )
KDE4_ADD_PLUGIN(kmm_kbanking ${kmm_kbanking_PART_SRCS})
Index: kmymoney/dialogs/transactioneditor.cpp
===================================================================
--- kmymoney/dialogs/transactioneditor.cpp (Revision 1164451)
+++ kmymoney/dialogs/transactioneditor.cpp (Arbeitskopie)
@@ -2052,7 +2052,8 @@
}
if (isMultiSelection() || splits.count() == 1) {
- KMyMoneyCategory* category = dynamic_cast<KMyMoneyCategory*>(m_editWidgets["category"]);
+ // isMultiSelection() && splits.count() >= 2 is impossible, because GUI prohibits that
+ KMyMoneyCategory* category = dynamic_cast<KMyMoneyCategory*>(m_editWidgets["category"]);
if (!isMultiSelection() || (isMultiSelection() && !category->currentText().isEmpty())) {
s1.setAccountId(category->selectedItem());
}
@@ -2101,6 +2102,16 @@
if (!s1.accountId().isEmpty())
t.addSplit(s1);
+ //
+ // automatic VAT processing for MultiSelections
+ //
+ // check if VAT account is associated with this category/account
+ MyMoneyAccount cat = MyMoneyFile::instance()->account(category->selectedItem());
+ if (isMultiSelection() && !cat.value("VatAccount").isEmpty()) {
+ MyMoneyMoney amount = s0.value();
+ addVatSplit(t, amount);
+ }
+
} else {
QList<MyMoneySplit>::iterator it_s;
for (it_s = splits.begin(); it_s != splits.end(); ++it_s) {
More information about the pkg-kde-extras
mailing list