return;
m_directory = directory;
- entryList = m_directory.entryInfoList(QDir::Files | QDir::Readable, QDir::Name);
+
+ entryList = m_directory.entryInfoList(
+ QStringList()
+ << "*.mkv"
+ << "*.mp4"
+ << "*.ogg"
+ << "*.ogm"
+ << "*.wmv"
+ << "*.avi",
+ QDir::Files | QDir::Readable,
+ QDir::Name);
m_currentIndex = 0;
+foreach(const QFileInfo &f, entryList)
+{
+ qDebug() << f.absoluteFilePath();
+}
}
int DirectoryPlaylist::indexOfFile(const QString &file) const
void DirectoryPlaylist::previous()
{
--m_currentIndex;
- if (m_currentIndex == 1)
- m_currentIndex = entryList.count() - 1;
+ if (m_currentIndex == -1)
+ m_currentIndex = count() - 1;
emit currentChanged(m_currentIndex);
emit currentChanged(entryList[m_currentIndex].absoluteFilePath());
case Phonon::ErrorState:
//QMessageBox::warning(this, tr("Phonon error"), mediaObject->errorString());
menu->showMessage(mediaObject->errorString());
- m_currentFile = "";
m_actions["play"]->setDisabled(false);
m_actions["pause"]->setDisabled(true);