Commit 22ae2f00 authored by Scott Wheeler's avatar Scott Wheeler

A couple of minor bugfixes, API cleanups and other such fun.

svn path=/trunk/kdemultimedia/juk/; revision=204961
parent 5f892fc4
......@@ -153,6 +153,7 @@ CollectionListItem::CollectionListItem(const QFileInfo &file, const QString &pat
setData(Data::newUser(file, path));
refresh();
connect(this, SIGNAL(refreshed()), l, SIGNAL(dataChanged()));
l->emitNumberOfItemsChanged();
}
else
kdError() << "CollectionListItems should not be created before"
......
......@@ -76,6 +76,8 @@ protected:
* This is similar to addArtist(), but is for album names.
*/
void addAlbum(const QString &album);
void emitNumberOfItemsChanged() { emit(numberOfItemsChanged(this)); }
private:
static CollectionList *list;
......
......@@ -51,7 +51,7 @@ void DirectoryList::addDirectory()
if(!dir.isEmpty() && dirList.find(dir) == dirList.end()) {
dirList.append(dir);
new KListViewItem(directoryListView, dir);
emit directoryAdded(dir);
emit(directoryAdded(dir));
}
}
......@@ -59,7 +59,7 @@ void DirectoryList::removeDirectory()
{
QString dir = directoryListView->selectedItem()->text(0);
dirList.remove(dir);
emit directoryRemoved(dir);
emit(directoryRemoved(dir));
delete(directoryListView->selectedItem());
}
......
......@@ -285,26 +285,6 @@ PlaylistItem *Playlist::previousItem(PlaylistItem *current, bool random)
return(static_cast<PlaylistItem *>(current->itemAbove()));
}
bool Playlist::isInternalFile() const
{
return(internalFile);
}
void Playlist::setInternal(bool internal)
{
internalFile = internal;
}
QString Playlist::fileName() const
{
return(playlistFileName);
}
void Playlist::setFileName(const QString &n)
{
playlistFileName = n;
}
QString Playlist::name() const
{
if(playlistName == QString::null)
......@@ -319,21 +299,6 @@ void Playlist::setName(const QString &n)
emit(nameChanged(playlistName));
}
PlaylistBoxItem *Playlist::playlistBoxItem() const
{
return(boxItem);
}
void Playlist::setPlaylistBoxItem(PlaylistBoxItem *item)
{
boxItem = item;
}
int Playlist::count() const
{
return(childCount());
}
////////////////////////////////////////////////////////////////////////////////
// protected members
////////////////////////////////////////////////////////////////////////////////
......@@ -417,11 +382,6 @@ PlaylistItem *Playlist::createItem(const QFileInfo &file, QListViewItem *after)
return(0);
}
PlaylistSplitter *Playlist::playlistSplitter() const
{
return(splitter);
}
////////////////////////////////////////////////////////////////////////////////
// private members
////////////////////////////////////////////////////////////////////////////////
......@@ -478,16 +438,6 @@ void Playlist::setup()
// private slots
////////////////////////////////////////////////////////////////////////////////
void Playlist::emitSelected()
{
emit(selectionChanged(selectedItems()));
}
void Playlist::emitDoubleClicked(QListViewItem *)
{
emit(doubleClicked());
}
void Playlist::showRMBMenu(QListViewItem *item, const QPoint &point, int column)
{
if(!item)
......
......@@ -94,10 +94,10 @@ public:
* Internal files are files which have not been saved by the user, but rather
* are stored in JuK's data directory and are restored by session management.
*/
bool isInternalFile() const;
void setInternal(bool internal);
QString fileName() const;
void setFileName(const QString &n);
bool isInternalFile() const { return(internalFile); }
void setInternal(bool internal) { internalFile = internal; }
QString fileName() const { return(playlistFileName); }
void setFileName(const QString &n) { playlistFileName = n; }
/**
* If playlistName has no value -- i.e. the name has not been set to
......@@ -111,10 +111,10 @@ public:
*/
void setName(const QString &n);
PlaylistBoxItem *playlistBoxItem() const;
void setPlaylistBoxItem(PlaylistBoxItem *item);
PlaylistBoxItem *playlistBoxItem() const { return(boxItem); }
void setPlaylistBoxItem(PlaylistBoxItem *item) { boxItem = item; }
int count() const;
int count() const { return(childCount()); }
/**
* This gets the next item to be played. This is static because often we
......@@ -133,7 +133,7 @@ protected:
virtual QDragObject *dragObject();
virtual void contentsDropEvent(QDropEvent *e);
virtual void contentsDragMoveEvent(QDragMoveEvent *e);
PlaylistSplitter *playlistSplitter() const;
PlaylistSplitter *playlistSplitter() const { return(splitter); }
signals:
/**
......@@ -169,8 +169,8 @@ private:
QPtrStack<PlaylistItem> history;
private slots:
void emitSelected();
void emitDoubleClicked(QListViewItem *);
void emitSelected() { emit(selectionChanged(selectedItems())); }
void emitDoubleClicked(QListViewItem *) { emit(doubleClicked()); }
void showRMBMenu(QListViewItem *item, const QPoint &point, int column);
void applyTags(QListViewItem *item, const QString &text, int column);
void renameTag();
......
......@@ -263,7 +263,7 @@ void PlaylistSplitter::openDirectory()
directoryQueue.clear();
connect(l, SIGNAL(directoryAdded(const QString &)), this, SLOT(queueDirectory(const QString &)));
connect(l, SIGNAL(directoryRemoved(const QString &)), this, SLOT(removeDirectory(const QString &)));
connect(l, SIGNAL(directoryRemoved(const QString &)), this, SLOT(queueDirectoryRemove(const QString &)));
if(l->exec() == QDialog::Accepted) {
open(directoryQueue);
......
......@@ -229,18 +229,6 @@ public slots:
*/
void setEditorVisible(bool visible);
/**
* Add a directory to the directory list queue. We need to queue these
* rather than processing them when they become available because the user
* could cancel the action.
*/
void queueDirectory(const QString &directory) { directoryQueue.append(directory); }
/**
* Add a directory to the queue
*/
void queueDirectoryRemove(const QString &directory) { directoryQueueRemove.append(directory); }
// PlaylistBox forwarding slots
void savePlaylist() { playlistBox->save(); }
......@@ -279,6 +267,17 @@ private:
private slots:
void changePlaylist(PlaylistBoxItem *item);
void playlistCountChanged(Playlist *p);
/**
* Add a directory to the directory list queue. We need to queue these
* rather than processing them when they become available because the user
* could cancel the action.
*/
void queueDirectory(const QString &directory) { directoryQueue.append(directory); }
/**
* Add a directory to the queue
*/
void queueDirectoryRemove(const QString &directory) { directoryQueueRemove.append(directory); }
private:
PlaylistItem *playingItem;
......
......@@ -34,8 +34,6 @@ public:
virtual ~StatusLabel();
public slots:
// void setPlayingItem(PlaylistItem *item);
/**
* Set the playlist name. This text will only be used when there is not an
* item playing.
......
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