summaryrefslogtreecommitdiffstats
path: root/rbutil/rbutilqt/base/utils.cpp
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2009-08-10 19:20:53 +0000
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2009-08-10 19:20:53 +0000
commit84ced00bbd1b86585de508176fa63f09a2faf79b (patch)
tree4f000e70d6b487b102186be58bb2b0414280adb1 /rbutil/rbutilqt/base/utils.cpp
parentad7dab615f668274bc35fca5375d1d2facf4f1b8 (diff)
downloadrockbox-84ced00bbd1b86585de508176fa63f09a2faf79b.tar.gz
rockbox-84ced00bbd1b86585de508176fa63f09a2faf79b.tar.bz2
rockbox-84ced00bbd1b86585de508176fa63f09a2faf79b.zip
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
Diffstat (limited to 'rbutil/rbutilqt/base/utils.cpp')
-rw-r--r--rbutil/rbutilqt/base/utils.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/rbutil/rbutilqt/base/utils.cpp b/rbutil/rbutilqt/base/utils.cpp
index 966ce335ea..a1b6e2bd0e 100644
--- a/rbutil/rbutilqt/base/utils.cpp
+++ b/rbutil/rbutilqt/base/utils.cpp
@@ -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;
}
+