Alkimia API

alkquotereceiver.cpp
1/*
2 SPDX-FileCopyrightText: 2004 Ace Jones acejones @users.sourceforge.net
3
4 This file is part of libalkimia.
5
6 SPDX-License-Identifier: GPL-2.0-or-later
7*/
8
9#include "alkquotereceiver.h"
10
11#include "alkdebug.h"
12#include "alkonlinequote.h"
13
14convertertest::AlkQuoteReceiver::AlkQuoteReceiver(AlkOnlineQuote *q, QObject *parent)
15 : QObject(parent)
16{
17 connect(q, SIGNAL(quote(QString,QString,QDate,double)),
18 this, SLOT(slotGetQuote(QString,QString,QDate,double)));
19 connect(q, SIGNAL(status(QString)),
20 this, SLOT(slotStatus(QString)));
21 connect(q, SIGNAL(error(QString)),
22 this, SLOT(slotError(QString)));
23}
24
25convertertest::AlkQuoteReceiver::~AlkQuoteReceiver()
26{
27}
28
29void convertertest::AlkQuoteReceiver::slotGetQuote(const QString &a, const QString &b,
30 const QDate &d, const double &m)
31{
32 if (m_verbose) {
33 alkDebug() << "test::AlkQuoteReceiver::slotGetQuote( , " << a << " , " << b << " , " << d
34 << " , " << m << " )";
35 }
36 m_price = AlkValue(m);
37 m_date = d;
38}
39
40void convertertest::AlkQuoteReceiver::slotStatus(const QString &msg)
41{
42 if (m_verbose) {
43 alkDebug() << "test::AlkQuoteReceiver::slotStatus( " << msg << " )";
44 }
45
46 m_statuses += msg;
47}
48
49void convertertest::AlkQuoteReceiver::slotError(const QString &msg)
50{
51 if (m_verbose) {
52 alkDebug() << "test::AlkQuoteReceiver::slotError( " << msg << " )";
53 }
54
55 m_errors += msg;
56}
Wrapper for debug output.
Retrieves a price quote from a web-based quote source.
Q_SCRIPTABLE CaptureState status()
void error(QWidget *parent, const QString &text, const QString &title, const KGuiItem &buttonOk, Options options=Notify)
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:01:13 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.