Zeroconf: Compile with QT_NO_CAST_FROM_ASCII

Change-Id: If23da8a3ae819875c627d40375b908eb0ea73e3c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
This commit is contained in:
Orgad Shaneh
2012-12-10 18:27:15 +02:00
committed by Orgad Shaneh
parent 6e7b51f941
commit a95c00f77c
5 changed files with 11 additions and 11 deletions

View File

@@ -467,7 +467,7 @@ extern "C" void cAvahiClientReply (AvahiClient * /*s*/, AvahiClientState state,
break; break;
case (AVAHI_CLIENT_S_RUNNING): case (AVAHI_CLIENT_S_RUNNING):
/* Server state: RUNNING */ /* Server state: RUNNING */
lib->setError(false, QString("")); lib->setError(false, QString());
break; break;
case (AVAHI_CLIENT_S_COLLISION): case (AVAHI_CLIENT_S_COLLISION):
/* Server state: COLLISION */ /* Server state: COLLISION */

View File

@@ -71,8 +71,8 @@ public:
{ {
if (daemonPath.isEmpty()) if (daemonPath.isEmpty())
m_maxErrors = 0; m_maxErrors = 0;
if (!daemonPath.isEmpty() && daemonPath.at(0) != '/' && daemonPath.at(0) != '.') if (!daemonPath.isEmpty() && daemonPath.at(0) != QLatin1Char('/') && daemonPath.at(0) != QLatin1Char('.'))
this->daemonPath = QCoreApplication::applicationDirPath() + QChar('/') + daemonPath; this->daemonPath = QCoreApplication::applicationDirPath() + QLatin1Char('/') + daemonPath;
} }
~EmbeddedZConfLib() ~EmbeddedZConfLib()
@@ -114,7 +114,7 @@ public:
QString daemonCmd = daemonPath; QString daemonCmd = daemonPath;
QStringList daemonArgs; QStringList daemonArgs;
#ifdef Q_OS_LINUX #ifdef Q_OS_LINUX
if (QFile::exists("/tmp/mdnsd") && logger) if (QFile::exists(QLatin1String("/tmp/mdnsd")) && logger)
logger->appendError(ErrorMessage::WarningLevel, logger->appendError(ErrorMessage::WarningLevel,
ZConfLib::tr("%1 detected a file at /tmp/mdnsd, daemon startup will probably fail.") ZConfLib::tr("%1 detected a file at /tmp/mdnsd, daemon startup will probably fail.")
.arg(name())); .arg(name()));

View File

@@ -663,7 +663,7 @@ extern "C" void DNSSD_API cServiceResolveReply(DNSServiceRef
<< ((size_t)context); << ((size_t)context);
ServiceGatherer *ctxGatherer = reinterpret_cast<ServiceGatherer *>(context); ServiceGatherer *ctxGatherer = reinterpret_cast<ServiceGatherer *>(context);
if (ctxGatherer){ if (ctxGatherer){
if (ctxGatherer->currentService->fullName() != fullname){ if (ctxGatherer->currentService->fullName() != QString::fromLocal8Bit(fullname)) {
qDebug() << "ServiceBrowser " << ctxGatherer->serviceBrowser->serviceType qDebug() << "ServiceBrowser " << ctxGatherer->serviceBrowser->serviceType
<< " for service " << ctxGatherer->currentService->name() << " for service " << ctxGatherer->currentService->name()
<< " ignoring resolve reply for " << fullname << " vs. " << " ignoring resolve reply for " << fullname << " vs. "
@@ -1078,7 +1078,7 @@ void ServiceGatherer::serviceResolveReply(DNSServiceFlags fl
} }
currentService->m_interfaceNr = interfaceIndex; currentService->m_interfaceNr = interfaceIndex;
currentService->m_port = port; currentService->m_port = port;
if (hostName != hosttarget) { if (hostName != QString::fromUtf8(hosttarget)) {
hostName = QString::fromUtf8(hosttarget); hostName = QString::fromUtf8(hosttarget);
if (!currentService->host()) if (!currentService->host())
currentService->m_host = new QHostInfo(); currentService->m_host = new QHostInfo();
@@ -1224,7 +1224,7 @@ void ServiceGatherer::addrReply(DNSServiceFlags flags,
serviceBrowser->updateFlowStatusForFlags(flags); serviceBrowser->updateFlowStatusForFlags(flags);
if (!currentService->host()) if (!currentService->host())
currentService->m_host = new QHostInfo(); currentService->m_host = new QHostInfo();
if (currentService->host()->hostName() != hostname) { if (currentService->host()->hostName() != QString::fromUtf8(hostname)) {
if ((flags & kDNSServiceFlagsAdd) == 1) if ((flags & kDNSServiceFlagsAdd) == 1)
currentService->m_host->setHostName(QString::fromUtf8(hostname)); currentService->m_host->setHostName(QString::fromUtf8(hostname));
if (currentService->host()->addresses().isEmpty()) { if (currentService->host()->addresses().isEmpty()) {
@@ -1475,9 +1475,9 @@ void ServiceBrowserPrivate::browseReply(DNSServiceFlags flag
QString newServiceName = QString::fromUtf8(serviceName); QString newServiceName = QString::fromUtf8(serviceName);
QString newType = serviceType; QString newType = serviceType;
QString newDomain = domain; QString newDomain = domain;
if (serviceType != regtype) // discard? should not happen... if (serviceType != QString::fromUtf8(regtype)) // discard? should not happen...
newType = QString::fromUtf8(regtype); newType = QString::fromUtf8(regtype);
if (domain != replyDomain) if (domain != QString::fromUtf8(replyDomain))
domain = QString::fromUtf8(replyDomain); domain = QString::fromUtf8(replyDomain);
QString fullName = toFullNameC(serviceName, regtype, replyDomain); QString fullName = toFullNameC(serviceName, regtype, replyDomain);
updateFlowStatusForFlags(flags); updateFlowStatusForFlags(flags);

View File

@@ -5,7 +5,7 @@ CONFIG += exceptions
TARGET = zeroconf TARGET = zeroconf
TEMPLATE = lib TEMPLATE = lib
DEFINES += ZEROCONF_LIBRARY DEFINES += ZEROCONF_LIBRARY QT_NO_CAST_FROM_ASCII
SOURCES += servicebrowser.cpp \ SOURCES += servicebrowser.cpp \
embeddedLib.cpp \ embeddedLib.cpp \

View File

@@ -8,7 +8,7 @@ QtcLibrary {
Depends { name: "Qt.network" } Depends { name: "Qt.network" }
cpp.includePaths: base.concat(".") cpp.includePaths: base.concat(".")
cpp.defines: base.concat("ZEROCONF_LIBRARY") cpp.defines: base.concat(["ZEROCONF_LIBRARY", "QT_NO_CAST_FROM_ASCII"])
Properties { Properties {
condition: qbs.targetOS == "windows" condition: qbs.targetOS == "windows"