Commit 11829399 authored by Scott Wheeler's avatar Scott Wheeler

Update the tag editor's auto completion stuff on startup (bug) and don't

allow repeated strings in the sortedstringlist.

svn path=/trunk/kdemultimedia/juk/; revision=212482
parent 2166051b
......@@ -74,6 +74,8 @@ void CollectionList::clear()
"your scan on startup list, then they will be readded on startup."));
if(result == KMessageBox::Yes)
Playlist::clear();
emit signalCollectionChanged();
}
void CollectionList::slotCheckCache()
......
......@@ -86,6 +86,9 @@ protected:
void addAlbum(const QString &album);
void emitNumberOfItemsChanged() { emit signalNumberOfItemsChanged(this); }
signals:
void signalCollectionChanged();
private:
static CollectionList *list;
......
......@@ -160,12 +160,6 @@ signals:
* PlaylistItem class.
*/
void signalDataChanged();
/**
* This signal is emitted when items are added to the collection list.
* This happens in the createItem() method when items are added to the
* collection.
*/
void signalCollectionChanged();
/**
* This is emitted when the playlist selection is changed. This is used
......
......@@ -64,6 +64,8 @@ PlaylistSplitter::PlaylistSplitter(QWidget *parent, bool restore, const char *na
setupLayout();
readConfig();
m_editor->slotUpdateCollection();
}
PlaylistSplitter::~PlaylistSplitter()
......@@ -364,6 +366,7 @@ void PlaylistSplitter::setupLayout()
CollectionList::initialize(m_playlistStack, m_restore);
m_collection = CollectionList::instance();
setupPlaylist(m_collection, true, "folder_sound");
connect(m_collection, SIGNAL(signalCollectionChanged()), m_editor, SLOT(slotUpdateCollection()));
// Show the collection on startup.
m_playlistBox->setSelected(0, true);
......@@ -498,7 +501,6 @@ void PlaylistSplitter::setupPlaylist(Playlist *p, bool raise, const char *icon)
{
connect(p, SIGNAL(signalSelectionChanged(const PlaylistItemList &)), m_editor, SLOT(slotSetItems(const PlaylistItemList &)));
connect(p, SIGNAL(signalDoubleClicked()), this, SIGNAL(signalDoubleClicked()));
connect(p, SIGNAL(signalCollectionChanged()), m_editor, SLOT(slotUpdateCollection()));
connect(p, SIGNAL(signalNumberOfItemsChanged(Playlist *)), this, SLOT(slotPlaylistCountChanged(Playlist *)));
connect(p, SIGNAL(signalAboutToRemove(PlaylistItem *)), this, SLOT(slotPlaylistItemRemoved(PlaylistItem *)));
connect(p, SIGNAL(signalFilesDropped(const QStringList &, Playlist *)), this, SLOT(slotAddToPlaylist(const QStringList &, Playlist *)));
......
......@@ -147,7 +147,9 @@ bool SortedStringList::BSTInsert(const QString &value)
while(node) {
previousNode = node;
if(value < node->key)
if(value == node->key)
return true;
else if(value < node->key)
node = node->left;
else
node = node->right;
......
......@@ -28,7 +28,6 @@
#include <qlayout.h>
#include "statuslabel.h"
#include "playlistitem.h"
#include "playlist.h"
#include "playlistbox.h"
#include "playlistsplitter.h"
......
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