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