summaryrefslogtreecommitdiffstats
path: root/juk/playlist.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-11 06:00:15 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-11 06:00:15 +0000
commitb1057f437bf65300831a0ccb45b920787c6b318d (patch)
treef8a73db06ca1180d0da0ba6dfbe786197b4f4bc3 /juk/playlist.cpp
parent4ddfca384ced9ad654213aef9dc2c3973720b980 (diff)
downloadtdemultimedia-b1057f437bf65300831a0ccb45b920787c6b318d.tar.gz
tdemultimedia-b1057f437bf65300831a0ccb45b920787c6b318d.zip
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
Diffstat (limited to 'juk/playlist.cpp')
-rw-r--r--juk/playlist.cpp64
1 files changed, 32 insertions, 32 deletions
diff --git a/juk/playlist.cpp b/juk/playlist.cpp
index fb218881..51cb5095 100644
--- a/juk/playlist.cpp
+++ b/juk/playlist.cpp
@@ -80,11 +80,11 @@ static bool manualResize()
* A tooltip specialized to show full filenames over the file name column.
*/
-class PlaylistToolTip : public QToolTip
+class PlaylistToolTip : public TQToolTip
{
public:
- PlaylistToolTip(TQWidget *parent, Playlist *playlist) :
- TQToolTip(parent), m_playlist(playlist) {}
+ PlaylistToolTip(TQWidget *tqparent, Playlist *playlist) :
+ TQToolTip(tqparent), m_playlist(playlist) {}
virtual void maybeTip(const TQPoint &p)
{
@@ -102,7 +102,7 @@ public:
(column == m_playlist->columnOffset() + PlaylistItem::CoverColumn &&
item->file().coverInfo()->hasCover()))
{
- TQRect r = m_playlist->itemRect(item);
+ TQRect r = m_playlist->tqitemRect(item);
int headerPosition = m_playlist->header()->sectionPos(column);
r.setLeft(headerPosition);
r.setRight(headerPosition + m_playlist->header()->sectionSize(column));
@@ -312,7 +312,7 @@ Playlist::Playlist(PlaylistCollection *collection, const TQString &name,
const TQString &iconName) :
KListView(collection->playlistStack(), name.latin1()),
m_collection(collection),
- m_fetcher(new WebImageFetcher(this)),
+ m_fetcher(new WebImageFetcher(TQT_TQOBJECT(this))),
m_selectedCount(0),
m_allowDuplicates(false),
m_polished(false),
@@ -336,7 +336,7 @@ Playlist::Playlist(PlaylistCollection *collection, const PlaylistItemList &items
const TQString &name, const TQString &iconName) :
KListView(collection->playlistStack(), name.latin1()),
m_collection(collection),
- m_fetcher(new WebImageFetcher(this)),
+ m_fetcher(new WebImageFetcher(TQT_TQOBJECT(this))),
m_selectedCount(0),
m_allowDuplicates(false),
m_polished(false),
@@ -361,7 +361,7 @@ Playlist::Playlist(PlaylistCollection *collection, const TQFileInfo &playlistFil
const TQString &iconName) :
KListView(collection->playlistStack()),
m_collection(collection),
- m_fetcher(new WebImageFetcher(this)),
+ m_fetcher(new WebImageFetcher(TQT_TQOBJECT(this))),
m_selectedCount(0),
m_allowDuplicates(false),
m_polished(false),
@@ -385,7 +385,7 @@ Playlist::Playlist(PlaylistCollection *collection, const TQFileInfo &playlistFil
Playlist::Playlist(PlaylistCollection *collection, bool delaySetup) :
KListView(collection->playlistStack()),
m_collection(collection),
- m_fetcher(new WebImageFetcher(this)),
+ m_fetcher(new WebImageFetcher(TQT_TQOBJECT(this))),
m_selectedCount(0),
m_allowDuplicates(false),
m_polished(false),
@@ -543,7 +543,7 @@ void Playlist::save()
TQFile file(m_fileName);
if(!file.open(IO_WriteOnly))
- return KMessageBox::error(this, i18n("Could not save to file %1.").arg(m_fileName));
+ return KMessageBox::error(this, i18n("Could not save to file %1.").tqarg(m_fileName));
TQTextStream stream(&file);
@@ -727,12 +727,12 @@ void Playlist::synchronizePlayingItems(const PlaylistList &sources, bool setMast
void Playlist::copy()
{
- kapp->clipboard()->setData(dragObject(0), QClipboard::Clipboard);
+ kapp->tqclipboard()->setData(dragObject(0), TQClipboard::Clipboard);
}
void Playlist::paste()
{
- decode(kapp->clipboard()->data(), static_cast<PlaylistItem *>(currentItem()));
+ decode(kapp->tqclipboard()->data(), static_cast<PlaylistItem *>(currentItem()));
}
void Playlist::clear()
@@ -750,7 +750,7 @@ void Playlist::slotRefresh()
if(l.isEmpty())
l = visibleItems();
- KApplication::setOverrideCursor(Qt::waitCursor);
+ KApplication::setOverrideCursor(TQt::waitCursor);
for(PlaylistItemList::Iterator it = l.begin(); it != l.end(); ++it) {
(*it)->refreshFromDisk();
@@ -800,7 +800,7 @@ void Playlist::slotRemoveCover()
return;
int button = KMessageBox::warningContinueCancel(this,
i18n("Are you sure you want to delete these covers?"),
- TQString::null,
+ TQString(),
i18n("&Delete Covers"));
if(button == KMessageBox::Continue)
refreshAlbums(items);
@@ -877,7 +877,7 @@ void Playlist::slotCoverChanged(int coverId)
void Playlist::slotGuessTagInfo(TagGuesser::Type type)
{
- KApplication::setOverrideCursor(Qt::waitCursor);
+ KApplication::setOverrideCursor(TQt::waitCursor);
PlaylistItemList items = selectedItems();
setDynamicListsFrozen(true);
@@ -922,7 +922,7 @@ void Playlist::slotWeightDirty(int column)
return;
}
- if(m_weightDirty.find(column) == m_weightDirty.end())
+ if(m_weightDirty.tqfind(column) == m_weightDirty.end())
m_weightDirty.append(column);
}
@@ -1015,7 +1015,7 @@ void Playlist::removeFromDisk(const PlaylistItemList &items)
}
}
-TQDragObject *Playlist::dragObject(TQWidget *parent)
+TQDragObject *Playlist::dragObject(TQWidget *tqparent)
{
PlaylistItemList items = selectedItems();
KURL::List urls;
@@ -1025,7 +1025,7 @@ TQDragObject *Playlist::dragObject(TQWidget *parent)
urls.append(url);
}
- KURLDrag *drag = new KURLDrag(urls, parent, "Playlist Items");
+ KURLDrag *drag = new KURLDrag(urls, tqparent, "Playlist Items");
drag->setPixmap(BarIcon("sound"));
return drag;
@@ -1110,11 +1110,11 @@ void Playlist::decode(TQMimeSource *s, PlaylistItem *item)
bool Playlist::eventFilter(TQObject *watched, TQEvent *e)
{
- if(watched == header()) {
+ if(TQT_BASE_OBJECT(watched) == TQT_BASE_OBJECT(header())) {
switch(e->type()) {
case TQEvent::MouseMove:
{
- if((static_cast<TQMouseEvent *>(e)->state() & LeftButton) == LeftButton &&
+ if((TQT_TQMOUSEEVENT(e)->state() & Qt::LeftButton) == Qt::LeftButton &&
!action<KToggleAction>("resizeColumnsManually")->isChecked())
{
m_columnWidthModeChanged = true;
@@ -1127,7 +1127,7 @@ bool Playlist::eventFilter(TQObject *watched, TQEvent *e)
}
case TQEvent::MouseButtonPress:
{
- if(static_cast<TQMouseEvent *>(e)->button() == RightButton)
+ if(TQT_TQMOUSEEVENT(e)->button() == Qt::RightButton)
m_headerMenu->popup(TQCursor::pos());
break;
@@ -1161,7 +1161,7 @@ void Playlist::keyPressEvent(TQKeyEvent *event)
TQListViewItemIterator visible(this, TQListViewItemIterator::IteratorFlag(
TQListViewItemIterator::Visible));
if(selected.current() == visible.current())
- KApplication::postEvent(parent(), new FocusUpEvent);
+ KApplication::postEvent(tqparent(), new FocusUpEvent);
}
}
@@ -1247,7 +1247,7 @@ void Playlist::contentsMouseDoubleClickEvent(TQMouseEvent *e)
// Filter out non left button double clicks, that way users don't have the
// weird experience of switching songs from a double right-click.
- if(e->button() == LeftButton)
+ if(e->button() == Qt::LeftButton)
KListView::contentsMouseDoubleClickEvent(e);
}
@@ -1353,7 +1353,7 @@ void Playlist::addFiles(const TQStringList &files, PlaylistItem *after)
if(!after)
after = static_cast<PlaylistItem *>(lastItem());
- KApplication::setOverrideCursor(Qt::waitCursor);
+ KApplication::setOverrideCursor(TQt::waitCursor);
m_blockDataChanged = true;
@@ -1375,22 +1375,22 @@ void Playlist::addFiles(const TQStringList &files, PlaylistItem *after)
void Playlist::refreshAlbums(const PlaylistItemList &items, coverKey id)
{
- TQValueList< QPair<TQString, TQString> > albums;
+ TQValueList< TQPair<TQString, TQString> > albums;
bool setAlbumCovers = items.count() == 1;
for(PlaylistItemList::ConstIterator it = items.begin(); it != items.end(); ++it) {
TQString artist = (*it)->file().tag()->artist();
TQString album = (*it)->file().tag()->album();
- if(albums.find(qMakePair(artist, album)) == albums.end())
- albums.append(qMakePair(artist, album));
+ if(albums.tqfind(tqMakePair(artist, album)) == albums.end())
+ albums.append(tqMakePair(artist, album));
(*it)->file().coverInfo()->setCoverId(id);
if(setAlbumCovers)
(*it)->file().coverInfo()->applyCoverToWholeAlbum(true);
}
- for(TQValueList< QPair<TQString, TQString> >::ConstIterator it = albums.begin();
+ for(TQValueList< TQPair<TQString, TQString> >::ConstIterator it = albums.begin();
it != albums.end(); ++it)
{
refreshAlbum((*it).first, (*it).second);
@@ -1545,7 +1545,7 @@ void Playlist::polish()
// setup header RMB menu
//////////////////////////////////////////////////
- m_columnVisibleAction = new KActionMenu(i18n("&Show Columns"), this, "showColumns");
+ m_columnVisibleAction = new KActionMenu(i18n("&Show Columns"), TQT_TQOBJECT(this), "showColumns");
m_headerMenu = m_columnVisibleAction->popupMenu();
m_headerMenu->insertTitle(i18n("Show"));
@@ -1636,7 +1636,7 @@ void Playlist::slotPopulateBackMenu() const
void Playlist::slotPlayFromBackMenu(int number) const
{
- if(!m_backMenuItems.contains(number))
+ if(!m_backMenuItems.tqcontains(number))
return;
TrackSequenceManager::instance()->setNextItem(m_backMenuItems[number]);
@@ -1947,7 +1947,7 @@ void Playlist::slotUpdateColumnWidths()
minimumWidth[column] = header()->fontMetrics().width(header()->label(column)) + 10;
minimumWidthTotal += minimumWidth[column];
- minimumFixedWidth[column] = QMAX(minimumWidth[column], m_columnFixedWidths[column]);
+ minimumFixedWidth[column] = TQMAX(minimumWidth[column], m_columnFixedWidths[column]);
minimumFixedWidthTotal += minimumFixedWidth[column];
}
@@ -2127,7 +2127,7 @@ void Playlist::slotShowRMBMenu(TQListViewItem *item, const TQPoint &point, int c
if(showEdit)
m_rmbMenu->changeItem(m_rmbEditID,
- i18n("Edit '%1'").arg(columnText(column + columnOffset())));
+ i18n("Edit '%1'").tqarg(columnText(column + columnOffset())));
m_rmbMenu->setItemVisible(m_rmbEditID, showEdit);
@@ -2239,7 +2239,7 @@ void Playlist::slotInlineEditDone(TQListViewItem *, const TQString &, int column
(l.count() > 1 && KMessageBox::warningContinueCancel(
0,
i18n("This will edit multiple files. Are you sure?"),
- TQString::null,
+ TQString(),
i18n("Edit"),
"DontWarnMultipleTags") == KMessageBox::Cancel))
{