summaryrefslogtreecommitdiffstats
path: root/juk/playlist.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'juk/playlist.cpp')
-rw-r--r--juk/playlist.cpp320
1 files changed, 160 insertions, 160 deletions
diff --git a/juk/playlist.cpp b/juk/playlist.cpp
index b090dca2..fb218881 100644
--- a/juk/playlist.cpp
+++ b/juk/playlist.cpp
@@ -30,14 +30,14 @@
#include <kio/job.h>
#include <dcopclient.h>
-#include <qheader.h>
-#include <qcursor.h>
-#include <qdir.h>
-#include <qeventloop.h>
-#include <qtooltip.h>
-#include <qwidgetstack.h>
-#include <qfile.h>
-#include <qhbox.h>
+#include <tqheader.h>
+#include <tqcursor.h>
+#include <tqdir.h>
+#include <tqeventloop.h>
+#include <tqtooltip.h>
+#include <tqwidgetstack.h>
+#include <tqfile.h>
+#include <tqhbox.h>
#include <id3v1genres.h>
@@ -83,17 +83,17 @@ static bool manualResize()
class PlaylistToolTip : public QToolTip
{
public:
- PlaylistToolTip(QWidget *parent, Playlist *playlist) :
- QToolTip(parent), m_playlist(playlist) {}
+ PlaylistToolTip(TQWidget *parent, Playlist *playlist) :
+ TQToolTip(parent), m_playlist(playlist) {}
- virtual void maybeTip(const QPoint &p)
+ virtual void maybeTip(const TQPoint &p)
{
PlaylistItem *item = static_cast<PlaylistItem *>(m_playlist->itemAt(p));
if(!item)
return;
- QPoint contentsPosition = m_playlist->viewportToContents(p);
+ TQPoint contentsPosition = m_playlist->viewportToContents(p);
int column = m_playlist->header()->sectionAt(contentsPosition.x());
@@ -102,7 +102,7 @@ public:
(column == m_playlist->columnOffset() + PlaylistItem::CoverColumn &&
item->file().coverInfo()->hasCover()))
{
- QRect r = m_playlist->itemRect(item);
+ TQRect r = m_playlist->itemRect(item);
int headerPosition = m_playlist->header()->sectionPos(column);
r.setLeft(headerPosition);
r.setRight(headerPosition + m_playlist->header()->sectionSize(column));
@@ -110,9 +110,9 @@ public:
if(column == m_playlist->columnOffset() + PlaylistItem::FileNameColumn)
tip(r, item->file().absFilePath());
else if(column == m_playlist->columnOffset() + PlaylistItem::CoverColumn) {
- QMimeSourceFactory *f = QMimeSourceFactory::defaultFactory();
+ TQMimeSourceFactory *f = TQMimeSourceFactory::defaultFactory();
f->setImage("coverThumb",
- QImage(item->file().coverInfo()->pixmap(CoverInfo::Thumbnail).convertToImage()));
+ TQImage(item->file().coverInfo()->pixmap(CoverInfo::Thumbnail).convertToImage()));
tip(r, "<center><img source=\"coverThumb\"/></center>");
}
else
@@ -160,8 +160,8 @@ private:
void writeConfig();
static SharedSettings *m_instance;
- QValueList<int> m_columnOrder;
- QValueVector<bool> m_columnsVisible;
+ TQValueList<int> m_columnOrder;
+ TQValueVector<bool> m_columnsVisible;
KGlobalSettings::Completion m_inlineCompletion;
};
@@ -214,7 +214,7 @@ void Playlist::SharedSettings::apply(Playlist *l) const
int offset = l->columnOffset();
int i = 0;
- for(QValueListConstIterator<int> it = m_columnOrder.begin(); it != m_columnOrder.end(); ++it)
+ for(TQValueListConstIterator<int> it = m_columnOrder.begin(); it != m_columnOrder.end(); ++it)
l->header()->moveSection(i++ + offset, *it + offset);
for(uint i = 0; i < m_columnsVisible.size(); i++) {
@@ -243,7 +243,7 @@ Playlist::SharedSettings::SharedSettings()
// save column order
m_columnOrder = config.readIntListEntry("ColumnOrder");
- QValueList<int> l = config.readIntListEntry("VisibleColumns");
+ TQValueList<int> l = config.readIntListEntry("VisibleColumns");
if(l.isEmpty()) {
@@ -268,7 +268,7 @@ Playlist::SharedSettings::SharedSettings()
m_columnsVisible.resize(l.size(), true);
uint i = 0;
- for(QValueList<int>::Iterator it = l.begin(); it != l.end(); ++it) {
+ for(TQValueList<int>::Iterator it = l.begin(); it != l.end(); ++it) {
if(! bool(*it))
m_columnsVisible[i] = bool(*it);
i++;
@@ -288,7 +288,7 @@ void Playlist::SharedSettings::writeConfig()
KConfigGroup config(KGlobal::config(), "PlaylistShared");
config.writeEntry("ColumnOrder", m_columnOrder);
- QValueList<int> l;
+ TQValueList<int> l;
for(uint i = 0; i < m_columnsVisible.size(); i++)
l.append(int(m_columnsVisible[i]));
@@ -305,11 +305,11 @@ void Playlist::SharedSettings::writeConfig()
////////////////////////////////////////////////////////////////////////////////
PlaylistItemList Playlist::m_history;
-QMap<int, PlaylistItem *> Playlist::m_backMenuItems;
+TQMap<int, PlaylistItem *> Playlist::m_backMenuItems;
int Playlist::m_leftColumn = 0;
-Playlist::Playlist(PlaylistCollection *collection, const QString &name,
- const QString &iconName) :
+Playlist::Playlist(PlaylistCollection *collection, const TQString &name,
+ const TQString &iconName) :
KListView(collection->playlistStack(), name.latin1()),
m_collection(collection),
m_fetcher(new WebImageFetcher(this)),
@@ -333,7 +333,7 @@ Playlist::Playlist(PlaylistCollection *collection, const QString &name,
}
Playlist::Playlist(PlaylistCollection *collection, const PlaylistItemList &items,
- const QString &name, const QString &iconName) :
+ const TQString &name, const TQString &iconName) :
KListView(collection->playlistStack(), name.latin1()),
m_collection(collection),
m_fetcher(new WebImageFetcher(this)),
@@ -357,8 +357,8 @@ Playlist::Playlist(PlaylistCollection *collection, const PlaylistItemList &items
createItems(items);
}
-Playlist::Playlist(PlaylistCollection *collection, const QFileInfo &playlistFile,
- const QString &iconName) :
+Playlist::Playlist(PlaylistCollection *collection, const TQFileInfo &playlistFile,
+ const TQString &iconName) :
KListView(collection->playlistStack()),
m_collection(collection),
m_fetcher(new WebImageFetcher(this)),
@@ -424,10 +424,10 @@ Playlist::~Playlist()
m_collection->removePlaylist(this);
}
-QString Playlist::name() const
+TQString Playlist::name() const
{
if(m_playlistName.isNull())
- return m_fileName.section(QDir::separator(), -1).section('.', 0, -2);
+ return m_fileName.section(TQDir::separator(), -1).section('.', 0, -2);
else
return m_playlistName;
}
@@ -469,7 +469,7 @@ int Playlist::time() const
void Playlist::playFirst()
{
TrackSequenceManager::instance()->setNextItem(static_cast<PlaylistItem *>(
- QListViewItemIterator(const_cast<Playlist *>(this), QListViewItemIterator::Visible).current()));
+ TQListViewItemIterator(const_cast<Playlist *>(this), TQListViewItemIterator::Visible).current()));
action("forward")->activate();
}
@@ -479,7 +479,7 @@ void Playlist::playNextAlbum()
if(!current)
return; // No next album if we're not already playing.
- QString currentAlbum = current->file().tag()->album();
+ TQString currentAlbum = current->file().tag()->album();
current = TrackSequenceManager::instance()->nextItem();
while(current && current->file().tag()->album() == currentAlbum)
@@ -526,7 +526,7 @@ void Playlist::playPrevious()
setPlaying(previous, false);
}
-void Playlist::setName(const QString &n)
+void Playlist::setName(const TQString &n)
{
m_collection->addNameToDict(n);
m_collection->removeNameFromDict(m_playlistName);
@@ -540,16 +540,16 @@ void Playlist::save()
if(m_fileName.isEmpty())
return saveAs();
- QFile file(m_fileName);
+ TQFile file(m_fileName);
if(!file.open(IO_WriteOnly))
return KMessageBox::error(this, i18n("Could not save to file %1.").arg(m_fileName));
- QTextStream stream(&file);
+ TQTextStream stream(&file);
- QStringList fileList = files();
+ TQStringList fileList = files();
- for(QStringList::Iterator it = fileList.begin(); it != fileList.end(); ++it)
+ for(TQStringList::Iterator it = fileList.begin(); it != fileList.end(); ++it)
stream << *it << endl;
file.close();
@@ -603,11 +603,11 @@ PlaylistItem *Playlist::playingItem() // static
return PlaylistItem::playingItems().isEmpty() ? 0 : PlaylistItem::playingItems().front();
}
-QStringList Playlist::files() const
+TQStringList Playlist::files() const
{
- QStringList list;
+ TQStringList list;
- for(QListViewItemIterator it(const_cast<Playlist *>(this)); it.current(); ++it)
+ for(TQListViewItemIterator it(const_cast<Playlist *>(this)); it.current(); ++it)
list.append(static_cast<PlaylistItem *>(*it)->file().absFilePath());
return list;
@@ -615,12 +615,12 @@ QStringList Playlist::files() const
PlaylistItemList Playlist::items()
{
- return items(QListViewItemIterator::IteratorFlag(0));
+ return items(TQListViewItemIterator::IteratorFlag(0));
}
PlaylistItemList Playlist::visibleItems()
{
- return items(QListViewItemIterator::Visible);
+ return items(TQListViewItemIterator::Visible);
}
PlaylistItemList Playlist::selectedItems()
@@ -634,8 +634,8 @@ PlaylistItemList Playlist::selectedItems()
// list.append(m_lastSelected);
// break;
default:
- list = items(QListViewItemIterator::IteratorFlag(QListViewItemIterator::Selected |
- QListViewItemIterator::Visible));
+ list = items(TQListViewItemIterator::IteratorFlag(TQListViewItemIterator::Selected |
+ TQListViewItemIterator::Visible));
break;
}
@@ -707,7 +707,7 @@ void Playlist::synchronizePlayingItems(const PlaylistList &sources, bool setMast
for(PlaylistList::ConstIterator it = sources.begin(); it != sources.end(); ++it) {
if((*it)->playing()) {
CollectionListItem *base = playingItem()->collectionItem();
- for(QListViewItemIterator itemIt(this); itemIt.current(); ++itemIt) {
+ for(TQListViewItemIterator itemIt(this); itemIt.current(); ++itemIt) {
PlaylistItem *item = static_cast<PlaylistItem *>(itemIt.current());
if(base == item->collectionItem()) {
item->setPlaying(true, setMaster);
@@ -800,7 +800,7 @@ void Playlist::slotRemoveCover()
return;
int button = KMessageBox::warningContinueCancel(this,
i18n("Are you sure you want to delete these covers?"),
- QString::null,
+ TQString::null,
i18n("&Delete Covers"));
if(button == KMessageBox::Continue)
refreshAlbums(items);
@@ -845,12 +845,12 @@ void Playlist::slotAddCover(bool retrieveLocal)
return;
}
- QPixmap newCover;
+ TQPixmap newCover;
if(retrieveLocal) {
KURL file = KFileDialog::getImageOpenURL(
":homedir", this, i18n("Select Cover Image File"));
- newCover = QPixmap(file.directory() + "/" + file.fileName());
+ newCover = TQPixmap(file.directory() + "/" + file.fileName());
}
else {
m_fetcher->setFile((*items.begin())->file());
@@ -861,8 +861,8 @@ void Playlist::slotAddCover(bool retrieveLocal)
if(newCover.isNull())
return;
- QString artist = items.front()->file().tag()->artist();
- QString album = items.front()->file().tag()->album();
+ TQString artist = items.front()->file().tag()->artist();
+ TQString album = items.front()->file().tag()->album();
coverKey newId = CoverManager::addCover(newCover, artist, album);
refreshAlbums(items, newId);
@@ -903,7 +903,7 @@ void Playlist::slotGuessTagInfo(TagGuesser::Type type)
void Playlist::slotReload()
{
- QFileInfo fileInfo(m_fileName);
+ TQFileInfo fileInfo(m_fileName);
if(!fileInfo.exists() || !fileInfo.isFile() || !fileInfo.isReadable())
return;
@@ -975,7 +975,7 @@ void Playlist::removeFromDisk(const PlaylistItemList &items)
{
if(isVisible() && !items.isEmpty()) {
- QStringList files;
+ TQStringList files;
for(PlaylistItemList::ConstIterator it = items.begin(); it != items.end(); ++it)
files.append((*it)->file().absFilePath());
@@ -985,15 +985,15 @@ void Playlist::removeFromDisk(const PlaylistItemList &items)
if(dialog.confirmDeleteList(files)) {
bool shouldDelete = dialog.shouldDelete();
- QStringList errorFiles;
+ TQStringList errorFiles;
for(PlaylistItemList::ConstIterator it = items.begin(); it != items.end(); ++it) {
if(playingItem() == *it)
action("forward")->activate();
- QString removePath = (*it)->file().absFilePath();
+ TQString removePath = (*it)->file().absFilePath();
if((!shouldDelete && KIO::NetAccess::synchronousRun(KIO::trash(removePath), this)) ||
- (shouldDelete && QFile::remove(removePath)))
+ (shouldDelete && TQFile::remove(removePath)))
{
CollectionList::instance()->clearItem((*it)->collectionItem());
}
@@ -1002,7 +1002,7 @@ void Playlist::removeFromDisk(const PlaylistItemList &items)
}
if(!errorFiles.isEmpty()) {
- QString errorMsg = shouldDelete ?
+ TQString errorMsg = shouldDelete ?
i18n("Could not delete these files") :
i18n("Could not move these files to the Trash");
KMessageBox::errorList(this, errorMsg, errorFiles);
@@ -1015,7 +1015,7 @@ void Playlist::removeFromDisk(const PlaylistItemList &items)
}
}
-QDragObject *Playlist::dragObject(QWidget *parent)
+TQDragObject *Playlist::dragObject(TQWidget *parent)
{
PlaylistItemList items = selectedItems();
KURL::List urls;
@@ -1031,7 +1031,7 @@ QDragObject *Playlist::dragObject(QWidget *parent)
return drag;
}
-void Playlist::contentsDragEnterEvent(QDragEnterEvent *e)
+void Playlist::contentsDragEnterEvent(TQDragEnterEvent *e)
{
KListView::contentsDragEnterEvent(e);
@@ -1056,12 +1056,12 @@ void Playlist::contentsDragEnterEvent(QDragEnterEvent *e)
return;
}
-bool Playlist::acceptDrag(QDropEvent *e) const
+bool Playlist::acceptDrag(TQDropEvent *e) const
{
return CoverDrag::canDecode(e) || KURLDrag::canDecode(e);
}
-bool Playlist::canDecode(QMimeSource *s)
+bool Playlist::canDecode(TQMimeSource *s)
{
KURL::List urls;
@@ -1071,7 +1071,7 @@ bool Playlist::canDecode(QMimeSource *s)
return KURLDrag::decode(s, urls) && !urls.isEmpty();
}
-void Playlist::decode(QMimeSource *s, PlaylistItem *item)
+void Playlist::decode(TQMimeSource *s, PlaylistItem *item)
{
KURL::List urls;
@@ -1082,7 +1082,7 @@ void Playlist::decode(QMimeSource *s, PlaylistItem *item)
if(!MediaFiles::isMediaFile(urls.front().path())) {
- QString file;
+ TQString file;
if(urls.front().isLocalFile())
file = urls.front().path();
@@ -1092,7 +1092,7 @@ void Playlist::decode(QMimeSource *s, PlaylistItem *item)
KMimeType::Ptr mimeType = KMimeType::findByPath(file);
if(item && mimeType->name().startsWith("image/")) {
- item->file().coverInfo()->setCover(QImage(file));
+ item->file().coverInfo()->setCover(TQImage(file));
refreshAlbum(item->file().tag()->artist(),
item->file().tag()->album());
}
@@ -1100,7 +1100,7 @@ void Playlist::decode(QMimeSource *s, PlaylistItem *item)
KIO::NetAccess::removeTempFile(file);
}
- QStringList fileList;
+ TQStringList fileList;
for(KURL::List::Iterator it = urls.begin(); it != urls.end(); ++it)
fileList += MediaFiles::convertURLsToLocal((*it).path(), this);
@@ -1108,13 +1108,13 @@ void Playlist::decode(QMimeSource *s, PlaylistItem *item)
addFiles(fileList, item);
}
-bool Playlist::eventFilter(QObject *watched, QEvent *e)
+bool Playlist::eventFilter(TQObject *watched, TQEvent *e)
{
if(watched == header()) {
switch(e->type()) {
- case QEvent::MouseMove:
+ case TQEvent::MouseMove:
{
- if((static_cast<QMouseEvent *>(e)->state() & LeftButton) == LeftButton &&
+ if((static_cast<TQMouseEvent *>(e)->state() & LeftButton) == LeftButton &&
!action<KToggleAction>("resizeColumnsManually")->isChecked())
{
m_columnWidthModeChanged = true;
@@ -1125,14 +1125,14 @@ bool Playlist::eventFilter(QObject *watched, QEvent *e)
break;
}
- case QEvent::MouseButtonPress:
+ case TQEvent::MouseButtonPress:
{
- if(static_cast<QMouseEvent *>(e)->button() == RightButton)
- m_headerMenu->popup(QCursor::pos());
+ if(static_cast<TQMouseEvent *>(e)->button() == RightButton)
+ m_headerMenu->popup(TQCursor::pos());
break;
}
- case QEvent::MouseButtonRelease:
+ case TQEvent::MouseButtonRelease:
{
if(m_columnWidthModeChanged) {
m_columnWidthModeChanged = false;
@@ -1140,7 +1140,7 @@ bool Playlist::eventFilter(QObject *watched, QEvent *e)
}
if(!manualResize() && m_widthsDirty)
- QTimer::singleShot(0, this, SLOT(slotUpdateColumnWidths()));
+ TQTimer::singleShot(0, this, TQT_SLOT(slotUpdateColumnWidths()));
break;
}
default:
@@ -1151,15 +1151,15 @@ bool Playlist::eventFilter(QObject *watched, QEvent *e)
return KListView::eventFilter(watched, e);
}
-void Playlist::keyPressEvent(QKeyEvent *event)
+void Playlist::keyPressEvent(TQKeyEvent *event)
{
if(event->key() == Key_Up) {
- QListViewItemIterator selected(this, QListViewItemIterator::IteratorFlag(
- QListViewItemIterator::Selected |
- QListViewItemIterator::Visible));
+ TQListViewItemIterator selected(this, TQListViewItemIterator::IteratorFlag(
+ TQListViewItemIterator::Selected |
+ TQListViewItemIterator::Visible));
if(selected.current()) {
- QListViewItemIterator visible(this, QListViewItemIterator::IteratorFlag(
- QListViewItemIterator::Visible));
+ TQListViewItemIterator visible(this, TQListViewItemIterator::IteratorFlag(
+ TQListViewItemIterator::Visible));
if(selected.current() == visible.current())
KApplication::postEvent(parent(), new FocusUpEvent);
}
@@ -1169,9 +1169,9 @@ void Playlist::keyPressEvent(QKeyEvent *event)
KListView::keyPressEvent(event);
}
-void Playlist::contentsDropEvent(QDropEvent *e)
+void Playlist::contentsDropEvent(TQDropEvent *e)
{
- QPoint vp = contentsToViewport(e->pos());
+ TQPoint vp = contentsToViewport(e->pos());
PlaylistItem *item = static_cast<PlaylistItem *>(itemAt(vp));
// First see if we're dropping a cover, if so we can get it out of the
@@ -1215,9 +1215,9 @@ void Playlist::contentsDropEvent(QDropEvent *e)
setSorting(columns() + 1);
- QPtrList<QListViewItem> items = KListView::selectedItems();
+ TQPtrList<TQListViewItem> items = KListView::selectedItems();
- for(QPtrListIterator<QListViewItem> it(items); it.current(); ++it) {
+ for(TQPtrListIterator<TQListViewItem> it(items); it.current(); ++it) {
if(!item) {
// Insert the item at the top of the list. This is a bit ugly,
@@ -1242,7 +1242,7 @@ void Playlist::contentsDropEvent(QDropEvent *e)
KListView::contentsDropEvent(e);
}
-void Playlist::contentsMouseDoubleClickEvent(QMouseEvent *e)
+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.
@@ -1251,7 +1251,7 @@ void Playlist::contentsMouseDoubleClickEvent(QMouseEvent *e)
KListView::contentsMouseDoubleClickEvent(e);
}
-void Playlist::showEvent(QShowEvent *e)
+void Playlist::showEvent(TQShowEvent *e)
{
if(m_applySharedSettings) {
SharedSettings::instance()->apply(this);
@@ -1265,21 +1265,21 @@ void Playlist::applySharedSettings()
m_applySharedSettings = true;
}
-void Playlist::read(QDataStream &s)
+void Playlist::read(TQDataStream &s)
{
- QString buffer;
+ TQString buffer;
s >> m_playlistName
>> m_fileName;
- QStringList files;
+ TQStringList files;
s >> files;
- QListViewItem *after = 0;
+ TQListViewItem *after = 0;
m_blockDataChanged = true;
- for(QStringList::ConstIterator it = files.begin(); it != files.end(); ++it)
+ for(TQStringList::ConstIterator it = files.begin(); it != files.end(); ++it)
after = createItem(FileHandle(*it), after, false);
m_blockDataChanged = false;
@@ -1288,7 +1288,7 @@ void Playlist::read(QDataStream &s)
m_collection->setupPlaylist(this, "midi");
}
-void Playlist::viewportPaintEvent(QPaintEvent *pe)
+void Playlist::viewportPaintEvent(TQPaintEvent *pe)
{
// If there are columns that need to be updated, well, update them.
@@ -1301,7 +1301,7 @@ void Playlist::viewportPaintEvent(QPaintEvent *pe)
KListView::viewportPaintEvent(pe);
}
-void Playlist::viewportResizeEvent(QResizeEvent *re)
+void Playlist::viewportResizeEvent(TQResizeEvent *re)
{
// If the width of the view has changed, manually update the column
// widths.
@@ -1312,10 +1312,10 @@ void Playlist::viewportResizeEvent(QResizeEvent *re)
KListView::viewportResizeEvent(re);
}
-void Playlist::insertItem(QListViewItem *item)
+void Playlist::insertItem(TQListViewItem *item)
{
// Because we're called from the PlaylistItem ctor, item may not be a
- // PlaylistItem yet (it would be QListViewItem when being inserted. But,
+ // PlaylistItem yet (it would be TQListViewItem when being inserted. But,
// it will be a PlaylistItem by the time it matters, but be careful if
// you need to use the PlaylistItem from here.
@@ -1323,7 +1323,7 @@ void Playlist::insertItem(QListViewItem *item)
KListView::insertItem(item);
}
-void Playlist::takeItem(QListViewItem *item)
+void Playlist::takeItem(TQListViewItem *item)
{
// See the warning in Playlist::insertItem.
@@ -1331,14 +1331,14 @@ void Playlist::takeItem(QListViewItem *item)
KListView::takeItem(item);
}
-void Playlist::addColumn(const QString &label)
+void Playlist::addColumn(const TQString &label)
{
slotWeightDirty(columns());
KListView::addColumn(label, 30);
}
PlaylistItem *Playlist::createItem(const FileHandle &file,
- QListViewItem *after, bool emitChanged)
+ TQListViewItem *after, bool emitChanged)
{
return createItem<PlaylistItem, CollectionListItem, CollectionList>(file, after, emitChanged);
}
@@ -1348,7 +1348,7 @@ void Playlist::createItems(const PlaylistItemList &siblings, PlaylistItem *after
createItems<CollectionListItem, PlaylistItem, PlaylistItem>(siblings, after);
}
-void Playlist::addFiles(const QStringList &files, PlaylistItem *after)
+void Playlist::addFiles(const TQStringList &files, PlaylistItem *after)
{
if(!after)
after = static_cast<PlaylistItem *>(lastItem());
@@ -1359,8 +1359,8 @@ void Playlist::addFiles(const QStringList &files, PlaylistItem *after)
FileHandleList queue;
- const QStringList::ConstIterator filesEnd = files.end();
- for(QStringList::ConstIterator it = files.begin(); it != filesEnd; ++it)
+ const TQStringList::ConstIterator filesEnd = files.end();
+ for(TQStringList::ConstIterator it = files.begin(); it != filesEnd; ++it)
addFile(*it, queue, true, &after);
addFileHelper(queue, &after, true);
@@ -1375,12 +1375,12 @@ void Playlist::addFiles(const QStringList &files, PlaylistItem *after)
void Playlist::refreshAlbums(const PlaylistItemList &items, coverKey id)
{
- QValueList< QPair<QString, QString> > albums;
+ TQValueList< QPair<TQString, TQString> > albums;
bool setAlbumCovers = items.count() == 1;
for(PlaylistItemList::ConstIterator it = items.begin(); it != items.end(); ++it) {
- QString artist = (*it)->file().tag()->artist();
- QString album = (*it)->file().tag()->album();
+ 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));
@@ -1390,7 +1390,7 @@ void Playlist::refreshAlbums(const PlaylistItemList &items, coverKey id)
(*it)->file().coverInfo()->applyCoverToWholeAlbum(true);
}
- for(QValueList< QPair<QString, QString> >::ConstIterator it = albums.begin();
+ for(TQValueList< QPair<TQString, TQString> >::ConstIterator it = albums.begin();
it != albums.end(); ++it)
{
refreshAlbum((*it).first, (*it).second);
@@ -1406,7 +1406,7 @@ void Playlist::updatePlaying() const
}
}
-void Playlist::refreshAlbum(const QString &artist, const QString &album)
+void Playlist::refreshAlbum(const TQString &artist, const TQString &album)
{
ColumnList columns;
columns.append(PlaylistItem::ArtistColumn);
@@ -1535,7 +1535,7 @@ void Playlist::polish()
setRenameable(PlaylistItem::YearColumn, true);
setAllColumnsShowFocus(true);
- setSelectionMode(QListView::Extended);
+ setSelectionMode(TQListView::Extended);
setShowSortIndicator(true);
setDropVisualizer(true);
@@ -1559,25 +1559,25 @@ void Playlist::polish()
adjustColumn(i);
}
- connect(m_headerMenu, SIGNAL(activated(int)), this, SLOT(slotToggleColumnVisible(int)));
+ connect(m_headerMenu, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotToggleColumnVisible(int)));
- connect(this, SIGNAL(contextMenuRequested(QListViewItem *, const QPoint &, int)),
- this, SLOT(slotShowRMBMenu(QListViewItem *, const QPoint &, int)));
- connect(this, SIGNAL(itemRenamed(QListViewItem *, const QString &, int)),
- this, SLOT(slotInlineEditDone(QListViewItem *, const QString &, int)));
- connect(this, SIGNAL(doubleClicked(QListViewItem *)),
- this, SLOT(slotPlayCurrent()));
- connect(this, SIGNAL(returnPressed(QListViewItem *)),
- this, SLOT(slotPlayCurrent()));
+ 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(header(), SIGNAL(sizeChange(int, int, int)),
- this, SLOT(slotColumnSizeChanged(int, int, int)));
+ connect(header(), TQT_SIGNAL(sizeChange(int, int, int)),
+ this, TQT_SLOT(slotColumnSizeChanged(int, int, int)));
- connect(renameLineEdit(), SIGNAL(completionModeChanged(KGlobalSettings::Completion)),
- this, SLOT(slotInlineCompletionModeChanged(KGlobalSettings::Completion)));
+ connect(renameLineEdit(), TQT_SIGNAL(completionModeChanged(KGlobalSettings::Completion)),
+ this, TQT_SLOT(slotInlineCompletionModeChanged(KGlobalSettings::Completion)));
- connect(action("resizeColumnsManually"), SIGNAL(activated()),
- this, SLOT(slotColumnResizeModeChanged()));
+ connect(action("resizeColumnsManually"), TQT_SIGNAL(activated()),
+ this, TQT_SLOT(slotColumnResizeModeChanged()));
if(action<KToggleAction>("resizeColumnsManually")->isChecked())
setHScrollBarMode(Auto);
@@ -1651,24 +1651,24 @@ void Playlist::setup()
{
setItemMargin(3);
- connect(header(), SIGNAL(indexChange(int, int, int)), this, SLOT(slotColumnOrderChanged(int, int, int)));
+ connect(header(), TQT_SIGNAL(indexChange(int, int, int)), this, TQT_SLOT(slotColumnOrderChanged(int, int, int)));
- connect(m_fetcher, SIGNAL(signalCoverChanged(int)), this, SLOT(slotCoverChanged(int)));
+ connect(m_fetcher, TQT_SIGNAL(signalCoverChanged(int)), this, TQT_SLOT(slotCoverChanged(int)));
// Prevent list of selected items from changing while internet search is in
// progress.
- connect(this, SIGNAL(selectionChanged()), m_fetcher, SLOT(abortSearch()));
+ connect(this, TQT_SIGNAL(selectionChanged()), m_fetcher, TQT_SLOT(abortSearch()));
setSorting(1);
}
-void Playlist::loadFile(const QString &fileName, const QFileInfo &fileInfo)
+void Playlist::loadFile(const TQString &fileName, const TQFileInfo &fileInfo)
{
- QFile file(fileName);
+ TQFile file(fileName);
if(!file.open(IO_ReadOnly))
return;
- QTextStream stream(&file);
+ TQTextStream stream(&file);
// Turn off non-explicit sorting.
@@ -1681,12 +1681,12 @@ void Playlist::loadFile(const QString &fileName, const QFileInfo &fileInfo)
m_blockDataChanged = true;
while(!stream.atEnd()) {
- QString itemName = stream.readLine().stripWhiteSpace();
+ TQString itemName = stream.readLine().stripWhiteSpace();
- QFileInfo item(itemName);
+ TQFileInfo item(itemName);
if(item.isRelative())
- item.setFile(QDir::cleanDirPath(fileInfo.dirPath(true) + "/" + itemName));
+ item.setFile(TQDir::cleanDirPath(fileInfo.dirPath(true) + "/" + itemName));
if(item.exists() && item.isFile() && item.isReadable() &&
MediaFiles::isMediaFile(item.fileName()))
@@ -1724,7 +1724,7 @@ void Playlist::setPlaying(PlaylistItem *item, bool addToHistory)
}
TrackSequenceManager::instance()->setCurrent(item);
- QByteArray data;
+ TQByteArray data;
kapp->dcopClient()->emitDCOPSignal("Player", "trackChanged()", data);
if(!item)
@@ -1750,11 +1750,11 @@ int Playlist::leftMostVisibleColumn() const
return header()->mapToSection(i);
}
-PlaylistItemList Playlist::items(QListViewItemIterator::IteratorFlag flags)
+PlaylistItemList Playlist::items(TQListViewItemIterator::IteratorFlag flags)
{
PlaylistItemList list;
- for(QListViewItemIterator it(this, flags); it.current(); ++it)
+ for(TQListViewItemIterator it(this, flags); it.current(); ++it)
list.append(static_cast<PlaylistItem *>(it.current()));
return list;
@@ -1766,12 +1766,12 @@ void Playlist::calculateColumnWeights()
return;
PlaylistItemList l = items();
- QValueListConstIterator<int> columnIt;
+ TQValueListConstIterator<int> columnIt;
- QValueVector<double> averageWidth(columns(), 0);
+ TQValueVector<double> averageWidth(columns(), 0);
double itemCount = l.size();
- QValueVector<int> cachedWidth;
+ TQValueVector<int> cachedWidth;
// Here we're not using a real average, but averaging the squares of the
// column widths and then using the square root of that value. This gives
@@ -1796,7 +1796,7 @@ void Playlist::calculateColumnWeights()
m_weightDirty.clear();
}
-void Playlist::addFile(const QString &file, FileHandleList &files, bool importPlaylists,
+void Playlist::addFile(const TQString &file, FileHandleList &files, bool importPlaylists,
PlaylistItem **after)
{
if(hasItem(file) && !m_allowDuplicates)
@@ -1817,7 +1817,7 @@ void Playlist::addFile(const QString &file, FileHandleList &files, bool importPl
}
- const QFileInfo fileInfo = QDir::cleanDirPath(file);
+ const TQFileInfo fileInfo = TQDir::cleanDirPath(file);
if(!fileInfo.exists())
return;
@@ -1838,10 +1838,10 @@ void Playlist::addFile(const QString &file, FileHandleList &files, bool importPl
if(fileInfo.isDir()) {
- // Resorting to the POSIX API because QDir::listEntries() stats every
+ // Resorting to the POSIX API because TQDir::listEntries() stats every
// file and blocks while it's doing so.
- DIR *dir = ::opendir(QFile::encodeName(fileInfo.filePath()));
+ DIR *dir = ::opendir(TQFile::encodeName(fileInfo.filePath()));
if(dir) {
struct dirent *dirEntry;
@@ -1854,7 +1854,7 @@ void Playlist::addFile(const QString &file, FileHandleList &files, bool importPl
// explicitly asked for, but not those that we find in lower
// directories.
- addFile(fileInfo.filePath() + QDir::separator() + QFile::decodeName(dirEntry->d_name),
+ addFile(fileInfo.filePath() + TQDir::separator() + TQFile::decodeName(dirEntry->d_name),
files, m_collection->importPlaylists(), after);
}
}
@@ -1870,7 +1870,7 @@ void Playlist::addFile(const QString &file, FileHandleList &files, bool importPl
void Playlist::addFileHelper(FileHandleList &files, PlaylistItem **after, bool ignoreTimer)
{
- static QTime time = QTime::currentTime();
+ static TQTime time = TQTime::currentTime();
// Process new items every 10 seconds, when we've loaded 1000 items, or when
// it's been requested in the API.
@@ -1912,13 +1912,13 @@ void Playlist::slotUpdateColumnWidths()
// Make sure that the column weights have been initialized before trying to
// update the columns.
- QValueList<int> visibleColumns;
+ TQValueList<int> visibleColumns;
for(int i = 0; i < columns(); i++) {
if(isColumnVisible(i))
visibleColumns.append(i);
}
- QValueListConstIterator<int> it;
+ TQValueListConstIterator<int> it;
if(count() == 0) {
for(it = visibleColumns.begin(); it != visibleColumns.end(); ++it)
@@ -1933,13 +1933,13 @@ void Playlist::slotUpdateColumnWidths()
// First build a list of minimum widths based on the strings in the listview
// header. We won't let the width of the column go below this width.
- QValueVector<int> minimumWidth(columns(), 0);
+ TQValueVector<int> minimumWidth(columns(), 0);
int minimumWidthTotal = 0;
// Also build a list of either the minimum *or* the fixed width -- whichever is
// greater.
- QValueVector<int> minimumFixedWidth(columns(), 0);
+ TQValueVector<int> minimumFixedWidth(columns(), 0);
int minimumFixedWidthTotal = 0;
for(it = visibleColumns.begin(); it != visibleColumns.end(); ++it) {
@@ -1976,7 +1976,7 @@ void Playlist::slotUpdateColumnWidths()
// Computed a "weighted width" for each visible column. This would be the
// width if we didn't have to handle the cases of minimum and maximum widths.
- QValueVector<int> weightedWidth(columns(), 0);
+ TQValueVector<int> weightedWidth(columns(), 0);
for(it = visibleColumns.begin(); it != visibleColumns.end(); ++it)
weightedWidth[*it] = int(double(m_columnWeights[*it]) / totalWeight * visibleWidth() + 0.5);
@@ -1984,7 +1984,7 @@ void Playlist::slotUpdateColumnWidths()
// minimum width or zero if the minimum width is greater than the weighted
// width.
- QValueVector<int> extraWidth(columns(), 0);
+ TQValueVector<int> extraWidth(columns(), 0);
// This is used as an indicator if we have any columns where the weighted
// width is less than the minimum width. If this is false then we can
@@ -2061,7 +2061,7 @@ void Playlist::slotAddToUpcoming()
m_collection->upcomingPlaylist()->appendItems(selectedItems());
}
-void Playlist::slotShowRMBMenu(QListViewItem *item, const QPoint &point, int column)
+void Playlist::slotShowRMBMenu(TQListViewItem *item, const TQPoint &point, int column)
{
if(!item)
return;
@@ -2076,7 +2076,7 @@ void Playlist::slotShowRMBMenu(QListViewItem *item, const QPoint &point, int col
m_rmbMenu = new KPopupMenu(this);
m_rmbUpcomingID = m_rmbMenu->insertItem(SmallIcon("today"),
- i18n("Add to Play Queue"), this, SLOT(slotAddToUpcoming()));
+ i18n("Add to Play Queue"), this, TQT_SLOT(slotAddToUpcoming()));
m_rmbMenu->insertSeparator();
if(!readOnly()) {
@@ -2090,7 +2090,7 @@ void Playlist::slotShowRMBMenu(QListViewItem *item, const QPoint &point, int col
action("edit_copy")->plug(m_rmbMenu);
m_rmbEditID = m_rmbMenu->insertItem(
- i18n("Edit"), this, SLOT(slotRenameTag()));
+ i18n("Edit"), this, TQT_SLOT(slotRenameTag()));
action("refresh")->plug(m_rmbMenu);
action("removeItem")->plug(m_rmbMenu);
@@ -2105,7 +2105,7 @@ void Playlist::slotShowRMBMenu(QListViewItem *item, const QPoint &point, int col
m_rmbMenu->insertSeparator();
m_rmbMenu->insertItem(
- SmallIcon("folder_new"), i18n("Create Playlist From Selected Items..."), this, SLOT(slotCreateGroup()));
+ SmallIcon("folder_new"), i18n("Create Playlist From Selected Items..."), this, TQT_SLOT(slotCreateGroup()));
K3bExporter *exporter = new K3bExporter(this);
KAction *k3bAction = exporter->action();
@@ -2165,7 +2165,7 @@ void Playlist::slotRenameTag()
break;
case PlaylistItem::GenreColumn:
{
- QStringList genreList;
+ TQStringList genreList;
TagLib::StringList genres = TagLib::ID3v1::genreList();
for(TagLib::StringList::ConstIterator it = genres.begin(); it != genres.end(); ++it)
genreList.append(TStringToQString((*it)));
@@ -2182,7 +2182,7 @@ void Playlist::slotRenameTag()
rename(currentItem(), m_currentColumn);
}
-bool Playlist::editTag(PlaylistItem *item, const QString &text, int column)
+bool Playlist::editTag(PlaylistItem *item, const TQString &text, int column)
{
Tag *newTag = TagTransactionManager::duplicateTag(item->file().tag());
@@ -2222,9 +2222,9 @@ bool Playlist::editTag(PlaylistItem *item, const QString &text, int column)
return true;
}
-void Playlist::slotInlineEditDone(QListViewItem *, const QString &, int column)
+void Playlist::slotInlineEditDone(TQListViewItem *, const TQString &, int column)
{
- QString text = renameLineEdit()->text();
+ TQString text = renameLineEdit()->text();
bool changed = false;
PlaylistItemList l = selectedItems();
@@ -2239,7 +2239,7 @@ void Playlist::slotInlineEditDone(QListViewItem *, const QString &, int column)
(l.count() > 1 && KMessageBox::warningContinueCancel(
0,
i18n("This will edit multiple files. Are you sure?"),
- QString::null,
+ TQString::null,
i18n("Edit"),
"DontWarnMultipleTags") == KMessageBox::Cancel))
{
@@ -2292,7 +2292,7 @@ void Playlist::slotToggleColumnVisible(int column)
void Playlist::slotCreateGroup()
{
- QString name = m_collection->playlistNameDialog(i18n("Create New Playlist"));
+ TQString name = m_collection->playlistNameDialog(i18n("Create New Playlist"));
if(!name.isEmpty())
new Playlist(m_collection, selectedItems(), name);
@@ -2321,7 +2321,7 @@ void Playlist::slotInlineCompletionModeChanged(KGlobalSettings::Completion mode)
void Playlist::slotPlayCurrent()
{
- QListViewItemIterator it(this, QListViewItemIterator::Selected);
+ TQListViewItemIterator it(this, TQListViewItemIterator::Selected);
PlaylistItem *next = static_cast<PlaylistItem *>(it.current());
TrackSequenceManager::instance()->setNextItem(next);
action("forward")->activate();
@@ -2331,7 +2331,7 @@ void Playlist::slotPlayCurrent()
// helper functions
////////////////////////////////////////////////////////////////////////////////
-QDataStream &operator<<(QDataStream &s, const Playlist &p)
+TQDataStream &operator<<(TQDataStream &s, const Playlist &p)
{
s << p.name();
s << p.fileName();
@@ -2340,7 +2340,7 @@ QDataStream &operator<<(QDataStream &s, const Playlist &p)
return s;
}
-QDataStream &operator>>(QDataStream &s, Playlist &p)
+TQDataStream &operator>>(TQDataStream &s, Playlist &p)
{
p.read(s);
return s;
@@ -2348,7 +2348,7 @@ QDataStream &operator>>(QDataStream &s, Playlist &p)
bool processEvents()
{
- static QTime time = QTime::currentTime();
+ static TQTime time = TQTime::currentTime();
if(time.elapsed() > 100) {
time.restart();