Commit 0a2be59e authored by Scott Wheeler's avatar Scott Wheeler

A couple of silly cleanups and minor bugfixes.

svn path=/trunk/kdemultimedia/juk/; revision=207006
parent c31d9c29
......@@ -18,8 +18,12 @@
#include <kurl.h>
#include <kurldrag.h>
#include <klocale.h>
#include <kapplication.h>
#include <kmessagebox.h>
#include <kdebug.h>
#include <qclipboard.h>
#include "collectionlist.h"
#include "playlistsplitter.h"
#include "cache.h"
......@@ -73,6 +77,26 @@ PlaylistItem *CollectionList::createItem(const QFileInfo &file, QListViewItem *)
return new CollectionListItem(file, path);
}
////////////////////////////////////////////////////////////////////////////////
// public slots
////////////////////////////////////////////////////////////////////////////////
void CollectionList::paste()
{
decode(kapp->clipboard()->data());
}
void CollectionList::clear()
{
int result = KMessageBox::warningYesNo(this,
i18n("Removing an item from the collection will also remove it from "
"all of your playlists. Are you sure you want to continue? \n\n"
"Note however that if the directory that these files are in are in "
"your scan on startup list, then they will be readded on startup."));
if(result == KMessageBox::Yes)
Playlist::clear();
}
////////////////////////////////////////////////////////////////////////////////
// protected methods
////////////////////////////////////////////////////////////////////////////////
......
......@@ -53,6 +53,10 @@ public:
CollectionListItem *lookup(const QString &file);
virtual PlaylistItem *createItem(const QFileInfo &file, QListViewItem *);
public slots:
virtual void paste();
virtual void clear();
protected:
CollectionList(PlaylistSplitter *s, QWidget *parent);
......
......@@ -371,6 +371,7 @@ PlaylistItem *Playlist::createItem(const QFileInfo &file, QListViewItem *after)
else
i = new PlaylistItem(item, this);
emit(numberOfItemsChanged(this));
connect(item, SIGNAL(destroyed()), i, SLOT(deleteLater()));
return i;
}
else
......
......@@ -126,11 +126,11 @@ public slots:
*/
void removeSelectedItems() { remove(selectedItems()); };
void copy();
void clear();
void cut() { copy(); clear(); }
void paste();
void selectAll() { KListView::selectAll(true); }
virtual void copy();
virtual void clear();
virtual void cut() { copy(); clear(); }
virtual void paste();
virtual void selectAll() { KListView::selectAll(true); }
protected:
virtual QDragObject *dragObject(QWidget *parent);
......
......@@ -66,7 +66,6 @@ PlaylistSplitter::~PlaylistSplitter()
QString PlaylistSplitter::uniquePlaylistName(const QString &startingWith, bool useParenthesis)
{
if(!playlistBox)
return QString::null;
QStringList names = playlistBox->names();
......@@ -417,8 +416,6 @@ void PlaylistSplitter::readConfig()
{ // block for Playlists group
KConfigGroupSaver saver(config, "Playlists");
directoryList = config->readListEntry("DirectoryList");
if(restore) {
QString playlistsFile = KGlobal::dirs()->saveLocation("appdata") + "playlists";
......@@ -440,6 +437,7 @@ void PlaylistSplitter::readConfig()
}
}
directoryList = config->readListEntry("DirectoryList");
open(directoryList);
}
}
......
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