Replace emit with Q_EMIT

This commit is contained in:
Jonas Kvinge 2024-08-25 05:46:17 +02:00
parent 359f320b06
commit 1c5d0dceb1
2 changed files with 9 additions and 9 deletions

View File

@ -60,7 +60,7 @@ void MacFSListener::EventStreamCallback(ConstFSEventStreamRef stream, void *user
while (path.endsWith(QLatin1Char('/'))) { while (path.endsWith(QLatin1Char('/'))) {
path.chop(1); path.chop(1);
} }
emit me->PathChanged(path); Q_EMIT me->PathChanged(path);
} }
} }

View File

@ -204,7 +204,7 @@ bool MacOsDeviceLister::Init() {
} }
void MacOsDeviceLister::ExitAsync() { void MacOsDeviceLister::ExitAsync() {
emit ExitFinished(); Q_EMIT ExitFinished();
} }
void MacOsDeviceLister::ShutDown() { CFRunLoopStop(run_loop_); } void MacOsDeviceLister::ShutDown() { CFRunLoopStop(run_loop_); }
@ -393,7 +393,7 @@ void MacOsDeviceLister::DiskAddedCallback(DADiskRef disk, void *context) {
// CD inserted. // CD inserted.
QString bsd_name = QString::fromLatin1(DADiskGetBSDName(disk)); QString bsd_name = QString::fromLatin1(DADiskGetBSDName(disk));
me->cd_devices_ << bsd_name; me->cd_devices_ << bsd_name;
emit me->DeviceAdded(bsd_name); Q_EMIT me->DeviceAdded(bsd_name);
return; return;
} }
#endif #endif
@ -416,7 +416,7 @@ void MacOsDeviceLister::DiskAddedCallback(DADiskRef disk, void *context) {
QString serial = GetSerialForDevice(device.get()); QString serial = GetSerialForDevice(device.get());
if (!serial.isEmpty()) { if (!serial.isEmpty()) {
me->current_devices_[serial] = QString::fromLatin1(DADiskGetBSDName(disk)); me->current_devices_[serial] = QString::fromLatin1(DADiskGetBSDName(disk));
emit me->DeviceAdded(serial); Q_EMIT me->DeviceAdded(serial);
} }
} }
} }
@ -433,13 +433,13 @@ void MacOsDeviceLister::DiskRemovedCallback(DADiskRef disk, void *context) {
QString bsd_name = QString::fromLatin1(DADiskGetBSDName(disk)); QString bsd_name = QString::fromLatin1(DADiskGetBSDName(disk));
if (me->cd_devices_.remove(bsd_name)) { if (me->cd_devices_.remove(bsd_name)) {
emit me->DeviceRemoved(bsd_name); Q_EMIT me->DeviceRemoved(bsd_name);
return; return;
} }
for (QMap<QString, QString>::iterator it = me->current_devices_.begin(); it != me->current_devices_.end(); ++it) { for (QMap<QString, QString>::iterator it = me->current_devices_.begin(); it != me->current_devices_.end(); ++it) {
if (it.value() == bsd_name) { if (it.value() == bsd_name) {
emit me->DeviceRemoved(it.key()); Q_EMIT me->DeviceRemoved(it.key());
me->current_devices_.erase(it); me->current_devices_.erase(it);
break; break;
} }
@ -661,7 +661,7 @@ void MacOsDeviceLister::RemovedMTPDevice(const QString &serial) {
int count = mtp_devices_.remove(serial); int count = mtp_devices_.remove(serial);
if (count) { if (count) {
qLog(Debug) << "MTP device removed:" << serial; qLog(Debug) << "MTP device removed:" << serial;
emit DeviceRemoved(serial); Q_EMIT DeviceRemoved(serial);
} }
} }
@ -674,7 +674,7 @@ void MacOsDeviceLister::FoundMTPDevice(const MTPDevice &device, const QString &s
MTPDevice *d = &mtp_devices_[serial]; MTPDevice *d = &mtp_devices_[serial];
d->capacity = GetCapacity(urls[0]); d->capacity = GetCapacity(urls[0]);
d->free_space = GetFreeSpace(urls[0]); d->free_space = GetFreeSpace(urls[0]);
emit DeviceAdded(serial); Q_EMIT DeviceAdded(serial);
} }
@ -887,6 +887,6 @@ void MacOsDeviceLister::UpdateDeviceFreeSpace(const QString &serial) {
d->free_space = GetFreeSpace(urls[0]); d->free_space = GetFreeSpace(urls[0]);
} }
} }
emit DeviceChanged(serial); Q_EMIT DeviceChanged(serial);
} }