1
0
Fork 0
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:
Dominik Riebeling 2012-05-23 22:48:09 +02:00
parent 968448c9cd
commit 6de59442a5
2 changed files with 9 additions and 8 deletions

View file

@ -59,13 +59,13 @@ bool VoiceFileCreator::createVoiceFile()
QString features = info.features(); QString features = info.features();
QString version = info.version(); QString version = info.version();
m_targetid = info.targetID().toInt(); m_targetid = info.targetID().toInt();
version = version.left(version.indexOf("-")).remove("r"); m_versionstring = version.left(version.indexOf("-")).remove("r");
//prepare download url //prepare download url
QString genlang = SystemInfo::value(SystemInfo::GenlangUrl).toString(); QString genlang = SystemInfo::value(SystemInfo::GenlangUrl).toString();
genlang.replace("%LANG%", m_lang); genlang.replace("%LANG%", m_lang);
genlang.replace("%TARGET%", target); genlang.replace("%TARGET%", target);
genlang.replace("%REVISION%", version); genlang.replace("%REVISION%", m_versionstring);
genlang.replace("%FEATURES%", features); genlang.replace("%FEATURES%", features);
QUrl genlangUrl(genlang); QUrl genlangUrl(genlang);
qDebug() << "[VoiceFileCreator] downloading " << genlangUrl; qDebug() << "[VoiceFileCreator] downloading " << genlangUrl;
@ -95,7 +95,8 @@ void VoiceFileCreator::downloadDone(bool error)
// update progress bar // update progress bar
emit logProgress(1,1); emit logProgress(1,1);
if(getter->httpResponse() != 200 && !getter->isCached()) { 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); emit done(true);
return; return;
} }
@ -233,9 +234,8 @@ void VoiceFileCreator::downloadDone(bool error)
// Add Voice file to the install log // Add Voice file to the install log
QSettings installlog(m_mountpoint + "/.rockbox/rbutil.log", QSettings::IniFormat, 0); QSettings installlog(m_mountpoint + "/.rockbox/rbutil.log", QSettings::IniFormat, 0);
installlog.beginGroup("selfcreated Voice"); installlog.beginGroup(QString("Voice (self created, %1)").arg(m_lang));
installlog.setValue("/.rockbox/langs/" + m_lang + ".voice", installlog.setValue("/.rockbox/langs/" + m_lang + ".voice", m_versionstring);
QDate::currentDate().toString("yyyyMMdd"));
installlog.endGroup(); installlog.endGroup();
installlog.sync(); installlog.sync();

View file

@ -64,6 +64,7 @@ private:
QString m_path; //path where the wav and mp3 files are stored to QString m_path; //path where the wav and mp3 files are stored to
int m_targetid; //the target id int m_targetid; //the target id
QString m_lang; // the language which will be spoken QString m_lang; // the language which will be spoken
QString m_versionstring; // version string to be used for logging
int m_wavtrimThreshold; int m_wavtrimThreshold;
bool m_abort; bool m_abort;