summaryrefslogtreecommitdiffstats
path: root/rbutil/rbutilqt/base/autodetection.h
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2013-04-06 21:15:05 +0200
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2013-04-09 22:39:13 +0200
commite30b3d84e8d744098df13617fceed562bcdb8462 (patch)
tree707d86f86098b287de15e586dc4fb6d11f27127a /rbutil/rbutilqt/base/autodetection.h
parente6c0bd035046e6b97f408fcff14879a2fba6c9e6 (diff)
downloadrockbox-e30b3d84e8d744098df13617fceed562bcdb8462.tar.gz
rockbox-e30b3d84e8d744098df13617fceed562bcdb8462.tar.bz2
rockbox-e30b3d84e8d744098df13617fceed562bcdb8462.zip
Change autodetection result to a list.
Both autodetection functionality and the configuration dialog assumed detection to only return one found device. This isn't necessarily true, especially since some players can be detected but detecting their mountpoint might be ambiguous (only if no previous Rockbox installation is present). Instead of returning individual results (found "ok" player, found "error" player etc.) return a list containing an entry for each player. Current autodetection code will never return more than one entry since it doesn't handle multiple devices yet, and the configuration dialog will show an error if multiple devices are found. Thus there is no user visible change yet. Both autodetection and configuration dialog can now get extended to handle multiple devices. Change-Id: I79b763dbd6e7111783194bcc22ab7cc06a4061c1
Diffstat (limited to 'rbutil/rbutilqt/base/autodetection.h')
-rw-r--r--rbutil/rbutilqt/base/autodetection.h21
1 files changed, 17 insertions, 4 deletions
diff --git a/rbutil/rbutilqt/base/autodetection.h b/rbutil/rbutilqt/base/autodetection.h
index 1543aef766..65a24abb8f 100644
--- a/rbutil/rbutilqt/base/autodetection.h
+++ b/rbutil/rbutilqt/base/autodetection.h
@@ -33,21 +33,34 @@ class Autodetection :public QObject
public:
Autodetection(QObject* parent=0);
+ enum PlayerStatus {
+ PlayerOk,
+ PlayerIncompatible,
+ PlayerMtpMode,
+ PlayerWrongFilesystem,
+ PlayerError,
+ };
+
+ struct Detected {
+ QString device;
+ QString mountpoint;
+ enum PlayerStatus status;
+ };
+
bool detect();
- QString getDevice() {return m_device;}
- QString getMountPoint() {return m_mountpoint;}
- QString errdev(void) { return m_errdev; }
- QString incompatdev(void) { return m_incompat; }
+ QList<struct Detected> detected(void);
private:
QString resolveMountPoint(QString);
bool detectUsb(void);
bool detectAjbrec(QString);
+ QList<struct Detected> m_detected;
QString m_device;
QString m_mountpoint;
QString m_errdev;
+ QString m_usberr;
QString m_incompat;
QList<int> m_usbconid;
};