DeviceWatcher.cpp 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569
  1. #include "DeviceWatcher.h"
  2. #include "DiskScanner/DiskScanner.h"
  3. #include "DiskDetach/DiskDetach.h"
  4. #include "RunnableThread.h"
  5. #include <QDebug>
  6. //#include "Detach.h"
  7. #include <QDir>
  8. #include <QRegExp>
  9. #include <sys/stat.h>
  10. #include <stdio.h>
  11. #include <stdlib.h>
  12. #include <string.h>
  13. #include <strings.h>
  14. #include <ctype.h>
  15. #include <sys/un.h>
  16. #include <sys/ioctl.h>
  17. #include <sys/socket.h>
  18. #include <linux/types.h>
  19. #include <linux/netlink.h>
  20. #include <errno.h>
  21. #include <unistd.h>
  22. #include <arpa/inet.h>
  23. #include <netinet/in.h>
  24. #include <sys/prctl.h>
  25. #include <sys/mount.h>
  26. #include <pthread.h>
  27. #include <stdbool.h>
  28. #include<unistd.h>
  29. #include<fcntl.h>
  30. #include <sys/mman.h>
  31. #include <sys/types.h>
  32. #include <QTimer>
  33. #ifdef ENABLE_ARKN141_CAMERA
  34. #include "libusb.h"
  35. #endif
  36. #define USB_MOUNT_POINT "/media/udisk"
  37. #define USB_MOUNT_DATA "fmask=0133,utf8,errors=continue"
  38. #define USB_MOUNT_FLAG (MS_NODEV | MS_NOSUID | MS_DIRSYNC)
  39. #define USB_MOUNT_FORMAT "vfat"
  40. #define USB_MOUNT_FORMAT_EXFAT "-t exfat"
  41. #define SD_MOUNT_POINT "/media/sdisk"
  42. #define SD_MOUNT_FROMAT "vfat"
  43. #define SD_MOUNT_FROMAT_EXFAT "-t exfat"
  44. #define SD_MOUNT_FLAG (MS_NODEV | MS_NOSUID | MS_DIRSYNC)
  45. #define SD_MOUNT_DATA "fmask=0133,utf8,errors=continue"
  46. static const QString mountUSBPath("/media/udisk");
  47. static const QString mountSDPath("/media/sdisk");
  48. class DeviceWatcherPrivate
  49. {
  50. Q_DISABLE_COPY(DeviceWatcherPrivate)
  51. public:
  52. explicit DeviceWatcherPrivate(DeviceWatcher *parent);
  53. ~DeviceWatcherPrivate();
  54. void initialize();
  55. void connectAllSlots();
  56. void diskDeviceAdd(const QString &path);
  57. void diskDeviceRemove(const QString &path);
  58. void usbDiskScan(const QString &path);
  59. void usbDiskCancelScan(const QString &path);
  60. void sdDiskScan(const QString &path);
  61. void sdDiskCancelScan(const QString &path);
  62. bool regExpUSBPath(const QString& path);
  63. bool regExpSDPath(const QString& path);
  64. bool usbSpecialDeviceDetach(const QString &device, const DiskDeviceWatcher::Action action);
  65. #ifdef ENABLE_ARKN141_CAMERA
  66. int usbArkn141CameraDetach(const QString &path);
  67. #endif
  68. bool m_UsbSpecialDeviceDetach;
  69. DiskScanner* m_USBDiskScanner;
  70. DiskScanner* m_SDDiskScanner;
  71. DiskDetach* m_DiskDetach;
  72. QString m_USBDiskPath;
  73. QString m_SDDiskPath;
  74. DeviceWatcherStatus m_USBDiskStatus;
  75. DeviceWatcherStatus m_SDDiskStatus;
  76. bool m_InitDetach;
  77. private:
  78. DeviceWatcher* m_Parent;
  79. };
  80. DeviceWatcher::DeviceWatcher(QObject *parent)
  81. : QObject(parent)
  82. , m_Private(new DeviceWatcherPrivate(this))
  83. {
  84. }
  85. DeviceWatcher::~DeviceWatcher()
  86. {
  87. }
  88. void DeviceWatcher::onDiskDeviceChangeHandler(const QString &device, const DiskDeviceWatcher::Action action)
  89. {
  90. m_Private->m_DiskDetach->onDiskDeviceChange(device, action);
  91. }
  92. void DeviceWatcher::synchronize()
  93. {
  94. deviceWatcherCheckStatus(DWT_SDDisk);
  95. deviceWatcherCheckStatus(DWT_USBDisk);
  96. }
  97. void DeviceWatcher::deviceWatcherCheckStatus(const int type)
  98. {
  99. switch (type) {
  100. case DWT_SDDisk: {
  101. emit onDeviceWatcherStatus(DWT_SDDisk, m_Private->m_SDDiskStatus);
  102. break;
  103. }
  104. case DWT_USBDisk: {
  105. emit onDeviceWatcherStatus(DWT_USBDisk, m_Private->m_USBDiskStatus);
  106. break;
  107. }
  108. default: {
  109. break;
  110. }
  111. }
  112. }
  113. void DeviceWatcher::timerEvent(QTimerEvent *event)
  114. {
  115. killTimer(event->timerId());
  116. QDir dir("/dev/");
  117. dir.setFilter(QDir::System | QDir::NoDotAndDotDot);
  118. QFileInfoList fileInfoList = dir.entryInfoList();
  119. bool sdExsits(false);
  120. bool usbExists(false);
  121. for (QFileInfoList::iterator fileIter = fileInfoList.begin(); fileIter != fileInfoList.end(); ++fileIter) {
  122. if ((!sdExsits) && (m_Private->regExpSDPath(fileIter->filePath()))) {
  123. sdExsits = true;
  124. onDiskDeviceChangeHandler(fileIter->filePath(), DiskDeviceWatcher::A_Add);
  125. } else if ((!usbExists) && (m_Private->regExpUSBPath(fileIter->filePath()))) {
  126. usbExists = true;
  127. if (0 == QString(qgetenv("PROTOCOL_ID")).compare(QString("yaoxi"))) {
  128. system("echo otg > /sys/devices/platform/musb-ark1680.1/musb-hdrc.1/mode");
  129. } else {
  130. onDiskDeviceChangeHandler(fileIter->filePath(), DiskDeviceWatcher::A_Add);
  131. }
  132. } else if (sdExsits && usbExists) {
  133. break;
  134. }
  135. }
  136. //}
  137. QObject::timerEvent(event);
  138. }
  139. DeviceWatcherPrivate::DeviceWatcherPrivate(DeviceWatcher *parent)
  140. : m_Parent(parent)
  141. {
  142. m_USBDiskScanner = NULL;
  143. m_SDDiskScanner = NULL;
  144. m_DiskDetach = NULL;
  145. m_USBDiskStatus = DWS_Empty;
  146. m_SDDiskStatus = DWS_Empty;
  147. //m_InitDetach = false;
  148. m_UsbSpecialDeviceDetach = false;
  149. initialize();
  150. connectAllSlots();
  151. m_Parent->startTimer(0);
  152. }
  153. DeviceWatcherPrivate::~DeviceWatcherPrivate()
  154. {
  155. // if (m_InitDetach) {
  156. // uninitDetach();
  157. // m_InitDetach = false;
  158. // }
  159. }
  160. void DeviceWatcherPrivate::initialize()
  161. {
  162. QStringList m_MusicSuffix;
  163. m_MusicSuffix.clear();
  164. m_MusicSuffix.append(QString(".MP2"));
  165. m_MusicSuffix.append(QString(".MP3"));
  166. m_MusicSuffix.append(QString(".WMA"));
  167. m_MusicSuffix.append(QString(".M4A"));
  168. m_MusicSuffix.append(QString(".M4R"));
  169. m_MusicSuffix.append(QString(".MMF"));
  170. m_MusicSuffix.append(QString(".FLAC"));
  171. m_MusicSuffix.append(QString(".APE"));
  172. m_MusicSuffix.append(QString(".OGG"));
  173. m_MusicSuffix.append(QString(".AC3"));
  174. m_MusicSuffix.append(QString(".AAC"));
  175. m_MusicSuffix.append(QString(".WAV"));
  176. m_MusicSuffix.append(QString(".AMR"));
  177. m_MusicSuffix.append(QString(".RA"));
  178. m_MusicSuffix.append(QString(".AU"));
  179. m_MusicSuffix.append(QString(".MMF"));
  180. // m_MusicSuffix.append(QString(".AIFF"));
  181. QStringList m_ImageSuffix;
  182. m_ImageSuffix.clear();
  183. m_ImageSuffix.append(QString(".JPG"));
  184. m_ImageSuffix.append(QString(".BMP"));
  185. m_ImageSuffix.append(QString(".JPEG"));
  186. m_ImageSuffix.append(QString(".PNG"));
  187. m_ImageSuffix.append(QString(".GIF"));
  188. m_ImageSuffix.append(QString(".TIF"));
  189. m_ImageSuffix.append(QString(".TIFF"));
  190. m_ImageSuffix.append(QString(".PCX"));
  191. m_ImageSuffix.append(QString(".ICO"));
  192. QStringList m_VideoSuffix;
  193. m_VideoSuffix.clear();
  194. m_VideoSuffix.append(QString(".AVI"));
  195. m_VideoSuffix.append(QString(".MP4"));
  196. m_VideoSuffix.append(QString(".MPG"));
  197. m_VideoSuffix.append(QString(".M4V"));
  198. m_VideoSuffix.append(QString(".MKV"));
  199. m_VideoSuffix.append(QString(".3GP"));
  200. m_VideoSuffix.append(QString(".ASF"));
  201. m_VideoSuffix.append(QString(".MOV"));
  202. m_VideoSuffix.append(QString(".MPEG"));
  203. m_VideoSuffix.append(QString(".VOB"));
  204. m_VideoSuffix.append(QString(".TS"));
  205. m_VideoSuffix.append(QString(".WMV"));
  206. m_VideoSuffix.append(QString(".RM"));
  207. m_VideoSuffix.append(QString(".RMVB"));
  208. m_VideoSuffix.append(QString(".DIVX"));
  209. m_VideoSuffix.append(QString(".FLV"));
  210. m_VideoSuffix.append(QString(".SWF"));
  211. m_VideoSuffix.append(QString(".OGM"));
  212. //m_VideoSuffix.append(QString(".DAT"));
  213. m_USBDiskScanner = new DiskScanner(m_Parent);
  214. m_USBDiskScanner->setMinimumScanTime(1500);
  215. QMap<int, QStringList> map;
  216. map.insert(0, m_MusicSuffix);
  217. map.insert(1, m_ImageSuffix);
  218. map.insert(2, m_VideoSuffix);
  219. m_USBDiskScanner->setScannerSuffixMap(map);
  220. m_SDDiskScanner = new DiskScanner(m_Parent);
  221. m_SDDiskScanner->setMinimumScanTime(1500);
  222. map.insert(0, m_MusicSuffix);
  223. map.insert(1, m_ImageSuffix);
  224. map.insert(2, m_VideoSuffix);
  225. m_SDDiskScanner->setScannerSuffixMap(map);
  226. m_USBDiskPath.clear();
  227. m_SDDiskPath.clear();
  228. m_DiskDetach = new DiskDetach(m_Parent);
  229. }
  230. void DeviceWatcherPrivate::connectAllSlots()
  231. {
  232. Qt::ConnectionType type = static_cast<Qt::ConnectionType>(Qt::UniqueConnection | Qt::AutoConnection);
  233. QObject::connect(m_USBDiskScanner, SIGNAL(filePath(const QString &, const int)),
  234. m_Parent, SLOT(onUSBFilePath(const QString &, const int)),
  235. type);
  236. QObject::connect(m_USBDiskScanner, SIGNAL(finish()),
  237. m_Parent, SLOT(onFinish()),
  238. type);
  239. QObject::connect(m_SDDiskScanner, SIGNAL(filePath(const QString &, const int)),
  240. m_Parent, SLOT(onSDFilePath(const QString &, const int)),
  241. type);
  242. QObject::connect(m_SDDiskScanner, SIGNAL(finish()),
  243. m_Parent, SLOT(onFinish()),
  244. type);
  245. QObject::connect(m_DiskDetach, SIGNAL(diskPartition(const QString &, const DiskDeviceWatcher::Action)),
  246. m_Parent, SLOT(onDiskDeviceChange(const QString &, const DiskDeviceWatcher::Action)),
  247. type);
  248. }
  249. void DeviceWatcherPrivate::diskDeviceAdd(const QString &path)
  250. {
  251. if (regExpUSBPath(path)) {
  252. if (m_USBDiskPath.isEmpty()
  253. && QFile::exists(path)) {
  254. if (!QFile::exists(mountUSBPath)) {
  255. system("mkdir -p /media/udisk");
  256. }
  257. umount(USB_MOUNT_POINT);
  258. int ret = mount(path.toLocal8Bit().data(), USB_MOUNT_POINT, USB_MOUNT_FORMAT, USB_MOUNT_FLAG, USB_MOUNT_DATA);
  259. if (0 == ret) {
  260. m_USBDiskPath = path;
  261. usbDiskScan(mountUSBPath);
  262. } else {
  263. umount(USB_MOUNT_POINT);
  264. int ret = mount(path.toLocal8Bit().data(), USB_MOUNT_POINT, USB_MOUNT_FORMAT_EXFAT, USB_MOUNT_FLAG, USB_MOUNT_DATA);
  265. if (0 == ret) {
  266. m_USBDiskPath = path;
  267. usbDiskScan(mountUSBPath);
  268. }
  269. else
  270. {
  271. qDebug() << "mount usb failed!!!!!1";
  272. }
  273. }
  274. }
  275. } else if (regExpSDPath(path)) {
  276. if (m_SDDiskPath.isEmpty()
  277. && QFile::exists(path)) {
  278. if (!QFile::exists(mountSDPath)) {
  279. system("mkdir -p /media/sdisk");
  280. }
  281. umount(SD_MOUNT_POINT);
  282. int ret = mount(path.toLocal8Bit().data(), SD_MOUNT_POINT, SD_MOUNT_FROMAT, SD_MOUNT_FLAG, SD_MOUNT_DATA);
  283. if (0 == ret) {
  284. m_SDDiskPath = path;
  285. sdDiskScan(mountSDPath);
  286. } else {
  287. umount(SD_MOUNT_POINT);
  288. int ret = mount(path.toLocal8Bit().data(), SD_MOUNT_POINT, SD_MOUNT_FROMAT_EXFAT, SD_MOUNT_FLAG, SD_MOUNT_DATA);
  289. if (0 == ret) {
  290. m_USBDiskPath = path;
  291. sdDiskScan(mountSDPath);
  292. }
  293. else
  294. {
  295. qDebug() << "mount usb failed!!!!!1";
  296. }
  297. }
  298. }
  299. } else {
  300. qDebug() << "add other device!";
  301. }
  302. }
  303. void DeviceWatcherPrivate::diskDeviceRemove(const QString &path)
  304. {
  305. if (m_USBDiskPath == path) {
  306. if (DWS_Unsupport == m_USBDiskStatus) {
  307. m_USBDiskStatus = DWS_Remove;
  308. m_USBDiskPath.clear();
  309. emit m_Parent->onDeviceWatcherStatus(DWT_USBDisk, m_USBDiskStatus);
  310. m_USBDiskStatus = DWS_Empty;
  311. return ;
  312. }
  313. usbDiskCancelScan(mountUSBPath);
  314. QString command = QString(" umount -l ") + mountUSBPath;
  315. int ret = system(command.toLocal8Bit().constData());
  316. if (0 == ret) {
  317. } else {
  318. qDebug() << "umount usb failed!!!!";
  319. }
  320. } else if (m_SDDiskPath == path) {
  321. if (DWS_Unsupport == m_SDDiskStatus) {
  322. m_SDDiskStatus = DWS_Remove;
  323. m_SDDiskPath.clear();
  324. emit m_Parent->onDeviceWatcherStatus(DWT_SDDisk, m_SDDiskStatus);
  325. m_SDDiskStatus = DWS_Empty;
  326. return ;
  327. }
  328. sdDiskCancelScan(mountSDPath);
  329. QString command = QString(" umount -l ") + mountSDPath;
  330. int ret = system(command.toLocal8Bit().constData());
  331. if (0 == ret) {
  332. } else {
  333. qDebug() << "umount sd failed!!!!";
  334. }
  335. } else {
  336. //modify by wandz at20190506
  337. qDebug() << "remove other device!" << path << m_SDDiskPath << m_USBDiskPath;
  338. if (DWS_Unsupport == m_SDDiskStatus) {
  339. m_SDDiskStatus = DWS_Remove;
  340. m_SDDiskPath.clear();
  341. emit m_Parent->onDeviceWatcherStatus(DWT_SDDisk, m_SDDiskStatus);
  342. m_SDDiskStatus = DWS_Empty;
  343. return ;
  344. }
  345. if (DWS_Unsupport == m_USBDiskStatus) {
  346. m_USBDiskStatus = DWS_Remove;
  347. m_USBDiskPath.clear();
  348. emit m_Parent->onDeviceWatcherStatus(DWT_USBDisk, m_USBDiskStatus);
  349. m_USBDiskStatus = DWS_Empty;
  350. return ;
  351. }
  352. }
  353. }
  354. void DeviceWatcherPrivate::usbDiskScan(const QString &path)
  355. {
  356. m_USBDiskStatus = DWS_Busy;
  357. m_USBDiskScanner->startScanner(path);
  358. emit m_Parent->onDeviceWatcherStatus(DWT_USBDisk, m_USBDiskStatus);
  359. }
  360. void DeviceWatcherPrivate::usbDiskCancelScan(const QString &path)
  361. {
  362. m_USBDiskStatus = DWS_Remove;
  363. m_USBDiskPath.clear();
  364. m_USBDiskScanner->stopScanner();
  365. emit m_Parent->onDeviceWatcherStatus(DWT_USBDisk, m_USBDiskStatus);
  366. m_USBDiskStatus = DWS_Empty;
  367. }
  368. void DeviceWatcherPrivate::sdDiskScan(const QString &path)
  369. {
  370. m_SDDiskStatus = DWS_Busy;
  371. m_SDDiskScanner->startScanner(path);
  372. emit m_Parent->onDeviceWatcherStatus(DWT_SDDisk, m_SDDiskStatus);
  373. }
  374. void DeviceWatcherPrivate::sdDiskCancelScan(const QString &path)
  375. {
  376. m_SDDiskStatus = DWS_Remove;
  377. m_SDDiskPath.clear();
  378. m_SDDiskScanner->stopScanner();
  379. emit m_Parent->onDeviceWatcherStatus(DWT_SDDisk, m_SDDiskStatus);
  380. m_SDDiskStatus = DWS_Empty;
  381. }
  382. bool DeviceWatcherPrivate::regExpUSBPath(const QString &path)
  383. {
  384. return path.startsWith(QString("/dev/sd"));
  385. }
  386. bool DeviceWatcherPrivate::regExpSDPath(const QString &path)
  387. {
  388. return (path.startsWith(QString("/dev/mmcblk1")));
  389. }
  390. #ifdef ENABLE_ARKN141_CAMERA
  391. int DeviceWatcherPrivate::usbArkn141CameraDetach(const QString &path)
  392. {
  393. libusb_context *usb_video_context = NULL;
  394. libusb_device_handle *usb_video_handle = NULL;
  395. unsigned int vid = 0x18EC;
  396. unsigned int pid = 0x0141;
  397. int r = -1;
  398. if(regExpUSBPath(path)) {
  399. r = libusb_init(&usb_video_context);
  400. if (r < 0) {
  401. qDebug()<<"### usbArkn141CameraDetach failed, libusb_init NG";
  402. return r;
  403. }
  404. usb_video_handle = libusb_open_device_with_vid_pid(usb_video_context, vid, pid);
  405. if(usb_video_handle) {
  406. libusb_close(usb_video_handle);
  407. usb_video_handle = NULL;
  408. } else {
  409. r = -1;
  410. qDebug()<<"### usbArkn141CameraDetach failed, open_device_with_vid_pid NG";
  411. }
  412. if(usb_video_context) {
  413. libusb_exit(usb_video_context);
  414. usb_video_context = NULL;
  415. }
  416. }
  417. return r;
  418. }
  419. #endif
  420. bool DeviceWatcherPrivate::usbSpecialDeviceDetach(const QString &device, const DiskDeviceWatcher::Action action)
  421. {
  422. bool ret;
  423. switch (action) {
  424. case DiskDeviceWatcher::A_Add: {
  425. if (0) { }
  426. #ifdef ENABLE_ARKN141_CAMERA
  427. else if(usbArkn141CameraDetach(device) == 0) {
  428. m_UsbSpecialDeviceDetach = true;
  429. //Handler(device, DiskDeviceWatcher::A_Remove);
  430. emit m_Parent->onDeviceWatcherStatus(DWT_USBDisk+10, DWS_Ready);
  431. }
  432. #endif
  433. else {
  434. m_UsbSpecialDeviceDetach = false;
  435. }
  436. break;
  437. }
  438. case DiskDeviceWatcher::A_Remove: {
  439. if(m_UsbSpecialDeviceDetach) {
  440. m_UsbSpecialDeviceDetach = false;
  441. #ifdef ENABLE_ARKN141_CAMERA
  442. emit m_Parent->onDeviceWatcherStatus(DWT_USBDisk+10, DWS_Remove);
  443. #endif
  444. return true;
  445. }
  446. break;
  447. }
  448. default: {
  449. m_UsbSpecialDeviceDetach = false;
  450. break;
  451. }
  452. }
  453. return m_UsbSpecialDeviceDetach;
  454. }
  455. void DeviceWatcher::onDiskDeviceChange(const QString &device, const DiskDeviceWatcher::Action action)
  456. {
  457. switch (action) {
  458. case DiskDeviceWatcher::A_Add: {
  459. if(m_Private->usbSpecialDeviceDetach(device, action) == false) {
  460. m_Private->diskDeviceAdd(device);
  461. }
  462. break;
  463. }
  464. case DiskDeviceWatcher::A_Remove: {
  465. if(m_Private->usbSpecialDeviceDetach(device, action) == false) {
  466. m_Private->diskDeviceRemove(device);
  467. }
  468. break;
  469. }
  470. default: {
  471. break;
  472. }
  473. }
  474. }
  475. void DeviceWatcher::onUSBFilePath(const QString &path, const int index)
  476. {
  477. switch(index) {
  478. case 0: {
  479. emit onMusicFilePath(path, DWT_USBDisk);
  480. break;
  481. }
  482. case 1: {
  483. emit onImageFilePath(path, DWT_USBDisk);
  484. break;
  485. }
  486. case 2: {
  487. emit onVideoFilePath(path, DWT_USBDisk);
  488. break;
  489. }
  490. default: {
  491. break;
  492. }
  493. }
  494. }
  495. void DeviceWatcher::onSDFilePath(const QString &path, const int index)
  496. {
  497. switch(index) {
  498. case 0: {
  499. emit onMusicFilePath(path, DWT_SDDisk);
  500. break;
  501. }
  502. case 1: {
  503. emit onImageFilePath(path, DWT_SDDisk);
  504. break;
  505. }
  506. case 2: {
  507. emit onVideoFilePath(path, DWT_SDDisk);
  508. break;
  509. }
  510. default: {
  511. break;
  512. }
  513. }
  514. }
  515. void DeviceWatcher::onFinish()
  516. {
  517. QObject* ptr = sender();
  518. if (ptr == m_Private->m_USBDiskScanner) {
  519. qDebug() << "USB::onFinish";
  520. m_Private->m_USBDiskStatus = DWS_Ready;
  521. emit onDeviceWatcherStatus(DWT_USBDisk, m_Private->m_USBDiskStatus);
  522. } else if (ptr == m_Private->m_SDDiskScanner) {
  523. qDebug() << "SD::onFinish";
  524. m_Private->m_SDDiskStatus = DWS_Ready;
  525. emit onDeviceWatcherStatus(DWT_SDDisk, m_Private->m_SDDiskStatus);
  526. }
  527. }