got rid of old customer object
authorkonrad <konrad@6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33>
Fri, 1 Jan 2010 18:23:50 +0000 (18:23 +0000)
committerkonrad <konrad@6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33>
Fri, 1 Jan 2010 18:23:50 +0000 (18:23 +0000)
git-svn-id: https://silmor.de/svn/softmagic/smoke/trunk@393 6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33

src/dialogs/customerdlg.cpp
src/dialogs/customerdlg.h
src/iface/customer.h [deleted file]
src/iface/iface.pri
src/mwin/carttab.cpp
src/mwin/carttab.h
src/mwin/overview.h
src/wext/MOCustomer.cpp [moved from src/iface/customer.cpp with 80% similarity]
src/wext/MOCustomerInfo.h
src/wext/wext.pri
wob/customer.wolf

index 91a17f1..58e772a 100644 (file)
@@ -131,7 +131,7 @@ MOCustomerInfo MCustomerListDialog::getCustomer()
 
 void MCustomerListDialog::newCustomer()
 {
-       MCustomerDialog cd(MCustomer(),this);
+       MCustomerDialog cd(MOCustomer(),this);
        if(cd.exec()==QDialog::Accepted)
                updateList(cd.getCustomer().id());
 }
@@ -197,7 +197,7 @@ void MCustomerListDialog::deleteCustomer()
 
 /****************************************************************/
 
-MCustomerDialog::MCustomerDialog(MCustomer c,QWidget*par)
+MCustomerDialog::MCustomerDialog(MOCustomer c,QWidget*par)
        :QDialog(par),m_cust(c)
 {
        if(m_cust.isValid())
@@ -237,7 +237,7 @@ MCustomerDialog::MCustomerDialog(MCustomer c,QWidget*par)
        connect(p,SIGNAL(clicked()),this,SLOT(reject()));
 }
 
