Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit a5978904 authored by Scott Wheeler's avatar Scott Wheeler

fix delayed cache checking

svn path=/trunk/kdemultimedia/juk/; revision=211443
parent ec4c44ee
...@@ -98,11 +98,19 @@ void CollectionList::clear() ...@@ -98,11 +98,19 @@ void CollectionList::clear()
Playlist::clear(); Playlist::clear();
} }
void CollectionList::slotCheckCache()
{
for(QDictIterator<CollectionListItem>it(m_itemsDict); it.current(); ++it) {
it.current()->checkCurrent();
kapp->processEvents();
}
}
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// protected methods // protected methods
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
CollectionList::CollectionList(PlaylistSplitter *s, QWidget *parent) : Playlist(s, parent, i18n("Collection List")) CollectionList::CollectionList(PlaylistSplitter *s, QWidget *parent) : Playlist(s, parent, i18n("Collection List")) //, m_finishedLoading(false)
{ {
} }
...@@ -206,7 +214,6 @@ CollectionListItem::CollectionListItem(const QFileInfo &file, const QString &pat ...@@ -206,7 +214,6 @@ CollectionListItem::CollectionListItem(const QFileInfo &file, const QString &pat
<< "CollectionList::initialize() has been called." << endl; << "CollectionList::initialize() has been called." << endl;
SplashScreen::increment(); SplashScreen::increment();
QTimer::singleShot(3 * 1000, this, SLOT(slotCheckCurrent()));
} }
CollectionListItem::~CollectionListItem() CollectionListItem::~CollectionListItem()
...@@ -222,11 +229,7 @@ void CollectionListItem::addChildItem(PlaylistItem *child) ...@@ -222,11 +229,7 @@ void CollectionListItem::addChildItem(PlaylistItem *child)
connect(this, SIGNAL(signalRefreshed()), child, SLOT(slotRefreshImpl())); connect(this, SIGNAL(signalRefreshed()), child, SLOT(slotRefreshImpl()));
} }
//////////////////////////////////////////////////////////////////////////////// void CollectionListItem::checkCurrent()
// CollectionListItem private slots
////////////////////////////////////////////////////////////////////////////////
void CollectionListItem::slotCheckCurrent()
{ {
if(!data()->exists() || !data()->isFile()) if(!data()->exists() || !data()->isFile())
CollectionList::instance()->clearItem(this); CollectionList::instance()->clearItem(this);
......
...@@ -57,6 +57,7 @@ public: ...@@ -57,6 +57,7 @@ public:
public slots: public slots:
virtual void paste(); virtual void paste();
virtual void clear(); virtual void clear();
void slotCheckCache();
protected: protected:
CollectionList(PlaylistSplitter *s, QWidget *parent); CollectionList(PlaylistSplitter *s, QWidget *parent);
...@@ -113,14 +114,13 @@ protected: ...@@ -113,14 +114,13 @@ protected:
void addChildItem(PlaylistItem *child); void addChildItem(PlaylistItem *child);
private slots:
/** /**
* This slot, called from a QTimer::singleShot() set in the constructor, allows for * This slot, called from a QTimer::singleShot() set in the constructor, allows for
* delayed consistancy checking for the cache at the cost of a few CPU cycles. The * delayed consistancy checking for the cache at the cost of a few CPU cycles. The
* effect however is that stating files is delayed until after the GUI is shown by * effect however is that stating files is delayed until after the GUI is shown by
* moving this action into the event loop. * moving this action into the event loop.
*/ */
void slotCheckCurrent(); void checkCurrent();
}; };
#endif #endif
...@@ -59,6 +59,7 @@ JuK::JuK(QWidget *parent, const char *name) : KMainWindow(parent, name, WDestruc ...@@ -59,6 +59,7 @@ JuK::JuK(QWidget *parent, const char *name) : KMainWindow(parent, name, WDestruc
processArgs(); processArgs();
SplashScreen::finishedLoading(); SplashScreen::finishedLoading();
QTimer::singleShot(0, CollectionList::instance(), SLOT(slotCheckCache()));
} }
JuK::~JuK() JuK::~JuK()
......
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