summaryrefslogtreecommitdiffstats
path: root/rbutil/rbutilqt/talkfile.cpp
diff options
context:
space:
mode:
authorDominik Wenger <domonoky@googlemail.com>2007-10-19 21:49:07 +0000
committerDominik Wenger <domonoky@googlemail.com>2007-10-19 21:49:07 +0000
commit04f1eaf4f0828cb5018a005a58ba4bb675b15419 (patch)
treebffe234247a60705852d123281136477e9ee04b5 /rbutil/rbutilqt/talkfile.cpp
parent5d066590cc1285f4cbefef60267f0942e58a4cb0 (diff)
downloadrockbox-04f1eaf4f0828cb5018a005a58ba4bb675b15419.tar.gz
rockbox-04f1eaf4f0828cb5018a005a58ba4bb675b15419.tar.bz2
rockbox-04f1eaf4f0828cb5018a005a58ba4bb675b15419.zip
rbutil: try to fix all Bugs from FS#7982 in the talkfile creation. Additionally fix the positon of the _dirname.talk file and uninstallation of talkfiles.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15212 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil/rbutilqt/talkfile.cpp')
-rw-r--r--rbutil/rbutilqt/talkfile.cpp27
1 files changed, 16 insertions, 11 deletions
diff --git a/rbutil/rbutilqt/talkfile.cpp b/rbutil/rbutilqt/talkfile.cpp
index 3b99b2c52c..e13647deb2 100644
--- a/rbutil/rbutilqt/talkfile.cpp
+++ b/rbutil/rbutilqt/talkfile.cpp
@@ -43,7 +43,7 @@ bool TalkFileCreator::createTalkFiles(ProgressloggerInterface* logger)
{
m_abort = false;
m_logger = logger;
- m_logger->addItem("Starting Talkfile generation",LOGINFO);
+ m_logger->addItem("Starting Talk file generation",LOGINFO);
if(m_curTTS == "sapi")
m_tts = new TTSSapi();
@@ -78,7 +78,7 @@ bool TalkFileCreator::createTalkFiles(ProgressloggerInterface* logger)
{
if(m_abort)
{
- m_logger->addItem("Talkfile creation aborted",LOGERROR);
+ m_logger->addItem("Talk file creation aborted",LOGERROR);
m_tts->stop();
return false;
}
@@ -88,13 +88,15 @@ bool TalkFileCreator::createTalkFiles(ProgressloggerInterface* logger)
QString toSpeak;
QString filename;
QString wavfilename;
-
- if(fileInf.fileName() == "." || fileInf.fileName() == ".." || fileInf.suffix() == "talk")
+
+ //! skip dotdot and .talk files
+ if(fileInf.fileName() == ".." || fileInf.suffix() == "talk")
{
it.next();
continue;
}
- if(fileInf.isDir()) // if it is a dir
+ //! if it is a dir
+ if(fileInf.isDir())
{
// skip entry if folder talking isnt enabled
if(m_talkFolders == false)
@@ -102,7 +104,7 @@ bool TalkFileCreator::createTalkFiles(ProgressloggerInterface* logger)
it.next();
continue;
}
- toSpeak = fileInf.fileName();
+ toSpeak = fileInf.absoluteDir().dirName();
filename = fileInf.absolutePath() + "/_dirname.talk";
}
else // if it is a file
@@ -124,6 +126,7 @@ bool TalkFileCreator::createTalkFiles(ProgressloggerInterface* logger)
QFileInfo filenameInf(filename);
QFileInfo wavfilenameInf(wavfilename);
+ //! the actual generation of the .talk files
if(!filenameInf.exists() || m_overwriteTalk)
{
if(!wavfilenameInf.exists() || m_overwriteWav)
@@ -146,7 +149,8 @@ bool TalkFileCreator::createTalkFiles(ProgressloggerInterface* logger)
return false;
}
}
-
+
+ //! remove the intermedia wav file, if requested
QString now = QDate::currentDate().toString("yyyyMMdd");
if(m_removeWav)
{
@@ -155,15 +159,16 @@ bool TalkFileCreator::createTalkFiles(ProgressloggerInterface* logger)
installlog.remove(wavfilename);
}
else
- installlog.setValue(wavfilename.remove(m_mountpoint),now);
-
- installlog.setValue(filename.remove(m_mountpoint),now);
+ installlog.setValue(wavfilename.remove(0,m_mountpoint.length()),now);
+
+ //! add the .talk file to the install log
+ installlog.setValue(filename.remove(0,m_mountpoint.length()),now);
it.next();
}
installlog.endGroup();
m_tts->stop();
- m_logger->addItem("Finished creating Talkfiles",LOGOK);
+ m_logger->addItem("Finished creating Talk files",LOGOK);
m_logger->setProgressMax(1);
m_logger->setProgressValue(1);
m_logger->abort();