1 /*
2  * Cantata
3  *
4  * Copyright (c) 2011-2020 Craig Drummond <craig.p.drummond@gmail.com>
5  *
6  * ----
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; see the file COPYING.  If not, write to
20  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21  * Boston, MA 02110-1301, USA.
22  */
23 
24 #ifndef UMSDEVICE_H
25 #define UMSDEVICE_H
26 
27 #include "fsdevice.h"
28 #include "solid-lite/storageaccess.h"
29 
30 class UmsDevice : public FsDevice
31 {
32     Q_OBJECT
33 
34 public:
35     UmsDevice(MusicLibraryModel *m, Solid::Device &dev);
36     ~UmsDevice() override;
37 
38     void connectionStateChanged() override;
39     void toggle() override;
40     bool isConnected() const override;
41     double usedCapacity() override;
42     QString capacityString() override;
43     qint64 freeSpace() override;
devType()44     DevType devType() const override { return Ums; }
45     void saveOptions() override;
46     void configure(QWidget *parent) override;
supportsDisconnect()47     bool supportsDisconnect() const override { return true; }
48 
49 private:
50     void setup();
51 
52 private Q_SLOTS:
53     void saveProperties();
54     void saveProperties(const QString &newPath, const DeviceOptions &opts);
55 
56 private:
57     QString defaultName;
58     Solid::StorageAccess *access;
59     QStringList unusedParams;
60 };
61 
62 #endif
63