[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kraft/mark_sent] src: Add paymentExpected attribute to the DocType object.
From:       Klaas Freitag <freitag () kde ! org>
Date:       2015-10-30 9:14:26
Message-ID: E1Zs5lS-0000eW-JF () scm ! kde ! org
[Download RAW message or body]

Git commit 08130b6aff91011ea883d37f36e60aa437a6c727 by Klaas Freitag.
Committed on 29/10/2015 at 07:37.
Pushed by freitag into branch 'mark_sent'.

Add paymentExpected attribute to the DocType object.

Bool value to mark that for a certainn DocType, a payment is expected.

M  +15   -1    src/doctype.cpp
M  +1    -0    src/doctype.h

http://commits.kde.org/kraft/08130b6aff91011ea883d37f36e60aa437a6c727

diff --git a/src/doctype.cpp b/src/doctype.cpp
index a6bc3df..2b036ba 100644
--- a/src/doctype.cpp
+++ b/src/doctype.cpp
@@ -40,6 +40,7 @@
 
 idMap DocType::mNameMap = idMap();
 
+static const char paymentExpectedC[] = "paymentExpected";
 
 DocType::DocType()
   : mAttributes( QString::fromLatin1( "DocType" ) ),
@@ -169,10 +170,23 @@ bool DocType::pricesVisible()
     return re;
 }
 
+void DocType::setPaymentExpected(bool pe)
+{
+    if(pe) {
+        Attribute att(paymentExpectedC);
+        att.setPersistant( true );
+        att.setValue( pe );
+        mAttributes[paymentExpectedC] = att;
+    } else {
+        mAttributes.markDelete(paymentExpectedC);
+    }
+    mDirty = true;
+}
+
 bool DocType::paymentExpected()
 {
     bool re = false;
-    if( mAttributes.contains("paymentExpected")) {
+    if( mAttributes.contains(paymentExpectedC)) {
         re = true;
     }
     return re;
diff --git a/src/doctype.h b/src/doctype.h
index 849170f..ab79fa0 100644
--- a/src/doctype.h
+++ b/src/doctype.h
@@ -60,6 +60,7 @@ class KRAFTCAT_EXPORT DocType
    * attribute, user should be able to set the payed sum on the docs.
    */
   bool paymentExpected();
+  void setPaymentExpected(bool pe);
 
   QStringList follower();
 

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic