mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-14 02:27:39 -04:00
Correctly construct the path for talkfile generation.
While TalkFileCreator uses the current mountpoint for writing logging information it does not use it for constructing the correct path to generate talkfiles for. Since there is not much point in generating talkfiles for files that are not on the player (and the UI limits the paths that can get selected to folders on the player) make TalkFileCreator use the mountpoint for creating correct paths. Fixes FS#12748. Change-Id: Id682a3738649e4167556255599553edc6e2acd48
This commit is contained in:
parent
a46e0b02c1
commit
05caadbca3
3 changed files with 20 additions and 16 deletions
|
@ -33,13 +33,13 @@ bool TalkFileCreator::createTalkFiles()
|
|||
QString errStr;
|
||||
|
||||
emit logItem(tr("Starting Talk file generation for folder %1")
|
||||
.arg(m_dir.dirName()), LOGINFO);
|
||||
.arg(m_dir), LOGINFO);
|
||||
emit logProgress(0,0);
|
||||
QCoreApplication::processEvents();
|
||||
|
||||
// read in Maps of paths - file/dirnames
|
||||
emit logItem(tr("Reading Filelist..."),LOGINFO);
|
||||
if(createTalkList(m_dir) == false)
|
||||
if(createTalkList(m_mountpoint + "/" + m_dir) == false)
|
||||
{
|
||||
emit logItem(tr("Talk file creation aborted"),LOGERROR);
|
||||
doAbort();
|
||||
|
@ -109,6 +109,7 @@ void TalkFileCreator::doAbort()
|
|||
//! \param startDir The directory from which to start scanning
|
||||
bool TalkFileCreator::createTalkList(QDir startDir)
|
||||
{
|
||||
qDebug() << "[TalkGenerator] generating list of files" << startDir;
|
||||
m_talkList.clear();
|
||||
|
||||
// create Iterator
|
||||
|
@ -213,6 +214,7 @@ bool TalkFileCreator::createTalkList(QDir startDir)
|
|||
}
|
||||
QCoreApplication::processEvents();
|
||||
}
|
||||
qDebug() << "[TalkFileCreator] list created, entries:" << m_talkList.size();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -36,15 +36,15 @@ public:
|
|||
|
||||
bool createTalkFiles();
|
||||
|
||||
void setDir(QDir dir){m_dir = dir; }
|
||||
void setMountPoint(QString mountpoint) {m_mountpoint =mountpoint; }
|
||||
void setDir(QString dir) {m_dir = dir;}
|
||||
void setMountPoint(QString mountpoint) {m_mountpoint = mountpoint;}
|
||||
|
||||
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;}
|
||||
void setTalkFiles(bool ov) {m_talkFiles = ov;}
|
||||
void setIgnoreFiles(QStringList wildcards) {m_ignoreFiles=wildcards;}
|
||||
void setIgnoreFiles(QStringList wildcards) {m_ignoreFiles = wildcards;}
|
||||
public slots:
|
||||
void abort();
|
||||
|
||||
|
@ -63,7 +63,7 @@ private:
|
|||
|
||||
bool createTalkList(QDir startDir);
|
||||
|
||||
QDir m_dir;
|
||||
QString m_dir;
|
||||
QString m_mountpoint;
|
||||
|
||||
bool m_generateOnlyNew;
|
||||
|
|
|
@ -111,7 +111,9 @@ void InstallTalkWindow::accept()
|
|||
QStringList foldersToTalk
|
||||
= RbSettings::value(RbSettings::TalkFolders).toStringList();
|
||||
for(int i = 0; i < foldersToTalk.size(); i++) {
|
||||
talkcreator->setDir(QDir(foldersToTalk.at(i)));
|
||||
qDebug() << "[InstallTalkWindow] creating talk files for folder"
|
||||
<< foldersToTalk.at(i);
|
||||
talkcreator->setDir(foldersToTalk.at(i));
|
||||
talkcreator->createTalkFiles();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue