Commit 9b880eb0 authored by Scott Wheeler's avatar Scott Wheeler

Made is so that when a new playlist is created that it is put on top of

the playlist stack and selected in the PlaylistBox.

svn path=/trunk/kdemultimedia/juk/; revision=200963
parent c67d8815
......@@ -111,7 +111,7 @@ void Playlist::save(bool autoGenerateFileName)
{
if(autoGenerateFileName && playlistFileName == QString::null) {
QString dataDir = KGlobal::dirs()->saveLocation("appdata");
kdDebug() << "Playlist::save() - name() == " << name() << endl;
// kdDebug() << "Playlist::save() - name() == " << name() << endl;
playlistFileName = dataDir + name() + "." + splitter->playlistExtensions().first();
}
else if(!autoGenerateFileName && (internalFile || playlistFileName == QString::null))
......
......@@ -280,7 +280,7 @@ Playlist *PlaylistSplitter::createPlaylist()
Playlist *PlaylistSplitter::createPlaylist(const QString &name)
{
Playlist *p = new Playlist(this, playlistStack, name.latin1());
setupPlaylist(p);
setupPlaylist(p, true);
return(p);
}
......@@ -427,7 +427,7 @@ void PlaylistSplitter::setupLayout()
CollectionList::initialize(this, playlistStack, restore);
collection = CollectionList::instance();
setupPlaylist(collection, "folder_sound");
setupPlaylist(collection, true, "folder_sound");
// Show the collection on startup.
playlistBox->setSelected(0, true);
......@@ -509,7 +509,7 @@ void PlaylistSplitter::addImpl(const QString &file, Playlist *list)
}
}
void PlaylistSplitter::setupPlaylist(Playlist *p, const char *icon)
void PlaylistSplitter::setupPlaylist(Playlist *p, bool raise, const char *icon)
{
PlaylistBoxItem *i = new PlaylistBoxItem(playlistBox, SmallIcon(icon, 32), p->name(), p);
p->setPlaylistBoxItem(i);
......@@ -519,6 +519,12 @@ void PlaylistSplitter::setupPlaylist(Playlist *p, const char *icon)
connect(p, SIGNAL(doubleClicked()), this, SIGNAL(doubleClicked()));
connect(p, SIGNAL(collectionChanged()), editor, SLOT(updateCollection()));
connect(p, SIGNAL(numberOfItemsChanged(Playlist *)), this, SLOT(playlistCountChanged(Playlist *)));
if(raise) {
playlistStack->raiseWidget(p);
playlistBox->setCurrentItem(i);
playlistBox->ensureCurrentVisible();
}
}
void PlaylistSplitter::checkPlayingItemBeforeRemove(PlaylistItemList &items)
......
......@@ -254,7 +254,7 @@ private:
void readConfig();
void saveConfig();
void addImpl(const QString &file, Playlist *list);
void setupPlaylist(Playlist *p, const char *icon = "midi");
void setupPlaylist(Playlist *p, bool raise = false, const char *icon = "midi");
void checkPlayingItemBeforeRemove(PlaylistItemList &items);
private slots:
......
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