forked from len0rd/rockbox
rbutil: completely rework how tts and encoders are configured. (FS#10070)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20824 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
3d2e42ab4c
commit
5b85ef6006
27 changed files with 1274 additions and 2029 deletions
|
|
@ -130,6 +130,35 @@ qulonglong filesystemFree(QString path)
|
|||
return size;
|
||||
}
|
||||
|
||||
//! \brief searches for a Executable in the Environement Path
|
||||
QString findExecutable(QString name)
|
||||
{
|
||||
QString exepath;
|
||||
//try autodetect tts
|
||||
#if defined(Q_OS_LINUX) || defined(Q_OS_MACX) || defined(Q_OS_OPENBSD)
|
||||
QStringList path = QString(getenv("PATH")).split(":", QString::SkipEmptyParts);
|
||||
#elif defined(Q_OS_WIN)
|
||||
QStringList path = QString(getenv("PATH")).split(";", QString::SkipEmptyParts);
|
||||
#endif
|
||||
qDebug() << path;
|
||||
for(int i = 0; i < path.size(); i++)
|
||||
{
|
||||
QString executable = QDir::fromNativeSeparators(path.at(i)) + "/" + name;
|
||||
#if defined(Q_OS_WIN)
|
||||
executable += ".exe";
|
||||
QStringList ex = executable.split("\"", QString::SkipEmptyParts);
|
||||
executable = ex.join("");
|
||||
#endif
|
||||
qDebug() << executable;
|
||||
if(QFileInfo(executable).isExecutable())
|
||||
{
|
||||
return QDir::toNativeSeparators(executable);
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
RockboxInfo::RockboxInfo(QString mountpoint)
|
||||
{
|
||||
m_path = mountpoint +"/.rockbox/rockbox-info.txt";
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@
|
|||
bool recRmdir( const QString &dirName );
|
||||
QString resolvePathCase(QString path);
|
||||
qulonglong filesystemFree(QString path);
|
||||
QString findExecutable(QString name);
|
||||
|
||||
class RockboxInfo
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue