Alkimia API

alkonlinequoteprocess.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 "alkonlinequoteprocess.h"
10
11#include "alkdebug.h"
12
13//
14// Helper class to babysit the KProcess used for running the local script in that case
15//
16
17AlkOnlineQuoteProcess::AlkOnlineQuoteProcess()
18{
19 connect(this, SIGNAL(readyReadStandardOutput()), this, SLOT(slotReceivedDataFromFilter()));
20 connect(this, SIGNAL(finished(int,QProcess::ExitStatus)), this,
21 SLOT(slotProcessExited(int,QProcess::ExitStatus)));
22}
23
24void AlkOnlineQuoteProcess::slotReceivedDataFromFilter()
25{
27 alkDebug() << data;
28 m_string += QString(data);
29}
30
31void AlkOnlineQuoteProcess::slotProcessExited(int /*exitCode*/, QProcess::ExitStatus /*exitStatus*/)
32{
33 alkDebug() ;
34 Q_EMIT processExited(m_string);
35 m_string.truncate(0);
36}
Wrapper for debug output.
Q_EMITQ_EMIT
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
void finished(int exitCode, QProcess::ExitStatus exitStatus)
QByteArray readAllStandardOutput()
void readyReadStandardOutput()
void truncate(qsizetype position)
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.