Commit 83f546f7 authored by Scott Wheeler's avatar Scott Wheeler

Make it actually restore playlists properly.

svn path=/trunk/kdemultimedia/juk/; revision=208256
parent 75b7cd57
......@@ -428,7 +428,7 @@ void PlaylistSplitter::readConfig()
// check to see if we've alredy loaded this item before continuing
if(!playlistFiles.insert(p->fileName()))
if(p->fileName().isEmpty() || !playlistFiles.insert(p->fileName()))
setupPlaylist(p);
else
delete p;
......@@ -443,19 +443,19 @@ void PlaylistSplitter::readConfig()
if(collection) {
// the last column is just a filler
_visibleColumns.resize(collection->columns() - 1, true);
m_visibleColumns.resize(collection->columns() - 1, true);
QValueList<int> l = config->readIntListEntry("VisibleColumns");
uint i = 0;
for(QValueList<int>::Iterator it = l.begin(); it != l.end(); ++it) {
if(! bool(*it)) {
_visibleColumns[i] = bool(*it);
m_visibleColumns[i] = bool(*it);
collection->hideColumn(i);
}
// while we're looping go ahead and populate _columnNames
// while we're looping go ahead and populate m_columnNames
_columnNames.append(collection->columnText(i));
m_columnNames.append(collection->columnText(i));
i++;
}
......@@ -494,8 +494,8 @@ void PlaylistSplitter::saveConfig()
config->writeEntry("DirectoryList", directoryList);
QValueList<int> l;
for(uint i = 0; i < _visibleColumns.size(); i++)
l.append(int(_visibleColumns[i]));
for(uint i = 0; i < m_visibleColumns.size(); i++)
l.append(int(m_visibleColumns[i]));
config->writeEntry("VisibleColumns", l);
......@@ -560,10 +560,10 @@ void PlaylistSplitter::setupColumns(Playlist *p)
if(!p)
return;
for(uint i = 0; i < _visibleColumns.size(); i++) {
if(_visibleColumns[i] && ! p->isColumnVisible(i))
for(uint i = 0; i < m_visibleColumns.size(); i++) {
if(m_visibleColumns[i] && ! p->isColumnVisible(i))
p->showColumn(i);
else if(! _visibleColumns[i] && p->isColumnVisible(i))
else if(! m_visibleColumns[i] && p->isColumnVisible(i))
p->hideColumn(i);
}
}
......@@ -597,7 +597,7 @@ void PlaylistSplitter::playlistItemRemoved(PlaylistItem *item)
void PlaylistSplitter::slotToggleColumnVisible(int column)
{
_visibleColumns[column] = ! _visibleColumns[column];
m_visibleColumns[column] = ! m_visibleColumns[column];
if(visiblePlaylist())
setupColumns(visiblePlaylist());
}
......
......@@ -143,7 +143,7 @@ public:
*/
void open(const QString &file);
QStringList columnNames() const { return _columnNames; }
QStringList columnNames() const { return m_columnNames; }
KActionMenu *columnVisibleAction() const { return collection->columnVisibleAction(); }
......@@ -299,8 +299,8 @@ private:
QStringList directoryQueue;
QStringList directoryQueueRemove;
QValueVector<bool> _visibleColumns;
QStringList _columnNames;
QValueVector<bool> m_visibleColumns;
QStringList m_columnNames;
bool showEditor;
bool restore;
......
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