-MCustomer MCustomerDialog::getCustomer()
+MOCustomer MCustomerDialog::getCustomer()
 {
        //copy data from input fields
        m_cust.setname(m_name->text());
index abf04d6..524ec69 100644 (file)
@@ -18,6 +18,7 @@
 #include <QList>
 
 #include "MOCustomerInfo.h"
+#include "MOCustomer.h"
 
 class QListView;
 class QStandardItemModel;
@@ -58,24 +59,23 @@ class QLineEdit;
 class QTextEdit;
 class QLabel;
 
-#include"customer.h"
 /**edit a specific customer*/
 class MCustomerDialog:public QDialog
 {
        Q_OBJECT
        public:
                /**creates a new customer dialog*/
-               MCustomerDialog(MCustomer,QWidget*);
+               MCustomerDialog(MOCustomer,QWidget*);
                
                /**returns the customer as currently entered*/
-               MCustomer getCustomer();
+               MOCustomer getCustomer();
                
        private slots:
                /**internal: save data*/
                void save();
                
        private:
-               MCustomer m_cust;
+               MOCustomer m_cust;
                QLineEdit*m_name;
                QTextEdit*m_addr,*m_cont,*m_comm;
                QLabel*m_mail;
diff --git a/src/iface/customer.h b/src/iface/customer.h
deleted file mode 100644 (file)
index edde9d7..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-//
-// C++ Interface: customer
-//
-// Description: 
-//
-//
-// Author: Konrad Rosenbaum <konrad@silmor.de>, (C) 2008
-//
-// Copyright: See README/COPYING files that come with this distribution
-//
-//
-
-#ifndef MAGICSMOKE_CUSTOMER_H
-#define MAGICSMOKE_CUSTOMER_H
-
-#include <QString>
-
-#include "MOCustomer.h"
-
-/**this class expands on MOCustomer to add some convenience methods*/
-class MCustomer:public MOCustomer
-{
-       public:
-               /**creates an empty/invalid customer*/
-               MCustomer(){}
-               /**fetches customer from the Database*/
-               MCustomer(qint64);
-               /**copies a customer*/
-               MCustomer(const MCustomer&c):MOCustomer(c){}
-               MCustomer(const MOCustomer&c):MOCustomer(c){}
-               
-               /**copies a customer*/
-               MCustomer& operator=(const MCustomer&c){MOCustomer::operator=(c);return *this;}
-               MCustomer& operator=(const MOCustomer&c){MOCustomer::operator=(c);return *this;}
-               
-               /**returns whether the customer is valid*/
-               bool isValid();
-               
-               /**returns the address of the customer*/
-               QString address(int i=0);
-};
-
-#endif
index c9dc8e7..6dfac48 100644 (file)
@@ -1,12 +1,9 @@
 HEADERS += \
        iface/msinterface.h \
-       iface/sslexception.h \
-       iface/customer.h
-       
+       iface/sslexception.h
 
 SOURCES += \
        iface/msinterface.cpp \
-       iface/sslexception.cpp \
-       iface/customer.cpp
+       iface/sslexception.cpp
 
 INCLUDEPATH += ./iface
\ No newline at end of file
index 5eeda29..b02fedb 100644 (file)
@@ -130,7 +130,7 @@ void MCartTab::initCart()
        cartmodel->clear();
        cartmodel->setHorizontalHeaderLabels(QStringList()<<tr("Amount")<<tr("Title")<<tr("Start Time"));
        //clear customer
-       customer=MCustomer();
+       customer=MOCustomer();
        cartcustomer->setText("");
        //clear address/comment
        cartaddr->setPlainText("");
index a0bb3a9..4200e70 100644 (file)
@@ -19,7 +19,7 @@
 #include <QMainWindow>
 #include <QTimer>
 
-#include "customer.h"
+#include "MOCustomer.h"
 
 class QAction;
 class QCheckBox;
@@ -94,7 +94,7 @@ class MCartTab:public QWidget
                QTextEdit *cartaddr,*cartcomment;
                QComboBox*cartship;
                //cart
-               MCustomer customer;
+               MOCustomer customer;
 };
 
 /**Helper class for shopping cart: allow editing amount, but nothing else*/
index fe9db3b..5b722e5 100644 (file)
@@ -19,8 +19,6 @@
 #include <QMainWindow>
 #include <QTimer>
 
-#include "customer.h"
-
 class QAction;
 class QCheckBox;
 class QComboBox;
similarity index 80%
rename from src/iface/customer.cpp
rename to src/wext/MOCustomer.cpp
index 4ddff1f..93dec4d 100644 (file)
 //
 //
 
-#include "customer.h"
+#include "MOCustomer.h"
 #include "msinterface.h"
 
-MCustomer::MCustomer(qint64 i)
+MOCustomer::MOCustomer(qint64 i)
 {
        MTGetCustomer gc=req->queryGetCustomer(i);
        if(gc.stage()==gc.Success)
                operator=(gc.getcustomer().value());
 }
 
-bool MCustomer::isValid()
-{
-       //TODO: reconsider isValid
-       return id()>-1;
-}
-
-QString MCustomer::address(int i)
+QString MOCustomer::address(int i)
 {
        if(i<0)return "";
        QList<MOAddress>adrs=addresses();
@@ -36,7 +30,6 @@ QString MCustomer::address(int i)
        if(adr.name().isNull())ret=name();
        else ret=adr.name().value();
        ret+="\n";
-//     if(!adr.company().isNull())ret+=adr.company().value()+"\n";
        if(!adr.addr1().isNull())ret+=adr.addr1().value()+"\n";
        if(!adr.addr2().isNull())ret+=adr.addr2().value()+"\n";
        if(!adr.city().isNull())ret+=adr.city().value()+"\n";
index 34c1bcc..cbf0a4e 100644 (file)
@@ -10,8 +10,8 @@
 //
 //
 
-#ifndef MAGICSMOKE_MOCUSTOMER_H
-#define MAGICSMOKE_MOCUSTOMER_H
+#ifndef MAGICSMOKE_MOCUSTOMERI_H
+#define MAGICSMOKE_MOCUSTOMERI_H
 
 #include "MOCustomerInfoAbstract.h"
 class MOCustomerInfo:public MOCustomerInfoAbstract
index b47c22b..0e85fd6 100644 (file)
@@ -7,11 +7,13 @@ HEADERS += \
        wext/MORole.h \
        wext/MOTicket.h \
        wext/MOAddress.h \
-       wext/MOEvent.h
+       wext/MOEvent.h \
+       wext/MOCustomer.h
 
 SOURCES += \
        wext/MOCustomerInfo.cpp \
        wext/MOOrder.cpp \
        wext/MOTicket.cpp \
        wext/MOAddress.cpp \
-       wext/MOEvent.cpp
\ No newline at end of file
+       wext/MOEvent.cpp \
+       wext/MOCustomer.cpp
\ No newline at end of file
index c8aad6c..152e3a0 100644 (file)
                </Mapping>
        </Class>
        <Class name="Customer">
+               <Abstract lang="qt"/>
                <Property name="id" type="int"/>
                <Property name="title" type="string"/>
                <Property name="firstname" type="string"/>