Exemplo n.º 1
0
void CBOrder::setOrder(CBOrder order)
{
    setId(order._id);
    setLocation(order._location);
    setCustomer(order._customer);
    setDisabledTagsSet(order._disabledTagsSet);
    setDiscount(order._discount);
    setSummation(order._summation);
    setCreatedTime(order._createdTime);
    setSubmitedTime(order._submitedTime);
    setMemo(order._memo);
    setRecordSavedPath(order._recordSavedPath);
    setStatus(order._status);
}
void
TestRecurrentTransaction::testSetMemoNoSignal() {
    auto memo = QString("Dinner with friends");
    auto numberOfDays = 3;
    auto amount = .45;
    auto account = std::make_shared<PublicAccount>("Test account", .0, "");
    auto category = std::make_shared<com::chancho::Category>("Sushi", com::chancho::Category::Type::EXPENSE);
    auto transactionPtr = std::make_shared<com::chancho::Transaction>(account, amount, category);
    transactionPtr->memo = memo;
    auto recurrentPtr = std::make_shared<com::chancho::RecurrentTransaction>(transactionPtr,
        std::make_shared<com::chancho::RecurrentTransaction::Recurrence>(numberOfDays, QDate::currentDate()));

    auto qmlTransaction = std::make_shared<com::chancho::tests::PublicRecurrentTransaction>(recurrentPtr);
    QSignalSpy spy(qmlTransaction.get(), SIGNAL(memoChanged(QString)));
    qmlTransaction->setMemo(memo);
    QCOMPARE(spy.count(), 0);
}
Exemplo n.º 3
0
void EvaMemoReplyPacket::parseBody()
{
	int pos = 0;
	int len = 0;
	switch(decryptedBuf[pos++]){
	case 0x01:
		
		m_Type = TQQ_MEMO_UPLOAD;
		m_ReplyCode = decryptedBuf[pos];
		break;
	case 0x02:
		m_Type = TQQ_MEMO_REMOVE;
		m_ReplyCode = decryptedBuf[pos];
		break;
	case 0x03:{
		m_Type = TQQ_MEMO_DOWNLOAD;
		if(bodyLength>1){
			m_Id = EvaUtil::read32(decryptedBuf+pos);//get the qq number
			pos += 5; //included an ignored unknow byte
		
			for( int i=0; i<TQQ_MEMO_FIELDS; i++ ){
				len = decryptedBuf[pos++];
				char *str = new char[len+1];
				memcpy(str, decryptedBuf+pos, len); pos += len;
				str[len] = 0x00;
				m_Infos.push_back(std::string(str));
				delete[] str;
				}
			setMemo(m_Infos);
			}
			else{
				printf("no memo on the server,set user qq number to zero\n");
				setQQ(0);//if there is no user memo on the server,then set the qq number zero;
			}
		}
		break;
	}
	
}