From b1057f437bf65300831a0ccb45b920787c6b318d Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 11 Jun 2011 06:00:15 +0000 Subject: TQt4 port kdemultimedia This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdemultimedia@1236079 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- juk/nowplaying.cpp | 78 +++++++++++++++++++++++++++--------------------------- 1 file changed, 39 insertions(+), 39 deletions(-) (limited to 'juk/nowplaying.cpp') diff --git a/juk/nowplaying.cpp b/juk/nowplaying.cpp index 4256ecff..ebf03b94 100644 --- a/juk/nowplaying.cpp +++ b/juk/nowplaying.cpp @@ -39,17 +39,17 @@ static const int imageSize = 64; -struct Line : public QFrame +struct Line : public TQFrame { - Line(TQWidget *parent) : TQFrame(parent) { setFrameShape(VLine); } + Line(TQWidget *tqparent) : TQFrame(tqparent) { setFrameShape(VLine); } }; //////////////////////////////////////////////////////////////////////////////// // NowPlaying //////////////////////////////////////////////////////////////////////////////// -NowPlaying::NowPlaying(TQWidget *parent, PlaylistCollection *collection, const char *name) : - TQHBox(parent, name), +NowPlaying::NowPlaying(TQWidget *tqparent, PlaylistCollection *collection, const char *name) : + TQHBox(tqparent, name), m_observer(this, collection), m_collection(collection) { @@ -58,9 +58,9 @@ NowPlaying::NowPlaying(TQWidget *parent, PlaylistCollection *collection, const c CollectionList::instance()->addObserver(&m_observer); - layout()->setMargin(5); - layout()->setSpacing(3); - setFixedHeight(imageSize + 2 + layout()->margin() * 2); + tqlayout()->setMargin(5); + tqlayout()->setSpacing(3); + setFixedHeight(imageSize + 2 + tqlayout()->margin() * 2); setStretchFactor(new CoverItem(this), 0); setStretchFactor(new TrackItem(this), 2); @@ -105,11 +105,11 @@ void NowPlaying::slotUpdate() // CoverItem //////////////////////////////////////////////////////////////////////////////// -CoverItem::CoverItem(NowPlaying *parent) : - TQLabel(parent, "CoverItem"), - NowPlayingItem(parent) +CoverItem::CoverItem(NowPlaying *tqparent) : + TQLabel(tqparent, "CoverItem"), + NowPlayingItem(tqparent) { - setFixedHeight(parent->height() - parent->layout()->margin() * 2); + setFixedHeight(tqparent->height() - tqparent->tqlayout()->margin() * 2); setFrameStyle(Box | Plain); setLineWidth(1); setMargin(1); @@ -123,7 +123,7 @@ void CoverItem::update(const FileHandle &file) if(file.coverInfo()->hasCover()) { show(); TQImage image = file.coverInfo()->pixmap(CoverInfo::Thumbnail).convertToImage(); - setPixmap(image.smoothScale(imageSize, imageSize, TQImage::ScaleMin)); + setPixmap(image.smoothScale(imageSize, imageSize, TQ_ScaleMin)); } else hide(); @@ -138,7 +138,7 @@ void CoverItem::mouseReleaseEvent(TQMouseEvent *event) if(event->x() >= 0 && event->y() >= 0 && event->x() < width() && event->y() < height() && - event->button() == LeftButton && + event->button() == Qt::LeftButton && m_file.coverInfo()->hasCover()) { m_file.coverInfo()->popup(); @@ -159,7 +159,7 @@ void CoverItem::mouseMoveEvent(TQMouseEvent *e) return; TQPoint diff = m_dragStart - e->globalPos(); - if(QABS(diff.x()) > 1 || QABS(diff.y()) > 1) { + if(TQABS(diff.x()) > 1 || TQABS(diff.y()) > 1) { // Start a drag. @@ -214,21 +214,21 @@ void CoverItem::dropEvent(TQDropEvent *e) // TrackItem //////////////////////////////////////////////////////////////////////////////// -TrackItem::TrackItem(NowPlaying *parent) : - TQWidget(parent, "TrackItem"), - NowPlayingItem(parent) +TrackItem::TrackItem(NowPlaying *tqparent) : + TQWidget(tqparent, "TrackItem"), + NowPlayingItem(tqparent) { - setFixedHeight(parent->height() - parent->layout()->margin() * 2); - setSizePolicy(TQSizePolicy::Preferred, TQSizePolicy::Fixed); + setFixedHeight(tqparent->height() - tqparent->tqlayout()->margin() * 2); + tqsetSizePolicy(TQSizePolicy::Preferred, TQSizePolicy::Fixed); - TQVBoxLayout *layout = new TQVBoxLayout(this); + TQVBoxLayout *tqlayout = new TQVBoxLayout(this); m_label = new LinkLabel(this); m_label->setLinkUnderline(false); - layout->addStretch(); - layout->addWidget(m_label); - layout->addStretch(); + tqlayout->addStretch(); + tqlayout->addWidget(m_label); + tqlayout->addStretch(); connect(m_label, TQT_SIGNAL(linkClicked(const TQString &)), this, TQT_SLOT(slotOpenLink(const TQString &))); @@ -242,7 +242,7 @@ void TrackItem::update(const FileHandle &file) void TrackItem::slotOpenLink(const TQString &link) { - PlaylistCollection *collection = NowPlayingItem::parent()->collection(); + PlaylistCollection *collection = NowPlayingItem::tqparent()->collection(); if(link == "artist") collection->showMore(m_file.tag()->artist()); @@ -259,7 +259,7 @@ void TrackItem::slotUpdate() TQString title = TQStyleSheet::escape(m_file.tag()->title()); TQString artist = TQStyleSheet::escape(m_file.tag()->artist()); TQString album = TQStyleSheet::escape(m_file.tag()->album()); - TQString separator = (artist.isNull() || album.isNull()) ? TQString::null : TQString(" - "); + TQString separator = (artist.isNull() || album.isNull()) ? TQString() : TQString(" - "); // This block-o-nastiness makes the font smaller and smaller until it actually fits. @@ -269,32 +269,32 @@ void TrackItem::slotUpdate() "
" "%4%5%6"; - if(NowPlayingItem::parent()->collection()->showMoreActive()) - format.append(TQString(" (%1)").arg(i18n("back to playlist"))); + if(NowPlayingItem::tqparent()->collection()->showMoreActive()) + format.append(TQString(" (%1)").tqarg(i18n("back to playlist"))); format.append(""); do { - m_label->setText(format.arg(size).arg(title).arg(size - 2) - .arg(artist).arg(separator).arg(album)); + m_label->setText(format.tqarg(size).tqarg(title).tqarg(size - 2) + .tqarg(artist).tqarg(separator).tqarg(album)); --size; } while(m_label->heightForWidth(m_label->width()) > imageSize && size >= 0); - m_label->setFixedHeight(QMIN(imageSize, m_label->heightForWidth(m_label->width()))); + m_label->setFixedHeight(TQMIN(imageSize, m_label->heightForWidth(m_label->width()))); } //////////////////////////////////////////////////////////////////////////////// // HistoryItem //////////////////////////////////////////////////////////////////////////////// -HistoryItem::HistoryItem(NowPlaying *parent) : - LinkLabel(parent, "HistoryItem"), - NowPlayingItem(parent) +HistoryItem::HistoryItem(NowPlaying *tqparent) : + LinkLabel(tqparent, "HistoryItem"), + NowPlayingItem(tqparent) { - setFixedHeight(parent->height() - parent->layout()->margin() * 2); - setSizePolicy(TQSizePolicy::Preferred, TQSizePolicy::Fixed); + setFixedHeight(tqparent->height() - tqparent->tqlayout()->margin() * 2); + tqsetSizePolicy(TQSizePolicy::Preferred, TQSizePolicy::Fixed); setLinkUnderline(false); - setText(TQString("%1").arg(i18n("History"))); + setText(TQString("%1").tqarg(i18n("History"))); m_timer = new TQTimer(this); connect(m_timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotAddPlaying())); @@ -309,14 +309,14 @@ void HistoryItem::update(const FileHandle &file) m_history.remove(m_history.fromLast()); TQString format = "
%2"; - TQString current = TQString("%1").arg(i18n("History")); + TQString current = TQString("%1").tqarg(i18n("History")); TQString previous; for(TQValueList::ConstIterator it = m_history.begin(); it != m_history.end(); ++it) { previous = current; - current.append(format.arg((*it).anchor).arg(TQStyleSheet::escape((*it).file.tag()->title()))); + current.append(format.tqarg((*it).anchor).tqarg(TQStyleSheet::escape((*it).file.tag()->title()))); setText(current); if(heightForWidth(width()) > imageSize) { setText(previous); @@ -342,7 +342,7 @@ void HistoryItem::openLink(const TQString &link) (*it).playlist->clearSelection(); (*it).playlist->setSelected(item, true); (*it).playlist->ensureItemVisible(item); - NowPlayingItem::parent()->collection()->raise((*it).playlist); + NowPlayingItem::tqparent()->collection()->raise((*it).playlist); } break; } -- cgit v1.2.1