diff options
| author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2012-05-23 22:48:09 +0200 |
|---|---|---|
| committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2012-05-23 22:48:09 +0200 |
| commit | 6de59442a50f840686baad96c68d6e215299b0d4 (patch) | |
| tree | 34cb205da9cfc107108bf951a6bca11dabfc5991 | |
| parent | 968448c9cdd2583225cff015b43aeeb9d1c304da (diff) | |
| download | rockbox-6de59442a50f840686baad96c68d6e215299b0d4.zip rockbox-6de59442a50f840686baad96c68d6e215299b0d4.tar.gz rockbox-6de59442a50f840686baad96c68d6e215299b0d4.tar.bz2 rockbox-6de59442a50f840686baad96c68d6e215299b0d4.tar.xz | |
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.cpp | 16 | ||||
| -rw-r--r-- | rbutil/rbutilqt/base/voicefile.h | 1 |
2 files changed, 9 insertions, 8 deletions
diff --git a/rbutil/rbutilqt/base/voicefile.cpp b/rbutil/rbutilqt/base/voicefile.cpp index cb9130c..871dd28 100644 --- a/rbutil/rbutilqt/base/voicefile.cpp +++ b/rbutil/rbutilqt/base/voicefile.cpp @@ -59,13 +59,13 @@ bool VoiceFileCreator::createVoiceFile() QString features = info.features(); QString version = info.version(); m_targetid = info.targetID().toInt(); - version = version.left(version.indexOf("-")).remove("r"); - + m_versionstring = version.left(version.indexOf("-")).remove("r"); + //prepare download url QString genlang = SystemInfo::value(SystemInfo::GenlangUrl).toString(); genlang.replace("%LANG%", m_lang); genlang.replace("%TARGET%", target); - genlang.replace("%REVISION%", version); + genlang.replace("%REVISION%", m_versionstring); genlang.replace("%FEATURES%", features); QUrl genlangUrl(genlang); qDebug() << "[VoiceFileCreator] downloading " << genlangUrl; @@ -95,7 +95,8 @@ void VoiceFileCreator::downloadDone(bool error) // update progress bar emit logProgress(1,1); if(getter->httpResponse() != 200 && !getter->isCached()) { - emit logItem(tr("Download error: received HTTP error %1.").arg(getter->httpResponse()),LOGERROR); + emit logItem(tr("Download error: received HTTP error %1.") + .arg(getter->httpResponse()),LOGERROR); emit done(true); return; } @@ -233,15 +234,14 @@ void VoiceFileCreator::downloadDone(bool error) // Add Voice file to the install log QSettings installlog(m_mountpoint + "/.rockbox/rbutil.log", QSettings::IniFormat, 0); - installlog.beginGroup("selfcreated Voice"); - installlog.setValue("/.rockbox/langs/" + m_lang + ".voice", - QDate::currentDate().toString("yyyyMMdd")); + installlog.beginGroup(QString("Voice (self created, %1)").arg(m_lang)); + installlog.setValue("/.rockbox/langs/" + m_lang + ".voice", m_versionstring); installlog.endGroup(); installlog.sync(); emit logProgress(1,1); emit logItem(tr("successfully created."),LOGOK); - + emit done(false); } diff --git a/rbutil/rbutilqt/base/voicefile.h b/rbutil/rbutilqt/base/voicefile.h index 9296dbe..82698bf 100644 --- a/rbutil/rbutilqt/base/voicefile.h +++ b/rbutil/rbutilqt/base/voicefile.h @@ -64,6 +64,7 @@ private: QString m_path; //path where the wav and mp3 files are stored to int m_targetid; //the target id QString m_lang; // the language which will be spoken + QString m_versionstring; // version string to be used for logging int m_wavtrimThreshold; bool m_abort; |