From 395a904bff7b4d6ead445c342f7ac0c5fbf29121 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 18 Jun 2011 17:00:31 +0000 Subject: TQt4 port kdeaddons This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeaddons@1237404 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kicker-applets/mediacontrol/mediacontrol.cpp | 58 ++++++++++++++-------------- 1 file changed, 29 insertions(+), 29 deletions(-) (limited to 'kicker-applets/mediacontrol/mediacontrol.cpp') diff --git a/kicker-applets/mediacontrol/mediacontrol.cpp b/kicker-applets/mediacontrol/mediacontrol.cpp index 433f52d..9068aeb 100644 --- a/kicker-applets/mediacontrol/mediacontrol.cpp +++ b/kicker-applets/mediacontrol/mediacontrol.cpp @@ -57,18 +57,18 @@ const int NO_BUTTONS = 4; extern "C" { - KDE_EXPORT KPanelApplet *init( TQWidget *parent, const TQString &configFile) + KDE_EXPORT KPanelApplet *init( TQWidget *tqparent, const TQString &configFile) { KGlobal::locale()->insertCatalogue("mediacontrol"); return new MediaControl(configFile, KPanelApplet::Normal, KPanelApplet::About | KPanelApplet::Preferences | - KPanelApplet::ReportBug, parent, "mediacontrol"); + KPanelApplet::ReportBug, tqparent, "mediacontrol"); } } // ============================================================================= -class MediaControlToolTip : public QToolTip +class MediaControlToolTip : public TQToolTip { public: MediaControlToolTip(TQWidget *widget, PlayerInterface *pl_obj) : @@ -78,7 +78,7 @@ class MediaControlToolTip : public QToolTip virtual void maybeTip(const TQPoint &pt) { TQRect rc( mWidget->rect()); - if (rc.contains(pt)) + if (rc.tqcontains(pt)) { tip ( rc, mPlayer->getTrackTitle() ); } @@ -91,9 +91,9 @@ class MediaControlToolTip : public QToolTip // ============================================================================= MediaControl::MediaControl(const TQString &configFile, Type t, int actions, - TQWidget *parent, const char *name) + TQWidget *tqparent, const char *name) : DCOPObject("MediaControl"), - KPanelApplet(configFile, t, actions, parent, name), + KPanelApplet(configFile, t, actions, tqparent, name), mInstance(new KInstance("mediacontrol")), mAboutData(new KAboutData("mediacontrol", I18N_NOOP("MediaControl"), @@ -124,7 +124,7 @@ MediaControl::MediaControl(const TQString &configFile, Type t, int actions, "tisch.crix@gmx.de", "http://www.crixensgfxcorner.de.vu/"); mAboutData->addCredit("Ulrik Mikaelsson", I18N_NOOP("Fix for Noatun-Support"), "rawler@rsn.bth.se", 0); - mAboutData->addCredit("Anthony J Moulen", I18N_NOOP("Fix for Vertical Slider"), + mAboutData->addCredit("Anthony J Moulen", I18N_NOOP("Fix forQt::Vertical Slider"), "ajmoulen@moulen.org", 0); mAboutData->addCredit("Teemu Rytilahti", I18N_NOOP("Volume Control Implementation"), "teemu.rytilahti@kde-fi.org", 0); @@ -139,7 +139,7 @@ MediaControl::MediaControl(const TQString &configFile, Type t, int actions, playpause_button = new TrayButton (this, "PLAYPAUSE"); stop_button = new TrayButton (this, "STOP"); next_button = new TrayButton (this, "NEXT"); - time_slider = new MCSlider (TQSlider::Horizontal, this, "time_slider" ); + time_slider = new MCSlider (Qt::Horizontal, this, "time_slider" ); time_slider->setRange(0,0); time_slider->setValue(0); time_slider->setTracking( false ); @@ -184,7 +184,7 @@ void MediaControl::dropEvent(TQDropEvent* event) void MediaControl::setSliderPosition(int len ,int time) { time_slider->blockSignals(true); - if(orientation() == Vertical) + if(orientation() ==Qt::Vertical) time = len - time; if (mLastLen != len) @@ -226,10 +226,10 @@ void MediaControl::disableAll() void MediaControl::slotPlayingStatusChanged(int status) { - if (mLastStatus == status) + if (mLasttqStatus == status) return; - mLastStatus = status; + mLasttqStatus = status; TQString skindir = locate("data", "mediacontrol/"+_configFrontend->theme()+"/"); switch (status) @@ -255,7 +255,7 @@ void MediaControl::slotIconChanged() if(!_configFrontend->useCustomTheme()) { prev_button->setIconSet(SmallIconSet("player_start")); - if (_player->playingStatus() == PlayerInterface::Playing) + if (_player->playingtqStatus() == PlayerInterface::Playing) playpause_button->setIconSet(SmallIconSet("player_pause")); else playpause_button->setIconSet(SmallIconSet("player_play")); @@ -318,7 +318,7 @@ void MediaControl::reportBug() // Fixing the orientation problem in qslider. void MediaControl::adjustTime(int time) { - if(orientation() == Vertical) + if(orientation() ==Qt::Vertical) emit(newJumpToTime(mLastLen - time)); else emit(newJumpToTime(time)); @@ -350,7 +350,7 @@ void MediaControl::reparseConfig() mLastLen = -1; mLastTime = -1; - mLastStatus = -1; + mLasttqStatus = -1; TQString playerString = _configFrontend->player(); @@ -413,7 +413,7 @@ void MediaControl::reparseConfig() if (TQFile(skindir+"play.png").exists()) { prev_button->setIconSet(SmallIconSet(locate("data",skindir+"prev.png"))); - if (_player->playingStatus() == PlayerInterface::Playing) + if (_player->playingtqStatus() == PlayerInterface::Playing) playpause_button->setIconSet(SmallIconSet(locate("data",skindir+"play.png"))); else playpause_button->setIconSet(SmallIconSet(locate("data",skindir+"pause.png"))); @@ -424,7 +424,7 @@ void MediaControl::reparseConfig() { KNotifyClient::event(winId(), KNotifyClient::warning, i18n("There was trouble loading theme %1. Please choose" \ - " a different theme.").arg(skindir)); + " a different theme.").tqarg(skindir)); // default to kde-icons, they have to be installed :) slotIconChanged(); @@ -461,10 +461,10 @@ void MediaControl::reparseConfig() int MediaControl::widthForHeight(int height) const { // kdDebug(90200) << "kicker height: " << height << endl; -// kdDebug(90200) << "slider needs: " << time_slider->minimumSizeHint().height() << endl; +// kdDebug(90200) << "slider needs: " << time_slider->tqminimumSizeHint().height() << endl; // slider height + button height - if ( height >= (time_slider->minimumSizeHint().height()+MC_BUTTONSIZE) ) + if ( height >= (time_slider->tqminimumSizeHint().height()+MC_BUTTONSIZE) ) { // slider UNDER buttons // (5 * button width + spaces between them); return (4*MC_BUTTONSIZE+10); @@ -483,7 +483,7 @@ int MediaControl::heightForWidth(int width) const // kdDebug(90200) << "kicker width: " << width << endl; // slider height + button height - if ( width >= (time_slider->minimumSizeHint().width()+MC_BUTTONSIZE) ) + if ( width >= (time_slider->tqminimumSizeHint().width()+MC_BUTTONSIZE) ) { // slider ASIDE icons // (5 * button width + spaces between them); return (4*MC_BUTTONSIZE+10); @@ -498,7 +498,7 @@ int MediaControl::heightForWidth(int width) const void MediaControl::mousePressEvent(TQMouseEvent* e) { - if (e->button() == TQMouseEvent::RightButton) + if (e->button() == Qt::RightButton) rmbMenu->popup(e->globalPos()); } @@ -506,8 +506,8 @@ bool MediaControl::eventFilter(TQObject *, TQEvent *e) { if (e->type() == TQEvent::MouseButtonPress) { - TQMouseEvent *me = static_cast(e); - if (me->button() == TQMouseEvent::RightButton) + TQMouseEvent *me = TQT_TQMOUSEEVENT(e); + if (me->button() == Qt::RightButton) { rmbMenu->popup(me->globalPos()); return true; @@ -532,10 +532,10 @@ void MediaControl::resizeEvent( TQResizeEvent* ) // kdDebug(90200) << "resizeEvent()" << endl; int w = width(); int h = height(); - if ( orientation() == Vertical ) + if ( orientation() ==Qt::Vertical ) { // ====== VERTICAL ================================================= - time_slider->setOrientation(TQSlider::Vertical); - int slider_width = time_slider->minimumSizeHint().width(); + time_slider->setOrientation(Qt::Vertical); + int slider_width = time_slider->tqminimumSizeHint().width(); // some styles need more space for sliders than avilable in very small panels :( if ( slider_width > w ) slider_width = w; @@ -566,8 +566,8 @@ void MediaControl::resizeEvent( TQResizeEvent* ) } else // ====== HORIZONTAL =============================================== { - time_slider->setOrientation(TQSlider::Horizontal); - int slider_height = time_slider->minimumSizeHint().height(); + time_slider->setOrientation(Qt::Horizontal); + int slider_height = time_slider->tqminimumSizeHint().height(); // some styles need more space for sliders than avilable in very small panels :( if ( slider_height > h ) slider_height = h; @@ -600,8 +600,8 @@ void MediaControl::resizeEvent( TQResizeEvent* ) // Our Button ======================================================================== -TrayButton::TrayButton(TQWidget* parent, const char* name) - : SimpleButton (parent, name) +TrayButton::TrayButton(TQWidget* tqparent, const char* name) + : SimpleButton (tqparent, name) { setBackgroundMode(PaletteBackground); setBackgroundOrigin(AncestorOrigin); -- cgit v1.2.1