[87582] trunk/dports/kde/kmymoney4-devel

mk at macports.org mk at macports.org
Sat Nov 26 13:35:17 PST 2011


Revision: 87582
          http://trac.macports.org/changeset/87582
Author:   mk at macports.org
Date:     2011-11-26 13:35:12 -0800 (Sat, 26 Nov 2011)
Log Message:
-----------
kmymoney4-devel: update to git version ff75edf07655f814de489e336d7f5c501a7540c0 and patch for online balance highlighting

Modified Paths:
--------------
    trunk/dports/kde/kmymoney4-devel/Portfile

Added Paths:
-----------
    trunk/dports/kde/kmymoney4-devel/files/online-balance-difference_highlight.patch.diff

Modified: trunk/dports/kde/kmymoney4-devel/Portfile
===================================================================
--- trunk/dports/kde/kmymoney4-devel/Portfile	2011-11-26 18:47:38 UTC (rev 87581)
+++ trunk/dports/kde/kmymoney4-devel/Portfile	2011-11-26 21:35:12 UTC (rev 87582)
@@ -8,10 +8,10 @@
 
 fetch.type          git
 git.url             git://anongit.kde.org/kmymoney
-git.branch          180e5a0df69d421fb2141dd9906869df9b3188fd
+git.branch          ff75edf07655f814de489e336d7f5c501a7540c0
 
 name                kmymoney4-devel
-version             4.6-20111118
+version             4.6-20111126
 
 categories          kde kde4 finance
 maintainers         mk pixilla openmaintainer
@@ -86,6 +86,7 @@
 
 patch.dir         ${workpath}/${distname}
 patch.pre_args    -p1
+patchfiles        online-balance-difference_highlight.patch.diff
 #patchfiles        patch-CMakeLists.txt.diff
 #                  patch_to_include_datePopup_hideshow.diff
 

Added: trunk/dports/kde/kmymoney4-devel/files/online-balance-difference_highlight.patch.diff
===================================================================
--- trunk/dports/kde/kmymoney4-devel/files/online-balance-difference_highlight.patch.diff	                        (rev 0)
+++ trunk/dports/kde/kmymoney4-devel/files/online-balance-difference_highlight.patch.diff	2011-11-26 21:35:12 UTC (rev 87582)
@@ -0,0 +1,80 @@
+diff --git a/kmymoney/widgets/register.cpp b/kmymoney/widgets/register.cpp
+index 39d991c..267326b 100644
+--- a/kmymoney/widgets/register.cpp
++++ b/kmymoney/widgets/register.cpp
+@@ -58,6 +58,7 @@
+ #include "stdtransactionmatched.h"
+ #include "scheduledtransaction.h"
+ #include "kmymoneyglobalsettings.h"
++#include "../mymoney/mymoneyfile.h"
+ 
+ const int LinesPerMemo = 3;
+ 
+@@ -234,7 +235,8 @@ bool ItemPtrVector::item_cmp(RegisterItem* i1, RegisterItem* i2)
+ GroupMarker::GroupMarker(Register *parent, const QString& txt) :
+     RegisterItem(parent),
+     m_txt(txt),
+-    m_showDate(false)
++    m_showDate(false),
++    m_erroneous(false)
+ {
+   int h;
+   if (m_parent) {
+@@ -284,7 +286,7 @@ void GroupMarker::paintRegisterCell(QPainter *painter, QStyleOptionViewItemV4 &o
+   cellRect.setWidth(m_parent->viewport()->width());
+   cellRect.setHeight(m_parent->rowHeight(index.row()));
+ 
+-  option.palette.setColor(QPalette::Base, KMyMoneyGlobalSettings::groupMarkerColor());
++  option.palette.setColor(QPalette::Base, isErroneous() ? KMyMoneyGlobalSettings::listErronousTransactionColor() : KMyMoneyGlobalSettings::groupMarkerColor());
+ 
+   QBrush backgroundBrush(option.palette.color(QPalette::Base));
+   painter->fillRect(cellRect, backgroundBrush);
+@@ -292,7 +294,7 @@ void GroupMarker::paintRegisterCell(QPainter *painter, QStyleOptionViewItemV4 &o
+   painter->drawLine(cellRect.x(), cellRect.height() - 1, cellRect.width(), cellRect.height() - 1);
+ 
+   // now write the text
+-  painter->setPen(option.palette.color(QPalette::Text));
++  painter->setPen(option.palette.color( isErroneous() ? QPalette::HighlightedText : QPalette::Text ));
+   QFont font = painter->font();
+   font.setBold(true);
+   painter->setFont(font);
+@@ -2013,7 +2015,12 @@ void Register::addGroupMarkers(void)
+           if (m_account.accountGroup() == MyMoneyAccount::Liability)
+             balance = -balance;
+           QString txt = i18n("Online Statement Balance: %1", balance.formatMoney(m_account.fraction()));
+-          new KMyMoneyRegister::StatementGroupMarker(this, KMyMoneyRegister::Deposit, QDate::fromString(m_account.value("lastImportedTransactionDate"), Qt::ISODate), txt);
++
++          MyMoneyMoney accBalance = MyMoneyFile::instance()->balance(m_account.id(), QDate::fromString(m_account.value("lastImportedTransactionDate")));
++
++          KMyMoneyRegister::StatementGroupMarker *p=new KMyMoneyRegister::StatementGroupMarker(this, KMyMoneyRegister::Deposit, QDate::fromString(m_account.value("lastImportedTransactionDate"), Qt::ISODate), txt);
++
++          if(balance != accBalance) p->setErroneous();
+         }
+ 
+         new KMyMoneyRegister::FancyDateGroupMarker(this, thisYear, i18n("This year"));
+diff --git a/kmymoney/widgets/register.h b/kmymoney/widgets/register.h
+index 8cd1a32..8c5a8ee 100644
+--- a/kmymoney/widgets/register.h
++++ b/kmymoney/widgets/register.h
+@@ -156,12 +156,21 @@ public:
+     return 0;
+   }
+ 
++  void setErroneous(bool condition=true) {
++    m_erroneous = condition;
++  }
++  bool isErroneous(void) const {
++    return m_erroneous;
++  }
++
+ protected:
+   QString                  m_txt;
+   bool                     m_showDate;
+ 
+   static QPixmap*          m_bg;
+   static int               m_bgRefCnt;
++
++  bool                     m_erroneous;
+ };
+ 
+ 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20111126/31ef98b3/attachment.html>


More information about the macports-changes mailing list