forked from len0rd/rockbox
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
This commit is contained in:
parent
968448c9cd
commit
6de59442a5
2 changed files with 9 additions and 8 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue