Commit 14d5bf18 authored by Scott Wheeler's avatar Scott Wheeler

Make reload work for Folder Playlists.

CCMAIL:81060@bugs.kde.org

svn path=/trunk/kdemultimedia/juk/; revision=344910
parent 3f6de973
......@@ -92,6 +92,8 @@ public:
void setupTreeViewEntries(ViewMode *viewMode) const;
virtual bool canReload() const { return true; }
public slots:
virtual void paste() { decode(kapp->clipboard()->data()); }
virtual void clear();
......
......@@ -37,6 +37,8 @@ public:
virtual ~DynamicPlaylist();
virtual bool canReload() const { return false; }
public slots:
/**
* Reimplemented so that it will reload all of the playlists that are
......
......@@ -26,7 +26,7 @@ FolderPlaylist::FolderPlaylist(PlaylistCollection *collection, const QString &fo
Playlist(collection, name, "folder"),
m_folder(folder)
{
QTimer::singleShot(0, this, SLOT(slotUpdate()));
QTimer::singleShot(0, this, SLOT(slotReload()));
}
FolderPlaylist::~FolderPlaylist()
......@@ -42,14 +42,14 @@ QString FolderPlaylist::folder() const
void FolderPlaylist::setFolder(const QString &s)
{
m_folder = s;
QTimer::singleShot(0, this, SLOT(slotUpdate()));
QTimer::singleShot(0, this, SLOT(slotReload()));
}
////////////////////////////////////////////////////////////////////////////////
// private slots
////////////////////////////////////////////////////////////////////////////////
void FolderPlaylist::slotUpdate()
void FolderPlaylist::slotReload()
{
if(!m_folder.isNull())
addFiles(m_folder, false);
......
......@@ -29,8 +29,11 @@ public:
QString folder() const;
void setFolder(const QString &s);
private slots:
void slotUpdate();
virtual bool canReload() const { return true; }
public slots:
virtual void slotReload();
private:
QString m_folder;
};
......
......@@ -282,6 +282,11 @@ public:
*/
virtual bool readOnly() const { return false; }
/**
* Returns true if it's possible to reload this playlist.
*/
virtual bool canReload() const { return !m_fileName.isNull(); }
void setColumnWidthUpdatesDisabled(bool disabled) { m_disableColumnWidthUpdates = disabled; }
/**
......
......@@ -565,7 +565,7 @@ void PlaylistBox::slotPlaylistChanged()
Playlist *p = (*it)->playlist();
if(p) {
if(p == CollectionList::instance() || !p->fileName().isNull())
if(p->canReload())
allowReload = true;
playlists.append(p);
}
......
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