Make add DIR to work.
This commit is contained in:
parent
bfc0548cd2
commit
4318215dbb
2 changed files with 18 additions and 7 deletions
24
Playlist.cpp
24
Playlist.cpp
|
@ -321,23 +321,33 @@ PlaylistWidget::addButtons (void)
|
|||
}
|
||||
|
||||
void
|
||||
PlaylistWidget::menuAddDir ()
|
||||
PlaylistWidget::diveDir (const QString &dir)
|
||||
{
|
||||
XMMSHandler *xmmsh = XMMSHandler::getInstance();
|
||||
QString dir;
|
||||
dir = QFileDialog::getExistingDirectory (this, "Select files to play",
|
||||
QDir::homePath ());
|
||||
QDir d (dir);
|
||||
|
||||
d.setFilter (QDir::Files);
|
||||
d.setFilter (QDir::Files | QDir::Dirs | QDir::NoDotAndDotDot);
|
||||
|
||||
QFileInfoList list = d.entryInfoList();
|
||||
for (int i = 0; i < list.size(); ++i) {
|
||||
QFileInfo fileInfo = list.at(i);
|
||||
QString fname = fileInfo.filePath();
|
||||
xmmsh->playlistAddURL ("file://" + fname);
|
||||
if (fileInfo.isDir ()) {
|
||||
diveDir (fileInfo.filePath ());
|
||||
} else {
|
||||
QString fname = fileInfo.filePath();
|
||||
xmmsh->playlistAddURL ("file://" + fname);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
PlaylistWidget::menuAddDir ()
|
||||
{
|
||||
QString dir;
|
||||
dir = QFileDialog::getExistingDirectory (this, "Select files to play",
|
||||
QDir::homePath ());
|
||||
|
||||
diveDir (dir);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -91,6 +91,7 @@ class PlaylistWidget : public QWidget {
|
|||
void paintEvent (QPaintEvent *event);
|
||||
void mouseDoubleClickEvent (QMouseEvent *event);
|
||||
void addButtons (void);
|
||||
void diveDir (const QString &);
|
||||
|
||||
QPixmap m_corner1;
|
||||
QPixmap m_corner2;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue