blob: 1fbe47f9a79912e903771ce2d3fc1eacf91c1677 [file] [log] [blame]
Dominik Wenger421411b2007-08-05 19:48:04 +00001/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 *
9 * Copyright (C) 2007 by Dominik Wenger
Dominik Riebeling1dc307a2007-08-23 22:11:50 +000010 * $Id$
Dominik Wenger421411b2007-08-05 19:48:04 +000011 *
Daniel Stenberg2acc0ac2008-06-28 18:10:04 +000012 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
Dominik Wenger421411b2007-08-05 19:48:04 +000016 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22
23#ifndef AUTODETECTION_H_
24#define AUTODETECTION_H_
25
Dominik Riebelingee09cb72008-02-10 18:25:49 +000026#include <QtCore>
Dominik Wenger13638812008-04-03 20:05:13 +000027#include "rbsettings.h"
Dominik Wenger421411b2007-08-05 19:48:04 +000028
Dominik Riebeling1152a122007-08-23 15:24:28 +000029#include "../ipodpatcher/ipodpatcher.h"
30#include "../sansapatcher/sansapatcher.h"
Dominik Riebeling1152a122007-08-23 15:24:28 +000031
Dominik Wenger421411b2007-08-05 19:48:04 +000032class Autodetection :public QObject
33{
34 Q_OBJECT
35
36public:
37 Autodetection(QObject* parent=0);
Dominik Riebeling3f65a702008-05-22 17:51:35 +000038
Dominik Wenger13638812008-04-03 20:05:13 +000039 void setSettings(RbSettings* sett) {settings = sett;}
Dominik Riebeling3f65a702008-05-22 17:51:35 +000040
Dominik Wenger421411b2007-08-05 19:48:04 +000041 bool detect();
Antoine Cellerier1464c9b2007-09-15 22:57:07 +000042
Dominik Wenger421411b2007-08-05 19:48:04 +000043 QString getDevice() {return m_device;}
44 QString getMountPoint() {return m_mountpoint;}
Dominik Riebelingfc252662007-09-14 20:52:38 +000045 QString errdev(void) { return m_errdev; }
Dominik Riebeling229c64b2008-04-05 21:48:54 +000046 QString incompatdev(void) { return m_incompat; }
Dominik Wenger421411b2007-08-05 19:48:04 +000047
48private:
Dominik Riebeling1152a122007-08-23 15:24:28 +000049 QStringList getMountpoints(void);
50 QString resolveMountPoint(QString);
Dominik Riebelingfc252662007-09-14 20:52:38 +000051 bool detectUsb(void);
Dominik Riebelingddbb7512007-09-27 08:50:47 +000052 bool detectAjbrec(QString);
Antoine Cellerier1464c9b2007-09-15 22:57:07 +000053
Dominik Wenger421411b2007-08-05 19:48:04 +000054 QString m_device;
55 QString m_mountpoint;
Dominik Riebelingfc252662007-09-14 20:52:38 +000056 QString m_errdev;
Dominik Riebeling229c64b2008-04-05 21:48:54 +000057 QString m_incompat;
Dominik Riebelingddbb7512007-09-27 08:50:47 +000058 QList<int> m_usbconid;
Dominik Wenger13638812008-04-03 20:05:13 +000059 RbSettings* settings;
Dominik Wenger421411b2007-08-05 19:48:04 +000060};
61
62
63#endif /*AUTODETECTION_H_*/