From 769e63d24adf5c844137484f06a972fcce732d6a Mon Sep 17 00:00:00 2001 From: tpearson Date: Thu, 30 Jun 2011 06:10:56 +0000 Subject: 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 --- src/kmplayer_koffice_part.cpp | 80 +++++++++++++++++++++---------------------- 1 file changed, 40 insertions(+), 40 deletions(-) (limited to 'src/kmplayer_koffice_part.cpp') diff --git a/src/kmplayer_koffice_part.cpp b/src/kmplayer_koffice_part.cpp index 756402a..85b27ac 100644 --- a/src/kmplayer_koffice_part.cpp +++ b/src/kmplayer_koffice_part.cpp @@ -23,14 +23,14 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -48,11 +48,11 @@ #ifdef HAVE_KOFFICE -#include -//#include -#include -#include -#include +#include +//#include +#include +#include +#include #include class KMPlayerFactory : public KParts::Factory { @@ -60,8 +60,8 @@ 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; @@ -80,21 +80,21 @@ KMPlayerFactory::~KMPlayerFactory () { } 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) { if (strstr (cls, "KoDocument")) - return new KOfficeMPlayer (wparent, wname, parent, name); + return new KOfficeMPlayer (wtqparent, wname, tqparent, name); return 0L; } //----------------------------------------------------------------------------- -KOfficeMPlayer::KOfficeMPlayer (QWidget *parentWidget, const char *widgetName, QObject* parent, const char* name, bool singleViewMode) - : KoDocument (parentWidget, widgetName, parent, name, singleViewMode), +KOfficeMPlayer::KOfficeMPlayer (TQWidget *tqparentWidget, const char *widgetName, TQObject* tqparent, const char* name, bool singleViewMode) + : KoDocument (tqparentWidget, widgetName, tqparent, name, singleViewMode), m_config (new KConfig ("kmplayerrc")), - m_player (new KMPlayer (parentWidget, 0L, 0L, 0L, m_config)) + m_player (new KMPlayer (tqparentWidget, 0L, 0L, 0L, m_config)) { setInstance (KMPlayerFactory::instance (), false); setReadWrite (false); @@ -107,8 +107,8 @@ KOfficeMPlayer::~KOfficeMPlayer () { kdDebug() << "KOfficeMPlayer::~KOfficeMPlayer" << /*kdBacktrace() <<*/ endl; } -void KOfficeMPlayer::paintContent (QPainter& p, const QRect& r, bool, double, double) { - p.fillRect (r, QBrush (QColor (0, 0, 0))); +void KOfficeMPlayer::paintContent (TQPainter& p, const TQRect& r, bool, double, double) { + p.fillRect (r, TQBrush (TQColor (0, 0, 0))); } bool KOfficeMPlayer::initDoc() { @@ -116,8 +116,8 @@ bool KOfficeMPlayer::initDoc() { return true; } -bool KOfficeMPlayer::loadXML (QIODevice *, const QDomDocument & doc) { - QDomNode node = doc.firstChild (); +bool KOfficeMPlayer::loadXML (TQIODevice *, const TQDomDocument & doc) { + TQDomNode node = doc.firstChild (); if (node.isNull ()) return true; kdDebug() << "KOfficeMPlayer::loadXML " << node.nodeName () << endl; node = node.firstChild (); @@ -129,39 +129,39 @@ bool KOfficeMPlayer::loadXML (QIODevice *, const QDomDocument & doc) { return true; } -bool KOfficeMPlayer::loadOasis (const QDomDocument &, KoOasisStyles &, const QDomDocument &, KoStore *) { +bool KOfficeMPlayer::loadOasis (const TQDomDocument &, KoOasisStyles &, const TQDomDocument &, KoStore *) { return true; } -QDomDocument KOfficeMPlayer::saveXML() { - QDomDocument doc = createDomDocument ("kmplayer", QString::number(1.0)); - QDomElement docelm = doc.documentElement(); +TQDomDocument KOfficeMPlayer::saveXML() { + TQDomDocument doc = createDomDocument ("kmplayer", TQString::number(1.0)); + TQDomElement docelm = doc.documentElement(); docelm.setAttribute ("editor", "KMPlayer"); docelm.setAttribute ("mime", "application/x-kmplayer"); - QDomElement url = doc.createElement ("url"); + TQDomElement url = doc.createElement ("url"); url.appendChild (doc.createTextNode (m_player->url ().url ())); doc.appendChild (url); return doc; } -KoView* KOfficeMPlayer::createViewInstance (QWidget* parent, const char* name) { +KoView* KOfficeMPlayer::createViewInstance (TQWidget* tqparent, const char* name) { kdDebug() << "KOfficeMPlayer::createViewInstance" << endl; - return new KOfficeMPlayerView (this, parent); + return new KOfficeMPlayerView (this, tqparent); } -KOfficeMPlayerView::KOfficeMPlayerView (KOfficeMPlayer* part, QWidget* parent, const char* name) - : KoView (part, parent, name), +KOfficeMPlayerView::KOfficeMPlayerView (KOfficeMPlayer* part, TQWidget* tqparent, const char* name) + : KoView (part, tqparent, name), m_view (static_cast (part->player ()->view ())) { - kdDebug() << "KOfficeMPlayerView::KOfficeMPlayerView this:" << this << " parent:" << parent << endl; - m_oldparent = static_cast (m_view->parent()); - m_view->reparent (this, QPoint (0, 0)); - QVBoxLayout * box = new QVBoxLayout (this, 0, 0); + kdDebug() << "KOfficeMPlayerView::KOfficeMPlayerView this:" << this << " tqparent:" << tqparent << endl; + m_oldtqparent = static_cast (m_view->tqparent()); + m_view->reparent (this, TQPoint (0, 0)); + TQVBoxLayout * box = new TQVBoxLayout (this, 0, 0); box->addWidget (m_view); } KOfficeMPlayerView::~KOfficeMPlayerView () { kdDebug() << "KOfficeMPlayerView::~KOfficeMPlayerView this:" << this << endl; - m_view->reparent (m_oldparent, QPoint (0, 0)); + m_view->reparent (m_oldtqparent, TQPoint (0, 0)); } #include "kmplayer_koffice_part.moc" -- cgit v1.2.1