summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2012-05-23 22:48:09 +0200
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2012-05-23 22:48:09 +0200
commit6de59442a50f840686baad96c68d6e215299b0d4 (patch)
tree34cb205da9cfc107108bf951a6bca11dabfc5991
parent968448c9cdd2583225cff015b43aeeb9d1c304da (diff)
downloadrockbox-6de59442a50f840686baad96c68d6e215299b0d4.tar.gz
rockbox-6de59442a50f840686baad96c68d6e215299b0d4.zip
Use Rockbox version for created voicefile version.
Instead of using the date the voice file was created use the version of Rockbox the voice file was created for. That way it is possible to see from the installation log if the installed voice matches the current Rockbox version. Change-Id: I9fd7d40d718febafbc20579f049b9b94cfa5d573
-rw-r--r--rbutil/rbutilqt/base/voicefile.cpp16
-rw-r--r--rbutil/rbutilqt/base/voicefile.h1
2 files changed, 9 insertions, 8 deletions
diff --git a/rbutil/rbutilqt/base/voicefile.cpp b/rbutil/rbutilqt/base/voicefile.cpp
index cb9130c41a..871dd287b1 100644
--- a/rbutil/rbutilqt/base/voicefile.cpp
+++ b/rbutil/rbutilqt/base/voicefile.cpp
@@ -59,13 +59,13 @@ bool VoiceFileCreator::createVoiceFile()
59 QString features = info.features(); 59 QString features = info.features();
60 QString version = info.version(); 60 QString version = info.version();
61 m_targetid = info.targetID().toInt(); 61 m_targetid = info.targetID().toInt();
62 version = version.left(version.indexOf("-")).remove("r"); 62 m_versionstring = version.left(version.indexOf("-")).remove("r");
63 63
64 //prepare download url 64 //prepare download url
65 QString genlang = SystemInfo::value(SystemInfo::GenlangUrl).toString(); 65 QString genlang = SystemInfo::value(SystemInfo::GenlangUrl).toString();
66 genlang.replace("%LANG%", m_lang); 66 genlang.replace("%LANG%", m_lang);
67 genlang.replace("%TARGET%", target); 67 genlang.replace("%TARGET%", target);
68 genlang.replace("%REVISION%", version); 68 genlang.replace("%REVISION%", m_versionstring);
69 genlang.replace("%FEATURES%", features); 69 genlang.replace("%FEATURES%", features);
70 QUrl genlangUrl(genlang); 70 QUrl genlangUrl(genlang);
71 qDebug() << "[VoiceFileCreator] downloading " << genlangUrl; 71 qDebug() << "[VoiceFileCreator] downloading " << genlangUrl;
@@ -95,7 +95,8 @@ void VoiceFileCreator::downloadDone(bool error)
95 // update progress bar 95 // update progress bar
96 emit logProgress(1,1); 96 emit logProgress(1,1);
97 if(getter->httpResponse() != 200 && !getter->isCached()) { 97 if(getter->httpResponse() != 200 && !getter->isCached()) {
98 emit logItem(tr("Download error: received HTTP error %1.").arg(getter->httpResponse()),LOGERROR); 98 emit logItem(tr("Download error: received HTTP error %1.")
99 .arg(getter->httpResponse()),LOGERROR);
99 emit done(true); 100 emit done(true);
100 return; 101 return;
101 } 102 }
@@ -233,15 +234,14 @@ void VoiceFileCreator::downloadDone(bool error)
233 234
234 // Add Voice file to the install log 235 // Add Voice file to the install log
235 QSettings installlog(m_mountpoint + "/.rockbox/rbutil.log", QSettings::IniFormat, 0); 236 QSettings installlog(m_mountpoint + "/.rockbox/rbutil.log", QSettings::IniFormat, 0);
236 installlog.beginGroup("selfcreated Voice"); 237 installlog.beginGroup(QString("Voice (self created, %1)").arg(m_lang));
237 installlog.setValue("/.rockbox/langs/" + m_lang + ".voice", 238 installlog.setValue("/.rockbox/langs/" + m_lang + ".voice", m_versionstring);
238 QDate::currentDate().toString("yyyyMMdd"));
239 installlog.endGroup(); 239 installlog.endGroup();
240 installlog.sync(); 240 installlog.sync();
241 241
242 emit logProgress(1,1); 242 emit logProgress(1,1);
243 emit logItem(tr("successfully created."),LOGOK); 243 emit logItem(tr("successfully created."),LOGOK);
244 244
245 emit done(false); 245 emit done(false);
246} 246}
247 247
diff --git a/rbutil/rbutilqt/base/voicefile.h b/rbutil/rbutilqt/base/voicefile.h
index 9296dbebdf..82698bfbde 100644
--- a/rbutil/rbutilqt/base/voicefile.h
+++ b/rbutil/rbutilqt/base/voicefile.h
@@ -64,6 +64,7 @@ private:
64 QString m_path; //path where the wav and mp3 files are stored to 64 QString m_path; //path where the wav and mp3 files are stored to
65 int m_targetid; //the target id 65 int m_targetid; //the target id
66 QString m_lang; // the language which will be spoken 66 QString m_lang; // the language which will be spoken
67 QString m_versionstring; // version string to be used for logging
67 int m_wavtrimThreshold; 68 int m_wavtrimThreshold;
68 69
69 bool m_abort; 70 bool m_abort;