summaryrefslogtreecommitdiff
path: root/rbutil/rbutilqt/talkfile.cpp
diff options
context:
space:
mode:
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)
43{ 43{
44 m_abort = false; 44 m_abort = false;
45 m_logger = logger; 45 m_logger = logger;
46 m_logger->addItem("Starting Talkfile generation",LOGINFO); 46 m_logger->addItem("Starting Talk file generation",LOGINFO);
47 47
48 if(m_curTTS == "sapi") 48 if(m_curTTS == "sapi")
49 m_tts = new TTSSapi(); 49 m_tts = new TTSSapi();
@@ -78,7 +78,7 @@ bool TalkFileCreator::createTalkFiles(ProgressloggerInterface* logger)
78 { 78 {
79 if(m_abort) 79 if(m_abort)
80 { 80 {
81 m_logger->addItem("Talkfile creation aborted",LOGERROR); 81 m_logger->addItem("Talk file creation aborted",LOGERROR);
82 m_tts->stop(); 82 m_tts->stop();
83 return false; 83 return false;
84 } 84 }
@@ -88,13 +88,15 @@ bool TalkFileCreator::createTalkFiles(ProgressloggerInterface* logger)
88 QString toSpeak; 88 QString toSpeak;
89 QString filename; 89 QString filename;
90 QString wavfilename; 90 QString wavfilename;
91 91
92 if(fileInf.fileName() == "." || fileInf.fileName() == ".." || fileInf.suffix() == "talk") 92 //! skip dotdot and .talk files
93 if(fileInf.fileName() == ".." || fileInf.suffix() == "talk")
93 { 94 {
94 it.next(); 95 it.next();
95 continue; 96 continue;
96 } 97 }
97 if(fileInf.isDir()) // if it is a dir 98 //! if it is a dir
99 if(fileInf.isDir())
98 { 100 {
99 // skip entry if folder talking isnt enabled 101 // skip entry if folder talking isnt enabled
100 if(m_talkFolders == false) 102 if(m_talkFolders == false)
@@ -102,7 +104,7 @@ bool TalkFileCreator::createTalkFiles(ProgressloggerInterface* logger)
102 it.next(); 104 it.next();
103 continue; 105 continue;
104 } 106 }
105 toSpeak = fileInf.fileName(); 107 toSpeak = fileInf.absoluteDir().dirName();
106 filename = fileInf.absolutePath() + "/_dirname.talk"; 108 filename = fileInf.absolutePath() + "/_dirname.talk";
107 } 109 }
108 else // if it is a file 110 else // if it is a file
@@ -124,6 +126,7 @@ bool TalkFileCreator::createTalkFiles(ProgressloggerInterface* logger)
124 QFileInfo filenameInf(filename); 126 QFileInfo filenameInf(filename);
125 QFileInfo wavfilenameInf(wavfilename); 127 QFileInfo wavfilenameInf(wavfilename);
126 128
129 //! the actual generation of the .talk files
127 if(!filenameInf.exists() || m_overwriteTalk) 130 if(!filenameInf.exists() || m_overwriteTalk)
128 { 131 {
129 if(!wavfilenameInf.exists() || m_overwriteWav) 132 if(!wavfilenameInf.exists() || m_overwriteWav)
@@ -146,7 +149,8 @@ bool TalkFileCreator::createTalkFiles(ProgressloggerInterface* logger)
146 return false; 149 return false;
147 } 150 }
148 } 151 }
149 152
153 //! remove the intermedia wav file, if requested
150 QString now = QDate::currentDate().toString("yyyyMMdd"); 154 QString now = QDate::currentDate().toString("yyyyMMdd");
151 if(m_removeWav) 155 if(m_removeWav)
152 { 156 {
@@ -155,15 +159,16 @@ bool TalkFileCreator::createTalkFiles(ProgressloggerInterface* logger)
155 installlog.remove(wavfilename); 159 installlog.remove(wavfilename);
156 } 160 }
157 else 161 else
158 installlog.setValue(wavfilename.remove(m_mountpoint),now); 162 installlog.setValue(wavfilename.remove(0,m_mountpoint.length()),now);
159 163
160 installlog.setValue(filename.remove(m_mountpoint),now); 164 //! add the .talk file to the install log
165 installlog.setValue(filename.remove(0,m_mountpoint.length()),now);
161 it.next(); 166 it.next();
162 } 167 }
163 168
164 installlog.endGroup(); 169 installlog.endGroup();
165 m_tts->stop(); 170 m_tts->stop();
166 m_logger->addItem("Finished creating Talkfiles",LOGOK); 171 m_logger->addItem("Finished creating Talk files",LOGOK);
167 m_logger->setProgressMax(1); 172 m_logger->setProgressMax(1);
168 m_logger->setProgressValue(1); 173 m_logger->setProgressValue(1);
169 m_logger->abort(); 174 m_logger->abort();