forked from len0rd/rockbox
Simplify and cleanup rockbox-info.txt handling.
Simplify RockboxInfo file handling. Remove Detect::installedVersion() and Detect::installedTarget(), as those became wrappers around RockboxInfo without functionality. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22237 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
ad7dab615f
commit
84ced00bbd
8 changed files with 23 additions and 53 deletions
|
@ -161,17 +161,14 @@ QString findExecutable(QString name)
|
|||
|
||||
RockboxInfo::RockboxInfo(QString mountpoint)
|
||||
{
|
||||
m_path = mountpoint +"/.rockbox/rockbox-info.txt";
|
||||
}
|
||||
|
||||
bool RockboxInfo::open()
|
||||
{
|
||||
QFile file(m_path);
|
||||
qDebug() << "[RockboxInfo] trying to find rockbox-info at" << mountpoint;
|
||||
QFile file(mountpoint + "/.rockbox/rockbox-info.txt");
|
||||
m_success = false;
|
||||
if(!file.exists())
|
||||
return false;
|
||||
return;
|
||||
|
||||
if(!file.open(QIODevice::ReadOnly | QIODevice::Text))
|
||||
return false;
|
||||
return;
|
||||
|
||||
// read file contents
|
||||
while (!file.atEnd())
|
||||
|
@ -195,7 +192,9 @@ bool RockboxInfo::open()
|
|||
m_targetid = line.remove("Target id:").trimmed();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
file.close();
|
||||
return true;
|
||||
m_success = true;
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue