Commit 59f48c50 authored by Scott Wheeler's avatar Scott Wheeler

More adjustments to make use of "columnOffset()". Now hiding columns in

the history view should properly update the columns in the normal list view.

svn path=/trunk/kdemultimedia/juk/; revision=241921
parent 57c492c6
......@@ -32,8 +32,8 @@ public:
virtual ~HistoryPlaylist();
virtual void createItems(const PlaylistItemList &siblings);
virtual int columnOffset() { return 1; }
virtual bool readOnly() { return true; }
virtual int columnOffset() const { return 1; }
virtual bool readOnly() const { return true; }
public slots:
void cut() {}
void clear() {}
......
......@@ -99,7 +99,7 @@ void Playlist::SharedSettings::setColumnOrder(const Playlist *l)
m_columnOrder.clear();
for(int i = 0; i < l->columns(); ++i)
for(int i = l->columnOffset(); i < l->columns(); ++i)
m_columnOrder.append(l->header()->mapToIndex(i));
writeConfig();
......@@ -120,15 +120,16 @@ void Playlist::SharedSettings::apply(Playlist *l) const
if(!l)
return;
int offset = l->columnOffset();
int i = 0;
for(QValueListConstIterator<int> it = m_columnOrder.begin(); it != m_columnOrder.end(); ++it)
l->header()->moveSection(i++, *it);
l->header()->moveSection(i++ + offset, *it + offset);
for(uint i = 0; i < m_columnsVisible.size(); i++) {
if(m_columnsVisible[i] && ! l->isColumnVisible(i))
l->showColumn(i);
else if(! m_columnsVisible[i] && l->isColumnVisible(i))
l->hideColumn(i);
if(m_columnsVisible[i] && !l->isColumnVisible(i + offset))
l->showColumn(i + offset);
else if(!m_columnsVisible[i] && l->isColumnVisible(i + offset))
l->hideColumn(i + offset);
}
l->updateLeftColumn();
......@@ -1099,7 +1100,7 @@ void Playlist::slotToggleColumnVisible(int column)
else
showColumn(column);
SharedSettings::instance()->toggleColumnVisible(column);
SharedSettings::instance()->toggleColumnVisible(column - columnOffset());
}
int Playlist::leftMostVisibleColumn() const
......
......@@ -213,8 +213,8 @@ public:
*/
void emitCountChanged() { emit signalCountChanged(this); }
virtual int columnOffset() { return 0; }
virtual bool readOnly() { return false; }
virtual int columnOffset() const { return 0; }
virtual bool readOnly() const { return false; }
public slots:
/**
......
......@@ -196,16 +196,20 @@ void PlaylistSplitter::stop()
QString PlaylistSplitter::playingArtist() const
{
if(m_playingItem)
return m_playingItem->text(PlaylistItem::ArtistColumn);
if(m_playingItem) {
int offset = static_cast<Playlist *>(m_playingItem->listView())->columnOffset();
return m_playingItem->text(PlaylistItem::ArtistColumn + offset);
}
else
return QString::null;
}
QString PlaylistSplitter::playingTrack() const
{
if(m_playingItem)
return m_playingItem->text(PlaylistItem::TrackColumn);
if(m_playingItem) {
int offset = static_cast<Playlist *>(m_playingItem->listView())->columnOffset();
return m_playingItem->text(PlaylistItem::TrackColumn + offset);
}
else
return QString::null;
}
......
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