From ee6483a76e62a69641530f36ad35f1f686914442 Mon Sep 17 00:00:00 2001 From: Lorn Potter Date: Mon, 19 Apr 2010 15:38:02 +1000 Subject: move network scan to thread. increases startup time. Task-number: QTBUG-9722 --- src/plugins/bearer/corewlan/qcorewlanengine.h | 41 +- src/plugins/bearer/corewlan/qcorewlanengine.mm | 819 +++++++++++++------------ 2 files changed, 464 insertions(+), 396 deletions(-) diff --git a/src/plugins/bearer/corewlan/qcorewlanengine.h b/src/plugins/bearer/corewlan/qcorewlanengine.h index 5c69299..854dcea 100644 --- a/src/plugins/bearer/corewlan/qcorewlanengine.h +++ b/src/plugins/bearer/corewlan/qcorewlanengine.h @@ -47,15 +47,18 @@ #include #include #include +#include #ifndef QT_NO_BEARERMANAGEMENT QT_BEGIN_NAMESPACE class QNetworkConfigurationPrivate; +class QScanThread; class QCoreWlanEngine : public QBearerEngineImpl { + friend class QScanThread; Q_OBJECT public: @@ -83,28 +86,54 @@ public: bool requiresPolling() const; private Q_SLOTS: + void init(); void doRequestUpdate(); + void networksChanged(); private: bool isWifiReady(const QString &dev); - QMap configurationInterface; - QStringList scanForSsids(const QString &interfaceName); - - bool isKnownSsid(const QString &ssid); QList foundConfigurations; SCDynamicStoreRef storeSession; CFRunLoopSourceRef runloopSource; bool hasWifi; + bool scanning; + QScanThread *scanThread; protected: - QMap > userProfiles; - void startNetworkChangeLoop(); + +}; + +class QScanThread : public QThread +{ + Q_OBJECT + +public: + QScanThread(QObject *parent = 0); + ~QScanThread(); + + void quit(); + QList getConfigurations(); + QString interfaceName; + QMap configurationInterface; void getUserConfigurations(); QString getNetworkNameFromSsid(const QString &ssid); QString getSsidFromNetworkName(const QString &name); + bool isKnownSsid(const QString &ssid); + QMap > userProfiles; + +signals: + void networksChanged(); + +protected: + void run(); + +private: + QList fetchedConfigurations; + QMutex mutex; QStringList foundNetwork(const QString &id, const QString &ssid, const QNetworkConfiguration::StateFlags state, const QString &interfaceName, const QNetworkConfiguration::Purpose purpose); + }; QT_END_NAMESPACE diff --git a/src/plugins/bearer/corewlan/qcorewlanengine.mm b/src/plugins/bearer/corewlan/qcorewlanengine.mm index 268126a..f54bd4d 100644 --- a/src/plugins/bearer/corewlan/qcorewlanengine.mm +++ b/src/plugins/bearer/corewlan/qcorewlanengine.mm @@ -67,10 +67,6 @@ #include #include "private/qcore_mac_p.h" -#ifndef QT_NO_BEARERMANAGEMENT - -QT_BEGIN_NAMESPACE - @interface QNSListener : NSObject { NSNotificationCenter *center; @@ -96,7 +92,6 @@ QT_BEGIN_NAMESPACE QMacCocoaAutoReleasePool pool; center = [NSNotificationCenter defaultCenter]; currentInterface = [CWInterface interfaceWithName:nil]; -// [center addObserver:self selector:@selector(notificationHandler:) name:kCWLinkDidChangeNotification object:nil]; [center addObserver:self selector:@selector(notificationHandler:) name:kCWPowerDidChangeNotification object:nil]; [locker unlock]; return self; @@ -130,6 +125,8 @@ QT_BEGIN_NAMESPACE QNSListener *listener = 0; +QT_BEGIN_NAMESPACE + void networkChangeCallback(SCDynamicStoreRef/* store*/, CFArrayRef changedKeys, void *info) { for ( long i = 0; i < CFArrayGetCount(changedKeys); i++) { @@ -143,20 +140,277 @@ void networkChangeCallback(SCDynamicStoreRef/* store*/, CFArrayRef changedKeys, return; } -QCoreWlanEngine::QCoreWlanEngine(QObject *parent) -: QBearerEngineImpl(parent) + +QScanThread::QScanThread(QObject *parent) + :QThread(parent) { - startNetworkChangeLoop(); +} + +QScanThread::~QScanThread() +{ +} + +void QScanThread::quit() +{ + wait(); +} + +void QScanThread::run() +{ + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + QStringList found; + mutex.lock(); + CWInterface *currentInterface = [CWInterface interfaceWithName:qt_mac_QStringToNSString(interfaceName)]; + mutex.unlock(); + + if([currentInterface power]) { + NSError *err = nil; + NSDictionary *parametersDict = [NSDictionary dictionaryWithObjectsAndKeys: + [NSNumber numberWithBool:YES], kCWScanKeyMerge, + [NSNumber numberWithInteger:100], kCWScanKeyRestTime, nil]; + + NSArray* apArray = [currentInterface scanForNetworksWithParameters:parametersDict error:&err]; + CWNetwork *apNetwork; + + if (!err) { + + for(uint row=0; row < [apArray count]; row++ ) { + apNetwork = [apArray objectAtIndex:row]; + + const QString networkSsid = qt_mac_NSStringToQString([apNetwork ssid]); + const QString id = QString::number(qHash(QLatin1String("corewlan:") + networkSsid)); + found.append(id); + + QNetworkConfiguration::StateFlags state = QNetworkConfiguration::Undefined; + bool known = isKnownSsid(networkSsid); + if( [currentInterface.interfaceState intValue] == kCWInterfaceStateRunning) { + if( networkSsid == qt_mac_NSStringToQString( [currentInterface ssid])) { + state = QNetworkConfiguration::Active; + } + } + if(state == QNetworkConfiguration::Undefined) { + if(known) { + state = QNetworkConfiguration::Discovered; + } else { + state = QNetworkConfiguration::Undefined; + } + } + QNetworkConfiguration::Purpose purpose = QNetworkConfiguration::UnknownPurpose; + if([[apNetwork securityMode] intValue] == kCWSecurityModeOpen) { + purpose = QNetworkConfiguration::PublicPurpose; + } else { + purpose = QNetworkConfiguration::PrivatePurpose; + } + + found.append(foundNetwork(id, networkSsid, state, interfaceName, purpose)); + + } //end row +// [parametersDict release]; + + } //end error + } // endwifi power + // add known configurations that are not around. + QMapIterator > i(userProfiles); + while (i.hasNext()) { + i.next(); + + QString networkName = i.key(); + const QString id = QString::number(qHash(QLatin1String("corewlan:") + networkName)); + + if(!found.contains(id)) { + QString networkSsid = getSsidFromNetworkName(networkName); + const QString ssidId = QString::number(qHash(QLatin1String("corewlan:") + networkSsid)); + QNetworkConfiguration::StateFlags state = QNetworkConfiguration::Undefined; + QString interfaceName; + QMapIterator ij(i.value()); + while (ij.hasNext()) { + ij.next(); + interfaceName = ij.value(); + } + + if( [currentInterface.interfaceState intValue] == kCWInterfaceStateRunning) { + if( networkSsid == qt_mac_NSStringToQString([currentInterface ssid])) { + state = QNetworkConfiguration::Active; + } + } + if(state == QNetworkConfiguration::Undefined) { + if( userProfiles.contains(networkName) + && found.contains(ssidId)) { + state = QNetworkConfiguration::Discovered; + } + } + + if(state == QNetworkConfiguration::Undefined) { + state = QNetworkConfiguration::Defined; + } + + found.append(foundNetwork(id, networkName, state, interfaceName, QNetworkConfiguration::UnknownPurpose)); + } + } + emit networksChanged(); + [pool release]; +} + +QStringList QScanThread::foundNetwork(const QString &id, const QString &name, const QNetworkConfiguration::StateFlags state, const QString &interfaceName, const QNetworkConfiguration::Purpose purpose) +{ + QStringList found; + QMutexLocker locker(&mutex); + QNetworkConfigurationPrivate *ptr = new QNetworkConfigurationPrivate; + ptr->name = name; + ptr->isValid = true; + ptr->id = id; + ptr->state = state; + ptr->type = QNetworkConfiguration::InternetAccessPoint; + ptr->bearer = QLatin1String("WLAN"); + ptr->purpose = purpose; + + fetchedConfigurations.append( ptr); + configurationInterface.insert(ptr->id, interfaceName); + + locker.unlock(); + locker.relock(); + found.append(id); + return found; +} + +QList QScanThread::getConfigurations() +{ + QMutexLocker locker(&mutex); + + QList foundConfigurations = fetchedConfigurations; + fetchedConfigurations.clear(); + + return foundConfigurations; +} + +void QScanThread::getUserConfigurations() +{ QMacCocoaAutoReleasePool pool; - if([[CWInterface supportedInterfaces] count] > 0 && !listener) { - listener = [[QNSListener alloc] init]; - listener.engine = this; - hasWifi = true; - } else { - hasWifi = false; + userProfiles.clear(); + + NSArray *wifiInterfaces = [CWInterface supportedInterfaces]; + for(uint row=0; row < [wifiInterfaces count]; row++ ) { + + CWInterface *wifiInterface = [CWInterface interfaceWithName: [wifiInterfaces objectAtIndex:row]]; + NSString *nsInterfaceName = [wifiInterface name]; +// add user configured system networks + SCDynamicStoreRef dynRef = SCDynamicStoreCreate(kCFAllocatorSystemDefault, (CFStringRef)@"Qt corewlan", nil, nil); + NSDictionary * airportPlist = (NSDictionary *)SCDynamicStoreCopyValue(dynRef, (CFStringRef)[NSString stringWithFormat:@"Setup:/Network/Interface/%@/AirPort", nsInterfaceName]); + CFRelease(dynRef); + + NSDictionary *prefNetDict = [airportPlist objectForKey:@"PreferredNetworks"]; + + NSArray *thisSsidarray = [prefNetDict valueForKey:@"SSID_STR"]; + for(NSString *ssidkey in thisSsidarray) { + QString thisSsid = qt_mac_NSStringToQString(ssidkey); + if(!userProfiles.contains(thisSsid)) { + QMap map; + map.insert(thisSsid, qt_mac_NSStringToQString(nsInterfaceName)); + userProfiles.insert(thisSsid, map); + } + } + CFRelease(airportPlist); + + // 802.1X user profiles + QString userProfilePath = QDir::homePath() + "/Library/Preferences/com.apple.eap.profiles.plist"; + NSDictionary* eapDict = [[NSMutableDictionary alloc] initWithContentsOfFile:qt_mac_QStringToNSString(userProfilePath)]; + NSString *profileStr= @"Profiles"; + NSString *nameStr = @"UserDefinedName"; + NSString *networkSsidStr = @"Wireless Network"; + for (id profileKey in eapDict) { + if ([profileStr isEqualToString:profileKey]) { + NSDictionary *itemDict = [eapDict objectForKey:profileKey]; + for (id itemKey in itemDict) { + + NSInteger dictSize = [itemKey count]; + id objects[dictSize]; + id keys[dictSize]; + + [itemKey getObjects:objects andKeys:keys]; + QString networkName; + QString ssid; + for(int i = 0; i < dictSize; i++) { + if([nameStr isEqualToString:keys[i]]) { + networkName = qt_mac_NSStringToQString(objects[i]); + } + if([networkSsidStr isEqualToString:keys[i]]) { + ssid = qt_mac_NSStringToQString(objects[i]); + } + if(!userProfiles.contains(networkName) + && !ssid.isEmpty()) { + QMap map; + map.insert(ssid, qt_mac_NSStringToQString(nsInterfaceName)); + userProfiles.insert(networkName, map); + } + } + } + [itemDict release]; + } + } + [eapDict release]; + } +} + +QString QScanThread::getSsidFromNetworkName(const QString &name) +{ + QMapIterator > i(userProfiles); + while (i.hasNext()) { + i.next(); + QMap map = i.value(); + QMapIterator ij(i.value()); + while (ij.hasNext()) { + ij.next(); + const QString networkNameHash = QString::number(qHash(QLatin1String("corewlan:") +i.key())); + if(name == i.key() || name == networkNameHash) { + return ij.key(); + } + } + } + return QString(); +} + +QString QScanThread::getNetworkNameFromSsid(const QString &ssid) +{ + QMapIterator > i(userProfiles); + while (i.hasNext()) { + i.next(); + QMap map = i.value(); + QMapIterator ij(i.value()); + while (ij.hasNext()) { + ij.next(); + if(ij.key() == ssid) { + return i.key(); + } + } } - QMetaObject::invokeMethod(this, "requestUpdate", Qt::QueuedConnection); + return QString(); +} + +bool QScanThread::isKnownSsid(const QString &ssid) +{ + QMutexLocker locker(&mutex); + + QMapIterator > i(userProfiles); + while (i.hasNext()) { + i.next(); + QMap map = i.value(); + if(map.keys().contains(ssid)) { + return true; + } + } + return false; +} + + +QCoreWlanEngine::QCoreWlanEngine(QObject *parent) +: QBearerEngineImpl(parent), scanThread(0) +{ + scanThread = new QScanThread(this); + connect(scanThread, SIGNAL(networksChanged()), + this, SLOT(networksChanged())); + + QTimer::singleShot(0,this,SLOT(init())); } QCoreWlanEngine::~QCoreWlanEngine() @@ -167,18 +421,33 @@ QCoreWlanEngine::~QCoreWlanEngine() [listener release]; } +void QCoreWlanEngine::init() +{ + if([[CWInterface supportedInterfaces] count] > 0 && !listener) { + listener = [[QNSListener alloc] init]; + listener.engine = this; + hasWifi = true; + } else { + hasWifi = false; + } + storeSession = NULL; + + startNetworkChangeLoop(); +} + + QString QCoreWlanEngine::getInterfaceFromId(const QString &id) { QMutexLocker locker(&mutex); - return configurationInterface.value(id); + return scanThread->configurationInterface.value(id); } bool QCoreWlanEngine::hasIdentifier(const QString &id) { QMutexLocker locker(&mutex); - return configurationInterface.contains(id); + return scanThread->configurationInterface.contains(id); } void QCoreWlanEngine::connectToId(const QString &id) @@ -195,13 +464,14 @@ void QCoreWlanEngine::connectToId(const QString &id) NSMutableDictionary *params = [NSMutableDictionary dictionaryWithCapacity:0]; QString wantedSsid; - bool using8021X = false; QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.value(id); - const QString idHash = QString::number(qHash(QLatin1String("corewlan:") + getNetworkNameFromSsid(ptr->name))); + const QString idHash = QString::number(qHash(QLatin1String("corewlan:") + ptr->name)); + const QString idHash2 = QString::number(qHash(QLatin1String("corewlan:") + scanThread->getNetworkNameFromSsid(ptr->name))); - if (idHash != id) { + bool using8021X = false; + if (idHash2 != id) { NSArray *array = [CW8021XProfile allUser8021XProfiles]; for (NSUInteger i = 0; i < [array count]; ++i) { @@ -210,7 +480,7 @@ void QCoreWlanEngine::connectToId(const QString &id) const QString ssidHash = QString::number(qHash(QLatin1String("corewlan:") + qt_mac_NSStringToQString([[array objectAtIndex:i] ssid]))); if (id == networkNameHashCheck || id == ssidHash) { - const QString thisName = getSsidFromNetworkName(id); + const QString thisName = scanThread->getSsidFromNetworkName(id); if (thisName.isEmpty()) wantedSsid = id; else @@ -225,24 +495,25 @@ void QCoreWlanEngine::connectToId(const QString &id) if (!using8021X) { QString wantedNetwork; - QMapIterator > i(userProfiles); + QMapIterator > i(scanThread->userProfiles); while (i.hasNext()) { i.next(); wantedNetwork = i.key(); const QString networkNameHash = QString::number(qHash(QLatin1String("corewlan:") + wantedNetwork)); if (id == networkNameHash) { - wantedSsid = getSsidFromNetworkName(wantedNetwork); + wantedSsid = scanThread->getSsidFromNetworkName(wantedNetwork); break; } } } NSDictionary *scanParameters = [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithBool:YES], kCWScanKeyMerge, + [NSNumber numberWithInt:kCWScanTypeFast], kCWScanKeyScanType, [NSNumber numberWithInteger:100], kCWScanKeyRestTime, qt_mac_QStringToNSString(wantedSsid), kCWScanKeySSID, nil]; - NSArray *scanArray = [NSArray arrayWithArray:[wifiInterface scanForNetworksWithParameters:scanParameters error:&err]]; + NSArray *scanArray = [wifiInterface scanForNetworksWithParameters:scanParameters error:&err]; if(!err) { for(uint row=0; row < [scanArray count]; row++ ) { @@ -261,326 +532,110 @@ void QCoreWlanEngine::connectToId(const QString &id) attributes[0].data = (void *)[account UTF8String]; attributes[0].length = [account length]; - attributes[1].tag = kSecDescriptionItemAttr; - attributes[1].data = (void *)[keyKind UTF8String]; - attributes[1].length = [keyKind length]; - - attributes[2].tag = kSecLabelItemAttr; - attributes[2].data = (void *)[keyName UTF8String]; - attributes[2].length = [keyName length]; - - SecKeychainAttributeList attributeList = {3,attributes}; - - SecKeychainSearchRef searchRef; - SecKeychainSearchCreateFromAttributes(NULL, kSecGenericPasswordItemClass, &attributeList, &searchRef); - - NSString *password = @""; - SecKeychainItemRef searchItem; - - if (SecKeychainSearchCopyNext(searchRef, &searchItem) == noErr) { - UInt32 realPasswordLength; - SecKeychainAttribute attributesW[8]; - attributesW[0].tag = kSecAccountItemAttr; - SecKeychainAttributeList listW = {1,attributesW}; - char *realPassword; - OSStatus status = SecKeychainItemCopyContent(searchItem, NULL, &listW, &realPasswordLength,(void **)&realPassword); - - if (status == noErr) { - if (realPassword != NULL) { - - QByteArray pBuf; - pBuf.resize(realPasswordLength); - pBuf.prepend(realPassword); - pBuf.insert(realPasswordLength,'\0'); - - password = [NSString stringWithUTF8String:pBuf]; - } - SecKeychainItemFreeContent(&listW, realPassword); - } - - CFRelease(searchItem); - } else { - qDebug() << "SecKeychainSearchCopyNext error"; - } - [params setValue: password forKey: kCWAssocKeyPassphrase]; - } // end using8021X - - - bool result = [wifiInterface associateToNetwork: apNetwork parameters:[NSDictionary dictionaryWithDictionary:params] error:&err]; - - if(!err) { - if(!result) { - emit connectionError(id, ConnectError); - } else { - return; - } - } else { - qDebug() <<"associate ERROR"<< qt_mac_NSStringToQString([err localizedDescription ]); - } - } - } //end scan network - } else { - qDebug() <<"scan ERROR"<< qt_mac_NSStringToQString([err localizedDescription ]); - } - emit connectionError(id, InterfaceLookupError); - } - - locker.unlock(); - emit connectionError(id, InterfaceLookupError); -} - -void QCoreWlanEngine::disconnectFromId(const QString &id) -{ - QMutexLocker locker(&mutex); - - QString interfaceString = getInterfaceFromId(id); - QMacCocoaAutoReleasePool pool; - - CWInterface *wifiInterface = - [CWInterface interfaceWithName: qt_mac_QStringToNSString(interfaceString)]; - - [wifiInterface disassociate]; - if ([[wifiInterface interfaceState]intValue] != kCWInterfaceStateInactive) { - locker.unlock(); - emit connectionError(id, DisconnectionError); - locker.relock(); - } -} - -void QCoreWlanEngine::requestUpdate() -{ - getUserConfigurations(); - doRequestUpdate(); -} - -void QCoreWlanEngine::doRequestUpdate() -{ - QMutexLocker locker(&mutex); - - QMacCocoaAutoReleasePool pool; - - QStringList previous = accessPointConfigurations.keys(); - - NSArray *wifiInterfaces = [CWInterface supportedInterfaces]; - for (uint row = 0; row < [wifiInterfaces count]; ++row) { - foreach (const QString &interface, - scanForSsids(qt_mac_NSStringToQString([wifiInterfaces objectAtIndex:row]))) { - previous.removeAll(interface); - } - } - - while (!previous.isEmpty()) { - QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.take(previous.takeFirst()); - - configurationInterface.remove(ptr->id); - - locker.unlock(); - emit configurationRemoved(ptr); - locker.relock(); - } - - locker.unlock(); - emit updateCompleted(); -} - -QString QCoreWlanEngine::getSsidFromNetworkName(const QString &name) -{ - QMapIterator > i(userProfiles); - while (i.hasNext()) { - i.next(); - QMap map = i.value(); - QMapIterator ij(i.value()); - while (ij.hasNext()) { - ij.next(); - const QString networkNameHash = QString::number(qHash(QLatin1String("corewlan:") + i.key())); - if (name == i.key() || name == networkNameHash) { - return ij.key(); - } - } - } - return QString(); -} - -QString QCoreWlanEngine::getNetworkNameFromSsid(const QString &ssid) -{ - QMapIterator > i(userProfiles); - while (i.hasNext()) { - i.next(); - QMap map = i.value(); - QMapIterator ij(i.value()); - while (ij.hasNext()) { - ij.next(); - if(ij.key() == ssid) { - return i.key(); - } - } - } - return QString(); -} - -QStringList QCoreWlanEngine::scanForSsids(const QString &interfaceName) -{ - QMutexLocker locker(&mutex); - - QStringList found; - - if(!hasWifi) { - return found; - } - QMacCocoaAutoReleasePool pool; - - CWInterface *currentInterface = [CWInterface interfaceWithName:qt_mac_QStringToNSString(interfaceName)]; - QStringList addedConfigs; - - if([currentInterface power]) { - NSError *err = nil; - NSDictionary *parametersDict = [NSDictionary dictionaryWithObjectsAndKeys: - [NSNumber numberWithBool:YES], kCWScanKeyMerge, - [NSNumber numberWithInt:kCWScanTypeFast], kCWScanKeyScanType, // get the networks in the scan cache - [NSNumber numberWithInteger:100], kCWScanKeyRestTime, nil]; - NSArray* apArray = [currentInterface scanForNetworksWithParameters:parametersDict error:&err]; - CWNetwork *apNetwork; - if (!err) { - - for(uint row=0; row < [apArray count]; row++ ) { - apNetwork = [apArray objectAtIndex:row]; + attributes[1].tag = kSecDescriptionItemAttr; + attributes[1].data = (void *)[keyKind UTF8String]; + attributes[1].length = [keyKind length]; - const QString networkSsid = qt_mac_NSStringToQString([apNetwork ssid]); + attributes[2].tag = kSecLabelItemAttr; + attributes[2].data = (void *)[keyName UTF8String]; + attributes[2].length = [keyName length]; - const QString id = QString::number(qHash(QLatin1String("corewlan:") + networkSsid)); - found.append(id); + SecKeychainAttributeList attributeList = {3,attributes}; - QNetworkConfiguration::StateFlags state = QNetworkConfiguration::Undefined; - bool known = isKnownSsid(networkSsid); - if( [currentInterface.interfaceState intValue] == kCWInterfaceStateRunning) { - if( networkSsid == qt_mac_NSStringToQString( [currentInterface ssid])) { - state = QNetworkConfiguration::Active; - } - } - if(state == QNetworkConfiguration::Undefined) { - if(known) { - state = QNetworkConfiguration::Discovered; - } else { - state = QNetworkConfiguration::Undefined; - } - } - QNetworkConfiguration::Purpose purpose = QNetworkConfiguration::UnknownPurpose; - if([[apNetwork securityMode] intValue] == kCWSecurityModeOpen) { - purpose = QNetworkConfiguration::PublicPurpose; - } else { - purpose = QNetworkConfiguration::PrivatePurpose; - } + SecKeychainSearchRef searchRef; + SecKeychainSearchCreateFromAttributes(NULL, kSecGenericPasswordItemClass, &attributeList, &searchRef); - found.append(foundNetwork(id, networkSsid, state, interfaceName, purpose)); + NSString *password = @""; + SecKeychainItemRef searchItem; - } //end row - } //end error - } // endwifi power + if (SecKeychainSearchCopyNext(searchRef, &searchItem) == noErr) { + UInt32 realPasswordLength; + SecKeychainAttribute attributesW[8]; + attributesW[0].tag = kSecAccountItemAttr; + SecKeychainAttributeList listW = {1,attributesW}; + char *realPassword; + OSStatus status = SecKeychainItemCopyContent(searchItem, NULL, &listW, &realPasswordLength,(void **)&realPassword); - // add known configurations that are not around. - QMapIterator > i(userProfiles); - while (i.hasNext()) { - i.next(); + if (status == noErr) { + if (realPassword != NULL) { - QString networkName = i.key(); - const QString id = QString::number(qHash(QLatin1String("corewlan:") + networkName)); + QByteArray pBuf; + pBuf.resize(realPasswordLength); + pBuf.prepend(realPassword); + pBuf.insert(realPasswordLength,'\0'); - if(!found.contains(id)) { - QString networkSsid = getSsidFromNetworkName(networkName); - const QString ssidId = QString::number(qHash(QLatin1String("corewlan:") + networkSsid)); - QNetworkConfiguration::StateFlags state = QNetworkConfiguration::Undefined; - QString interfaceName; - QMapIterator ij(i.value()); - while (ij.hasNext()) { - ij.next(); - interfaceName = ij.value(); - } + password = [NSString stringWithUTF8String:pBuf]; + } + SecKeychainItemFreeContent(&listW, realPassword); + } - if( [currentInterface.interfaceState intValue] == kCWInterfaceStateRunning) { - if( networkSsid == qt_mac_NSStringToQString([currentInterface ssid])) { - state = QNetworkConfiguration::Active; - } - } - if(state == QNetworkConfiguration::Undefined) { - if( userProfiles.contains(networkName) - && found.contains(ssidId)) { - state = QNetworkConfiguration::Discovered; - } - } + CFRelease(searchItem); + } else { + qDebug() << "SecKeychainSearchCopyNext error"; + } + [params setValue: password forKey: kCWAssocKeyPassphrase]; + } // end using8021X - if(state == QNetworkConfiguration::Undefined) { - state = QNetworkConfiguration::Defined; - } - found.append(foundNetwork(id, networkName, state, interfaceName, QNetworkConfiguration::UnknownPurpose)); + bool result = [wifiInterface associateToNetwork: apNetwork parameters:[NSDictionary dictionaryWithDictionary:params] error:&err]; + + if(!err) { + if(!result) { + emit connectionError(id, ConnectError); + } else { + return; + } + } else { + qDebug() <<"associate ERROR"<< qt_mac_NSStringToQString([err localizedDescription ]); + } + } + } //end scan network + } else { + qDebug() <<"scan ERROR"<< qt_mac_NSStringToQString([err localizedDescription ]); } + emit connectionError(id, InterfaceLookupError); } - return found; + + locker.unlock(); + emit connectionError(id, InterfaceLookupError); } -QStringList QCoreWlanEngine::foundNetwork(const QString &id, const QString &name, const QNetworkConfiguration::StateFlags state, const QString &interfaceName, const QNetworkConfiguration::Purpose purpose) +void QCoreWlanEngine::disconnectFromId(const QString &id) { - QStringList found; QMutexLocker locker(&mutex); - if (accessPointConfigurations.contains(id)) { - QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.value(id); - - bool changed = false; - - ptr->mutex.lock(); - - if (!ptr->isValid) { - ptr->isValid = true; - changed = true; - } - - if (ptr->name != name) { - ptr->name = name; - changed = true; - } - if (ptr->id != id) { - ptr->id = id; - changed = true; - } + QString interfaceString = getInterfaceFromId(id); + QMacCocoaAutoReleasePool pool; - if (ptr->state != state) { - ptr->state = state; - changed = true; - } + CWInterface *wifiInterface = + [CWInterface interfaceWithName: qt_mac_QStringToNSString(interfaceString)]; - if (ptr->purpose != purpose) { - ptr->purpose = purpose; - changed = true; - } - ptr->mutex.unlock(); + [wifiInterface disassociate]; + if ([[wifiInterface interfaceState]intValue] != kCWInterfaceStateInactive) { + locker.unlock(); + emit connectionError(id, DisconnectionError); + locker.relock(); + } +} - if (changed) { - locker.unlock(); - emit configurationChanged(ptr); - locker.relock(); - } - found.append(id); - } else { - QNetworkConfigurationPrivatePointer ptr(new QNetworkConfigurationPrivate); +void QCoreWlanEngine::requestUpdate() +{ + scanThread->getUserConfigurations(); + doRequestUpdate(); +} - ptr->name = name; - ptr->isValid = true; - ptr->id = id; - ptr->state = state; - ptr->type = QNetworkConfiguration::InternetAccessPoint; - ptr->bearer = QLatin1String("WLAN"); - ptr->purpose = purpose; +void QCoreWlanEngine::doRequestUpdate() +{ + QMutexLocker locker(&mutex); - accessPointConfigurations.insert(ptr->id, ptr); - configurationInterface.insert(ptr->id, interfaceName); + QMacCocoaAutoReleasePool pool; - locker.unlock(); - emit configurationAdded(ptr); - locker.relock(); - found.append(id); + NSArray *wifiInterfaces = [CWInterface supportedInterfaces]; + for (uint row = 0; row < [wifiInterfaces count]; ++row) { + scanThread->interfaceName = qt_mac_NSStringToQString([wifiInterfaces objectAtIndex:row]); + scanThread->start(); } - return found; + locker.unlock(); } bool QCoreWlanEngine::isWifiReady(const QString &wifiDeviceName) @@ -596,20 +651,6 @@ bool QCoreWlanEngine::isWifiReady(const QString &wifiDeviceName) return false; } -bool QCoreWlanEngine::isKnownSsid(const QString &ssid) -{ - QMutexLocker locker(&mutex); - - QMapIterator > i(userProfiles); - while (i.hasNext()) { - i.next(); - QMap map = i.value(); - if(map.keys().contains(ssid)) { - return true; - } - } - return false; -} QNetworkSession::State QCoreWlanEngine::sessionStateForId(const QString &id) { @@ -644,7 +685,6 @@ QNetworkConfigurationManager::Capabilities QCoreWlanEngine::capabilities() const void QCoreWlanEngine::startNetworkChangeLoop() { - storeSession = NULL; SCDynamicStoreContext dynStoreContext = { 0, this/*(void *)storeSession*/, NULL, NULL, NULL }; storeSession = SCDynamicStoreCreate(NULL, @@ -711,74 +751,73 @@ bool QCoreWlanEngine::requiresPolling() const return true; } -void QCoreWlanEngine::getUserConfigurations() +void QCoreWlanEngine::networksChanged() { - QMacCocoaAutoReleasePool pool; - userProfiles.clear(); + QMutexLocker locker(&mutex); - NSArray *wifiInterfaces = [CWInterface supportedInterfaces]; - for(uint row=0; row < [wifiInterfaces count]; row++ ) { + QStringList previous = accessPointConfigurations.keys(); - CWInterface *wifiInterface = [CWInterface interfaceWithName: [wifiInterfaces objectAtIndex:row]]; - NSString *nsInterfaceName = [wifiInterface name]; -// add user configured system networks - SCDynamicStoreRef dynRef = SCDynamicStoreCreate(kCFAllocatorSystemDefault, (CFStringRef)@"Qt corewlan", nil, nil); - NSDictionary *airportPlist = (NSDictionary *)SCDynamicStoreCopyValue(dynRef, (CFStringRef)[[NSString stringWithFormat:@"Setup:/Network/Interface/%@/AirPort", nsInterfaceName] autorelease]); - CFRelease(dynRef); + QList foundConfigurations = scanThread->getConfigurations(); + while (!foundConfigurations.isEmpty()) { + QNetworkConfigurationPrivate *cpPriv = foundConfigurations.takeFirst(); - NSDictionary *prefNetDict = [airportPlist objectForKey:@"PreferredNetworks"]; + previous.removeAll(cpPriv->id); - NSArray *thisSsidarray = [prefNetDict valueForKey:@"SSID_STR"]; - for(NSString *ssidkey in thisSsidarray) { - QString thisSsid = qt_mac_NSStringToQString(ssidkey); - if(!userProfiles.contains(thisSsid)) { - QMap map; - map.insert(thisSsid, qt_mac_NSStringToQString(nsInterfaceName)); - userProfiles.insert(thisSsid, map); + if (accessPointConfigurations.contains(cpPriv->id)) { + QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.value(cpPriv->id); + + bool changed = false; + + ptr->mutex.lock(); + + if (ptr->isValid != cpPriv->isValid) { + ptr->isValid = cpPriv->isValid; + changed = true; } - } - CFRelease(airportPlist); - // 802.1X user profiles - QString userProfilePath = QDir::homePath() + "/Library/Preferences/com.apple.eap.profiles.plist"; - NSDictionary* eapDict = [[NSDictionary alloc] initWithContentsOfFile:qt_mac_QStringToNSString(userProfilePath)]; - NSString *profileStr= @"Profiles"; - NSString *nameStr = @"UserDefinedName"; - NSString *networkSsidStr = @"Wireless Network"; - for (id profileKey in eapDict) { - if ([profileStr isEqualToString:profileKey]) { - NSDictionary *itemDict = [eapDict objectForKey:profileKey]; - for (id itemKey in itemDict) { + if (ptr->name != cpPriv->name) { + ptr->name = cpPriv->name; + changed = true; + } - NSInteger dictSize = [itemKey count]; - id objects[dictSize]; - id keys[dictSize]; + if (ptr->state != cpPriv->state) { + ptr->state = cpPriv->state; + changed = true; + } - [itemKey getObjects:objects andKeys:keys]; - QString networkName; - QString ssid; - for(int i = 0; i < dictSize; i++) { - if([nameStr isEqualToString:keys[i]]) { - networkName = qt_mac_NSStringToQString(objects[i]); - } - if([networkSsidStr isEqualToString:keys[i]]) { - ssid = qt_mac_NSStringToQString(objects[i]); - } - if(!userProfiles.contains(networkName) - && !ssid.isEmpty()) { - QMap map; - map.insert(ssid, qt_mac_NSStringToQString(nsInterfaceName)); - userProfiles.insert(networkName, map); - } - } - } - [itemDict release]; + ptr->mutex.unlock(); + + if (changed) { + locker.unlock(); + emit configurationChanged(ptr); + locker.relock(); } + + delete cpPriv; + } else { + QNetworkConfigurationPrivatePointer ptr(cpPriv); + + accessPointConfigurations.insert(ptr->id, ptr); + + locker.unlock(); + emit configurationAdded(ptr); + locker.relock(); } - [eapDict release]; } + + while (!previous.isEmpty()) { + QNetworkConfigurationPrivatePointer ptr = + accessPointConfigurations.take(previous.takeFirst()); + + locker.unlock(); + emit configurationRemoved(ptr); + locker.relock(); + } + + locker.unlock(); + emit updateCompleted(); + } -QT_END_NAMESPACE -#endif // QT_NO_BEARERMANAGEMENT +QT_END_NAMESPACE -- cgit v0.12 From 73a1291a3f097787f00d79d0d27bd75219bf8e3d Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Mon, 19 Apr 2010 08:58:24 +0200 Subject: Report the error as being AlreadyExists if this is why it fails On Windows it would never report this error, and on Unix it would report a different error ulimately instead as it tried to obtain the semaphore a second time which could cause a different error to what should be reported. Task-number: QTBUG-9610 Reviewed-by: Frans Englich --- src/corelib/kernel/qsystemsemaphore_unix.cpp | 2 +- src/corelib/kernel/qsystemsemaphore_win.cpp | 8 +++++-- .../qsystemsemaphore/tst_qsystemsemaphore.cpp | 25 ++++++++++++++++++++++ 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/src/corelib/kernel/qsystemsemaphore_unix.cpp b/src/corelib/kernel/qsystemsemaphore_unix.cpp index 07e3618..d6c6c37 100644 --- a/src/corelib/kernel/qsystemsemaphore_unix.cpp +++ b/src/corelib/kernel/qsystemsemaphore_unix.cpp @@ -145,10 +145,10 @@ key_t QSystemSemaphorePrivate::handle(QSystemSemaphore::AccessMode mode) // Get semaphore semaphore = semget(unix_key, 1, 0666 | IPC_CREAT | IPC_EXCL); if (-1 == semaphore) { + setErrorString(QLatin1String("QSystemSemaphore::handle")); if (errno == EEXIST) semaphore = semget(unix_key, 1, 0666 | IPC_CREAT); if (-1 == semaphore) { - setErrorString(QLatin1String("QSystemSemaphore::handle")); cleanHandle(); return -1; } diff --git a/src/corelib/kernel/qsystemsemaphore_win.cpp b/src/corelib/kernel/qsystemsemaphore_win.cpp index 96a47f5..74f253a 100644 --- a/src/corelib/kernel/qsystemsemaphore_win.cpp +++ b/src/corelib/kernel/qsystemsemaphore_win.cpp @@ -69,6 +69,10 @@ void QSystemSemaphorePrivate::setErrorString(const QString &function) error = QSystemSemaphore::PermissionDenied; errorString = QCoreApplication::translate("QSystemSemaphore", "%1: permission denied").arg(function); break; + case ERROR_ALREADY_EXISTS: + error = QSystemSemaphore::AlreadyExists; + errorString = QCoreApplication::translate("QSystemSemaphore", "%1: already exists").arg(function); + break; default: errorString = QCoreApplication::translate("QSystemSemaphore", "%1: unknown error %2").arg(function).arg(windowsError); error = QSystemSemaphore::UnknownError; @@ -88,8 +92,8 @@ HANDLE QSystemSemaphorePrivate::handle(QSystemSemaphore::AccessMode) if (semaphore == 0) { QString safeName = makeKeyFileName(); semaphore = CreateSemaphore(0, initialValue, MAXLONG, (wchar_t*)safeName.utf16()); - if (semaphore == NULL) - setErrorString(QLatin1String("QSystemSemaphore::handle")); + // If the semaphore exists then the handle is still valid but there is still an error + setErrorString(QLatin1String("QSystemSemaphore::handle")); } return semaphore; diff --git a/tests/auto/qtipc/qsystemsemaphore/tst_qsystemsemaphore.cpp b/tests/auto/qtipc/qsystemsemaphore/tst_qsystemsemaphore.cpp index eb82fd4..0dc9c99 100644 --- a/tests/auto/qtipc/qsystemsemaphore/tst_qsystemsemaphore.cpp +++ b/tests/auto/qtipc/qsystemsemaphore/tst_qsystemsemaphore.cpp @@ -76,6 +76,8 @@ private slots: void undo(); void initialValue(); + void exists(); + private: QSystemSemaphore *existingLock; @@ -297,6 +299,29 @@ void tst_QSystemSemaphore::initialValue() release.waitForFinished(LACKYWAITTIME); QVERIFY(acquire.state()== QProcess::NotRunning); } + +void tst_QSystemSemaphore::exists() +{ + QSystemSemaphore sem("store", 1, QSystemSemaphore::Create); + QVERIFY(sem.error() == QSystemSemaphore::NoError); + QVERIFY(sem.acquire()); + QVERIFY(sem.error() == QSystemSemaphore::NoError); + + { + QSystemSemaphore dupSem("store", 1, QSystemSemaphore::Create); + QVERIFY(dupSem.error() == QSystemSemaphore::AlreadyExists); + } +#ifndef Q_OS_UNIX + // The rest of the test does not make sense on Unix because open will + // actually succeed anyway (see QSystemSemaphore docs) + QSystemSemaphore anotherSem("store", 1, QSystemSemaphore::Open); + QVERIFY(anotherSem.error() == QSystemSemaphore::AlreadyExists); + QVERIFY(sem.release()); + QVERIFY(anotherSem.acquire()); + QVERIFY(anotherSem.release()); +#endif +} + QTEST_MAIN(tst_QSystemSemaphore) #include "tst_qsystemsemaphore.moc" -- cgit v0.12 From 0a509ce8633c49e19f52c08b74c9b54d0227f033 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 19 Apr 2010 10:01:50 +0200 Subject: Fix compile warning. --- tools/designer/src/components/propertyeditor/propertyeditor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/designer/src/components/propertyeditor/propertyeditor.cpp b/tools/designer/src/components/propertyeditor/propertyeditor.cpp index 86d7bdf..a8ca8ad 100644 --- a/tools/designer/src/components/propertyeditor/propertyeditor.cpp +++ b/tools/designer/src/components/propertyeditor/propertyeditor.cpp @@ -135,7 +135,7 @@ QSize ElidingLabel::sizeHint() const return size; } -void ElidingLabel::paintEvent(QPaintEvent *e) { +void ElidingLabel::paintEvent(QPaintEvent *) { QPainter painter(this); painter.setPen(QColor(0, 0, 0, 60)); painter.setBrush(QColor(255, 255, 255, 40)); -- cgit v0.12 From a0b75798032cb9916121ebc2277c9a950aa9a26f Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 19 Apr 2010 10:51:25 +0200 Subject: I10n: Update German translations for 4.7.0 --- translations/assistant_de.ts | 40 +-- translations/designer_de.ts | 95 ++++-- translations/linguist_de.ts | 27 +- translations/qt_de.ts | 744 +++++++++++++++++++++++++++++++------------ translations/qt_help_de.ts | 26 +- 5 files changed, 648 insertions(+), 284 deletions(-) diff --git a/translations/assistant_de.ts b/translations/assistant_de.ts index 0a0d37f..bfafc71 100644 --- a/translations/assistant_de.ts +++ b/translations/assistant_de.ts @@ -147,7 +147,7 @@ Grund: Lesezeichen verwalten... - + Add Bookmark... Lesezeichen hinzufügen ... @@ -190,7 +190,7 @@ Grund: CentralWidget - + Add new page Neue Seite hinzufügen @@ -488,19 +488,19 @@ Grund: MainWindow - + Index Index - - + + Contents Inhalt - - + + Bookmarks Lesezeichen @@ -510,14 +510,14 @@ Grund: Suchen - - + + Qt Assistant Qt Assistant - + Page Set&up... S&eite einrichten ... @@ -532,17 +532,17 @@ Grund: &Drucken ... - + New &Tab Neuer &Reiter - + &Close Tab Reiter &schließen - + &Quit &Beenden @@ -662,17 +662,17 @@ Grund: Ctrl+Alt+Left - + Could not register file '%1': %2 Die Datei '%1' konnte nicht registriert werden: %2 - + About... Über ... - + Navigation Toolbar Navigationsleiste @@ -717,12 +717,12 @@ Grund: Suchindex wird aufgebaut - + Looking for Qt Documentation... Suche nach Qt-Dokumentation ... - + &Window &Fenster @@ -742,12 +742,12 @@ Grund: Zoom - + &File &Datei - + &Edit &Bearbeiten diff --git a/translations/designer_de.ts b/translations/designer_de.ts index 475a5d5..b508b7f 100644 --- a/translations/designer_de.ts +++ b/translations/designer_de.ts @@ -180,12 +180,12 @@ BrushPropertyManager - + Style Stil - + No brush Kein Muster @@ -260,7 +260,7 @@ Kreuzende Diagonalen - + Color Farbe @@ -741,7 +741,7 @@ Designer - + Qt Designer Qt Designer @@ -1202,7 +1202,7 @@ MainWindowBase - + Main Not currently used (main tool bar) Haupt-Werkzeugleiste @@ -1579,7 +1579,7 @@ Script: %3 QDesignerActions - + Edit Widgets Widgets bearbeiten @@ -1604,17 +1604,17 @@ Script: %3 Einstellungen... - + Clear &Menu Menü &löschen - + CTRL+SHIFT+S CTRL+SHIFT+S - + CTRL+R CTRL+R @@ -1668,7 +1668,7 @@ Script: %3 Designer-UI-Dateien (*.%1);;Alle Dateien (*) - + %1 already exists. Do you want to replace it? Die Datei %1 existiert bereits. @@ -1680,7 +1680,7 @@ Möchten Sie sie überschreiben? Das Formular %1 wurde gespeichert... - + &Recent Forms &Zuletzt bearbeitete Formulare @@ -1764,7 +1764,7 @@ Möchten Sie einen anderen Namen eingeben oder ein neues Formular erzeugen?Vorschau &schließen - + Save &Image... &Vorschaubild speichern... @@ -1779,7 +1779,7 @@ Möchten Sie einen anderen Namen eingeben oder ein neues Formular erzeugen?&Zusätzliche Schriftarten... - + The file %1 could not be opened. Reason: %2 Would you like to retry or select a different file? @@ -1813,7 +1813,7 @@ Möchten Sie es noch einmal versuchen? Die Datei %1 konnte nicht geschrieben werden. - + &New... &Neu... @@ -1844,17 +1844,17 @@ Möchten Sie es noch einmal versuchen? - + &Close &Schließen - + View &Code... &Code anzeigen... - + Save Form As Formular unter einem anderen Namen speichern @@ -1886,7 +1886,7 @@ Möchten Sie es noch einmal versuchen? %1 wurde gedruckt. - + ALT+CTRL+S ALT+CTRL+S @@ -2085,7 +2085,7 @@ Möchten Sie es noch einmal versuchen? QDesignerPropertySheet - + Dynamic Properties Dynamische Eigenschaften @@ -2098,14 +2098,14 @@ Möchten Sie es noch einmal versuchen? Der Layout-Typ '%1' wird nicht unterstützt; es wurde ein Grid-Layout erzeugt. - + The container extension of the widget '%1' (%2) returned a widget not managed by Designer '%3' (%4) when queried for page #%5. Container pages should only be added by specifying them in XML returned by the domXml() method of the custom widget. Die Container-Extension des Widgets '%1' (%2) gab für Seite %5 ein Widget '%3' (%4) zurück, was nicht von Designer verwaltet wird. Container-Seiten sollten ausschließlich im XML der domXML()-Methode spezifiziert werden. - + Unexpected element <%1> Parsing clipboard contents Ungültiges Element <%1> @@ -2207,12 +2207,12 @@ Container-Seiten sollten ausschließlich im XML der domXML()-Methode spezifizier Werkzeugleisten - + Save Forms? Formulare speichern? - + &View &Ansicht @@ -2227,7 +2227,7 @@ Container-Seiten sollten ausschließlich im XML der domXML()-Methode spezifizier Widgetbox - + If you do not review your documents, all your changes will be lost. Die Änderungen gehen verloren, wenn Sie sich die Formulare nicht noch einmal ansehen. @@ -3497,7 +3497,7 @@ Dies kann zum Beispiel eine Sprachkennung wie "_de" sein. QtResourceView - + Size: %1 x %2 %3 Größe: %1 x %2 @@ -3908,6 +3908,26 @@ Möchten Sie sie überschreiben? + File + Datei + + + + Edit + Bearbeiten + + + + Tools + Werkzeuge + + + + Form + Formular + + + Toolbars Werkzeugleisten @@ -4698,9 +4718,14 @@ Möchten Sie sie überschreiben? qdesigner_internal::FilterWidget - - <Filter> - <Filter> + + Filter + Filter + + + + Clear text + Text löschen @@ -4827,7 +4852,7 @@ Möchten Sie sie überschreiben? qdesigner_internal::FormWindowBase - + Delete Löschen @@ -4997,7 +5022,7 @@ Möchten Sie sie überschreiben? Formular&einstellungen... - + Break Layout Layout auflösen @@ -5018,7 +5043,7 @@ Möchten Sie sie überschreiben? Formulareinstellungen - %1 - + Removes empty columns and rows Entfernt unbesetzte Zeilen und Spalten @@ -5975,7 +6000,7 @@ ate the goose who was loose. qdesigner_internal::PropertyEditor - + Add Dynamic Property... Dynamische Eigenschaft hinzufügen... @@ -5995,14 +6020,14 @@ ate the goose who was loose. Detailansicht - + Object: %1 Class: %2 Objekt: %1 Klasse: %2 - + Sorting Sortiert @@ -6012,7 +6037,7 @@ Klasse: %2 Farbige Hervorhebung - + Configure Property Editor Anzeige der Eigenschaften konfigurieren diff --git a/translations/linguist_de.ts b/translations/linguist_de.ts index 14095ba..5597458 100644 --- a/translations/linguist_de.ts +++ b/translations/linguist_de.ts @@ -453,7 +453,7 @@ Es wird mit einer einfachen Universalform gearbeitet. Ctrl+Q - + &Save &Speichern @@ -909,7 +909,7 @@ Es wird mit einer einfachen Universalform gearbeitet. Freigeben unter ... - + This is the application's main window. @@ -1023,12 +1023,12 @@ Soll die erstgenannte Datei übersprungen werden? - + Release Freigeben - + Qt message files for released applications (*.qm) All files (*) Qt-Nachrichtendateien (*.qm) @@ -1095,7 +1095,7 @@ Alle Dateien (*) - + @@ -1104,7 +1104,7 @@ Alle Dateien (*) Qt Linguist - + Cannot find the string '%1'. Kann Zeichenkette '%1' nicht finden. @@ -1233,7 +1233,7 @@ Alle Dateien (*) Es wurden alle Übersetzungseinheiten abgearbeitet. - + &Window &Fenster @@ -1493,7 +1493,7 @@ Alle Dateien (*) Display information about the Qt toolkit by Nokia. - + Zeigt Informationen über das Qt-Toolkit von Nokia an. @@ -1797,7 +1797,7 @@ Zeile: %2 Kompilierte Qt-Übersetzungen - + Translation files (%1);; Übersetzungsdateien (%1);; @@ -1818,11 +1818,16 @@ Zeile: %2 Qt Linguist - + GNU Gettext localization files GNU-Gettext-Übersetzungsdateien + + GNU Gettext localization template files + Vorlagen für GNU-Gettext-Übersetzungsdateien + + Qt translation sources (format 1.1) Qt-Übersetzungsdateien (Formatversion 1.1) @@ -1838,7 +1843,7 @@ Zeile: %2 Qt-Übersetzungsdateien (aktuelles Format) - + XLIFF localization files XLIFF-Übersetzungsdateien diff --git a/translations/qt_de.ts b/translations/qt_de.ts index ec7e786..86d5edb 100644 --- a/translations/qt_de.ts +++ b/translations/qt_de.ts @@ -12,7 +12,7 @@ FakeReply - + Fake error ! Fake error ! @@ -25,7 +25,7 @@ MAC_APPLICATION_MENU - + Services Dienste @@ -44,6 +44,21 @@ Show All Alle anzeigen + + + Preferences... + Einstellungen... + + + + Quit %1 + %1 beenden + + + + About %1 + Über %1 + Phonon:: @@ -81,25 +96,32 @@ Phonon::AudioOutput - + + <html>The audio playback device <b>%1</b> does not work.<br/>Falling back to <b>%2</b>.</html> <html>Das Audiogerät <b>%1</b> funktioniert nicht.<br/>Es wird stattdessen <b>%2</b> verwendet.</html> - + <html>Switching to the audio playback device <b>%1</b><br/>which just became available and has higher preference.</html> <html>Das Audiogerät <b>%1</b> wurde aktiviert,<br/>da es gerade verfügbar und höher priorisiert ist.</html> + Revert back to device '%1' Zurückschalten zum Gerät '%1' + + + <html>Switching to the audio playback device <b>%1</b><br/>which has higher preference or is specifically configured for this stream.</html> + <html>Es wird zum Audiogerät <b>%1</b> geschaltet, <br/>da es höher priorisiert ist oder spezifisch für diesen Stream konfiguriert wurde.</html> + Phonon::Gstreamer::Backend - + Warning: You do not seem to have the package gstreamer0.10-plugins-good installed. Some video features have been disabled. Achtung: Das Paket gstreamer0.10-plugins-good ist nicht installiert. @@ -116,7 +138,7 @@ Die Audio- und Video-Unterstützung steht nicht zur Verfügung. Phonon::Gstreamer::MediaObject - + Cannot start playback. Check your GStreamer installation and make sure you @@ -126,29 +148,39 @@ have libgstreamer-plugins-base installed. Bitte überprüfen Sie Ihre GStreamer-Installation und stellen Sie sicher, dass das Paket libgstreamer-plugins-base installiert ist. - + + Missing codec helper script assistant. + Der Skript-Hilfsassistent des Codecs fehlt. + + + + Plugin codec installation failed for codec: %0 + Die Installation des Codec-Plugins schlug fehl für: %0 + + + A required codec is missing. You need to install the following codec(s) to play this content: %0 Es sind nicht alle erforderlichen Codecs installiert. Um diesen Inhalt abzuspielen, muss der folgende Codec installiert werden: %0 - - - - + - - + + + + + Could not open media source. Die Medienquelle konnte nicht geöffnet werden. - + Invalid source type. Ungültiger Typ der Medienquelle. - + Could not locate media source. Die Medienquelle konnte nicht gefunden werden. @@ -350,12 +382,40 @@ Bitte überprüfen Sie Ihre GStreamer-Installation und stellen Sie sicher, dass Die Lautstärke konnte nicht eingestellt werden - + + Loading clip failed + Das Laden des Clips schlug fehl + + + Playback complete Abspielen beendet + Phonon::MMF::AbstractVideoPlayer + + + Pause failed + Fehler bei Pause-Funktion + + + + Seek failed + Suchoperation fehlgeschlagen + + + + Getting position failed + Die Position konnte nicht bestimmt werden + + + + Opening clip failed + Der Clip konnte nicht geöffnet werden + + + Phonon::MMF::AudioEqualizer @@ -370,10 +430,17 @@ Bitte überprüfen Sie Ihre GStreamer-Installation und stellen Sie sicher, dass Getting position failed Die Position konnte nicht bestimmt werden + + + Phonon::MMF::DsaVideoPlayer - - Opening clip failed - Der Clip konnte nicht geöffnet werden + + + + + + Video display error + Fehler bei der Video-Anzeige @@ -450,7 +517,7 @@ Bitte überprüfen Sie Ihre GStreamer-Installation und stellen Sie sicher, dass Phonon::MMF::MediaObject - + Error opening source: type not supported Die Quelle konnte nicht geöffnet werden: Dieser Typ wird nicht unterstützt @@ -469,38 +536,10 @@ Bitte überprüfen Sie Ihre GStreamer-Installation und stellen Sie sicher, dass - Phonon::MMF::VideoPlayer - - - Pause failed - Fehler bei Pause-Funktion - + Phonon::MMF::SurfaceVideoPlayer + - Seek failed - Suchoperation fehlgeschlagen - - - - Getting position failed - Die Position konnte nicht bestimmt werden - - - - Opening clip failed - Der Clip konnte nicht geöffnet werden - - - - Buffering clip failed - Fehler beim Puffern des Clips - - - - - - - Video display error Fehler bei der Video-Anzeige @@ -1236,7 +1275,7 @@ nach Diese Socket-Operation wird nicht unterstützt - + Socket operation timed out Das Zeitlimit für die Operation wurde überschritten @@ -1281,7 +1320,7 @@ nach QApplication - + QT_LAYOUT_DIRECTION Translate this string to the string 'LTR' in left-to-right languages or to 'RTL' in right-to-left languages (such as Hebrew and Arabic) to get proper widget layout. LTR @@ -1409,7 +1448,7 @@ nach QComboBox - + Open Öffnen @@ -1558,7 +1597,7 @@ nach QDeclarativeAbstractAnimation - + Cannot animate non-existent property "%1" Die Eigenschaft '%1" existiert nicht und kann daher nicht animiert werden @@ -1571,19 +1610,19 @@ nach QDeclarativeAnchors - + Possible anchor loop detected on fill. Bei der Fülloperation wurde eine potentielle Endlosschleife der Anker festgestellt. - + Possible anchor loop detected on centerIn. Bei der Operation 'centerIn' wurde eine potentielle Endlosschleife der Anker festgestellt. - + - + Cannot anchor to an item that isn't a parent or sibling. Das Ziel eines Anker muss ein Elternelement oder Element der gleichen Ebene sein. @@ -1639,7 +1678,7 @@ nach QDeclarativeBehavior - + Cannot change the animation assigned to a Behavior. Die zu einem Behavior-Element gehörende Animation kann nicht geändert werden. @@ -1647,7 +1686,15 @@ nach QDeclarativeBinding - + + Binding loop detected for property "%1" + Bei der für die Eigenschaft "%1" angegebenen Bindung wurde eine Endlosschleife festgestellt + + + + QDeclarativeCompiledBindings + + Binding loop detected for property "%1" Bei der für die Eigenschaft "%1" angegebenen Bindung wurde eine Endlosschleife festgestellt @@ -1655,16 +1702,17 @@ nach QDeclarativeCompiler - - + + + - + Invalid property assignment: "%1" is a read-only property Ungültige Zuweisung bei Eigenschaft: "%1" ist schreibgeschützt - + Invalid property assignment: unknown enumeration Ungültige Zuweisung bei Eigenschaft: Ungültiger Aufzählungswert @@ -1749,12 +1797,12 @@ nach Ungültige Zuweisung bei Eigenschaft: Der Typ "%1" ist nicht unterstützt - + Element is not creatable. Das Element kann nicht erzeugt werden. - + Component elements may not contain properties other than id Komponenten dürfen außer id keine weiteren Eigenschaften enthalten. @@ -1770,12 +1818,12 @@ nach - + id is not unique ID-Wert nicht eindeutig - + Invalid component body specification Inhalt der Komponente ungültig @@ -1785,7 +1833,7 @@ nach Es kann keine leere Komponentenangabe erzeugt werden - + Invalid Script block. Specify either the source property or inline script Ungültiges Skript. Es muss die Eigenschaft oder ein eingebettetes Skript angegeben werden @@ -1795,7 +1843,7 @@ nach Ungültige Angabe für Skript - + Properties cannot be set on Script block Für ein Skript können keine Eigenschaften angegeben werden @@ -1805,12 +1853,7 @@ nach Ungültiges Skript - - Incorrectly specified signal - Ungültige Signalspezifikation - - - + Empty signal assignment Leere Signalzuweisung @@ -1843,12 +1886,12 @@ nach - + Cannot assign to non-existent property "%1" Es kann keine Zuweisung erfolgen, da keine Eigenschaft des Namens '%1" existiert - + Invalid use of namespace Ungültige Verwendung eines Namensraums @@ -1863,23 +1906,18 @@ nach Ungültige Verwendung einer Eigenschaft des Typs 'Id' - - id conflicts with type name - Der Wert der Id ist ungültig, da er bereits als Typnamen vergeben ist - - - - id conflicts with namespace prefix - Der Wert der Id ist ungültig, da er bereits als Namensraum vergeben ist + + Incorrectly specified signal assignment + - + Property has already been assigned a value Der Eigenschaft wurde bereits ein Wert zugewiesen - + Invalid grouped property access Falsche Gruppierung bei Zugriff auf Eigenschaft @@ -1895,7 +1933,7 @@ nach Ungültige Verwendung von Eigenschaften - + Property assignment expected Zuweisung an Eigenschaft erwartet @@ -1945,7 +1983,7 @@ nach "%1" kann nicht auf "%2" angewandt werden - + Duplicate default property Mehrfaches Auftreten der Vorgabe-Eigenschaft @@ -2000,7 +2038,7 @@ nach Ungültiger Typ der Eigenschaft - + Invalid empty ID Ungültiger (leerer) Id-Wert @@ -2050,7 +2088,7 @@ nach QDeclarativeComponent - + Invalid empty URL Ungültige (leere) URL @@ -2058,18 +2096,13 @@ nach QDeclarativeCompositeTypeManager - - + + Resource %1 unavailable Auf die Ressource %1 konnte nicht zugegriffen werden - - Import %1 unavailable - Import %1 nicht verfügbar - - - + Namespace %1 cannot be used as a type Der Namensraum %1 kann nicht als Typangabe verwendet werden @@ -2079,7 +2112,7 @@ nach %1 ist keine Typangabe - + Type %1 unavailable Der Typ %1 ist nicht verfügbar @@ -2142,11 +2175,48 @@ nach SQL: database version mismatch SQL: Die Version der Datenbank entspricht nicht der erwarteten Version + + + module "%1" definition "%2" not readable + Modul "%1" Definition "%2" kann nicht gelesen werden + + + + plugin cannot be loaded for module "%1": %2 + Das Plugin des Moduls "%1" konnte nicht geladen werden: %2 + + + + module "%1" plugin "%2" not found + Modul "%1" Plugin "%2" konnte nicht gefunden werden + + + + + module "%1" version %2.%3 is not installed + Modul "%1" Version %2.%3 ist nicht installiert + + + + module "%1" is not installed + Modul "%1" ist nicht installiert + + + + + "%1": no such directory + Das Verzeichnis "%1" existiert nicht + + + + import "%1" has no qmldir and no namespace + "qmldir" und Namensraum fehlt bei Import "%1" + QDeclarativeFlipable - + front is a write-once property 'front' kann nur einmal zugewiesen werden @@ -2159,7 +2229,7 @@ nach QDeclarativeInfo - + unknown location Unbekannter Ort @@ -2168,50 +2238,51 @@ nach QDeclarativeListModel - + remove: index %1 out of range remove: Der Index %1 ist außerhalb des gültigen Bereichs - + insert: value is not an object insert: Der Wert ist kein Objekt - + insert: index %1 out of range insert: Der Index %1 ist außerhalb des gültigen Bereichs - + move: out of range move: Außerhalb des gültigen Bereichs - + append: value is not an object append: Der Wert ist kein Objekt - + get: index %1 out of range get: Der Index %1 ist außerhalb des gültigen Bereichs - + set: value is not an object set: Der Wert ist kein Objekt - + set: index %1 out of range set: Der Index %1 ist außerhalb des gültigen Bereichs - - ListElement: cannot use default property - ListElement: Die Vorgabe-Eigenschaft kann nicht verwendet werden + + + ListElement: cannot contain nested elements + ListElement kann keine geschachtelten Elemente enthalten @@ -2219,20 +2290,28 @@ nach ListElement: Die "id"-Eigenschaft kann nicht verwendet werden - + ListElement: cannot use script for property value ListElement: Es kann kein Skript für den Wert der Eigenschaft verwendet werden - + ListModel: undefined property '%1' ListModel: Die Eigenschaft '%1' ist nicht definiert + QDeclarativeLoader + + + Loader does not support loading non-visual elements. + Das Laden nicht-visueller Elemente ist nicht unterstützt. + + + QDeclarativeParentAnimation - + Unable to preserve appearance under complex transform Das Erscheinungsbild kann bei einer komplexen Transformation nicht beibehalten werden @@ -2251,7 +2330,7 @@ nach QDeclarativeParentChange - + Unable to preserve appearance under complex transform Das Erscheinungsbild kann bei einer komplexen Transformation nicht beibehalten werden @@ -2270,7 +2349,7 @@ nach QDeclarativeParser - + Illegal character Ungültiges Zeichen @@ -2315,7 +2394,7 @@ nach Ungültiger Modifikator '%0' bei regulärem Ausdruck - + Syntax error Syntaxfehler @@ -2332,14 +2411,14 @@ nach Es wird das Element '%1' erwartet - - + + Property value set multiple times Mehrfache Zuweisung eines Wertes an eine Eigenschaft - + Expected type name Es wird ein Typname erwartet @@ -2349,17 +2428,27 @@ nach Ungültige Verwendung von Skript-Blöcken - + Invalid import qualifier ID Ungültige Id-Angabe bei Import + + Script import qualifiers must be unique. + Der für den Skript-Import angegebene Qualifizierer muss eindeutig sein. + + + + Script import requires a qualifier + Der Skript-Import erfordert die Angabe eines Qualifizierers. + + Library import requires a version Der Import einer Bibliothek erfordert eine Versionsangabe - + Expected parameter type Es wird eine Typangabe für den Parameter erwartet @@ -2384,7 +2473,7 @@ nach 'read-only' wird an dieser Stelle noch nicht unterstützt - + JavaScript declaration outside Script element Eine JavaScript-Deklaration ist außerhalb eines Skriptelementes nicht zulässig @@ -2397,15 +2486,39 @@ nach QDeclarativePauseAnimation - + Cannot set a duration of < 0 Es kann keine Zeitdauer <0 gesetzt werden + QDeclarativePixmapCache + + + Error decoding: %1: %2 + Fehler beim Decodieren: %1: %2 + + + + Failed to get image from provider: %1 + Bilddaten konnten nicht erhalten werden: %1 + + + + + Cannot open: %1 + Fehlschlag beim Öffnen: %1 + + + + Unknown Error loading %1 + Unbekannter Fehler beim Laden von %1 + + + QDeclarativePropertyAnimation - + Cannot set a duration of < 0 Es kann keine Zeitdauer <0 gesetzt werden @@ -2413,7 +2526,12 @@ nach QDeclarativePropertyChanges - + + PropertyChanges does not support creating state-specific objects. + Die Erzeugung von Objekten, die einem Zustand zugeordnet sind, wird von PropertyChanges nicht unterstützt. + + + Cannot assign to non-existent property "%1" Es kann keine Zuweisung erfolgen, da keine Eigenschaft des Namens '%1" existiert @@ -2426,7 +2544,7 @@ nach QDeclarativeTextInput - + Could not load cursor delegate Cursor-Delegate konnte nicht geladen werden @@ -2440,12 +2558,12 @@ nach QDeclarativeVME - + Unable to create object of type %1 Es konnte kein Objekt des Typs %1 erzeugt werden - + Cannot assign value %1 to property %2 Der Wert '%1' kann nicht der Eigenschaft %2 zugewiesen werden @@ -2465,7 +2583,7 @@ nach Der Signal-Eigenschaft %1 kann kein Objekt zugewiesen werden - + Cannot assign object to list Zuweisung eines Objekts an eine Liste nicht zulässig @@ -2488,7 +2606,7 @@ nach QDeclarativeVisualDataModel - + Delegate component must be Item type. Delegate-Komponente muss vom Typ 'Item' sein @@ -2496,7 +2614,7 @@ nach QDeclarativeXmlListModelRole - + An XmlRole query must not start with '/' Eine XmlRole-Abfrage darf nicht mit '/' beginnen @@ -2504,7 +2622,7 @@ nach QDeclarativeXmlRoleList - + An XmlListModel query must start with '/' or "//" Eine XmlListModel-Abfrage muss mit '/' oder "//" beginnen @@ -2530,12 +2648,12 @@ nach QDialog - + What's This? Direkthilfe - + Done Fertig @@ -2543,9 +2661,9 @@ nach QDialogButtonBox - + - + OK OK @@ -2757,7 +2875,7 @@ nach QFile - + Destination file exists Die Zieldatei existiert bereits @@ -2797,7 +2915,7 @@ nach QFileDialog - + All Files (*) Alle Dateien (*) @@ -2820,13 +2938,13 @@ nach Details - + File Datei - + Open Öffnen @@ -2836,7 +2954,7 @@ nach Speichern unter - + &Open @@ -2854,7 +2972,7 @@ nach Zuletzt besucht - + &Rename &Umbenennen @@ -2869,17 +2987,17 @@ nach &Versteckte Dateien anzeigen - + New Folder Neues Verzeichnis - + Find Directory Verzeichnis suchen - + Directories Verzeichnisse @@ -2889,8 +3007,8 @@ nach Alle Dateien (*.*) - - + + Directory: Verzeichnis: @@ -2989,7 +3107,7 @@ Möchten Sie die Datei trotzdem löschen? Unbekannt - + Show Anzeigen @@ -3005,7 +3123,7 @@ Möchten Sie die Datei trotzdem löschen? &Neues Verzeichnis - + &Choose &Auswählen @@ -3016,8 +3134,8 @@ Möchten Sie die Datei trotzdem löschen? Löschen - - + + File &name: Datei&name: @@ -3033,12 +3151,42 @@ Möchten Sie die Datei trotzdem löschen? Create New Folder Neuen Ordner erstellen + + + Go back + Zurück + + + + Go forward + Vor + + + + Go to the parent directory + Gehe zum übergeordneten Verzeichnis + + + + Create a New Folder + Neuen Ordner erstellen + + + + Change to list view mode + Wechsle zu Listenansicht + + + + Change to detail view mode + Wechsle zu Detailansicht + QFileSystemModel - + %1 TB %1 TB @@ -3418,14 +3566,14 @@ Möchten Sie die Datei trotzdem löschen? Verbindung mit %1 beendet - + Connection closed Verbindung beendet - + Host %1 not found Rechner %1 konnte nicht gefunden werden @@ -3450,7 +3598,7 @@ Möchten Sie die Datei trotzdem löschen? Unbekannter Fehler - + Connecting to host failed: %1 @@ -3522,7 +3670,7 @@ Möchten Sie die Datei trotzdem löschen? %1 - + Not connected Keine Verbindung @@ -3912,7 +4060,7 @@ Möchten Sie die Datei trotzdem löschen? QIODevice - + Permission denied Zugriff verweigert @@ -3932,7 +4080,7 @@ Möchten Sie die Datei trotzdem löschen? Kein freier Speicherplatz auf dem Gerät vorhanden - + Unknown error Unbekannter Fehler @@ -3940,7 +4088,7 @@ Möchten Sie die Datei trotzdem löschen? QInputContext - + XIM XIM @@ -3996,7 +4144,7 @@ Möchten Sie die Datei trotzdem löschen? Operation unmap fehlgeschlagen für '%1': %2 - + The plugin '%1' uses incompatible Qt library. (%2.%3.%4) [%5] Das Plugin '%1' verwendet eine inkompatible Qt-Bibliothek. (%2.%3.%4) [%5] @@ -4011,7 +4159,8 @@ Möchten Sie die Datei trotzdem löschen? Unbekannter Fehler - + + The shared library was not found. Die dynamische Bibliothek konnte nicht gefunden werden. @@ -4048,7 +4197,7 @@ Möchten Sie die Datei trotzdem löschen? QLineEdit - + Select All Alles auswählen @@ -4124,7 +4273,7 @@ Möchten Sie die Datei trotzdem löschen? - + %1: Invalid name %1: Ungültiger Name @@ -4371,7 +4520,7 @@ Möchten Sie die Datei trotzdem löschen? QMediaPlayer - + The QMediaPlayer object does not have a valid service Das QMediaPlayer-Objekt verfügt über keinen gültigen Dienst @@ -4462,7 +4611,7 @@ Möchten Sie die Datei trotzdem löschen? Hilfe - + Show Details... Details einblenden... @@ -4735,7 +4884,7 @@ Möchten Sie die Datei trotzdem löschen? QNetworkAccessManager - + Network access is disabled. Der Zugriff auf das Netzwerk ist nicht gestattet. @@ -4748,17 +4897,17 @@ Möchten Sie die Datei trotzdem löschen? Beim Herunterladen von %1 trat ein Fehler auf - Die Antwort des Servers ist: %2 - + Protocol "%1" is unknown Das Protokoll "%1" ist unbekannt - + Network session error. Fehler bei Netzwerkverbindung. - + Temporary network failure. Das Netzwerk ist zur Zeit ausgefallen. @@ -4766,7 +4915,7 @@ Möchten Sie die Datei trotzdem löschen? QNetworkReplyImpl - + Operation canceled Operation abgebrochen @@ -4775,7 +4924,7 @@ Möchten Sie die Datei trotzdem löschen? QNetworkSession - + Invalid configuration. Ungültige Konfiguration. @@ -4783,8 +4932,8 @@ Möchten Sie die Datei trotzdem löschen? QNetworkSessionPrivateImpl - - + + Unknown session error. Unbekannter Fehler bei Netzwerkverbindung. @@ -4813,7 +4962,7 @@ Möchten Sie die Datei trotzdem löschen? Das Roaming wurde abgebrochen oder ist hier nicht möglich. - + Roaming error Fehler beim Roaming @@ -4905,12 +5054,12 @@ Möchten Sie die Datei trotzdem löschen? QODBCDriver - + Unable to connect Es kann keine Verbindung aufgebaut werden - + Unable to disable autocommit 'autocommit' konnte nicht deaktiviert werden @@ -4930,7 +5079,7 @@ Möchten Sie die Datei trotzdem löschen? 'autocommit' konnte nicht aktiviert werden - + Unable to connect - Driver doesn't support all functionality required Es kann keine Verbindung aufgebaut werden weil der Treiber die benötigte Funktionalität nicht vollständig unterstützt @@ -4938,7 +5087,7 @@ Möchten Sie die Datei trotzdem löschen? QODBCResult - + QODBCResult::reset: Unable to set 'SQL_CURSOR_STATIC' as statement attribute. Please check your ODBC driver configuration QODBCResult::reset: 'SQL_CURSOR_STATIC' konnte nicht als Attribut des Befehls gesetzt werden. Bitte prüfen Sie die Konfiguration Ihres ODBC-Treibers @@ -4990,10 +5139,16 @@ Möchten Sie die Datei trotzdem löschen? QObject - + "%1" duplicates a previous role name and will be disabled. "%1" ist bereits als Name einer Rolle vergeben und wird daher deaktiviert. + + + + PulseAudio Sound Server + PulseAudio Sound Server + QPPDOptionsModel @@ -5915,7 +6070,7 @@ Bitte wählen Sie einen anderen Dateinamen. Zeitüberschreitung - + @@ -7535,7 +7690,157 @@ Bitte wählen Sie einen anderen Dateinamen. Umdrehen - + + Kanji + Kanji + + + + Muhenkan + Muhenkan + + + + Henkan + Henkan + + + + Romaji + Romaji + + + + Hiragana + Hiragana + + + + Katakana + Katakana + + + + Hiragana Katakana + Hiragana Katakana + + + + Zenkaku + Zenkaku + + + + Hankaku + Hankaku + + + + Zenkaku Hankaku + Zenkaku Hankaku + + + + Touroku + Touroku + + + + Massyo + Massyo + + + + Kana Lock + Kana Lock + + + + Kana Shift + Kana Shift + + + + Eisu Shift + Eisu Shift + + + + Eisu toggle + Eisu toggle + + + + Code input + Code-Eingabe + + + + Multiple Candidate + Mehrere Vorschläge + + + + Previous Candidate + Vorangegangener Vorschlag + + + + Hangul + Hangul + + + + Hangul Start + Hangul Anfang + + + + Hangul End + Hangul Ende + + + + Hangul Hanja + Hangul Hanja + + + + Hangul Jamo + Hangul Jamo + + + + Hangul Romaja + Hangul Romaja + + + + Hangul Jeonja + Hangul Jeonja + + + + Hangul Banja + Hangul Banja + + + + Hangul PreHanja + Hangul PreHanja + + + + Hangul PostHanja + Hangul PostHanja + + + + Hangul Special + Hangul Special + + + Ctrl Strg @@ -7569,7 +7874,7 @@ Bitte wählen Sie einen anderen Dateinamen. F%1 - + Home Page Startseite @@ -7703,7 +8008,7 @@ Bitte wählen Sie einen anderen Dateinamen. Abbrechen - + Exit Beenden @@ -8039,7 +8344,7 @@ Bitte wählen Sie einen anderen Dateinamen. QTcpServer - + Operation on socket is not supported Diese Socket-Operation wird nicht unterstützt @@ -8047,7 +8352,7 @@ Bitte wählen Sie einen anderen Dateinamen. QTextControl - + &Undo &Rückgängig @@ -8105,7 +8410,7 @@ Bitte wählen Sie einen anderen Dateinamen. QUdpSocket - + This platform does not support IPv6 Diese Plattform unterstützt kein IPv6 @@ -8205,7 +8510,7 @@ Bitte wählen Sie einen anderen Dateinamen. QWebFrame - + Request cancelled Anfrage wurde abgebrochen @@ -8238,7 +8543,7 @@ Bitte wählen Sie einen anderen Dateinamen. QWebPage - + Submit default label for Submit buttons in forms on web pages Senden @@ -8490,7 +8795,13 @@ Bitte wählen Sie einen anderen Dateinamen. Von rechts nach links - + + Missing Plug-in + Label text to be used when a plug-in is missing + Fehlendes Plugin + + + Loading... Media controller status message when the media is loading Lädt... @@ -8724,7 +9035,7 @@ Bitte wählen Sie einen anderen Dateinamen. %1 Sekunden - + Inspect Inspect Element context menu item Prüfen @@ -8748,13 +9059,13 @@ Bitte wählen Sie einen anderen Dateinamen. Gespeicherte Suchanfragen löschen - + Unknown Unknown filesize FTP directory listing item Unbekannt - + Web Inspector - %2 Web Inspector - %2 @@ -8765,12 +9076,12 @@ Bitte wählen Sie einen anderen Dateinamen. %1 (%2x%3 Pixel) - + Bad HTTP request Ungültige HTTP-Anforderung - + This is a searchable index. Enter search keywords: text that appears at the start of nearly-obsolete web pages in the form of a 'searchable index' Dieser Index verfügt über eine Suchfunktion. Geben Sie einen Suchbegriff ein: @@ -8850,22 +9161,22 @@ Bitte wählen Sie einen anderen Dateinamen. - + JavaScript Alert - %1 JavaScript-Hinweis - %1 - + JavaScript Confirm - %1 JavaScript-Bestätigung - %1 - + JavaScript Prompt - %1 JavaScript-Eingabeaufforderung - %1 - + JavaScript Problem - %1 JavaScript-Problem - %1 @@ -8875,7 +9186,7 @@ Bitte wählen Sie einen anderen Dateinamen. Das Skript dieser Webseite ist fehlerhaft. Möchten Sie es anhalten? - + Move the cursor to the next character Positionsmarke auf folgendes Zeichen setzen @@ -9096,7 +9407,7 @@ Bitte wählen Sie einen anderen Dateinamen. QWidget - + * * @@ -9104,7 +9415,7 @@ Bitte wählen Sie einen anderen Dateinamen. QWizard - + Cancel Abbrechen @@ -11927,4 +12238,27 @@ Bitte wählen Sie einen anderen Dateinamen. Das Attribut '%1' enthält einen ungültigen qualifizierten Namen: %2. + + Widget + + + Widget + Widget + + + + about:blank + about:blank + + + + Image from Qt to HTML + Bild von Qt zu HTML + + + + Pixmap from Qt to HTML + Pixmap von Qt zu HTML + + diff --git a/translations/qt_help_de.ts b/translations/qt_help_de.ts index 40d1158..c7a8103 100644 --- a/translations/qt_help_de.ts +++ b/translations/qt_help_de.ts @@ -43,7 +43,7 @@ - + Cannot open collection file: %1 Katalogdatei kann nicht geöffnet werden: %1 @@ -58,7 +58,7 @@ Die Katalogdatei '%1' existiert bereits. - + Unknown filter '%1'! Unbekannter Filter '%1'. @@ -78,12 +78,12 @@ Die Datenbank '%1' kann nicht zur Optimierung geöffnet werden. - + Cannot create directory: %1 Das Verzeichnis kann nicht angelegt werden: %1 - + Cannot copy collection file: %1 Die Katalogdatei kann nicht kopiert werden: %1 @@ -158,7 +158,7 @@ Die Datenbank-Datei %1 kann nicht geöffnet werden. - + Cannot register namespace %1! Der Namensraum %1 kann nicht registriert werden. @@ -266,7 +266,7 @@ QHelpProject - + Unknown token. Unbekanntes Token. @@ -282,16 +282,16 @@ - A virtual folder must not contain a '/' character! - Ein virtuelles Verzeichnis darf kein '/'-Zeichen enthalten. + Virtual folder has invalid syntax. + Ungültige Syntax bei Angabe des virtuellen Verzeichnisses. - - A namespace must not contain a '/' character! - Ein Namensraum darf kein '/'-Zeichen enthalten. + + Namespace has invalid syntax. + Ungültige Syntax der Namensraum-Angabe. - + Missing namespace in QtHelpProject. Fehlender Namensraum in QtHelpProject. @@ -306,7 +306,7 @@ Fehlendes Attribut in Schlagwort in Zeile %1. - + The input file %1 could not be opened! Die Eingabe-Datei %1 kann nicht geöffnet werden. -- cgit v0.12 From 22c44d7da7682fb2500c9b11c884e50ed4dcd042 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Mon, 19 Apr 2010 11:47:36 +0200 Subject: qdoc: Added online flag to the qdocconf file. To generate the offline docs, do nothing. To generate the online docs, add this to your qdocconf file: "online = true" --- tools/qdoc3/config.h | 1 + tools/qdoc3/htmlgenerator.cpp | 295 ++++++++++++++++++++++-------------------- tools/qdoc3/htmlgenerator.h | 1 + tools/qdoc3/test/qt.qdocconf | 1 + 4 files changed, 157 insertions(+), 141 deletions(-) diff --git a/tools/qdoc3/config.h b/tools/qdoc3/config.h index 980d1fb..c29becc 100644 --- a/tools/qdoc3/config.h +++ b/tools/qdoc3/config.h @@ -142,6 +142,7 @@ class Config #define CONFIG_MACRO "macro" #define CONFIG_NATURALLANGUAGE "naturallanguage" #define CONFIG_OBSOLETELINKS "obsoletelinks" +#define CONFIG_ONLINE "online" #define CONFIG_OUTPUTDIR "outputdir" #define CONFIG_OUTPUTENCODING "outputencoding" #define CONFIG_OUTPUTLANGUAGE "outputlanguage" diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index a5dc7b7..e074bb2 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -204,10 +204,18 @@ static void addLink(const QString &linkTarget, HtmlGenerator::HtmlGenerator() - : helpProjectWriter(0), inLink(false), inContents(false), - inSectionHeading(false), inTableHeader(false), numTableRows(0), - threeColumnEnumValueTable(true), funcLeftParen("\\S(\\()"), - myTree(0), slow(false), obsoleteLinks(false) + : helpProjectWriter(0), + inLink(false), + inContents(false), + inSectionHeading(false), + inTableHeader(false), + numTableRows(0), + threeColumnEnumValueTable(true), + offlineDocs(true), + funcLeftParen("\\S(\\()"), + myTree(0), + slow(false), + obsoleteLinks(false) { } @@ -262,7 +270,7 @@ void HtmlGenerator::initializeGenerator(const Config &config) HTMLGENERATOR_GENERATEMACREFS); project = config.getString(CONFIG_PROJECT); - + offlineDocs = !config.getBool(CONFIG_ONLINE); projectDescription = config.getString(CONFIG_DESCRIPTION); if (projectDescription.isEmpty() && !project.isEmpty()) projectDescription = project + " Reference Documentation"; @@ -1737,146 +1745,17 @@ void HtmlGenerator::generateHeader(const QString& title, out() << " \n"; out() << " \n"; out() << "\n"; - -#if 0 - out() << "\n"; - out() << QString("\n").arg(naturalLanguage); - - QString shortVersion; - if ((project != "Qtopia") && (project != "Qt Extended")) { - shortVersion = project + " " + shortVersion + ": "; - if (node && !node->doc().location().isEmpty()) - out() << "\n"; - - shortVersion = myTree->version(); - if (shortVersion.count(QChar('.')) == 2) - shortVersion.truncate(shortVersion.lastIndexOf(QChar('.'))); - if (!shortVersion.isEmpty()) { - if (project == "QSA") - shortVersion = "QSA " + shortVersion + ": "; - else - shortVersion = "Qt " + shortVersion + ": "; - } - } - - out() << "\n" - " " << shortVersion << protectEnc(title) << "\n"; - out() << QString("").arg(outputEncoding); - - if (!style.isEmpty()) - out() << " \n"; - - const QMap &metaMap = node->doc().metaTagMap(); - if (!metaMap.isEmpty()) { - QMapIterator i(metaMap); - while (i.hasNext()) { - i.next(); - out() << " \n"; - } - } - - navigationLinks.clear(); - - if (node && !node->links().empty()) { - QPair linkPair; - QPair anchorPair; - const Node *linkNode; - - if (node->links().contains(Node::PreviousLink)) { - linkPair = node->links()[Node::PreviousLink]; - linkNode = findNodeForTarget(linkPair.first, node, marker); - if (!linkNode || linkNode == node) - anchorPair = linkPair; - else - anchorPair = anchorForNode(linkNode); - - out() << " \n"; - - navigationLinks += "[Previous: "; - if (linkPair.first == linkPair.second && !anchorPair.second.isEmpty()) - navigationLinks += protectEnc(anchorPair.second); - else - navigationLinks += protectEnc(linkPair.second); - navigationLinks += "]\n"; - } - if (node->links().contains(Node::ContentsLink)) { - linkPair = node->links()[Node::ContentsLink]; - linkNode = findNodeForTarget(linkPair.first, node, marker); - if (!linkNode || linkNode == node) - anchorPair = linkPair; - else - anchorPair = anchorForNode(linkNode); - - out() << " \n"; - - navigationLinks += "["; - if (linkPair.first == linkPair.second && !anchorPair.second.isEmpty()) - navigationLinks += protectEnc(anchorPair.second); - else - navigationLinks += protectEnc(linkPair.second); - navigationLinks += "]\n"; - } - if (node->links().contains(Node::NextLink)) { - linkPair = node->links()[Node::NextLink]; - linkNode = findNodeForTarget(linkPair.first, node, marker); - if (!linkNode || linkNode == node) - anchorPair = linkPair; - else - anchorPair = anchorForNode(linkNode); - - out() << " \n"; - - navigationLinks += "[Next: "; - if (linkPair.first == linkPair.second && !anchorPair.second.isEmpty()) - navigationLinks += protectEnc(anchorPair.second); - else - navigationLinks += protectEnc(linkPair.second); - navigationLinks += "]\n"; - } - if (node->links().contains(Node::IndexLink)) { - linkPair = node->links()[Node::IndexLink]; - linkNode = findNodeForTarget(linkPair.first, node, marker); - if (!linkNode || linkNode == node) - anchorPair = linkPair; - else - anchorPair = anchorForNode(linkNode); - out() << " \n"; - } - if (node->links().contains(Node::StartLink)) { - linkPair = node->links()[Node::StartLink]; - linkNode = findNodeForTarget(linkPair.first, node, marker); - if (!linkNode || linkNode == node) - anchorPair = linkPair; - else - anchorPair = anchorForNode(linkNode); - out() << " \n"; - } - } - - foreach (const QString &stylesheet, stylesheets) { - out() << " \n"; - } - foreach (const QString &customHeadElement, customHeadElements) { - out() << " " << customHeadElement << "\n"; - } - - out() << "\n" - #endif + if (offlineDocs) + out() << "\n"; + else out() << "\n"; + if (mainPage) generateMacRef(node, marker); out() << QString(postHeader).replace("\\" + COMMAND_VERSION, myTree->version()); -#if 0 +#if 0 // Removed for new docf format. MWS if (node && !node->links().empty()) out() << "

