diff --git a/src/devices/macdevicelister.h b/src/devices/macdevicelister.h index 6468b8d97..81bf7c905 100644 --- a/src/devices/macdevicelister.h +++ b/src/devices/macdevicelister.h @@ -77,9 +77,7 @@ class MacDeviceLister : public DeviceLister { uint qHash(const MacDeviceLister::MTPDevice& device); inline bool operator==(const MacDeviceLister::MTPDevice& a, const MacDeviceLister::MTPDevice& b) { - return (a.vendor == b.vendor) && - (a.vendor_id == b.vendor_id) && - (a.product == b.product) && + return (a.vendor_id == b.vendor_id) && (a.product_id == b.product_id); } diff --git a/src/devices/macdevicelister.mm b/src/devices/macdevicelister.mm index 87ac5e5a2..aa48a8b80 100644 --- a/src/devices/macdevicelister.mm +++ b/src/devices/macdevicelister.mm @@ -57,7 +57,7 @@ QSet MacDeviceLister::sMTPDeviceList; uint qHash(const MacDeviceLister::MTPDevice& d) { - return qHash(d.vendor) ^ qHash(d.vendor_id) ^ qHash(d.product) ^ qHash(d.product_id); + return qHash(d.vendor_id) ^ qHash(d.product_id); } MacDeviceLister::MacDeviceLister() { @@ -85,8 +85,18 @@ void MacDeviceLister::Init() { d.product = QString::fromAscii(device.product); d.product_id = device.product_id; d.quirks = device.device_flags; + sMTPDeviceList << d; } } + + MTPDevice d; + d.vendor = "SanDisk"; + d.vendor_id = 0x781; + d.product = "Sansa Clip+"; + d.product_id = 0x74d0; + + d.quirks = 0x2 | 0x4 | 0x40 | 0x4000; + sMTPDeviceList << d; } run_loop_ = CFRunLoopGetCurrent(); @@ -423,6 +433,7 @@ void MacDeviceLister::USBDeviceAddedCallback(void* refcon, io_iterator_t it) { // First check the libmtp device list. QSet::const_iterator it = sMTPDeviceList.find(device); if (it != sMTPDeviceList.end()) { + qDebug() << "Found in table"; // Fill in quirks flags from libmtp. device.quirks = it->quirks; me->FoundMTPDevice(device, GetSerialForMTPDevice(object)); diff --git a/src/ui/organisedialog.cpp b/src/ui/organisedialog.cpp index 926716f8a..e49cb3993 100644 --- a/src/ui/organisedialog.cpp +++ b/src/ui/organisedialog.cpp @@ -303,7 +303,6 @@ void OrganiseDialog::OrganiseFinished(const QStringList& files_with_errors) { if (files_with_errors.isEmpty()) return; - OrganiseErrorDialog* dialog = new OrganiseErrorDialog(this); - dialog->Show(OrganiseErrorDialog::Type_Copy, files_with_errors); - // It deletes itself when the user closes it + error_dialog_.reset(new OrganiseErrorDialog); + error_dialog_->Show(OrganiseErrorDialog::Type_Copy, files_with_errors); } diff --git a/src/ui/organisedialog.h b/src/ui/organisedialog.h index a24e690eb..ff0bf9791 100644 --- a/src/ui/organisedialog.h +++ b/src/ui/organisedialog.h @@ -24,9 +24,10 @@ #include "core/organiseformat.h" #include "core/song.h" -#include +#include class LibraryWatcher; +class OrganiseErrorDialog; class TaskManager; class Ui_OrganiseDialog; @@ -76,6 +77,8 @@ private: QStringList filenames_; SongList preview_songs_; quint64 total_size_; + + boost::scoped_ptr error_dialog_; }; #endif // ORGANISEDIALOG_H