Commit e1dfaf37a1411d1afaaa63684b54a443d19df7e2

fix crash on 10.6 with no wifi interface

Task-number: QTBUG-8954
  
9797 CFRunLoopSourceRef runloopSource;
9898
9999 void startNetworkChangeLoop();
100 bool hasWifi;
100101
101102};
102103
  
158158 startNetworkChangeLoop();
159159
160160#if defined(MAC_SDK_10_6)
161 if(!listener) {
161 if([[CWInterface supportedInterfaces] count] > 0 && !listener) {
162162 listener = [[QNSListener alloc] init];
163163 listener.engine = this;
164 hasWifi = true;
165 } else {
166 hasWifi = false;
164167 }
165168#endif
166169}
404404 QStringList found;
405405
406406#if defined(MAC_SDK_10_6)
407 QMacCocoaAutoReleasePool pool;
407 if(!hasWifi) {
408 return found;
409 }
408410
411 QMacCocoaAutoReleasePool pool;
412
409413 CWInterface *currentInterface = [CWInterface interfaceWithName:qt_mac_QStringToNSString(interfaceName)];
410414 if([currentInterface power]) {
411415 NSError *err = nil;
504504 QMutexLocker locker(&mutex);
505505
506506#if defined(MAC_SDK_10_6)
507 CWInterface *defaultInterface = [CWInterface interfaceWithName: qt_mac_QStringToNSString(wifiDeviceName)];
508 if([defaultInterface power])
509 return true;
507 if(hasWifi) {
508 CWInterface *defaultInterface = [CWInterface interfaceWithName: qt_mac_QStringToNSString(wifiDeviceName)];
509 if([defaultInterface power])
510 return true;
511 }
510512#else
511513 Q_UNUSED(wifiDeviceName);
512514#endif
520520 QMutexLocker locker(&mutex);
521521
522522#if defined(MAC_SDK_10_6)
523 if(!hasWifi) { return false; }
523524 CWInterface *wifiInterface = [CWInterface interfaceWithName: qt_mac_QStringToNSString(interfaceName)];
524525 CWConfiguration *userConfig = [wifiInterface configuration];
525526 NSSet *remNets = [userConfig rememberedNetworks];