projects
/
bootcreen
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3ec4cdf
)
Fixed "file with spaces in the name" bug, boot player can't read these
author
Valerio Valerio
<vdv100@gmail.com>
Sun, 28 Feb 2010 17:33:35 +0000
(17:33 +0000)
committer
Valerio Valerio
<vdv100@gmail.com>
Sun, 28 Feb 2010 17:33:35 +0000
(17:33 +0000)
bootscreen.cpp
patch
|
blob
|
history
diff --git
a/bootscreen.cpp
b/bootscreen.cpp
index
ae1a04b
..
d80a8ae
100644
(file)
--- a/
bootscreen.cpp
+++ b/
bootscreen.cpp
@@
-153,7
+153,10
@@
void BootScreen::addVideo()
if(filePath != ""){
QFile fileCopy(filePath);
QFileInfo fileInfo(filePath);
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)
qDebug() << newFilePath << endl;
qDebug() << fileInfo.size() << endl;
if(fileInfo.size() > 11100000)
@@
-168,7
+171,7
@@
void BootScreen::addVideo()
else{
bool result = fileCopy.copy(newFilePath);
if(result){
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);
//autoselect item, if not in random mode
if(!random){
QListWidgetItem *currentItem = list->item(list->count()-1);
@@
-329,8
+332,10
@@
void BootScreen::createFile(QString filename, int index)
out << "filename=" << filePath << endl;
}
}
out << "filename=" << filePath << endl;
}
}
- else
+ else{
+ qDebug() << filename << endl;
qDebug() << "print a error" << endl;
qDebug() << "print a error" << endl;
+ }
}
void BootScreen::closeEvent(QCloseEvent *event)
}
void BootScreen::closeEvent(QCloseEvent *event)