load same folder, add playlist listview for debug
This commit is contained in:
24
main.cpp
24
main.cpp
@ -1,11 +1,35 @@
|
||||
#include "mainwindow.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QCommandLineParser>
|
||||
#include <QUrl>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication a(argc, argv);
|
||||
|
||||
// parse commandline arguments
|
||||
QCommandLineParser parser;
|
||||
parser.addPositionalArgument("File list", QCoreApplication::translate("main", "File list."));
|
||||
parser.addHelpOption();
|
||||
|
||||
parser.process(a);
|
||||
|
||||
QStringList urlStrList = parser.positionalArguments();
|
||||
QList<QUrl> urlList;
|
||||
for (const QString & str : urlStrList) {
|
||||
QUrl url = QUrl::fromLocalFile(str);
|
||||
if (url.isValid()) {
|
||||
urlList.append(url);
|
||||
}
|
||||
}
|
||||
|
||||
MainWindow w;
|
||||
w.show();
|
||||
|
||||
if (!urlList.isEmpty()) {
|
||||
w.commandlinePlayAudioFiles(urlList);
|
||||
}
|
||||
|
||||
return a.exec();
|
||||
}
|
||||
|
Reference in New Issue
Block a user