\n" << navigationLinks << "

\n"; #endif @@ -4371,8 +4250,6 @@ void HtmlGenerator::endLink() inObsoleteLink = false; } -QT_END_NAMESPACE - #ifdef QDOC_QML /*! @@ -4724,3 +4601,139 @@ void HtmlGenerator::generatePageIndex(const QString& fileName, CodeMarker* marke } #endif + +#if 0 // fossil removed for new doc format MWS 19/04/2010 + out() << "\n"; + out() << QString("\n").arg(naturalLanguage); + + QString shortVersion; + if ((project != "Qtopia") && (project != "Qt Extended")) { + shortVersion = project + " " + shortVersion + ": "; + if (node && !node->doc().location().isEmpty()) + out() << "\n"; + + shortVersion = myTree->version(); + if (shortVersion.count(QChar('.')) == 2) + shortVersion.truncate(shortVersion.lastIndexOf(QChar('.'))); + if (!shortVersion.isEmpty()) { + if (project == "QSA") + shortVersion = "QSA " + shortVersion + ": "; + else + shortVersion = "Qt " + shortVersion + ": "; + } + } + + out() << "\n" + " " << shortVersion << protectEnc(title) << "\n"; + out() << QString("").arg(outputEncoding); + + if (!style.isEmpty()) + out() << " \n"; + + const QMap &metaMap = node->doc().metaTagMap(); + if (!metaMap.isEmpty()) { + QMapIterator i(metaMap); + while (i.hasNext()) { + i.next(); + out() << " \n"; + } + } + + navigationLinks.clear(); + + if (node && !node->links().empty()) { + QPair linkPair; + QPair anchorPair; + const Node *linkNode; + + if (node->links().contains(Node::PreviousLink)) { + linkPair = node->links()[Node::PreviousLink]; + linkNode = findNodeForTarget(linkPair.first, node, marker); + if (!linkNode || linkNode == node) + anchorPair = linkPair; + else + anchorPair = anchorForNode(linkNode); + + out() << " \n"; + + navigationLinks += "[Previous: "; + if (linkPair.first == linkPair.second && !anchorPair.second.isEmpty()) + navigationLinks += protectEnc(anchorPair.second); + else + navigationLinks += protectEnc(linkPair.second); + navigationLinks += "]\n"; + } + if (node->links().contains(Node::ContentsLink)) { + linkPair = node->links()[Node::ContentsLink]; + linkNode = findNodeForTarget(linkPair.first, node, marker); + if (!linkNode || linkNode == node) + anchorPair = linkPair; + else + anchorPair = anchorForNode(linkNode); + + out() << " \n"; + + navigationLinks += "["; + if (linkPair.first == linkPair.second && !anchorPair.second.isEmpty()) + navigationLinks += protectEnc(anchorPair.second); + else + navigationLinks += protectEnc(linkPair.second); + navigationLinks += "]\n"; + } + if (node->links().contains(Node::NextLink)) { + linkPair = node->links()[Node::NextLink]; + linkNode = findNodeForTarget(linkPair.first, node, marker); + if (!linkNode || linkNode == node) + anchorPair = linkPair; + else + anchorPair = anchorForNode(linkNode); + + out() << " \n"; + + navigationLinks += "[Next: "; + if (linkPair.first == linkPair.second && !anchorPair.second.isEmpty()) + navigationLinks += protectEnc(anchorPair.second); + else + navigationLinks += protectEnc(linkPair.second); + navigationLinks += "]\n"; + } + if (node->links().contains(Node::IndexLink)) { + linkPair = node->links()[Node::IndexLink]; + linkNode = findNodeForTarget(linkPair.first, node, marker); + if (!linkNode || linkNode == node) + anchorPair = linkPair; + else + anchorPair = anchorForNode(linkNode); + out() << " \n"; + } + if (node->links().contains(Node::StartLink)) { + linkPair = node->links()[Node::StartLink]; + linkNode = findNodeForTarget(linkPair.first, node, marker); + if (!linkNode || linkNode == node) + anchorPair = linkPair; + else + anchorPair = anchorForNode(linkNode); + out() << " \n"; + } + } + + foreach (const QString &stylesheet, stylesheets) { + out() << " \n"; + } + + foreach (const QString &customHeadElement, customHeadElements) { + out() << " " << customHeadElement << "\n"; + } + + out() << "\n" + #endif + + QT_END_NAMESPACE diff --git a/tools/qdoc3/htmlgenerator.h b/tools/qdoc3/htmlgenerator.h index 559c968..2a365e9 100644 --- a/tools/qdoc3/htmlgenerator.h +++ b/tools/qdoc3/htmlgenerator.h @@ -297,6 +297,7 @@ class HtmlGenerator : public PageGenerator bool inTableHeader; int numTableRows; bool threeColumnEnumValueTable; + bool offlineDocs; QString link; QStringList sectionNumber; QRegExp funcLeftParen; diff --git a/tools/qdoc3/test/qt.qdocconf b/tools/qdoc3/test/qt.qdocconf index cc3e436..ef6fe97 100644 --- a/tools/qdoc3/test/qt.qdocconf +++ b/tools/qdoc3/test/qt.qdocconf @@ -9,6 +9,7 @@ versionsym = version = %VERSION% description = Qt Reference Documentation url = http://qt.nokia.com/doc/4.7 +online = true sourceencoding = UTF-8 outputencoding = UTF-8 -- cgit v0.12 From 80f69e2d2501c9958068c305ccd909aa034334d9 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 19 Apr 2010 14:09:31 +0200 Subject: [tst_qdiriterator] Stop removing files from the repository. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes issue introduced by 21e0423a5c9ecd9da8e141dcfba25e60b55f7fe5. Reviewed-By: João Abecasis --- tests/auto/qdiriterator/tst_qdiriterator.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/auto/qdiriterator/tst_qdiriterator.cpp b/tests/auto/qdiriterator/tst_qdiriterator.cpp index c1db8f2..1a873b8 100644 --- a/tests/auto/qdiriterator/tst_qdiriterator.cpp +++ b/tests/auto/qdiriterator/tst_qdiriterator.cpp @@ -85,11 +85,13 @@ private: // convenience functions return false; } - bool createFile(const QString &fileName) + enum Cleanup { DoDelete, DontDelete }; + bool createFile(const QString &fileName, Cleanup cleanup = DoDelete) { QFile file(fileName); if (file.open(QIODevice::WriteOnly)) { - createdFiles << fileName; + if (cleanup == DoDelete) + createdFiles << fileName; return true; } return false; @@ -131,9 +133,9 @@ tst_QDirIterator::tst_QDirIterator() createDirectory("entrylist"); createDirectory("entrylist/directory"); - createFile("entrylist/file"); + createFile("entrylist/file", DontDelete); createFile("entrylist/writable"); - createFile("entrylist/directory/dummy"); + createFile("entrylist/directory/dummy", DontDelete); createDirectory("recursiveDirs"); createDirectory("recursiveDirs/dir1"); -- cgit v0.12 From 1f0104850aafcb0e2d6af3fcd4d61ae7073c6e3d Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Mon, 19 Apr 2010 15:26:55 +0200 Subject: Fix the code for estimate whether the project is debug/release only in cetest. Reviewed-by: Miikka Heikkinen Reviewed-by: Joerg Bornemann --- tools/qtestlib/wince/cetest/main.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/qtestlib/wince/cetest/main.cpp b/tools/qtestlib/wince/cetest/main.cpp index 9fe5f02..4272a83 100644 --- a/tools/qtestlib/wince/cetest/main.cpp +++ b/tools/qtestlib/wince/cetest/main.cpp @@ -285,10 +285,14 @@ int main(int argc, char **argv) } // Check wether the project is still in debug/release mode after reading // If .pro specifies to be one mode only, we need to accept this - if (project.isActiveConfig("debug")) + if (project.isActiveConfig("debug") && !project.isActiveConfig("release")) { TestConfiguration::testDebug = true; - else + debugOutput("ActiveConfig: debug only in .pro.", 1); + } + if (!project.isActiveConfig("debug") && project.isActiveConfig("release")) { TestConfiguration::testDebug = false; + debugOutput("ActiveConfig: release only in .pro.", 1); + } // determine what is the real mkspec to use if the default mkspec is being used if (Option::mkfile::qmakespec.endsWith("/default")) -- cgit v0.12 From dfa8d13a20548c31b56678df517ae38e85fe1384 Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Mon, 19 Apr 2010 17:22:35 +0200 Subject: Don't deadlock tst_QThread::exit() and tst_QThread::quit() Make sure to lock the mutex before starting the threads... otherwise we run the risk of losing the wakeup between start() and the lock being acquired. Reviewed-by: TrustMe --- tests/auto/qthread/tst_qthread.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/auto/qthread/tst_qthread.cpp b/tests/auto/qthread/tst_qthread.cpp index 9a4397e..7a5b053 100644 --- a/tests/auto/qthread/tst_qthread.cpp +++ b/tests/auto/qthread/tst_qthread.cpp @@ -442,9 +442,9 @@ void tst_QThread::exit() thread2.object = 0; thread2.code = 53; thread2.result = 0; + QMutexLocker locker2(&thread2.mutex); thread2.start(); thread2.exit(thread2.code); - QMutexLocker locker2(&thread2.mutex); thread2.cond.wait(locker2.mutex()); QVERIFY(thread2.wait(five_minutes)); QCOMPARE(thread2.result, thread2.code); @@ -514,9 +514,9 @@ void tst_QThread::quit() Quit_Thread thread2; thread2.object = 0; thread2.result = -1; + QMutexLocker locker2(&thread2.mutex); thread2.start(); thread2.quit(); - QMutexLocker locker2(&thread2.mutex); thread2.cond.wait(locker2.mutex()); QVERIFY(thread2.wait(five_minutes)); QCOMPARE(thread2.result, 0); -- cgit v0.12 From 0fd81e81a357edb9f9e615cff28a1876bd363b2e Mon Sep 17 00:00:00 2001 From: kh1 Date: Mon, 19 Apr 2010 18:59:32 +0200 Subject: Quick fix to make the documentation work, needs a proper solution though. Reviewed-by: kh --- tools/assistant/tools/assistant/helpviewer.cpp | 4 ++++ tools/assistant/tools/assistant/helpviewer.h | 1 + tools/assistant/tools/assistant/helpviewer_qwv.cpp | 22 ++++++++++++++++++---- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/tools/assistant/tools/assistant/helpviewer.cpp b/tools/assistant/tools/assistant/helpviewer.cpp index 0c51a02..85e4e71 100644 --- a/tools/assistant/tools/assistant/helpviewer.cpp +++ b/tools/assistant/tools/assistant/helpviewer.cpp @@ -52,6 +52,10 @@ QT_BEGIN_NAMESPACE +QString AbstractHelpViewer::DocPath = QString::fromLatin1("qthelp://com." + "trolltech.qt.%1/").arg(QString(QLatin1String(QT_VERSION_STR)) + .replace(QLatin1String("."), QLatin1String(""))); + QString AbstractHelpViewer::AboutBlank = QCoreApplication::translate("HelpViewer", "about:blank"); diff --git a/tools/assistant/tools/assistant/helpviewer.h b/tools/assistant/tools/assistant/helpviewer.h index 6f1f48d..9c3971f 100644 --- a/tools/assistant/tools/assistant/helpviewer.h +++ b/tools/assistant/tools/assistant/helpviewer.h @@ -67,6 +67,7 @@ public: virtual bool handleForwardBackwardMouseButtons(QMouseEvent *e) = 0; + static QString DocPath; static QString AboutBlank; static QString LocalHelpFile; static QString PageNotFoundMessage; diff --git a/tools/assistant/tools/assistant/helpviewer_qwv.cpp b/tools/assistant/tools/assistant/helpviewer_qwv.cpp index db1cd58..a19b29a 100644 --- a/tools/assistant/tools/assistant/helpviewer_qwv.cpp +++ b/tools/assistant/tools/assistant/helpviewer_qwv.cpp @@ -129,13 +129,27 @@ QNetworkReply *HelpNetworkAccessManager::createRequest(Operation /*op*/, const QNetworkRequest &request, QIODevice* /*outgoingData*/) { TRACE_OBJ - const QUrl &url = request.url(); - const QString &mimeType = AbstractHelpViewer::mimeFromUrl(url.toString()); - + QString url = request.url().toString(); HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance(); + + // TODO: For some reason the url to load is already wrong (passed from webkit) + // though the css file and the references inside should work that way. One + // possible problem might be that the css is loaded at the same level as the + // html, thus a path inside the css like (../images/foo.png) might cd out of + // the virtual folder + if (!helpEngine.findFile(url).isValid()) { + if (url.startsWith(AbstractHelpViewer::DocPath)) { + if (!url.startsWith(AbstractHelpViewer::DocPath + QLatin1String("qdoc/"))) { + url = url.replace(AbstractHelpViewer::DocPath, + AbstractHelpViewer::DocPath + QLatin1String("qdoc/")); + } + } + } + + const QString &mimeType = AbstractHelpViewer::mimeFromUrl(url); const QByteArray &data = helpEngine.findFile(url).isValid() ? helpEngine.fileData(url) - : AbstractHelpViewer::PageNotFoundMessage.arg(url.toString()).toUtf8(); + : AbstractHelpViewer::PageNotFoundMessage.arg(url).toUtf8(); return new HelpNetworkReply(request, data, mimeType.isEmpty() ? QLatin1String("application/octet-stream") : mimeType); } -- cgit v0.12 From 2649b5f4695680b584decf75af11dc82325cc03f Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Fri, 16 Apr 2010 10:06:39 +0200 Subject: QScript: use JSC::NativeFunctionWrapper instead of JSC::PrototypeFunction when possible JSC::NativeFunctionWrapper is a typedef to either JSC::PrototypeFunction or JSC::JSFunction depending if we are running JIT or not. When using JIT, JSC::JSFunction is faster, as it allow JIT to do the native call dirrectly. The difference is that in that case, the JS stack is not fully set up so we have to be carefull. Unfortunately, it is not possible to make FunctionWrapper inherit from JSC::NativeFunctionWrapper, because JSFunction is slightly bigger, and we cannot fit in a Cell Reviewed-by: Kent Hansen --- src/script/api/qscriptengine.cpp | 4 ++-- src/script/bridge/qscriptqobject.cpp | 9 +++++---- src/script/bridge/qscriptvariant.cpp | 6 ++++-- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp index 0b8a2e4..03d535c 100644 --- a/src/script/api/qscriptengine.cpp +++ b/src/script/api/qscriptengine.cpp @@ -796,7 +796,7 @@ JSC::JSValue JSC_HOST_CALL functionQsTr(JSC::ExecState *exec, JSC::JSObject*, JS JSC::UString context; // The first non-empty source URL in the call stack determines the translation context. { - JSC::ExecState *frame = exec->removeHostCallFrameFlag(); + JSC::ExecState *frame = exec->callerFrame()->removeHostCallFrameFlag(); while (frame) { if (frame->codeBlock() && frame->codeBlock()->source() && !frame->codeBlock()->source()->url().isEmpty()) { @@ -3404,7 +3404,7 @@ void QScriptEngine::installTranslatorFunctions(const QScriptValue &object) // unsigned attribs = JSC::DontEnum; JSC::asObject(jscObject)->putDirectFunction(exec, new (exec)JSC::NativeFunctionWrapper(exec, glob->prototypeFunctionStructure(), 5, JSC::Identifier(exec, "qsTranslate"), QScript::functionQsTranslate)); JSC::asObject(jscObject)->putDirectFunction(exec, new (exec)JSC::NativeFunctionWrapper(exec, glob->prototypeFunctionStructure(), 2, JSC::Identifier(exec, "QT_TRANSLATE_NOOP"), QScript::functionQsTranslateNoOp)); - JSC::asObject(jscObject)->putDirectFunction(exec, new (exec)JSC::PrototypeFunction(exec, glob->prototypeFunctionStructure(), 3, JSC::Identifier(exec, "qsTr"), QScript::functionQsTr)); + JSC::asObject(jscObject)->putDirectFunction(exec, new (exec)JSC::NativeFunctionWrapper(exec, glob->prototypeFunctionStructure(), 3, JSC::Identifier(exec, "qsTr"), QScript::functionQsTr)); JSC::asObject(jscObject)->putDirectFunction(exec, new (exec)JSC::NativeFunctionWrapper(exec, glob->prototypeFunctionStructure(), 1, JSC::Identifier(exec, "QT_TR_NOOP"), QScript::functionQsTrNoOp)); glob->stringPrototype()->putDirectFunction(exec, new (exec)JSC::NativeFunctionWrapper(exec, glob->prototypeFunctionStructure(), 1, JSC::Identifier(exec, "arg"), QScript::stringProtoFuncArg)); diff --git a/src/script/bridge/qscriptqobject.cpp b/src/script/bridge/qscriptqobject.cpp index 0477454..5e4f097 100644 --- a/src/script/bridge/qscriptqobject.cpp +++ b/src/script/bridge/qscriptqobject.cpp @@ -35,6 +35,7 @@ #include "Error.h" #include "PrototypeFunction.h" +#include "NativeFunctionWrapper.h" #include "PropertyNameArray.h" #include "JSFunction.h" #include "JSString.h" @@ -1753,9 +1754,9 @@ QObjectPrototype::QObjectPrototype(JSC::ExecState* exec, WTF::PassRefPtrpropertyNames().toString, qobjectProtoFuncToString), JSC::DontEnum); - putDirectFunction(exec, new (exec) JSC::PrototypeFunction(exec, prototypeFunctionStructure, /*length=*/1, JSC::Identifier(exec, "findChild"), qobjectProtoFuncFindChild), JSC::DontEnum); - putDirectFunction(exec, new (exec) JSC::PrototypeFunction(exec, prototypeFunctionStructure, /*length=*/1, JSC::Identifier(exec, "findChildren"), qobjectProtoFuncFindChildren), JSC::DontEnum); + putDirectFunction(exec, new (exec) JSC::NativeFunctionWrapper(exec, prototypeFunctionStructure, /*length=*/0, exec->propertyNames().toString, qobjectProtoFuncToString), JSC::DontEnum); + putDirectFunction(exec, new (exec) JSC::NativeFunctionWrapper(exec, prototypeFunctionStructure, /*length=*/1, JSC::Identifier(exec, "findChild"), qobjectProtoFuncFindChild), JSC::DontEnum); + putDirectFunction(exec, new (exec) JSC::NativeFunctionWrapper(exec, prototypeFunctionStructure, /*length=*/1, JSC::Identifier(exec, "findChildren"), qobjectProtoFuncFindChildren), JSC::DontEnum); this->structure()->setHasGetterSetterProperties(true); } @@ -2015,7 +2016,7 @@ QMetaObjectPrototype::QMetaObjectPrototype( JSC::Structure* prototypeFunctionStructure) : QMetaObjectWrapperObject(exec, StaticQtMetaObject::get(), /*ctor=*/JSC::JSValue(), structure) { - putDirectFunction(exec, new (exec) JSC::PrototypeFunction(exec, prototypeFunctionStructure, /*length=*/0, JSC::Identifier(exec, "className"), qmetaobjectProtoFuncClassName), JSC::DontEnum); + putDirectFunction(exec, new (exec) JSC::NativeFunctionWrapper(exec, prototypeFunctionStructure, /*length=*/0, JSC::Identifier(exec, "className"), qmetaobjectProtoFuncClassName), JSC::DontEnum); } static const uint qt_meta_data_QObjectConnectionManager[] = { diff --git a/src/script/bridge/qscriptvariant.cpp b/src/script/bridge/qscriptvariant.cpp index b2dd3b0..93459a8 100644 --- a/src/script/bridge/qscriptvariant.cpp +++ b/src/script/bridge/qscriptvariant.cpp @@ -29,6 +29,8 @@ #include "Error.h" #include "PrototypeFunction.h" +#include "JSFunction.h" +#include "NativeFunctionWrapper.h" #include "JSString.h" namespace JSC @@ -139,8 +141,8 @@ QVariantPrototype::QVariantPrototype(JSC::ExecState* exec, WTF::PassRefPtrpropertyNames().toString, variantProtoFuncToString), JSC::DontEnum); - putDirectFunction(exec, new (exec) JSC::PrototypeFunction(exec, prototypeFunctionStructure, 0, exec->propertyNames().valueOf, variantProtoFuncValueOf), JSC::DontEnum); + putDirectFunction(exec, new (exec) JSC::NativeFunctionWrapper(exec, prototypeFunctionStructure, 0, exec->propertyNames().toString, variantProtoFuncToString), JSC::DontEnum); + putDirectFunction(exec, new (exec) JSC::NativeFunctionWrapper(exec, prototypeFunctionStructure, 0, exec->propertyNames().valueOf, variantProtoFuncValueOf), JSC::DontEnum); } -- cgit v0.12 From b64a309f78b684bf3acb49bc6d0e9b93aa2138c5 Mon Sep 17 00:00:00 2001 From: Lorn Potter Date: Tue, 20 Apr 2010 07:38:20 +1000 Subject: make sure to lock these --- src/plugins/bearer/corewlan/qcorewlanengine.mm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/plugins/bearer/corewlan/qcorewlanengine.mm b/src/plugins/bearer/corewlan/qcorewlanengine.mm index f54bd4d..f78fc76 100644 --- a/src/plugins/bearer/corewlan/qcorewlanengine.mm +++ b/src/plugins/bearer/corewlan/qcorewlanengine.mm @@ -286,6 +286,8 @@ QList QScanThread::getConfigurations() void QScanThread::getUserConfigurations() { + QMutexLocker locker(&mutex); + QMacCocoaAutoReleasePool pool; userProfiles.clear(); @@ -354,6 +356,8 @@ void QScanThread::getUserConfigurations() QString QScanThread::getSsidFromNetworkName(const QString &name) { + QMutexLocker locker(&mutex); + QMapIterator > i(userProfiles); while (i.hasNext()) { i.next(); @@ -372,6 +376,8 @@ QString QScanThread::getSsidFromNetworkName(const QString &name) QString QScanThread::getNetworkNameFromSsid(const QString &ssid) { + QMutexLocker locker(&mutex); + QMapIterator > i(userProfiles); while (i.hasNext()) { i.next(); -- cgit v0.12 From c4c75ebd65454fd27bffefb4a3468ece20990c86 Mon Sep 17 00:00:00 2001 From: Aaron McCarthy Date: Tue, 20 Apr 2010 15:35:29 +1000 Subject: Remove redundant network configuration updates on startup. The initial list of network configurations was being fetched twice when the bearer management plugins are loaded. --- src/network/bearer/qnetworkconfigmanager_p.cpp | 2 +- src/plugins/bearer/corewlan/qcorewlanengine.h | 2 +- src/plugins/bearer/corewlan/qcorewlanengine.mm | 6 +++--- src/plugins/bearer/generic/qgenericengine.cpp | 5 +++++ src/plugins/bearer/generic/qgenericengine.h | 1 + src/plugins/bearer/icd/qicdengine.cpp | 8 +++++--- src/plugins/bearer/icd/qicdengine.h | 2 +- src/plugins/bearer/nativewifi/qnativewifiengine.cpp | 7 +++++-- src/plugins/bearer/nativewifi/qnativewifiengine.h | 1 + src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp | 6 +++--- src/plugins/bearer/networkmanager/qnetworkmanagerengine.h | 3 +-- src/plugins/bearer/symbian/symbianengine.cpp | 7 ++++++- src/plugins/bearer/symbian/symbianengine.h | 1 + 13 files changed, 34 insertions(+), 17 deletions(-) diff --git a/src/network/bearer/qnetworkconfigmanager_p.cpp b/src/network/bearer/qnetworkconfigmanager_p.cpp index a651dd1..a7bd2d5 100644 --- a/src/network/bearer/qnetworkconfigmanager_p.cpp +++ b/src/network/bearer/qnetworkconfigmanager_p.cpp @@ -381,7 +381,7 @@ void QNetworkConfigurationManagerPrivate::updateConfigurations() connect(engine, SIGNAL(configurationChanged(QNetworkConfigurationPrivatePointer)), this, SLOT(configurationChanged(QNetworkConfigurationPrivatePointer))); - QMetaObject::invokeMethod(engine, "requestUpdate"); + QMetaObject::invokeMethod(engine, "initialize"); } } diff --git a/src/plugins/bearer/corewlan/qcorewlanengine.h b/src/plugins/bearer/corewlan/qcorewlanengine.h index 854dcea..3c24c54 100644 --- a/src/plugins/bearer/corewlan/qcorewlanengine.h +++ b/src/plugins/bearer/corewlan/qcorewlanengine.h @@ -73,6 +73,7 @@ public: void connectToId(const QString &id); void disconnectFromId(const QString &id); + Q_INVOKABLE void initialize(); Q_INVOKABLE void requestUpdate(); QNetworkSession::State sessionStateForId(const QString &id); @@ -86,7 +87,6 @@ public: bool requiresPolling() const; private Q_SLOTS: - void init(); void doRequestUpdate(); void networksChanged(); diff --git a/src/plugins/bearer/corewlan/qcorewlanengine.mm b/src/plugins/bearer/corewlan/qcorewlanengine.mm index f78fc76..02079d6 100644 --- a/src/plugins/bearer/corewlan/qcorewlanengine.mm +++ b/src/plugins/bearer/corewlan/qcorewlanengine.mm @@ -415,8 +415,6 @@ QCoreWlanEngine::QCoreWlanEngine(QObject *parent) scanThread = new QScanThread(this); connect(scanThread, SIGNAL(networksChanged()), this, SLOT(networksChanged())); - - QTimer::singleShot(0,this,SLOT(init())); } QCoreWlanEngine::~QCoreWlanEngine() @@ -427,8 +425,10 @@ QCoreWlanEngine::~QCoreWlanEngine() [listener release]; } -void QCoreWlanEngine::init() +void QCoreWlanEngine::initialize() { + QMutexLocker locker(&mutex); + if([[CWInterface supportedInterfaces] count] > 0 && !listener) { listener = [[QNSListener alloc] init]; listener.engine = this; diff --git a/src/plugins/bearer/generic/qgenericengine.cpp b/src/plugins/bearer/generic/qgenericengine.cpp index 41ff3e0..652fe4a 100644 --- a/src/plugins/bearer/generic/qgenericengine.cpp +++ b/src/plugins/bearer/generic/qgenericengine.cpp @@ -177,6 +177,11 @@ void QGenericEngine::disconnectFromId(const QString &id) emit connectionError(id, OperationNotSupported); } +void QGenericEngine::initialize() +{ + doRequestUpdate(); +} + void QGenericEngine::requestUpdate() { doRequestUpdate(); diff --git a/src/plugins/bearer/generic/qgenericengine.h b/src/plugins/bearer/generic/qgenericengine.h index 82d22af..cdbbc9d 100644 --- a/src/plugins/bearer/generic/qgenericengine.h +++ b/src/plugins/bearer/generic/qgenericengine.h @@ -70,6 +70,7 @@ public: void connectToId(const QString &id); void disconnectFromId(const QString &id); + Q_INVOKABLE void initialize(); Q_INVOKABLE void requestUpdate(); QNetworkSession::State sessionStateForId(const QString &id); diff --git a/src/plugins/bearer/icd/qicdengine.cpp b/src/plugins/bearer/icd/qicdengine.cpp index fc9b469..9d1bfab 100644 --- a/src/plugins/bearer/icd/qicdengine.cpp +++ b/src/plugins/bearer/icd/qicdengine.cpp @@ -225,8 +225,6 @@ QIcdEngine::QIcdEngine(QObject *parent) : QBearerEngine(parent), iapMonitor(new IapMonitor), m_dbusInterface(0), firstUpdate(true), m_scanGoingOn(false) { - QMetaObject::invokeMethod(this, "doRequestUpdate", Qt::QueuedConnection); - init(); } QIcdEngine::~QIcdEngine() @@ -243,8 +241,10 @@ QNetworkConfigurationManager::Capabilities QIcdEngine::capabilities() const QNetworkConfigurationManager::NetworkSessionRequired; } -void QIcdEngine::init() +void QIcdEngine::initialize() { + QMutexLocker locker(&mutex); + // Setup DBus Interface for ICD m_dbusInterface = new QDBusInterface(ICD_DBUS_API_INTERFACE, ICD_DBUS_API_PATH, @@ -272,6 +272,8 @@ void QIcdEngine::init() QNetworkConfigurationPrivatePointer ptr(cpPriv); userChoiceConfigurations.insert(cpPriv->id, ptr); + + doRequestUpdate(); } static inline QString network_attrs_to_security(uint network_attrs) diff --git a/src/plugins/bearer/icd/qicdengine.h b/src/plugins/bearer/icd/qicdengine.h index 841874f..2f9f8ed 100644 --- a/src/plugins/bearer/icd/qicdengine.h +++ b/src/plugins/bearer/icd/qicdengine.h @@ -91,6 +91,7 @@ public: bool hasIdentifier(const QString &id); + Q_INVOKABLE void initialize(); Q_INVOKABLE void requestUpdate(); QNetworkConfigurationManager::Capabilities capabilities() const; @@ -123,7 +124,6 @@ public: emit configurationChanged(ptr); } - void init(); void cleanup(); void addConfiguration(QString &iap_id); diff --git a/src/plugins/bearer/nativewifi/qnativewifiengine.cpp b/src/plugins/bearer/nativewifi/qnativewifiengine.cpp index e796df3..9b6ffa0 100644 --- a/src/plugins/bearer/nativewifi/qnativewifiengine.cpp +++ b/src/plugins/bearer/nativewifi/qnativewifiengine.cpp @@ -100,8 +100,6 @@ QNativeWifiEngine::QNativeWifiEngine(QObject *parent) if (result != ERROR_SUCCESS) qDebug("%s: WlanRegisterNotification failed with error %ld\n", __FUNCTION__, result); #endif - - scanComplete(); } QNativeWifiEngine::~QNativeWifiEngine() @@ -472,6 +470,11 @@ void QNativeWifiEngine::disconnectFromId(const QString &id) } } +void QNativeWifiEngine::initialize() +{ + scanComplete(); +} + void QNativeWifiEngine::requestUpdate() { QMutexLocker locker(&mutex); diff --git a/src/plugins/bearer/nativewifi/qnativewifiengine.h b/src/plugins/bearer/nativewifi/qnativewifiengine.h index 77764e4..3b21985 100644 --- a/src/plugins/bearer/nativewifi/qnativewifiengine.h +++ b/src/plugins/bearer/nativewifi/qnativewifiengine.h @@ -80,6 +80,7 @@ public: void connectToId(const QString &id); void disconnectFromId(const QString &id); + Q_INVOKABLE void initialize(); Q_INVOKABLE void requestUpdate(); QNetworkSession::State sessionStateForId(const QString &id); diff --git a/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp b/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp index 13b2252..3ebc356 100644 --- a/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp +++ b/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp @@ -93,16 +93,16 @@ QNetworkManagerEngine::QNetworkManagerEngine(QObject *parent) userSettings->setConnections(); connect(userSettings, SIGNAL(newConnection(QDBusObjectPath)), this, SLOT(newConnection(QDBusObjectPath))); - - QMetaObject::invokeMethod(this, "init", Qt::QueuedConnection); } QNetworkManagerEngine::~QNetworkManagerEngine() { } -void QNetworkManagerEngine::init() +void QNetworkManagerEngine::initialize() { + QMutexLocker locker(&mutex); + // Get current list of access points. foreach (const QDBusObjectPath &devicePath, interface->getDevices()) deviceAdded(devicePath); diff --git a/src/plugins/bearer/networkmanager/qnetworkmanagerengine.h b/src/plugins/bearer/networkmanager/qnetworkmanagerengine.h index 7f8badb..8e95a2c 100644 --- a/src/plugins/bearer/networkmanager/qnetworkmanagerengine.h +++ b/src/plugins/bearer/networkmanager/qnetworkmanagerengine.h @@ -73,8 +73,6 @@ public: QNetworkManagerEngine(QObject *parent = 0); ~QNetworkManagerEngine(); - Q_INVOKABLE void init(); - bool networkManagerAvailable() const; QString getInterfaceFromId(const QString &id); @@ -85,6 +83,7 @@ public: void connectToId(const QString &id); void disconnectFromId(const QString &id); + Q_INVOKABLE void initialize(); Q_INVOKABLE void requestUpdate(); QNetworkSession::State sessionStateForId(const QString &id); diff --git a/src/plugins/bearer/symbian/symbianengine.cpp b/src/plugins/bearer/symbian/symbianengine.cpp index c629d02..8e9675e 100644 --- a/src/plugins/bearer/symbian/symbianengine.cpp +++ b/src/plugins/bearer/symbian/symbianengine.cpp @@ -137,7 +137,12 @@ SymbianEngine::SymbianEngine(QObject *parent) return; } #endif - +} + +void SymbianEngine::initialize() +{ + QMutexLocker locker(&mutex); + SymbianNetworkConfigurationPrivate *cpPriv = new SymbianNetworkConfigurationPrivate; cpPriv->name = "UserChoice"; cpPriv->bearer = SymbianNetworkConfigurationPrivate::BearerUnknown; diff --git a/src/plugins/bearer/symbian/symbianengine.h b/src/plugins/bearer/symbian/symbianengine.h index dfd12bd..afb37de 100644 --- a/src/plugins/bearer/symbian/symbianengine.h +++ b/src/plugins/bearer/symbian/symbianengine.h @@ -110,6 +110,7 @@ public: bool hasIdentifier(const QString &id); + Q_INVOKABLE void initialize(); Q_INVOKABLE void requestUpdate(); QNetworkConfigurationManager::Capabilities capabilities() const; -- cgit v0.12 From 2c961fcf39c991ee461a35aa62158cdd3ac8e9f8 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 19 Apr 2010 21:39:00 +0200 Subject: [tst_qhostinfo] Properly clean up the cache and lookup threads. Ensure that one test won't interfere with the next Reviewed-by: Markus Goetz --- src/network/kernel/qhostinfo.cpp | 22 ++++++++++++++++++---- src/network/kernel/qhostinfo_p.h | 3 ++- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/src/network/kernel/qhostinfo.cpp b/src/network/kernel/qhostinfo.cpp index baf69e7..7e006e0 100644 --- a/src/network/kernel/qhostinfo.cpp +++ b/src/network/kernel/qhostinfo.cpp @@ -488,9 +488,23 @@ QHostInfoLookupManager::~QHostInfoLookupManager() wasDeleted = true; // don't qDeleteAll currentLookups, the QThreadPool has ownership - qDeleteAll(postponedLookups); - qDeleteAll(scheduledLookups); - qDeleteAll(finishedLookups); + clear(); +} + +void QHostInfoLookupManager::clear() +{ + { + QMutexLocker locker(&mutex); + qDeleteAll(postponedLookups); + qDeleteAll(scheduledLookups); + qDeleteAll(finishedLookups); + postponedLookups.clear(); + scheduledLookups.clear(); + finishedLookups.clear(); + } + + threadPool.waitForDone(); + cache.clear(); } void QHostInfoLookupManager::work() @@ -636,7 +650,7 @@ void qt_qhostinfo_clear_cache() { QHostInfoLookupManager* manager = theHostInfoLookupManager(); if (manager) { - manager->cache.clear(); + manager->clear(); } } diff --git a/src/network/kernel/qhostinfo_p.h b/src/network/kernel/qhostinfo_p.h index 4fc74e9..e11766b 100644 --- a/src/network/kernel/qhostinfo_p.h +++ b/src/network/kernel/qhostinfo_p.h @@ -116,7 +116,7 @@ public: // These functions are outside of the QHostInfo class and strictly internal. // Do NOT use them outside of QAbstractSocket. QHostInfo Q_NETWORK_EXPORT qt_qhostinfo_lookup(const QString &name, QObject *receiver, const char *member, bool *valid, int *id); -void Q_NETWORK_EXPORT qt_qhostinfo_clear_cache(); +void Q_AUTOTEST_EXPORT qt_qhostinfo_clear_cache(); void Q_AUTOTEST_EXPORT qt_qhostinfo_enable_cache(bool e); class QHostInfoCache @@ -161,6 +161,7 @@ public: QHostInfoLookupManager(); ~QHostInfoLookupManager(); + void clear(); void work(); // called from QHostInfo -- cgit v0.12 From 85add63738927dc5a0ebfdb27edccfee66ba8caa Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 19 Apr 2010 20:53:05 +0200 Subject: [tst_qhostinfo] Modify multipleDifferentLookups to repeat hostnames Reviewed-By: Markus Goetz --- tests/auto/qhostinfo/tst_qhostinfo.cpp | 45 +++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 17 deletions(-) diff --git a/tests/auto/qhostinfo/tst_qhostinfo.cpp b/tests/auto/qhostinfo/tst_qhostinfo.cpp index 4282062..c336746 100644 --- a/tests/auto/qhostinfo/tst_qhostinfo.cpp +++ b/tests/auto/qhostinfo/tst_qhostinfo.cpp @@ -128,6 +128,7 @@ private slots: void threadSafety(); void multipleSameLookups(); + void multipleDifferentLookups_data(); void multipleDifferentLookups(); void cache(); @@ -441,36 +442,46 @@ void tst_QHostInfo::multipleSameLookups() for (int i = 0; i < COUNT; i++) QHostInfo::lookupHost("localhost", this, SLOT(resultsReady(const QHostInfo))); - QTRY_VERIFY(lookupsDoneCounter == COUNT); - - // spin two seconds more to see if it is not more :) - QTestEventLoop::instance().enterLoop(2); - QTRY_VERIFY(lookupsDoneCounter == COUNT); + QElapsedTimer timer; + timer.start(); + while (timer.elapsed() < 10000 && lookupsDoneCounter < COUNT) { + QTestEventLoop::instance().enterLoop(2); + } + QCOMPARE(lookupsDoneCounter, COUNT); } // this test is for the multi-threaded QHostInfo rewrite. It is about getting results at all, // not about getting correct IPs +void tst_QHostInfo::multipleDifferentLookups_data() +{ + QTest::addColumn("repeats"); + QTest::newRow("1") << 1; + QTest::newRow("2") << 2; + QTest::newRow("5") << 5; + QTest::newRow("10") << 10; +} + void tst_QHostInfo::multipleDifferentLookups() { QStringList hostnameList; hostnameList << "www.ovi.com" << "www.nokia.com" << "qt.nokia.com" << "www.trolltech.com" << "troll.no" - << "www.qtcentre.org" << "forum.nokia.com" << "www.forum.nokia.com" << "wiki.forum.nokia.com" - << "www.nokia.no" << "nokia.de" << "127.0.0.1" << "----"; + << "www.qtcentre.org" << "forum.nokia.com" << "www.nokia.com" << "wiki.forum.nokia.com" + << "www.nokia.com" << "nokia.de" << "127.0.0.1" << "----"; + QFETCH(int, repeats); const int COUNT = hostnameList.size(); lookupsDoneCounter = 0; for (int i = 0; i < hostnameList.size(); i++) - QHostInfo::lookupHost(hostnameList.at(i), this, SLOT(resultsReady(const QHostInfo))); - - // give some time - QTestEventLoop::instance().enterLoop(5); - // try_verify gives some more time - QTRY_VERIFY(lookupsDoneCounter == COUNT); + for (int j = 0; j < repeats; ++j) + QHostInfo::lookupHost(hostnameList.at(i), this, SLOT(resultsReady(const QHostInfo))); - // spin two seconds more to see if it is not more than expected - QTestEventLoop::instance().enterLoop(2); - QTRY_VERIFY(lookupsDoneCounter == COUNT); + QElapsedTimer timer; + timer.start(); + while (timer.elapsed() < 10000 && lookupsDoneCounter < repeats*COUNT) { + QTestEventLoop::instance().enterLoop(2); + } + QCOMPARE(lookupsDoneCounter, repeats*COUNT); } void tst_QHostInfo::cache() @@ -517,7 +528,7 @@ void tst_QHostInfo::resultsReady(const QHostInfo &hi) lookupDone = true; lookupResults = hi; lookupsDoneCounter++; - QTestEventLoop::instance().exitLoop(); + QMetaObject::invokeMethod(&QTestEventLoop::instance(), "exitLoop", Qt::QueuedConnection); } QTEST_MAIN(tst_QHostInfo) -- cgit v0.12 From c0bbdb8a293d0877e8dba517bad50748c70d0dfd Mon Sep 17 00:00:00 2001 From: Prasanth Ullattil Date: Mon, 19 Apr 2010 09:08:34 +0200 Subject: ScrollBar width not updated dynamically on Windows. Whenever the scrollbar width is changed in the system, Windows sends a WM_SETTINGCHANGE message (with SPI_SETNONCLIENTMETRICS) to all toplevel windows. This will now call updateGeometry() for all QScrollBar based widgets and issue a new QEvent::LayoutRequest. Task-number: QTBUG-9822 Reviewed-by: Jan-Arve --- src/gui/kernel/qapplication_win.cpp | 25 +++++++++++++++++++++++++ src/gui/widgets/qabstractscrollarea.cpp | 1 + 2 files changed, 26 insertions(+) diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp index 1d8eb4c..fb2837e 100644 --- a/src/gui/kernel/qapplication_win.cpp +++ b/src/gui/kernel/qapplication_win.cpp @@ -79,6 +79,7 @@ extern void qt_wince_hide_taskbar(HWND hwnd); //defined in qguifunctions_wince.c #include "qlayout.h" #include "qtooltip.h" #include "qt_windows.h" +#include "qscrollbar.h" #if defined(QT_NON_COMMERCIAL) #include "qnc_win.h" #endif @@ -701,6 +702,21 @@ void QApplicationPrivate::initializeWidgetPaletteHash() QApplication::setPalette(menu, "QMenuBar"); } +static void qt_set_windows_updateScrollBar(QWidget *widget) +{ + QList children = widget->children(); + for (int i = 0; i < children.size(); ++i) { + QObject *o = children.at(i); + if(!o->isWidgetType()) + continue; + if (QWidget *w = static_cast(o)) + qt_set_windows_updateScrollBar(w); + } + if (qobject_cast(widget)) + widget->updateGeometry(); +} + + /***************************************************************************** qt_init() - initializes Qt for Windows *****************************************************************************/ @@ -1930,6 +1946,15 @@ extern "C" LRESULT QT_WIN_CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wPa } } } + else if (msg.wParam == SPI_SETNONCLIENTMETRICS) { + widget = (QETWidget*)QWidget::find(hwnd); + if (widget && !widget->parentWidget()) { + qt_set_windows_updateScrollBar(widget); + QEvent e(QEvent::LayoutRequest); + QApplication::sendEvent(widget, &e); + } + } + break; case WM_PAINT: // paint event diff --git a/src/gui/widgets/qabstractscrollarea.cpp b/src/gui/widgets/qabstractscrollarea.cpp index 73ec53e..8cffebd 100644 --- a/src/gui/widgets/qabstractscrollarea.cpp +++ b/src/gui/widgets/qabstractscrollarea.cpp @@ -983,6 +983,7 @@ bool QAbstractScrollArea::event(QEvent *e) case QEvent::StyleChange: case QEvent::LayoutDirectionChange: case QEvent::ApplicationLayoutDirectionChange: + case QEvent::LayoutRequest: d->layoutChildren(); // fall through default: -- cgit v0.12 From 84eadc0bc232d8196e08f5aa5614ce9a17ea93bd Mon Sep 17 00:00:00 2001 From: Morten Engvoldsen Date: Tue, 20 Apr 2010 11:51:35 +0200 Subject: Doc: Correcting qdocconf files for assistant Linking correct files to the qdocconf files Reviewed-by: Daniel Molkentin --- tools/qdoc3/test/qt-build-docs.qdocconf | 21 ++++++++++++++------- tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf | 20 +++++++++++++------- tools/qdoc3/test/qt.qdocconf | 20 +++++++++++++------- tools/qdoc3/test/qt_zh_CN.qdocconf | 20 +++++++++++++------- 4 files changed, 53 insertions(+), 28 deletions(-) diff --git a/tools/qdoc3/test/qt-build-docs.qdocconf b/tools/qdoc3/test/qt-build-docs.qdocconf index dbff4e2..0694748 100644 --- a/tools/qdoc3/test/qt-build-docs.qdocconf +++ b/tools/qdoc3/test/qt-build-docs.qdocconf @@ -22,14 +22,12 @@ qhp.Qt.indexTitle = Qt Reference Documentation # Files not referenced in any qdoc file (last four are needed by qtdemo) # See also extraimages.HTML qhp.Qt.extraFiles = index.html \ - style/style.css \ - scripts/functions.js \ - scripts/jquery.js \ images/api_examples.png \ images/api_lookup.png \ images/api_topics.png \ - images/bg_ll.png \ images/bg_l_blank.png \ + images/bg_ll_blank.png \ + images/bg_ll.png \ images/bg_l.png \ images/bg_lr.png \ images/bg_r.png \ @@ -37,24 +35,33 @@ qhp.Qt.extraFiles = index.html \ images/bg_ul.png \ images/bg_ur_blank.png \ images/bg_ur.png \ + images/box_bg.png \ images/breadcrumb.png \ images/bullet_dn.png \ images/bullet_gt.png \ + images/bullet_sq.png \ + images/bullet_up.png \ + images/coloreditorfactoryimage.png \ + images/content_bg.png \ + images/dynamiclayouts-example.png \ images/feedbackground.png \ images/form_bg.png \ images/horBar.png \ images/page_bg.png \ images/print.png \ images/qt_guide.png \ + images/qt_icon.png \ images/qt-logo.png \ images/qt_ref_doc.png \ images/qt_tools.png \ images/sep.png \ images/sprites-combined.png \ + images/stylesheet-coffee-plastique.png \ images/taskmenuextension-example.png \ - images/coloreditorfactoryimage.png \ - images/dynamiclayouts-example.png \ - images/stylesheet-coffee-plastique.png + scripts/functions.js \ + scripts/jquery.js \ + style/style.css + qhp.Qt.filterAttributes = qt 4.7.0 qtrefdoc diff --git a/tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf b/tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf index 461c069..5a3d726 100644 --- a/tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf +++ b/tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf @@ -30,14 +30,12 @@ qhp.Qt.customFilters.Qt.filterAttributes = qt 4.7.0 # Files not referenced in any qdoc file (last four are needed by qtdemo) # See also extraimages.HTML qhp.Qt.extraFiles = index.html \ - style/style.css \ - scripts/functions.js \ - scripts/jquery.js \ images/api_examples.png \ images/api_lookup.png \ images/api_topics.png \ - images/bg_ll.png \ images/bg_l_blank.png \ + images/bg_ll_blank.png \ + images/bg_ll.png \ images/bg_l.png \ images/bg_lr.png \ images/bg_r.png \ @@ -45,24 +43,32 @@ qhp.Qt.extraFiles = index.html \ images/bg_ul.png \ images/bg_ur_blank.png \ images/bg_ur.png \ + images/box_bg.png \ images/breadcrumb.png \ images/bullet_dn.png \ images/bullet_gt.png \ + images/bullet_sq.png \ + images/bullet_up.png \ + images/coloreditorfactoryimage.png \ + images/content_bg.png \ + images/dynamiclayouts-example.png \ images/feedbackground.png \ images/form_bg.png \ images/horBar.png \ images/page_bg.png \ images/print.png \ images/qt_guide.png \ + images/qt_icon.png \ images/qt-logo.png \ images/qt_ref_doc.png \ images/qt_tools.png \ images/sep.png \ images/sprites-combined.png \ + images/stylesheet-coffee-plastique.png \ images/taskmenuextension-example.png \ - images/coloreditorfactoryimage.png \ - images/dynamiclayouts-example.png \ - images/stylesheet-coffee-plastique.png + scripts/functions.js \ + scripts/jquery.js \ + style/style.css language = Cpp diff --git a/tools/qdoc3/test/qt.qdocconf b/tools/qdoc3/test/qt.qdocconf index ef6fe97..69ab4e1 100644 --- a/tools/qdoc3/test/qt.qdocconf +++ b/tools/qdoc3/test/qt.qdocconf @@ -26,14 +26,12 @@ qhp.Qt.indexRoot = # Files not referenced in any qdoc file (last four are needed by qtdemo) # See also extraimages.HTML qhp.Qt.extraFiles = index.html \ - style/style.css \ - scripts/functions.js \ - scripts/jquery.js \ images/api_examples.png \ images/api_lookup.png \ images/api_topics.png \ - images/bg_ll.png \ images/bg_l_blank.png \ + images/bg_ll_blank.png \ + images/bg_ll.png \ images/bg_l.png \ images/bg_lr.png \ images/bg_r.png \ @@ -41,24 +39,32 @@ qhp.Qt.extraFiles = index.html \ images/bg_ul.png \ images/bg_ur_blank.png \ images/bg_ur.png \ + images/box_bg.png \ images/breadcrumb.png \ images/bullet_dn.png \ images/bullet_gt.png \ + images/bullet_sq.png \ + images/bullet_up.png \ + images/coloreditorfactoryimage.png \ + images/content_bg.png \ + images/dynamiclayouts-example.png \ images/feedbackground.png \ images/form_bg.png \ images/horBar.png \ images/page_bg.png \ images/print.png \ images/qt_guide.png \ + images/qt_icon.png \ images/qt-logo.png \ images/qt_ref_doc.png \ images/qt_tools.png \ images/sep.png \ images/sprites-combined.png \ + images/stylesheet-coffee-plastique.png \ images/taskmenuextension-example.png \ - images/coloreditorfactoryimage.png \ - images/dynamiclayouts-example.png \ - images/stylesheet-coffee-plastique.png + scripts/functions.js \ + scripts/jquery.js \ + style/style.css qhp.Qt.filterAttributes = qt 4.7.0 qtrefdoc qhp.Qt.customFilters.Qt.name = Qt 4.7.0 diff --git a/tools/qdoc3/test/qt_zh_CN.qdocconf b/tools/qdoc3/test/qt_zh_CN.qdocconf index c5d2c88..a5a65d8 100644 --- a/tools/qdoc3/test/qt_zh_CN.qdocconf +++ b/tools/qdoc3/test/qt_zh_CN.qdocconf @@ -32,14 +32,12 @@ qhp.Qt.customFilters.Qt.filterAttributes = qt 4.7.0 # Files not referenced in any qdoc file (last four are needed by qtdemo) # See also extraimages.HTML qhp.Qt.extraFiles = index.html \ - style/style.css \ - scripts/functions.js \ - scripts/jquery.js \ images/api_examples.png \ images/api_lookup.png \ images/api_topics.png \ - images/bg_ll.png \ images/bg_l_blank.png \ + images/bg_ll_blank.png \ + images/bg_ll.png \ images/bg_l.png \ images/bg_lr.png \ images/bg_r.png \ @@ -47,24 +45,32 @@ qhp.Qt.extraFiles = index.html \ images/bg_ul.png \ images/bg_ur_blank.png \ images/bg_ur.png \ + images/box_bg.png \ images/breadcrumb.png \ images/bullet_dn.png \ images/bullet_gt.png \ + images/bullet_sq.png \ + images/bullet_up.png \ + images/coloreditorfactoryimage.png \ + images/content_bg.png \ + images/dynamiclayouts-example.png \ images/feedbackground.png \ images/form_bg.png \ images/horBar.png \ images/page_bg.png \ images/print.png \ images/qt_guide.png \ + images/qt_icon.png \ images/qt-logo.png \ images/qt_ref_doc.png \ images/qt_tools.png \ images/sep.png \ images/sprites-combined.png \ + images/stylesheet-coffee-plastique.png \ images/taskmenuextension-example.png \ - images/coloreditorfactoryimage.png \ - images/dynamiclayouts-example.png \ - images/stylesheet-coffee-plastique.png + scripts/functions.js \ + scripts/jquery.js \ + style/style.css language = Cpp -- cgit v0.12 From d8b3186319cf5a3d1cf3784fa93dd0cf114f8ab5 Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Tue, 13 Apr 2010 17:56:27 +0200 Subject: Backport a few fixes to the Designer filteredit from Creator First problem is that there are too many animations triggered. Second problem is that it doesnt reflect the disabled state. Reviewed-by: thorbjorn --- tools/designer/src/lib/shared/filterwidget.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tools/designer/src/lib/shared/filterwidget.cpp b/tools/designer/src/lib/shared/filterwidget.cpp index f485346..07af901 100644 --- a/tools/designer/src/lib/shared/filterwidget.cpp +++ b/tools/designer/src/lib/shared/filterwidget.cpp @@ -80,8 +80,11 @@ void IconButton::paintEvent(QPaintEvent *) QPainter painter(this); // Note isDown should really use the active state but in most styles // this has no proper feedback - QPixmap iconpixmap = icon().pixmap(ICONBUTTON_SIZE, ICONBUTTON_SIZE, isDown() ? - QIcon::Selected : QIcon::Normal); + QIcon::Mode state = QIcon::Disabled; + if (isEnabled()) + state = isDown() ? QIcon::Selected : QIcon::Normal; + QPixmap iconpixmap = icon().pixmap(QSize(ICONBUTTON_SIZE, ICONBUTTON_SIZE), + state, QIcon::Off); QRect pixmapRect = QRect(0, 0, iconpixmap.width(), iconpixmap.height()); pixmapRect.moveCenter(rect().center()); painter.setOpacity(m_fader); @@ -204,9 +207,12 @@ QString FilterWidget::text() const return m_editor->text(); } -void FilterWidget::checkButton(const QString &) +void FilterWidget::checkButton(const QString &text) { - m_button->animateShow(!m_editor->text().isEmpty()); + static QString oldtext; + if (oldtext.isEmpty() || text.isEmpty()) + m_button->animateShow(!m_editor->text().isEmpty()); + oldtext = text; } void FilterWidget::reset() -- cgit v0.12 From 7bec0ef0cd9ffb633586c820004607d2e3d66b07 Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Tue, 20 Apr 2010 11:56:37 +0200 Subject: Improve itemview appearance on Mac MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes two significant issues with the mac look and feel. * Remove superfluous white inner border from item views. This makes items fill all the way to the border. * Remove double border for item view headers. We now clip headers properly to make them blend with the outer border. Reviewed-by: Morten Sørvig Task-number: QTBUG-10047 --- src/gui/styles/qmacstyle_mac.mm | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/gui/styles/qmacstyle_mac.mm b/src/gui/styles/qmacstyle_mac.mm index 074dd89..f5b0b0c 100644 --- a/src/gui/styles/qmacstyle_mac.mm +++ b/src/gui/styles/qmacstyle_mac.mm @@ -2143,7 +2143,7 @@ int QMacStyle::pixelMetric(PixelMetric metric, const QStyleOption *opt, const QW if (qstyleoption_cast(opt) != 0) ret = 0; else - ret = QWindowsStyle::pixelMetric(metric, opt, widget); + ret = 1; break; case PM_MaximumDragDistance: ret = -1; @@ -3099,14 +3099,16 @@ void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPai HIRect hirect = qt_hirectForQRect(opt->rect); HIThemeDrawButton(&hirect, &bi, cg, kHIThemeOrientationNormal, 0); break; } + case PE_Frame: { QPen oldPen = p->pen(); - QPen newPen; - newPen.setBrush(opt->palette.dark()); - p->setPen(newPen); + p->setPen(opt->palette.base().color().darker(140)); p->drawRect(opt->rect.adjusted(0, 0, -1, -1)); + p->setPen(opt->palette.base().color().darker(180)); + p->drawLine(opt->rect.topLeft(), opt->rect.topRight()); p->setPen(oldPen); break; } + case PE_FrameLineEdit: if (const QStyleOptionFrame *frame = qstyleoption_cast(opt)) { if (frame->state & State_Sunken) { @@ -3279,10 +3281,14 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter if (header->orientation == Qt::Horizontal){ switch (header->position) { case QStyleOptionHeader::Beginning: + ir.adjust(-1, -1, 0, 0); break; case QStyleOptionHeader::Middle: + ir.adjust(-1, -1, 0, 0); + break; + case QStyleOptionHeader::OnlyOneSection: case QStyleOptionHeader::End: - ir.adjust(-1, 0, 0, 0); + ir.adjust(-1, -1, 1, 0); break; default: break; -- cgit v0.12 From 0a6faf00f06c8a0e2e0f4714bb14645172ee8922 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Tue, 20 Apr 2010 12:33:25 +0200 Subject: qdoc: Avoided putting bad chars in links --- tools/qdoc3/doc.cpp | 11 +++++++---- tools/qdoc3/htmlgenerator.cpp | 6 +++--- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/tools/qdoc3/doc.cpp b/tools/qdoc3/doc.cpp index ad4cdde..5716626 100644 --- a/tools/qdoc3/doc.cpp +++ b/tools/qdoc3/doc.cpp @@ -3036,7 +3036,7 @@ QString Doc::canonicalTitle(const QString &title) QString result; result.reserve(title.size()); - bool slurping = false; + bool dashAppended = false; bool begun = false; int lastAlnum = 0; for (int i = 0; i != title.size(); ++i) { @@ -3047,18 +3047,21 @@ QString Doc::canonicalTitle(const QString &title) if (alnum) { result += QLatin1Char(c); begun = true; - slurping = false; + dashAppended = false; lastAlnum = result.size(); } - else if (!slurping) { + else if (!dashAppended) { if (begun) result += QLatin1Char('-'); - slurping = true; + dashAppended = true; } +#if 0 + // This was screwing things up. else { result += title[i]; lastAlnum = result.size(); } +#endif } result.truncate(lastAlnum); return result; diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index e074bb2..0781c4c 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -414,9 +414,7 @@ void HtmlGenerator::generateTree(const Tree *tree, CodeMarker *marker) generateIndex(fileBase, projectUrl, projectDescription); generatePageIndex(outputDir() + "/" + fileBase + ".pageindex", marker); - //qDebug() << "start helpProjectWriter->generate(myTree)"; helpProjectWriter->generate(myTree); - //qDebug() << "end helpProjectWriter->generate(myTree)"; } void HtmlGenerator::startText(const Node * /* relative */, @@ -1983,10 +1981,12 @@ void HtmlGenerator::generateTableOfContents(const Node *node, } int numAtoms; Text headingText = Text::sectionHeading(atom); + QString s = headingText.toString(); out() << "
  • "; out() << ""; generateAtomList(headingText.firstAtom(), node, marker, true, numAtoms); out() << "
  • \n"; -- cgit v0.12 From 528ffd602cc5a501713cd768df0cf6870a36ddad Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Tue, 20 Apr 2010 14:00:01 +0200 Subject: Fix Mac OS Tiger-vs-Leopard crash due to memory tagging by JavaScriptCore Cherry-picked from WebKit trunk. --- .../javascriptcore/JavaScriptCore/ChangeLog | 26 +++++++++++++++ .../javascriptcore/JavaScriptCore/wtf/VMTags.h | 39 +++++++++++++++++----- src/3rdparty/javascriptcore/VERSION | 4 +-- 3 files changed, 59 insertions(+), 10 deletions(-) diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/ChangeLog b/src/3rdparty/javascriptcore/JavaScriptCore/ChangeLog index 4f6e565..11572b0 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/ChangeLog +++ b/src/3rdparty/javascriptcore/JavaScriptCore/ChangeLog @@ -1,3 +1,29 @@ +2010-04-14 Kent Hansen + + Reviewed by Maciej Stachowiak. + + Mac OS X: Use deployment target to determine whether memory tagging should be enabled + https://bugs.webkit.org/show_bug.cgi?id=34888 + + When building on (Snow) Leopard but targeting Tiger + (TARGETING_TIGER defined, BUILDING_ON_TIGER not defined), + WebKit would crash on Tiger because the tags passed to mmap + caused those function calls to fail. + + Conversely, when building on Tiger but targeting Leopard + (BUILDING_ON_TIGER defined, TARGETING_LEOPARD defined), WebKit + would crash on Leopard because the tags passed to vm_map and + vm_allocate caused those function calls to fail. + + Solution: Use TARGETING_TIGER rather than BUILDING_ON_TIGER to + govern the tag definitions. Use the same tags for vm_map and + vm_allocate regardless of target, since they work on + both. Fall back to the mmap tags that work on Tiger (that is, + "no tags") if targeting Tiger, since those tags also work on + Leopard. + + * wtf/VMTags.h: + 2010-03-29 Patrick Gansterer Reviewed by Darin Adler. diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/VMTags.h b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/VMTags.h index 34e2494..75bec11 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/VMTags.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/VMTags.h @@ -30,25 +30,48 @@ // On Mac OS X, the VM subsystem allows tagging memory requested from mmap and vm_map // in order to aid tools that inspect system memory use. -#if OS(DARWIN) && !defined(BUILDING_ON_TIGER) +#if OS(DARWIN) #include +#if !defined(TARGETING_TIGER) + #if defined(VM_MEMORY_TCMALLOC) #define VM_TAG_FOR_TCMALLOC_MEMORY VM_MAKE_TAG(VM_MEMORY_TCMALLOC) #else #define VM_TAG_FOR_TCMALLOC_MEMORY VM_MAKE_TAG(53) #endif // defined(VM_MEMORY_TCMALLOC) -#if defined(VM_MEMORY_JAVASCRIPT_CORE) && defined(VM_MEMORY_JAVASCRIPT_JIT_REGISTER_FILE) && defined(VM_MEMORY_JAVASCRIPT_JIT_EXECUTABLE_ALLOCATOR) && defined(VM_MEMORY_JAVASCRIPT_JIT_EXECUTABLE_ALLOCATOR) -#define VM_TAG_FOR_COLLECTOR_MEMORY VM_MAKE_TAG(VM_MEMORY_JAVASCRIPT_CORE) -#define VM_TAG_FOR_REGISTERFILE_MEMORY VM_MAKE_TAG(VM_MEMORY_JAVASCRIPT_JIT_REGISTER_FILE) +#if defined(VM_MEMORY_JAVASCRIPT_JIT_EXECUTABLE_ALLOCATOR) #define VM_TAG_FOR_EXECUTABLEALLOCATOR_MEMORY VM_MAKE_TAG(VM_MEMORY_JAVASCRIPT_JIT_EXECUTABLE_ALLOCATOR) #else -#define VM_TAG_FOR_COLLECTOR_MEMORY VM_MAKE_TAG(63) #define VM_TAG_FOR_EXECUTABLEALLOCATOR_MEMORY VM_MAKE_TAG(64) +#endif // defined(VM_MEMORY_JAVASCRIPT_JIT_EXECUTABLE_ALLOCATOR) + +#if defined(VM_MEMORY_JAVASCRIPT_JIT_REGISTER_FILE) +#define VM_TAG_FOR_REGISTERFILE_MEMORY VM_MAKE_TAG(VM_MEMORY_JAVASCRIPT_JIT_REGISTER_FILE) +#else #define VM_TAG_FOR_REGISTERFILE_MEMORY VM_MAKE_TAG(65) -#endif // defined(VM_MEMORY_JAVASCRIPT_CORE) && defined(VM_MEMORY_JAVASCRIPT_JIT_REGISTER_FILE) && defined(VM_MEMORY_JAVASCRIPT_JIT_EXECUTABLE_ALLOCATOR) && defined(VM_MEMORY_JAVASCRIPT_JIT_EXECUTABLE_ALLOCATOR) +#endif // defined(VM_MEMORY_JAVASCRIPT_JIT_REGISTER_FILE) + +#else // !defined(TARGETING_TIGER) + +// mmap on Tiger fails with tags that work on Leopard, so fall +// back to Tiger-compatible tags (that also work on Leopard) +// when targeting Tiger. +#define VM_TAG_FOR_TCMALLOC_MEMORY -1 +#define VM_TAG_FOR_EXECUTABLEALLOCATOR_MEMORY -1 +#define VM_TAG_FOR_REGISTERFILE_MEMORY -1 + +#endif // !defined(TARGETING_TIGER) + +// Tags for vm_map and vm_allocate work on both Tiger and Leopard. + +#if defined(VM_MEMORY_JAVASCRIPT_CORE) +#define VM_TAG_FOR_COLLECTOR_MEMORY VM_MAKE_TAG(VM_MEMORY_JAVASCRIPT_CORE) +#else +#define VM_TAG_FOR_COLLECTOR_MEMORY VM_MAKE_TAG(63) +#endif // defined(VM_MEMORY_JAVASCRIPT_CORE) #if defined(VM_MEMORY_WEBCORE_PURGEABLE_BUFFERS) #define VM_TAG_FOR_WEBCORE_PURGEABLE_MEMORY VM_MAKE_TAG(VM_MEMORY_WEBCORE_PURGEABLE_BUFFERS) @@ -56,7 +79,7 @@ #define VM_TAG_FOR_WEBCORE_PURGEABLE_MEMORY VM_MAKE_TAG(69) #endif // defined(VM_MEMORY_WEBCORE_PURGEABLE_BUFFERS) -#else // OS(DARWIN) && !defined(BUILDING_ON_TIGER) +#else // OS(DARWIN) #define VM_TAG_FOR_TCMALLOC_MEMORY -1 #define VM_TAG_FOR_COLLECTOR_MEMORY -1 @@ -64,6 +87,6 @@ #define VM_TAG_FOR_REGISTERFILE_MEMORY -1 #define VM_TAG_FOR_WEBCORE_PURGEABLE_MEMORY -1 -#endif // OS(DARWIN) && !defined(BUILDING_ON_TIGER) +#endif // OS(DARWIN) #endif // VMTags_h diff --git a/src/3rdparty/javascriptcore/VERSION b/src/3rdparty/javascriptcore/VERSION index 2b885a7..9a02027 100644 --- a/src/3rdparty/javascriptcore/VERSION +++ b/src/3rdparty/javascriptcore/VERSION @@ -4,8 +4,8 @@ This is a snapshot of JavaScriptCore from The commit imported was from the - javascriptcore-snapshot-07042010 branch/tag + javascriptcore-snapshot-20042010 branch/tag and has the sha1 checksum - 475f8c67522d8b3f3163dc3a6b24d6083fd0ac19 + c589321ffdda5e93cf77e2cf2cf43afe3e996f6e -- cgit v0.12 From 327fabf8e8819b199aa24912ffe6893020b465d4 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Tue, 20 Apr 2010 13:44:59 +0200 Subject: Default (Parentless) QMenuBar actions do not work This bug is a bit nasty. The problem is that Cocoa is trying to be smart behind our back, and enable/disable menu items depending on the menu item targets. But in Qt, we have a different policy that Cocoa on when a menu bar should be disabled or not. E.g. we allow a modal dialog to access the application menu bar if it is the only window on screen. This patch will work around cocoa being smart by setting the menu item targets dynamically, depending on the modal state of Qt. Setting it to nil will make the items enabled when there is a modal dialog on screen, and setting it to the menu loader will enable it when there is _no_ window on screen at all. Task-number: QTBUG-9209 Reviewed-by: prasanth --- src/gui/widgets/qmenu_mac.mm | 19 ++++-- tests/auto/macnativeevents/nativeeventlist.cpp | 5 -- tests/auto/macnativeevents/nativeeventlist.h | 1 - tests/auto/macnativeevents/tst_macnativeevents.cpp | 67 ++++++++++++++++++++-- 4 files changed, 77 insertions(+), 15 deletions(-) diff --git a/src/gui/widgets/qmenu_mac.mm b/src/gui/widgets/qmenu_mac.mm index 6a0eb53..7645c23 100644 --- a/src/gui/widgets/qmenu_mac.mm +++ b/src/gui/widgets/qmenu_mac.mm @@ -665,6 +665,7 @@ void qt_mac_set_modal_state_helper_recursive(OSMenuRef menu, OSMenuRef merge, bo } } #else + bool modalWindowOnScreen = qApp->activeModalWidget() != 0; for (NSMenuItem *item in [menu itemArray]) { OSMenuRef submenu = [item submenu]; if (submenu != merge) { @@ -674,10 +675,20 @@ void qt_mac_set_modal_state_helper_recursive(OSMenuRef menu, OSMenuRef merge, bo // The item should follow what the QAction has. if ([item tag]) { QAction *action = reinterpret_cast([item tag]); - syncNSMenuItemEnabled(item, action->isEnabled()); - } else { - syncNSMenuItemEnabled(item, YES); - } + syncNSMenuItemEnabled(item, action->isEnabled()); + } else { + syncNSMenuItemEnabled(item, YES); + } + // We sneak in some extra code here to handle a menu problem: + // If there is no window on screen, we cannot set 'nil' as + // menu item target, because then cocoa will disable the item + // (guess it assumes that there will be no first responder to + // catch the trigger anyway?) OTOH, If we have a modal window, + // then setting the menu loader as target will make cocoa not + // deliver the trigger because the loader is then seen as modally + // shaddowed). So either way there are shortcomings. Instead, we + // decide the target as late as possible: + [item setTarget:modalWindowOnScreen ? nil : getMenuLoader()]; } else { syncNSMenuItemEnabled(item, NO); } diff --git a/tests/auto/macnativeevents/nativeeventlist.cpp b/tests/auto/macnativeevents/nativeeventlist.cpp index d5d7b95..1a90ee0 100644 --- a/tests/auto/macnativeevents/nativeeventlist.cpp +++ b/tests/auto/macnativeevents/nativeeventlist.cpp @@ -88,11 +88,6 @@ void NativeEventList::append(int waitMs, QNativeEvent *event) eventList.append(QPair(waitMs, event)); } -void NativeEventList::append(int waitMs) -{ - eventList.append(QPair(waitMs, 0)); -} - void NativeEventList::play(Playback playback) { waitNextEvent(); diff --git a/tests/auto/macnativeevents/nativeeventlist.h b/tests/auto/macnativeevents/nativeeventlist.h index 688665d..efcca43 100644 --- a/tests/auto/macnativeevents/nativeeventlist.h +++ b/tests/auto/macnativeevents/nativeeventlist.h @@ -57,7 +57,6 @@ class NativeEventList : public QObject void append(QNativeEvent *event); void append(int waitMs, QNativeEvent *event = 0); - void append(int waitMs); void play(Playback playback = WaitUntilFinished); void stop(); diff --git a/tests/auto/macnativeevents/tst_macnativeevents.cpp b/tests/auto/macnativeevents/tst_macnativeevents.cpp index 70a14f5..18fe81a 100644 --- a/tests/auto/macnativeevents/tst_macnativeevents.cpp +++ b/tests/auto/macnativeevents/tst_macnativeevents.cpp @@ -39,10 +39,7 @@ ** ****************************************************************************/ -#include -#include -#include -#include +#include #include #include "qnativeevents.h" @@ -65,8 +62,10 @@ private slots: void testMouseDragOutside(); void testMouseDragToNonClientArea(); void testDragWindow(); - void testMouseEnter(); void testChildDialogInFrontOfModalParent(); + void testMouseEnter(); + void testMenuBarWorksWithoutWindows(); + void testMenuBarWorksForModalDialog(); }; void tst_MacNativeEvents::testMouseMoveLocation() @@ -307,6 +306,64 @@ void tst_MacNativeEvents::testChildDialogInFrontOfModalParent() QVERIFY(!child.isVisible()); } +void tst_MacNativeEvents::testMenuBarWorksWithoutWindows() +{ + // Test that a global menu bar is enabled even + // when there is no window on screen (QTBUG-9209) + QEventLoop loop; + QMenuBar mb; + QMenu *fileMenu = mb.addMenu("Dummy"); + fileMenu->addAction("Dummy", &loop, SLOT(quit())); + QPoint inside1(250, 10); + QPoint inside2 = inside1 + QPoint(0, 30); + + // Post a click to press the menu item: + NativeEventList native; + native.append(new QNativeMouseButtonEvent(inside1, Qt::LeftButton, 1, Qt::NoModifier)); + native.append(new QNativeMouseButtonEvent(inside1, Qt::LeftButton, 0, Qt::NoModifier)); + native.append(new QNativeMouseButtonEvent(inside2, Qt::LeftButton, 1, Qt::NoModifier)); + native.append(new QNativeMouseButtonEvent(inside2, Qt::LeftButton, 0, Qt::NoModifier)); + + // Add a backup timer to end the test if we fail: + QTimer dontHang; + dontHang.setSingleShot(true); + connect(&dontHang, SIGNAL(timeout()), &loop, SLOT(quit())); + dontHang.start(2000); + + native.play(NativeEventList::ReturnImmediately); + loop.exec(); + QVERIFY2(dontHang.isActive(), "The item was not triggered!"); +} + +void tst_MacNativeEvents::testMenuBarWorksForModalDialog() +{ + // Test that a global menu bar is enabled even + // when there is no window on screen (QTBUG-9209) + QDialog dialog; + QMenuBar mb; + QMenu *fileMenu = mb.addMenu("Dummy"); + fileMenu->addAction("Dummy", &dialog, SLOT(hide())); + QPoint inside1(250, 10); + QPoint inside2 = inside1 + QPoint(0, 30); + + // Post a click to press the menu item: + NativeEventList native; + native.append(new QNativeMouseButtonEvent(inside1, Qt::LeftButton, 1, Qt::NoModifier)); + native.append(new QNativeMouseButtonEvent(inside1, Qt::LeftButton, 0, Qt::NoModifier)); + native.append(new QNativeMouseButtonEvent(inside2, Qt::LeftButton, 1, Qt::NoModifier)); + native.append(new QNativeMouseButtonEvent(inside2, Qt::LeftButton, 0, Qt::NoModifier)); + + // Add a backup timer to end the test if we fail: + QTimer dontHang; + dontHang.setSingleShot(true); + connect(&dontHang, SIGNAL(timeout()), &dialog, SLOT(hide())); + dontHang.start(2000); + + native.play(NativeEventList::ReturnImmediately); + dialog.exec(); + QVERIFY2(dontHang.isActive(), "The item was not triggered!"); +} + #include "tst_macnativeevents.moc" QTEST_MAIN(tst_MacNativeEvents) -- cgit v0.12 From 019af5ecb5dbc9c173109ba670180177713a51ad Mon Sep 17 00:00:00 2001 From: Morten Engvoldsen Date: Tue, 20 Apr 2010 15:51:04 +0200 Subject: Doc: Cleaning HTML generator and updating index.qdoc Adding links to the index page and removing HTML attributes like align and valing form the HTML generator Reviewed-by: Martin Smith --- tools/qdoc3/htmlgenerator.cpp | 123 ++++++++++++++-------------- tools/qdoc3/test/qt-html-templates.qdocconf | 18 ++-- 2 files changed, 68 insertions(+), 73 deletions(-) diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index 0781c4c..bf2f724 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -512,14 +512,14 @@ int HtmlGenerator::generateAtom(const Atom *atom, out() << formattingRightMap()[ATOM_FORMATTING_TELETYPE]; break; case Atom::Code: - out() << "
    "
    +	out() << "
    "
                   << trimmedTrailing(highlightedCode(indent(codeIndent,atom->string()),
                                                      marker,relative))
                   << "
    \n"; break; #ifdef QDOC_QML case Atom::Qml: - out() << "
    "
    +	out() << "
    "
                   << trimmedTrailing(highlightedCode(indent(codeIndent,atom->string()),
                                                      marker,relative))
                   << "
    \n"; @@ -527,7 +527,7 @@ int HtmlGenerator::generateAtom(const Atom *atom, #endif case Atom::CodeNew: out() << "

    you can rewrite it as

    \n" - << "
    "
    +              << "
    "
                   << trimmedTrailing(highlightedCode(indent(codeIndent,atom->string()),
                                                      marker,relative))
                   << "
    \n"; @@ -536,9 +536,9 @@ int HtmlGenerator::generateAtom(const Atom *atom, out() << "

    For example, if you have code like

    \n"; // fallthrough case Atom::CodeBad: - out() << "
    "
    +        out() << "
    "
                   << trimmedTrailing(protectEnc(plainCode(indent(codeIndent,atom->string()))))
    -              << "
    \n"; + << "
    \n"; break; case Atom::FootnoteLeft: // ### For now @@ -847,7 +847,7 @@ int HtmlGenerator::generateAtom(const Atom *atom, if (atom->next() != 0) text = atom->next()->string(); if (atom->type() == Atom::Image) - out() << "

    "; + out() << "

    "; if (fileName.isEmpty()) { out() << "[Missing image " << protectEnc(atom->string()) << "]"; @@ -866,7 +866,7 @@ int HtmlGenerator::generateAtom(const Atom *atom, case Atom::ImageText: break; case Atom::LegaleseLeft: - out() << "

    "; + out() << "
    "; break; case Atom::LegaleseRight: out() << "
    "; @@ -908,13 +908,13 @@ int HtmlGenerator::generateAtom(const Atom *atom, else if (atom->string() == ATOM_LIST_VALUE) { threeColumnEnumValueTable = isThreeColumnEnumValueTable(atom); if (threeColumnEnumValueTable) { - out() << "

    " + out() << "
    " << "" << "" << "\n"; } else { - out() << "

    ConstantValueDescription
    " + out() << "
    " << "\n"; } } @@ -949,10 +949,10 @@ int HtmlGenerator::generateAtom(const Atom *atom, else { // (atom->string() == ATOM_LIST_VALUE) // ### Trenton - out() << "
    ConstantValue
    " + out() << "
    " << protectEnc(plainCode(marker->markedUpEnumValue(atom->next()->string(), relative))) - << ""; + << ""; QString itemValue; if (relative->type() == Node::Enum) { @@ -978,7 +978,7 @@ int HtmlGenerator::generateAtom(const Atom *atom, } else if (atom->string() == ATOM_LIST_VALUE) { if (threeColumnEnumValueTable) { - out() << ""; + out() << ""; if (matchAhead(atom, Atom::ListItemRight)) out() << " "; } @@ -1008,7 +1008,7 @@ int HtmlGenerator::generateAtom(const Atom *atom, out() << "\n"; } else if (atom->string() == ATOM_LIST_VALUE) { - out() << "

    \n"; + out() << "\n"; } else { out() << "\n"; @@ -1089,29 +1089,28 @@ int HtmlGenerator::generateAtom(const Atom *atom, } if (!atom->string().isEmpty()) { if (atom->string().contains("%")) - out() << "

    string() << "\" " - << "align=\"center\">\n"; + out() << "
    string() << "\">\n "; else { - out() << "

    \n"; + out() << "
    \n"; } } else { - out() << "

    \n"; + out() << "
    \n"; } numTableRows = 0; break; case Atom::TableRight: - out() << "

    \n"; + out() << "\n"; break; case Atom::TableHeaderLeft: - out() << ""; + out() << ""; inTableHeader = true; break; case Atom::TableHeaderRight: out() << ""; if (matchAhead(atom, Atom::TableHeaderLeft)) { skipAhead = 1; - out() << "\n"; + out() << "\n"; } else { out() << "\n"; @@ -1120,9 +1119,9 @@ int HtmlGenerator::generateAtom(const Atom *atom, break; case Atom::TableRowLeft: if (++numTableRows % 2 == 1) - out() << ""; + out() << ""; else - out() << ""; + out() << ""; break; case Atom::TableRowRight: out() << "\n"; @@ -1187,11 +1186,11 @@ int HtmlGenerator::generateAtom(const Atom *atom, out() << "string()) << "\">"; break; case Atom::UnhandledFormat: - out() << "<Missing HTML>"; + out() << "<Missing HTML>"; break; case Atom::UnknownCommand: - out() << "\\" << protectEnc(atom->string()) - << ""; + out() << "\\" << protectEnc(atom->string()) + << ""; break; #ifdef QDOC_QML case Atom::QmlText: @@ -1809,7 +1808,7 @@ void HtmlGenerator::generateBrief(const Node *node, CodeMarker *marker, void HtmlGenerator::generateIncludes(const InnerNode *inner, CodeMarker *marker) { if (!inner->includes().isEmpty()) { - out() << "
    "
    +        out() << "
    "
                   << trimmedTrailing(highlightedCode(indent(codeIndent,
                                                             marker->markedUpIncludes(inner->includes())),
                                                      marker,inner))
    @@ -1843,8 +1842,8 @@ void HtmlGenerator::generateTableOfContents(const Node *node,
     
         QString tdTag;
         if (numColumns > 1) {
    -        tdTag = "";
    -        out() << "

    \n" + tdTag = "
    "; /* width=\"" + QString::number((100 + numColumns - 1) / numColumns) + "%\">";*/ + out() << "\n" << tdTag << "\n"; } @@ -1896,7 +1895,7 @@ void HtmlGenerator::generateTableOfContents(const Node *node, } if (numColumns > 1) - out() << "

    \n"; + out() << "
    \n"; inContents = false; inLink = false; @@ -2007,7 +2006,7 @@ void HtmlGenerator::generateNavigationBar(const NavigationBar& bar, { if (bar.prev.begin() != 0 || bar.current.begin() != 0 || bar.next.begin() != 0) { - out() << "

    "; + out() << "

    "; if (bar.prev.begin() != 0) { #if 0 out() << "[\n"; + out() << "
    \n"; int row = 0; foreach (const QString &name, nodeMap.keys()) { @@ -2193,9 +2192,9 @@ void HtmlGenerator::generateAnnotatedList(const Node *relative, continue; if (++row % 2 == 1) - out() << ""; + out() << ""; else - out() << ""; + out() << ""; out() << ""; @@ -2215,7 +2214,7 @@ void HtmlGenerator::generateAnnotatedList(const Node *relative, } out() << "\n"; } - out() << "
    "; generateFullName(node, relative, marker); out() << "

    \n"; + out() << "\n"; } /*! @@ -2368,7 +2367,7 @@ void HtmlGenerator::generateCompactList(const Node *relative, } firstOffset[NumColumns] = classMap.count(); - out() << "

    \n"; + out() << "
    \n"; for (k = 0; k < numRows; k++) { out() << "\n"; for (i = 0; i < NumColumns; i++) { @@ -2389,7 +2388,7 @@ void HtmlGenerator::generateCompactList(const Node *relative, currentParagraphNo[i] = NumParagraphs - 1; } #endif - out() << "\n"; } - out() << "
    "; + out() << ""; if (currentOffsetInParagraph[i] == 0) { // start a new paragraph out() << "" @@ -2432,18 +2431,18 @@ void HtmlGenerator::generateCompactList(const Node *relative, } out() << "

    \n"; + out() << "\n"; } void HtmlGenerator::generateFunctionIndex(const Node *relative, CodeMarker *marker) { - out() << "

    "; + out() << "

    "; for (int i = 0; i < 26; i++) { QChar ch('a' + i); out() << QString("%2 ").arg(ch).arg(ch.toUpper()); } - out() << "

    \n"; + out() << "

    \n"; char nextLetter = 'a'; char currentLetter; @@ -2711,8 +2710,8 @@ void HtmlGenerator::generateSection(const NodeList& nl, } else { if (twoColumn) - out() << "

    \n" - << "\n
    "; + out() << "\n" + << "\n
    "; out() << "
      \n"; } @@ -2725,12 +2724,11 @@ void HtmlGenerator::generateSection(const NodeList& nl, } if (name_alignment) { - out() << "
    "; + out() << "
    "; } else { if (twoColumn && i == (int) (nl.count() + 1) / 2) - out() << "
      \n"; + out() << "
      \n"; out() << "
    • "; } @@ -2747,7 +2745,7 @@ void HtmlGenerator::generateSection(const NodeList& nl, else { out() << "
    \n"; if (twoColumn) - out() << "

    \n"; + out() << "
    \n"; } } } @@ -2773,8 +2771,8 @@ void HtmlGenerator::generateSectionList(const Section& section, } else { if (twoColumn) - out() << "

    \n" - << "\n
    "; + out() << "\n" + << "\n
    "; out() << "
      \n"; } @@ -2787,12 +2785,11 @@ void HtmlGenerator::generateSectionList(const Section& section, } if (name_alignment) { - out() << "
    "; + out() << "
    "; } else { if (twoColumn && i == (int) (section.members.count() + 1) / 2) - out() << "
      \n"; + out() << "
      \n"; out() << "
    • "; } @@ -2809,7 +2806,7 @@ void HtmlGenerator::generateSectionList(const Section& section, else { out() << "
    \n"; if (twoColumn) - out() << "

    \n"; + out() << "
    \n"; } } @@ -2906,7 +2903,7 @@ QString HtmlGenerator::highlightedCode(const QString& markedCode, for (int i = 0, n = src.size(); i < n;) { if (src.at(i) == charLangle && src.at(i + 1).unicode() == '@') { if (nameAlignment && !done) {// && (i != 0)) Why was this here? - html += ""; + html += ""; done = true; } i += 2; @@ -3071,8 +3068,8 @@ void HtmlGenerator::generateSectionList(const Section& section, twoColumn = (section.members.count() >= 5); } if (twoColumn) - out() << "

    \n" - << "\n
    "; + out() << "\n" + << "\n
    "; out() << "
      \n"; int i = 0; @@ -3084,7 +3081,7 @@ void HtmlGenerator::generateSectionList(const Section& section, } if (twoColumn && i == (int) (section.members.count() + 1) / 2) - out() << "
      \n"; + out() << "
      \n"; out() << "
    • "; if (style == CodeMarker::Accessors) @@ -3098,7 +3095,7 @@ void HtmlGenerator::generateSectionList(const Section& section, } out() << "
    \n"; if (twoColumn) - out() << "

    \n"; + out() << "
    \n"; } if (style == CodeMarker::Summary && !section.inherited.isEmpty()) { @@ -4270,15 +4267,15 @@ void HtmlGenerator::generateQmlSummary(const Section& section, twoColumn = (count >= 5); } if (twoColumn) - out() << "

    \n" - << "\n
    "; + out() << "\n" + << "\n
    "; out() << "
      \n"; int row = 0; m = section.members.begin(); while (m != section.members.end()) { if (twoColumn && row == (int) (count + 1) / 2) - out() << "
      \n"; + out() << "
      \n"; out() << "
    • "; generateQmlItem(*m,relative,marker,true); out() << "
    • \n"; @@ -4287,7 +4284,7 @@ void HtmlGenerator::generateQmlSummary(const Section& section, } out() << "
    \n"; if (twoColumn) - out() << "

    \n"; + out() << "
    \n"; } } @@ -4379,7 +4376,7 @@ void HtmlGenerator::generateQmlInherits(const QmlClassNode* cn, const Node* n = myTree->findNode(strList,Node::Fake); if (n && n->subType() == Node::QmlClass) { const QmlClassNode* qcn = static_cast(n); - out() << "

    "; + out() << "

    "; Text text; text << "[Inherits "; text << Atom(Atom::LinkNode,CodeMarker::stringForNode(qcn)); @@ -4426,7 +4423,7 @@ void HtmlGenerator::generateQmlInstantiates(const QmlClassNode* qcn, { const ClassNode* cn = qcn->classNode(); if (cn && (cn->status() != Node::Internal)) { - out() << "

    "; + out() << "

    "; Text text; text << "["; text << Atom(Atom::LinkNode,CodeMarker::stringForNode(qcn)); @@ -4457,7 +4454,7 @@ void HtmlGenerator::generateInstantiatedBy(const ClassNode* cn, if (cn && cn->status() != Node::Internal && !cn->qmlElement().isEmpty()) { const Node* n = myTree->root()->findNode(cn->qmlElement(),Node::Fake); if (n && n->subType() == Node::QmlClass) { - out() << "

    "; + out() << "

    "; Text text; text << "["; text << Atom(Atom::LinkNode,CodeMarker::stringForNode(cn)); diff --git a/tools/qdoc3/test/qt-html-templates.qdocconf b/tools/qdoc3/test/qt-html-templates.qdocconf index 67a25f3..158aef3 100644 --- a/tools/qdoc3/test/qt-html-templates.qdocconf +++ b/tools/qdoc3/test/qt-html-templates.qdocconf @@ -2,7 +2,7 @@ HTML.stylesheets = style/style.css HTML.postheader = "

    \n" \ "
    \n" \ " Home
    \n" \ - " Qt Reference Documentation\n" \ + " Qt Reference Documentation\n" \ "
    \n" \ " \n" \ "
    \n" \ "
    \n" \ @@ -110,7 +110,6 @@ HTML.footer = "
    \n" \ "
    \n" \ " \n" \ "
    \n" \ - " \n" \ "
    \n" \ "

    \n" \ " © 2008-2010 Nokia Corporation and/or its\n" \ @@ -121,10 +120,10 @@ HTML.footer = "

    \n" \ " href=\"http://qt.nokia.com/about/privacy-policy\">Privacy Policy

    \n" \ " \n" \ "
    \n" \ - "
    \n" \ "
    \n" \ " X\n" \ "
    \n" \ + " \n" \ " \n" \ " \n" \ @@ -132,7 +131,6 @@ HTML.footer = "
    \n" \ " \n" \ "
    \n" \ "
    \n" \ - " \n" \ "