Commit 85b2766a authored by Scott Wheeler's avatar Scott Wheeler

Make it so that the visible column list is updated correctly when it's

changed from a list other than the collection list.

svn path=/trunk/kdemultimedia/juk/; revision=249877
parent 3eb8607f
......@@ -75,6 +75,8 @@ public:
QListViewItem * = 0,
bool = false);
void emitVisibleColumnsChanged() { emit signalVisibleColumnsChanged(); }
public slots:
virtual void paste() { decode(kapp->clipboard()->data()); }
virtual void clear();
......@@ -103,6 +105,15 @@ protected:
signals:
void signalCollectionChanged();
/**
* This is emitted when the set of columns that is visible is changed.
*
* \see Playlist::hideColumn()
* \see Playlist::showColumn()
* \see Playlsit::isColumnVisible()
*/
void signalVisibleColumnsChanged();
private slots:
void slotRemoveItem(const QString &file);
void slotRefreshItem(const QString &file);
......
......@@ -769,6 +769,9 @@ void Playlist::hideColumn(int c)
{
m_headerMenu->setItemChecked(c, false);
if(!isColumnVisible(c))
return;
setColumnWidthMode(c, Manual);
setColumnWidth(c, 0);
......@@ -782,13 +785,20 @@ void Playlist::hideColumn(int c)
slotUpdateColumnWidths();
triggerUpdate();
emit signalVisibleColumnsChanged();
if(this != CollectionList::instance())
CollectionList::instance()->hideColumn(c);
CollectionList::instance()->emitVisibleColumnsChanged();
}
void Playlist::showColumn(int c)
{
m_headerMenu->setItemChecked(c, true);
if(isColumnVisible(c))
return;
// Just set the width to one to mark the column as visible -- we'll update
// the real size in the next call.
......@@ -804,7 +814,11 @@ void Playlist::showColumn(int c)
slotUpdateColumnWidths();
triggerUpdate();
emit signalVisibleColumnsChanged();
if(this != CollectionList::instance())
CollectionList::instance()->showColumn(c);
CollectionList::instance()->emitVisibleColumnsChanged();
}
bool Playlist::isColumnVisible(int c) const
......
......@@ -438,15 +438,6 @@ signals:
*/
void signalSetNext(PlaylistItem *item);
/**
* This is emitted when the set of columns that is visible is changed.
*
* \see hideColumn()
* \see showColumn()
* \see isColumnVisible()
*/
void signalVisibleColumnsChanged();
/**
* Request creation of a playlist based on \a items.
*/
......
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