summaryrefslogtreecommitdiffstats
path: root/rbutil/rbutilqt/base
diff options
context:
space:
mode:
authorDominik Wenger <domonoky@googlemail.com>2009-10-13 20:51:20 +0000
committerDominik Wenger <domonoky@googlemail.com>2009-10-13 20:51:20 +0000
commit11bd80cd3849e71358e0efabfa5149e6ce7dc462 (patch)
tree88019c54b609b693d38c8f0b69cbf688a7cb5bb9 /rbutil/rbutilqt/base
parente3bd45ef81a963ee4b893e72c1a65c554e1c1d3b (diff)
downloadrockbox-11bd80cd3849e71358e0efabfa5149e6ce7dc462.tar.gz
rockbox-11bd80cd3849e71358e0efabfa5149e6ce7dc462.tar.bz2
rockbox-11bd80cd3849e71358e0efabfa5149e6ce7dc462.zip
rbutil: rework and rename the "dont overwrite talkfiles" option so it really generates only new Talkfiles.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23162 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil/rbutilqt/base')
-rw-r--r--rbutil/rbutilqt/base/talkfile.cpp17
-rw-r--r--rbutil/rbutilqt/base/talkfile.h4
2 files changed, 17 insertions, 4 deletions
diff --git a/rbutil/rbutilqt/base/talkfile.cpp b/rbutil/rbutilqt/base/talkfile.cpp
index bc3f5f965d..a069f3aa78 100644
--- a/rbutil/rbutilqt/base/talkfile.cpp
+++ b/rbutil/rbutilqt/base/talkfile.cpp
@@ -140,6 +140,13 @@ bool TalkFileCreator::createTalkList(QDir startDir)
// insert into List
if(!dir.dirName().isEmpty() && m_talkFolders)
{
+ // check if we should ignore it
+ if(m_generateOnlyNew && QFileInfo(dir.path() + "/_dirname.talk").exists())
+ {
+ continue;
+ }
+
+ //generate entry
TalkGenerator::TalkEntry entry;
entry.toSpeak = dir.dirName();
entry.wavfilename = QDir::tempPath()+ "/talkfiles/" + QCryptographicHash::hash(entry.toSpeak.toUtf8(),
@@ -150,7 +157,7 @@ bool TalkFileCreator::createTalkList(QDir startDir)
entry.voiced = false;
entry.encoded = false;
qDebug() << "toSpeak: " << entry.toSpeak << " target: " << entry.target << " intermediates: " <<
- entry.wavfilename << entry.talkfilename;
+ entry.wavfilename << entry.talkfilename;
m_talkList.append(entry);
}
}
@@ -171,6 +178,12 @@ bool TalkFileCreator::createTalkList(QDir startDir)
if(match)
continue;
+ // check if we should ignore it
+ if(m_generateOnlyNew && QFileInfo(fileInf.path() + "/" + fileInf.fileName() + ".talk").exists())
+ {
+ continue;
+ }
+
//generate entry
TalkGenerator::TalkEntry entry;
if(m_stripExtensions)
@@ -223,7 +236,7 @@ bool TalkFileCreator::copyTalkFiles(QString* errString)
continue; // this file was skipped in one of the previous steps
}
// remove target if it exists, and if we should overwrite it
- if(m_overwriteTalk && QFile::exists(m_talkList[i].target))
+ if(QFile::exists(m_talkList[i].target))
QFile::remove(m_talkList[i].target);
// copying
diff --git a/rbutil/rbutilqt/base/talkfile.h b/rbutil/rbutilqt/base/talkfile.h
index 9c596934ab..b7b4c5b5a1 100644
--- a/rbutil/rbutilqt/base/talkfile.h
+++ b/rbutil/rbutilqt/base/talkfile.h
@@ -40,7 +40,7 @@ public:
void setDir(QDir dir){m_dir = dir; }
void setMountPoint(QString mountpoint) {m_mountpoint =mountpoint; }
- void setOverwriteTalk(bool ov) {m_overwriteTalk = ov;}
+ void setGenerateOnlyNew(bool ov) {m_generateOnlyNew = ov;}
void setRecursive(bool ov) {m_recursive = ov;}
void setStripExtensions(bool ov) {m_stripExtensions = ov;}
void setTalkFolders(bool ov) {m_talkFolders = ov;}
@@ -67,7 +67,7 @@ private:
QDir m_dir;
QString m_mountpoint;
- bool m_overwriteTalk;
+ bool m_generateOnlyNew;
bool m_recursive;
bool m_stripExtensions;
bool m_talkFolders;