diff options
Diffstat (limited to 'src/kmplayerprocess.cpp')
-rw-r--r-- | src/kmplayerprocess.cpp | 792 |
1 files changed, 396 insertions, 396 deletions
diff --git a/src/kmplayerprocess.cpp b/src/kmplayerprocess.cpp index fff98f4..415e28b 100644 --- a/src/kmplayerprocess.cpp +++ b/src/kmplayerprocess.cpp @@ -19,20 +19,20 @@ */ #include <math.h> #include <config.h> -#include <qstring.h> -#include <qfile.h> -#include <qfileinfo.h> -#include <qtimer.h> -#include <qlayout.h> -#include <qtable.h> -#include <qlineedit.h> -#include <qslider.h> -#include <qcombobox.h> -#include <qcheckbox.h> -#include <qspinbox.h> -#include <qlabel.h> -#include <qfontmetrics.h> -#include <qwhatsthis.h> +#include <tqstring.h> +#include <tqfile.h> +#include <tqfileinfo.h> +#include <tqtimer.h> +#include <tqlayout.h> +#include <tqtable.h> +#include <tqlineedit.h> +#include <tqslider.h> +#include <tqcombobox.h> +#include <tqcheckbox.h> +#include <tqspinbox.h> +#include <tqlabel.h> +#include <tqfontmetrics.h> +#include <tqwhatsthis.h> #include <dcopobject.h> #include <dcopclient.h> @@ -64,23 +64,23 @@ using namespace KMPlayer; static const char * default_supported [] = { 0L }; -static QString getPath (const KURL & url) { - QString p = KURL::decode_string (url.url ()); - if (p.startsWith (QString ("file:/"))) { +static TQString getPath (const KURL & url) { + TQString p = KURL::decode_string (url.url ()); + if (p.startsWith (TQString ("file:/"))) { p = p.mid (5); unsigned int i = 0; - for (; i < p.length () && p[i] == QChar ('/'); ++i) + for (; i < p.length () && p[i] == TQChar ('/'); ++i) ; //kdDebug () << "getPath " << p.mid (i-1) << endl; if (i > 0) return p.mid (i-1); - return QString (QChar ('/') + p); + return TQString (TQChar ('/') + p); } return p; } -Process::Process (QObject * parent, Settings * settings, const char * n) - : QObject (parent, n), m_source (0L), m_settings (settings), +Process::Process (TQObject * tqparent, Settings * settings, const char * n) + : TQObject (tqparent, n), m_source (0L), m_settings (settings), m_state (NotRunning), m_old_state (NotRunning), m_process (0L), m_job(0L), m_supported_sources (default_supported), m_viewer (0L) {} @@ -92,8 +92,8 @@ Process::~Process () { void Process::init () { } -QString Process::menuName () const { - return QString (className ()); +TQString Process::menuName () const { + return TQString (className ()); } void Process::initProcess (Viewer * viewer) { @@ -101,7 +101,7 @@ void Process::initProcess (Viewer * viewer) { delete m_process; m_process = new KProcess; m_process->setUseShell (true); - m_process->setEnvironment (QString::fromLatin1 ("SESSION_MANAGER"), QString::fromLatin1 ("")); + m_process->setEnvironment (TQString::tqfromLatin1 ("SESSION_MANAGER"), TQString::tqfromLatin1 ("")); if (m_source) m_source->setPosition (0); } @@ -113,9 +113,9 @@ bool Process::playing () const { return m_process && m_process->isRunning (); } -void Process::setAudioLang (int, const QString &) {} +void Process::setAudioLang (int, const TQString &) {} -void Process::setSubtitle (int, const QString &) {} +void Process::setSubtitle (int, const TQString &) {} bool Process::pause () { return false; @@ -191,7 +191,7 @@ void Process::setState (State newstate) { m_old_state = m_state; m_state = newstate; if (need_timer && m_source) - QTimer::singleShot (0, this, SLOT (rescheduledStateChanged ())); + TQTimer::singleShot (0, this, TQT_SLOT (rescheduledStateChanged ())); } } @@ -205,7 +205,7 @@ bool Process::play (Source * src, NodePtr _mrl) { m_source = src; m_mrl = _mrl; Mrl * m = _mrl ? _mrl->mrl () : 0L; - QString url = m ? m->absolutePath () : QString (); + TQString url = m ? m->absolutePath () : TQString (); bool changed = m_url != url; m_url = url; #if KDE_IS_VERSION(3,3,91) @@ -213,7 +213,7 @@ bool Process::play (Source * src, NodePtr _mrl) { return deMediafiedPlay (); m_url = url; m_job = KIO::stat (m_url, false); - connect(m_job, SIGNAL (result(KIO::Job *)), this, SLOT(result(KIO::Job *))); + connect(m_job, TQT_SIGNAL (result(KIO::Job *)), this, TQT_SLOT(result(KIO::Job *))); return true; #else return deMediafiedPlay (); @@ -258,15 +258,15 @@ Viewer * Process::viewer () const { //----------------------------------------------------------------------------- -static bool proxyForURL (const KURL& url, QString& proxy) { +static bool proxyForURL (const KURL& url, TQString& proxy) { KProtocolManager::slaveProtocol (url, proxy); return !proxy.isNull (); } //----------------------------------------------------------------------------- -KDE_NO_CDTOR_EXPORT MPlayerBase::MPlayerBase (QObject * parent, Settings * settings, const char * n) - : Process (parent, settings, n), m_use_slave (true) { +KDE_NO_CDTOR_EXPORT MPlayerBase::MPlayerBase (TQObject * tqparent, Settings * settings, const char * n) + : Process (tqparent, settings, n), m_use_slave (true) { m_process = new KProcess; } @@ -277,22 +277,22 @@ KDE_NO_EXPORT void MPlayerBase::initProcess (Viewer * viewer) { Process::initProcess (viewer); const KURL & url (m_source->url ()); if (!url.isEmpty ()) { - QString proxy_url; + TQString proxy_url; if (KProtocolManager::useProxy () && proxyForURL (url, proxy_url)) m_process->setEnvironment("http_proxy", proxy_url); } - connect (m_process, SIGNAL (wroteStdin (KProcess *)), - this, SLOT (dataWritten (KProcess *))); - connect (m_process, SIGNAL (processExited (KProcess *)), - this, SLOT (processStopped (KProcess *))); + connect (m_process, TQT_SIGNAL (wroteStdin (KProcess *)), + this, TQT_SLOT (dataWritten (KProcess *))); + connect (m_process, TQT_SIGNAL (processExited (KProcess *)), + this, TQT_SLOT (processStopped (KProcess *))); } -KDE_NO_EXPORT bool MPlayerBase::sendCommand (const QString & cmd) { +KDE_NO_EXPORT bool MPlayerBase::sendCommand (const TQString & cmd) { if (playing () && m_use_slave) { commands.push_front (cmd + '\n'); fprintf (stderr, "eval %s", commands.last ().latin1 ()); if (commands.size () < 2) - m_process->writeStdin (QFile::encodeName(commands.last ()), + m_process->writeStdin (TQFile::encodeName(commands.last ()), commands.last ().length ()); return true; } @@ -309,8 +309,8 @@ KDE_NO_EXPORT bool MPlayerBase::stop () { KDE_NO_EXPORT bool MPlayerBase::quit () { if (playing ()) { stop (); - disconnect (m_process, SIGNAL (processExited (KProcess *)), - this, SLOT (processStopped (KProcess *))); + disconnect (m_process, TQT_SIGNAL (processExited (KProcess *)), + this, TQT_SLOT (processStopped (KProcess *))); if (!m_use_slave) { void (*oldhandler)(int) = signal(SIGTERM, SIG_IGN); ::kill (-1 * ::getpid (), SIGTERM); @@ -319,7 +319,7 @@ KDE_NO_EXPORT bool MPlayerBase::quit () { #if KDE_IS_VERSION(3, 1, 90) m_process->wait(2); #else - QTime t; + TQTime t; t.start (); do { KProcessController::theKProcessController->waitForProcessExit (2); @@ -338,7 +338,7 @@ KDE_NO_EXPORT void MPlayerBase::dataWritten (KProcess *) { kdDebug() << "eval done " << commands.last () << endl; commands.pop_back (); if (commands.size ()) - m_process->writeStdin (QFile::encodeName(commands.last ()), + m_process->writeStdin (TQFile::encodeName(commands.last ()), commands.last ().length ()); } @@ -354,8 +354,8 @@ static const char * mplayer_supports [] = { "dvdsource", "exitsource", "hrefsource", "introsource", "pipesource", "tvscanner", "tvsource", "urlsource", "vcdsource", "audiocdsource", 0L }; -KDE_NO_CDTOR_EXPORT MPlayer::MPlayer (QObject * parent, Settings * settings) - : MPlayerBase (parent, settings, "mplayer"), +KDE_NO_CDTOR_EXPORT MPlayer::MPlayer (TQObject * tqparent, Settings * settings) + : MPlayerBase (tqparent, settings, "mplayer"), m_widget (0L), m_configpage (new MPlayerPreferencesPage (this)), aid (-1), sid (-1), @@ -365,7 +365,7 @@ KDE_NO_CDTOR_EXPORT MPlayer::MPlayer (QObject * parent, Settings * settings) } KDE_NO_CDTOR_EXPORT MPlayer::~MPlayer () { - if (m_widget && !m_widget->parent ()) + if (m_widget && !m_widget->tqparent ()) delete m_widget; delete m_configpage; } @@ -373,7 +373,7 @@ KDE_NO_CDTOR_EXPORT MPlayer::~MPlayer () { KDE_NO_EXPORT void MPlayer::init () { } -QString MPlayer::menuName () const { +TQString MPlayer::menuName () const { return i18n ("&MPlayer"); } @@ -389,7 +389,7 @@ KDE_NO_EXPORT bool MPlayer::ready (Viewer * viewer) { KDE_NO_EXPORT bool MPlayer::deMediafiedPlay () { if (playing ()) - return sendCommand (QString ("gui_play")); + return sendCommand (TQString ("gui_play")); if (!m_needs_restarted && playing ()) quit (); // rescheduling of setState will reset state just-in-time initProcess (viewer ()); @@ -401,47 +401,47 @@ KDE_NO_EXPORT bool MPlayer::deMediafiedPlay () { alanglist = 0L; slanglist = 0L; m_request_seek = -1; - QString args = m_source->options () + ' '; + TQString args = m_source->options () + ' '; KURL url (m_url); if (!url.isEmpty ()) { if (m_source->url ().isLocalFile ()) m_process->setWorkingDirectory - (QFileInfo (m_source->url ().path ()).dirPath (true)); + (TQFileInfo (m_source->url ().path ()).dirPath (true)); if (url.isLocalFile ()) { m_url = getPath (url); if (m_configpage->alwaysbuildindex && (m_url.lower ().endsWith (".avi") || m_url.lower ().endsWith (".divx"))) - args += QString (" -idx "); + args += TQString (" -idx "); } else { int cache = m_configpage->cachesize; - if (cache > 3 && !url.url ().startsWith (QString ("dvd")) && - !url.url ().startsWith (QString ("vcd")) && - !url.url ().startsWith (QString ("tv://"))) - args += QString ("-cache %1 ").arg (cache); - if (m_url.startsWith (QString ("cdda:/")) && - !m_url.startsWith (QString ("cdda://"))) - m_url = QString ("cdda://") + m_url.mid (6); + if (cache > 3 && !url.url ().startsWith (TQString ("dvd")) && + !url.url ().startsWith (TQString ("vcd")) && + !url.url ().startsWith (TQString ("tv://"))) + args += TQString ("-cache %1 ").arg (cache); + if (m_url.startsWith (TQString ("cdda:/")) && + !m_url.startsWith (TQString ("cdda://"))) + m_url = TQString ("cdda://") + m_url.mid (6); } - if (url.protocol () != QString ("stdin")) - args += KProcess::quote (QString (QFile::encodeName (m_url))); + if (url.protocol () != TQString ("stdin")) + args += KProcess::quote (TQString (TQFile::encodeName (m_url))); } m_tmpURL.truncate (0); if (!m_source->identified () && !m_settings->mplayerpost090) { - args += QString (" -quiet -nocache -identify -frames 0 "); + args += TQString (" -quiet -nocache -identify -frames 0 "); } else { if (m_mrl->mrl ()->repeat > 0) - args += QString(" -loop " +QString::number(m_mrl->mrl()->repeat+1)); + args += TQString(" -loop " +TQString::number(m_mrl->mrl()->repeat+1)); else if (m_settings->loop) - args += QString (" -loop 0"); + args += TQString (" -loop 0"); if (m_settings->mplayerpost090) - args += QString (" -identify"); + args += TQString (" -identify"); if (!m_source->subUrl ().isEmpty ()) { - args += QString (" -sub "); + args += TQString (" -sub "); const KURL & sub_url (m_source->subUrl ()); if (!sub_url.isEmpty ()) { - QString myurl (sub_url.isLocalFile () ? getPath (sub_url) : sub_url.url ()); - args += KProcess::quote (QString (QFile::encodeName (myurl))); + TQString myurl (sub_url.isLocalFile () ? getPath (sub_url) : sub_url.url ()); + args += KProcess::quote (TQString (TQFile::encodeName (myurl))); } } } @@ -452,12 +452,12 @@ KDE_NO_EXPORT bool MPlayer::stop () { terminateJobs (); if (!m_source || !m_process || !m_process->isRunning ()) return true; if (m_use_slave) - sendCommand (QString ("quit")); + sendCommand (TQString ("quit")); return MPlayerBase::stop (); } KDE_NO_EXPORT bool MPlayer::pause () { - return sendCommand (QString ("pause")); + return sendCommand (TQString ("pause")); } KDE_NO_EXPORT bool MPlayer::seek (int pos, bool absolute) { @@ -465,10 +465,10 @@ KDE_NO_EXPORT bool MPlayer::seek (int pos, bool absolute) { (absolute && m_source->position () == pos)) return false; if (m_request_seek >= 0 && commands.size () > 1) { - QStringList::iterator i = commands.begin (); - QStringList::iterator end ( commands.end () ); + TQStringList::iterator i = commands.begin (); + TQStringList::iterator end ( commands.end () ); for (++i; i != end; ++i) - if ((*i).startsWith (QString ("seek"))) { + if ((*i).startsWith (TQString ("seek"))) { i = commands.erase (i); m_request_seek = -1; break; @@ -479,7 +479,7 @@ KDE_NO_EXPORT bool MPlayer::seek (int pos, bool absolute) { return false; } m_request_seek = pos; - QString cmd; + TQString cmd; cmd.sprintf ("seek %d %d", pos/10, absolute ? 2 : 0); if (!absolute) pos = m_source->position () + pos; @@ -493,67 +493,67 @@ KDE_NO_EXPORT bool MPlayer::volume (int incdec, bool absolute) { if (incdec == 0) return true; old_volume += incdec; - return sendCommand (QString ("volume ") + QString::number (incdec)); + return sendCommand (TQString ("volume ") + TQString::number (incdec)); } KDE_NO_EXPORT bool MPlayer::saturation (int val, bool absolute) { - QString cmd; + TQString cmd; cmd.sprintf ("saturation %d %d", val, absolute ? 1 : 0); return sendCommand (cmd); } KDE_NO_EXPORT bool MPlayer::hue (int val, bool absolute) { - QString cmd; + TQString cmd; cmd.sprintf ("hue %d %d", val, absolute ? 1 : 0); return sendCommand (cmd); } KDE_NO_EXPORT bool MPlayer::contrast (int val, bool /*absolute*/) { - QString cmd; + TQString cmd; cmd.sprintf ("contrast %d 1", val); return sendCommand (cmd); } KDE_NO_EXPORT bool MPlayer::brightness (int val, bool /*absolute*/) { - QString cmd; + TQString cmd; cmd.sprintf ("brightness %d 1", val); return sendCommand (cmd); } bool MPlayer::run (const char * args, const char * pipe) { //m_view->consoleOutput ()->clear (); - m_process_output = QString (); - connect (m_process, SIGNAL (receivedStdout (KProcess *, char *, int)), - this, SLOT (processOutput (KProcess *, char *, int))); - connect (m_process, SIGNAL (receivedStderr (KProcess *, char *, int)), - this, SLOT (processOutput (KProcess *, char *, int))); + m_process_output = TQString (); + connect (m_process, TQT_SIGNAL (receivedStdout (KProcess *, char *, int)), + this, TQT_SLOT (processOutput (KProcess *, char *, int))); + connect (m_process, TQT_SIGNAL (receivedStderr (KProcess *, char *, int)), + this, TQT_SLOT (processOutput (KProcess *, char *, int))); m_use_slave = !(pipe && pipe[0]); if (!m_use_slave) { fprintf (stderr, "%s | ", pipe); *m_process << pipe << " | "; } - QString exe = m_configpage->mplayer_path; + TQString exe = m_configpage->mplayer_path; if (exe.isEmpty ()) exe = "mplayer"; fprintf (stderr, "%s -wid %lu ", exe.ascii(), (unsigned long) widget ()); - *m_process << exe << " -wid " << QString::number (widget ()); + *m_process << exe << " -wid " << TQString::number (widget ()); if (m_use_slave) { fprintf (stderr, "-slave "); *m_process << "-slave "; } - QString strVideoDriver = QString (m_settings->videodrivers[m_settings->videodriver].driver); + TQString strVideoDriver = TQString (m_settings->videodrivers[m_settings->videodriver].driver); if (!strVideoDriver.isEmpty ()) { fprintf (stderr, " -vo %s", strVideoDriver.lower().ascii()); *m_process << " -vo " << strVideoDriver.lower(); if (viewer ()->view ()->keepSizeRatio () && - strVideoDriver.lower() == QString::fromLatin1 ("x11")) { + strVideoDriver.lower() == TQString::tqfromLatin1 ("x11")) { fprintf (stderr, " -zoom"); *m_process << " -zoom"; } } - QString strAudioDriver = QString (m_settings->audiodrivers[m_settings->audiodriver].driver); + TQString strAudioDriver = TQString (m_settings->audiodrivers[m_settings->audiodriver].driver); if (!strAudioDriver.isEmpty ()) { fprintf (stderr, " -ao %s", strAudioDriver.lower().ascii()); *m_process << " -ao " << strAudioDriver.lower(); @@ -574,34 +574,34 @@ bool MPlayer::run (const char * args, const char * pipe) { if (m_settings->autoadjustcolors) { fprintf (stderr, " -contrast %d", m_settings->contrast); - *m_process << " -contrast " << QString::number (m_settings->contrast); + *m_process << " -contrast " << TQString::number (m_settings->contrast); fprintf (stderr, " -brightness %d", m_settings->brightness); - *m_process << " -brightness " <<QString::number(m_settings->brightness); + *m_process << " -brightness " <<TQString::number(m_settings->brightness); fprintf (stderr, " -hue %d", m_settings->hue); - *m_process << " -hue " << QString::number (m_settings->hue); + *m_process << " -hue " << TQString::number (m_settings->hue); fprintf (stderr, " -saturation %d", m_settings->saturation); - *m_process << " -saturation " <<QString::number(m_settings->saturation); + *m_process << " -saturation " <<TQString::number(m_settings->saturation); } if (aid > -1) { fprintf (stderr, " -aid %d", aid); - *m_process << " -aid " << QString::number (aid); + *m_process << " -aid " << TQString::number (aid); } if (sid > -1) { fprintf (stderr, " -sid %d", sid); - *m_process << " -sid " << QString::number (sid); + *m_process << " -sid " << TQString::number (sid); } - for (NodePtr n = m_mrl; n; n = n->parentNode ()) { + for (NodePtr n = m_mrl; n; n = n->tqparentNode ()) { if (n->id != id_node_group_node && n->id != id_node_playlist_item) break; - QString plops = convertNode <Element> (n)->getAttribute ("mplayeropts"); + TQString plops = convertNode <Element> (n)->getAttribute ("mplayeropts"); if (!plops.isNull ()) { - QStringList sl = QStringList::split (QChar (' '), plops); + TQStringList sl = TQStringList::split (TQChar (' '), plops); for (int i = 0; i < sl.size (); ++i) { - QString plop = KProcess::quote (sl[i]); + TQString plop = KProcess::quote (sl[i]); fprintf (stderr, " %s", plop.ascii ()); *m_process << " " << plop; } @@ -612,9 +612,9 @@ bool MPlayer::run (const char * args, const char * pipe) { fprintf (stderr, " %s\n", args); *m_process << " " << args; - QValueList<QCString>::const_iterator it; - QString sMPArgs; - QValueList<QCString>::const_iterator end( m_process->args().end() ); + TQValueList<TQCString>::const_iterator it; + TQString sMPArgs; + TQValueList<TQCString>::const_iterator end( m_process->args().end() ); for ( it = m_process->args().begin(); it != end; ++it ){ sMPArgs += (*it); } @@ -632,20 +632,20 @@ bool MPlayer::run (const char * args, const char * pipe) { KDE_NO_EXPORT bool MPlayer::grabPicture (const KURL & url, int pos) { stop (); initProcess (viewer ()); - QString outdir = locateLocal ("data", "kmplayer/"); - m_grabfile = outdir + QString ("00000001.jpg"); + TQString outdir = locateLocal ("data", "kmplayer/"); + m_grabfile = outdir + TQString ("00000001.jpg"); unlink (m_grabfile.ascii ()); - QString myurl (url.isLocalFile () ? getPath (url) : url.url ()); - QString args ("mplayer "); + TQString myurl (url.isLocalFile () ? getPath (url) : url.url ()); + TQString args ("mplayer "); if (m_settings->mplayerpost090) args += "-vo jpeg:outdir="; else args += "-vo jpeg -jpeg outdir="; args += KProcess::quote (outdir); - args += QString (" -frames 1 -nosound -quiet "); + args += TQString (" -frames 1 -nosound -quiet "); if (pos > 0) - args += QString ("-ss %1 ").arg (pos); - args += KProcess::quote (QString (QFile::encodeName (myurl))); + args += TQString ("-ss %1 ").arg (pos); + args += KProcess::quote (TQString (TQFile::encodeName (myurl))); *m_process << args; kdDebug () << args << endl; m_process->start (KProcess::NotifyOnExit, KProcess::NoCommunication); @@ -657,13 +657,13 @@ KDE_NO_EXPORT void MPlayer::processOutput (KProcess *, char * str, int slen) { View * v = viewer ()->view (); bool ok; - QRegExp * patterns = m_configpage->m_patterns; - QRegExp & m_refURLRegExp = patterns[MPlayerPreferencesPage::pat_refurl]; - QRegExp & m_refRegExp = patterns[MPlayerPreferencesPage::pat_ref]; + TQRegExp * patterns = m_configpage->m_patterns; + TQRegExp & m_refURLRegExp = patterns[MPlayerPreferencesPage::pat_refurl]; + TQRegExp & m_refRegExp = patterns[MPlayerPreferencesPage::pat_ref]; do { int len = strcspn (str, "\r\n"); - QString out = m_process_output + QString::fromLocal8Bit (str, len); - m_process_output = QString (); + TQString out = m_process_output + TQString::fromLocal8Bit (str, len); + m_process_output = TQString (); str += len; slen -= len; if (slen <= 0) { @@ -682,8 +682,8 @@ KDE_NO_EXPORT void MPlayer::processOutput (KProcess *, char * str, int slen) { slen--; if (process_stats) { - QRegExp & m_posRegExp = patterns[MPlayerPreferencesPage::pat_pos]; - QRegExp & m_cacheRegExp = patterns[MPlayerPreferencesPage::pat_cache]; + TQRegExp & m_posRegExp = patterns[MPlayerPreferencesPage::pat_pos]; + TQRegExp & m_cacheRegExp = patterns[MPlayerPreferencesPage::pat_cache]; if (m_source->hasLength () && m_posRegExp.search (out) > -1) { int pos = int (10.0 * m_posRegExp.cap (1).toFloat ()); m_source->setPosition (pos); @@ -692,7 +692,7 @@ KDE_NO_EXPORT void MPlayer::processOutput (KProcess *, char * str, int slen) { m_source->setLoading (int (m_cacheRegExp.cap(1).toDouble())); } } else if (out.startsWith ("ID_LENGTH")) { - int pos = out.find ('='); + int pos = out.tqfind ('='); if (pos > 0) { int l = (int) out.mid (pos + 1).toDouble (&ok); if (ok && l >= 0) { @@ -710,35 +710,35 @@ KDE_NO_EXPORT void MPlayer::processOutput (KProcess *, char * str, int slen) { kdDebug () << "Reference File " << endl; m_tmpURL.truncate (0); } else if (out.startsWith ("ID_VIDEO_WIDTH")) { - int pos = out.find ('='); + int pos = out.tqfind ('='); if (pos > 0) { int w = out.mid (pos + 1).toInt (); m_source->setDimensions (m_mrl, w, m_source->height ()); } } else if (out.startsWith ("ID_VIDEO_HEIGHT")) { - int pos = out.find ('='); + int pos = out.tqfind ('='); if (pos > 0) { int h = out.mid (pos + 1).toInt (); m_source->setDimensions (m_mrl, m_source->width (), h); } } else if (out.startsWith ("ID_VIDEO_ASPECT")) { - int pos = out.find ('='); + int pos = out.tqfind ('='); if (pos > 0) { bool ok; - QString val = out.mid (pos + 1); + TQString val = out.mid (pos + 1); float a = val.toFloat (&ok); if (!ok) { - val.replace (',', '.'); + val.tqreplace (',', '.'); a = val.toFloat (&ok); } if (ok && a > 0.001) m_source->setAspect (m_mrl, a); } } else if (out.startsWith ("ID_AID_")) { - int pos = out.find ('_', 7); + int pos = out.tqfind ('_', 7); if (pos > 0) { int id = out.mid (7, pos - 7).toInt (); - pos = out.find ('=', pos); + pos = out.tqfind ('=', pos); if (pos > 0) { if (!alanglist_end) { alanglist = new LangInfo (id, out.mid (pos + 1)); @@ -751,10 +751,10 @@ KDE_NO_EXPORT void MPlayer::processOutput (KProcess *, char * str, int slen) { } } } else if (out.startsWith ("ID_SID_")) { - int pos = out.find ('_', 7); + int pos = out.tqfind ('_', 7); if (pos > 0) { int id = out.mid (7, pos - 7).toInt (); - pos = out.find ('=', pos); + pos = out.tqfind ('=', pos); if (pos > 0) { if (!slanglist_end) { slanglist = new LangInfo (id, out.mid (pos + 1)); @@ -767,17 +767,17 @@ KDE_NO_EXPORT void MPlayer::processOutput (KProcess *, char * str, int slen) { } } } else if (out.startsWith ("ICY Info")) { - int p = out.find ("StreamTitle=", 8); + int p = out.tqfind ("StreamTitle=", 8); if (p > -1) { p += 12; - int e = out.find (';', p); + int e = out.tqfind (';', p); if (e > -1) e -= p; ((PlayListNotify *)m_source)->setInfoMessage (out.mid (p, e)); } } else { - QRegExp & m_startRegExp = patterns[MPlayerPreferencesPage::pat_start]; - QRegExp & m_sizeRegExp = patterns[MPlayerPreferencesPage::pat_size]; + TQRegExp & m_startRegExp = patterns[MPlayerPreferencesPage::pat_start]; + TQRegExp & m_sizeRegExp = patterns[MPlayerPreferencesPage::pat_size]; v->addText (out, true); if (!m_source->processOutput (out)) { // int movie_width = m_source->width (); @@ -796,7 +796,7 @@ KDE_NO_EXPORT void MPlayer::processOutput (KProcess *, char * str, int slen) { } m_source->setIdentified (); } - QStringList alst, slst; + TQStringList alst, slst; for (SharedPtr <LangInfo> li = alanglist; li; li = li->next) alst.push_back (li->name); for (SharedPtr <LangInfo> li = slanglist; li; li = li->next) @@ -814,7 +814,7 @@ KDE_NO_EXPORT void MPlayer::processStopped (KProcess * p) { emit grabReady (m_grabfile); m_grabfile.truncate (0); } else if (p) { - QString url; + TQString url; if (!m_source->identified ()) { m_source->setIdentified (); if (!m_tmpURL.isEmpty () && m_url != m_tmpURL) { @@ -832,24 +832,24 @@ KDE_NO_EXPORT void MPlayer::processStopped (KProcess * p) { } } -void MPlayer::setAudioLang (int id, const QString &) { +void MPlayer::setAudioLang (int id, const TQString &) { SharedPtr <LangInfo> li = alanglist; for (; id > 0 && li; li = li->next) id--; if (li) aid = li->id; m_needs_restarted = true; - sendCommand (QString ("quit")); + sendCommand (TQString ("quit")); } -void MPlayer::setSubtitle (int id, const QString &) { +void MPlayer::setSubtitle (int id, const TQString &) { SharedPtr <LangInfo> li = slanglist; for (; id > 0 && li; li = li->next) id--; if (li) sid = li->id; m_needs_restarted = true; - sendCommand (QString ("quit")); + sendCommand (TQString ("quit")); } //----------------------------------------------------------------------------- @@ -863,7 +863,7 @@ static const char * strAlwaysBuildIndex = "Always build index"; static const int non_patterns = 4; static struct MPlayerPattern { - QString caption; + TQString caption; const char * name; const char * pattern; } _mplayer_patterns [] = { @@ -884,18 +884,18 @@ static struct MPlayerPattern { namespace KMPlayer { -class KMPLAYER_NO_EXPORT MPlayerPreferencesFrame : public QFrame { +class KMPLAYER_NO_EXPORT MPlayerPreferencesFrame : public TQFrame { public: - MPlayerPreferencesFrame (QWidget * parent); - QTable * table; + MPlayerPreferencesFrame (TQWidget * tqparent); + TQTable * table; }; } // namespace -KDE_NO_CDTOR_EXPORT MPlayerPreferencesFrame::MPlayerPreferencesFrame (QWidget * parent) - : QFrame (parent) { - QVBoxLayout * layout = new QVBoxLayout (this); - table = new QTable (int (MPlayerPreferencesPage::pat_last)+non_patterns, 2, this); +KDE_NO_CDTOR_EXPORT MPlayerPreferencesFrame::MPlayerPreferencesFrame (TQWidget * tqparent) + : TQFrame (tqparent) { + TQVBoxLayout * tqlayout = new TQVBoxLayout (this); + table = new TQTable (int (MPlayerPreferencesPage::pat_last)+non_patterns, 2, this); table->verticalHeader ()->hide (); table->setLeftMargin (0); table->horizontalHeader ()->hide (); @@ -903,14 +903,14 @@ KDE_NO_CDTOR_EXPORT MPlayerPreferencesFrame::MPlayerPreferencesFrame (QWidget * table->setColumnReadOnly (0, true); table->setText (0, 0, i18n ("MPlayer command:")); table->setText (1, 0, i18n ("Additional command line arguments:")); - table->setText (2, 0, QString("%1 (%2)").arg (i18n ("Cache size:")).arg (i18n ("kB"))); // FIXME for new translations - table->setCellWidget (2, 1, new QSpinBox (0, 32767, 32, table->viewport())); + table->setText (2, 0, TQString("%1 (%2)").arg (i18n ("Cache size:")).arg (i18n ("kB"))); // FIXME for new translations + table->setCellWidget (2, 1, new TQSpinBox (0, 32767, 32, table->viewport())); table->setText (3, 0, i18n ("Build new index when possible")); - table->setCellWidget (3, 1, new QCheckBox (table->viewport())); - QWhatsThis::add (table->cellWidget (3, 1), i18n ("Allows seeking in indexed files (AVIs)")); + table->setCellWidget (3, 1, new TQCheckBox (table->viewport())); + TQWhatsThis::add (table->cellWidget (3, 1), i18n ("Allows seeking in indexed files (AVIs)")); for (int i = 0; i < int (MPlayerPreferencesPage::pat_last); i++) table->setText (i+non_patterns, 0, _mplayer_patterns[i].caption); - QFontMetrics metrics (table->font ()); + TQFontMetrics metrics (table->font ()); int first_column_width = 50; for (int i = 0; i < int (MPlayerPreferencesPage::pat_last+non_patterns); i++) { int strwidth = metrics.boundingRect (table->text (i, 0)).width (); @@ -919,7 +919,7 @@ KDE_NO_CDTOR_EXPORT MPlayerPreferencesFrame::MPlayerPreferencesFrame (QWidget * } table->setColumnWidth (0, first_column_width); table->setColumnStretchable (1, true); - layout->addWidget (table); + tqlayout->addWidget (table); } KDE_NO_CDTOR_EXPORT MPlayerPreferencesPage::MPlayerPreferencesPage (MPlayer * p) @@ -930,7 +930,7 @@ KDE_NO_EXPORT void MPlayerPreferencesPage::write (KConfig * config) { config->setGroup (strMPlayerPatternGroup); for (int i = 0; i < int (pat_last); i++) config->writeEntry - (_mplayer_patterns[i].name, m_patterns[i].pattern ()); + (_mplayer_patterns[i].name, TQString(m_patterns[i].pattern ())); config->setGroup (strMPlayerGroup); config->writeEntry (strMPlayerPath, mplayer_path); config->writeEntry (strAddArgs, additionalarguments); @@ -951,9 +951,9 @@ KDE_NO_EXPORT void MPlayerPreferencesPage::read (KConfig * config) { } KDE_NO_EXPORT void MPlayerPreferencesPage::sync (bool fromUI) { - QTable * table = m_configframe->table; - QSpinBox * cacheSize = static_cast<QSpinBox *>(table->cellWidget (2, 1)); - QCheckBox * buildIndex = static_cast<QCheckBox *>(table->cellWidget (3, 1)); + TQTable * table = m_configframe->table; + TQSpinBox * cacheSize = static_cast<TQSpinBox *>(table->cellWidget (2, 1)); + TQCheckBox * buildIndex = static_cast<TQCheckBox *>(table->cellWidget (3, 1)); if (fromUI) { mplayer_path = table->text (0, 1); additionalarguments = table->text (1, 1); @@ -972,14 +972,14 @@ KDE_NO_EXPORT void MPlayerPreferencesPage::sync (bool fromUI) { } } -KDE_NO_EXPORT void MPlayerPreferencesPage::prefLocation (QString & item, QString & icon, QString & tab) { +KDE_NO_EXPORT void MPlayerPreferencesPage::prefLocation (TQString & item, TQString & icon, TQString & tab) { item = i18n ("General Options"); - icon = QString ("kmplayer"); + icon = TQString ("kmplayer"); tab = i18n ("MPlayer"); } -KDE_NO_EXPORT QFrame * MPlayerPreferencesPage::prefPage (QWidget * parent) { - m_configframe = new MPlayerPreferencesFrame (parent); +KDE_NO_EXPORT TQFrame * MPlayerPreferencesPage::prefPage (TQWidget * tqparent) { + m_configframe = new MPlayerPreferencesFrame (tqparent); return m_configframe; } @@ -989,8 +989,8 @@ static const char * mencoder_supports [] = { "dvdsource", "pipesource", "tvscanner", "tvsource", "urlsource", "vcdsource", "audiocdsource", 0L }; -KDE_NO_CDTOR_EXPORT MEncoder::MEncoder (QObject * parent, Settings * settings) - : MPlayerBase (parent, settings, "mencoder") { +KDE_NO_CDTOR_EXPORT MEncoder::MEncoder (TQObject * tqparent, Settings * settings) + : MPlayerBase (tqparent, settings, "mencoder") { m_supported_sources = mencoder_supports; } @@ -1006,29 +1006,29 @@ bool MEncoder::deMediafiedPlay () { initProcess (viewer ()); KURL url (m_url); m_source->setPosition (0); - QString args; + TQString args; m_use_slave = m_source->pipeCmd ().isEmpty (); if (!m_use_slave) - args = m_source->pipeCmd () + QString (" | "); - QString margs = m_settings->mencoderarguments; + args = m_source->pipeCmd () + TQString (" | "); + TQString margs = m_settings->mencoderarguments; if (m_settings->recordcopy) - margs = QString ("-oac copy -ovc copy"); - args += QString ("mencoder ") + margs + ' ' + m_source->recordCmd (); + margs = TQString ("-oac copy -ovc copy"); + args += TQString ("mencoder ") + margs + ' ' + m_source->recordCmd (); // FIXME if (m_player->source () == source) // ugly // m_player->stop (); - QString myurl = url.isLocalFile () ? getPath (url) : url.url (); + TQString myurl = url.isLocalFile () ? getPath (url) : url.url (); bool post090 = m_settings->mplayerpost090; if (!myurl.isEmpty ()) { - if (!post090 && myurl.startsWith (QString ("tv://"))) + if (!post090 && myurl.startsWith (TQString ("tv://"))) ; // skip it - else if (!post090 && myurl.startsWith (QString ("vcd://"))) - args += myurl.replace (0, 6, QString (" -vcd ")); - else if (!post090 && myurl.startsWith (QString ("dvd://"))) - args += myurl.replace (0, 6, QString (" -dvd ")); + else if (!post090 && myurl.startsWith (TQString ("vcd://"))) + args += myurl.tqreplace (0, 6, TQString (" -vcd ")); + else if (!post090 && myurl.startsWith (TQString ("dvd://"))) + args += myurl.tqreplace (0, 6, TQString (" -dvd ")); else - args += ' ' + KProcess::quote (QString (QFile::encodeName (myurl))); + args += ' ' + KProcess::quote (TQString (TQFile::encodeName (myurl))); } - QString outurl = KProcess::quote (QString (QFile::encodeName (m_recordurl.isLocalFile () ? getPath (m_recordurl) : m_recordurl.url ()))); + TQString outurl = KProcess::quote (TQString (TQFile::encodeName (m_recordurl.isLocalFile () ? getPath (m_recordurl) : m_recordurl.url ()))); kdDebug () << args << " -o " << outurl << endl; *m_process << args << " -o " << outurl; m_process->start (KProcess::NotifyOnExit, KProcess::NoCommunication); @@ -1054,8 +1054,8 @@ static const char * mplayerdump_supports [] = { }; KDE_NO_CDTOR_EXPORT -MPlayerDumpstream::MPlayerDumpstream (QObject * parent, Settings * settings) - : MPlayerBase (parent, settings, "mplayerdumpstream") { +MPlayerDumpstream::MPlayerDumpstream (TQObject * tqparent, Settings * settings) + : MPlayerBase (tqparent, settings, "mplayerdumpstream") { m_supported_sources = mplayerdump_supports; } @@ -1071,26 +1071,26 @@ bool MPlayerDumpstream::deMediafiedPlay () { initProcess (viewer ()); KURL url (m_url); m_source->setPosition (0); - QString args; + TQString args; m_use_slave = m_source->pipeCmd ().isEmpty (); if (!m_use_slave) - args = m_source->pipeCmd () + QString (" | "); - args += QString ("mplayer ") + m_source->recordCmd (); + args = m_source->pipeCmd () + TQString (" | "); + args += TQString ("mplayer ") + m_source->recordCmd (); // FIXME if (m_player->source () == source) // ugly // m_player->stop (); - QString myurl = url.isLocalFile () ? getPath (url) : url.url (); + TQString myurl = url.isLocalFile () ? getPath (url) : url.url (); bool post090 = m_settings->mplayerpost090; if (!myurl.isEmpty ()) { - if (!post090 && myurl.startsWith (QString ("tv://"))) + if (!post090 && myurl.startsWith (TQString ("tv://"))) ; // skip it - else if (!post090 && myurl.startsWith (QString ("vcd://"))) - args += myurl.replace (0, 6, QString (" -vcd ")); - else if (!post090 && myurl.startsWith (QString ("dvd://"))) - args += myurl.replace (0, 6, QString (" -dvd ")); + else if (!post090 && myurl.startsWith (TQString ("vcd://"))) + args += myurl.tqreplace (0, 6, TQString (" -vcd ")); + else if (!post090 && myurl.startsWith (TQString ("dvd://"))) + args += myurl.tqreplace (0, 6, TQString (" -dvd ")); else - args += ' ' + KProcess::quote (QString (QFile::encodeName (myurl))); + args += ' ' + KProcess::quote (TQString (TQFile::encodeName (myurl))); } - QString outurl = KProcess::quote (QString (QFile::encodeName (m_recordurl.isLocalFile () ? getPath (m_recordurl) : m_recordurl.url ()))); + TQString outurl = KProcess::quote (TQString (TQFile::encodeName (m_recordurl.isLocalFile () ? getPath (m_recordurl) : m_recordurl.url ()))); kdDebug () << args << " -dumpstream -dumpfile " << outurl << endl; *m_process << args << " -dumpstream -dumpfile " << outurl; m_process->start (KProcess::NotifyOnExit, KProcess::NoCommunication); @@ -1114,11 +1114,11 @@ KDE_NO_EXPORT bool MPlayerDumpstream::stop () { static int callback_counter = 0; Callback::Callback (CallbackProcess * process) - : DCOPObject (QString (QString ("KMPlayerCallback-") + - QString::number (callback_counter++)).ascii ()), + : DCOPObject (TQString (TQString ("KMPlayerCallback-") + + TQString::number (callback_counter++)).ascii ()), m_process (process) {} -void Callback::statusMessage (int code, QString msg) { +void Callback::statusMessage (int code, TQString msg) { if (!m_process->m_source) return; switch ((StatusCode) code) { case stat_newtitle: @@ -1135,14 +1135,14 @@ void Callback::statusMessage (int code, QString msg) { }; } -void Callback::subMrl (QString mrl, QString title) { +void Callback::subMrl (TQString mrl, TQString title) { if (!m_process->m_source) return; m_process->m_source->insertURL (m_process->m_mrl, KURL::fromPathOrURL (mrl).url (), title); if (m_process->m_mrl && m_process->m_mrl->active ()) m_process->m_mrl->defer (); // Xine detected this is a playlist } -void Callback::errorMessage (int code, QString msg) { +void Callback::errorMessage (int code, TQString msg) { m_process->setErrorMessage (code, msg); } @@ -1154,11 +1154,11 @@ void Callback::playing () { m_process->setPlaying (); } -void Callback::started (QCString dcopname, QByteArray data) { +void Callback::started (TQCString dcopname, TQByteArray data) { m_process->setStarted (dcopname, data); } -void Callback::movieParams (int length, int w, int h, float aspect, QStringList alang, QStringList slang) { +void Callback::movieParams (int length, int w, int h, float aspect, TQStringList alang, TQStringList slang) { m_process->setMovieParams (length, w, h, aspect, alang, slang); } @@ -1178,8 +1178,8 @@ void Callback::toggleFullScreen () { //----------------------------------------------------------------------------- -CallbackProcess::CallbackProcess (QObject * parent, Settings * settings, const char * n, const QString & menuname) - : Process (parent, settings, n), +CallbackProcess::CallbackProcess (TQObject * tqparent, Settings * settings, const char * n, const TQString & menuname) + : Process (tqparent, settings, n), m_callback (new Callback (this)), m_backend (0L), m_menuname (menuname), @@ -1196,14 +1196,14 @@ CallbackProcess::~CallbackProcess () { configdoc->document()->dispose (); } -void CallbackProcess::setStatusMessage (const QString & /*msg*/) { +void CallbackProcess::setStatusMessage (const TQString & /*msg*/) { } -QString CallbackProcess::menuName () const { +TQString CallbackProcess::menuName () const { return m_menuname; } -void CallbackProcess::setErrorMessage (int code, const QString & msg) { +void CallbackProcess::setErrorMessage (int code, const TQString & msg) { kdDebug () << "setErrorMessage " << code << " " << msg << endl; if (code == 0 && m_send_config != send_no) { if (m_send_config == send_new) @@ -1220,7 +1220,7 @@ void CallbackProcess::setPlaying () { setState (Playing); } -void CallbackProcess::setStarted (QCString dcopname, QByteArray & data) { +void CallbackProcess::setStarted (TQCString dcopname, TQByteArray & data) { if (data.size ()) m_configdata = data; kdDebug () << "up and running " << dcopname << endl; @@ -1233,8 +1233,8 @@ void CallbackProcess::setStarted (QCString dcopname, QByteArray & data) { m_have_config = data.size () ? config_yes : config_no; if (m_have_config == config_yes) { configdoc = new ConfigDocument (); - QTextStream ts (data, IO_ReadOnly); - readXML (configdoc, ts, QString ()); + TQTextStream ts (data, IO_ReadOnly); + readXML (configdoc, ts, TQString ()); configdoc->normalize (); //kdDebug () << mydoc->innerText () << endl; } @@ -1255,7 +1255,7 @@ void CallbackProcess::setStarted (QCString dcopname, QByteArray & data) { setState (Ready); } -void CallbackProcess::setMovieParams (int len, int w, int h, float a, const QStringList & alang, const QStringList & slang) { +void CallbackProcess::setMovieParams (int len, int w, int h, float a, const TQStringList & alang, const TQStringList & slang) { kdDebug () << "setMovieParams " << len << " " << w << "," << h << " " << a << endl; if (!m_source) return; in_gui_update = true; @@ -1290,7 +1290,7 @@ bool CallbackProcess::getConfigData () { return true; } -void CallbackProcess::setChangedData (const QByteArray & data) { +void CallbackProcess::setChangedData (const TQByteArray & data) { m_changeddata = data; m_send_config = playing () ? send_try : send_new; if (m_send_config == send_try) @@ -1303,18 +1303,18 @@ bool CallbackProcess::deMediafiedPlay () { if (!m_backend) return false; kdDebug () << "CallbackProcess::play " << m_url << endl; - QString u = m_url; + TQString u = m_url; if (u == "tv://" && !m_source->tuner ().isEmpty ()) { u = "v4l:/" + m_source->tuner (); if (m_source->frequency () > 0) - u += QChar ('/') + QString::number (m_source->frequency ()); + u += TQChar ('/') + TQString::number (m_source->frequency ()); } KURL url (u); - QString myurl = url.isLocalFile () ? getPath (url) : url.url (); + TQString myurl = url.isLocalFile () ? getPath (url) : url.url (); m_backend->setURL (myurl); const KURL & sub_url = m_source->subUrl (); if (!sub_url.isEmpty ()) - m_backend->setSubTitleURL (QString (QFile::encodeName (sub_url.isLocalFile () ? QFileInfo (getPath (sub_url)).absFilePath () : sub_url.url ()))); + m_backend->setSubTitleURL (TQString (TQFile::encodeName (sub_url.isLocalFile () ? TQFileInfo (getPath (sub_url)).absFilePath () : sub_url.url ()))); if (m_source->frequency () > 0) m_backend->frequency (m_source->frequency ()); m_backend->play (m_mrl ? m_mrl->mrl ()->repeat : 0); @@ -1346,7 +1346,7 @@ bool CallbackProcess::quit () { #if KDE_IS_VERSION(3, 1, 90) m_process->wait(1); #else - QTime t; + TQTime t; t.start (); do { KProcessController::theKProcessController->waitForProcessExit (2); @@ -1362,12 +1362,12 @@ bool CallbackProcess::pause () { return true; } -void CallbackProcess::setAudioLang (int id, const QString & al) { +void CallbackProcess::setAudioLang (int id, const TQString & al) { if (!m_backend) return; m_backend->setAudioLang (id, al); } -void CallbackProcess::setSubtitle (int id, const QString & sl) { +void CallbackProcess::setSubtitle (int id, const TQString & sl) { if (!m_backend) return; m_backend->setSubtitle (id, sl); } @@ -1418,31 +1418,31 @@ bool CallbackProcess::contrast (int val, bool b) { return !!m_backend; } -QString CallbackProcess::dcopName () { - QString cbname; - cbname.sprintf ("%s/%s", QString (kapp->dcopClient ()->appId ()).ascii (), - QString (m_callback->objId ()).ascii ()); +TQString CallbackProcess::dcopName () { + TQString cbname; + cbname.sprintf ("%s/%s", TQString (kapp->dcopClient ()->appId ()).ascii (), + TQString (m_callback->objId ()).ascii ()); return cbname; } void CallbackProcess::initProcess (Viewer * viewer) { Process::initProcess (viewer); - connect (m_process, SIGNAL (processExited (KProcess *)), - this, SLOT (processStopped (KProcess *))); - connect (m_process, SIGNAL (receivedStdout (KProcess *, char *, int)), - this, SLOT (processOutput (KProcess *, char *, int))); - connect (m_process, SIGNAL (receivedStderr (KProcess *, char *, int)), - this, SLOT (processOutput (KProcess *, char *, int))); + connect (m_process, TQT_SIGNAL (processExited (KProcess *)), + this, TQT_SLOT (processStopped (KProcess *))); + connect (m_process, TQT_SIGNAL (receivedStdout (KProcess *, char *, int)), + this, TQT_SLOT (processOutput (KProcess *, char *, int))); + connect (m_process, TQT_SIGNAL (receivedStderr (KProcess *, char *, int)), + this, TQT_SLOT (processOutput (KProcess *, char *, int))); } KDE_NO_EXPORT void CallbackProcess::processOutput (KProcess *, char * str, int slen) { if (viewer () && slen > 0) - viewer ()->view ()->addText (QString::fromLocal8Bit (str, slen)); + viewer ()->view ()->addText (TQString::fromLocal8Bit (str, slen)); } KDE_NO_EXPORT void CallbackProcess::processStopped (KProcess *) { if (m_source) - ((PlayListNotify *) m_source)->setInfoMessage (QString ()); + ((PlayListNotify *) m_source)->setInfoMessage (TQString ()); delete m_backend; m_backend = 0L; setState (NotRunning); @@ -1459,7 +1459,7 @@ WId CallbackProcess::widget () { //----------------------------------------------------------------------------- KDE_NO_CDTOR_EXPORT ConfigDocument::ConfigDocument () - : Document (QString ()) {} + : Document (TQString ()) {} KDE_NO_CDTOR_EXPORT ConfigDocument::~ConfigDocument () { kdDebug () << "~ConfigDocument" << endl; @@ -1470,53 +1470,53 @@ namespace KMPlayer { * Element for ConfigDocument */ struct KMPLAYER_NO_EXPORT SomeNode : public ConfigNode { - KDE_NO_CDTOR_EXPORT SomeNode (NodePtr & d, const QString & t) + KDE_NO_CDTOR_EXPORT SomeNode (NodePtr & d, const TQString & t) : ConfigNode (d, t) {} KDE_NO_CDTOR_EXPORT ~SomeNode () {} - NodePtr childFromTag (const QString & t); + NodePtr childFromTag (const TQString & t); }; } // namespace -KDE_NO_CDTOR_EXPORT ConfigNode::ConfigNode (NodePtr & d, const QString & t) +KDE_NO_CDTOR_EXPORT ConfigNode::ConfigNode (NodePtr & d, const TQString & t) : DarkNode (d, t), w (0L) {} -NodePtr ConfigDocument::childFromTag (const QString & tag) { - if (tag.lower () == QString ("document")) +NodePtr ConfigDocument::childFromTag (const TQString & tag) { + if (tag.lower () == TQString ("document")) return new ConfigNode (m_doc, tag); return 0L; } -NodePtr ConfigNode::childFromTag (const QString & t) { +NodePtr ConfigNode::childFromTag (const TQString & t) { return new TypeNode (m_doc, t); } -KDE_NO_CDTOR_EXPORT TypeNode::TypeNode (NodePtr & d, const QString & t) +KDE_NO_CDTOR_EXPORT TypeNode::TypeNode (NodePtr & d, const TQString & t) : ConfigNode (d, t), tag (t) {} -NodePtr TypeNode::childFromTag (const QString & tag) { +NodePtr TypeNode::childFromTag (const TQString & tag) { return new SomeNode (m_doc, tag); } -NodePtr SomeNode::childFromTag (const QString & t) { +NodePtr SomeNode::childFromTag (const TQString & t) { return new SomeNode (m_doc, t); } -QWidget * TypeNode::createWidget (QWidget * parent) { - QString type_attr = getAttribute (StringPool::attr_type); +TQWidget * TypeNode::createWidget (TQWidget * tqparent) { + TQString type_attr = getAttribute (StringPool::attr_type); const char * ctype = type_attr.ascii (); - QString value = getAttribute (StringPool::attr_value); + TQString value = getAttribute (StringPool::attr_value); if (!strcmp (ctype, "range")) { - w = new QSlider (getAttribute (QString ("START")).toInt (), + w = new TQSlider (getAttribute (TQString ("START")).toInt (), getAttribute (StringPool::attr_end).toInt (), - 1, value.toInt (), Qt::Horizontal, parent); + 1, value.toInt (), Qt::Horizontal, tqparent); } else if (!strcmp (ctype, "num") || !strcmp (ctype, "string")) { - w = new QLineEdit (value, parent); + w = new TQLineEdit (value, tqparent); } else if (!strcmp (ctype, "bool")) { - QCheckBox * checkbox = new QCheckBox (parent); + TQCheckBox * checkbox = new TQCheckBox (tqparent); checkbox->setChecked (value.toInt ()); w = checkbox; } else if (!strcmp (ctype, "enum")) { - QComboBox * combo = new QComboBox (parent); + TQComboBox * combo = new TQComboBox (tqparent); for (NodePtr e = firstChild (); e; e = e->nextSibling ()) if (e->isElementNode () && !strcmp (e->nodeName (), "item")) combo->insertItem (convertNode <Element> (e)->getAttribute (StringPool::attr_value)); @@ -1528,20 +1528,20 @@ QWidget * TypeNode::createWidget (QWidget * parent) { return w; } -void TypeNode::changedXML (QTextStream & out) { +void TypeNode::changedXML (TQTextStream & out) { if (!w) return; - QString type_attr = getAttribute (StringPool::attr_type); + TQString type_attr = getAttribute (StringPool::attr_type); const char * ctype = type_attr.ascii (); - QString value = getAttribute (StringPool::attr_value); - QString newvalue; + TQString value = getAttribute (StringPool::attr_value); + TQString newvalue; if (!strcmp (ctype, "range")) { - newvalue = QString::number (static_cast <QSlider *> (w)->value ()); + newvalue = TQString::number (static_cast <TQSlider *> (w)->value ()); } else if (!strcmp (ctype, "num") || !strcmp (ctype, "string")) { - newvalue = static_cast <QLineEdit *> (w)->text (); + newvalue = static_cast <TQLineEdit *> (w)->text (); } else if (!strcmp (ctype, "bool")) { - newvalue = QString::number (static_cast <QCheckBox *> (w)->isChecked()); + newvalue = TQString::number (static_cast <TQCheckBox *> (w)->isChecked()); } else if (!strcmp (ctype, "enum")) { - newvalue = QString::number (static_cast<QComboBox *>(w)->currentItem()); + newvalue = TQString::number (static_cast<TQComboBox *>(w)->currentItem()); } else if (!strcmp (ctype, "tree")) { } else kdDebug() << "Unknown type:" << ctype << endl; @@ -1556,13 +1556,13 @@ void TypeNode::changedXML (QTextStream & out) { namespace KMPlayer { -class KMPLAYER_NO_EXPORT XMLPreferencesFrame : public QFrame { +class KMPLAYER_NO_EXPORT XMLPreferencesFrame : public TQFrame { public: - XMLPreferencesFrame (QWidget * parent, CallbackProcess *); + XMLPreferencesFrame (TQWidget * tqparent, CallbackProcess *); KDE_NO_CDTOR_EXPORT ~XMLPreferencesFrame () {} - QTable * table; + TQTable * table; protected: - void showEvent (QShowEvent *); + void showEvent (TQShowEvent *); private: CallbackProcess * m_process; }; @@ -1570,11 +1570,11 @@ private: } // namespace KDE_NO_CDTOR_EXPORT XMLPreferencesFrame::XMLPreferencesFrame -(QWidget * parent, CallbackProcess * p) - : QFrame (parent), m_process (p){ - QVBoxLayout * layout = new QVBoxLayout (this); - table = new QTable (this); - layout->addWidget (table); +(TQWidget * tqparent, CallbackProcess * p) + : TQFrame (tqparent), m_process (p){ + TQVBoxLayout * tqlayout = new TQVBoxLayout (this); + table = new TQTable (this); + tqlayout->addWidget (table); } KDE_NO_CDTOR_EXPORT XMLPreferencesPage::XMLPreferencesPage (CallbackProcess * p) @@ -1584,7 +1584,7 @@ KDE_NO_CDTOR_EXPORT XMLPreferencesPage::XMLPreferencesPage (CallbackProcess * p) KDE_NO_CDTOR_EXPORT XMLPreferencesPage::~XMLPreferencesPage () { } -KDE_NO_EXPORT void XMLPreferencesFrame::showEvent (QShowEvent *) { +KDE_NO_EXPORT void XMLPreferencesFrame::showEvent (TQShowEvent *) { if (!m_process->haveConfig ()) m_process->getConfigData (); } @@ -1597,7 +1597,7 @@ KDE_NO_EXPORT void XMLPreferencesPage::read (KConfig *) { KDE_NO_EXPORT void XMLPreferencesPage::sync (bool fromUI) { if (!m_configframe) return; - QTable * table = m_configframe->table; + TQTable * table = m_configframe->table; int row = 0; if (fromUI) { NodePtr configdoc = m_process->configDocument (); @@ -1608,14 +1608,14 @@ KDE_NO_EXPORT void XMLPreferencesPage::sync (bool fromUI) { kdDebug () << "No valid data" << endl; return; } - QString str; - QTextStream ts (&str, IO_WriteOnly); + TQString str; + TQTextStream ts (&str, IO_WriteOnly); ts << "<document>"; for (NodePtr e = elm->firstChild (); e; e = e->nextSibling ()) convertNode <TypeNode> (e)->changedXML (ts); if (str.length () > 10) { ts << "</document>"; - QByteArray changeddata = QCString (str.ascii ()); + TQByteArray changeddata = TQCString (str.ascii ()); kdDebug () << str << " " << changeddata.size () << str.length () << endl; changeddata.resize (str.length ()); m_process->setChangedData (changeddata); @@ -1627,7 +1627,7 @@ KDE_NO_EXPORT void XMLPreferencesPage::sync (bool fromUI) { if (!configdoc) return; if (m_configframe->table->numCols () < 1) { // not yet created - QString err; + TQString err; int first_column_width = 50; NodePtr elm = configdoc->firstChild (); // document if (!elm || !elm->hasChildNodes ()) { @@ -1642,18 +1642,18 @@ KDE_NO_EXPORT void XMLPreferencesPage::sync (bool fromUI) { table->horizontalHeader ()->hide (); table->setTopMargin (0); table->setColumnReadOnly (0, true); - QFontMetrics metrics (table->font ()); + TQFontMetrics metrics (table->font ()); for (elm=elm->firstChild (); elm; elm=elm->nextSibling (), row++) { TypeNode * tn = convertNode <TypeNode> (elm); - QString name = tn->getAttribute (StringPool::attr_name); + TQString name = tn->getAttribute (StringPool::attr_name); m_configframe->table->setText (row, 0, name); int strwid = metrics.boundingRect (name).width (); if (strwid > first_column_width) first_column_width = strwid + 4; - QWidget * w = tn->createWidget (table->viewport ()); + TQWidget * w = tn->createWidget (table->viewport ()); if (w) { table->setCellWidget (row, 1, w); - QWhatsThis::add (w, elm->innerText ()); + TQWhatsThis::add (w, elm->innerText ()); } else kdDebug () << "No widget for " << name; } @@ -1663,14 +1663,14 @@ KDE_NO_EXPORT void XMLPreferencesPage::sync (bool fromUI) { } } -KDE_NO_EXPORT void XMLPreferencesPage::prefLocation (QString & item, QString & icon, QString & tab) { +KDE_NO_EXPORT void XMLPreferencesPage::prefLocation (TQString & item, TQString & icon, TQString & tab) { item = i18n ("General Options"); - icon = QString ("kmplayer"); + icon = TQString ("kmplayer"); tab = m_process->menuName (); } -KDE_NO_EXPORT QFrame * XMLPreferencesPage::prefPage (QWidget * parent) { - m_configframe = new XMLPreferencesFrame (parent, m_process); +KDE_NO_EXPORT TQFrame * XMLPreferencesPage::prefPage (TQWidget * tqparent) { + m_configframe = new XMLPreferencesFrame (tqparent, m_process); return m_configframe; } @@ -1681,8 +1681,8 @@ static const char * xine_supported [] = { "tvsource", "urlsource", "vcdsource", "audiocdsource", 0L }; -KDE_NO_CDTOR_EXPORT Xine::Xine (QObject * parent, Settings * settings) - : CallbackProcess (parent, settings, "xine", i18n ("&Xine")) { +KDE_NO_CDTOR_EXPORT Xine::Xine (TQObject * tqparent, Settings * settings) + : CallbackProcess (tqparent, settings, "xine", i18n ("&Xine")) { #ifdef HAVE_XINE m_supported_sources = xine_supported; m_settings->addPage (m_configpage); @@ -1694,26 +1694,26 @@ KDE_NO_CDTOR_EXPORT Xine::~Xine () {} bool Xine::ready (Viewer * viewer) { initProcess (viewer); viewer->changeProtocol (QXEmbed::XPLAIN); - QString xine_config = KProcess::quote (QString (QFile::encodeName (locateLocal ("data", "kmplayer/") + QString ("xine_config")))); + TQString xine_config = KProcess::quote (TQString (TQFile::encodeName (locateLocal ("data", "kmplayer/") + TQString ("xine_config")))); m_request_seek = -1; if (m_source && !m_source->pipeCmd ().isEmpty ()) { fprintf (stderr, "%s | ", m_source->pipeCmd ().ascii ()); *m_process << m_source->pipeCmd ().ascii () << " | "; } fprintf (stderr, "kxineplayer -wid %lu", (unsigned long) widget ()); - *m_process << "kxineplayer -wid " << QString::number (widget ()); + *m_process << "kxineplayer -wid " << TQString::number (widget ()); fprintf (stderr, " -f %s", xine_config.ascii ()); *m_process << " -f " << xine_config; - QString strVideoDriver = QString (m_settings->videodrivers[m_settings->videodriver].driver); + TQString strVideoDriver = TQString (m_settings->videodrivers[m_settings->videodriver].driver); if (!strVideoDriver.isEmpty ()) { fprintf (stderr, " -vo %s", strVideoDriver.lower().ascii()); *m_process << " -vo " << strVideoDriver.lower(); } - QString strAudioDriver = QString (m_settings->audiodrivers[m_settings->audiodriver].driver); + TQString strAudioDriver = TQString (m_settings->audiodrivers[m_settings->audiodriver].driver); if (!strAudioDriver.isEmpty ()) { - if (strAudioDriver.startsWith (QString ("alsa"))) - strAudioDriver = QString ("alsa"); + if (strAudioDriver.startsWith (TQString ("alsa"))) + strAudioDriver = TQString ("alsa"); fprintf (stderr, " -ao %s", strAudioDriver.lower().ascii()); *m_process << " -ao " << strAudioDriver.lower(); } @@ -1724,22 +1724,22 @@ bool Xine::ready (Viewer * viewer) { *m_process << " -c"; } if (m_source) - if (m_source->url ().url ().startsWith (QString ("dvd://")) && + if (m_source->url ().url ().startsWith (TQString ("dvd://")) && !m_settings->dvddevice.isEmpty ()) { fprintf (stderr, " -dvd-device %s", m_settings->dvddevice.ascii ()); *m_process << " -dvd-device " << m_settings->dvddevice; - } else if (m_source->url ().url ().startsWith (QString ("vcd://")) && + } else if (m_source->url ().url ().startsWith (TQString ("vcd://")) && !m_settings->vcddevice.isEmpty ()) { fprintf (stderr, " -vcd-device %s", m_settings->vcddevice.ascii ()); *m_process << " -vcd-device " << m_settings->vcddevice; - } else if (m_source->url ().url ().startsWith (QString ("tv://")) && + } else if (m_source->url ().url ().startsWith (TQString ("tv://")) && !m_source->videoDevice ().isEmpty ()) { fprintf (stderr, " -vd %s", m_source->videoDevice ().ascii ()); *m_process << " -vd " << m_source->videoDevice (); } if (!m_recordurl.isEmpty ()) { - QString rf = KProcess::quote ( - QString (QFile::encodeName (getPath (m_recordurl)))); + TQString rf = KProcess::quote ( + TQString (TQFile::encodeName (getPath (m_recordurl)))); fprintf (stderr, " -rec %s", rf.ascii ()); *m_process << " -rec " << rf; } @@ -1757,8 +1757,8 @@ static const char * gst_supported [] = { "exitsource", "introsource", "urlsource", "vcdsource", "audiocdsource", 0L }; -KDE_NO_CDTOR_EXPORT GStreamer::GStreamer (QObject * parent, Settings * settings) - : CallbackProcess (parent, settings, "gstreamer", i18n ("&GStreamer")) { +KDE_NO_CDTOR_EXPORT GStreamer::GStreamer (TQObject * tqparent, Settings * settings) + : CallbackProcess (tqparent, settings, "gstreamer", i18n ("&GStreamer")) { #ifdef HAVE_GSTREAMER m_supported_sources = gst_supported; #endif @@ -1771,28 +1771,28 @@ KDE_NO_EXPORT bool GStreamer::ready (Viewer * viewer) { viewer->changeProtocol (QXEmbed::XPLAIN); m_request_seek = -1; fprintf (stderr, "kgstplayer -wid %lu", (unsigned long) widget ()); - *m_process << "kgstplayer -wid " << QString::number (widget ()); + *m_process << "kgstplayer -wid " << TQString::number (widget ()); - QString strVideoDriver = QString (m_settings->videodrivers[m_settings->videodriver].driver); + TQString strVideoDriver = TQString (m_settings->videodrivers[m_settings->videodriver].driver); if (!strVideoDriver.isEmpty ()) { fprintf (stderr, " -vo %s", strVideoDriver.lower().ascii()); *m_process << " -vo " << strVideoDriver.lower(); } - QString strAudioDriver = QString (m_settings->audiodrivers[m_settings->audiodriver].driver); + TQString strAudioDriver = TQString (m_settings->audiodrivers[m_settings->audiodriver].driver); if (!strAudioDriver.isEmpty ()) { - if (strAudioDriver.startsWith (QString ("alsa"))) - strAudioDriver = QString ("alsa"); + if (strAudioDriver.startsWith (TQString ("alsa"))) + strAudioDriver = TQString ("alsa"); fprintf (stderr, " -ao %s", strAudioDriver.lower().ascii()); *m_process << " -ao " << strAudioDriver.lower(); } fprintf (stderr, " -cb %s", dcopName ().ascii()); *m_process << " -cb " << dcopName (); if (m_source) - if (m_source->url ().url ().startsWith (QString ("dvd://")) && + if (m_source->url ().url ().startsWith (TQString ("dvd://")) && !m_settings->dvddevice.isEmpty ()) { fprintf (stderr, " -dvd-device %s", m_settings->dvddevice.ascii ()); *m_process << " -dvd-device " << m_settings->dvddevice; - } else if (m_source->url ().url ().startsWith (QString ("vcd://")) && + } else if (m_source->url ().url ().startsWith (TQString ("vcd://")) && !m_settings->vcddevice.isEmpty ()) { fprintf (stderr, " -vcd-device %s", m_settings->vcddevice.ascii ()); *m_process << " -vcd-device " << m_settings->vcddevice; @@ -1808,8 +1808,8 @@ static const char * ffmpeg_supports [] = { "tvsource", "urlsource", 0L }; -FFMpeg::FFMpeg (QObject * parent, Settings * settings) - : Process (parent, settings, "ffmpeg") { +FFMpeg::FFMpeg (TQObject * tqparent, Settings * settings) + : Process (tqparent, settings, "ffmpeg") { m_supported_sources = ffmpeg_supports; } @@ -1822,41 +1822,41 @@ KDE_NO_EXPORT void FFMpeg::init () { bool FFMpeg::deMediafiedPlay () { initProcess (viewer ()); KURL url (m_url); - connect (m_process, SIGNAL (processExited (KProcess *)), - this, SLOT (processStopped (KProcess *))); - QString outurl = QString (QFile::encodeName (m_recordurl.isLocalFile () ? getPath (m_recordurl) : m_recordurl.url ())); + connect (m_process, TQT_SIGNAL (processExited (KProcess *)), + this, TQT_SLOT (processStopped (KProcess *))); + TQString outurl = TQString (TQFile::encodeName (m_recordurl.isLocalFile () ? getPath (m_recordurl) : m_recordurl.url ())); if (m_recordurl.isLocalFile ()) - QFile (outurl).remove (); - QString cmd ("ffmpeg "); + TQFile (outurl).remove (); + TQString cmd ("ffmpeg "); if (!m_source->videoDevice ().isEmpty () || !m_source->audioDevice ().isEmpty ()) { if (!m_source->videoDevice ().isEmpty ()) - cmd += QString ("-vd ") + m_source->videoDevice (); + cmd += TQString ("-vd ") + m_source->videoDevice (); else - cmd += QString ("-vn"); + cmd += TQString ("-vn"); if (!m_source->audioDevice ().isEmpty ()) - cmd += QString (" -ad ") + m_source->audioDevice (); + cmd += TQString (" -ad ") + m_source->audioDevice (); else - cmd += QString (" -an"); + cmd += TQString (" -an"); KProcess process; process.setUseShell (true); if (!m_source->videoNorm ().isEmpty ()) { process << "v4lctl -c " << m_source->videoDevice () << " setnorm " << m_source->videoNorm (); kdDebug () << "v4lctl -c " << m_source->videoDevice () << " setnorm " << m_source->videoNorm () << endl; process.start (KProcess::Block); - cmd += QString (" -tvstd ") + m_source->videoNorm (); + cmd += TQString (" -tvstd ") + m_source->videoNorm (); } if (m_source->frequency () > 0) { process.clearArguments(); - process << "v4lctl -c " << m_source->videoDevice () << " setfreq " << QString::number (m_source->frequency ()); + process << "v4lctl -c " << m_source->videoDevice () << " setfreq " << TQString::number (m_source->frequency ()); kdDebug () << "v4lctl -c " << m_source->videoDevice () << " setfreq " << m_source->frequency () << endl; process.start (KProcess::Block); } } else { - cmd += QString ("-i ") + KProcess::quote (QString (QFile::encodeName (url.isLocalFile () ? getPath (url) : url.url ()))); + cmd += TQString ("-i ") + KProcess::quote (TQString (TQFile::encodeName (url.isLocalFile () ? getPath (url) : url.url ()))); } - cmd += QChar (' ') + m_settings->ffmpegarguments; - cmd += QChar (' ') + KProcess::quote (QString (QFile::encodeName (outurl))); + cmd += TQChar (' ') + m_settings->ffmpegarguments; + cmd += TQChar (' ') + KProcess::quote (TQString (TQFile::encodeName (outurl))); fprintf (stderr, "%s\n", (const char *) cmd.local8Bit ()); *m_process << cmd; // FIXME if (m_player->source () == source) // ugly @@ -1878,7 +1878,7 @@ KDE_NO_EXPORT bool FFMpeg::stop () { KDE_NO_EXPORT bool FFMpeg::quit () { stop (); if (!playing ()) return true; - QTime t; + TQTime t; t.start (); do { KProcessController::theKProcessController->waitForProcessExit (2); @@ -1927,7 +1927,7 @@ dbusFilter (DBusConnection *conn, DBusMessage *msg, void *data) { if (dbus_message_has_destination (msg, process->destination ().ascii ()) && dbus_message_has_interface (msg, iface) && - QString (path).startsWith(process->objectPath ())) + TQString (path).startsWith(process->objectPath ())) { //kdDebug () << "dbusFilter " << sender << // " iface:" << dbus_message_get_interface (msg) << @@ -1936,15 +1936,15 @@ dbusFilter (DBusConnection *conn, DBusMessage *msg, void *data) { if (dbus_message_is_method_call (msg, iface, "getUrl")) { char *param = 0; - QString url, target; + TQString url, target; if (dbus_message_iter_init (msg, &args) && DBUS_TYPE_STRING == dbus_message_iter_get_arg_type(&args)) { dbus_message_iter_get_basic (&args, ¶m); - url = QString::fromLocal8Bit (param); + url = TQString::fromLocal8Bit (param); if (dbus_message_iter_next (&args) && DBUS_TYPE_STRING==dbus_message_iter_get_arg_type(&args)) { dbus_message_iter_get_basic (&args, ¶m); - target = QString::fromLocal8Bit (param); + target = TQString::fromLocal8Bit (param); } process->requestStream (path, url, target); } @@ -1955,7 +1955,7 @@ dbusFilter (DBusConnection *conn, DBusMessage *msg, void *data) { if (dbus_message_iter_init (msg, &args) && DBUS_TYPE_STRING == dbus_message_iter_get_arg_type(&args)) { dbus_message_iter_get_basic (&args, ¶m); - QString r = process->evaluateScript (QString::fromUtf8 (param)); + TQString r = process->evaluateScript (TQString::fromUtf8 (param)); DBusMessage * rmsg = dbus_message_new_method_return (msg); char *res = strdup (r.utf8 ().data ()); //kdDebug () << "evaluate => " << res << endl; @@ -1969,7 +1969,7 @@ dbusFilter (DBusConnection *conn, DBusMessage *msg, void *data) { } } else if (dbus_message_is_method_call (msg, iface, "destroy")) { - QString stream =QString(path).mid(process->objectPath().length()+1); + TQString stream =TQString(path).mid(process->objectPath().length()+1); process->destroyStream (stream); } else if (dbus_message_is_method_call (msg, iface, "running")) { @@ -1977,13 +1977,13 @@ dbusFilter (DBusConnection *conn, DBusMessage *msg, void *data) { if (dbus_message_iter_init (msg, &args) && DBUS_TYPE_STRING == dbus_message_iter_get_arg_type(&args)) { dbus_message_iter_get_basic (&args, ¶m); - process->setStarted (QString (param)); + process->setStarted (TQString (param)); } } else if (dbus_message_is_method_call (msg, iface, "plugged")) { process->viewer ()->view ()->videoStart (); } else if (dbus_message_is_method_call (msg, iface, "dimension")) { - Q_UINT32 w, h; + TQ_UINT32 w, h; if (dbus_message_iter_init (msg, &args) && DBUS_TYPE_UINT32 == dbus_message_iter_get_arg_type(&args)) { dbus_message_iter_get_basic (&args, &w); @@ -2001,8 +2001,8 @@ dbusFilter (DBusConnection *conn, DBusMessage *msg, void *data) { } KDE_NO_CDTOR_EXPORT -NpStream::NpStream (QObject *p, Q_UINT32 sid, const KURL & u) - : QObject (p), +NpStream::NpStream (TQObject *p, TQ_UINT32 sid, const KURL & u) + : TQObject (p), url (u), job (0L), bytes (0), content_length (0), stream_id (sid), @@ -2017,10 +2017,10 @@ KDE_NO_CDTOR_EXPORT NpStream::~NpStream () { KDE_NO_EXPORT void NpStream::open () { kdDebug () << "NpStream " << stream_id << " open " << url.url () << endl; if (url.url().startsWith ("javascript:")) { - NpPlayer *npp = static_cast <NpPlayer *> (parent ()); - QString result = npp->evaluateScript (url.url().mid (11)); + NpPlayer *npp = static_cast <NpPlayer *> (tqparent ()); + TQString result = npp->evaluateScript (url.url().mid (11)); if (!result.isEmpty ()) { - QCString cr = result.local8Bit (); + TQCString cr = result.local8Bit (); int len = cr.length (); pending_buf.resize (len + 1); memcpy (pending_buf.data (), cr.data (), len); @@ -2033,16 +2033,16 @@ KDE_NO_EXPORT void NpStream::open () { } else { job = KIO::get (url, false, false); job->addMetaData ("errorPage", "false"); - connect (job, SIGNAL (data (KIO::Job *, const QByteArray &)), - this, SLOT (slotData (KIO::Job *, const QByteArray &))); - connect (job, SIGNAL (result (KIO::Job *)), - this, SLOT (slotResult (KIO::Job *))); - connect (job, SIGNAL (redirection (KIO::Job *, const KURL &)), - this, SLOT (redirection (KIO::Job *, const KURL &))); - connect (job, SIGNAL (mimetype (KIO::Job *, const QString &)), - SLOT (slotMimetype (KIO::Job *, const QString &))); - connect (job, SIGNAL (totalSize (KIO::Job *, KIO::filesize_t)), - SLOT (slotTotalSize (KIO::Job *, KIO::filesize_t))); + connect (job, TQT_SIGNAL (data (KIO::Job *, const TQByteArray &)), + this, TQT_SLOT (slotData (KIO::Job *, const TQByteArray &))); + connect (job, TQT_SIGNAL (result (KIO::Job *)), + this, TQT_SLOT (slotResult (KIO::Job *))); + connect (job, TQT_SIGNAL (redirection (KIO::Job *, const KURL &)), + this, TQT_SLOT (redirection (KIO::Job *, const KURL &))); + connect (job, TQT_SIGNAL (mimetype (KIO::Job *, const TQString &)), + TQT_SLOT (slotMimetype (KIO::Job *, const TQString &))); + connect (job, TQT_SIGNAL (totalSize (KIO::Job *, KIO::filesize_t)), + TQT_SLOT (slotTotalSize (KIO::Job *, KIO::filesize_t))); } } @@ -2062,7 +2062,7 @@ KDE_NO_EXPORT void NpStream::slotResult (KIO::Job *jb) { emit stateChanged (); } -KDE_NO_EXPORT void NpStream::slotData (KIO::Job*, const QByteArray& qb) { +KDE_NO_EXPORT void NpStream::slotData (KIO::Job*, const TQByteArray& qb) { pending_buf = qb; // we suspend job, so qb should be valid until resume if (qb.size()) { job->suspend (); @@ -2076,7 +2076,7 @@ KDE_NO_EXPORT void NpStream::redirection (KIO::Job *, const KURL &u) { emit redirected (stream_id, url); } -void NpStream::slotMimetype (KIO::Job *, const QString &mime) { +void NpStream::slotMimetype (KIO::Job *, const TQString &mime) { mimetype = mime; } @@ -2089,8 +2089,8 @@ static const char * npplayer_supports [] = { }; KDE_NO_CDTOR_EXPORT -NpPlayer::NpPlayer (QObject * parent, Settings * settings, const QString & srv) - : Process (parent, settings, "npp"), +NpPlayer::NpPlayer (TQObject * tqparent, Settings * settings, const TQString & srv) + : Process (tqparent, settings, "npp"), service (srv), write_in_progress (false) { m_supported_sources = npplayer_supports; @@ -2116,22 +2116,22 @@ KDE_NO_EXPORT void NpPlayer::init () { KDE_NO_EXPORT void NpPlayer::initProcess (Viewer * viewer) { Process::initProcess (viewer); - connect (m_process, SIGNAL (processExited (KProcess *)), - this, SLOT (processStopped (KProcess *))); - connect (m_process, SIGNAL (receivedStdout (KProcess *, char *, int)), - this, SLOT (processOutput (KProcess *, char *, int))); - connect (m_process, SIGNAL (receivedStderr (KProcess *, char *, int)), - this, SLOT (processOutput (KProcess *, char *, int))); - connect (m_process, SIGNAL (wroteStdin (KProcess *)), - this, SLOT (wroteStdin (KProcess *))); + connect (m_process, TQT_SIGNAL (processExited (KProcess *)), + this, TQT_SLOT (processStopped (KProcess *))); + connect (m_process, TQT_SIGNAL (receivedStdout (KProcess *, char *, int)), + this, TQT_SLOT (processOutput (KProcess *, char *, int))); + connect (m_process, TQT_SIGNAL (receivedStderr (KProcess *, char *, int)), + this, TQT_SLOT (processOutput (KProcess *, char *, int))); + connect (m_process, TQT_SIGNAL (wroteStdin (KProcess *)), + this, TQT_SLOT (wroteStdin (KProcess *))); if (!dbus_static) dbus_static = dbus_static_deleter.setObject (new DBusStatic ()); if (iface.isEmpty ()) { DBusError dberr; - iface = QString ("org.kde.kmplayer.callback"); + iface = TQString ("org.kde.kmplayer.callback"); static int count = 0; - path = QString ("/npplayer%1").arg (count++); - filter = QString ("type='method_call',interface='org.kde.kmplayer.callback'"); + path = TQString ("/npplayer%1").arg (count++); + filter = TQString ("type='method_call',interface='org.kde.kmplayer.callback'"); dbus_error_init (&dberr); DBusConnection *conn = dbus_bus_get (DBUS_BUS_SESSION, &dberr); @@ -2152,7 +2152,7 @@ KDE_NO_EXPORT void NpPlayer::initProcess (Viewer * viewer) { } } if (!has_service) // plugin, accept what-is [sic] - service = QString (dbus_bus_get_unique_name (conn)); + service = TQString (dbus_bus_get_unique_name (conn)); kdDebug() << "using service " << service << " interface " << iface << endl; dbus_bus_add_match (conn, filter.ascii(), &dberr); if (dbus_error_is_set (&dberr)) { @@ -2170,8 +2170,8 @@ KDE_NO_EXPORT bool NpPlayer::deMediafiedPlay () { // if we change from XPLAIN to XEMBED, the DestroyNotify may come later viewer ()->changeProtocol (QXEmbed::XEMBED); if (m_mrl && !m_url.isEmpty () && dbus_static->dbus_connnection) { - QString mime = "text/plain"; - QString plugin; + TQString mime = "text/plain"; + TQString plugin; Element *elm = m_mrl->mrl (); if (elm->id == id_node_html_object) { // this sucks to have to do this here .. @@ -2181,7 +2181,7 @@ KDE_NO_EXPORT bool NpPlayer::deMediafiedPlay () { break; } } - for (NodePtr n = m_mrl; n; n = n->parentNode ()) { + for (NodePtr n = m_mrl; n; n = n->tqparentNode ()) { Mrl *mrl = n->mrl (); if (mrl && m_base_url.isEmpty ()) m_base_url = mrl->getAttribute ("pluginbaseurl"); @@ -2255,39 +2255,39 @@ KDE_NO_EXPORT bool NpPlayer::ready (Viewer * viewer) { initProcess (viewer); viewer->changeProtocol (QXEmbed::XEMBED); kdDebug() << "NpPlayer::ready" << endl; - QString cmd ("knpplayer"); - cmd += QString (" -cb "); + TQString cmd ("knpplayer"); + cmd += TQString (" -cb "); cmd += service; cmd += path; - cmd += QString (" -wid "); - cmd += QString::number (viewer->winId ()); + cmd += TQString (" -wid "); + cmd += TQString::number (viewer->winId ()); fprintf (stderr, "%s\n", cmd.local8Bit ().data ()); *m_process << cmd; m_process->start (KProcess::NotifyOnExit, KProcess::All); return m_process->isRunning (); } -KDE_NO_EXPORT void NpPlayer::setStarted (const QString & srv) { +KDE_NO_EXPORT void NpPlayer::setStarted (const TQString & srv) { remote_service = srv; kdDebug () << "NpPlayer::setStarted " << srv << endl; setState (Ready); } -KDE_NO_EXPORT QString NpPlayer::evaluateScript (const QString & script) { - QString result; +KDE_NO_EXPORT TQString NpPlayer::evaluateScript (const TQString & script) { + TQString result; emit evaluate (script, result); //kdDebug () << "evaluateScript " << script << " => " << result << endl; return result; } -static int getStreamId (const QString &path) { - int p = path.findRev (QChar ('_')); +static int getStreamId (const TQString &path) { + int p = path.tqfindRev (TQChar ('_')); if (p < 0) { kdError() << "wrong object path " << path << endl; return -1; } bool ok; - Q_UINT32 sid = path.mid (p+1).toInt (&ok); + TQ_UINT32 sid = path.mid (p+1).toInt (&ok); if (!ok) { kdError() << "wrong object path suffix " << path.mid (p+1) << endl; return -1; @@ -2296,15 +2296,15 @@ static int getStreamId (const QString &path) { } KDE_NO_EXPORT -void NpPlayer::requestStream (const QString &path, const QString & url, const QString & target) { +void NpPlayer::requestStream (const TQString &path, const TQString & url, const TQString & target) { KURL uri (m_base_url.isEmpty () ? m_url : m_base_url, url); kdDebug () << "NpPlayer::request " << path << " '" << uri << "'" << endl; - Q_UINT32 sid = getStreamId (path); + TQ_UINT32 sid = getStreamId (path); if (sid >= 0) { if (!target.isEmpty ()) { kdDebug () << "new page request " << target << endl; if (url.startsWith ("javascript:")) { - QString result = evaluateScript (url.mid (11)); + TQString result = evaluateScript (url.mid (11)); kdDebug() << "result is " << result << endl; if (result == "undefined") uri = KURL (); @@ -2316,8 +2316,8 @@ void NpPlayer::requestStream (const QString &path, const QString & url, const QS sendFinish (sid, 0, NpStream::BecauseDone); } else { NpStream * ns = new NpStream (this, sid, uri); - connect (ns, SIGNAL (stateChanged ()), - this, SLOT (streamStateChanged ())); + connect (ns, TQT_SIGNAL (stateChanged ()), + this, TQT_SLOT (streamStateChanged ())); streams[sid] = ns; if (url != uri.url ()) streamRedirected (sid, uri.url ()); @@ -2327,10 +2327,10 @@ void NpPlayer::requestStream (const QString &path, const QString & url, const QS } } -KDE_NO_EXPORT void NpPlayer::destroyStream (const QString &s) { +KDE_NO_EXPORT void NpPlayer::destroyStream (const TQString &s) { int sid = getStreamId (s); - if (sid >= 0 && streams.contains ((Q_UINT32) sid)) { - NpStream *ns = streams[(Q_UINT32) sid]; + if (sid >= 0 && streams.tqcontains ((TQ_UINT32) sid)) { + NpStream *ns = streams[(TQ_UINT32) sid]; ns->close (); if (!write_in_progress) processStreams (); @@ -2340,10 +2340,10 @@ KDE_NO_EXPORT void NpPlayer::destroyStream (const QString &s) { } KDE_NO_EXPORT -void NpPlayer::sendFinish (Q_UINT32 sid, Q_UINT32 bytes, NpStream::Reason because) { +void NpPlayer::sendFinish (TQ_UINT32 sid, TQ_UINT32 bytes, NpStream::Reason because) { if (playing () && dbus_static->dbus_connnection) { - Q_UINT32 reason = (int) because; - QString objpath = QString ("/plugin/stream_%1").arg (sid); + TQ_UINT32 reason = (int) because; + TQString objpath = TQString ("/plugin/stream_%1").arg (sid); DBusMessage *msg = dbus_message_new_method_call ( remote_service.ascii(), objpath.ascii (), @@ -2389,7 +2389,7 @@ KDE_NO_EXPORT bool NpPlayer::stop () { KDE_NO_EXPORT bool NpPlayer::quit () { if (playing ()) { stop (); - QTime t; + TQTime t; t.start (); do { KProcessController::theKProcessController->waitForProcessExit (2); @@ -2401,13 +2401,13 @@ KDE_NO_EXPORT bool NpPlayer::quit () { KDE_NO_EXPORT void NpPlayer::processOutput (KProcess *, char * str, int slen) { if (viewer () && slen > 0) - viewer ()->view ()->addText (QString::fromLocal8Bit (str, slen)); + viewer ()->view ()->addText (TQString::fromLocal8Bit (str, slen)); } KDE_NO_EXPORT void NpPlayer::processStopped (KProcess *) { terminateJobs (); if (m_source) - ((PlayListNotify *) m_source)->setInfoMessage (QString ()); + ((PlayListNotify *) m_source)->setInfoMessage (TQString ()); setState (NotRunning); } @@ -2417,11 +2417,11 @@ KDE_NO_EXPORT void NpPlayer::streamStateChanged () { processStreams (); } -KDE_NO_EXPORT void NpPlayer::streamRedirected (Q_UINT32 sid, const KURL &u) { +KDE_NO_EXPORT void NpPlayer::streamRedirected (TQ_UINT32 sid, const KURL &u) { if (playing () && dbus_static->dbus_connnection) { kdDebug() << "redirected " << sid << " to " << u.url() << endl; char *cu = strdup (u.url ().local8Bit().data ()); - QString objpath = QString ("/plugin/stream_%1").arg (sid); + TQString objpath = TQString ("/plugin/stream_%1").arg (sid); DBusMessage *msg = dbus_message_new_method_call ( remote_service.ascii(), objpath.ascii (), @@ -2438,7 +2438,7 @@ KDE_NO_EXPORT void NpPlayer::streamRedirected (Q_UINT32 sid, const KURL &u) { KDE_NO_EXPORT void NpPlayer::processStreams () { NpStream *stream = 0L; - Q_UINT32 stream_id; + TQ_UINT32 stream_id; timeval tv = { 0x7fffffff, 0 }; const StreamMap::iterator e = streams.end (); int active_count = 0; @@ -2453,8 +2453,8 @@ KDE_NO_EXPORT void NpPlayer::processStreams () { ns->open (); write_in_progress = false; if (ns->job) { - connect (ns, SIGNAL (redirected (Q_UINT32, const KURL&)), - this, SLOT (streamRedirected (Q_UINT32, const KURL&))); + connect (ns, TQT_SIGNAL (redirected (TQ_UINT32, const KURL&)), + this, TQT_SLOT (streamRedirected (TQ_UINT32, const KURL&))); active_count++; } } @@ -2488,7 +2488,7 @@ KDE_NO_EXPORT void NpPlayer::processStreams () { char *mt = strdup (stream->mimetype.isEmpty () ? "" : stream->mimetype.utf8 ().data ()); - QString objpath=QString("/plugin/stream_%1").arg(stream->stream_id); + TQString objpath=TQString("/plugin/stream_%1").tqarg(stream->stream_id); DBusMessage *msg = dbus_message_new_method_call ( remote_service.ascii(), objpath.ascii (), @@ -2504,13 +2504,13 @@ KDE_NO_EXPORT void NpPlayer::processStreams () { dbus_connection_flush (dbus_static->dbus_connnection); free (mt); } - const int header_len = 2 * sizeof (Q_UINT32); - Q_UINT32 chunk = stream->pending_buf.size(); + const int header_len = 2 * sizeof (TQ_UINT32); + TQ_UINT32 chunk = stream->pending_buf.size(); send_buf.resize (chunk + header_len); - memcpy (send_buf.data (), &stream_id, sizeof (Q_UINT32)); - memcpy (send_buf.data() + sizeof (Q_UINT32), &chunk, sizeof (Q_UINT32)); + memcpy (send_buf.data (), &stream_id, sizeof (TQ_UINT32)); + memcpy (send_buf.data() + sizeof (TQ_UINT32), &chunk, sizeof (TQ_UINT32)); memcpy (send_buf.data()+header_len, stream->pending_buf.data (), chunk); - stream->pending_buf = QByteArray (); + stream->pending_buf = TQByteArray (); /*fprintf (stderr, " => %d %d\n", (long)stream_id, chunk);*/ stream->bytes += chunk; write_in_progress = true; @@ -2526,32 +2526,32 @@ KDE_NO_EXPORT void NpPlayer::wroteStdin (KProcess *) { processStreams (); } -KDE_NO_EXPORT QString NpPlayer::menuName () const { +KDE_NO_EXPORT TQString NpPlayer::menuName () const { return i18n ("&Ice Ape"); } #else KDE_NO_CDTOR_EXPORT -NpStream::NpStream (QObject *p, Q_UINT32, const KURL & url) - : QObject (p) {} +NpStream::NpStream (TQObject *p, TQ_UINT32, const KURL & url) + : TQObject (p) {} KDE_NO_CDTOR_EXPORT NpStream::~NpStream () {} void NpStream::slotResult (KIO::Job*) {} -void NpStream::slotData (KIO::Job*, const QByteArray&) {} +void NpStream::slotData (KIO::Job*, const TQByteArray&) {} void NpStream::redirection (KIO::Job *, const KURL &) {} -void NpStream::slotMimetype (KIO::Job *, const QString &) {} +void NpStream::slotMimetype (KIO::Job *, const TQString &) {} void NpStream::slotTotalSize (KIO::Job *, KIO::filesize_t) {} KDE_NO_CDTOR_EXPORT -NpPlayer::NpPlayer (QObject * parent, Settings * settings, const QString &) - : Process (parent, settings, "npp") {} +NpPlayer::NpPlayer (TQObject * tqparent, Settings * settings, const TQString &) + : Process (tqparent, settings, "npp") {} KDE_NO_CDTOR_EXPORT NpPlayer::~NpPlayer () {} KDE_NO_EXPORT void NpPlayer::init () {} KDE_NO_EXPORT bool NpPlayer::deMediafiedPlay () { return false; } KDE_NO_EXPORT void NpPlayer::initProcess (Viewer *) {} -KDE_NO_EXPORT QString NpPlayer::menuName () const { return QString (); } -KDE_NO_EXPORT void NpPlayer::setStarted (const QString &) {} +KDE_NO_EXPORT TQString NpPlayer::menuName () const { return TQString (); } +KDE_NO_EXPORT void NpPlayer::setStarted (const TQString &) {} KDE_NO_EXPORT bool NpPlayer::stop () { return false; } KDE_NO_EXPORT bool NpPlayer::quit () { return false; } KDE_NO_EXPORT bool NpPlayer::ready (Viewer *) { return false; } @@ -2559,7 +2559,7 @@ KDE_NO_EXPORT void NpPlayer::processOutput (KProcess *, char *, int) {} KDE_NO_EXPORT void NpPlayer::processStopped (KProcess *) {} KDE_NO_EXPORT void NpPlayer::wroteStdin (KProcess *) {} KDE_NO_EXPORT void NpPlayer::streamStateChanged () {} -KDE_NO_EXPORT void NpPlayer::streamRedirected (Q_UINT32, const KURL &) {} +KDE_NO_EXPORT void NpPlayer::streamRedirected (TQ_UINT32, const KURL &) {} KDE_NO_EXPORT void NpPlayer::terminateJobs () {} #endif |