summaryrefslogtreecommitdiffstats
path: root/juk/playlist.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'juk/playlist.cpp')
-rw-r--r--juk/playlist.cpp78
1 files changed, 40 insertions, 38 deletions
diff --git a/juk/playlist.cpp b/juk/playlist.cpp
index de65b6e7..784db887 100644
--- a/juk/playlist.cpp
+++ b/juk/playlist.cpp
@@ -65,6 +65,8 @@
#include "tagtransactionmanager.h"
#include "cache.h"
+#define TStringToTQString(s) TQString::fromUtf8((s).toCString(true))
+
using namespace ActionCollection;
/**
@@ -312,7 +314,7 @@ Playlist::Playlist(PlaylistCollection *collection, const TQString &name,
const TQString &iconName) :
TDEListView(collection->playlistStack(), name.latin1()),
m_collection(collection),
- m_fetcher(new WebImageFetcher(TQT_TQOBJECT(this))),
+ m_fetcher(new WebImageFetcher(this)),
m_selectedCount(0),
m_allowDuplicates(false),
m_polished(false),
@@ -336,7 +338,7 @@ Playlist::Playlist(PlaylistCollection *collection, const PlaylistItemList &items
const TQString &name, const TQString &iconName) :
TDEListView(collection->playlistStack(), name.latin1()),
m_collection(collection),
- m_fetcher(new WebImageFetcher(TQT_TQOBJECT(this))),
+ m_fetcher(new WebImageFetcher(this)),
m_selectedCount(0),
m_allowDuplicates(false),
m_polished(false),
@@ -361,7 +363,7 @@ Playlist::Playlist(PlaylistCollection *collection, const TQFileInfo &playlistFil
const TQString &iconName) :
TDEListView(collection->playlistStack()),
m_collection(collection),
- m_fetcher(new WebImageFetcher(TQT_TQOBJECT(this))),
+ m_fetcher(new WebImageFetcher(this)),
m_selectedCount(0),
m_allowDuplicates(false),
m_polished(false),
@@ -385,7 +387,7 @@ Playlist::Playlist(PlaylistCollection *collection, const TQFileInfo &playlistFil
Playlist::Playlist(PlaylistCollection *collection, bool delaySetup) :
TDEListView(collection->playlistStack()),
m_collection(collection),
- m_fetcher(new WebImageFetcher(TQT_TQOBJECT(this))),
+ m_fetcher(new WebImageFetcher(this)),
m_selectedCount(0),
m_allowDuplicates(false),
m_polished(false),
@@ -727,12 +729,12 @@ void Playlist::synchronizePlayingItems(const PlaylistList &sources, bool setMast
void Playlist::copy()
{
- kapp->clipboard()->setData(dragObject(0), TQClipboard::Clipboard);
+ tdeApp->clipboard()->setData(dragObject(0), TQClipboard::Clipboard);
}
void Playlist::paste()
{
- decode(kapp->clipboard()->data(), static_cast<PlaylistItem *>(currentItem()));
+ decode(tdeApp->clipboard()->data(), static_cast<PlaylistItem *>(currentItem()));
}
void Playlist::clear()
@@ -1110,11 +1112,11 @@ void Playlist::decode(TQMimeSource *s, PlaylistItem *item)
bool Playlist::eventFilter(TQObject *watched, TQEvent *e)
{
- if(TQT_BASE_OBJECT(watched) == TQT_BASE_OBJECT(header())) {
+ if(watched == header()) {
switch(e->type()) {
case TQEvent::MouseMove:
{
- if((TQT_TQMOUSEEVENT(e)->state() & Qt::LeftButton) == Qt::LeftButton &&
+ if((static_cast<TQMouseEvent*>(e)->state() & TQt::LeftButton) == TQt::LeftButton &&
!action<TDEToggleAction>("resizeColumnsManually")->isChecked())
{
m_columnWidthModeChanged = true;
@@ -1127,7 +1129,7 @@ bool Playlist::eventFilter(TQObject *watched, TQEvent *e)
}
case TQEvent::MouseButtonPress:
{
- if(TQT_TQMOUSEEVENT(e)->button() == Qt::RightButton)
+ if(static_cast<TQMouseEvent*>(e)->button() == TQt::RightButton)
m_headerMenu->popup(TQCursor::pos());
break;
@@ -1140,7 +1142,7 @@ bool Playlist::eventFilter(TQObject *watched, TQEvent *e)
}
if(!manualResize() && m_widthsDirty)
- TQTimer::singleShot(0, this, TQT_SLOT(slotUpdateColumnWidths()));
+ TQTimer::singleShot(0, this, TQ_SLOT(slotUpdateColumnWidths()));
break;
}
default:
@@ -1247,7 +1249,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() == Qt::LeftButton)
+ if(e->button() == TQt::LeftButton)
TDEListView::contentsMouseDoubleClickEvent(e);
}
@@ -1382,8 +1384,8 @@ void Playlist::refreshAlbums(const PlaylistItemList &items, coverKey id)
TQString artist = (*it)->file().tag()->artist();
TQString album = (*it)->file().tag()->album();
- if(albums.find(tqMakePair(artist, album)) == albums.end())
- albums.append(tqMakePair(artist, album));
+ if(albums.find(qMakePair(artist, album)) == albums.end())
+ albums.append(qMakePair(artist, album));
(*it)->file().coverInfo()->setCoverId(id);
if(setAlbumCovers)
@@ -1545,7 +1547,7 @@ void Playlist::polish()
// setup header RMB menu
//////////////////////////////////////////////////
- m_columnVisibleAction = new TDEActionMenu(i18n("&Show Columns"), TQT_TQOBJECT(this), "showColumns");
+ m_columnVisibleAction = new TDEActionMenu(i18n("&Show Columns"), this, "showColumns");
m_headerMenu = m_columnVisibleAction->popupMenu();
m_headerMenu->insertTitle(i18n("Show"));
@@ -1559,25 +1561,25 @@ void Playlist::polish()
adjustColumn(i);
}
- connect(m_headerMenu, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotToggleColumnVisible(int)));
+ connect(m_headerMenu, TQ_SIGNAL(activated(int)), this, TQ_SLOT(slotToggleColumnVisible(int)));
- connect(this, TQT_SIGNAL(contextMenuRequested(TQListViewItem *, const TQPoint &, int)),
- this, TQT_SLOT(slotShowRMBMenu(TQListViewItem *, const TQPoint &, int)));
- connect(this, TQT_SIGNAL(itemRenamed(TQListViewItem *, const TQString &, int)),
- this, TQT_SLOT(slotInlineEditDone(TQListViewItem *, const TQString &, int)));
- connect(this, TQT_SIGNAL(doubleClicked(TQListViewItem *)),
- this, TQT_SLOT(slotPlayCurrent()));
- connect(this, TQT_SIGNAL(returnPressed(TQListViewItem *)),
- this, TQT_SLOT(slotPlayCurrent()));
+ connect(this, TQ_SIGNAL(contextMenuRequested(TQListViewItem *, const TQPoint &, int)),
+ this, TQ_SLOT(slotShowRMBMenu(TQListViewItem *, const TQPoint &, int)));
+ connect(this, TQ_SIGNAL(itemRenamed(TQListViewItem *, const TQString &, int)),
+ this, TQ_SLOT(slotInlineEditDone(TQListViewItem *, const TQString &, int)));
+ connect(this, TQ_SIGNAL(doubleClicked(TQListViewItem *)),
+ this, TQ_SLOT(slotPlayCurrent()));
+ connect(this, TQ_SIGNAL(returnPressed(TQListViewItem *)),
+ this, TQ_SLOT(slotPlayCurrent()));
- connect(header(), TQT_SIGNAL(sizeChange(int, int, int)),
- this, TQT_SLOT(slotColumnSizeChanged(int, int, int)));
+ connect(header(), TQ_SIGNAL(sizeChange(int, int, int)),
+ this, TQ_SLOT(slotColumnSizeChanged(int, int, int)));
- connect(renameLineEdit(), TQT_SIGNAL(completionModeChanged(TDEGlobalSettings::Completion)),
- this, TQT_SLOT(slotInlineCompletionModeChanged(TDEGlobalSettings::Completion)));
+ connect(renameLineEdit(), TQ_SIGNAL(completionModeChanged(TDEGlobalSettings::Completion)),
+ this, TQ_SLOT(slotInlineCompletionModeChanged(TDEGlobalSettings::Completion)));
- connect(action("resizeColumnsManually"), TQT_SIGNAL(activated()),
- this, TQT_SLOT(slotColumnResizeModeChanged()));
+ connect(action("resizeColumnsManually"), TQ_SIGNAL(activated()),
+ this, TQ_SLOT(slotColumnResizeModeChanged()));
if(action<TDEToggleAction>("resizeColumnsManually")->isChecked())
setHScrollBarMode(Auto);
@@ -1651,13 +1653,13 @@ void Playlist::setup()
{
setItemMargin(3);
- connect(header(), TQT_SIGNAL(indexChange(int, int, int)), this, TQT_SLOT(slotColumnOrderChanged(int, int, int)));
+ connect(header(), TQ_SIGNAL(indexChange(int, int, int)), this, TQ_SLOT(slotColumnOrderChanged(int, int, int)));
- connect(m_fetcher, TQT_SIGNAL(signalCoverChanged(int)), this, TQT_SLOT(slotCoverChanged(int)));
+ connect(m_fetcher, TQ_SIGNAL(signalCoverChanged(int)), this, TQ_SLOT(slotCoverChanged(int)));
// Prevent list of selected items from changing while internet search is in
// progress.
- connect(this, TQT_SIGNAL(selectionChanged()), m_fetcher, TQT_SLOT(abortSearch()));
+ connect(this, TQ_SIGNAL(selectionChanged()), m_fetcher, TQ_SLOT(abortSearch()));
setSorting(1);
}
@@ -1725,7 +1727,7 @@ void Playlist::setPlaying(PlaylistItem *item, bool addToHistory)
TrackSequenceManager::instance()->setCurrent(item);
TQByteArray data;
- kapp->dcopClient()->emitDCOPSignal("Player", "trackChanged()", data);
+ tdeApp->dcopClient()->emitDCOPSignal("Player", "trackChanged()", data);
if(!item)
return;
@@ -2076,7 +2078,7 @@ void Playlist::slotShowRMBMenu(TQListViewItem *item, const TQPoint &point, int c
m_rmbMenu = new TDEPopupMenu(this);
m_rmbUpcomingID = m_rmbMenu->insertItem(SmallIcon("today"),
- i18n("Add to Play Queue"), this, TQT_SLOT(slotAddToUpcoming()));
+ i18n("Add to Play Queue"), this, TQ_SLOT(slotAddToUpcoming()));
m_rmbMenu->insertSeparator();
if(!readOnly()) {
@@ -2090,7 +2092,7 @@ void Playlist::slotShowRMBMenu(TQListViewItem *item, const TQPoint &point, int c
action("edit_copy")->plug(m_rmbMenu);
m_rmbEditID = m_rmbMenu->insertItem(
- i18n("Edit"), this, TQT_SLOT(slotRenameTag()));
+ i18n("Edit"), this, TQ_SLOT(slotRenameTag()));
action("refresh")->plug(m_rmbMenu);
action("removeItem")->plug(m_rmbMenu);
@@ -2105,7 +2107,7 @@ void Playlist::slotShowRMBMenu(TQListViewItem *item, const TQPoint &point, int c
m_rmbMenu->insertSeparator();
m_rmbMenu->insertItem(
- SmallIcon("folder-new"), i18n("Create Playlist From Selected Items..."), this, TQT_SLOT(slotCreateGroup()));
+ SmallIcon("folder-new"), i18n("Create Playlist From Selected Items..."), this, TQ_SLOT(slotCreateGroup()));
K3bExporter *exporter = new K3bExporter(this);
TDEAction *k3bAction = exporter->action();
@@ -2168,7 +2170,7 @@ void Playlist::slotRenameTag()
TQStringList genreList;
TagLib::StringList genres = TagLib::ID3v1::genreList();
for(TagLib::StringList::ConstIterator it = genres.begin(); it != genres.end(); ++it)
- genreList.append(TStringToQString((*it)));
+ genreList.append(TStringToTQString((*it)));
edit->completionObject()->setItems(genreList);
break;
}
@@ -2352,7 +2354,7 @@ bool processEvents()
if(time.elapsed() > 100) {
time.restart();
- kapp->processEvents();
+ tdeApp->processEvents();
return true;
}
return false;