quick and ugly hack until we remove the PlaylistInterface

parent 4ce35621
......@@ -79,6 +79,9 @@ void CollectionList::loadCachedItems()
// m_list->setSortColumn(config.readEntry("CollectionListSortColumn", 1));
// m_list->sort();
emit dataChanged(index(0, 0), index(rowCount(), columnCount()));
SplashScreen::finishedLoading();
}
......@@ -131,7 +134,7 @@ void CollectionList::clearItems(const PlaylistItemList &items)
delete item;
}
dataChanged();
weChanged();
}
void CollectionList::setupTreeViewEntries(ViewMode *viewMode) const
......@@ -420,12 +423,12 @@ void CollectionListItem::refresh()
for(PlaylistItemList::Iterator it = m_children.begin(); it != m_children.end(); ++it) {
// (*it)->playlist()->update();
(*it)->playlist()->dataChanged();
(*it)->playlist()->weChanged();
// if((*it)->listView()->isVisible())
// (*it)->repaint();
}
CollectionList::instance()->dataChanged();
CollectionList::instance()->weChanged();
emit CollectionList::instance()->signalCollectionChanged();
}
......@@ -473,7 +476,7 @@ CollectionListItem::CollectionListItem(CollectionList *parent, const FileHandle
if(file.tag()) {
refresh();
parent->dataChanged();
parent->weChanged();
}
else {
kError() << "CollectionListItem::CollectionListItem() -- Tag() could not be created." << endl;
......
......@@ -154,7 +154,7 @@ void PlaylistCollection::stop()
{
m_playing = false;
currentPlaylist()->stop();
dataChanged();
weChanged();
}
bool PlaylistCollection::playing() const
......@@ -339,7 +339,7 @@ void PlaylistCollection::open(const QStringList &l)
else
visiblePlaylist()->addFiles(files);
dataChanged();
weChanged();
}
void PlaylistCollection::open(const QString &playlist, const QStringList &files)
......@@ -463,14 +463,14 @@ void PlaylistCollection::addCovers(bool fromFile)
{
// ### TODO: View
// visiblePlaylist()->slotAddCover(fromFile);
dataChanged();
weChanged();
}
void PlaylistCollection::removeCovers()
{
// ### TODO: View
// visiblePlaylist()->slotRemoveCover();
dataChanged();
weChanged();
}
void PlaylistCollection::viewCovers()
......@@ -647,7 +647,7 @@ void PlaylistCollection::raise(Playlist *playlist)
// playlist->setSearchEnabled(m_searchEnabled);
m_playlistView->setModel(playlist);
clearShowMore(false);
dataChanged();
weChanged();
}
void PlaylistCollection::raiseDistraction()
......
......@@ -24,7 +24,7 @@ void Watched::currentChanged()
observer->updateCurrent();
}
void Watched::dataChanged()
void Watched::weChanged()
{
foreach(PlaylistObserver *observer, m_observers)
observer->updateData();
......
......@@ -47,7 +47,7 @@ public:
* This is triggered when the data in the playlist -- i.e. the tag content
* changes.
*/
virtual void dataChanged();
virtual void weChanged();
protected:
virtual ~Watched();
......
......@@ -151,7 +151,7 @@ QDataStream &operator>>(QDataStream &s, HistoryPlaylist &p)
}
}
p.dataChanged();
p.weChanged();
return s;
}
......
......@@ -385,7 +385,7 @@ void Playlist::clearItem(PlaylistItem *item, bool emitChanged)
// Automatically updates internal structs via updateDeletedItem
delete item;
dataChanged();
weChanged();
}
// ### TODO Remove me
......@@ -397,7 +397,7 @@ void Playlist::clearItems(const PlaylistItemList &items)
}
dataChanged();
weChanged();
}
PlaylistItem *Playlist::playingItem() // static
......@@ -448,11 +448,11 @@ void Playlist::slotReload()
}
//### TODO: Nuke me
void Playlist::dataChanged()
void Playlist::weChanged()
{
if(m_blockDataChanged)
return;
PlaylistInterface::dataChanged();
PlaylistInterface::weChanged();
}
////////////////////////////////////////////////////////////////////////////////
......@@ -491,7 +491,7 @@ void Playlist::read(QDataStream &s)
m_blockDataChanged = false;
dataChanged();
weChanged();
m_collection->setupPlaylist(this, "view-media-playlist");
}
......@@ -525,7 +525,7 @@ void Playlist::addFiles(const QStringList &files, PlaylistItem *after)
m_blockDataChanged = false;
// slotWeightDirty();
dataChanged();
weChanged();
KApplication::restoreOverrideCursor();
}
......@@ -585,6 +585,9 @@ void Playlist::setupItem(PlaylistItem *item)
item->setTrackId(g_trackID);
g_trackID++;
if (!m_items.contains(item))
m_items.append(item);
//### TODO: View
// if(!m_search.isEmpty())
// item->setVisible(m_search.checkItem(item));
......@@ -700,7 +703,7 @@ void Playlist::loadFile(const QString &fileName, const QFileInfo &fileInfo)
file.close();
dataChanged();
weChanged();
m_disableColumnWidthUpdates = false;
}
......@@ -1060,7 +1063,7 @@ bool Playlist::deleteRows(int row, int count, const QModelIndex& parent)
emit QAbstractTableModel::dataChanged(createIndex(row, 0), createIndex(row, columnCount()));
dataChanged();
weChanged();
return true;
}
......
......@@ -429,7 +429,7 @@ public slots:
// void slotColumnResizeModeChanged();
virtual void dataChanged();
virtual void weChanged();
protected:
/**
......@@ -495,6 +495,8 @@ signals:
void coverChanged();
void signalPlaylistItemsDropped(Playlist *p);
void dataChanged(const QModelIndex&, const QModelIndex&);
private:
// void setup();
......@@ -740,12 +742,13 @@ ItemType *Playlist::createItem(const FileHandle &file, ItemType *after,
if(item && (!m_members.insert(file.absFilePath()) || m_allowDuplicates)) {
ItemType *i = new ItemType(item, this);
setupItem(i);
m_items.insert(m_items.indexOf(after), i);
setupItem(i);
if(emitChanged)
dataChanged();
weChanged();
return i;
}
......@@ -777,7 +780,8 @@ void Playlist::createItems(const QList<SiblingType *> &siblings, ItemType *after
foreach(SiblingType *sibling, siblings)
after = createItem(sibling, after);
dataChanged();
weChanged();
emit dataChanged(index(m_items.indexOf(siblings.first()), 0), index(m_items.indexOf(siblings.last()), 0));
// slotWeightDirty();
}
......
......@@ -76,7 +76,7 @@ void SearchPlaylist::updateItems()
clearItem(item, false);
if(!oldItems.isEmpty() && newItems.isEmpty())
dataChanged();
weChanged();
createItems(newItems);
......
......@@ -76,7 +76,7 @@ void UpcomingPlaylist::appendItems(const PlaylistItemList &itemList)
m_playlistIndex.insert(after, playlistItem->playlist());
}
dataChanged();
weChanged();
// slotWeightDirty();
}
......@@ -225,7 +225,7 @@ void UpcomingPlaylist::UpcomingSequenceIterator::setCurrent(PlaylistItem *curren
if(p != m_playlist) {
PlaylistItem *i = m_playlist->createItem(currentItem, (PlaylistItem *) 0);
m_playlist->playlistIndex().insert(i, p);
m_playlist->dataChanged();
m_playlist->weChanged();
// m_playlist->slotWeightDirty();
}
else {
......
......@@ -599,7 +599,7 @@ void TagEditor::save(const PlaylistItemList &list)
}
TagTransactionManager::instance()->commit();
CollectionList::instance()->dataChanged();
CollectionList::instance()->weChanged();
m_performingSave = false;
KApplication::restoreOverrideCursor();
}
......
......@@ -179,7 +179,7 @@ bool TagTransactionManager::processChangeList(bool undo)
item->file().setFile(tag->fileName());
item->refreshFromDisk();
//item->repaint();
item->playlist()->dataChanged();
item->playlist()->weChanged();
//item->playlist()->update();
}
else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment