summaryrefslogtreecommitdiffstats
path: root/juk/playlistbox.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:43:15 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:43:15 +0000
commite654398e46e37abf457b2b1122ab898d2c51c49f (patch)
treed39ee6440f3c3663c3ead84a2d4cc2d034667e96 /juk/playlistbox.cpp
parente4f29b18e19394b9352f52a6c0d0d0e3932cf511 (diff)
downloadtdemultimedia-e654398e46e37abf457b2b1122ab898d2c51c49f.tar.gz
tdemultimedia-e654398e46e37abf457b2b1122ab898d2c51c49f.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdemultimedia@1157644 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'juk/playlistbox.cpp')
-rw-r--r--juk/playlistbox.cpp142
1 files changed, 71 insertions, 71 deletions
diff --git a/juk/playlistbox.cpp b/juk/playlistbox.cpp
index 092342a3..32e874b9 100644
--- a/juk/playlistbox.cpp
+++ b/juk/playlistbox.cpp
@@ -20,9 +20,9 @@
#include <kaction.h>
#include <kdebug.h>
-#include <qheader.h>
-#include <qpainter.h>
-#include <qtimer.h>
+#include <tqheader.h>
+#include <tqpainter.h>
+#include <tqtimer.h>
#include "playlistbox.h"
#include "playlist.h"
@@ -46,7 +46,7 @@ using namespace ActionCollection;
// PlaylistBox public methods
////////////////////////////////////////////////////////////////////////////////
-PlaylistBox::PlaylistBox(QWidget *parent, QWidgetStack *playlistStack,
+PlaylistBox::PlaylistBox(TQWidget *parent, TQWidgetStack *playlistStack,
const char *name) :
KListView(parent, name),
PlaylistCollection(playlistStack),
@@ -98,14 +98,14 @@ PlaylistBox::PlaylistBox(QWidget *parent, QWidgetStack *playlistStack,
m_viewModes.append(new TreeViewMode(this));
// m_viewModes.append(new CoverManagerMode(this));
- QStringList modeNames;
+ TQStringList modeNames;
- for(QValueListIterator<ViewMode *> it = m_viewModes.begin(); it != m_viewModes.end(); ++it)
+ for(TQValueListIterator<ViewMode *> it = m_viewModes.begin(); it != m_viewModes.end(); ++it)
modeNames.append((*it)->name());
viewModeAction->setItems(modeNames);
- QPopupMenu *p = viewModeAction->popupMenu();
+ TQPopupMenu *p = viewModeAction->popupMenu();
p->changeItem(0, SmallIconSet("view_detailed"), modeNames[0]);
p->changeItem(1, SmallIconSet("view_text"), modeNames[1]);
p->changeItem(2, SmallIconSet("view_tree"), modeNames[2]);
@@ -120,43 +120,43 @@ PlaylistBox::PlaylistBox(QWidget *parent, QWidgetStack *playlistStack,
raise(CollectionList::instance());
viewModeAction->plug(m_contextMenu);
- connect(viewModeAction, SIGNAL(activated(int)), this, SLOT(slotSetViewMode(int)));
+ connect(viewModeAction, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotSetViewMode(int)));
- connect(this, SIGNAL(selectionChanged()),
- this, SLOT(slotPlaylistChanged()));
+ connect(this, TQT_SIGNAL(selectionChanged()),
+ this, TQT_SLOT(slotPlaylistChanged()));
- connect(this, SIGNAL(doubleClicked(QListViewItem *)),
- this, SLOT(slotDoubleClicked()));
+ connect(this, TQT_SIGNAL(doubleClicked(TQListViewItem *)),
+ this, TQT_SLOT(slotDoubleClicked()));
- connect(this, SIGNAL(contextMenuRequested(QListViewItem *, const QPoint &, int)),
- this, SLOT(slotShowContextMenu(QListViewItem *, const QPoint &, int)));
+ connect(this, TQT_SIGNAL(contextMenuRequested(TQListViewItem *, const TQPoint &, int)),
+ this, TQT_SLOT(slotShowContextMenu(TQListViewItem *, const TQPoint &, int)));
TagTransactionManager *tagManager = TagTransactionManager::instance();
- connect(tagManager, SIGNAL(signalAboutToModifyTags()), SLOT(slotFreezePlaylists()));
- connect(tagManager, SIGNAL(signalDoneModifyingTags()), SLOT(slotUnfreezePlaylists()));
+ connect(tagManager, TQT_SIGNAL(signalAboutToModifyTags()), TQT_SLOT(slotFreezePlaylists()));
+ connect(tagManager, TQT_SIGNAL(signalDoneModifyingTags()), TQT_SLOT(slotUnfreezePlaylists()));
setupUpcomingPlaylist();
- connect(CollectionList::instance(), SIGNAL(signalNewTag(const QString &, unsigned)),
- this, SLOT(slotAddItem(const QString &, unsigned)));
- connect(CollectionList::instance(), SIGNAL(signalRemovedTag(const QString &, unsigned)),
- this, SLOT(slotRemoveItem(const QString &, unsigned)));
+ connect(CollectionList::instance(), TQT_SIGNAL(signalNewTag(const TQString &, unsigned)),
+ this, TQT_SLOT(slotAddItem(const TQString &, unsigned)));
+ connect(CollectionList::instance(), TQT_SIGNAL(signalRemovedTag(const TQString &, unsigned)),
+ this, TQT_SLOT(slotRemoveItem(const TQString &, unsigned)));
- QTimer::singleShot(0, object(), SLOT(slotScanFolders()));
+ TQTimer::singleShot(0, object(), TQT_SLOT(slotScanFolders()));
enableDirWatch(true);
// Auto-save playlists after 10 minutes
- QTimer::singleShot(600000, this, SLOT(slotSavePlaylists()));
+ TQTimer::singleShot(600000, this, TQT_SLOT(slotSavePlaylists()));
- m_showTimer = new QTimer(this);
- connect(m_showTimer, SIGNAL(timeout()), SLOT(slotShowDropTarget()));
+ m_showTimer = new TQTimer(this);
+ connect(m_showTimer, TQT_SIGNAL(timeout()), TQT_SLOT(slotShowDropTarget()));
}
PlaylistBox::~PlaylistBox()
{
PlaylistList l;
CollectionList *collection = CollectionList::instance();
- for(QListViewItem *i = firstChild(); i; i = i->nextSibling()) {
+ for(TQListViewItem *i = firstChild(); i; i = i->nextSibling()) {
Item *item = static_cast<Item *>(i);
if(item->playlist() && item->playlist() != collection)
l.append(item->playlist());
@@ -192,7 +192,7 @@ void PlaylistBox::duplicate()
if(!item || !item->playlist())
return;
- QString name = playlistNameDialog(i18n("Duplicate"), item->text(0));
+ TQString name = playlistNameDialog(i18n("Duplicate"), item->text(0));
if(name.isNull())
return;
@@ -225,15 +225,15 @@ void PlaylistBox::slotUnfreezePlaylists()
setDynamicListsFrozen(false);
}
-void PlaylistBox::setupPlaylist(Playlist *playlist, const QString &iconName)
+void PlaylistBox::setupPlaylist(Playlist *playlist, const TQString &iconName)
{
setupPlaylist(playlist, iconName, 0);
}
-void PlaylistBox::setupPlaylist(Playlist *playlist, const QString &iconName, Item *parentItem)
+void PlaylistBox::setupPlaylist(Playlist *playlist, const TQString &iconName, Item *parentItem)
{
- connect(playlist, SIGNAL(signalPlaylistItemsDropped(Playlist *)),
- SLOT(slotPlaylistItemsDropped(Playlist *)));
+ connect(playlist, TQT_SIGNAL(signalPlaylistItemsDropped(Playlist *)),
+ TQT_SLOT(slotPlaylistItemsDropped(Playlist *)));
PlaylistCollection::setupPlaylist(playlist, iconName);
@@ -274,13 +274,13 @@ void PlaylistBox::remove()
if(items.isEmpty())
return;
- QStringList files;
- QStringList names;
+ TQStringList files;
+ TQStringList names;
for(ItemList::ConstIterator it = items.begin(); it != items.end(); ++it) {
if(*it && (*it)->playlist() &&
!(*it)->playlist()->fileName().isEmpty() &&
- QFileInfo((*it)->playlist()->fileName()).exists())
+ TQFileInfo((*it)->playlist()->fileName()).exists())
{
files.append((*it)->playlist()->fileName());
}
@@ -289,12 +289,12 @@ void PlaylistBox::remove()
if(!files.isEmpty()) {
int remove = KMessageBox::warningYesNoCancelList(
- this, i18n("Do you want to delete these files from the disk as well?"), files, QString::null, KStdGuiItem::del(), i18n("Keep"));
+ this, i18n("Do you want to delete these files from the disk as well?"), files, TQString::null, KStdGuiItem::del(), i18n("Keep"));
if(remove == KMessageBox::Yes) {
- QStringList couldNotDelete;
- for(QStringList::ConstIterator it = files.begin(); it != files.end(); ++it) {
- if(!QFile::remove(*it))
+ TQStringList couldNotDelete;
+ for(TQStringList::ConstIterator it = files.begin(); it != files.end(); ++it) {
+ if(!TQFile::remove(*it))
couldNotDelete.append(*it);
}
@@ -352,7 +352,7 @@ void PlaylistBox::remove()
void PlaylistBox::setDynamicListsFrozen(bool frozen)
{
- for(QValueList<ViewMode *>::Iterator it = m_viewModes.begin();
+ for(TQValueList<ViewMode *>::Iterator it = m_viewModes.begin();
it != m_viewModes.end();
++it)
{
@@ -366,7 +366,7 @@ void PlaylistBox::slotSavePlaylists()
PlaylistList l;
CollectionList *collection = CollectionList::instance();
- for(QListViewItem *i = firstChild(); i; i = i->nextSibling()) {
+ for(TQListViewItem *i = firstChild(); i; i = i->nextSibling()) {
Item *item = static_cast<Item *>(i);
if(item->playlist() && item->playlist() != collection)
l.append(item->playlist());
@@ -375,7 +375,7 @@ void PlaylistBox::slotSavePlaylists()
Cache::savePlaylists(l);
CoverManager::saveCovers();
- QTimer::singleShot(600000, this, SLOT(slotSavePlaylists()));
+ TQTimer::singleShot(600000, this, TQT_SLOT(slotSavePlaylists()));
}
void PlaylistBox::slotShowDropTarget()
@@ -388,19 +388,19 @@ void PlaylistBox::slotShowDropTarget()
raise(m_dropItem->playlist());
}
-void PlaylistBox::slotAddItem(const QString &tag, unsigned column)
+void PlaylistBox::slotAddItem(const TQString &tag, unsigned column)
{
- for(QValueListIterator<ViewMode *> it = m_viewModes.begin(); it != m_viewModes.end(); ++it)
+ for(TQValueListIterator<ViewMode *> it = m_viewModes.begin(); it != m_viewModes.end(); ++it)
(*it)->addItems(tag, column);
}
-void PlaylistBox::slotRemoveItem(const QString &tag, unsigned column)
+void PlaylistBox::slotRemoveItem(const TQString &tag, unsigned column)
{
- for(QValueListIterator<ViewMode *> it = m_viewModes.begin(); it != m_viewModes.end(); ++it)
+ for(TQValueListIterator<ViewMode *> it = m_viewModes.begin(); it != m_viewModes.end(); ++it)
(*it)->removeItem(tag, column);
}
-void PlaylistBox::decode(QMimeSource *s, Item *item)
+void PlaylistBox::decode(TQMimeSource *s, Item *item)
{
if(!s || (item && item->playlist() && item->playlist()->readOnly()))
return;
@@ -408,7 +408,7 @@ void PlaylistBox::decode(QMimeSource *s, Item *item)
KURL::List urls;
if(KURLDrag::decode(s, urls) && !urls.isEmpty()) {
- QStringList files;
+ TQStringList files;
for(KURL::List::Iterator it = urls.begin(); it != urls.end(); ++it)
files.append((*it).path());
@@ -426,7 +426,7 @@ void PlaylistBox::decode(QMimeSource *s, Item *item)
if(item && item->playlist())
item->playlist()->addFiles(files);
else {
- QString name = playlistNameDialog();
+ TQString name = playlistNameDialog();
if(!name.isNull()) {
Playlist *p = new Playlist(this, name);
p->addFiles(files);
@@ -435,7 +435,7 @@ void PlaylistBox::decode(QMimeSource *s, Item *item)
}
}
-void PlaylistBox::contentsDropEvent(QDropEvent *e)
+void PlaylistBox::contentsDropEvent(TQDropEvent *e)
{
m_showTimer->stop();
@@ -449,7 +449,7 @@ void PlaylistBox::contentsDropEvent(QDropEvent *e)
}
}
-void PlaylistBox::contentsDragMoveEvent(QDragMoveEvent *e)
+void PlaylistBox::contentsDragMoveEvent(TQDragMoveEvent *e)
{
// If we can decode the input source, there is a non-null item at the "move"
// position, the playlist for that Item is non-null, is not the
@@ -512,7 +512,7 @@ void PlaylistBox::contentsDragMoveEvent(QDragMoveEvent *e)
}
}
-void PlaylistBox::contentsDragLeaveEvent(QDragLeaveEvent *e)
+void PlaylistBox::contentsDragLeaveEvent(TQDragLeaveEvent *e)
{
if(m_dropItem) {
Item *old = m_dropItem;
@@ -522,14 +522,14 @@ void PlaylistBox::contentsDragLeaveEvent(QDragLeaveEvent *e)
KListView::contentsDragLeaveEvent(e);
}
-void PlaylistBox::contentsMousePressEvent(QMouseEvent *e)
+void PlaylistBox::contentsMousePressEvent(TQMouseEvent *e)
{
if(e->button() == LeftButton)
m_doingMultiSelect = true;
KListView::contentsMousePressEvent(e);
}
-void PlaylistBox::contentsMouseReleaseEvent(QMouseEvent *e)
+void PlaylistBox::contentsMouseReleaseEvent(TQMouseEvent *e)
{
if(e->button() == LeftButton) {
m_doingMultiSelect = false;
@@ -538,14 +538,14 @@ void PlaylistBox::contentsMouseReleaseEvent(QMouseEvent *e)
KListView::contentsMouseReleaseEvent(e);
}
-void PlaylistBox::keyPressEvent(QKeyEvent *e)
+void PlaylistBox::keyPressEvent(TQKeyEvent *e)
{
if((e->key() == Key_Up || e->key() == Key_Down) && e->state() == ShiftButton)
m_doingMultiSelect = true;
KListView::keyPressEvent(e);
}
-void PlaylistBox::keyReleaseEvent(QKeyEvent *e)
+void PlaylistBox::keyReleaseEvent(TQKeyEvent *e)
{
if(m_doingMultiSelect && e->key() == Key_Shift) {
m_doingMultiSelect = false;
@@ -558,14 +558,14 @@ PlaylistBox::ItemList PlaylistBox::selectedItems() const
{
ItemList l;
- for(QListViewItemIterator it(const_cast<PlaylistBox *>(this),
- QListViewItemIterator::Selected); it.current(); ++it)
+ for(TQListViewItemIterator it(const_cast<PlaylistBox *>(this),
+ TQListViewItemIterator::Selected); it.current(); ++it)
l.append(static_cast<Item *>(*it));
return l;
}
-void PlaylistBox::setSingleItem(QListViewItem *item)
+void PlaylistBox::setSingleItem(TQListViewItem *item)
{
setSelectionModeExt(Single);
KListView::setCurrentItem(item);
@@ -644,7 +644,7 @@ void PlaylistBox::slotDoubleClicked()
action("play")->activate();
}
-void PlaylistBox::slotShowContextMenu(QListViewItem *, const QPoint &point, int)
+void PlaylistBox::slotShowContextMenu(TQListViewItem *, const TQPoint &point, int)
{
m_contextMenu->popup(point);
}
@@ -685,15 +685,15 @@ void PlaylistBox::setupUpcomingPlaylist()
PlaylistBox::Item *PlaylistBox::Item::m_collectionItem = 0;
-PlaylistBox::Item::Item(PlaylistBox *listBox, const QString &icon, const QString &text, Playlist *l)
- : QObject(listBox), KListViewItem(listBox, 0, text),
+PlaylistBox::Item::Item(PlaylistBox *listBox, const TQString &icon, const TQString &text, Playlist *l)
+ : TQObject(listBox), KListViewItem(listBox, 0, text),
m_playlist(l), m_text(text), m_iconName(icon), m_sortedFirst(false)
{
init();
}
-PlaylistBox::Item::Item(Item *parent, const QString &icon, const QString &text, Playlist *l)
- : QObject(parent->listView()), KListViewItem(parent, text),
+PlaylistBox::Item::Item(Item *parent, const TQString &icon, const TQString &text, Playlist *l)
+ : TQObject(parent->listView()), KListViewItem(parent, text),
m_playlist(l), m_text(text), m_iconName(icon), m_sortedFirst(false)
{
init();
@@ -704,7 +704,7 @@ PlaylistBox::Item::~Item()
}
-int PlaylistBox::Item::compare(QListViewItem *i, int col, bool) const
+int PlaylistBox::Item::compare(TQListViewItem *i, int col, bool) const
{
Item *otherItem = static_cast<Item *>(i);
PlaylistBox *playlistBox = static_cast<PlaylistBox *>(listView());
@@ -722,13 +722,13 @@ int PlaylistBox::Item::compare(QListViewItem *i, int col, bool) const
return text(col).lower().localeAwareCompare(i->text(col).lower());
}
-void PlaylistBox::Item::paintCell(QPainter *painter, const QColorGroup &colorGroup, int column, int width, int align)
+void PlaylistBox::Item::paintCell(TQPainter *painter, const TQColorGroup &colorGroup, int column, int width, int align)
{
PlaylistBox *playlistBox = static_cast<PlaylistBox *>(listView());
playlistBox->viewMode()->paintCell(this, painter, colorGroup, column, width, align);
}
-void PlaylistBox::Item::setText(int column, const QString &text)
+void PlaylistBox::Item::setText(int column, const TQString &text)
{
m_text = text;
KListViewItem::setText(column, text);
@@ -743,7 +743,7 @@ void PlaylistBox::Item::setup()
// PlaylistBox::Item protected slots
////////////////////////////////////////////////////////////////////////////////
-void PlaylistBox::Item::slotSetName(const QString &name)
+void PlaylistBox::Item::slotSetName(const TQString &name)
{
if(listView()) {
setText(0, name);
@@ -770,11 +770,11 @@ void PlaylistBox::Item::init()
list->addNameToDict(m_text);
if(m_playlist) {
- connect(m_playlist, SIGNAL(signalNameChanged(const QString &)),
- this, SLOT(slotSetName(const QString &)));
- connect(m_playlist, SIGNAL(destroyed()), this, SLOT(deleteLater()));
- connect(m_playlist, SIGNAL(signalEnableDirWatch(bool)),
- list->object(), SLOT(slotEnableDirWatch(bool)));
+ connect(m_playlist, TQT_SIGNAL(signalNameChanged(const TQString &)),
+ this, TQT_SLOT(slotSetName(const TQString &)));
+ connect(m_playlist, TQT_SIGNAL(destroyed()), this, TQT_SLOT(deleteLater()));
+ connect(m_playlist, TQT_SIGNAL(signalEnableDirWatch(bool)),
+ list->object(), TQT_SLOT(slotEnableDirWatch(bool)));
}
if(m_playlist == CollectionList::instance()) {