From c3282aebf42918df2af34a48556b6b471b3e754f Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Thu, 6 Oct 2016 12:10:08 +0200 Subject: Darwin: Fix deprecation warning on usage of QString(const char *) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit By wrapping the kIOConstants in the CFSTR macro, this also prevents the creation of temporary QString objects. Change-Id: I04baf9e3f3076f0134e5eb924c2dbf5da011acad Reviewed-by: Tor Arne Vestbø --- src/serialport/qserialportinfo_osx.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/serialport/qserialportinfo_osx.cpp b/src/serialport/qserialportinfo_osx.cpp index 03cb59b..cecb3a2 100644 --- a/src/serialport/qserialportinfo_osx.cpp +++ b/src/serialport/qserialportinfo_osx.cpp @@ -102,42 +102,42 @@ static bool isCompleteInfo(const QSerialPortInfoPrivate &priv, const QString &ca static QString calloutDeviceSystemLocation(io_registry_entry_t ioRegistryEntry) { - return searchStringProperty(ioRegistryEntry, QCFString(kIOCalloutDeviceKey)); + return searchStringProperty(ioRegistryEntry, QCFString(CFSTR(kIOCalloutDeviceKey))); } static QString dialinDeviceSystemLocation(io_registry_entry_t ioRegistryEntry) { - return searchStringProperty(ioRegistryEntry, QCFString(kIODialinDeviceKey)); + return searchStringProperty(ioRegistryEntry, QCFString(CFSTR(kIODialinDeviceKey))); } static QString deviceDescription(io_registry_entry_t ioRegistryEntry) { - QString result = searchStringProperty(ioRegistryEntry, QCFString(kIOPropertyProductNameKey)); + QString result = searchStringProperty(ioRegistryEntry, QCFString(CFSTR(kIOPropertyProductNameKey))); if (result.isEmpty()) - result = searchStringProperty(ioRegistryEntry, QCFString(kUSBProductString)); + result = searchStringProperty(ioRegistryEntry, QCFString(CFSTR(kUSBProductString))); if (result.isEmpty()) - result = searchStringProperty(ioRegistryEntry, QCFString("BTName")); + result = searchStringProperty(ioRegistryEntry, QCFString(CFSTR("BTName"))); return result; } static QString deviceManufacturer(io_registry_entry_t ioRegistryEntry) { - return searchStringProperty(ioRegistryEntry, QCFString(kUSBVendorString)); + return searchStringProperty(ioRegistryEntry, QCFString(CFSTR(kUSBVendorString))); } static QString deviceSerialNumber(io_registry_entry_t ioRegistryEntry) { - return searchStringProperty(ioRegistryEntry, QCFString(kUSBSerialNumberString)); + return searchStringProperty(ioRegistryEntry, QCFString(CFSTR(kUSBSerialNumberString))); } static quint16 deviceVendorIdentifier(io_registry_entry_t ioRegistryEntry, bool &ok) { - return searchShortIntProperty(ioRegistryEntry, QCFString(kUSBVendorID), ok); + return searchShortIntProperty(ioRegistryEntry, QCFString(CFSTR(kUSBVendorID)), ok); } static quint16 deviceProductIdentifier(io_registry_entry_t ioRegistryEntry, bool &ok) { - return searchShortIntProperty(ioRegistryEntry, QCFString(kUSBProductID), ok); + return searchShortIntProperty(ioRegistryEntry, QCFString(CFSTR(kUSBProductID)), ok); } static io_registry_entry_t parentSerialPortService(io_registry_entry_t currentSerialPortService) -- cgit v1.2.1