diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-30 06:10:56 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-30 06:10:56 +0000 |
commit | 769e63d24adf5c844137484f06a972fcce732d6a (patch) | |
tree | 5185797dcb3ff4b1b3cb71d367123bf89eb2410f /src/kmplayer_part.cpp | |
parent | 0a8af92185eac74d48da1225e6053a0d66c078f5 (diff) | |
download | kmplayer-769e63d24adf5c844137484f06a972fcce732d6a.tar.gz kmplayer-769e63d24adf5c844137484f06a972fcce732d6a.zip |
TQt4 port kmplayer
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kmplayer@1238840 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/kmplayer_part.cpp')
-rw-r--r-- | src/kmplayer_part.cpp | 316 |
1 files changed, 158 insertions, 158 deletions
diff --git a/src/kmplayer_part.cpp b/src/kmplayer_part.cpp index 74698b9..0064f41 100644 --- a/src/kmplayer_part.cpp +++ b/src/kmplayer_part.cpp @@ -23,10 +23,10 @@ #include <algorithm> #include <config.h> -#include <qpopupmenu.h> -#include <qtimer.h> -#include <qpushbutton.h> -#include <qslider.h> +#include <tqpopupmenu.h> +#include <tqtimer.h> +#include <tqpushbutton.h> +#include <tqslider.h> class KXMLGUIClient; // workaround for kde3.3 on sarge with gcc4, kactioncollection.h does not forward declare KXMLGUIClient #include <klibloader.h> @@ -72,17 +72,17 @@ KDE_NO_CDTOR_EXPORT KMPlayerPartStatic::~KMPlayerPartStatic () { struct KMPLAYER_NO_EXPORT GroupPredicate { const KMPlayerPart * m_part; - const QString & m_group; + const TQString & m_group; bool m_get_any; - GroupPredicate(const KMPlayerPart *part, const QString &group, bool b=false) + GroupPredicate(const KMPlayerPart *part, const TQString &group, bool b=false) : m_part (part), m_group (group), m_get_any (b) {} bool operator () (const KMPlayerPart * part) const { return ((m_get_any && part != m_part && !part->master () && !part->url ().isEmpty ()) || (m_part->allowRedir (part->m_docbase) && (part->m_group == m_group || - part->m_group == QString::fromLatin1("_master") || - m_group == QString::fromLatin1("_master")) && + part->m_group == TQString::tqfromLatin1("_master") || + m_group == TQString::tqfromLatin1("_master")) && (part->m_features & KMPlayerPart::Feat_Viewer) != (m_part->m_features & KMPlayerPart::Feat_Viewer))); } @@ -97,9 +97,9 @@ public: KMPlayerFactory (); virtual ~KMPlayerFactory (); virtual KParts::Part *createPartObject - (QWidget *wparent, const char *wname, - QObject *parent, const char *name, - const char *className, const QStringList &args); + (TQWidget *wtqparent, const char *wname, + TQObject *tqparent, const char *name, + const char *className, const TQStringList &args); static KInstance * instance () { return s_instance; } private: static KInstance * s_instance; @@ -118,27 +118,27 @@ KDE_NO_CDTOR_EXPORT KMPlayerFactory::~KMPlayerFactory () { } KDE_NO_EXPORT KParts::Part *KMPlayerFactory::createPartObject - (QWidget *wparent, const char *wname, - QObject *parent, const char * name, - const char * cls, const QStringList & args) { + (TQWidget *wtqparent, const char *wname, + TQObject *tqparent, const char * name, + const char * cls, const TQStringList & args) { kdDebug() << "KMPlayerFactory::createPartObject " << cls << endl; - return new KMPlayerPart (wparent, wname, parent, name, args); + return new KMPlayerPart (wtqparent, wname, tqparent, name, args); } //----------------------------------------------------------------------------- -static bool getBoolValue (const QString & value) { - return (value.lower() != QString::fromLatin1("false") && - value.lower() != QString::fromLatin1("off") && - value.lower() != QString::fromLatin1("0")); +static bool getBoolValue (const TQString & value) { + return (value.lower() != TQString::tqfromLatin1("false") && + value.lower() != TQString::tqfromLatin1("off") && + value.lower() != TQString::tqfromLatin1("0")); } #define SET_FEAT_ON(f) { m_features |= f; turned_off_features &= ~f; } #define SET_FEAT_OFF(f) { m_features &= ~f; turned_off_features |= f; } -KDE_NO_CDTOR_EXPORT KMPlayerPart::KMPlayerPart (QWidget * wparent, const char *wname, - QObject * parent, const char *name, const QStringList &args) - : PartBase (wparent, wname, parent, name, new KConfig ("kmplayerrc")), +KDE_NO_CDTOR_EXPORT KMPlayerPart::KMPlayerPart (TQWidget * wtqparent, const char *wname, + TQObject * tqparent, const char *name, const TQStringList &args) + : PartBase (wtqparent, wname, tqparent, name, new KConfig ("kmplayerrc")), m_master (0L), m_browserextension (new KMPlayerBrowserExtension (this)), m_liveconnectextension (new KMPlayerLiveConnectExtension (this)), @@ -154,27 +154,27 @@ KDE_NO_CDTOR_EXPORT KMPlayerPart::KMPlayerPart (QWidget * wparent, const char *w m_sources ["hrefsource"] = (new KMPlayerHRefSource (this)); #ifdef HAVE_NSPR KMPlayer::NpPlayer *npp = (KMPlayer::NpPlayer *) players () ["npp"]; - connect (npp, SIGNAL (evaluate (const QString &, QString &)), - m_liveconnectextension, SLOT (evaluate (const QString &, QString &))); - connect (npp, SIGNAL (openUrl (const KURL &, const QString &)), + connect (npp, TQT_SIGNAL (evaluate (const TQString &, TQString &)), + m_liveconnectextension, TQT_SLOT (evaluate (const TQString &, TQString &))); + connect (npp, TQT_SIGNAL (openUrl (const KURL &, const TQString &)), m_browserextension, - SLOT (slotRequestOpenURL (const KURL &, const QString &))); + TQT_SLOT (slotRequestOpenURL (const KURL &, const TQString &))); #endif - /*KAction *playact =*/ new KAction(i18n("P&lay"), QString ("player_play"), KShortcut (), this, SLOT(play ()), actionCollection (), "play"); - /*KAction *pauseact =*/ new KAction(i18n("&Pause"), QString ("player_pause"), KShortcut (), this, SLOT(pause ()), actionCollection (), "pause"); - /*KAction *stopact =*/ new KAction(i18n("&Stop"), QString ("player_stop"), KShortcut (), this, SLOT(stop ()), actionCollection (), "stop"); - new KAction (i18n ("Increase Volume"), QString ("player_volume"), KShortcut (), this, SLOT (increaseVolume ()), actionCollection (), "edit_volume_up"); - new KAction (i18n ("Decrease Volume"), QString ("player_volume"), KShortcut (), this, SLOT (decreaseVolume ()), actionCollection (), "edit_volume_down"); + /*KAction *playact =*/ new KAction(i18n("P&lay"), TQString ("player_play"), KShortcut (), this, TQT_SLOT(play ()), actionCollection (), "play"); + /*KAction *pauseact =*/ new KAction(i18n("&Pause"), TQString ("player_pause"), KShortcut (), this, TQT_SLOT(pause ()), actionCollection (), "pause"); + /*KAction *stopact =*/ new KAction(i18n("&Stop"), TQString ("player_stop"), KShortcut (), this, TQT_SLOT(stop ()), actionCollection (), "stop"); + new KAction (i18n ("Increase Volume"), TQString ("player_volume"), KShortcut (), this, TQT_SLOT (increaseVolume ()), actionCollection (), "edit_volume_up"); + new KAction (i18n ("Decrease Volume"), TQString ("player_volume"), KShortcut (), this, TQT_SLOT (decreaseVolume ()), actionCollection (), "edit_volume_down"); Source * urlsource = m_sources ["urlsource"]; KMPlayer::ControlPanel * panel = m_view->controlPanel (); - QStringList::const_iterator it = args.begin (); - QStringList::const_iterator end = args.end (); + TQStringList::const_iterator it = args.begin (); + TQStringList::const_iterator end = args.end (); int turned_off_features = 0; for ( ; it != end; ++it) { - int equalPos = (*it).find("="); + int equalPos = (*it).tqfind("="); if (equalPos > 0) { - QString name = (*it).left (equalPos).lower (); - QString value = (*it).right ((*it).length () - equalPos - 1); + TQString name = (*it).left (equalPos).lower (); + TQString value = (*it).right ((*it).length () - equalPos - 1); if (value.at(0)=='\"') value = value.right (value.length () - 1); if (value.at (value.length () - 1) == '\"') @@ -184,121 +184,121 @@ KDE_NO_CDTOR_EXPORT KMPlayerPart::KMPlayerPart (QWidget * wparent, const char *w urlsource->setURL (KURL (value)); urlsource->setIdentified (false); m_havehref = true; - } else if (name == QString::fromLatin1("width")) { + } else if (name == TQString::tqfromLatin1("width")) { m_noresize = true; - } else if (name == QString::fromLatin1("height")) { + } else if (name == TQString::tqfromLatin1("height")) { m_noresize = true; - } else if (name == QString::fromLatin1("type")) { + } else if (name == TQString::tqfromLatin1("type")) { urlsource->document ()->mrl ()->mimetype = value; - } else if (name == QString::fromLatin1("controls")) { + } else if (name == TQString::tqfromLatin1("controls")) { //http://service.real.com/help/library/guides/production8/realpgd.htm?src=noref,rnhmpg_080301,rnhmtn,nosrc //http://service.real.com/help/library/guides/production8/htmfiles/control.htm - QStringList sl = QStringList::split (QChar (','), value); - QStringList::const_iterator it = sl.begin (); - const QStringList::const_iterator e = sl.end (); - for (QStringList::const_iterator i = sl.begin (); i != e; ++i) { - QString val_lower ((*i).lower ()); - if (val_lower == QString::fromLatin1("imagewindow")) { + TQStringList sl = TQStringList::split (TQChar (','), value); + TQStringList::const_iterator it = sl.begin (); + const TQStringList::const_iterator e = sl.end (); + for (TQStringList::const_iterator i = sl.begin (); i != e; ++i) { + TQString val_lower ((*i).lower ()); + if (val_lower == TQString::tqfromLatin1("imagewindow")) { SET_FEAT_ON (Feat_ImageWindow | Feat_Viewer) - } else if (val_lower == QString::fromLatin1("all")) { + } else if (val_lower == TQString::tqfromLatin1("all")) { m_features = (Feat_Controls | Feat_StatusBar); - } else if (val_lower == QString::fromLatin1("tacctrl")) { + } else if (val_lower == TQString::tqfromLatin1("tacctrl")) { SET_FEAT_ON (Feat_Label) - } else if (val_lower == QString::fromLatin1("controlpanel")) { + } else if (val_lower == TQString::tqfromLatin1("controlpanel")) { SET_FEAT_ON (Feat_Controls) - } else if (val_lower == QString::fromLatin1("infovolumepanel")){ + } else if (val_lower == TQString::tqfromLatin1("infovolumepanel")){ SET_FEAT_ON (Feat_Controls) // TODO - } else if (val_lower == QString::fromLatin1("positionfield") || - val_lower == QString::fromLatin1("positionslider")) { + } else if (val_lower == TQString::tqfromLatin1("positionfield") || + val_lower == TQString::tqfromLatin1("positionslider")) { setAutoControls (false); panel->positionSlider ()->show (); SET_FEAT_ON (Feat_Controls) - } else if ( val_lower == QString::fromLatin1("homectrl")) { + } else if ( val_lower == TQString::tqfromLatin1("homectrl")) { setAutoControls (false); panel->button (KMPlayer::ControlPanel::button_config)->show(); - } else if (val_lower == QString::fromLatin1("mutectrl") || - val_lower == QString::fromLatin1("mutevolume")) { + } else if (val_lower == TQString::tqfromLatin1("mutectrl") || + val_lower == TQString::tqfromLatin1("mutevolume")) { setAutoControls (false); - panel->volumeBar()->setMinimumSize (QSize (20, panel->volumeBar()->minimumSize ().height ())); + panel->volumeBar()->setMinimumSize (TQSize (20, panel->volumeBar()->tqminimumSize ().height ())); panel->volumeBar()->show (); SET_FEAT_ON (Feat_Controls) - } else if (val_lower == QString::fromLatin1("rwctrl")) { + } else if (val_lower == TQString::tqfromLatin1("rwctrl")) { setAutoControls (false); panel->button (KMPlayer::ControlPanel::button_back)->show (); // rewind ? SET_FEAT_ON (Feat_Controls) - } else if ( val_lower == QString::fromLatin1("ffctrl")) { + } else if ( val_lower == TQString::tqfromLatin1("ffctrl")) { setAutoControls (false); panel->button(KMPlayer::ControlPanel::button_forward)->show(); m_features = Feat_Controls; - } else if ( val_lower ==QString::fromLatin1("stopbutton")) { + } else if ( val_lower ==TQString::tqfromLatin1("stopbutton")) { setAutoControls (false); panel->button (KMPlayer::ControlPanel::button_stop)->show (); SET_FEAT_ON (Feat_Controls) - } else if (val_lower == QString::fromLatin1("playbutton") || - val_lower ==QString::fromLatin1("playonlybutton")) { + } else if (val_lower == TQString::tqfromLatin1("playbutton") || + val_lower ==TQString::tqfromLatin1("playonlybutton")) { setAutoControls (false); panel->button (KMPlayer::ControlPanel::button_play)->show (); SET_FEAT_ON (Feat_Controls) - } else if (val_lower ==QString::fromLatin1("pausebutton")) { + } else if (val_lower ==TQString::tqfromLatin1("pausebutton")) { setAutoControls (false); panel->button (KMPlayer::ControlPanel::button_pause)->show (); SET_FEAT_ON (Feat_Controls) - } else if (val_lower == QString::fromLatin1("statusbar") || - val_lower == QString::fromLatin1("statusfield")) { + } else if (val_lower == TQString::tqfromLatin1("statusbar") || + val_lower == TQString::tqfromLatin1("statusfield")) { SET_FEAT_ON (Feat_StatusBar) - } else if (val_lower == QString::fromLatin1("infopanel")) { + } else if (val_lower == TQString::tqfromLatin1("infopanel")) { SET_FEAT_ON (Feat_InfoPanel) - } else if (val_lower == QString::fromLatin1("playlist")) { + } else if (val_lower == TQString::tqfromLatin1("playlist")) { SET_FEAT_ON (Feat_PlayList) - } else if (val_lower==QString::fromLatin1("volumeslider")) { + } else if (val_lower==TQString::tqfromLatin1("volumeslider")) { SET_FEAT_ON (Feat_VolumeSlider) setAutoControls (false); panel->volumeBar()->show (); - panel->volumeBar()->setMinimumSize (QSize (20, panel->volumeBar()->minimumSize ().height ())); + panel->volumeBar()->setMinimumSize (TQSize (20, panel->volumeBar()->tqminimumSize ().height ())); } } - } else if (name == QString::fromLatin1("uimode")) { - QString val_lower (value.lower ()); - if (val_lower == QString::fromLatin1("full")) + } else if (name == TQString::tqfromLatin1("uimode")) { + TQString val_lower (value.lower ()); + if (val_lower == TQString::tqfromLatin1("full")) SET_FEAT_ON (Feat_All & ~(Feat_PlayList | Feat_ImageWindow)) // TODO: invisible, none, mini - } else if (name == QString::fromLatin1("nolabels")) { + } else if (name == TQString::tqfromLatin1("nolabels")) { SET_FEAT_OFF (Feat_Label) - } else if (name == QString::fromLatin1("nocontrols")) { + } else if (name == TQString::tqfromLatin1("nocontrols")) { SET_FEAT_OFF (Feat_Controls | Feat_VolumeSlider) - } else if (name == QString::fromLatin1("showdisplay")) { + } else if (name == TQString::tqfromLatin1("showdisplay")) { // the author name, the clip name, and the copyright information if (getBoolValue (value)) SET_FEAT_ON (Feat_InfoPanel) else SET_FEAT_OFF (Feat_InfoPanel) - } else if (name == QString::fromLatin1("showcontrols")) { + } else if (name == TQString::tqfromLatin1("showcontrols")) { if (getBoolValue (value)) SET_FEAT_ON (Feat_Viewer | Feat_Controls) else SET_FEAT_OFF (Feat_Controls | Feat_VolumeSlider) - } else if (name == QString::fromLatin1("showstatusbar")) { + } else if (name == TQString::tqfromLatin1("showstatusbar")) { if (getBoolValue (value)) SET_FEAT_ON (Feat_Viewer | Feat_StatusBar) else SET_FEAT_OFF (Feat_StatusBar) // else showcaptioning/showgotobar/showpositioncontrols/showtracker - } else if (name == QString::fromLatin1("console")) { - m_group = value.isEmpty() ? QString::fromLatin1("_anonymous") : value; - } else if (name == QString::fromLatin1("__khtml__pluginbaseurl")) { + } else if (name == TQString::tqfromLatin1("console")) { + m_group = value.isEmpty() ? TQString::tqfromLatin1("_anonymous") : value; + } else if (name == TQString::tqfromLatin1("__khtml__pluginbaseurl")) { m_docbase = KURL (value); - } else if (name == QString::fromLatin1("src")) { + } else if (name == TQString::tqfromLatin1("src")) { m_src_url = value; - } else if (name == QString::fromLatin1("filename")) { + } else if (name == TQString::tqfromLatin1("filename")) { m_file_name = value; - } else if (name == QString::fromLatin1 ("fullscreenmode")) { + } else if (name == TQString::tqfromLatin1 ("fullscreenmode")) { show_fullscreen = getBoolValue (value); - } else if (name == QString::fromLatin1 ("autostart")) { + } else if (name == TQString::tqfromLatin1 ("autostart")) { urlsource->setAutoPlay (getBoolValue (value)); } // volume/clicktoplay/transparentatstart/animationatstart // autorewind/displaysize/border - if (name.startsWith (QString::fromLatin1 ("__khtml__"))) + if (name.startsWith (TQString::tqfromLatin1 ("__khtml__"))) name = name.mid (9); convertNode <KMPlayer::Element> (urlsource->document ())->setAttribute (name, value); } @@ -311,11 +311,11 @@ KDE_NO_CDTOR_EXPORT KMPlayerPart::KMPlayerPart (QWidget * wparent, const char *w //KParts::Part::setWidget (m_view); setXMLFile("kmplayerpartui.rc"); panel->zoomMenu ()->connectItem (KMPlayer::ControlPanel::menu_zoom50, - this, SLOT (setMenuZoom (int))); + this, TQT_SLOT (setMenuZoom (int))); panel->zoomMenu ()->connectItem (KMPlayer::ControlPanel::menu_zoom100, - this, SLOT (setMenuZoom (int))); + this, TQT_SLOT (setMenuZoom (int))); panel->zoomMenu ()->connectItem (KMPlayer::ControlPanel::menu_zoom150, - this, SLOT (setMenuZoom (int))); + this, TQT_SLOT (setMenuZoom (int))); m_view->setNoInfoMessages (m_features != Feat_InfoPanel); if (m_features == Feat_InfoPanel) @@ -332,7 +332,7 @@ KDE_NO_CDTOR_EXPORT KMPlayerPart::KMPlayerPart (QWidget * wparent, const char *w else m_view->setControlPanelMode (KMPlayer::View::CP_AutoHide); } - bool group_member = !m_group.isEmpty () && m_group != QString::fromLatin1("_unique") && m_features != Feat_Unknown; + bool group_member = !m_group.isEmpty () && m_group != TQString::tqfromLatin1("_unique") && m_features != Feat_Unknown; if (!group_member || m_features & Feat_Viewer) { // not part of a group or we're the viewer setProcess ("mplayer"); @@ -340,9 +340,9 @@ KDE_NO_CDTOR_EXPORT KMPlayerPart::KMPlayerPart (QWidget * wparent, const char *w connectPanel (m_view->controlPanel ()); if (m_features & Feat_StatusBar) { last_time_left = 0; - connect (this, SIGNAL (positioned (int, int)), - this, SLOT (statusPosition (int, int))); - m_view->statusBar ()->insertItem (QString ("--:--"), 1, 0, true); + connect (this, TQT_SIGNAL (positioned (int, int)), + this, TQT_SLOT (statusPosition (int, int))); + m_view->statusBar ()->insertItem (TQString ("--:--"), 1, 0, true); } } if (group_member) { @@ -362,7 +362,7 @@ KDE_NO_CDTOR_EXPORT KMPlayerPart::KMPlayerPart (QWidget * wparent, const char *w m_group.truncate (0); kmplayerpart_static->partlist.push_back (this); - QWidget *pwidget = view ()->parentWidget (); + TQWidget *pwidget = view ()->tqparentWidget (); if (pwidget) { m_view->viewArea()->setPaletteBackgroundColor(pwidget->paletteBackgroundColor ()); m_view->viewer()->setBackgroundColor(pwidget->paletteBackgroundColor()); @@ -397,7 +397,7 @@ KDE_NO_EXPORT void KMPlayerPart::setAutoControls (bool b) { m_view->controlPanel ()->setAutoControls (b); } -KDE_NO_EXPORT void KMPlayerPart::viewerPartDestroyed (QObject * o) { +KDE_NO_EXPORT void KMPlayerPart::viewerPartDestroyed (TQObject * o) { if (o == m_master) m_master = 0L; kdDebug () << "KMPlayerPart(" << this << ")::viewerPartDestroyed" << endl; @@ -434,16 +434,16 @@ KDE_NO_EXPORT bool KMPlayerPart::openURL (const KURL & _url) { url = KURL (m_docbase, m_file_name); // fix misdetected SRC attr else if (_url != m_docbase) { url = _url; - if (!m_file_name.isEmpty () && _url.url ().find (m_file_name) < 0) { + if (!m_file_name.isEmpty () && _url.url ().tqfind (m_file_name) < 0) { KURL u (m_file_name); - if ((u.protocol () == QString ("mms")) || + if ((u.protocol () == TQString ("mms")) || _url.protocol ().isEmpty ()) { // see if we somehow have to merge these int p = _url.port (); if (p > 0) u.setPort (p); if (u.path ().isEmpty ()) - u.setPath (QChar ('/') + _url.host ()); + u.setPath (TQChar ('/') + _url.host ()); if (allowRedir (u)) { url = u; kdDebug () << "KMPlayerPart::openURL compose " << m_file_name << " " << _url.url() << " ->" << u.url() << endl; @@ -469,7 +469,7 @@ KDE_NO_EXPORT bool KMPlayerPart::openURL (const KURL & _url) { if (url.isEmpty ()) { if (!m_master && !(m_features & Feat_Viewer)) // no master set, wait for a viewer to attach or timeout - QTimer::singleShot (50, this, SLOT (waitForImageWindowTimeOut ())); + TQTimer::singleShot (50, this, TQT_SLOT (waitForImageWindowTimeOut ())); return true; } if (!m_group.isEmpty () && !(m_features & Feat_Viewer)) { @@ -479,7 +479,7 @@ KDE_NO_EXPORT bool KMPlayerPart::openURL (const KURL & _url) { i = std::find_if (++i, e, pred)) if ((*i)->url ().isEmpty ()) // image window created w/o url return (*i)->openURL (_url); - QTimer::singleShot (50, this, SLOT (waitForImageWindowTimeOut ())); + TQTimer::singleShot (50, this, TQT_SLOT (waitForImageWindowTimeOut ())); //kdError () << "Not the ImageWindow and no ImageWindow found" << endl; return true; } @@ -549,17 +549,17 @@ KDE_NO_EXPORT void KMPlayerPart::connectToPart (KMPlayerPart * m) { if (m_features & Feat_InfoPanel) m->connectInfoPanel (m_view->infoPanel ()); connectSource (m_source, m->source ()); - connect (m, SIGNAL (destroyed (QObject *)), - this, SLOT (viewerPartDestroyed (QObject *))); - connect (m, SIGNAL (processChanged (const char *)), - this, SLOT (viewerPartProcessChanged (const char *))); - connect (m, SIGNAL (sourceChanged (KMPlayer::Source *, KMPlayer::Source *)), - this, SLOT (viewerPartSourceChanged (KMPlayer::Source *, KMPlayer::Source *))); + connect (m, TQT_SIGNAL (destroyed (TQObject *)), + this, TQT_SLOT (viewerPartDestroyed (TQObject *))); + connect (m, TQT_SIGNAL (processChanged (const char *)), + this, TQT_SLOT (viewerPartProcessChanged (const char *))); + connect (m, TQT_SIGNAL (sourceChanged (KMPlayer::Source *, KMPlayer::Source *)), + this, TQT_SLOT (viewerPartSourceChanged (KMPlayer::Source *, KMPlayer::Source *))); if (m_features & Feat_StatusBar) { last_time_left = 0; - connect (m, SIGNAL (positioned (int, int)), - this, SLOT (statusPosition (int, int))); - m_view->statusBar ()->insertItem (QString ("--:--"), 1, 0, true); + connect (m, TQT_SIGNAL (positioned (int, int)), + this, TQT_SLOT (statusPosition (int, int))); + m_view->statusBar ()->insertItem (TQString ("--:--"), 1, 0, true); } } @@ -568,7 +568,7 @@ KDE_NO_EXPORT void KMPlayerPart::setLoaded (int percentage) { if (percentage < 100) { m_browserextension->setLoadingProgress (percentage); m_browserextension->infoMessage - (QString::number (percentage) + i18n ("% Cache fill")); + (TQString::number (percentage) + i18n ("% Cache fill")); } } @@ -631,7 +631,7 @@ KDE_NO_EXPORT void KMPlayerPart::statusPosition (int pos, int length) { int left = (length - pos) / 10; if (left != last_time_left) { last_time_left = left; - QString text ("--:--"); + TQString text ("--:--"); if (left > 0) { int h = left / 3600; int m = (left % 3600) / 60; @@ -647,11 +647,11 @@ KDE_NO_EXPORT void KMPlayerPart::statusPosition (int pos, int length) { //--------------------------------------------------------------------- -KDE_NO_CDTOR_EXPORT KMPlayerBrowserExtension::KMPlayerBrowserExtension (KMPlayerPart * parent) - : KParts::BrowserExtension (parent, "KMPlayer Browser Extension") { +KDE_NO_CDTOR_EXPORT KMPlayerBrowserExtension::KMPlayerBrowserExtension (KMPlayerPart * tqparent) + : KParts::BrowserExtension (tqparent, "KMPlayer Browser Extension") { } -KDE_NO_EXPORT void KMPlayerBrowserExtension::urlChanged (const QString & url) { +KDE_NO_EXPORT void KMPlayerBrowserExtension::urlChanged (const TQString & url) { emit setLocationBarURL (url); } @@ -659,25 +659,25 @@ KDE_NO_EXPORT void KMPlayerBrowserExtension::setLoadingProgress (int percentage) emit loadingProgress (percentage); } -KDE_NO_EXPORT void KMPlayerBrowserExtension::saveState (QDataStream & stream) { - stream << static_cast <PartBase *> (parent ())->url ().url (); +KDE_NO_EXPORT void KMPlayerBrowserExtension::saveState (TQDataStream & stream) { + stream << static_cast <PartBase *> (tqparent ())->url ().url (); } -KDE_NO_EXPORT void KMPlayerBrowserExtension::restoreState (QDataStream & stream) { - QString url; +KDE_NO_EXPORT void KMPlayerBrowserExtension::restoreState (TQDataStream & stream) { + TQString url; stream >> url; - static_cast <PartBase *> (parent ())->openURL (KURL(url)); + static_cast <PartBase *> (tqparent ())->openURL (KURL(url)); } -KDE_NO_EXPORT void KMPlayerBrowserExtension::requestOpenURL (const KURL & url, const QString & target, const QString & service) { +KDE_NO_EXPORT void KMPlayerBrowserExtension::requestOpenURL (const KURL & url, const TQString & target, const TQString & service) { KParts::URLArgs args; args.frameName = target; args.serviceType = service; emit openURLRequest (url, args); } -KDE_NO_EXPORT void KMPlayerBrowserExtension::slotRequestOpenURL (const KURL &url, const QString &target) { - requestOpenURL (url, target, QString ()); +KDE_NO_EXPORT void KMPlayerBrowserExtension::slotRequestOpenURL (const KURL &url, const TQString &target) { + requestOpenURL (url, target, TQString ()); } //--------------------------------------------------------------------- @@ -746,14 +746,14 @@ static const JSCommandEntry JSCommandList [] = { { "GetEntryCopyright", notsupported, "(c)", KParts::LiveConnectExtension::TypeString }, { "GetEntryTitle", notsupported, "title", KParts::LiveConnectExtension::TypeString }, { "GetFullScreen", isfullscreen, 0L, KParts::LiveConnectExtension::TypeBool }, - { "GetImageStatus", notsupported, "false", KParts::LiveConnectExtension::TypeBool }, + { "GetImagetqStatus", notsupported, "false", KParts::LiveConnectExtension::TypeBool }, { "GetLastErrorMoreInfoURL", notsupported, "no error", KParts::LiveConnectExtension::TypeString }, { "GetLastErrorRMACode", notsupported, "0", KParts::LiveConnectExtension::TypeNumber }, { "GetLastErrorSeverity", notsupported, "6", KParts::LiveConnectExtension::TypeNumber }, { "GetLastErrorUserCode", notsupported, "0", KParts::LiveConnectExtension::TypeNumber }, { "GetLastErrorUserString", notsupported, "no error", KParts::LiveConnectExtension::TypeString }, { "GetLastMessage", notsupported, "no error", KParts::LiveConnectExtension::TypeString }, - { "GetLastStatus", notsupported, "no error", KParts::LiveConnectExtension::TypeString }, + { "GetLasttqStatus", notsupported, "no error", KParts::LiveConnectExtension::TypeString }, { "GetLength", length, 0L, KParts::LiveConnectExtension::TypeNumber }, { "GetLiveState", notsupported, "false", KParts::LiveConnectExtension::TypeBool }, { "GetLoop", isloop, 0L, KParts::LiveConnectExtension::TypeBool }, @@ -802,7 +802,7 @@ static const JSCommandEntry JSCommandList [] = { { "SetDoubleSize", notsupported, "true", KParts::LiveConnectExtension::TypeBool }, { "SetFileName", setsource, 0L, KParts::LiveConnectExtension::TypeBool }, { "SetFullScreen", notsupported, "true", KParts::LiveConnectExtension::TypeBool }, - { "SetImageStatus", notsupported, "true", KParts::LiveConnectExtension::TypeBool }, + { "SetImagetqStatus", notsupported, "true", KParts::LiveConnectExtension::TypeBool }, { "SetLoop", notsupported, "true", KParts::LiveConnectExtension::TypeBool }, { "SetMaintainAspect", notsupported, "true", KParts::LiveConnectExtension::TypeBool }, { "SetMute", notsupported, "true", KParts::LiveConnectExtension::TypeBool }, @@ -847,13 +847,13 @@ static const JSCommandEntry * getJSCommandEntry (const char * name, int start = return &JSCommandList[mid]; } -KDE_NO_CDTOR_EXPORT KMPlayerLiveConnectExtension::KMPlayerLiveConnectExtension (KMPlayerPart * parent) - : KParts::LiveConnectExtension (parent), player (parent), +KDE_NO_CDTOR_EXPORT KMPlayerLiveConnectExtension::KMPlayerLiveConnectExtension (KMPlayerPart * tqparent) + : KParts::LiveConnectExtension (tqparent), player (tqparent), lastJSCommandEntry (0L), m_started (false), m_enablefinish (false), m_evaluating (false) { - connect (parent, SIGNAL (started (KIO::Job *)), this, SLOT (started ())); + connect (tqparent, TQT_SIGNAL (started (KIO::Job *)), this, TQT_SLOT (started ())); } KDE_NO_CDTOR_EXPORT KMPlayerLiveConnectExtension::~KMPlayerLiveConnectExtension() { @@ -867,7 +867,7 @@ KDE_NO_EXPORT void KMPlayerLiveConnectExtension::started () { KDE_NO_EXPORT void KMPlayerLiveConnectExtension::finished () { if (m_started && m_enablefinish) { KParts::LiveConnectExtension::ArgList args; - args.push_back (qMakePair (KParts::LiveConnectExtension::TypeString, QString("if (window.onFinished) onFinished();"))); + args.push_back (qMakePair (KParts::LiveConnectExtension::TypeString, TQString("if (window.onFinished) onFinished();"))); emit partEvent (0, "eval", args); m_started = true; m_enablefinish = false; @@ -875,14 +875,14 @@ KDE_NO_EXPORT void KMPlayerLiveConnectExtension::finished () { } KDE_NO_EXPORT void KMPlayerLiveConnectExtension::evaluate ( - const QString & scr, QString & result) { - QString script (scr); + const TQString & scr, TQString & result) { + TQString script (scr); KParts::LiveConnectExtension::ArgList args; - script = script.replace ('\\', "\\\\"); - script = script.replace ('\n', "\\n"); - script = script.replace ('\r', ""); - script = script.replace ('"', "\\\""); - script = QString ("this.__kmplayer__res=eval(\"%1\")").arg (script); + script = script.tqreplace ('\\', "\\\\"); + script = script.tqreplace ('\n', "\\n"); + script = script.tqreplace ('\r', ""); + script = script.tqreplace ('"', "\\\""); + script = TQString ("this.__kmplayer__res=eval(\"%1\")").arg (script); args.push_back(qMakePair(KParts::LiveConnectExtension::TypeString, script)); script_result = "undefined"; @@ -893,9 +893,9 @@ KDE_NO_EXPORT void KMPlayerLiveConnectExtension::evaluate ( } KDE_NO_EXPORT bool KMPlayerLiveConnectExtension::get - (const unsigned long id, const QString & name, + (const unsigned long id, const TQString & name, KParts::LiveConnectExtension::Type & type, - unsigned long & rid, QString & rval) + unsigned long & rid, TQString & rval) { if (name.startsWith ("__kmplayer__obj_")) { if (m_evaluating) @@ -919,11 +919,11 @@ KDE_NO_EXPORT bool KMPlayerLiveConnectExtension::get break; case prop_volume: if (player->view ()) - rval = QString::number (player->process()->viewer ()->view()->controlPanel()->volumeBar()->value()); + rval = TQString::number (player->process()->viewer ()->view()->controlPanel()->volumeBar()->value()); break; case prop_error: type = KParts::LiveConnectExtension::TypeNumber; - rval = QString::number (0); + rval = TQString::number (0); break; default: lastJSCommandEntry = entry; @@ -933,7 +933,7 @@ KDE_NO_EXPORT bool KMPlayerLiveConnectExtension::get } KDE_NO_EXPORT bool KMPlayerLiveConnectExtension::put - (const unsigned long, const QString & name, const QString & val) { + (const unsigned long, const TQString & name, const TQString & val) { if (name == "__kmplayer__res") { script_result = val; return true; @@ -964,9 +964,9 @@ KDE_NO_EXPORT bool KMPlayerLiveConnectExtension::put } KDE_NO_EXPORT bool KMPlayerLiveConnectExtension::call - (const unsigned long id, const QString & name, - const QStringList & args, KParts::LiveConnectExtension::Type & type, - unsigned long & rid, QString & rval) { + (const unsigned long id, const TQString & name, + const TQStringList & args, KParts::LiveConnectExtension::Type & type, + unsigned long & rid, TQString & rval) { const JSCommandEntry * entry = lastJSCommandEntry; const char * str = name.ascii (); if (!entry || strcmp (entry->name, str)) @@ -1017,8 +1017,8 @@ KDE_NO_EXPORT bool KMPlayerLiveConnectExtension::call break; case showcontrolpanel: if (args.size () && - (args.first () == QString::fromLatin1 ("0") || - args.first () == QString::fromLatin1 ("false"))) + (args.first () == TQString::tqfromLatin1 ("0") || + args.first () == TQString::tqfromLatin1 ("false"))) static_cast <KMPlayer::View*> (player->view ())->setControlPanelMode (KMPlayer::View::CP_Hide); else static_cast <KMPlayer::View*> (player->view ())->setControlPanelMode (KMPlayer::View::CP_Show); @@ -1073,7 +1073,7 @@ KDE_NO_EXPORT bool KMPlayerLiveConnectExtension::call break; case volume: if (player->view ()) - rval = QString::number (player->process()->viewer ()->view()->controlPanel()->volumeBar()->value()); + rval = TQString::number (player->process()->viewer ()->view()->controlPanel()->volumeBar()->value()); break; default: return false; @@ -1088,7 +1088,7 @@ KDE_NO_EXPORT void KMPlayerLiveConnectExtension::setSize (int w, int h) { KMPlayer::View * view = static_cast <KMPlayer::View*> (player->view ()); if (view->controlPanelMode () == KMPlayer::View::CP_Show) h += view->controlPanel()->height(); - QString jscode; + TQString jscode; jscode.sprintf("try { eval(\"this.setAttribute('WIDTH',%d);this.setAttribute('HEIGHT',%d)\"); } catch(e){}", w, h); KParts::LiveConnectExtension::ArgList args; args.push_back (qMakePair (KParts::LiveConnectExtension::TypeString, jscode)); @@ -1115,7 +1115,7 @@ KDE_NO_EXPORT bool KMPlayerHRefSource::hasLength () { return false; } -KDE_NO_EXPORT bool KMPlayerHRefSource::processOutput (const QString & /*str*/) { +KDE_NO_EXPORT bool KMPlayerHRefSource::processOutput (const TQString & /*str*/) { //return Source::processOutput (str); return true; } @@ -1131,7 +1131,7 @@ KDE_NO_EXPORT void KMPlayerHRefSource::setURL (const KURL & url) { KDE_NO_EXPORT void KMPlayerHRefSource::play () { kdDebug () << "KMPlayerHRefSource::play " << m_url.url() << endl; Source * src = m_player->sources () ["urlsource"]; - QString target = src->document ()->document ()-> + TQString target = src->document ()->document ()-> getAttribute (StringPool::attr_target); if (!target.isEmpty ()) { KMPlayer::Mrl * mrl = src->document ()->mrl (); @@ -1143,17 +1143,17 @@ KDE_NO_EXPORT void KMPlayerHRefSource::play () { KDE_NO_EXPORT void KMPlayerHRefSource::activate () { m_player->stop (); if (m_finished) { - QTimer::singleShot (0, this, SLOT (finished ())); + TQTimer::singleShot (0, this, TQT_SLOT (finished ())); return; } init (); m_player->setProcess ("mplayer"); if (m_player->process ()->grabPicture (m_url, 0)) - connect (m_player->process (), SIGNAL (grabReady (const QString &)), - this, SLOT (grabReady (const QString &))); + connect (m_player->process (), TQT_SIGNAL (grabReady (const TQString &)), + this, TQT_SLOT (grabReady (const TQString &))); else { setURL (KURL ()); - QTimer::singleShot (0, this, SLOT (play ())); + TQTimer::singleShot (0, this, TQT_SLOT (play ())); } } @@ -1161,7 +1161,7 @@ KDE_NO_EXPORT void KMPlayerHRefSource::clear () { setURL (KURL ()); } -KDE_NO_EXPORT void KMPlayerHRefSource::grabReady (const QString & path) { +KDE_NO_EXPORT void KMPlayerHRefSource::grabReady (const TQString & path) { kdDebug () << "KMPlayerHRefSource::grabReady(" << path << ")" << endl; m_finished = true; m_grabfile = path; @@ -1174,23 +1174,23 @@ KDE_NO_EXPORT void KMPlayerHRefSource::finished () { if (!view) return; if (!view->setPicture (m_grabfile)) { clear (); - QTimer::singleShot (0, this, SLOT (play ())); + TQTimer::singleShot (0, this, TQT_SLOT (play ())); return; } if (view->viewer ()) - connect (view, SIGNAL (pictureClicked ()), this, SLOT (play ())); + connect (view, TQT_SIGNAL (pictureClicked ()), this, TQT_SLOT (play ())); } KDE_NO_EXPORT void KMPlayerHRefSource::deactivate () { kdDebug () << "KMPlayerHRefSource::deactivate()" << endl; KMPlayer::View * view = static_cast <KMPlayer::View*> (m_player->view ()); if (!view) return; - view->setPicture (QString ()); + view->setPicture (TQString ()); if (view->viewer ()) - disconnect (view, SIGNAL (pictureClicked ()), this, SLOT (play ())); + disconnect (view, TQT_SIGNAL (pictureClicked ()), this, TQT_SLOT (play ())); } -KDE_NO_EXPORT QString KMPlayerHRefSource::prettyName () { +KDE_NO_EXPORT TQString KMPlayerHRefSource::prettyName () { return i18n ("WEB"); } |