summaryrefslogtreecommitdiffstats
path: root/kttsd/filters/xmltransformer
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:20:30 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:20:30 +0000
commit28bf3cbba4139c8a0f81dc9d1a2f6c4ed724f22c (patch)
treea2f011f22aa31d0839c6e2118501b7a6d2f2ae96 /kttsd/filters/xmltransformer
parent0285229d858c8f03cde7354c679a752598cf4515 (diff)
downloadtdeaccessibility-28bf3cbba4139c8a0f81dc9d1a2f6c4ed724f22c.tar.gz
tdeaccessibility-28bf3cbba4139c8a0f81dc9d1a2f6c4ed724f22c.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeaccessibility@1157633 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kttsd/filters/xmltransformer')
-rw-r--r--kttsd/filters/xmltransformer/xmltransformerconf.cpp50
-rw-r--r--kttsd/filters/xmltransformer/xmltransformerconf.h10
-rw-r--r--kttsd/filters/xmltransformer/xmltransformerproc.cpp58
-rw-r--r--kttsd/filters/xmltransformer/xmltransformerproc.h32
4 files changed, 75 insertions, 75 deletions
diff --git a/kttsd/filters/xmltransformer/xmltransformerconf.cpp b/kttsd/filters/xmltransformer/xmltransformerconf.cpp
index 76cfd70..c70c449 100644
--- a/kttsd/filters/xmltransformer/xmltransformerconf.cpp
+++ b/kttsd/filters/xmltransformer/xmltransformerconf.cpp
@@ -22,8 +22,8 @@
******************************************************************************/
// Qt includes.
-#include <qstring.h>
-#include <qlayout.h>
+#include <tqstring.h>
+#include <tqlayout.h>
// KDE includes.
#include <klocale.h>
@@ -43,13 +43,13 @@
/**
* Constructor
*/
-XmlTransformerConf::XmlTransformerConf( QWidget *parent, const char *name, const QStringList& /*args*/) :
+XmlTransformerConf::XmlTransformerConf( TQWidget *parent, const char *name, const TQStringList& /*args*/) :
KttsFilterConf(parent, name)
{
// kdDebug() << "XmlTransformerConf::XmlTransformerConf: Running" << endl;
// Create configuration widget.
- QVBoxLayout *layout = new QVBoxLayout(this, KDialog::marginHint(),
+ TQVBoxLayout *layout = new TQVBoxLayout(this, KDialog::marginHint(),
KDialog::spacingHint(), "XmlTransformerConfWidgetLayout");
layout->setAlignment (Qt::AlignTop);
m_widget = new XmlTransformerConfWidget(this, "XmlTransformerConfigWidget");
@@ -59,18 +59,18 @@ XmlTransformerConf::XmlTransformerConf( QWidget *parent, const char *name, const
defaults();
// Connect signals.
- connect( m_widget->nameLineEdit, SIGNAL(textChanged(const QString&)),
- this, SLOT(configChanged()));
- connect( m_widget->xsltPath, SIGNAL(textChanged(const QString&)),
- this, SLOT(configChanged()) );
- connect( m_widget->xsltprocPath, SIGNAL(textChanged(const QString&)),
- this, SLOT(configChanged()) );
- connect( m_widget->rootElementLineEdit, SIGNAL(textChanged(const QString&)),
- this, SLOT(configChanged()) );
- connect( m_widget->doctypeLineEdit, SIGNAL(textChanged(const QString&)),
- this, SLOT(configChanged()) );
- connect( m_widget->appIdLineEdit, SIGNAL(textChanged(const QString&)),
- this, SLOT(configChanged()) );
+ connect( m_widget->nameLineEdit, TQT_SIGNAL(textChanged(const TQString&)),
+ this, TQT_SLOT(configChanged()));
+ connect( m_widget->xsltPath, TQT_SIGNAL(textChanged(const TQString&)),
+ this, TQT_SLOT(configChanged()) );
+ connect( m_widget->xsltprocPath, TQT_SIGNAL(textChanged(const TQString&)),
+ this, TQT_SLOT(configChanged()) );
+ connect( m_widget->rootElementLineEdit, TQT_SIGNAL(textChanged(const TQString&)),
+ this, TQT_SLOT(configChanged()) );
+ connect( m_widget->doctypeLineEdit, TQT_SIGNAL(textChanged(const TQString&)),
+ this, TQT_SLOT(configChanged()) );
+ connect( m_widget->appIdLineEdit, TQT_SIGNAL(textChanged(const TQString&)),
+ this, TQT_SLOT(configChanged()) );
}
/**
@@ -93,7 +93,7 @@ XmlTransformerConf::~XmlTransformerConf(){
* @param configGroup Call config->setGroup with this argument before
* loading your configuration.
*/
-void XmlTransformerConf::load(KConfig* config, const QString& configGroup){
+void XmlTransformerConf::load(KConfig* config, const TQString& configGroup){
// kdDebug() << "XmlTransformerConf::load: Running" << endl;
config->setGroup( configGroup );
m_widget->nameLineEdit->setText( config->readEntry( "UserFilterName", m_widget->nameLineEdit->text() ) );
@@ -117,7 +117,7 @@ void XmlTransformerConf::load(KConfig* config, const QString& configGroup){
* @param configGroup Call config->setGroup with this argument before
* saving your configuration.
*/
-void XmlTransformerConf::save(KConfig* config, const QString& configGroup){
+void XmlTransformerConf::save(KConfig* config, const TQString& configGroup){
// kdDebug() << "XmlTransformerConf::save: Running" << endl;
config->setGroup( configGroup );
config->writeEntry( "UserFilterName", m_widget->nameLineEdit->text() );
@@ -167,16 +167,16 @@ bool XmlTransformerConf::supportsMultiInstance() { return true; }
* return an empty string.
* @return Filter instance name.
*/
-QString XmlTransformerConf::userPlugInName()
+TQString XmlTransformerConf::userPlugInName()
{
- QString filePath = realFilePath(m_widget->xsltprocPath->url());
- if (filePath.isEmpty()) return QString::null;
- if (getLocation(filePath).isEmpty()) return QString::null;
+ TQString filePath = realFilePath(m_widget->xsltprocPath->url());
+ if (filePath.isEmpty()) return TQString::null;
+ if (getLocation(filePath).isEmpty()) return TQString::null;
filePath = realFilePath(m_widget->xsltPath->url());
- if (filePath.isEmpty()) return QString::null;
- if (getLocation(filePath).isEmpty()) return QString::null;
- if (!QFileInfo(filePath).isFile()) return QString::null;
+ if (filePath.isEmpty()) return TQString::null;
+ if (getLocation(filePath).isEmpty()) return TQString::null;
+ if (!TQFileInfo(filePath).isFile()) return TQString::null;
return m_widget->nameLineEdit->text();
}
diff --git a/kttsd/filters/xmltransformer/xmltransformerconf.h b/kttsd/filters/xmltransformer/xmltransformerconf.h
index 86df0e2..caec175 100644
--- a/kttsd/filters/xmltransformer/xmltransformerconf.h
+++ b/kttsd/filters/xmltransformer/xmltransformerconf.h
@@ -25,7 +25,7 @@
#define _XMLTRANSFORMERCONF_H_
// Qt includes.
-#include <qwidget.h>
+#include <tqwidget.h>
// KDE includes.
#include <kconfig.h>
@@ -45,7 +45,7 @@ class XmlTransformerConf : public KttsFilterConf
/**
* Constructor
*/
- XmlTransformerConf( QWidget *parent, const char *name, const QStringList &args = QStringList() );
+ XmlTransformerConf( TQWidget *parent, const char *name, const TQStringList &args = TQStringList() );
/**
* Destructor
@@ -70,7 +70,7 @@ class XmlTransformerConf : public KttsFilterConf
* any instance-specific parameters to load, but it may still wish
* to load parameters that apply to all instances of the plugin.
*/
- virtual void load(KConfig *config, const QString &configGroup);
+ virtual void load(KConfig *config, const TQString &configGroup);
/**
* This function gets called when the user wants to save the settings in
@@ -82,7 +82,7 @@ class XmlTransformerConf : public KttsFilterConf
* @param configGroup Call config->setGroup with this argument before
* saving your configuration.
*/
- virtual void save(KConfig *config, const QString &configGroup);
+ virtual void save(KConfig *config, const TQString &configGroup);
/**
* This function is called to set the settings in the module to sensible
@@ -108,7 +108,7 @@ class XmlTransformerConf : public KttsFilterConf
* return an empty string.
* @return Filter instance name.
*/
- virtual QString userPlugInName();
+ virtual TQString userPlugInName();
private slots:
diff --git a/kttsd/filters/xmltransformer/xmltransformerproc.cpp b/kttsd/filters/xmltransformer/xmltransformerproc.cpp
index d4aa1c5..b4b9f71 100644
--- a/kttsd/filters/xmltransformer/xmltransformerproc.cpp
+++ b/kttsd/filters/xmltransformer/xmltransformerproc.cpp
@@ -22,8 +22,8 @@
******************************************************************************/
// Qt includes.
-#include <qfile.h>
-#include <qregexp.h>
+#include <tqfile.h>
+#include <tqregexp.h>
// KDE includes.
#include <kdeversion.h>
@@ -44,7 +44,7 @@
/**
* Constructor.
*/
-XmlTransformerProc::XmlTransformerProc( QObject *parent, const char *name, const QStringList& ) :
+XmlTransformerProc::XmlTransformerProc( TQObject *parent, const char *name, const TQStringList& ) :
KttsFilterProc(parent, name)
{
m_xsltProc = 0;
@@ -56,8 +56,8 @@ XmlTransformerProc::XmlTransformerProc( QObject *parent, const char *name, const
/*virtual*/ XmlTransformerProc::~XmlTransformerProc()
{
delete m_xsltProc;
- if (!m_inFilename.isEmpty()) QFile::remove(m_inFilename);
- if (!m_outFilename.isEmpty()) QFile::remove(m_outFilename);
+ if (!m_inFilename.isEmpty()) TQFile::remove(m_inFilename);
+ if (!m_outFilename.isEmpty()) TQFile::remove(m_outFilename);
}
/**
@@ -69,7 +69,7 @@ XmlTransformerProc::XmlTransformerProc( QObject *parent, const char *name, const
* Note: The parameters are for reading from kttsdrc file. Plugins may wish to maintain
* separate configuration files of their own.
*/
-bool XmlTransformerProc::init(KConfig* config, const QString& configGroup)
+bool XmlTransformerProc::init(KConfig* config, const TQString& configGroup)
{
// kdDebug() << "XmlTransformerProc::init: Running." << endl;
config->setGroup( configGroup );
@@ -105,8 +105,8 @@ bool XmlTransformerProc::init(KConfig* config, const QString& configGroup)
* @param appId The DCOP appId of the application that queued the text.
* Also useful for hints about how to do the filtering.
*/
-/*virtual*/ QString XmlTransformerProc::convert(const QString& inputText, TalkerCode* talkerCode,
- const QCString& appId)
+/*virtual*/ TQString XmlTransformerProc::convert(const TQString& inputText, TalkerCode* talkerCode,
+ const TQCString& appId)
{
// kdDebug() << "XmlTransformerProc::convert: Running." << endl;
// If not properly configured, do nothing.
@@ -139,8 +139,8 @@ bool XmlTransformerProc::init(KConfig* config, const QString& configGroup)
* program may then call @ref getOutput to retrieve converted text. Calling
* program must call @ref ackFinished to acknowledge the conversion.
*/
-/*virtual*/ bool XmlTransformerProc::asyncConvert(const QString& inputText, TalkerCode* /*talkerCode*/,
- const QCString& appId)
+/*virtual*/ bool XmlTransformerProc::asyncConvert(const TQString& inputText, TalkerCode* /*talkerCode*/,
+ const TQCString& appId)
{
m_wasModified = false;
@@ -192,7 +192,7 @@ bool XmlTransformerProc::init(KConfig* config, const QString& configGroup)
// If appId doesn't match, return input unmolested.
if ( !m_appIdList.isEmpty() )
{
- QString appIdStr = appId;
+ TQString appIdStr = appId;
// kdDebug() << "XmlTransformrProc::convert: converting " << inputText << " if appId "
// << appId << " matches " << m_appIdList << endl;
found = false;
@@ -214,7 +214,7 @@ bool XmlTransformerProc::init(KConfig* config, const QString& configGroup)
/// Write @param text to a temporary file.
KTempFile inFile(locateLocal("tmp", "kttsd-"), ".xml");
m_inFilename = inFile.file()->name();
- QTextStream* wstream = inFile.textStream();
+ TQTextStream* wstream = inFile.textStream();
if (wstream == 0) {
/// wtf...
kdDebug() << "XmlTransformerProc::convert: Can't write to " << m_inFilename << endl;;
@@ -226,8 +226,8 @@ bool XmlTransformerProc::init(KConfig* config, const QString& configGroup)
// FIXME: Temporary Fix until Konqi returns properly formatted xhtml with & coded as &amp;
// This will change & inside a CDATA section, which is not good, and also within comments and
// processing instructions, which is OK because we don't speak those anyway.
- QString text = inputText;
- text.replace(QRegExp("&(?!amp;)"),"&amp;");
+ TQString text = inputText;
+ text.replace(TQRegExp("&(?!amp;)"),"&amp;");
*wstream << text;
inFile.close();
#if KDE_VERSION >= KDE_MAKE_VERSION (3,3,0)
@@ -250,12 +250,12 @@ bool XmlTransformerProc::init(KConfig* config, const QString& configGroup)
// m_xsltProc->args() << endl;
m_state = fsFiltering;
- connect(m_xsltProc, SIGNAL(processExited(KProcess*)),
- this, SLOT(slotProcessExited(KProcess*)));
- connect(m_xsltProc, SIGNAL(receivedStdout(KProcess*, char*, int)),
- this, SLOT(slotReceivedStdout(KProcess*, char*, int)));
- connect(m_xsltProc, SIGNAL(receivedStderr(KProcess*, char*, int)),
- this, SLOT(slotReceivedStderr(KProcess*, char*, int)));
+ connect(m_xsltProc, TQT_SIGNAL(processExited(KProcess*)),
+ this, TQT_SLOT(slotProcessExited(KProcess*)));
+ connect(m_xsltProc, TQT_SIGNAL(receivedStdout(KProcess*, char*, int)),
+ this, TQT_SLOT(slotReceivedStdout(KProcess*, char*, int)));
+ connect(m_xsltProc, TQT_SIGNAL(receivedStderr(KProcess*, char*, int)),
+ this, TQT_SLOT(slotReceivedStderr(KProcess*, char*, int)));
if (!m_xsltProc->start(KProcess::NotifyOnExit,
static_cast<KProcess::Communication>(KProcess::Stdout | KProcess::Stderr)))
{
@@ -269,7 +269,7 @@ bool XmlTransformerProc::init(KConfig* config, const QString& configGroup)
// Process output when xsltproc exits.
void XmlTransformerProc::processOutput()
{
- QFile::remove(m_inFilename);
+ TQFile::remove(m_inFilename);
int exitStatus = 11;
if (m_xsltProc->normalExit())
@@ -284,27 +284,27 @@ void XmlTransformerProc::processOutput()
{
kdDebug() << "XmlTransformerProc::processOutput: xsltproc abnormal exit. Status = " << exitStatus << endl;
m_state = fsFinished;
- QFile::remove(m_outFilename);
+ TQFile::remove(m_outFilename);
emit filteringFinished();
return;
}
/// Read back the data that was written to /tmp/fileName.output.
- QFile readfile(m_outFilename);
+ TQFile readfile(m_outFilename);
if(!readfile.open(IO_ReadOnly)) {
/// uhh yeah... Issues writing to the output file.
kdDebug() << "XmlTransformerProc::processOutput: Could not read file " << m_outFilename << endl;
m_state = fsFinished;
emit filteringFinished();
}
- QTextStream rstream(&readfile);
+ TQTextStream rstream(&readfile);
m_text = rstream.read();
readfile.close();
kdDebug() << "XmlTransformerProc::processOutput: Read file at " + m_inFilename + " and created " + m_outFilename + " based on the stylesheet at " << m_xsltFilePath << endl;
// Clean up.
- QFile::remove(m_outFilename);
+ TQFile::remove(m_outFilename);
m_state = fsFinished;
m_wasModified = true;
@@ -338,7 +338,7 @@ void XmlTransformerProc::processOutput()
/**
* Returns the filtered output.
*/
-/*virtual*/ QString XmlTransformerProc::getOutput() { return m_text; }
+/*virtual*/ TQString XmlTransformerProc::getOutput() { return m_text; }
/**
* Acknowledges the finished filtering.
@@ -346,7 +346,7 @@ void XmlTransformerProc::processOutput()
/*virtual*/ void XmlTransformerProc::ackFinished()
{
m_state = fsIdle;
- m_text = QString::null;
+ m_text = TQString::null;
}
/**
@@ -373,13 +373,13 @@ void XmlTransformerProc::slotProcessExited(KProcess*)
void XmlTransformerProc::slotReceivedStdout(KProcess*, char* /*buffer*/, int /*buflen*/)
{
- // QString buf = QString::fromLatin1(buffer, buflen);
+ // TQString buf = TQString::fromLatin1(buffer, buflen);
// kdDebug() << "XmlTransformerProc::slotReceivedStdout: Received from xsltproc: " << buf << endl;
}
void XmlTransformerProc::slotReceivedStderr(KProcess*, char* buffer, int buflen)
{
- QString buf = QString::fromLatin1(buffer, buflen);
+ TQString buf = TQString::fromLatin1(buffer, buflen);
kdDebug() << "XmlTransformerProc::slotReceivedStderr: Received error from xsltproc: " << buf << endl;
}
diff --git a/kttsd/filters/xmltransformer/xmltransformerproc.h b/kttsd/filters/xmltransformer/xmltransformerproc.h
index 7c88dd1..d50adeb 100644
--- a/kttsd/filters/xmltransformer/xmltransformerproc.h
+++ b/kttsd/filters/xmltransformer/xmltransformerproc.h
@@ -25,8 +25,8 @@
#define _XMLTRANSFORMERPROC_H_
// Qt includes.
-#include <qobject.h>
-#include <qstringlist.h>
+#include <tqobject.h>
+#include <tqstringlist.h>
// KTTS includes.
#include "filterproc.h"
@@ -41,7 +41,7 @@ public:
/**
* Constructor.
*/
- XmlTransformerProc( QObject *parent, const char *name, const QStringList &args = QStringList() );
+ XmlTransformerProc( TQObject *parent, const char *name, const TQStringList &args = TQStringList() );
/**
* Destructor.
@@ -57,7 +57,7 @@ public:
* Note: The parameters are for reading from kttsdrc file. Plugins may wish to maintain
* separate configuration files of their own.
*/
- virtual bool init(KConfig *config, const QString &configGroup);
+ virtual bool init(KConfig *config, const TQString &configGroup);
/**
* Returns True if the plugin supports asynchronous processing,
@@ -80,7 +80,7 @@ public:
* @param appId The DCOP appId of the application that queued the text.
* Also useful for hints about how to do the filtering.
*/
- virtual QString convert(const QString& inputText, TalkerCode* talkerCode, const QCString& appId);
+ virtual TQString convert(const TQString& inputText, TalkerCode* talkerCode, const TQCString& appId);
/**
* Convert input. Runs asynchronously.
@@ -96,7 +96,7 @@ public:
* program may then call @ref getOutput to retrieve converted text. Calling
* program must call @ref ackFinished to acknowledge the conversion.
*/
- virtual bool asyncConvert(const QString& inputText, TalkerCode* talkerCode, const QCString& appId);
+ virtual bool asyncConvert(const TQString& inputText, TalkerCode* talkerCode, const TQCString& appId);
/**
* Waits for a previous call to asyncConvert to finish.
@@ -111,7 +111,7 @@ public:
/**
* Returns the filtered output.
*/
- virtual QString getOutput();
+ virtual TQString getOutput();
/**
* Acknowledges the finished filtering.
@@ -140,26 +140,26 @@ private:
void processOutput();
// If not empty, only apply to text queued by an applications containing one of these strings.
- QStringList m_appIdList;
+ TQStringList m_appIdList;
// If not empty, only apply to XML that has the specified root element.
- QStringList m_rootElementList;
+ TQStringList m_rootElementList;
// If not empty, only apply to XML that has the specified DOCTYPE spec.
- QStringList m_doctypeList;
+ TQStringList m_doctypeList;
// The text that is being filtered.
- QString m_text;
+ TQString m_text;
// Processing state.
int m_state;
// xsltproc process.
KProcess* m_xsltProc;
// Input and Output filenames.
- QString m_inFilename;
- QString m_outFilename;
+ TQString m_inFilename;
+ TQString m_outFilename;
// User's name for the filter.
- QString m_UserFilterName;
+ TQString m_UserFilterName;
// XSLT file.
- QString m_xsltFilePath;
+ TQString m_xsltFilePath;
// Path to xsltproc processor.
- QString m_xsltprocPath;
+ TQString m_xsltprocPath;
// Did this filter modify the text?
bool m_wasModified;
};