mirror of
https://bitbucket.org/smil3y/kde-extraapps.git
synced 2025-02-24 02:42:52 +00:00
jovie: replace KProcess with QProcess
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
5b149fadc9
commit
54d2587bbe
4 changed files with 15 additions and 19 deletions
|
@ -218,11 +218,11 @@ bool XmlTransformerProc::asyncConvert(const QString& inputText, TalkerCode* talk
|
|||
m_outFilename = outFile.fileName();
|
||||
|
||||
/// Spawn an xsltproc process to apply our stylesheet to input file.
|
||||
m_xsltProc = new KProcess;
|
||||
m_xsltProc->setOutputChannelMode(KProcess::SeparateChannels);
|
||||
*m_xsltProc << m_xsltprocPath;
|
||||
*m_xsltProc << QLatin1String("-o") << m_outFilename << QLatin1String("--novalid")
|
||||
<< m_xsltFilePath << m_inFilename;
|
||||
m_xsltProc = new QProcess;
|
||||
m_xsltProc->setProcessChannelMode(QProcess::SeparateChannels);
|
||||
const QStringList xsltProcArgs = QStringList()
|
||||
<< QLatin1String("-o") << m_outFilename << QLatin1String("--novalid")
|
||||
<< m_xsltFilePath << m_inFilename;
|
||||
// Warning: This won't compile under KDE 3.2. See FreeTTS::argsToStringList().
|
||||
// kDebug() << "SSMLConvert::transform: executing command: " <<
|
||||
// m_xsltProc->args() << endl;
|
||||
|
@ -234,10 +234,10 @@ bool XmlTransformerProc::asyncConvert(const QString& inputText, TalkerCode* talk
|
|||
this, SLOT(slotReceivedStdout()));
|
||||
connect(m_xsltProc, SIGNAL(readyReadStandardError()),
|
||||
this, SLOT(slotReceivedStderr()));
|
||||
m_xsltProc->start();
|
||||
m_xsltProc->start(m_xsltprocPath, xsltProcArgs);
|
||||
if (!m_xsltProc->waitForStarted())
|
||||
{
|
||||
kDebug() << "XmlTransformerProc::convert: Error starting xsltproc";
|
||||
kWarning() << "XmlTransformerProc::convert: Error starting xsltproc";
|
||||
m_state = fsIdle;
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -27,9 +27,7 @@
|
|||
// Qt includes.
|
||||
#include <QtCore/QObject>
|
||||
#include <QtCore/QStringList>
|
||||
|
||||
// KDE includes.
|
||||
#include <kprocess.h>
|
||||
#include <QtCore/QProcess>
|
||||
|
||||
// KTTS includes.
|
||||
#include "filterproc.h"
|
||||
|
@ -168,7 +166,7 @@ private:
|
|||
// Processing state.
|
||||
int m_state;
|
||||
// xsltproc process.
|
||||
KProcess* m_xsltProc;
|
||||
QProcess* m_xsltProc;
|
||||
// Input and Output filenames.
|
||||
QString m_inFilename;
|
||||
QString m_outFilename;
|
||||
|
|
|
@ -37,9 +37,7 @@
|
|||
|
||||
// KTTSD includes.
|
||||
#include <config-jovie.h>
|
||||
#ifdef OPENTTS_FOUND
|
||||
#include <opentts/libopentts.h>
|
||||
#elif defined(SPEECHD_FOUND)
|
||||
#if defined(SPEECHD_FOUND)
|
||||
#include <libspeechd.h>
|
||||
#endif
|
||||
|
||||
|
|
|
@ -229,9 +229,9 @@ bool SSMLConvert::transform(const QString &text, const QString &xsltFilename) {
|
|||
m_outFilename = outFile.fileName();
|
||||
|
||||
/// Spawn an xsltproc process to apply our stylesheet to our SSML file.
|
||||
QStringList args;
|
||||
m_xsltProc = new QProcess;
|
||||
args << QLatin1String( "-o" ) << m_outFilename << QLatin1String( "--novalid" )
|
||||
QStringList xsltProcArgs= QStringList()
|
||||
<< QLatin1String( "-o" ) << m_outFilename << QLatin1String( "--novalid" )
|
||||
<< m_xsltFilename << m_inFilename;
|
||||
// Warning: This won't compile under KDE 3.2. See FreeTTS::argsToStringList().
|
||||
// kDebug() << "SSMLConvert::transform: executing command: " <<
|
||||
|
@ -239,10 +239,10 @@ bool SSMLConvert::transform(const QString &text, const QString &xsltFilename) {
|
|||
|
||||
connect(m_xsltProc, SIGNAL(finished(int,QProcess::ExitStatus)),
|
||||
this, SLOT(slotProcessExited()));
|
||||
m_xsltProc->start(QLatin1String("xsltproc"), args);
|
||||
if (m_xsltProc->state() != QProcess::Running && m_xsltProc->state() != QProcess::Starting)
|
||||
m_xsltProc->start(QLatin1String("xsltproc"), xsltProcArgs);
|
||||
if (!m_xsltProc->waitForStarted())
|
||||
{
|
||||
kDebug() << "SSMLConvert::transform: Error starting xsltproc";
|
||||
kWarning() << "SSMLConvert::transform: Error starting xsltproc";
|
||||
return false;
|
||||
}
|
||||
m_state = tsTransforming;
|
||||
|
|
Loading…
Add table
Reference in a new issue