[PATCH] Remember transaction type identified by user

Łukasz Wojniłowicz lukasz.wojnilowicz at gmail.com
Sat Mar 19 14:15:33 UTC 2016


.bin extension isn't probably the best, so here is .txt.
-------------- next part --------------
>From 7d8810058a1d13f9f0a99d357f12e8f8e118f0b8 Mon Sep 17 00:00:00 2001
Message-Id: <7d8810058a1d13f9f0a99d357f12e8f8e118f0b8.1458395930.git.lukasz.wojnilowicz at gmail.com>
From: =?UTF-8?q?=C5=81ukasz=20Wojni=C5=82owicz?=
 <lukasz.wojnilowicz at gmail.com>
Date: Sat, 19 Mar 2016 14:58:44 +0100
Subject: [PATCH] Remember transaction type identified by user

Transaction type identified by user isn't remembered, so in case of
consecutive transaction of the same type user is asked again about
identification. For KMM it is better to ask only once for unknown
transaction and use that answer to identify further transactions.
---
 kmymoney/plugins/csvimport/investprocessing.cpp | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/kmymoney/plugins/csvimport/investprocessing.cpp b/kmymoney/plugins/csvimport/investprocessing.cpp
index ea71d05..b55e731 100644
--- a/kmymoney/plugins/csvimport/investprocessing.cpp
+++ b/kmymoney/plugins/csvimport/investprocessing.cpp
@@ -1620,6 +1620,23 @@ int InvestProcessing::processActionType(QString& type)
   int ret = m_redefine->suspectType(i18n("<center>The transaction below has an unrecognised type or action.</center>"
                                          "<center>Please select an appropriate entry, if available.</center>"
                                          "<center>Otherwise, click Cancel to abort.</center>"));
+  //   remember the selection for futher transactions
+  if (!type.isEmpty() && !m_trInvestData.type.isEmpty() && type.compare(m_trInvestData.type,Qt::CaseInsensitive) != 0) {
+      if (m_trInvestData.type == "shrsin") {
+        m_shrsinList << type;
+      } else if (m_trInvestData.type == "reinvdiv") {
+        m_reinvdivList << type;
+      } else if (m_trInvestData.type == "divx") {
+        m_divXList << type;
+      } else if (m_trInvestData.type == "buy") {
+        m_buyList << type;
+      } else if (m_trInvestData.type == "sell") {
+        m_sellList << type;
+      } else if (m_trInvestData.type == "shrsout") {
+        m_removeList << type;
+      } else if (m_trInvestData.type == "intinc") {
+        m_intIncList << type;
+      }
   return ret;
 }//   end of Type Col
 
-- 
2.5.5



More information about the KMyMoney-devel mailing list