1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
9 * Copyright (C) 2007 by Dominik Wenger
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
18 ****************************************************************************/
20 #include "rockboxinfo.h"
25 RockboxInfo::RockboxInfo(QString mountpoint
)
27 qDebug() << "[RockboxInfo] trying to find rockbox-info at" << mountpoint
;
28 QFile
file(mountpoint
+ "/.rockbox/rockbox-info.txt");
33 if(!file
.open(QIODevice::ReadOnly
| QIODevice::Text
))
39 QString line
= file
.readLine();
41 if(line
.contains("Version:"))
43 m_version
= line
.remove("Version:").trimmed();
44 if(m_version
.startsWith("r")) {
45 m_revision
= m_version
;
46 m_revision
.remove("r").replace(QRegExp("-.+$"), "");
50 m_release
= m_version
;
54 else if(line
.contains("Target: "))
56 m_target
= line
.remove("Target: ").trimmed();
58 else if(line
.contains("Features:"))
60 m_features
= line
.remove("Features:").trimmed();
62 else if(line
.contains("Target id:"))
64 m_targetid
= line
.remove("Target id:").trimmed();
66 else if(line
.contains("Memory:"))
68 m_ram
= line
.remove("Memory:").trimmed().toInt();