if(filePath != ""){
QFile fileCopy(filePath);
QFileInfo fileInfo(filePath);
- QString newFilePath = videosDir + fileInfo.fileName();
+ QString fileName = fileInfo.fileName();
+ //boot player can't read files with spaces in the name
+ fileName.replace(QString(" "), QString("_"));
+ QString newFilePath = videosDir + fileName;
qDebug() << newFilePath << endl;
qDebug() << fileInfo.size() << endl;
if(fileInfo.size() > 11100000)
else{
bool result = fileCopy.copy(newFilePath);
if(result){
- list->addItem(QString("%1").arg(fileInfo.fileName()));
+ list->addItem(QString("%1").arg(fileName));
//autoselect item, if not in random mode
if(!random){
QListWidgetItem *currentItem = list->item(list->count()-1);
out << "filename=" << filePath << endl;
}
}
- else
+ else{
+ qDebug() << filename << endl;
qDebug() << "print a error" << endl;
+ }
}
void BootScreen::closeEvent(QCloseEvent *event)