| 3 | #include <QUuid> |
| 4 | |
| 5 | QString GetDeviceId::getDeviceId() |
| 6 | { |
| 7 | QMutexLocker locker(&mutex_); |
| 8 | |
| 9 | QSettings s; |
| 10 | if (s.contains("deviceId")) |
| 11 | { |
| 12 | return s.value("deviceId").toString(); |
| 13 | } |
| 14 | else |
| 15 | { |
| 16 | QUuid id = QUuid::createUuid(); |
| 17 | QString strId = id.toString(); |
| 18 | strId = strId.remove(0, 1); |
| 19 | strId = strId.remove(strId.length() - 1, 1); |
| 20 | s.setValue("deviceId", strId); |
| 21 | return strId; |
| 22 | } |
| 23 | } |
| 24 | |
| 25 | GetDeviceId::GetDeviceId() |
| 26 | { |