[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [juk/nokde3] /: more outcommenting and cleaning, now it builds
From: Martin Sandsmark <martin.sandsmark () kde ! org>
Date: 2012-07-27 23:45:19
Message-ID: 20120727234519.045DAA6094 () git ! kde ! org
[Download RAW message or body]
Git commit 029a39f9bc37200977b78cb0857d786630271482 by Martin Sandsmark.
Committed on 28/07/2012 at 01:45.
Pushed by sandsmark into branch 'nokde3'.
more outcommenting and cleaning, now it builds
M +11 -8 cache.cpp
M +51 -45 collectionlist.cpp
M +3 -3 collectionlist.h
M +2 -2 coverinfo.cpp
M +1 -1 dbuscollectionproxy.cpp
M +2 -2 filerenamer.cpp
M +7 -6 k3bexporter.cpp
M +2 -2 mpris2/mediaplayer2player.cpp
M +2 -2 nowplaying.cpp
M +1 -1 nowplaying.h
M +1 -1 playermanager.cpp
M +39 -36 playlist/playlistcollection.cpp
M +7 -4 playlist/playlistcollection.h
M +25 -24 playlist/playlistitem.cpp
M +3 -1 playlist/playlistitem.h
M +1 -1 playlist/playlists/dynamicplaylist.cpp
M +4 -4 playlist/playlists/dynamicplaylist.h
M +128 -88 playlist/playlists/playlist.cpp
M +40 -40 playlist/playlists/playlist.h
M +2 -2 playlist/playlists/upcomingplaylist.cpp
M +6 -6 playlist/playlistsearch.cpp
M +8 -8 playlistbox.cpp
M +2 -2 playlistbox.h
M +29 -24 playlistsplitter.cpp
M +2 -1 playlistsplitter.h
M +3 -3 searchwidget.cpp
M +1 -1 searchwidget.h
M +1 -1 statuslabel.cpp
M +1 -1 statuslabel.h
M +6 -4 tageditor.cpp
M +3 -3 tagtransactionmanager.cpp
M +25 -14 tracksequenceiterator.cpp
M +2 -2 tracksequencemanager.cpp
M +2 -2 viewmode.cpp
http://commits.kde.org/juk/029a39f9bc37200977b78cb0857d786630271482
diff --git a/cache.cpp b/cache.cpp
index 194fd23..73b890e 100644
--- a/cache.cpp
+++ b/cache.cpp
@@ -31,11 +31,11 @@
#include <QBuffer>
#include "tag.h"
-#include "searchplaylist.h"
-#include "historyplaylist.h"
-#include "upcomingplaylist.h"
-#include "folderplaylist.h"
-#include "playlistcollection.h"
+#include "playlist/playlists/searchplaylist.h"
+#include "playlist/playlists/historyplaylist.h"
+#include "playlist/playlists/upcomingplaylist.h"
+#include "playlist/playlists/folderplaylist.h"
+#include "playlist/playlistcollection.h"
#include "actioncollection.h"
using namespace ActionCollection;
@@ -215,8 +215,10 @@ void Cache::loadPlaylists(PlaylistCollection *collection) // \
static if(version >= 2) {
qint32 sortColumn;
s >> sortColumn;
- if(playlist)
- playlist->setSorting(sortColumn);
+ if(playlist) {
+ // ### TODO: View
+// playlist->setSorting(sortColumn);
+ }
}
} // while !s.atEnd()
@@ -313,7 +315,8 @@ void Cache::savePlaylists(const PlaylistList &playlists)
s << qint32(Normal)
<< *(*it);
}
- s << qint32((*it)->sortColumn());
+ // ### TODO: View
+ s << qint32(0);//qint32((*it)->sortColumn());
}
}
diff --git a/collectionlist.cpp b/collectionlist.cpp
index f2840c6..515081a 100644
--- a/collectionlist.cpp
+++ b/collectionlist.cpp
@@ -32,7 +32,7 @@
#include <QClipboard>
#include <QFileInfo>
-#include "playlistcollection.h"
+#include "playlist/playlistcollection.h"
#include "splashscreen.h"
#include "stringshare.h"
#include "cache.h"
@@ -74,11 +74,11 @@ void CollectionList::loadCachedItems()
Qt::SortOrder order = Qt::DescendingOrder;
if(config.readEntry("CollectionListSortAscending", true))
order = Qt::AscendingOrder;
+// ### TODO: View
+// m_list->setSortOrder(order);
+// m_list->setSortColumn(config.readEntry("CollectionListSortColumn", 1));
- m_list->setSortOrder(order);
- m_list->setSortColumn(config.readEntry("CollectionListSortColumn", 1));
-
- m_list->sort();
+// m_list->sort();
SplashScreen::finishedLoading();
}
@@ -159,7 +159,7 @@ void CollectionList::slotNewItems(const KFileItemList &items)
files.append((*it).url().path());
addFiles(files);
- update();
+// update();
}
void CollectionList::slotRefreshItems(const QList<QPair<KFileItem, KFileItem> > \
&items) @@ -174,13 +174,15 @@ void CollectionList::slotRefreshItems(const \
QList<QPair<KFileItem, KFileItem> >
// If the item is no longer on disk, remove it from the collection.
if(item->file().fileInfo().exists())
- item->repaint();
+ // ### TODO: View
+ true;
+ //item->repaint();
else
delete item;
}
}
- update();
+// update();
}
void CollectionList::slotDeleteItem(const KFileItem &item)
@@ -194,12 +196,14 @@ void CollectionList::slotDeleteItem(const KFileItem &item)
void CollectionList::paste()
{
- decode(QApplication::clipboard()->mimeData());
+ // ### TODO: View
+// decode(QApplication::clipboard()->mimeData());
}
void CollectionList::clear()
{
- int result = KMessageBox::warningContinueCancel(this,
+ // ### TODO: View
+ int result = KMessageBox::warningContinueCancel(/*this*/0,
i18n("Removing an item from the collection will also remove it from "
"all of your playlists. Are you sure you want to continue?\n\n"
"Note, however, that if the directory that these files are in is in "
@@ -253,7 +257,7 @@ CollectionList::CollectionList(PlaylistCollection *collection) :
this, SLOT(slotPopulateBackMenu()));
connect(action<KToolBarPopupAction>("back")->menu(), \
SIGNAL(triggered(QAction*)), this, SLOT(slotPlayFromBackMenu(QAction*)));
- setSorting(-1); // Temporarily disable sorting to add items faster.
+// setSorting(-1); // Temporarily disable sorting to add items faster.
m_columnTags[PlaylistItem::ArtistColumn] = new TagCountDict;
m_columnTags[PlaylistItem::AlbumColumn] = new TagCountDict;
@@ -263,8 +267,9 @@ CollectionList::CollectionList(PlaylistCollection *collection) :
CollectionList::~CollectionList()
{
KConfigGroup config(KGlobal::config(), "Playlists");
- config.writeEntry("CollectionListSortColumn", sortColumn());
- config.writeEntry("CollectionListSortAscending", sortOrder() == \
Qt::AscendingOrder); + // ### TODO: View
+// config.writeEntry("CollectionListSortColumn", sortColumn());
+// config.writeEntry("CollectionListSortAscending", sortOrder() == \
Qt::AscendingOrder);
// In some situations the dataChanged signal from clearItems will cause \
observers to
// subsequently try to access a deleted item. Since we're going away just \
remove all @@ -282,21 +287,22 @@ CollectionList::~CollectionList()
m_columnTags.clear();
}
-void CollectionList::contentsDropEvent(QDropEvent *e)
-{
- if(e->source() == this)
- return; // Don't rearrange in the CollectionList.
- else
- Playlist::contentsDropEvent(e);
-}
-
-void CollectionList::contentsDragMoveEvent(QDragMoveEvent *e)
-{
- if(e->source() != this)
- Playlist::contentsDragMoveEvent(e);
- else
- e->setAccepted(false);
-}
+// ### TODO: View
+// void CollectionList::contentsDropEvent(QDropEvent *e)
+// {
+// if(e->source() == this)
+// return; // Don't rearrange in the CollectionList.
+// else
+// Playlist::contentsDropEvent(e);
+// }
+//
+// void CollectionList::contentsDragMoveEvent(QDragMoveEvent *e)
+// {
+// if(e->source() != this)
+// Playlist::contentsDragMoveEvent(e);
+// else
+// e->setAccepted(false);
+// }
QString CollectionList::addStringToDict(const QString &value, int column)
{
@@ -401,22 +407,22 @@ void CollectionListItem::refresh()
data()->metadata[id] = toLower;
}
-
- int newWidth = width(listView()->fontMetrics(), listView(), i);
- if(newWidth != data()->cachedWidths[i])
- playlist()->slotWeightDirty(i);
-
- data()->cachedWidths[i] = newWidth;
+// ### TODO: View
+// int newWidth = width(listView()->fontMetrics(), listView(), i);
+// if(newWidth != data()->cachedWidths[i])
+// playlist()->slotWeightDirty(i);
+//
+// data()->cachedWidths[i] = newWidth;
}
- if(listView()->isVisible())
- repaint();
+// if(listView()->isVisible())
+// repaint();
for(PlaylistItemList::Iterator it = m_children.begin(); it != m_children.end(); \
++it) {
- (*it)->playlist()->update();
+// (*it)->playlist()->update();
(*it)->playlist()->dataChanged();
- if((*it)->listView()->isVisible())
- (*it)->repaint();
+// if((*it)->listView()->isVisible())
+// (*it)->repaint();
}
CollectionList::instance()->dataChanged();
@@ -446,12 +452,12 @@ void CollectionListItem::updateCollectionDict(const QString \
&oldPath, const QStr collection->addToDict(newPath, this);
}
-void CollectionListItem::repaint() const
-{
- Q3ListViewItem::repaint();
- for(PlaylistItemList::ConstIterator it = m_children.constBegin(); it != \
m_children.constEnd(); ++it)
- (*it)->repaint();
-}
+// void CollectionListItem::repaint() const
+// {
+// Q3ListViewItem::repaint();
+// for(PlaylistItemList::ConstIterator it = m_children.constBegin(); it != \
m_children.constEnd(); ++it) +// (*it)->repaint();
+// }
////////////////////////////////////////////////////////////////////////////////
// CollectionListItem protected methods
diff --git a/collectionlist.h b/collectionlist.h
index 68f8960..4d5485e 100644
--- a/collectionlist.h
+++ b/collectionlist.h
@@ -65,7 +65,7 @@ public:
virtual void refresh();
PlaylistItem *itemForPlaylist(const Playlist *playlist);
void updateCollectionDict(const QString &oldPath, const QString &newPath);
- void repaint() const;
+// void repaint() const;
PlaylistItemList children() const { return m_children; }
protected:
@@ -139,8 +139,8 @@ protected:
CollectionList(PlaylistCollection *collection);
virtual ~CollectionList();
- virtual void contentsDropEvent(QDropEvent *e);
- virtual void contentsDragMoveEvent(QDragMoveEvent *e);
+// virtual void contentsDropEvent(QDropEvent *e);
+// virtual void contentsDragMoveEvent(QDragMoveEvent *e);
// These methods are used by CollectionListItem, which is a friend class.
diff --git a/coverinfo.cpp b/coverinfo.cpp
index 151ee58..4e4f6f5 100644
--- a/coverinfo.cpp
+++ b/coverinfo.cpp
@@ -47,8 +47,8 @@
#include "mediafiles.h"
#include "collectionlist.h"
-#include "playlistsearch.h"
-#include "playlistitem.h"
+#include "playlist/playlistsearch.h"
+#include "playlist/playlistitem.h"
#include "tag.h"
struct CoverPopup : public QWidget
diff --git a/dbuscollectionproxy.cpp b/dbuscollectionproxy.cpp
index bc2dfb2..7d8bd82 100644
--- a/dbuscollectionproxy.cpp
+++ b/dbuscollectionproxy.cpp
@@ -23,7 +23,7 @@
#include <kdebug.h>
#include "collectionadaptor.h"
-#include "playlistcollection.h"
+#include "playlist/playlistcollection.h"
#include "covermanager.h"
#include "collectionlist.h"
#include "coverinfo.h"
diff --git a/filerenamer.cpp b/filerenamer.cpp
index b9907a0..14060d3 100644
--- a/filerenamer.cpp
+++ b/filerenamer.cpp
@@ -50,8 +50,8 @@
#include "filerenameroptions.h"
#include "filehandle.h"
#include "exampleoptions.h"
-#include "playlistitem.h"
-#include "playlist.h" // processEvents()
+#include "playlist/playlistitem.h"
+#include "playlist/playlists/playlist.h" // processEvents()
#include "coverinfo.h"
class ConfirmationDialog : public KDialog
diff --git a/k3bexporter.cpp b/k3bexporter.cpp
index 6a98cb0..57bf846 100644
--- a/k3bexporter.cpp
+++ b/k3bexporter.cpp
@@ -28,8 +28,8 @@
#include <QMap>
-#include "playlistitem.h"
-#include "playlist.h"
+#include "playlist/playlistitem.h"
+#include "playlist/playlists/playlist.h"
#include "playlistbox.h"
#include "actioncollection.h"
@@ -111,8 +111,9 @@ void K3bExporter::exportPlaylistItems(const PlaylistItemList \
&items)
void K3bExporter::slotExport()
{
- if(m_parent)
- exportPlaylistItems(m_parent->selectedItems());
+ // ### TODO: View
+ /*if(m_parent)
+ exportPlaylistItems(m_parent->selectedItems());*/
}
void K3bExporter::exportViaCmdLine(const PlaylistItemList &items)
@@ -143,13 +144,13 @@ void K3bExporter::exportViaCmdLine(const PlaylistItemList \
&items) process << (*it)->file().absFilePath();
if(!process.startDetached())
- KMessageBox::error(m_parent, i18n("Unable to start K3b."));
+ KMessageBox::error(/*m_parent ### TODO: View */0, i18n("Unable to start \
K3b.")); }
K3bExporter::K3bOpenMode K3bExporter::openMode()
{
int reply = KMessageBox::questionYesNoCancel(
- m_parent,
+ /*m_parent*/0,//### TODO: View
i18n("Create an audio mode CD suitable for CD players, or a data "
"mode CD suitable for computers and other digital music "
"players?"),
diff --git a/mpris2/mediaplayer2player.cpp b/mpris2/mediaplayer2player.cpp
index fe9b6b7..5cc62c8 100644
--- a/mpris2/mediaplayer2player.cpp
+++ b/mpris2/mediaplayer2player.cpp
@@ -22,8 +22,8 @@
#include "juk.h"
#include "playermanager.h"
#include "coverinfo.h"
-#include "playlist.h"
-#include "playlistitem.h"
+#include "playlist/playlists/playlist.h"
+#include "playlist/playlistitem.h"
#include "tag.h"
#include "filehandle.h"
diff --git a/nowplaying.cpp b/nowplaying.cpp
index 85f4ba1..e88cd88 100644
--- a/nowplaying.cpp
+++ b/nowplaying.cpp
@@ -41,8 +41,8 @@
#include <QList>
#include <QTextDocument>
-#include "playlistcollection.h"
-#include "playlistitem.h"
+#include "playlist/playlistcollection.h"
+#include "playlist/playlistitem.h"
#include "coverinfo.h"
#include "covermanager.h"
#include "tag.h"
diff --git a/nowplaying.h b/nowplaying.h
index 9321b78..b55e066 100644
--- a/nowplaying.h
+++ b/nowplaying.h
@@ -22,7 +22,7 @@
#include <QList>
#include "filehandle.h"
-#include "playlistinterface.h"
+#include "playlist/playlistinterface.h"
class QTimer;
class QPoint;
diff --git a/playermanager.cpp b/playermanager.cpp
index abb29c4..885dd3e 100644
--- a/playermanager.cpp
+++ b/playermanager.cpp
@@ -38,7 +38,7 @@
#include <math.h>
-#include "playlistinterface.h"
+#include "playlist/playlistinterface.h"
#include "playeradaptor.h"
#include "slideraction.h"
#include "statuslabel.h"
diff --git a/playlist/playlistcollection.cpp b/playlist/playlistcollection.cpp
index 2b24024..9ac5793 100644
--- a/playlist/playlistcollection.cpp
+++ b/playlist/playlistcollection.cpp
@@ -68,7 +68,7 @@ PlaylistCollection *PlaylistCollection::m_instance = 0;
// public methods
////////////////////////////////////////////////////////////////////////////////
-PlaylistCollection::PlaylistCollection(PlayerManager *player, QStackedWidget \
*playlistStack) : +PlaylistCollection::PlaylistCollection(PlayerManager *player, \
QListView *playlistStack) : m_playlistStack(playlistStack),
m_historyPlaylist(0),
m_upcomingPlaylist(0),
@@ -166,9 +166,7 @@ QStringList PlaylistCollection::playlists() const
{
QStringList l;
- //(or qFindChildren() if you need MSVC 6 compatibility)
- const QList<Playlist *> childList = m_playlistStack->findChildren<Playlist \
*>("Playlist");
- foreach(Playlist *p, childList) {
+ foreach(const Playlist *p, m_playlists) {
l.append(p->name());
}
@@ -445,39 +443,46 @@ void PlaylistCollection::editSearch()
void PlaylistCollection::removeItems()
{
- visiblePlaylist()->slotRemoveSelectedItems();
+ // ### TODO: View
+// visiblePlaylist()->slotRemoveSelectedItems();
}
void PlaylistCollection::refreshItems()
{
- visiblePlaylist()->slotRefresh();
+ // ### TODO: View
+// visiblePlaylist()->slotRefresh();
}
void PlaylistCollection::renameItems()
{
- visiblePlaylist()->slotRenameFile();
+ // ### TODO: View
+// visiblePlaylist()->slotRenameFile();
}
void PlaylistCollection::addCovers(bool fromFile)
{
- visiblePlaylist()->slotAddCover(fromFile);
+ // ### TODO: View
+// visiblePlaylist()->slotAddCover(fromFile);
dataChanged();
}
void PlaylistCollection::removeCovers()
{
- visiblePlaylist()->slotRemoveCover();
+ // ### TODO: View
+// visiblePlaylist()->slotRemoveCover();
dataChanged();
}
void PlaylistCollection::viewCovers()
{
- visiblePlaylist()->slotViewCover();
+ // ### TODO: View
+// visiblePlaylist()->slotViewCover();
}
void PlaylistCollection::showCoverManager()
{
- visiblePlaylist()->slotShowCoverManager();
+ // ### TODO: View
+// visiblePlaylist()->slotShowCoverManager();
}
// ### TODO: View
@@ -528,12 +533,14 @@ void PlaylistCollection::createFolderPlaylist()
void PlaylistCollection::guessTagFromFile()
{
- visiblePlaylist()->slotGuessTagInfo(TagGuesser::FileName);
+ // ### TODO: View
+// visiblePlaylist()->slotGuessTagInfo(TagGuesser::FileName);
}
void PlaylistCollection::guessTagFromInternet()
{
- visiblePlaylist()->slotGuessTagInfo(TagGuesser::MusicBrainz);
+ // ### TODO: View
+// visiblePlaylist()->slotGuessTagInfo(TagGuesser::MusicBrainz);
}
void PlaylistCollection::setSearchEnabled(bool enable)
@@ -543,7 +550,8 @@ void PlaylistCollection::setSearchEnabled(bool enable)
m_searchEnabled = enable;
- visiblePlaylist()->setSearchEnabled(enable);
+ // ### TODO: View
+// visiblePlaylist()->setSearchEnabled(enable);
}
HistoryPlaylist *PlaylistCollection::historyPlaylist() const
@@ -622,21 +630,22 @@ Playlist *PlaylistCollection::currentPlaylist() const
Playlist *PlaylistCollection::visiblePlaylist() const
{
- return qobject_cast<Playlist *>(m_playlistStack->currentWidget());
+ return qobject_cast<Playlist *>(m_playlistStack->model());
}
void PlaylistCollection::raise(Playlist *playlist)
{
- if(m_showMorePlaylist && currentPlaylist() == m_showMorePlaylist)
- m_showMorePlaylist->lower(playlist);
- if(m_dynamicPlaylist && currentPlaylist() == m_dynamicPlaylist)
- m_dynamicPlaylist->lower(playlist);
+ // ### wat
+// if(m_showMorePlaylist && currentPlaylist() == m_showMorePlaylist)
+// m_showMorePlaylist->lower(playlist);
+// if(m_dynamicPlaylist && currentPlaylist() == m_dynamicPlaylist)
+// m_dynamicPlaylist->lower(playlist);
TrackSequenceManager::instance()->setCurrentPlaylist(playlist);
playlist->applySharedSettings();
- playlist->setSearchEnabled(m_searchEnabled);
// ### TODO: View
- m_playlistStack->setCurrentWidget(playlist);
+// playlist->setSearchEnabled(m_searchEnabled);
+ m_playlistStack->setModel(playlist);
clearShowMore(false);
dataChanged();
}
@@ -648,12 +657,13 @@ void PlaylistCollection::raiseDistraction()
m_belowDistraction = currentPlaylist();
- if(!m_distraction) {
- m_distraction = new QWidget(m_playlistStack);
- m_playlistStack->addWidget(m_distraction);
- }
+ // ### TODO: View
+// if(!m_distraction) {
+// m_distraction = new QWidget(m_playlistStack);
+// m_playlistStack->addWidget(m_distraction);
+// }
- m_playlistStack->setCurrentWidget(m_distraction);
+// m_playlistStack->setCurrentWidget(m_distraction);
}
void PlaylistCollection::lowerDistraction()
@@ -672,11 +682,6 @@ void PlaylistCollection::lowerDistraction()
// protected methods
////////////////////////////////////////////////////////////////////////////////
-QStackedWidget *PlaylistCollection::playlistStack() const
-{
- return m_playlistStack;
-}
-
void PlaylistCollection::setupPlaylist(Playlist *playlist, const QString &)
{
if(!playlist->fileName().isEmpty())
@@ -686,6 +691,7 @@ void PlaylistCollection::setupPlaylist(Playlist *playlist, const \
QString &) m_playlistNames.insert(playlist->name());
// ### TODO: View
+ m_playlists.append(playlist);
// m_playlistStack->addWidget(playlist);
QObject::connect(playlist, SIGNAL(selectionChanged()),
object(), SIGNAL(signalSelectedItemsChanged()));
@@ -801,11 +807,8 @@ void PlaylistCollection::dirChanged(const QString &path)
Playlist *PlaylistCollection::playlistByName(const QString &name) const
{
- for(int i = 0; i < m_playlistStack->count(); ++i) {
- Playlist *p = qobject_cast<Playlist *>(m_playlistStack->widget(i));
- if(p && p->name() == name)
- return p;
- }
+ foreach(Playlist *playlist, m_playlists)
+ if (playlist->name() == name) return playlist;
return 0;
}
diff --git a/playlist/playlistcollection.h b/playlist/playlistcollection.h
index d9fd9ff..5d35469 100644
--- a/playlist/playlistcollection.h
+++ b/playlist/playlistcollection.h
@@ -23,6 +23,7 @@
#include <kdirlister.h>
#include <QPointer>
+#include <QListView>
class QPixmap;
class QStackedWidget;
@@ -50,7 +51,7 @@ class PlaylistCollection : public PlaylistInterface
friend class DynamicPlaylist;
public:
- PlaylistCollection(PlayerManager *player, QStackedWidget *playlistStack);
+ PlaylistCollection(PlayerManager* player, QListView* playlistStack);
virtual ~PlaylistCollection();
static PlaylistCollection *instance() { return m_instance; }
@@ -105,7 +106,7 @@ public:
void viewCovers();
void showCoverManager();
- virtual PlaylistItemList selectedItems();
+// virtual PlaylistItemList selectedItems();
void scanFolders();
@@ -171,7 +172,7 @@ public:
class ActionHandler;
protected:
- virtual QStackedWidget *playlistStack() const;
+// virtual QStackedWidget *playlistStack() const;
virtual void setupPlaylist(Playlist *playlist, const QString &iconName);
virtual void removePlaylist(Playlist *playlist) = 0;
@@ -193,7 +194,7 @@ private:
void readConfig();
void saveConfig();
- QStackedWidget *m_playlistStack;
+ QListView *m_playlistStack;
HistoryPlaylist *m_historyPlaylist;
UpcomingPlaylist *m_upcomingPlaylist;
ActionHandler *m_actionHandler;
@@ -211,6 +212,8 @@ private:
QPointer<Playlist> m_belowShowMorePlaylist;
QPointer<DynamicPlaylist> m_dynamicPlaylist;
QPointer<Playlist> m_belowDistraction;
+
+ QList<Playlist*> m_playlists;
QWidget *m_distraction;
diff --git a/playlist/playlistitem.cpp b/playlist/playlistitem.cpp
index 15cd876..fe2b61d 100644
--- a/playlist/playlistitem.cpp
+++ b/playlist/playlistitem.cpp
@@ -109,8 +109,8 @@ const QPixmap *PlaylistItem::pixmap(int column) const
{
return globalPlayingImage;
}
-
- return K3ListViewItem::pixmap(column);
+ return globalPlayingImage;
+// return K3ListViewItem::pixmap(column);
}
QString PlaylistItem::text(int column) const
@@ -150,7 +150,8 @@ QString PlaylistItem::text(int column) const
case FullPathColumn:
return d->fileHandle.fileInfo().absoluteFilePath();
default:
- return K3ListViewItem::text(column);
+ return QString();
+// return K3ListViewItem::text(column);
}
}
@@ -158,12 +159,12 @@ void PlaylistItem::setText(int column, const QString &text)
{
int offset = playlist()->columnOffset();
if(column - offset >= 0 && column + offset <= lastColumn()) {
- K3ListViewItem::setText(column, QString());
+// K3ListViewItem::setText(column, QString());
return;
}
- K3ListViewItem::setText(column, text);
- playlist()->slotWeightDirty(column);
+// K3ListViewItem::setText(column, text);
+// playlist()->slotWeightDirty(column);
}
void PlaylistItem::setPlaying(bool playing, bool master)
@@ -185,13 +186,13 @@ void PlaylistItem::setPlaying(bool playing, bool master)
m_playingItems.front()->setPlaying(false);
}
- listView()->triggerUpdate();
+// listView()->triggerUpdate();
}
void PlaylistItem::setSelected(bool selected)
{
- playlist()->markItemSelected(this, selected);
- K3ListViewItem::setSelected(selected);
+// playlist()->markItemSelected(this, selected);
+// K3ListViewItem::setSelected(selected);
}
void PlaylistItem::guessTagInfo(TagGuesser::Type type)
@@ -224,7 +225,7 @@ void PlaylistItem::guessTagInfo(TagGuesser::Type type)
Playlist *PlaylistItem::playlist() const
{
- return static_cast<Playlist *>(listView());
+ return m_playlist;//static_cast<Playlist *>(listView());
}
QVector<int> PlaylistItem::cachedWidths() const
@@ -254,14 +255,16 @@ void PlaylistItem::clear()
PlaylistItem::PlaylistItem(CollectionListItem *item, Playlist *parent) :
d(0),
- m_watched(0)
+ m_watched(0),
+ m_playlist(parent)
{
setup(item);
}
PlaylistItem::PlaylistItem(CollectionListItem *item, Playlist *parent, \
Q3ListViewItem *after) : d(0),
- m_watched(0)
+ m_watched(0),
+ m_playlist(parent)
{
setup(item);
}
@@ -274,13 +277,13 @@ PlaylistItem::PlaylistItem(CollectionList *parent) :
{
d = new Data;
m_collectionItem = static_cast<CollectionListItem *>(this);
- setDragEnabled(true);
+// setDragEnabled(true);
}
void PlaylistItem::paintCell(QPainter *p, const QColorGroup &cg, int column, int \
width, int align) {
- if(!m_playingItems.contains(this))
- return K3ListViewItem::paintCell(p, cg, column, width, align);
+// if(!m_playingItems.contains(this))
+// return K3ListViewItem::paintCell(p, cg, column, width, align);
QPalette colorGroup = cg;
@@ -294,20 +297,18 @@ void PlaylistItem::paintCell(QPainter *p, const QColorGroup \
&cg, int column, int QColor c(r, g, b);
colorGroup.setColor(QPalette::Base, c);
- Q3ListViewItem::paintCell(p, colorGroup, column, width, align);
+// Q3ListViewItem::paintCell(p, colorGroup, column, width, align);
}
-int PlaylistItem::compare(Q3ListViewItem *item, int column, bool ascending) const
+int PlaylistItem::compare(PlaylistItem *playlistItem, int column, bool ascending) \
const {
// reimplemented from QListViewItem
int offset = playlist()->columnOffset();
- if(!item)
+ if(!playlistItem)
return 0;
- PlaylistItem *playlistItem = static_cast<PlaylistItem *>(item);
-
// The following statments first check to see if you can sort based on the
// specified column. If the values for the two PlaylistItems are the same
// in that column it then tries to sort based on columns 1, 2, 3 and 0,
@@ -321,14 +322,14 @@ int PlaylistItem::compare(Q3ListViewItem *item, int column, \
bool ascending) cons
// Loop through the columns doing comparisons until something is differnt.
// If all else is the same, compare the track name.
- int last = playlist()->isColumnVisible(AlbumColumn + offset) ? \
TrackNumberColumn : ArtistColumn; + int last = TrackNumberColumn;// \
playlist()->isColumnVisible(AlbumColumn + offset) ? TrackNumberColumn : ArtistColumn; \
for(int i = ArtistColumn; i <= last; i++) {
- if(playlist()->isColumnVisible(i + offset)) {
+// if(playlist()->isColumnVisible(i + offset)) {
c = compare(this, playlistItem, i, ascending);
if(c != 0)
return c;
- }
+// }
}
return compare(this, playlistItem, TrackColumn + offset, ascending);
}
@@ -406,7 +407,7 @@ void PlaylistItem::setup(CollectionListItem *item)
d = item->d;
item->addChildItem(this);
- setDragEnabled(true);
+// setDragEnabled(true);
}
////////////////////////////////////////////////////////////////////////////////
diff --git a/playlist/playlistitem.h b/playlist/playlistitem.h
index 6b1d11c..6358a3e 100644
--- a/playlist/playlistitem.h
+++ b/playlist/playlistitem.h
@@ -28,6 +28,7 @@
#include "filehandle.h"
class Playlist;
+class Playlist;
class PlaylistItem;
class CollectionListItem;
class CollectionList;
@@ -170,7 +171,7 @@ protected:
virtual void paintCell(QPainter *p, const QColorGroup &cg, int column, int \
width, int align);
virtual void paintFocus(QPainter *, const QColorGroup &, const QRect &) {}
- virtual int compare(Q3ListViewItem *item, int column, bool ascending) const;
+ virtual int compare(PlaylistItem *item, int column, bool ascending) const;
int compare(const PlaylistItem *firstItem, const PlaylistItem *secondItem, int \
column, bool ascending) const;
bool isValid() const;
@@ -203,6 +204,7 @@ private:
quint32 m_trackId;
bool m_watched;
static PlaylistItemList m_playingItems;
+ Playlist *m_playlist;
};
inline QDebug operator<<(QDebug s, const PlaylistItem &item)
diff --git a/playlist/playlists/dynamicplaylist.cpp \
b/playlist/playlists/dynamicplaylist.cpp index 317d895..6ac533c 100644
--- a/playlist/playlists/dynamicplaylist.cpp
+++ b/playlist/playlists/dynamicplaylist.cpp
@@ -65,7 +65,7 @@ DynamicPlaylist::DynamicPlaylist(const PlaylistList &playlists,
DynamicPlaylist::~DynamicPlaylist()
{
- lower();
+// lower();
foreach(PlaylistObserver *observer, m_observers)
delete observer;
diff --git a/playlist/playlists/dynamicplaylist.h \
b/playlist/playlists/dynamicplaylist.h index 85d7b71..7be2261 100644
--- a/playlist/playlists/dynamicplaylist.h
+++ b/playlist/playlists/dynamicplaylist.h
@@ -57,7 +57,7 @@ public slots:
* it can synchronize the playing item with the one that playlist it was
* create from.
*/
- void lower(QWidget *top = 0);
+// void lower(QWidget *top = 0);
protected:
/**
@@ -77,9 +77,9 @@ protected:
* Reimplemented from QWidget. Here it updates the list of items (when
* appropriate) as the widget is shown.
*/
- virtual void showEvent(QShowEvent *e);
-
- virtual void paintEvent(QPaintEvent *e);
+// virtual void showEvent(QShowEvent *e);
+//
+// virtual void paintEvent(QPaintEvent *e);
/**
* Updates the items (unconditionally). This should be reimplemented in
diff --git a/playlist/playlists/playlist.cpp b/playlist/playlists/playlist.cpp
index 0b9c61d..a0181fd 100644
--- a/playlist/playlists/playlist.cpp
+++ b/playlist/playlists/playlist.cpp
@@ -328,7 +328,7 @@ int Playlist::m_leftColumn = 0;
Playlist::Playlist(PlaylistCollection *collection, const QString &name,
const QString &iconName) :
- QAbstractListModel(collection->playlistStack()),
+ QAbstractListModel(/*collection->playlistStack()*/0),
m_collection(collection),
m_fetcher(new WebImageFetcher(this)),
m_selectedCount(0),
@@ -344,13 +344,13 @@ Playlist::Playlist(PlaylistCollection *collection, const \
QString &name, m_toolTip(0),
m_blockDataChanged(false)
{
- setup();
+// setup();
collection->setupPlaylist(this, iconName);
}
Playlist::Playlist(PlaylistCollection *collection, const PlaylistItemList &items,
const QString &name, const QString &iconName) :
- QAbstractListModel(collection->playlistStack()),
+ QAbstractListModel(/*collection->playlistStack()*/0),
m_collection(collection),
m_fetcher(new WebImageFetcher(this)),
m_selectedCount(0),
@@ -366,14 +366,14 @@ Playlist::Playlist(PlaylistCollection *collection, const \
PlaylistItemList &items m_toolTip(0),
m_blockDataChanged(false)
{
- setup();
+// setup();
collection->setupPlaylist(this, iconName);
createItems(items);
}
Playlist::Playlist(PlaylistCollection *collection, const QFileInfo &playlistFile,
const QString &iconName) :
- QAbstractListModel(collection->playlistStack()),
+ QAbstractListModel(/*collection->playlistStack()*/0),
m_collection(collection),
m_fetcher(new WebImageFetcher(this)),
m_selectedCount(0),
@@ -389,13 +389,13 @@ Playlist::Playlist(PlaylistCollection *collection, const \
QFileInfo &playlistFile m_toolTip(0),
m_blockDataChanged(false)
{
- setup();
+// setup();
loadFile(m_fileName, playlistFile);
collection->setupPlaylist(this, iconName);
}
Playlist::Playlist(PlaylistCollection *collection, bool delaySetup, int \
extraColumns) :
- QAbstractListModel(collection->playlistStack()),
+ QAbstractListModel(/*collection->playlistStack()*/0),
m_collection(collection),
m_fetcher(new WebImageFetcher(this)),
m_selectedCount(0),
@@ -414,7 +414,7 @@ Playlist::Playlist(PlaylistCollection *collection, bool \
delaySetup, int extraCol
setHeaderData(i, Qt::Horizontal, i18n("JuK")); // Placeholder text!
}
- setup();
+// setup();
if(!delaySetup)
collection->setupPlaylist(this, "view-media-playlist");
@@ -636,15 +636,15 @@ QStringList Playlist::files() const
// return items(Q3ListViewItemIterator::Visible);
// }
-void Playlist::updateLeftColumn()
-{
- int newLeftColumn = leftMostVisibleColumn();
-
- if(m_leftColumn != newLeftColumn) {
- updatePlaying();
- m_leftColumn = newLeftColumn;
- }
-}
+// void Playlist::updateLeftColumn()
+// {
+// int newLeftColumn = leftMostVisibleColumn();
+//
+// if(m_leftColumn != newLeftColumn) {
+// updatePlaying();
+// m_leftColumn = newLeftColumn;
+// }
+// }
// ### TODO: View
// void Playlist::setItemsVisible(const PlaylistItemList &items, bool visible) // \
static @@ -655,33 +655,34 @@ void Playlist::updateLeftColumn()
// playlistItem->setVisible(visible);
// }
-void Playlist::setSearch(const PlaylistSearch &s)
-{
- m_search = s;
-
- if(!m_searchEnabled)
- return;
-
- setItemsVisible(s.matchedItems(), true);
- setItemsVisible(s.unmatchedItems(), false);
-
- TrackSequenceManager::instance()->iterator()->playlistChanged();
-}
-
-void Playlist::setSearchEnabled(bool enabled)
-{
- if(m_searchEnabled == enabled)
- return;
-
- m_searchEnabled = enabled;
-
- if(enabled) {
- setItemsVisible(m_search.matchedItems(), true);
- setItemsVisible(m_search.unmatchedItems(), false);
- }
- else
- setItemsVisible(items(), true);
-}
+// ### TODO: View, move to a proxy model
+// void Playlist::setSearch(const PlaylistSearch &s)
+// {
+// m_search = s;
+//
+// if(!m_searchEnabled)
+// return;
+//
+// setItemsVisible(s.matchedItems(), true);
+// setItemsVisible(s.unmatchedItems(), false);
+//
+// TrackSequenceManager::instance()->iterator()->playlistChanged();
+// }
+//
+// void Playlist::setSearchEnabled(bool enabled)
+// {
+// if(m_searchEnabled == enabled)
+// return;
+//
+// m_searchEnabled = enabled;
+//
+// if(enabled) {
+// setItemsVisible(m_search.matchedItems(), true);
+// setItemsVisible(m_search.unmatchedItems(), false);
+// }
+// else
+// setItemsVisible(items(), true);
+// }
// ### TODO: View
// void Playlist::markItemSelected(PlaylistItem *item, bool selected)
@@ -877,15 +878,15 @@ void Playlist::synchronizePlayingItems(const PlaylistList \
&sources, bool setMast // KApplication::restoreOverrideCursor();
// }
//
-// void Playlist::slotReload()
-// {
-// QFileInfo fileInfo(m_fileName);
-// if(!fileInfo.exists() || !fileInfo.isFile() || !fileInfo.isReadable())
-// return;
-//
-// clearItems(items());
-// loadFile(m_fileName, fileInfo);
-// }
+void Playlist::slotReload()
+{
+ QFileInfo fileInfo(m_fileName);
+ if(!fileInfo.exists() || !fileInfo.isFile() || !fileInfo.isReadable())
+ return;
+
+ clearItems(items());
+ loadFile(m_fileName, fileInfo);
+}
//
// void Playlist::slotWeightDirty(int column)
// {
@@ -1227,42 +1228,42 @@ void Playlist::dataChanged()
// K3ListView::showEvent(e);
// }
//
-// void Playlist::applySharedSettings()
-// {
-// m_applySharedSettings = true;
-// }
+void Playlist::applySharedSettings()
+{
+ m_applySharedSettings = true;
+}
-// void Playlist::read(QDataStream &s)
-// {
-// s >> m_playlistName
-// >> m_fileName;
-//
-// // m_fileName is probably empty.
-// if(m_playlistName.isEmpty())
-// throw BICStreamException();
-//
-// // Do not sort. Add the files in the order they were saved.
+void Playlist::read(QDataStream &s)
+{
+ s >> m_playlistName
+ >> m_fileName;
+
+ // m_fileName is probably empty.
+ if(m_playlistName.isEmpty())
+ throw BICStreamException();
+
+ // Do not sort. Add the files in the order they were saved.
// setSorting(columns() + 1);
-//
-// QStringList files;
-// s >> files;
-//
-// Q3ListViewItem *after = 0;
-//
-// m_blockDataChanged = true;
-//
-// foreach(const QString &file, files) {
-// if(file.isEmpty())
-// throw BICStreamException();
-//
-// after = createItem(FileHandle(file), after, false);
-// }
-//
-// m_blockDataChanged = false;
-//
-// dataChanged();
-// m_collection->setupPlaylist(this, "view-media-playlist");
-// }
+
+ QStringList files;
+ s >> files;
+
+ PlaylistItem *after = 0;
+
+ m_blockDataChanged = true;
+
+ foreach(const QString &file, files) {
+ if(file.isEmpty())
+ throw BICStreamException();
+
+ after = createItem(FileHandle(file), after, false);
+ }
+
+ m_blockDataChanged = false;
+
+ dataChanged();
+ m_collection->setupPlaylist(this, "view-media-playlist");
+}
// void Playlist::viewportPaintEvent(QPaintEvent *pe)
// {
@@ -1343,7 +1344,7 @@ void Playlist::addFiles(const QStringList &files, PlaylistItem \
*after)
m_blockDataChanged = false;
- slotWeightDirty();
+// slotWeightDirty();
dataChanged();
KApplication::restoreOverrideCursor();
@@ -2390,6 +2391,45 @@ bool processEvents()
return false;
}
+
+// ---- QAbstractListModel API
+int Playlist::columnCount(const QModelIndex& parent) const
+{
+ return -1;
+ //return QAbstractListModel::columnCount(parent);
+}
+
+QVariant Playlist::data(const QModelIndex& index, int role) const
+{
+ return QVariant();
+}
+
+int Playlist::rowCount(const QModelIndex& parent) const
+{
+ return -1;
+}
+
+Qt::ItemFlags Playlist::flags(const QModelIndex& index) const
+{
+ return QAbstractItemModel::flags(index);
+}
+
+bool Playlist::setData(const QModelIndex& index, const QVariant& value, int role)
+{
+ return QAbstractItemModel::setData(index, value, role);
+}
+
+bool Playlist::insertRows(int row, int count, const QModelIndex& parent)
+{
+ return QAbstractItemModel::insertRows(row, count, parent);
+}
+
+bool Playlist::removeRows(int row, int count, const QModelIndex& parent)
+{
+ return QAbstractItemModel::removeRows(row, count, parent);
+}
+
+
#include "playlist.moc"
// vim: set et sw=4 tw=0 sta:
diff --git a/playlist/playlists/playlist.h b/playlist/playlists/playlist.h
index f079d02..f6f1d40 100644
--- a/playlist/playlists/playlist.h
+++ b/playlist/playlists/playlist.h
@@ -160,7 +160,7 @@ public:
/**
* Returns a list of all of the \e visible items in the playlist.
*/
- PlaylistItemList visibleItems();
+// PlaylistItemList visibleItems();
/**
* Allow duplicate files in the playlist.
@@ -216,7 +216,7 @@ public:
* will be udated.
*/
void showColumn(int c, bool updateSearch = true);
- bool isColumnVisible(int c) const;
+// bool isColumnVisible(int c) const;
/**
* This sets a name for the playlist that is \e different from the file name.
@@ -266,18 +266,18 @@ public:
/**
* Set the search associtated with this playlist.
*/
- void setSearch(const PlaylistSearch &s);
+// void setSearch(const PlaylistSearch &s);
/**
* If the search is disabled then all items will be shown, not just those that
* match the current search.
*/
- void setSearchEnabled(bool searchEnabled);
+// void setSearchEnabled(bool searchEnabled);
/**
* Marks \a item as either selected or deselected based.
*/
- void markItemSelected(PlaylistItem *item, bool selected);
+// void markItemSelected(PlaylistItem *item, bool selected);
/**
* Subclasses of Playlist which add new columns will set this value to
@@ -332,60 +332,60 @@ public slots:
/**
* Remove the currently selected items from the playlist and disk.
*/
- void slotRemoveSelectedItems();
+// void slotRemoveSelectedItems();
- /*
+ /**
* The edit slots are required to use the canonical names so that they are
* detected by the application wide framework.
*/
- virtual void cut();
+// virtual void cut();
/**
* Puts a list of URLs pointing to the files in the current selection on the
* clipboard.
*/
- virtual void copy();
+// virtual void copy();
/**
* Checks the clipboard for local URLs to be inserted into this playlist.
*/
- virtual void paste();
+// virtual void paste();
/**
* Refreshes the tags of the selection from disk, or all of the files in the
* list if there is no selection.
*/
- virtual void slotRefresh();
+// virtual void slotRefresh();
- void slotGuessTagInfo(TagGuesser::Type type);
+// void slotGuessTagInfo(TagGuesser::Type type);
/**
* Renames the selected items' files based on their tags contents.
*
* @see PlaylistItem::renameFile()
*/
- void slotRenameFile();
+// void slotRenameFile();
/**
* Sets the cover of the selected items, pass in true if you want to load from \
the local system,
* false if you want to load from the internet.
*/
- void slotAddCover(bool fromLocal);
+// void slotAddCover(bool fromLocal);
/**
* Shows a large image of the cover
*/
- void slotViewCover();
+// void slotViewCover();
/**
* Removes covers from the selected items
*/
- void slotRemoveCover();
+// void slotRemoveCover();
/**
* Shows the cover manager GUI dialog
*/
- void slotShowCoverManager();
+// void slotShowCoverManager();
/**
* Reload the playlist contents from the m3u file.
@@ -397,11 +397,11 @@ public slots:
* column widths must be recalculated. If this is called without a column
* all visible columns are marked as dirty.
*/
- void slotWeightDirty(int column = -1);
+// void slotWeightDirty(int column = -1);
- void slotShowPlaying();
+// void slotShowPlaying();
- void slotColumnResizeModeChanged();
+// void slotColumnResizeModeChanged();
virtual void dataChanged();
@@ -414,7 +414,7 @@ protected:
// the following are all reimplemented from base classes
- virtual void decode(const QMimeData *s, PlaylistItem *item = 0);
+// virtual void decode(const QMimeData *s, PlaylistItem *item = 0);
virtual bool hasItem(const QString &file) const { return \
m_members.contains(file); } @@ -471,7 +471,7 @@ signals:
void signalPlaylistItemsDropped(Playlist *p);
private:
- void setup();
+// void setup();
/**
* This function is called to let the user know that JuK has automatically \
enabled @@ -498,19 +498,19 @@ private:
*
* \see isColumnVisible()
*/
- int leftMostVisibleColumn() const;
+// int leftMostVisibleColumn() const;
/**
* Build the column "weights" for the weighted width mode.
*/
- void calculateColumnWeights();
+// void calculateColumnWeights();
void addFile(const QString &file, FileHandleList &files, bool importPlaylists,
PlaylistItem **after);
void addFileHelper(FileHandleList &files, PlaylistItem **after,
bool ignoreTimer = false);
- void redisplaySearch() { setSearch(m_search); }
+// void redisplaySearch() { setSearch(m_search); }
/**
* Sets the cover for items to the cover identified by id.
@@ -552,17 +552,17 @@ private slots:
* Used to be a subclass of K3ListView::polish() but the timing of the
* call is not consistent and therefore lead to crashes.
*/
- void slotInitialize();
-
- void slotUpdateColumnWidths();
+// void slotInitialize();
- void slotAddToUpcoming();
+// void slotUpdateColumnWidths();
+//
+// void slotAddToUpcoming();
/**
* Show the RMB menu. Matches the signature for the signal
* QListView::contextMenuRequested().
*/
- void slotShowRMBMenu(Q3ListViewItem *item, const QPoint &point, int column);
+// void slotShowRMBMenu(Q3ListViewItem *item, const QPoint &point, int column);
/**
* This slot is called when the inline tag editor has completed its editing
@@ -570,25 +570,25 @@ private slots:
*
* \see editTag()
*/
- void slotInlineEditDone(Q3ListViewItem *, const QString &, int column);
+// void slotInlineEditDone(Q3ListViewItem *, const QString &, int column);
/**
* This starts the renaming process by displaying a line edit if the mouse is in
* an appropriate position.
*/
- void slotRenameTag();
+// void slotRenameTag();
/**
* The image fetcher will update the cover asynchronously, this internal
* slot is called when it happens.
*/
- void slotCoverChanged(int coverId);
+// void slotCoverChanged(int coverId);
/**
* Moves the column \a from to the position \a to. This matches the signature
* for the signal QHeader::indexChange().
*/
- void slotColumnOrderChanged(int, int from, int to);
+// void slotColumnOrderChanged(int, int from, int to);
/**
* Toggles a columns visible status. Useful for KActions.
@@ -596,18 +596,18 @@ private slots:
* \see hideColumn()
* \see showColumn()
*/
- void slotToggleColumnVisible(QAction *action);
+// void slotToggleColumnVisible(QAction *action);
/**
* Prompts the user to create a new playlist with from the selected items.
*/
- void slotCreateGroup();
+// void slotCreateGroup();
/**
* This slot is called when the user drags the slider in the listview header
* to manually set the size of the column.
*/
- void slotColumnSizeChanged(int column, int oldSize, int newSize);
+// void slotColumnSizeChanged(int column, int oldSize, int newSize);
/**
* The slot is called when the completion mode for the line edit in the
@@ -615,9 +615,9 @@ private slots:
* magic of the SharedSettings class will apply it to the other playlists as
* well.
*/
- void slotInlineCompletionModeChanged(KGlobalSettings::Completion mode);
+// void slotInlineCompletionModeChanged(KGlobalSettings::Completion mode);
- void slotPlayCurrent();
+// void slotPlayCurrent();
private:
friend class PlaylistItem;
@@ -753,7 +753,7 @@ void Playlist::createItems(const QList<SiblingType *> &siblings, \
ItemType *after after = createItem(sibling, after);
dataChanged();
- slotWeightDirty();
+// slotWeightDirty();
}
#endif
diff --git a/playlist/playlists/upcomingplaylist.cpp \
b/playlist/playlists/upcomingplaylist.cpp index 4f04b06..2a02eea 100644
--- a/playlist/playlists/upcomingplaylist.cpp
+++ b/playlist/playlists/upcomingplaylist.cpp
@@ -77,7 +77,7 @@ void UpcomingPlaylist::appendItems(const PlaylistItemList \
&itemList) }
dataChanged();
- slotWeightDirty();
+// slotWeightDirty();
}
void UpcomingPlaylist::playNext()
@@ -226,7 +226,7 @@ void \
UpcomingPlaylist::UpcomingSequenceIterator::setCurrent(PlaylistItem \
*curren
PlaylistItem *i = m_playlist->createItem(currentItem, (PlaylistItem *) 0);
m_playlist->playlistIndex().insert(i, p);
m_playlist->dataChanged();
- m_playlist->slotWeightDirty();
+// m_playlist->slotWeightDirty();
}
else {
// if(p == m_playlist) {
diff --git a/playlist/playlistsearch.cpp b/playlist/playlistsearch.cpp
index 1f86138..b7ce7d4 100644
--- a/playlist/playlistsearch.cpp
+++ b/playlist/playlistsearch.cpp
@@ -14,7 +14,7 @@
***************************************************************************/
#include "playlistsearch.h"
-#include "playlist.h"
+#include "playlists/playlist.h"
#include "playlistitem.h"
#include "collectionlist.h"
#include "juk-exception.h"
@@ -60,8 +60,8 @@ void PlaylistSearch::search()
foreach(Playlist *playlist, m_playlists) {
if(!isEmpty()) {
- for(Q3ListViewItemIterator it(playlist); it.current(); ++it)
- checkItem(static_cast<PlaylistItem *>(*it));
+ foreach(PlaylistItem *item, playlist->items())
+ checkItem(item);
}
else {
m_items += playlist->items();
@@ -185,9 +185,9 @@ bool PlaylistSearch::Component::matches(PlaylistItem *item) const
return false;
if(m_columns.isEmpty()) {
- Playlist *p = static_cast<Playlist *>(item->listView());
- for(int i = 0; i < p->columns(); i++) {
- if(p->isColumnVisible(i))
+ Playlist *p = static_cast<Playlist *>(item->playlist());
+ for(int i = 0; i < p->columnCount(); i++) {
+// if(p->isColumnVisible(i))
m_columns.append(i);
}
}
diff --git a/playlistbox.cpp b/playlistbox.cpp
index 4e305aa..6c064bd 100644
--- a/playlistbox.cpp
+++ b/playlistbox.cpp
@@ -40,14 +40,14 @@
#include <QApplication>
#include <QClipboard>
-#include "playlist.h"
+#include "playlist/playlists/playlist.h"
#include "collectionlist.h"
-#include "dynamicplaylist.h"
-#include "upcomingplaylist.h"
-#include "historyplaylist.h"
+#include "playlist/playlists/dynamicplaylist.h"
+#include "playlist/playlists/upcomingplaylist.h"
+#include "playlist/playlists/historyplaylist.h"
#include "viewmode.h"
-#include "searchplaylist.h"
-#include "treeviewitemplaylist.h"
+#include "playlist/playlists/searchplaylist.h"
+#include "playlist/playlists/treeviewitemplaylist.h"
#include "actioncollection.h"
#include "cache.h"
#include "k3bexporter.h"
@@ -62,7 +62,7 @@ using namespace ActionCollection;
// PlaylistBox public methods
////////////////////////////////////////////////////////////////////////////////
-PlaylistBox::PlaylistBox(PlayerManager *player, QWidget *parent, QStackedWidget \
*playlistStack) : +PlaylistBox::PlaylistBox(PlayerManager *player, QWidget *parent, \
QListView *playlistStack) : K3ListView(parent),
PlaylistCollection(player, playlistStack),
m_viewModeIndex(0),
@@ -453,7 +453,7 @@ void PlaylistBox::decode(const QMimeData *s, Item *item)
if(playlistItem) {
playlistItem->retag(files, currentPlaylist());
TagTransactionManager::instance()->commit();
- currentPlaylist()->update();
+// currentPlaylist()->update();
return;
}
}
diff --git a/playlistbox.h b/playlistbox.h
index f078079..9ec74ce 100644
--- a/playlistbox.h
+++ b/playlistbox.h
@@ -16,7 +16,7 @@
#ifndef PLAYLISTBOX_H
#define PLAYLISTBOX_H
-#include "playlistcollection.h"
+#include "playlist/playlistcollection.h"
#include <k3listview.h>
@@ -48,7 +48,7 @@ public:
friend class Item;
- PlaylistBox(PlayerManager *player, QWidget *parent, QStackedWidget \
*playlistStack); + PlaylistBox(PlayerManager* player, QWidget* parent, QListView* \
playlistStack); virtual ~PlaylistBox();
virtual void raise(Playlist *playlist);
diff --git a/playlistsplitter.cpp b/playlistsplitter.cpp
index 225a632..6b08062 100644
--- a/playlistsplitter.cpp
+++ b/playlistsplitter.cpp
@@ -34,7 +34,7 @@
#include <QSizePolicy>
#include "searchwidget.h"
-#include "playlistsearch.h"
+#include "playlist/playlistsearch.h"
#include "actioncollection.h"
#include "tageditor.h"
#include "collectionlist.h"
@@ -117,25 +117,26 @@ void PlaylistSplitter::slotFocusCurrentPlaylist()
Playlist *playlist = m_playlistBox->visiblePlaylist();
if(playlist) {
- playlist->setFocus();
- playlist->K3ListView::selectAll(false);
-
- // Select the top visible (and matching) item.
-
- PlaylistItem *item = static_cast<PlaylistItem *>(playlist->itemAt(QPoint(0, \
0)));
-
- if(!item)
- return;
-
- // A little bit of a hack to make QListView repaint things properly. Switch
- // to single selection mode, set the selection and then switch back.
-
- playlist->setSelectionMode(Q3ListView::Single);
-
- playlist->markItemSelected(item, true);
- playlist->setCurrentItem(item);
-
- playlist->setSelectionMode(Q3ListView::Extended);
+ // ### TODO: View
+// playlist->setFocus();
+// playlist->K3ListView::selectAll(false);
+//
+// // Select the top visible (and matching) item.
+//
+// PlaylistItem *item = static_cast<PlaylistItem \
*>(playlist->itemAt(QPoint(0, 0))); +//
+// if(!item)
+// return;
+//
+// // A little bit of a hack to make QListView repaint things properly. \
Switch +// // to single selection mode, set the selection and then switch \
back. +//
+// playlist->setSelectionMode(Q3ListView::Single);
+//
+// playlist->markItemSelected(item, true);
+// playlist->setCurrentItem(item);
+//
+// playlist->setSelectionMode(Q3ListView::Extended);
}
}
@@ -181,7 +182,7 @@ void PlaylistSplitter::setupLayout()
topLayout->setMargin(0);
topLayout->setSpacing(0);
- m_playlistStack = new QStackedWidget(top);
+ m_playlistStack = new QListView(top);
m_playlistStack->setObjectName( QLatin1String("playlistStack" ));
m_playlistStack->installEventFilter(this);
m_playlistStack->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
@@ -283,17 +284,21 @@ void PlaylistSplitter::slotShowSearchResults()
PlaylistList playlists;
playlists.append(visiblePlaylist());
PlaylistSearch search = m_searchWidget->search(playlists);
- visiblePlaylist()->setSearch(search);
+
+ // ### TODO: View, search
+// visiblePlaylist()->setSearch(search);
}
void PlaylistSplitter::slotPlaylistSelectionChanged()
{
- m_editor->slotSetItems(visiblePlaylist()->selectedItems());
+ // ### TODO: View
+// m_editor->slotSetItems(visiblePlaylist()->selectedItems());
}
+// ### TODO: View: What does this do?
void PlaylistSplitter::slotPlaylistChanged(int i)
{
- Playlist *p = qobject_cast<Playlist *>(m_playlistStack->widget(i));
+ Playlist *p = qobject_cast<Playlist *>(m_playlistStack->model());
if(!p)
return;
diff --git a/playlistsplitter.h b/playlistsplitter.h
index 4de0177..27008c2 100644
--- a/playlistsplitter.h
+++ b/playlistsplitter.h
@@ -18,6 +18,7 @@
#include <QSplitter>
+class QListView;
class QStackedWidget;
class Playlist;
@@ -90,7 +91,7 @@ private:
Playlist *m_newVisible;
PlaylistBox *m_playlistBox;
SearchWidget *m_searchWidget;
- QStackedWidget *m_playlistStack;
+ QListView *m_playlistStack;
TagEditor *m_editor;
NowPlaying *m_nowPlaying;
PlayerManager *m_player;
diff --git a/searchwidget.cpp b/searchwidget.cpp
index 5efe720..7bef45a 100644
--- a/searchwidget.cpp
+++ b/searchwidget.cpp
@@ -93,7 +93,7 @@ PlaylistSearch::Component SearchLine::searchComponent() const
if(!m_searchFieldsBox || m_searchFieldsBox->currentIndex() == 0) {
foreach(int column, m_columnList) {
- if(playlist->isColumnVisible(column))
+// if(playlist->isColumnVisible(column))
searchedColumns.append(column);
}
}
@@ -178,9 +178,9 @@ void SearchLine::updateColumns()
int selection = -1;
m_columnList.clear();
- for(int i = 0; i < playlist->columns(); i++) {
+ for(int i = 0; i < playlist->columnCount(); i++) {
m_columnList.append(i);
- QString text = playlist->columnText(i);
+ QString text = playlist->headerData(i, Qt::Horizontal).toString();
columnHeaders.append(text);
if(currentText == text)
selection = m_columnList.size() - 1;
diff --git a/searchwidget.h b/searchwidget.h
index 73c7a22..53968ee 100644
--- a/searchwidget.h
+++ b/searchwidget.h
@@ -24,7 +24,7 @@
#include <QtGui/QFrame>
#include <QList>
-#include "playlistsearch.h"
+#include "playlist/playlistsearch.h"
class QEvent;
diff --git a/statuslabel.cpp b/statuslabel.cpp
index f482033..3eff507 100644
--- a/statuslabel.cpp
+++ b/statuslabel.cpp
@@ -29,7 +29,7 @@
#include <QEvent>
#include "filehandle.h"
-#include "playlistinterface.h"
+#include "playlist/playlistinterface.h"
#include "actioncollection.h"
#include "tag.h"
diff --git a/statuslabel.h b/statuslabel.h
index 6a65e1e..755a241 100644
--- a/statuslabel.h
+++ b/statuslabel.h
@@ -16,7 +16,7 @@
#ifndef STATUSLABEL_H
#define STATUSLABEL_H
-#include "playlistinterface.h"
+#include "playlist/playlistinterface.h"
#include <khbox.h>
//Added by qt3to4:
diff --git a/tageditor.cpp b/tageditor.cpp
index 66117e8..8d90b99 100644
--- a/tageditor.cpp
+++ b/tageditor.cpp
@@ -15,7 +15,7 @@
#include "tageditor.h"
#include "collectionlist.h"
-#include "playlistitem.h"
+#include "playlist/playlistitem.h"
#include "tag.h"
#include "actioncollection.h"
#include "tagtransactionmanager.h"
@@ -117,8 +117,9 @@ public:
virtual void updateData()
{
- if(m_parent && m_parent->m_currentPlaylist && m_parent->isVisible())
- m_parent->slotSetItems(m_parent->m_currentPlaylist->selectedItems());
+ // ### TODO: View
+ //if(m_parent && m_parent->m_currentPlaylist && m_parent->isVisible())
+ // m_parent->slotSetItems(m_parent->m_currentPlaylist->selectedItems());
}
virtual void updateCurrent() {}
@@ -191,7 +192,8 @@ void TagEditor::slotSetItems(const PlaylistItemList &list)
// We can't use list here, it may not be valid
- m_items = itemPlaylist->selectedItems();
+ // ### TODO: View
+ //m_items = itemPlaylist->selectedItems();
}
if(m_currentPlaylist) {
diff --git a/tagtransactionmanager.cpp b/tagtransactionmanager.cpp
index c231833..55c539b 100644
--- a/tagtransactionmanager.cpp
+++ b/tagtransactionmanager.cpp
@@ -24,7 +24,7 @@
#include <QFileInfo>
#include <QDir>
-#include "playlistitem.h"
+#include "playlist/playlistitem.h"
#include "collectionlist.h"
#include "tag.h"
#include "actioncollection.h"
@@ -178,9 +178,9 @@ bool TagTransactionManager::processChangeList(bool undo)
item->file().setFile(tag->fileName());
item->refreshFromDisk();
- item->repaint();
+ //item->repaint();
item->playlist()->dataChanged();
- item->playlist()->update();
+ //item->playlist()->update();
}
else {
Tag *errorTag = item->file().tag();
diff --git a/tracksequenceiterator.cpp b/tracksequenceiterator.cpp
index 2961b8c..5ca4a94 100644
--- a/tracksequenceiterator.cpp
+++ b/tracksequenceiterator.cpp
@@ -21,7 +21,7 @@
#include <krandom.h>
#include <ktoggleaction.h>
-#include "playlist.h"
+#include "playlist/playlists/playlist.h"
#include "actioncollection.h"
#include "tag.h"
#include "filehandle.h"
@@ -141,12 +141,16 @@ void DefaultSequenceIterator::advance()
m_randomItems.removeAll(item);
}
else {
- PlaylistItem *next = current()->itemBelow();
+
+ PlaylistItem *next = 0;
+ const PlaylistItemList &items = current()->playlist()->items();
+ if (items.indexOf(current()) < items.count())
+ next = items[items.indexOf(current()) + 1];
if(!next && loop) {
Playlist *p = current()->playlist();
- next = p->firstChild();
- while(next && !next->isVisible())
- next = static_cast<PlaylistItem *>(next->nextSibling());
+ next = items.first();
+ //while(next && !next->isVisible()) // ### TODO: FIXME
+ // next = static_cast<PlaylistItem *>(next->nextSibling());
}
setCurrent(next);
@@ -158,7 +162,10 @@ void DefaultSequenceIterator::backup()
if(!current())
return;
- PlaylistItem *item = current()->itemAbove();
+ PlaylistItem *item = 0;
+ const PlaylistItemList &items = current()->playlist()->items();
+ if (items.indexOf(current()) > 0)
+ item = items[items.indexOf(current()) - 1];
if(item)
setCurrent(item);
@@ -170,9 +177,10 @@ void DefaultSequenceIterator::prepareToPlay(Playlist *playlist)
bool albumRandom = action("albumRandomPlay") && \
action<KToggleAction>("albumRandomPlay")->isChecked();
if(random || albumRandom) {
- PlaylistItemList items = playlist->selectedItems();
- if(items.isEmpty())
- items = playlist->visibleItems();
+ // ### TODO: View FIXME
+ PlaylistItemList items = playlist->items();//selectedItems();
+// if(items.isEmpty())
+// items = playlist->visibleItems();
PlaylistItem *newItem = 0;
if(!items.isEmpty())
@@ -182,11 +190,13 @@ void DefaultSequenceIterator::prepareToPlay(Playlist *playlist)
refillRandomList();
}
else {
- Q3ListViewItemIterator it(playlist, Q3ListViewItemIterator::Visible | \
Q3ListViewItemIterator::Selected);
- if(!it.current())
- it = Q3ListViewItemIterator(playlist, Q3ListViewItemIterator::Visible);
+ // ### TODO: View
+// Q3ListViewItemIterator it(playlist, Q3ListViewItemIterator::Visible | \
Q3ListViewItemIterator::Selected); +// if(!it.current())
+// it = Q3ListViewItemIterator(playlist, \
Q3ListViewItemIterator::Visible);
- setCurrent(static_cast<PlaylistItem *>(it.current()));
+// setCurrent(static_cast<PlaylistItem *>(it.current()));
+ setCurrent(playlist->items().first());
}
}
@@ -256,7 +266,8 @@ void DefaultSequenceIterator::refillRandomList(Playlist *p)
}
}
- m_randomItems = p->visibleItems();
+ // ### TODO: View
+ m_randomItems = p->items();//visibleItems();
m_randomItems.removeAll(current());
m_albumSearch.clearComponents();
m_albumSearch.search();
diff --git a/tracksequencemanager.cpp b/tracksequencemanager.cpp
index bdc0615..9e2c8be 100644
--- a/tracksequencemanager.cpp
+++ b/tracksequencemanager.cpp
@@ -20,8 +20,8 @@
#include "actioncollection.h"
#include "tracksequencemanager.h"
-#include "playlist.h"
-#include "playlistitem.h"
+#include "playlist/playlists/playlist.h"
+#include "playlist/playlistitem.h"
#include "tracksequenceiterator.h"
#include "tag.h"
#include "filehandle.h"
diff --git a/viewmode.cpp b/viewmode.cpp
index b3f1239..80524cc 100644
--- a/viewmode.cpp
+++ b/viewmode.cpp
@@ -24,8 +24,8 @@
#include <QResizeEvent>
#include "playlistbox.h"
-#include "searchplaylist.h"
-#include "treeviewitemplaylist.h"
+#include "playlist/playlists/searchplaylist.h"
+#include "playlist/playlists/treeviewitemplaylist.h"
#include "collectionlist.h"
////////////////////////////////////////////////////////////////////////////////
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic