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/kmplayerpartbase.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/kmplayerpartbase.cpp')
-rw-r--r-- | src/kmplayerpartbase.cpp | 508 |
1 files changed, 252 insertions, 256 deletions
diff --git a/src/kmplayerpartbase.cpp b/src/kmplayerpartbase.cpp index 10a9f87..7bd33bb 100644 --- a/src/kmplayerpartbase.cpp +++ b/src/kmplayerpartbase.cpp @@ -24,17 +24,17 @@ #include <math.h> -#include <qapplication.h> -#include <qcstring.h> -#include <qcursor.h> -#include <qtimer.h> -#include <qpair.h> -#include <qpushbutton.h> -#include <qpopupmenu.h> -#include <qslider.h> -#include <qfile.h> -#include <qregexp.h> -#include <qtextstream.h> +#include <tqapplication.h> +#include <tqcstring.h> +#include <tqcursor.h> +#include <tqtimer.h> +#include <tqpair.h> +#include <tqpushbutton.h> +#include <tqpopupmenu.h> +#include <tqslider.h> +#include <tqfile.h> +#include <tqregexp.h> +#include <tqtextstream.h> #include <kmessagebox.h> #include <kaboutdata.h> @@ -68,16 +68,16 @@ class KMPLAYER_NO_EXPORT BookmarkOwner : public KBookmarkOwner { public: BookmarkOwner (PartBase *); KDE_NO_CDTOR_EXPORT virtual ~BookmarkOwner () {} - void openBookmarkURL(const QString& _url); - QString currentTitle() const; - QString currentURL() const; + void openBookmarkURL(const TQString& _url); + TQString currentTitle() const; + TQString currentURL() const; private: PartBase * m_player; }; class KMPLAYER_NO_EXPORT BookmarkManager : public KBookmarkManager { public: - BookmarkManager (const QString &); + BookmarkManager (const TQString &); }; } // namespace @@ -87,29 +87,29 @@ using namespace KMPlayer; KDE_NO_CDTOR_EXPORT BookmarkOwner::BookmarkOwner (PartBase * player) : m_player (player) {} -KDE_NO_EXPORT void BookmarkOwner::openBookmarkURL (const QString & url) { +KDE_NO_EXPORT void BookmarkOwner::openBookmarkURL (const TQString & url) { m_player->openURL (KURL (url)); } -KDE_NO_EXPORT QString BookmarkOwner::currentTitle () const { +KDE_NO_EXPORT TQString BookmarkOwner::currentTitle () const { return m_player->source ()->prettyName (); } -KDE_NO_EXPORT QString BookmarkOwner::currentURL () const { +KDE_NO_EXPORT TQString BookmarkOwner::currentURL () const { return m_player->source ()->url ().url (); } -inline BookmarkManager::BookmarkManager(const QString & bmfile) +inline BookmarkManager::BookmarkManager(const TQString & bmfile) : KBookmarkManager (bmfile, false) { } //----------------------------------------------------------------------------- -PartBase::PartBase (QWidget * wparent, const char *wname, - QObject * parent, const char *name, KConfig * config) - : KMediaPlayer::Player (wparent, wname ? wname : "kde_kmplayer_view", parent, name ? name : "kde_kmplayer_part"), +PartBase::PartBase (TQWidget * wtqparent, const char *wname, + TQObject * tqparent, const char *name, KConfig * config) + : KMediaPlayer::Player (wtqparent, wname ? wname : "kde_kmplayer_view", tqparent, name ? name : "kde_kmplayer_part"), m_config (config), - m_view (new View (wparent, wname ? wname : "kde_kmplayer_view")), + m_view (new View (wtqparent, wname ? wname : "kde_kmplayer_view")), m_settings (new Settings (this, config)), m_recorder (0L), m_source (0L), @@ -133,12 +133,12 @@ PartBase::PartBase (QWidget * wparent, const char *wname, m_recorders ["xine"] = xine; m_sources ["urlsource"] = new URLSource (this); - QString bmfile = locate ("data", "kmplayer/bookmarks.xml"); - QString localbmfile = locateLocal ("data", "kmplayer/bookmarks.xml"); + TQString bmfile = locate ("data", "kmplayer/bookmarks.xml"); + TQString localbmfile = locateLocal ("data", "kmplayer/bookmarks.xml"); if (localbmfile != bmfile) { kdDebug () << "cp " << bmfile << " " << localbmfile << endl; KProcess p; - p << "/bin/cp" << QFile::encodeName (bmfile) << QFile::encodeName (localbmfile); + p << "/bin/cp" << TQString(TQFile::encodeName (bmfile)) << TQString(TQFile::encodeName (localbmfile)); p.start (KProcess::Block); } m_bookmark_manager = new BookmarkManager (localbmfile); @@ -160,7 +160,7 @@ KDE_NO_EXPORT void PartBase::showPlayListWindow () { m_view->toggleShowPlaylist (); } -KDE_NO_EXPORT void PartBase::addBookMark (const QString & t, const QString & url) { +KDE_NO_EXPORT void PartBase::addBookMark (const TQString & t, const TQString & url) { KBookmarkGroup b = m_bookmark_manager->root (); b.addBookmark (m_bookmark_manager, t, KURL (url)); m_bookmark_manager->emitChanged (b); @@ -172,14 +172,14 @@ void PartBase::init (KActionCollection * action_collection) { #ifdef HAVE_NSPR m_players ["npp"] = new NpPlayer (this, m_settings, m_service); #endif - connect(m_settings, SIGNAL(configChanged()), this, SLOT(settingsChanged())); + connect(m_settings, TQT_SIGNAL(configChanged()), this, TQT_SLOT(settingsChanged())); m_settings->readConfig (); m_settings->applyColorSetting (false); m_bookmark_menu = new KBookmarkMenu (m_bookmark_manager, m_bookmark_owner, m_view->controlPanel ()->bookmarkMenu (), action_collection, true, true); - connect (m_view, SIGNAL (urlDropped (const KURL::List &)), this, SLOT (openURL (const KURL::List &))); + connect (m_view, TQT_SIGNAL (urlDropped (const KURL::List &)), this, TQT_SLOT (openURL (const KURL::List &))); connectPlaylist (m_view->playList ()); connectInfoPanel (m_view->infoPanel ()); - new KAction (i18n ("Edit playlist &item"), 0, 0, m_view->playList (), SLOT (editCurrent ()), action_collection, "edit_playlist_item"); + new KAction (i18n ("Edit playlist &item"), 0, 0, TQT_TQOBJECT(m_view->playList ()), TQT_SLOT (editCurrent ()), action_collection, "edit_playlist_item"); } void PartBase::connectPanel (ControlPanel * panel) { @@ -188,56 +188,56 @@ void PartBase::connectPanel (ControlPanel * panel) { panel->hueSlider ()->setValue (m_settings->hue); panel->saturationSlider ()->setValue (m_settings->saturation); panel->volumeBar ()->setValue (m_settings->volume); - connect (panel->button (ControlPanel::button_playlist), SIGNAL (clicked ()), this, SLOT (showPlayListWindow ())); - connect (panel->button (ControlPanel::button_back), SIGNAL (clicked ()), this, SLOT (back ())); - connect (panel->button (ControlPanel::button_play), SIGNAL (clicked ()), this, SLOT (play ())); - connect (panel->button (ControlPanel::button_forward), SIGNAL (clicked ()), this, SLOT (forward ())); - connect (panel->button (ControlPanel::button_pause), SIGNAL (clicked ()), this, SLOT (pause ())); - connect (panel->button (ControlPanel::button_stop), SIGNAL (clicked ()), this, SLOT (stop ())); - connect (panel->button (ControlPanel::button_record), SIGNAL (clicked()), this, SLOT (record())); - connect (panel->volumeBar (), SIGNAL (volumeChanged (int)), this, SLOT (volumeChanged (int))); - connect (panel->positionSlider (), SIGNAL (valueChanged (int)), this, SLOT (positionValueChanged (int))); - connect (panel->positionSlider (), SIGNAL (sliderPressed()), this, SLOT (posSliderPressed())); - connect (panel->positionSlider (), SIGNAL (sliderReleased()), this, SLOT (posSliderReleased())); - connect (this, SIGNAL (positioned (int, int)), panel, SLOT (setPlayingProgress (int, int))); - connect (this, SIGNAL (loading(int)), panel, SLOT(setLoadingProgress(int))); - connect (panel->contrastSlider (), SIGNAL (valueChanged(int)), this, SLOT (contrastValueChanged(int))); - connect (panel->brightnessSlider (), SIGNAL (valueChanged(int)), this, SLOT (brightnessValueChanged(int))); - connect (panel->hueSlider (), SIGNAL (valueChanged(int)), this, SLOT (hueValueChanged(int))); - connect (panel->saturationSlider (), SIGNAL (valueChanged(int)), this, SLOT (saturationValueChanged(int))); - connect (this, SIGNAL (languagesUpdated(const QStringList &, const QStringList &)), panel, SLOT (setLanguages (const QStringList &, const QStringList &))); - connect (panel->audioMenu (), SIGNAL (activated (int)), this, SLOT (audioSelected (int))); - connect (panel->subtitleMenu (), SIGNAL (activated (int)), this, SLOT (subtitleSelected (int))); - connect (this, SIGNAL (audioIsSelected (int)), panel, SLOT (selectAudioLanguage (int))); - connect (this, SIGNAL (subtitleIsSelected (int)), panel, SLOT (selectSubtitle (int))); - panel->popupMenu()->connectItem (ControlPanel::menu_fullscreen, this, SLOT (fullScreen ())); + connect (panel->button (ControlPanel::button_playlist), TQT_SIGNAL (clicked ()), this, TQT_SLOT (showPlayListWindow ())); + connect (panel->button (ControlPanel::button_back), TQT_SIGNAL (clicked ()), this, TQT_SLOT (back ())); + connect (panel->button (ControlPanel::button_play), TQT_SIGNAL (clicked ()), this, TQT_SLOT (play ())); + connect (panel->button (ControlPanel::button_forward), TQT_SIGNAL (clicked ()), this, TQT_SLOT (forward ())); + connect (panel->button (ControlPanel::button_pause), TQT_SIGNAL (clicked ()), this, TQT_SLOT (pause ())); + connect (panel->button (ControlPanel::button_stop), TQT_SIGNAL (clicked ()), this, TQT_SLOT (stop ())); + connect (panel->button (ControlPanel::button_record), TQT_SIGNAL (clicked()), this, TQT_SLOT (record())); + connect (panel->volumeBar (), TQT_SIGNAL (volumeChanged (int)), this, TQT_SLOT (volumeChanged (int))); + connect (panel->positionSlider (), TQT_SIGNAL (valueChanged (int)), this, TQT_SLOT (positionValueChanged (int))); + connect (panel->positionSlider (), TQT_SIGNAL (sliderPressed()), this, TQT_SLOT (posSliderPressed())); + connect (panel->positionSlider (), TQT_SIGNAL (sliderReleased()), this, TQT_SLOT (posSliderReleased())); + connect (this, TQT_SIGNAL (positioned (int, int)), panel, TQT_SLOT (setPlayingProgress (int, int))); + connect (this, TQT_SIGNAL (loading(int)), panel, TQT_SLOT(setLoadingProgress(int))); + connect (panel->contrastSlider (), TQT_SIGNAL (valueChanged(int)), this, TQT_SLOT (contrastValueChanged(int))); + connect (panel->brightnessSlider (), TQT_SIGNAL (valueChanged(int)), this, TQT_SLOT (brightnessValueChanged(int))); + connect (panel->hueSlider (), TQT_SIGNAL (valueChanged(int)), this, TQT_SLOT (hueValueChanged(int))); + connect (panel->saturationSlider (), TQT_SIGNAL (valueChanged(int)), this, TQT_SLOT (saturationValueChanged(int))); + connect (this, TQT_SIGNAL (languagesUpdated(const TQStringList &, const TQStringList &)), panel, TQT_SLOT (setLanguages (const TQStringList &, const TQStringList &))); + connect (panel->audioMenu (), TQT_SIGNAL (activated (int)), this, TQT_SLOT (audioSelected (int))); + connect (panel->subtitleMenu (), TQT_SIGNAL (activated (int)), this, TQT_SLOT (subtitleSelected (int))); + connect (this, TQT_SIGNAL (audioIsSelected (int)), panel, TQT_SLOT (selectAudioLanguage (int))); + connect (this, TQT_SIGNAL (subtitleIsSelected (int)), panel, TQT_SLOT (selectSubtitle (int))); + panel->popupMenu()->connectItem (ControlPanel::menu_fullscreen, this, TQT_SLOT (fullScreen ())); panel->popupMenu ()->connectItem (ControlPanel::menu_config, - this, SLOT (showConfigDialog ())); + this, TQT_SLOT (showConfigDialog ())); panel->popupMenu ()->connectItem (ControlPanel::menu_video, - m_view, SLOT(toggleVideoConsoleWindow())); + m_view, TQT_SLOT(toggleVideoConsoleWindow())); panel->popupMenu ()->connectItem (ControlPanel::menu_playlist, - m_view, SLOT (toggleShowPlaylist ())); - connect (this, SIGNAL (statusUpdated (const QString &)), - panel->view (), SLOT (setStatusMessage (const QString &))); - //connect (panel (), SIGNAL (clicked ()), m_settings, SLOT (show ())); + m_view, TQT_SLOT (toggleShowPlaylist ())); + connect (this, TQT_SIGNAL (statusUpdated (const TQString &)), + panel->view (), TQT_SLOT (setStatusMessage (const TQString &))); + //connect (panel (), TQT_SIGNAL (clicked ()), m_settings, TQT_SLOT (show ())); } void PartBase::connectPlaylist (PlayListView * playlist) { - connect (playlist, SIGNAL (addBookMark (const QString &, const QString &)), - this, SLOT (addBookMark (const QString &, const QString &))); - connect (playlist, SIGNAL (executed (QListViewItem *)), - this, SLOT (playListItemExecuted (QListViewItem *))); - connect (playlist, SIGNAL (clicked (QListViewItem *)), - this, SLOT (playListItemClicked (QListViewItem *))); - connect (this, SIGNAL (treeChanged (int, NodePtr, NodePtr, bool, bool)), - playlist, SLOT (updateTree (int, NodePtr, NodePtr, bool, bool))); - connect (this, SIGNAL (treeUpdated ()), - playlist, SLOT (triggerUpdate ())); + connect (playlist, TQT_SIGNAL (addBookMark (const TQString &, const TQString &)), + this, TQT_SLOT (addBookMark (const TQString &, const TQString &))); + connect (playlist, TQT_SIGNAL (executed (TQListViewItem *)), + this, TQT_SLOT (playListItemExecuted (TQListViewItem *))); + connect (playlist, TQT_SIGNAL (clicked (TQListViewItem *)), + this, TQT_SLOT (playListItemClicked (TQListViewItem *))); + connect (this, TQT_SIGNAL (treeChanged (int, NodePtr, NodePtr, bool, bool)), + playlist, TQT_SLOT (updateTree (int, NodePtr, NodePtr, bool, bool))); + connect (this, TQT_SIGNAL (treeUpdated ()), + playlist, TQT_SLOT (triggerUpdate ())); } void PartBase::connectInfoPanel (InfoWindow * infopanel) { - connect (this, SIGNAL (infoUpdated (const QString &)), - infopanel->view (), SLOT (setInfoMessage (const QString &))); + connect (this, TQT_SIGNAL (infoUpdated (const TQString &)), + infopanel->view (), TQT_SLOT (setInfoMessage (const TQString &))); } PartBase::~PartBase () { @@ -278,7 +278,7 @@ extern const char * strGeneralGroup; bool PartBase::setProcess (Mrl *mrl) { // determine backend, start with temp_backends - QString p = temp_backends [m_source->name()]; + TQString p = temp_backends [m_source->name()]; bool remember_backend = p.isEmpty (); bool changed = false; if (p.isEmpty ()) { @@ -287,7 +287,7 @@ bool PartBase::setProcess (Mrl *mrl) { m_config->setGroup (mrl->mimetype); p = m_config->readEntry ("player", "" ); remember_backend = !(!p.isEmpty () && - m_players.contains (p) && + m_players.tqcontains (p) && m_players [p]->supports (m_source->name ())); } } @@ -300,7 +300,7 @@ bool PartBase::setProcess (Mrl *mrl) { p = m_config->readEntry (m_source->name (), ""); } if (p.isEmpty () || - !m_players.contains (p) || + !m_players.tqcontains (p) || !m_players [p]->supports (m_source->name ())) { // finally find first supported player p.truncate (0); @@ -308,11 +308,11 @@ bool PartBase::setProcess (Mrl *mrl) { ProcessMap::const_iterator i, e = m_players.end(); for (i = m_players.begin(); i != e; ++i) if (i.data ()->supports (m_source->name ())) { - p = QString (i.data ()->name ()); + p = TQString (i.data ()->name ()); break; } } else - p = QString (m_process->name ()); + p = TQString (m_process->name ()); } if (!p.isEmpty ()) { if (!m_process || p != m_process->name ()) { @@ -361,7 +361,7 @@ void PartBase::setRecorder (const char * name) { KDE_NO_EXPORT void PartBase::slotPlayerMenu (int id) { bool playing = m_process->playing (); const char * srcname = m_source->name (); - QPopupMenu * menu = m_view->controlPanel ()->playerMenu (); + TQPopupMenu * menu = m_view->controlPanel ()->playerMenu (); ProcessMap::const_iterator pi = m_players.begin(), e = m_players.end(); unsigned i = 0; for (; pi != e && i < menu->count(); ++pi) { @@ -371,7 +371,7 @@ KDE_NO_EXPORT void PartBase::slotPlayerMenu (int id) { int menuid = menu->idAt (i); menu->setItemChecked (menuid, menuid == id); if (menuid == id) { - if (proc->name () != QString ("npp")) + if (proc->name () != TQString ("npp")) m_settings->backends [srcname] = proc->name (); temp_backends [srcname] = proc->name (); if (playing && strcmp (m_process->name (), proc->name ())) @@ -387,7 +387,7 @@ KDE_NO_EXPORT void PartBase::slotPlayerMenu (int id) { void PartBase::updatePlayerMenu (ControlPanel * panel) { if (!m_view || !m_process) return; - QPopupMenu * menu = panel->playerMenu (); + TQPopupMenu * menu = panel->playerMenu (); menu->clear (); if (!m_source) return; @@ -396,7 +396,7 @@ void PartBase::updatePlayerMenu (ControlPanel * panel) { for (ProcessMap::const_iterator i = m_players.begin(); i != e; ++i) { Process * p = i.data (); if (p->supports (m_source->name ())) { - menu->insertItem (p->menuName (), this, SLOT (slotPlayerMenu (int)), 0, id++); + menu->insertItem (p->menuName (), this, TQT_SLOT (slotPlayerMenu (int)), 0, id++); if (i.data() == m_process) menu->setItemChecked (id-1, true); } @@ -405,20 +405,20 @@ void PartBase::updatePlayerMenu (ControlPanel * panel) { void PartBase::connectSource (Source * old_source, Source * source) { if (old_source) { - disconnect (old_source, SIGNAL(endOfPlayItems ()), this, SLOT(stop ())); - disconnect (old_source, SIGNAL (dimensionsChanged ()), - this, SLOT (sourceHasChangedAspects ())); - disconnect (old_source, SIGNAL (startPlaying ()), - this, SLOT (playingStarted ())); - disconnect (old_source, SIGNAL (stopPlaying ()), - this, SLOT (playingStopped ())); + disconnect (old_source, TQT_SIGNAL(endOfPlayItems ()), this, TQT_SLOT(stop ())); + disconnect (old_source, TQT_SIGNAL (dimensionsChanged ()), + this, TQT_SLOT (sourceHasChangedAspects ())); + disconnect (old_source, TQT_SIGNAL (startPlaying ()), + this, TQT_SLOT (playingStarted ())); + disconnect (old_source, TQT_SIGNAL (stopPlaying ()), + this, TQT_SLOT (playingStopped ())); } if (source) { - connect (source, SIGNAL (endOfPlayItems ()), this, SLOT (stop ())); - connect (source, SIGNAL (dimensionsChanged ()), - this, SLOT (sourceHasChangedAspects ())); - connect (source, SIGNAL (startPlaying()), this, SLOT(playingStarted())); - connect (source, SIGNAL (stopPlaying ()), this, SLOT(playingStopped())); + connect (source, TQT_SIGNAL (endOfPlayItems ()), this, TQT_SLOT (stop ())); + connect (source, TQT_SIGNAL (dimensionsChanged ()), + this, TQT_SLOT (sourceHasChangedAspects ())); + connect (source, TQT_SIGNAL (startPlaying()), this, TQT_SLOT(playingStarted())); + connect (source, TQT_SIGNAL (stopPlaying ()), this, TQT_SLOT(playingStopped())); } } @@ -429,14 +429,14 @@ void PartBase::setSource (Source * _source) { stop (); if (m_view) { m_view->reset (); - emit infoUpdated (QString ()); + emit infoUpdated (TQString ()); } - disconnect (m_source, SIGNAL (startRecording ()), - this, SLOT (recordingStarted ())); - disconnect (this, SIGNAL (audioIsSelected (int)), - m_source, SLOT (setAudioLang (int))); - disconnect (this, SIGNAL (subtitleIsSelected (int)), - m_source, SLOT (setSubtitle (int))); + disconnect (m_source, TQT_SIGNAL (startRecording ()), + this, TQT_SLOT (recordingStarted ())); + disconnect (this, TQT_SIGNAL (audioIsSelected (int)), + m_source, TQT_SLOT (setAudioLang (int))); + disconnect (this, TQT_SIGNAL (subtitleIsSelected (int)), + m_source, TQT_SLOT (setSubtitle (int))); } if (m_view) { if (m_auto_controls) @@ -450,23 +450,23 @@ void PartBase::setSource (Source * _source) { m_source = _source; connectSource (old_source, m_source); m_process->setSource (m_source); - connect (m_source, SIGNAL(startRecording()), this,SLOT(recordingStarted())); - connect (this, SIGNAL (audioIsSelected (int)), - m_source, SLOT (setAudioLang (int))); - connect (this, SIGNAL (subtitleIsSelected (int)), - m_source, SLOT (setSubtitle (int))); + connect (m_source, TQT_SIGNAL(startRecording()), this,TQT_SLOT(recordingStarted())); + connect (this, TQT_SIGNAL (audioIsSelected (int)), + m_source, TQT_SLOT (setAudioLang (int))); + connect (this, TQT_SIGNAL (subtitleIsSelected (int)), + m_source, TQT_SLOT (setSubtitle (int))); m_source->init (); m_source->setIdentified (false); if (m_view && m_view->viewer ()) { updatePlayerMenu (m_view->controlPanel ()); m_view->viewer ()->setAspect (0.0); } - if (m_source) QTimer::singleShot (0, m_source, SLOT (activate ())); + if (m_source) TQTimer::singleShot (0, m_source, TQT_SLOT (activate ())); updateTree (true, true); emit sourceChanged (old_source, m_source); } -KDE_NO_EXPORT void PartBase::changeURL (const QString & url) { +KDE_NO_EXPORT void PartBase::changeURL (const TQString & url) { emit urlChanged (url); } @@ -486,7 +486,7 @@ bool PartBase::openURL (const KURL & url) { kdDebug () << "PartBase::openURL " << url.url() << url.isValid () << endl; if (!m_view) return false; stop (); - Source * src = (url.isEmpty () ? m_sources ["urlsource"] : (!url.protocol ().compare ("kmplayer") && m_sources.contains (url.host ()) ? m_sources [url.host ()] : m_sources ["urlsource"])); + Source * src = (url.isEmpty () ? m_sources ["urlsource"] : (!url.protocol ().compare ("kmplayer") && m_sources.tqcontains (url.host ()) ? m_sources [url.host ()] : m_sources ["urlsource"])); src->setSubURL (KURL ()); src->setURL (url); setSource (src); @@ -545,7 +545,7 @@ void PartBase::recordingStopped () { setRecorder ("mencoder"); //FIXME see PartBase::record() checking playing() } -void PartBase::timerEvent (QTimerEvent * e) { +void PartBase::timerEvent (TQTimerEvent * e) { if (e->timerId () == m_record_timer) { kdDebug () << "record timer event" << (m_recorder->playing () && !playing ()) << endl; m_record_timer = 0; @@ -615,13 +615,13 @@ void PartBase::forward () { m_source->forward (); } -KDE_NO_EXPORT void PartBase::playListItemClicked (QListViewItem * item) { +KDE_NO_EXPORT void PartBase::playListItemClicked (TQListViewItem * item) { if (!item) return; PlayListItem * vi = static_cast <PlayListItem *> (item); RootPlayListItem * ri = vi->playListView ()->rootItem (item); if (ri == item && vi->node) { - QString src = ri->source; + TQString src = ri->source; //kdDebug() << "playListItemClicked " << src << " " << vi->node->nodeName() << endl; Source * source = src.isEmpty() ? m_source : m_sources[src.ascii()]; if (vi->node->isPlayable ()) { @@ -634,7 +634,7 @@ KDE_NO_EXPORT void PartBase::playListItemClicked (QListViewItem * item) { updateTree (); // items already deleted } -KDE_NO_EXPORT void PartBase::playListItemExecuted (QListViewItem * item) { +KDE_NO_EXPORT void PartBase::playListItemExecuted (TQListViewItem * item) { if (m_in_update_tree) return; if (m_view->editMode ()) return; PlayListItem * vi = static_cast <PlayListItem *> (item); @@ -642,7 +642,7 @@ KDE_NO_EXPORT void PartBase::playListItemExecuted (QListViewItem * item) { if (ri == item) return; // both null or handled by playListItemClicked if (vi->node) { - QString src = ri->source; + TQString src = ri->source; //kdDebug() << "playListItemExecuted " << src << " " << vi->node->nodeName() << endl; Source * source = src.isEmpty() ? m_source : m_sources[src.ascii()]; if (vi->node->isPlayable ()) { @@ -657,11 +657,11 @@ KDE_NO_EXPORT void PartBase::playListItemExecuted (QListViewItem * item) { vi->m_attr->name () == StringPool::attr_url || vi->m_attr->name () == StringPool::attr_value || vi->m_attr->name () == "data") { - QString src (vi->m_attr->value ()); + TQString src (vi->m_attr->value ()); if (!src.isEmpty ()) { - PlayListItem * pi = static_cast <PlayListItem*>(item->parent()); + PlayListItem * pi = static_cast <PlayListItem*>(item->tqparent()); if (pi) { - for (NodePtr e = pi->node; e; e = e->parentNode ()) { + for (NodePtr e = pi->node; e; e = e->tqparentNode ()) { Mrl * mrl = e->mrl (); if (mrl) src = KURL (mrl->absolutePath (), src).url (); @@ -698,15 +698,15 @@ void PartBase::updateTree (bool full, bool force) { m_update_tree_full |= full; } -void PartBase::updateInfo (const QString & msg) { +void PartBase::updateInfo (const TQString & msg) { emit infoUpdated (msg); } -void PartBase::updateStatus (const QString & msg) { +void PartBase::updatetqStatus (const TQString & msg) { emit statusUpdated (msg); } -void PartBase::setLanguages (const QStringList & al, const QStringList & sl) { +void PartBase::setLanguages (const TQStringList & al, const TQStringList & sl) { emit languagesUpdated (al, sl); } @@ -719,19 +719,19 @@ KDE_NO_EXPORT void PartBase::subtitleSelected (int id) { } void PartBase::record () { - if (m_view) m_view->setCursor (QCursor (Qt::WaitCursor)); + if (m_view) m_view->setCursor (TQCursor (TQt::WaitCursor)); if (m_recorder->playing ()) { m_recorder->stop (); } else { m_settings->show ("RecordPage"); m_view->controlPanel ()->setRecording (false); } - if (m_view) m_view->setCursor (QCursor (Qt::ArrowCursor)); + if (m_view) m_view->setCursor (TQCursor (TQt::ArrowCursor)); } void PartBase::play () { if (!m_process || !m_view) return; - QPushButton * pb = ::qt_cast <QPushButton *> (sender ()); + TQPushButton * pb = ::tqqt_cast <TQPushButton *> (sender ()); if (pb && !pb->isOn ()) { stop (); return; @@ -743,16 +743,16 @@ void PartBase::play () { if (m_process->state () == Process::NotRunning) { PlayListItem * lvi = m_view->playList ()->currentPlayListItem (); if (lvi) { // make sure it's in the first tree - QListViewItem * pitem = lvi; - while (pitem->parent()) - pitem = pitem->parent(); + TQListViewItem * pitem = lvi; + while (pitem->tqparent()) + pitem = pitem->tqparent(); if (pitem != m_view->playList ()->firstChild ()) lvi = 0L; } if (!lvi) lvi = static_cast<PlayListItem*>(m_view->playList()->firstChild()); if (lvi) - for (NodePtr n = lvi->node; n; n = n->parentNode ()) { + for (NodePtr n = lvi->node; n; n = n->tqparentNode ()) { if (n->isPlayable ()) { m_source->setCurrent (n); break; @@ -770,18 +770,18 @@ bool PartBase::playing () const { } void PartBase::stop () { - QPushButton * b = m_view ? m_view->controlPanel ()->button (ControlPanel::button_stop) : 0L; + TQPushButton * b = m_view ? m_view->controlPanel ()->button (ControlPanel::button_stop) : 0L; if (b) { if (!b->isOn ()) b->toggle (); - m_view->setCursor (QCursor (Qt::WaitCursor)); + m_view->setCursor (TQCursor (TQt::WaitCursor)); } if (m_process) m_process->quit (); if (m_source) m_source->reset (); if (m_view) { - m_view->setCursor (QCursor (Qt::ArrowCursor)); + m_view->setCursor (TQCursor (TQt::ArrowCursor)); if (b->isOn ()) b->toggle (); m_view->controlPanel ()->setPlaying (false); @@ -814,11 +814,7 @@ KDE_NO_EXPORT void PartBase::posSliderPressed () { KDE_NO_EXPORT void PartBase::posSliderReleased () { m_bPosSliderPressed=false; -#if (QT_VERSION < 0x030200) - const QSlider * posSlider = dynamic_cast <const QSlider *> (sender ()); -#else - const QSlider * posSlider = ::qt_cast<const QSlider *> (sender ()); -#endif + const TQSlider * posSlider = ::tqqt_cast<const TQSlider *> (sender ()); if (posSlider) m_process->seek (posSlider->value(), true); } @@ -860,7 +856,7 @@ KDE_NO_EXPORT void PartBase::sourceHasChangedAspects () { } KDE_NO_EXPORT void PartBase::positionValueChanged (int pos) { - QSlider * slider = ::qt_cast <QSlider *> (sender ()); + TQSlider * slider = ::tqqt_cast <TQSlider *> (sender ()); if (slider && slider->isEnabled ()) m_process->seek (pos, true); } @@ -885,8 +881,8 @@ KAboutData* PartBase::createAboutData () { //----------------------------------------------------------------------------- -Source::Source (const QString & name, PartBase * player, const char * n) - : QObject (player, n), +Source::Source (const TQString & name, PartBase * player, const char * n) + : TQObject (player, n), m_name (name), m_player (player), m_identified (false), m_auto_play (true), m_frequency (0), m_xvport (0), m_xvencoding (-1), m_doc_timer (0) { init (); @@ -910,7 +906,7 @@ void Source::init () { m_recordcmd.truncate (0); } -KDE_NO_EXPORT void Source::setLanguages (const QStringList & alang, const QStringList & slang) { +KDE_NO_EXPORT void Source::setLanguages (const TQStringList & alang, const TQStringList & slang) { m_player->setLanguages (alang, slang); } @@ -971,13 +967,13 @@ KDE_NO_EXPORT void Source::setLoading (int percentage) { } /* -static void printTree (NodePtr root, QString off=QString()) { +static void printTree (NodePtr root, TQString off=TQString()) { if (!root) { kdDebug() << off << "[null]" << endl; return; } - kdDebug() << off << root->nodeName() << " " << (Element*)root << (root->isPlayable() ? root->mrl ()->src : QString ("-")) << endl; - off += QString (" "); + kdDebug() << off << root->nodeName() << " " << (Element*)root << (root->isPlayable() ? root->mrl ()->src : TQString ("-")) << endl; + off += TQString (" "); for (NodePtr e = root->firstChild(); e; e = e->nextSibling()) printTree(e, off); }*/ @@ -1001,7 +997,7 @@ void Source::setURL (const KURL & url) { m_current = m_document; } -void Source::setTitle (const QString & title) { +void Source::setTitle (const TQString & title) { emit titleChanged (title); } @@ -1027,14 +1023,14 @@ void Source::reset () { init (); } -QString Source::currentMrl () { +TQString Source::currentMrl () { Mrl * mrl = m_current ? m_current->mrl () : 0L; - kdDebug() << "Source::currentMrl " << (m_current ? m_current->nodeName():"") << " src:" << (mrl ? mrl->absolutePath () : QString ()) << endl; - return mrl ? mrl->absolutePath () : QString (); + kdDebug() << "Source::currentMrl " << (m_current ? m_current->nodeName():"") << " src:" << (mrl ? mrl->absolutePath () : TQString ()) << endl; + return mrl ? mrl->absolutePath () : TQString (); } void Source::playCurrent () { - QString url = currentMrl (); + TQString url = currentMrl (); m_player->changeURL (url); m_width = m_height = 0; m_aspect = 0.0; @@ -1044,7 +1040,7 @@ void Source::playCurrent () { if (!m_current) m_document->activate (); else { // ugly code duplicate w/ back_request - for (NodePtr p = m_current->parentNode(); p; p = p->parentNode()) + for (NodePtr p = m_current->tqparentNode(); p; p = p->tqparentNode()) p->state = Element::state_activated; m_current->activate (); } @@ -1097,7 +1093,7 @@ bool Source::requestPlayURL (NodePtr mrl) { else m_back_request = mrl; m_player->updateTree (); - QTimer::singleShot (0, this, SLOT (playCurrent ())); + TQTimer::singleShot (0, this, TQT_SLOT (playCurrent ())); } m_player->setProcess (mrl->mrl ()); return true; @@ -1114,7 +1110,7 @@ void Source::setTimeout (int ms) { m_doc_timer = ms > -1 ? startTimer (ms) : 0; } -void Source::timerEvent (QTimerEvent * e) { +void Source::timerEvent (TQTimerEvent * e) { if (e->timerId () == m_doc_timer && m_document && m_document->active ()) m_document->document ()->timer (); // will call setTimeout() else @@ -1137,7 +1133,7 @@ void Source::stateElementChanged (Node * elm, Node::State os, Node::State ns) { //a SMIL movies stopped by SMIL events rather than movie just ending m_player->process ()->stop (); if (m_player->view ()) // move away the video widget - QTimer::singleShot (0, m_player->view (), SLOT (updateLayout ())); + TQTimer::singleShot (0, m_player->view (), TQT_SLOT (updateLayout ())); } else if ((ns == Node::state_deferred || (os == Node::state_deferred && ns > Node::state_deferred)) && elm == m_document) { @@ -1145,7 +1141,7 @@ void Source::stateElementChanged (Node * elm, Node::State os, Node::State ns) { } else if (ns == Node::state_activated && elm->isPlayable () && elm->mrl ()->view_mode == Mrl::SingleMode) { - Node *p = elm->parentNode(); + Node *p = elm->tqparentNode(); if (!p || !p->mrl () || p->mrl ()->view_mode == Mrl::SingleMode) // make sure we don't set current to nested document m_current = elm; @@ -1164,7 +1160,7 @@ SurfacePtr Source::getSurface (NodePtr n) { return 0L; } -void Source::setInfoMessage (const QString & msg) { +void Source::setInfoMessage (const TQString & msg) { m_player->updateInfo (msg); } @@ -1173,10 +1169,10 @@ void Source::bitRates (int & preferred, int & maximal) { maximal= 1024 * m_player->settings ()->maxbitrate; } -void Source::insertURL (NodePtr node, const QString & mrl, const QString & title) { +void Source::insertURL (NodePtr node, const TQString & mrl, const TQString & title) { if (!node || !node->mrl ()) // this should always be false return; - QString cur_url = node->mrl ()->absolutePath (); + TQString cur_url = node->mrl ()->absolutePath (); KURL url (cur_url, mrl); kdDebug() << "Source::insertURL " << KURL (cur_url) << " " << url << endl; if (!url.isValid ()) @@ -1185,7 +1181,7 @@ void Source::insertURL (NodePtr node, const QString & mrl, const QString & title kdError () << "try to append url to itself" << endl; else { int depth = 0; // cache this? - for (NodePtr e = node; e->parentNode (); e = e->parentNode ()) + for (NodePtr e = node; e->tqparentNode (); e = e->tqparentNode ()) ++depth; if (depth < 40) { node->appendChild (new GenericURL (m_document, KURL::decode_string (url.url ()), title.isEmpty() ? KURL::decode_string (mrl) : title)); @@ -1197,7 +1193,7 @@ void Source::insertURL (NodePtr node, const QString & mrl, const QString & title void Source::play () { m_player->updateTree (); - QTimer::singleShot (0, m_player, SLOT (play ())); + TQTimer::singleShot (0, m_player, TQT_SLOT (play ())); //printTree (m_document); } @@ -1222,12 +1218,12 @@ void Source::backward () { else if (m_current) { m_document->reset (); m_current = e; - QTimer::singleShot (0, this, SLOT (playCurrent ())); + TQTimer::singleShot (0, this, TQT_SLOT (playCurrent ())); } return; } } else - m_back_request = m_back_request->parentNode (); + m_back_request = m_back_request->tqparentNode (); } m_back_request = 0L; } else @@ -1253,7 +1249,7 @@ void Source::jump (NodePtr e) { if (m_current) m_document->reset (); m_current = e; - QTimer::singleShot (0, this, SLOT (playCurrent ())); + TQTimer::singleShot (0, this, TQT_SLOT (playCurrent ())); } } else m_player->updateTree (); @@ -1261,7 +1257,7 @@ void Source::jump (NodePtr e) { NodePtr Source::document () { if (!m_document) - m_document = new Document (QString (), this); + m_document = new Document (TQString (), this); return m_document; } @@ -1269,13 +1265,13 @@ NodePtr Source::root () { return document (); } -bool Source::processOutput (const QString &) { +bool Source::processOutput (const TQString &) { return false; } -QString Source::filterOptions () { +TQString Source::filterOptions () { Settings* m_settings = m_player->settings (); - QString PPargs (""); + TQString PPargs (""); if (m_settings->postprocessing) { if (m_settings->pp_default) @@ -1371,7 +1367,7 @@ void Source::setIdentified (bool b) { m_identified = b; } -static const QString statemap [] = { +static const TQString statemap [] = { i18n ("Not Running"), i18n ("Ready"), i18n ("Buffering"), i18n ("Playing") }; @@ -1380,7 +1376,7 @@ void Source::stateChange(Process *p, Process::State olds, Process::State news) { Recorder *rec = dynamic_cast <Recorder *> (p); if (rec && !rec->recordURL ().isEmpty ()) { kdDebug () << "recordState " << statemap[olds] << " -> " << statemap[news] << endl; - m_player->updateStatus (i18n ("Recorder %1 %2").arg (p->name ()).arg (statemap[news])); + m_player->updatetqStatus (i18n ("Recorder %1 %2").arg (p->name ()).arg (statemap[news])); p->viewer ()->view ()->controlPanel ()->setRecording (news > Process::Ready); if (news == Process::Ready) { if (olds > Process::Ready) { @@ -1398,7 +1394,7 @@ void Source::stateChange(Process *p, Process::State olds, Process::State news) { } else { p->viewer()->view()->controlPanel()->setPlaying(news > Process::Ready); kdDebug () << "processState " << statemap[olds] << " -> " << statemap[news] << endl; - m_player->updateStatus (i18n ("Player %1 %2").arg (p->name ()).arg (statemap[news])); + m_player->updatetqStatus (i18n ("Player %1 %2").arg (p->name ()).arg (statemap[news])); if (!p->mrl () && news > Process::Ready) { p->stop (); // reschedule for Ready state } else if (news == Process::Playing) { @@ -1428,9 +1424,9 @@ void Source::stateChange(Process *p, Process::State olds, Process::State news) { m_current->id < SMIL::id_node_last) { playCurrent (); // just play back_request } else { - // sanitize pl having all parents of current activated + // sanitize pl having all tqparents of current activated m_document->reset (); // deactivate everything - for (NodePtr p = m_current->parentNode(); p; p = p->parentNode()) + for (NodePtr p = m_current->tqparentNode(); p; p = p->tqparentNode()) p->state = Element::state_activated; m_current->activate (); // calls requestPlayUrl } @@ -1441,9 +1437,9 @@ void Source::stateChange(Process *p, Process::State olds, Process::State news) { } if (m_player->view() && (!mrl || mrl->view_mode != Mrl::WindowMode)) - static_cast<View*>(m_player->view())->viewArea()->repaint(); + static_cast<View*>(m_player->view())->viewArea()->tqrepaint(); } else - QTimer::singleShot (0, this, SLOT (playCurrent ())); + TQTimer::singleShot (0, this, TQT_SLOT (playCurrent ())); } else if (news == Process::Buffering) { if (p->mrl ()->mrl ()->view_mode != Mrl::SingleMode) p->mrl ()->defer (); // paused the SMIL @@ -1451,12 +1447,12 @@ void Source::stateChange(Process *p, Process::State olds, Process::State news) { } } -QString Source::plugin (const QString &mime) const { +TQString Source::plugin (const TQString &mime) const { m_player->config ()->setGroup (mime); return m_player->config ()->readEntry ("plugin", "" ); } -QString Source::prettyName () { +TQString Source::prettyName () { return i18n ("Unknown"); } @@ -1506,7 +1502,7 @@ KDE_NO_EXPORT void URLSource::stopResolving () { for (SharedPtr <ResolveInfo> ri = m_resolve_info; ri; ri = ri->next) ri->job->kill (); m_resolve_info = 0L; - m_player->updateStatus (i18n ("Disconnected")); + m_player->updatetqStatus (i18n ("Disconnected")); m_player->setLoaded (100); } } @@ -1537,16 +1533,16 @@ void URLSource::deactivate () { getSurface (0L); } -QString URLSource::prettyName () { +TQString URLSource::prettyName () { if (m_url.isEmpty ()) return i18n ("URL"); if (m_url.url ().length () > 50) { - QString newurl = m_url.protocol () + QString ("://"); + TQString newurl = m_url.protocol () + TQString ("://"); if (m_url.hasHost ()) newurl += m_url.host (); if (m_url.port ()) - newurl += QString (":%1").arg (m_url.port ()); - QString file = m_url.fileName (); + newurl += TQString (":%1").arg (m_url.port ()); + TQString file = m_url.fileName (); int len = newurl.length () + file.length (); KURL path = KURL (m_url.directory ()); bool modified = false; @@ -1554,20 +1550,20 @@ QString URLSource::prettyName () { path = path.upURL (); modified = true; } - QString dir = path.directory (); - if (!dir.endsWith (QString ("/"))) + TQString dir = path.directory (); + if (!dir.endsWith (TQString ("/"))) dir += '/'; if (modified) - dir += QString (".../"); + dir += TQString (".../"); newurl += dir + file; return i18n ("URL - %1").arg (newurl); } return i18n ("URL - %1").arg (m_url.prettyURL ()); } -static bool isPlayListMime (const QString & mime) { - QString m (mime); - int plugin_pos = m.find ("-plugin"); +static bool isPlayListMime (const TQString & mime) { + TQString m (mime); + int plugin_pos = m.tqfind ("-plugin"); if (plugin_pos > 0) m.truncate (plugin_pos); const char * mimestr = m.ascii (); @@ -1595,8 +1591,8 @@ static bool isPlayListMime (const QString & mime) { !strcmp (mimestr, "application/x-mplayer2")); } -KDE_NO_EXPORT void URLSource::read (NodePtr root, QTextStream & textstream) { - QString line; +KDE_NO_EXPORT void URLSource::read (NodePtr root, TQTextStream & textstream) { + TQString line; do { line = textstream.readLine (); } while (!line.isNull () && line.stripWhiteSpace ().isEmpty ()); @@ -1604,25 +1600,25 @@ KDE_NO_EXPORT void URLSource::read (NodePtr root, QTextStream & textstream) { NodePtr cur_elm = root; if (cur_elm->isPlayable ()) cur_elm = cur_elm->mrl ()->linkNode (); - if (cur_elm->mrl ()->mimetype == QString ("audio/x-scpls")) { + if (cur_elm->mrl ()->mimetype == TQString ("audio/x-scpls")) { bool groupfound = false; int nr = -1; struct Entry { - QString url, title; + TQString url, title; } * entries = 0L; do { line = line.stripWhiteSpace (); if (!line.isEmpty ()) { - if (line.startsWith (QString ("[")) && line.endsWith (QString ("]"))) { - if (!groupfound && line.mid (1, line.length () - 2).stripWhiteSpace () == QString ("playlist")) + if (line.startsWith (TQString ("[")) && line.endsWith (TQString ("]"))) { + if (!groupfound && line.mid (1, line.length () - 2).stripWhiteSpace () == TQString ("playlist")) groupfound = true; else break; kdDebug () << "Group found: " << line << endl; } else if (groupfound) { - int eq_pos = line.find (QChar ('=')); + int eq_pos = line.tqfind (TQChar ('=')); if (eq_pos > 0) { - if (line.lower ().startsWith (QString ("numberofentries"))) { + if (line.lower ().startsWith (TQString ("numberofentries"))) { nr = line.mid (eq_pos + 1).stripWhiteSpace ().toInt (); kdDebug () << "numberofentries : " << nr << endl; if (nr > 0 && nr < 1024) @@ -1630,12 +1626,12 @@ KDE_NO_EXPORT void URLSource::read (NodePtr root, QTextStream & textstream) { else nr = 0; } else if (nr > 0) { - QString ll = line.lower (); - if (ll.startsWith (QString ("file"))) { + TQString ll = line.lower (); + if (ll.startsWith (TQString ("file"))) { int i = line.mid (4, eq_pos-4).toInt (); if (i > 0 && i <= nr) entries[i-1].url = line.mid (eq_pos + 1).stripWhiteSpace (); - } else if (ll.startsWith (QString ("title"))) { + } else if (ll.startsWith (TQString ("title"))) { int i = line.mid (5, eq_pos-5).toInt (); if (i > 0 && i <= nr) entries[i-1].title = line.mid (eq_pos + 1).stripWhiteSpace (); @@ -1650,29 +1646,29 @@ KDE_NO_EXPORT void URLSource::read (NodePtr root, QTextStream & textstream) { if (!entries[i].url.isEmpty ()) cur_elm->appendChild (new GenericURL (m_document, KURL::decode_string (entries[i].url), entries[i].title)); delete [] entries; - } else if (line.stripWhiteSpace ().startsWith (QChar ('<'))) { + } else if (line.stripWhiteSpace ().startsWith (TQChar ('<'))) { readXML (cur_elm, textstream, line); //cur_elm->normalize (); if (m_document && m_document->firstChild ()) { - // SMIL documents have set its size of root-layout + // SMIL documents have set its size of root-tqlayout Mrl * mrl = m_document->firstChild ()->mrl (); if (mrl) Source::setDimensions (m_document->firstChild (), mrl->width, mrl->height); } - } else if (line.lower () != QString ("[reference]")) do { - QString mrl = line.stripWhiteSpace (); - if (line == QString ("--stop--")) + } else if (line.lower () != TQString ("[reference]")) do { + TQString mrl = line.stripWhiteSpace (); + if (line == TQString ("--stop--")) break; - if (mrl.lower ().startsWith (QString ("asf "))) + if (mrl.lower ().startsWith (TQString ("asf "))) mrl = mrl.mid (4).stripWhiteSpace (); - if (!mrl.isEmpty () && !mrl.startsWith (QChar ('#'))) + if (!mrl.isEmpty () && !mrl.startsWith (TQChar ('#'))) cur_elm->appendChild (new GenericURL (m_document, mrl)); line = textstream.readLine (); } while (!line.isNull ()); /* TODO && m_document.size () < 1024 / * support 1k entries * /);*/ } } -KDE_NO_EXPORT void URLSource::kioData (KIO::Job * job, const QByteArray & d) { +KDE_NO_EXPORT void URLSource::kioData (KIO::Job * job, const TQByteArray & d) { SharedPtr <ResolveInfo> rinfo = m_resolve_info; while (rinfo && rinfo->job != job) rinfo = rinfo->next; @@ -1686,7 +1682,7 @@ KDE_NO_EXPORT void URLSource::kioData (KIO::Job * job, const QByteArray & d) { int accuraty = 0; KMimeType::Ptr mime = KMimeType::findByContent (d, &accuraty); if (!mime || - !mime->name ().startsWith (QString ("text/")) || + !mime->name ().startsWith (TQString ("text/")) || (newsize > 4 && !strncmp (d.data (), "RIFF", 4))) { newsize = 0; kdDebug () << "URLSource::kioData: " << mime->name () << accuraty << endl; @@ -1704,7 +1700,7 @@ KDE_NO_EXPORT void URLSource::kioData (KIO::Job * job, const QByteArray & d) { } } -KDE_NO_EXPORT void URLSource::kioMimetype (KIO::Job * job, const QString & mimestr) { +KDE_NO_EXPORT void URLSource::kioMimetype (KIO::Job * job, const TQString & mimestr) { SharedPtr <ResolveInfo> rinfo = m_resolve_info; while (rinfo && rinfo->job != job) rinfo = rinfo->next; @@ -1728,13 +1724,13 @@ KDE_NO_EXPORT void URLSource::kioResult (KIO::Job * job) { kdWarning () << "Spurious kioData" << endl; return; } - m_player->updateStatus (""); + m_player->updatetqStatus (""); m_player->setLoaded (100); if (previnfo) previnfo->next = rinfo->next; else m_resolve_info = rinfo->next; - QTextStream textstream (rinfo->data, IO_ReadOnly); + TQTextStream textstream (rinfo->data, IO_ReadOnly); if (rinfo->resolving_mrl) { if (isPlayListMime (rinfo->resolving_mrl->mrl ()->mimetype)) read (rinfo->resolving_mrl, textstream); @@ -1794,19 +1790,19 @@ bool URLSource::resolveURL (NodePtr m) { if (!mrl || mrl->src.isEmpty ()) return true; int depth = 0; - for (NodePtr e = m->parentNode (); e; e = e->parentNode ()) + for (NodePtr e = m->tqparentNode (); e; e = e->tqparentNode ()) ++depth; if (depth > 40) return true; KURL url (mrl->absolutePath ()); - QString mimestr = mrl->mimetype; + TQString mimestr = mrl->mimetype; if (mimestr == "application/x-shockwave-flash" || mimestr == "application/futuresplash") return true; // FIXME bool maybe_playlist = isPlayListMime (mimestr); kdDebug () << "resolveURL " << mrl->absolutePath () << " " << mimestr << endl; if (url.isLocalFile ()) { - QFile file (url.path ()); + TQFile file (url.path ()); if (!file.exists ()) { kdWarning () << "resolveURL " << url.path() << " not found" << endl; return true; @@ -1823,39 +1819,39 @@ bool URLSource::resolveURL (NodePtr m) { int nr_bytes = file.readBlock (databuf, 512); if (nr_bytes > 3) { int accuraty = 0; - KMimeType::Ptr mime = KMimeType::findByContent (QCString (databuf, nr_bytes), &accuraty); - if ((mime && !mime->name().startsWith (QString("text/"))) || + KMimeType::Ptr mime = KMimeType::findByContent (TQCString (databuf, nr_bytes), &accuraty); + if ((mime && !mime->name().startsWith (TQString("text/"))) || !strncmp (databuf, "RIFF", 4)) { return true; } - kdDebug () << "mime: " << (mime ? mime->name (): QString("null")) << endl; + kdDebug () << "mime: " << (mime ? mime->name (): TQString("null")) << endl; } file.reset (); - QTextStream textstream (&file); + TQTextStream textstream (&file); read (m, textstream); } } else if ((maybe_playlist && - url.protocol ().compare (QString ("mms")) && - url.protocol ().compare (QString ("rtsp")) && - url.protocol ().compare (QString ("rtp"))) || + url.protocol ().compare (TQString ("mms")) && + url.protocol ().compare (TQString ("rtsp")) && + url.protocol ().compare (TQString ("rtp"))) || (mimestr.isEmpty () && - (url.protocol ().startsWith (QString ("http")) || - url.protocol () == QString::fromLatin1 ("media") || - url.protocol () == QString::fromLatin1 ("remote")))) { + (url.protocol ().startsWith (TQString ("http")) || + url.protocol () == TQString::tqfromLatin1 ("media") || + url.protocol () == TQString::tqfromLatin1 ("remote")))) { KIO::Job * job = KIO::get (url, false, false); job->addMetaData ("PropagateHttpHeader", "true"); job->addMetaData ("errorPage", "false"); m_resolve_info = new ResolveInfo (m, job, m_resolve_info); - connect (m_resolve_info->job, SIGNAL(data(KIO::Job*,const QByteArray&)), - this, SLOT (kioData (KIO::Job *, const QByteArray &))); - //connect( m_job, SIGNAL(connected(KIO::Job*)), - // this, SLOT(slotConnected(KIO::Job*))); - connect(m_resolve_info->job, SIGNAL(mimetype(KIO::Job*,const QString&)), - this, SLOT (kioMimetype (KIO::Job *, const QString &))); - connect (m_resolve_info->job, SIGNAL (result (KIO::Job *)), - this, SLOT (kioResult (KIO::Job *))); + connect (m_resolve_info->job, TQT_SIGNAL(data(KIO::Job*,const TQByteArray&)), + this, TQT_SLOT (kioData (KIO::Job *, const TQByteArray &))); + //connect( m_job, TQT_SIGNAL(connected(KIO::Job*)), + // this, TQT_SLOT(slotConnected(KIO::Job*))); + connect(m_resolve_info->job, TQT_SIGNAL(mimetype(KIO::Job*,const TQString&)), + this, TQT_SLOT (kioMimetype (KIO::Job *, const TQString &))); + connect (m_resolve_info->job, TQT_SIGNAL (result (KIO::Job *)), + this, TQT_SLOT (kioResult (KIO::Job *))); static_cast <View *> (m_player->view ())->controlPanel ()->setPlaying (true); - m_player->updateStatus (i18n ("Connecting")); + m_player->updatetqStatus (i18n ("Connecting")); m_player->setLoaded (0); return false; // wait for result .. } @@ -1869,16 +1865,16 @@ namespace KMPlayer { static DataCache * memory_cache; } -void DataCache::add (const QString & url, const QByteArray & data) { - QByteArray bytes; +void DataCache::add (const TQString & url, const TQByteArray & data) { + TQByteArray bytes; bytes.duplicate (data); cache_map.insert (url, bytes); preserve_map.erase (url); emit preserveRemoved (url); } -bool DataCache::get (const QString & url, QByteArray & data) { - DataMap::const_iterator it = cache_map.find (url); +bool DataCache::get (const TQString & url, TQByteArray & data) { + DataMap::const_iterator it = cache_map.tqfind (url); if (it != cache_map.end ()) { data.duplicate (it.data ()); return true; @@ -1886,8 +1882,8 @@ bool DataCache::get (const QString & url, QByteArray & data) { return false; } -bool DataCache::preserve (const QString & url) { - PreserveMap::const_iterator it = preserve_map.find (url); +bool DataCache::preserve (const TQString & url) { + PreserveMap::const_iterator it = preserve_map.tqfind (url); if (it == preserve_map.end ()) { preserve_map.insert (url, true); return true; @@ -1895,12 +1891,12 @@ bool DataCache::preserve (const QString & url) { return false; } -bool DataCache::isPreserved (const QString & url) { - return preserve_map.find (url) != preserve_map.end (); +bool DataCache::isPreserved (const TQString & url) { + return preserve_map.tqfind (url) != preserve_map.end (); } -bool DataCache::unpreserve (const QString & url) { - const PreserveMap::iterator it = preserve_map.find (url); +bool DataCache::unpreserve (const TQString & url) { + const PreserveMap::iterator it = preserve_map.tqfind (url); if (it == preserve_map.end ()) return false; preserve_map.erase (it); @@ -1918,11 +1914,11 @@ RemoteObjectPrivate::~RemoteObjectPrivate () { clear (); } -KDE_NO_EXPORT bool RemoteObjectPrivate::download (const QString & str) { +KDE_NO_EXPORT bool RemoteObjectPrivate::download (const TQString & str) { url = str; KURL kurl (str); if (kurl.isLocalFile ()) { - QFile file (kurl.path ()); + TQFile file (kurl.path ()); if (file.exists () && file.open (IO_ReadOnly)) { data = file.readAll (); file.close (); @@ -1938,16 +1934,16 @@ KDE_NO_EXPORT bool RemoteObjectPrivate::download (const QString & str) { if (memory_cache->preserve (str)) { //kdDebug () << "downloading " << str << endl; job = KIO::get (kurl, false, 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 (mimetype (KIO::Job *, const QString &)), - this, SLOT (slotMimetype (KIO::Job *, const QString &))); + 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 (mimetype (KIO::Job *, const TQString &)), + this, TQT_SLOT (slotMimetype (KIO::Job *, const TQString &))); } else { //kdDebug () << "download preserved " << str << endl; - connect (memory_cache, SIGNAL (preserveRemoved (const QString &)), - this, SLOT (cachePreserveRemoved (const QString &))); + connect (memory_cache, TQT_SIGNAL (preserveRemoved (const TQString &)), + this, TQT_SLOT (cachePreserveRemoved (const TQString &))); preserve_wait = true; } return false; @@ -1959,8 +1955,8 @@ KDE_NO_EXPORT void RemoteObjectPrivate::clear () { job = 0L; memory_cache->unpreserve (url); } else if (preserve_wait) { - disconnect (memory_cache, SIGNAL (preserveRemoved (const QString &)), - this, SLOT (cachePreserveRemoved (const QString &))); + disconnect (memory_cache, TQT_SIGNAL (preserveRemoved (const TQString &)), + this, TQT_SLOT (cachePreserveRemoved (const TQString &))); preserve_wait = false; } } @@ -1975,17 +1971,17 @@ KDE_NO_EXPORT void RemoteObjectPrivate::slotResult (KIO::Job * kjob) { } KDE_NO_EXPORT -void RemoteObjectPrivate::cachePreserveRemoved (const QString & str) { +void RemoteObjectPrivate::cachePreserveRemoved (const TQString & str) { if (str == url && !memory_cache->isPreserved (str)) { preserve_wait = false; - disconnect (memory_cache, SIGNAL (preserveRemoved (const QString &)), - this, SLOT (cachePreserveRemoved (const QString &))); + disconnect (memory_cache, TQT_SIGNAL (preserveRemoved (const TQString &)), + this, TQT_SLOT (cachePreserveRemoved (const TQString &))); download (str); } } KDE_NO_EXPORT -void RemoteObjectPrivate::slotData (KIO::Job*, const QByteArray& qb) { +void RemoteObjectPrivate::slotData (KIO::Job*, const TQByteArray& qb) { if (qb.size ()) { int old_size = data.size (); data.resize (old_size + qb.size ()); @@ -1994,7 +1990,7 @@ void RemoteObjectPrivate::slotData (KIO::Job*, const QByteArray& qb) { } KDE_NO_EXPORT -void RemoteObjectPrivate::slotMimetype (KIO::Job *, const QString & m) { +void RemoteObjectPrivate::slotMimetype (KIO::Job *, const TQString & m) { mime = m; } @@ -2015,12 +2011,12 @@ KDE_NO_EXPORT void RemoteObject::killWGet () { /** * Gets contents from url and puts it in m_data */ -KDE_NO_EXPORT bool RemoteObject::wget (const QString & url) { +KDE_NO_EXPORT bool RemoteObject::wget (const TQString & url) { clear (); return d->download (url); } -KDE_NO_EXPORT QString RemoteObject::mimetype () { +KDE_NO_EXPORT TQString RemoteObject::mimetype () { if (d->data.size () > 0 && d->mime.isEmpty ()) { int accuraty; KMimeType::Ptr mime = KMimeType::findByContent (d->data, &accuraty); |