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 b1d187399b79b980bc49cb9f78320466da54f977 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Fri, 16 Apr 2010 06:42:09 +0200 Subject: Don't resolve geometry shaders every time... This was a huge extra cost in all QPainter::begin's on GL target surfaces Reviewed-by: Rhys Weatherley --- src/opengl/qglextensions.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/opengl/qglextensions.cpp b/src/opengl/qglextensions.cpp index ef3c4cd..8e2bbd4 100644 --- a/src/opengl/qglextensions.cpp +++ b/src/opengl/qglextensions.cpp @@ -235,11 +235,6 @@ bool qt_resolve_eglimage_gl_extensions(QGLContext *ctx) bool qt_resolve_glsl_extensions(QGLContext *ctx) { - // Geometry shaders are optional... - glProgramParameteriEXT = (_glProgramParameteriEXT) ctx->getProcAddress(QLatin1String("glProgramParameteriEXT")); - glFramebufferTextureEXT = (_glFramebufferTextureEXT) ctx->getProcAddress(QLatin1String("glFramebufferTextureEXT")); - glFramebufferTextureLayerEXT = (_glFramebufferTextureLayerEXT) ctx->getProcAddress(QLatin1String("glFramebufferTextureLayerEXT")); - glFramebufferTextureFaceEXT = (_glFramebufferTextureFaceEXT) ctx->getProcAddress(QLatin1String("glFramebufferTextureFaceEXT")); #if defined(QT_OPENGL_ES_2) // The GLSL shader functions are always present in OpenGL/ES 2.0. @@ -254,6 +249,12 @@ bool qt_resolve_glsl_extensions(QGLContext *ctx) if (glCreateShader) return true; + // Geometry shaders are optional... + glProgramParameteriEXT = (_glProgramParameteriEXT) ctx->getProcAddress(QLatin1String("glProgramParameteriEXT")); + glFramebufferTextureEXT = (_glFramebufferTextureEXT) ctx->getProcAddress(QLatin1String("glFramebufferTextureEXT")); + glFramebufferTextureLayerEXT = (_glFramebufferTextureLayerEXT) ctx->getProcAddress(QLatin1String("glFramebufferTextureLayerEXT")); + glFramebufferTextureFaceEXT = (_glFramebufferTextureFaceEXT) ctx->getProcAddress(QLatin1String("glFramebufferTextureFaceEXT")); + glCreateShader = (_glCreateShader) ctx->getProcAddress(QLatin1String("glCreateShader")); if (glCreateShader) { glShaderSource = (_glShaderSource) ctx->getProcAddress(QLatin1String("glShaderSource")); -- cgit v0.12 From edc6e0218b5fad73476f1f18529b5ec48a3e100f Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Mon, 19 Apr 2010 07:25:15 +0200 Subject: Swapped x and y values in qt_painterpath_check_crossing Reviewed-by: Kim --- src/gui/painting/qpainterpath.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/painting/qpainterpath.cpp b/src/gui/painting/qpainterpath.cpp index f78de34..965b84c 100644 --- a/src/gui/painting/qpainterpath.cpp +++ b/src/gui/painting/qpainterpath.cpp @@ -1914,7 +1914,7 @@ static bool qt_painterpath_check_crossing(const QPainterPath *path, const QRectF case QPainterPath::MoveToElement: if (i > 0 - && qFuzzyCompare(last_pt.x(), last_start.y()) + && qFuzzyCompare(last_pt.x(), last_start.x()) && qFuzzyCompare(last_pt.y(), last_start.y()) && qt_painterpath_isect_line_rect(last_pt.x(), last_pt.y(), last_start.x(), last_start.y(), rect)) -- cgit v0.12 From c799eeffc43a186747f06a7d36a747cce59925dd Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Mon, 19 Apr 2010 07:26:44 +0200 Subject: Don't crash when calling drawPixmapFragements with a null pixmap --- src/gui/painting/qpaintengineex.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gui/painting/qpaintengineex.cpp b/src/gui/painting/qpaintengineex.cpp index 9366513..a78cafb 100644 --- a/src/gui/painting/qpaintengineex.cpp +++ b/src/gui/painting/qpaintengineex.cpp @@ -974,6 +974,9 @@ void QPaintEngineEx::drawTiledPixmap(const QRectF &r, const QPixmap &pixmap, con void QPaintEngineEx::drawPixmapFragments(const QPainter::PixmapFragment *fragments, int fragmentCount, const QPixmap &pixmap, QPainter::PixmapFragmentHints /*hints*/) { + if (pixmap.isNull()) + return; + qreal oldOpacity = state()->opacity; QTransform oldTransform = state()->matrix; -- cgit v0.12 From 8fffbc7768be28fb2b31727bf79b2e2357ce9814 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Mon, 19 Apr 2010 10:17:30 +0200 Subject: Use QGLContextPrivate to track attribarray enabled state. Reviewed-by: Trond Reviewed-by: Tom --- src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp index c89d34f..955a129 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp @@ -573,9 +573,9 @@ void QGL2PaintEngineExPrivate::resetGLState() glStencilMask(0xff); glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP); glStencilFunc(GL_ALWAYS, 0, 0xff); - glDisableVertexAttribArray(QT_TEXTURE_COORDS_ATTR); - glDisableVertexAttribArray(QT_VERTEX_COORDS_ATTR); - glDisableVertexAttribArray(QT_OPACITY_ATTR); + ctx->d_func()->setVertexAttribArrayEnabled(QT_TEXTURE_COORDS_ATTR, false); + ctx->d_func()->setVertexAttribArrayEnabled(QT_VERTEX_COORDS_ATTR, false); + ctx->d_func()->setVertexAttribArrayEnabled(QT_OPACITY_ATTR, false); #ifndef QT_OPENGL_ES_2 glColor4f(1.0f, 1.0f, 1.0f, 1.0f); // color may have been changed by glVertexAttrib() #endif -- cgit v0.12 From 5ce428cf7f20cd37f4cf0d92ddcceddd07c5a0db Mon Sep 17 00:00:00 2001 From: Tom Cooksey Date: Fri, 16 Apr 2010 18:20:37 +0200 Subject: QX11GL: Fix bug with pixmaps drawn on multiple top-levels Reviewed-By: TrustMe --- src/opengl/qpixmapdata_x11gl_egl.cpp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/opengl/qpixmapdata_x11gl_egl.cpp b/src/opengl/qpixmapdata_x11gl_egl.cpp index 3ab385a..4d726b6 100644 --- a/src/opengl/qpixmapdata_x11gl_egl.cpp +++ b/src/opengl/qpixmapdata_x11gl_egl.cpp @@ -66,7 +66,8 @@ QT_BEGIN_NAMESPACE // different contexts: Q_GLOBAL_STATIC(QEglContext, qt_x11gl_rgbContext); -Q_GLOBAL_STATIC(QEglContext, qt_x11gl_argbContext) +Q_GLOBAL_STATIC(QEglContext, qt_x11gl_argbContext); +Q_GLOBAL_STATIC_WITH_ARGS(QGLContext, qt_x11gl_fake_shared_context, (QX11GLPixmapData::glFormat())); QEglContext* QX11GLPixmapData::rgbContext = 0; QEglContext* QX11GLPixmapData::argbContext = 0; @@ -112,7 +113,13 @@ bool QX11GLPixmapData::hasX11GLPixmaps() if (!argbContext) { argbContext = qt_x11gl_argbContext(); argbContext->setConfig(argbConfig); - argbContext->createContext(); + bool success = argbContext->createContext(rgbContext); + if (!success) { + qWarning("QX11GLPixmapData - RGB & ARGB contexts aren't shared"); + success = argbContext->createContext(); + if (!success) + argbContext = rgbContext; // Might work, worth a shot at least. + } } if (!argbContext->isValid()) @@ -258,6 +265,14 @@ QPaintEngine* QX11GLPixmapData::paintEngine() const ctx = new QGLContext(glFormat()); Q_ASSERT(ctx->d_func()->eglContext == 0); ctx->d_func()->eglContext = hasAlphaChannel() ? argbContext : rgbContext; + + // While we use a seperate QGLContext for each pixmap, the underlying QEglContext is + // the same. So we must use a "fake" QGLContext and fool the texture cache into thinking + // each pixmap's QGLContext is sharing with this central one. The only place this is + // going to fail is where we the underlying EGL RGB and ARGB contexts aren't sharing. + ctx->d_func()->sharing = true; + QGLContextGroup::addShare(ctx, qt_x11gl_fake_shared_context()); + // Update the glFormat for the QGLContext: qt_glformat_from_eglconfig(ctx->d_func()->glFormat, ctx->d_func()->eglContext->config()); } -- cgit v0.12 From bce9c47d5437812b137c47ff3c602ff23ffa5e22 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Mon, 19 Apr 2010 10:27:29 +0200 Subject: Mac: Fix off-by-one in vertical position for elided and non-elided text In the code path that draws the elided text, we would truncate the position before passing it to the painter. With a font engine that supports fractional values (mac), this would potentially give us the wrong position compared to the code path that draws the complete text, which essentially rounds off the number. The result was that when you resized the width an item view to make its items elide the text, then they would potentially shift up or down by one pixel. Task-number: QTBUG-9879 Reviewed-by: Gunnar --- src/gui/styles/qcommonstyle.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/styles/qcommonstyle.cpp b/src/gui/styles/qcommonstyle.cpp index b0e2d37..8036728 100644 --- a/src/gui/styles/qcommonstyle.cpp +++ b/src/gui/styles/qcommonstyle.cpp @@ -981,7 +981,7 @@ void QCommonStylePrivate::viewItemDrawText(QPainter *p, const QStyleOptionViewIt qreal y = position.y() + line.y() + line.ascent(); p->save(); p->setFont(option->font); - p->drawText(int(x), int(y), elidedText); + p->drawText(QPointF(x, y), elidedText); p->restore(); break; } -- 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 1e83011e2ac4a33b39d12807b71cd3bb3511a263 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Mon, 19 Apr 2010 10:57:08 +0200 Subject: Odf export: Remove double namespace in tab-stops and fix table padding According to the specification, the correct name of the tab-stops element is style:tab-stops (and similar with style:tab-stop). The style namespace seems to have been added twice by mistake in QTextOdfWriter. Also: Fix a copy-paste bug when outputting left, right and bottom padding for table cells. Reviewed-by: Thomas Zander --- src/gui/text/qtextodfwriter.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/gui/text/qtextodfwriter.cpp b/src/gui/text/qtextodfwriter.cpp index d369bff0..7992de5 100644 --- a/src/gui/text/qtextodfwriter.cpp +++ b/src/gui/text/qtextodfwriter.cpp @@ -493,10 +493,10 @@ void QTextOdfWriter::writeBlockFormat(QXmlStreamWriter &writer, QTextBlockFormat format.nonBreakableLines() ? QString::fromLatin1("true") : QString::fromLatin1("false")); if (format.hasProperty(QTextFormat::TabPositions)) { QList tabs = format.tabPositions(); - writer.writeStartElement(styleNS, QString::fromLatin1("style-tab-stops")); + writer.writeStartElement(styleNS, QString::fromLatin1("tab-stops")); QList::Iterator iterator = tabs.begin(); while(iterator != tabs.end()) { - writer.writeEmptyElement(styleNS, QString::fromLatin1("style-tab-stop")); + writer.writeEmptyElement(styleNS, QString::fromLatin1("tab-stop")); writer.writeAttribute(styleNS, QString::fromLatin1("position"), pixelToPoint(iterator->position) ); QString type; switch(iterator->type) { @@ -511,7 +511,7 @@ void QTextOdfWriter::writeBlockFormat(QXmlStreamWriter &writer, QTextBlockFormat ++iterator; } - writer.writeEndElement(); // style-tab-stops + writer.writeEndElement(); // tab-stops } writer.writeEndElement(); // paragraph-properties @@ -698,11 +698,11 @@ void QTextOdfWriter::writeTableCellFormat(QXmlStreamWriter &writer, QTextTableCe if (padding > 0) writer.writeAttribute(foNS, QString::fromLatin1("padding-top"), pixelToPoint(padding)); if (format.bottomPadding() > 0) - writer.writeAttribute(foNS, QString::fromLatin1("padding-top"), pixelToPoint(format.bottomPadding())); + writer.writeAttribute(foNS, QString::fromLatin1("padding-bottom"), pixelToPoint(format.bottomPadding())); if (format.leftPadding() > 0) - writer.writeAttribute(foNS, QString::fromLatin1("padding-top"), pixelToPoint(format.leftPadding())); + writer.writeAttribute(foNS, QString::fromLatin1("padding-left"), pixelToPoint(format.leftPadding())); if (format.rightPadding() > 0) - writer.writeAttribute(foNS, QString::fromLatin1("padding-top"), pixelToPoint(format.rightPadding())); + writer.writeAttribute(foNS, QString::fromLatin1("padding-right"), pixelToPoint(format.rightPadding())); } if (format.hasProperty(QTextFormat::TextVerticalAlignment)) { -- 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 d935191592bfe275b6122841de8fa76778be02af Mon Sep 17 00:00:00 2001 From: Robin Burchell Date: Mon, 19 Apr 2010 12:52:18 +0100 Subject: Add a test to QListView to check initialisation of style option index, similar to QTreeView test. Reviewed-by: Olivier Goffart Merge-request: 565 --- tests/auto/qlistview/tst_qlistview.cpp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/tests/auto/qlistview/tst_qlistview.cpp b/tests/auto/qlistview/tst_qlistview.cpp index f5c32cd..330f803 100644 --- a/tests/auto/qlistview/tst_qlistview.cpp +++ b/tests/auto/qlistview/tst_qlistview.cpp @@ -124,6 +124,7 @@ private slots: void taskQTBUG_2678_spacingAndWrappedText(); void taskQTBUG_5877_skippingItemInPageDownUp(); void taskQTBUG_9455_wrongScrollbarRanges(); + void styleOptionViewItem(); }; // Testing get/set functions @@ -1971,5 +1972,35 @@ void tst_QListView::taskQTBUG_9455_wrongScrollbarRanges() QCOMPARE(w.verticalScrollBar()->maximum(), w.contentsSize().height() - w.viewport()->geometry().height()); } +void tst_QListView::styleOptionViewItem() +{ + class MyDelegate : public QStyledItemDelegate + { + public: + void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const + { + QVERIFY(qstyleoption_cast(&option)); + QStyleOptionViewItemV4 opt(option); + initStyleOption(&opt, index); + + QCOMPARE(opt.index, index); + + QStyledItemDelegate::paint(painter, option, index); + } + }; + + QListView view; + QStandardItemModel model; + view.setModel(&model); + MyDelegate delegate; + view.setItemDelegate(&delegate); + model.appendRow(QList() + << new QStandardItem("Beginning") << new QStandardItem("Middle") << new QStandardItem("Middle") << new QStandardItem("End") ); + + // Run test + view.showMaximized(); + QApplication::processEvents(); +} + QTEST_MAIN(tst_QListView) #include "tst_qlistview.moc" -- 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 d97c42b7fdb4b370ec5a09ef5d6f04e2e22f241d Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Mon, 19 Apr 2010 16:26:42 +0200 Subject: Fixed a crash when declaring an animation with Q_GLOBAL_STATIC Reviewed-By: gabi Task-Number: QTBUG-10017 --- src/corelib/animation/qabstractanimation.cpp | 77 ++++++++++++++++++---------- src/corelib/animation/qabstractanimation_p.h | 11 ++-- 2 files changed, 56 insertions(+), 32 deletions(-) diff --git a/src/corelib/animation/qabstractanimation.cpp b/src/corelib/animation/qabstractanimation.cpp index 82b3003..01570ad 100644 --- a/src/corelib/animation/qabstractanimation.cpp +++ b/src/corelib/animation/qabstractanimation.cpp @@ -173,11 +173,12 @@ QUnifiedTimer::QUnifiedTimer() : time.invalidate(); } -QUnifiedTimer *QUnifiedTimer::instance() + +QUnifiedTimer *QUnifiedTimer::instance(bool create) { QUnifiedTimer *inst; #ifndef QT_NO_THREAD - if (!unifiedTimer()->hasLocalData()) { + if (create && !unifiedTimer()->hasLocalData()) { inst = new QUnifiedTimer; unifiedTimer()->setLocalData(inst); } else { @@ -190,10 +191,16 @@ QUnifiedTimer *QUnifiedTimer::instance() return inst; } +QUnifiedTimer *QUnifiedTimer::instance() +{ + return instance(true); +} + void QUnifiedTimer::ensureTimerUpdate() { - if (isPauseTimerActive) - updateAnimationsTime(); + QUnifiedTimer *inst = QUnifiedTimer::instance(false); + if (inst && inst->isPauseTimerActive) + inst->updateAnimationsTime(); } void QUnifiedTimer::updateAnimationsTime() @@ -219,6 +226,13 @@ void QUnifiedTimer::updateAnimationsTime() } } +void QUnifiedTimer::updateAnimationTimer() +{ + QUnifiedTimer *inst = QUnifiedTimer::instance(false); + if (inst) + inst->restartAnimationTimer(); +} + void QUnifiedTimer::restartAnimationTimer() { if (runningLeafAnimations == 0 && !runningPauseAnimations.isEmpty()) { @@ -269,34 +283,41 @@ void QUnifiedTimer::timerEvent(QTimerEvent *event) void QUnifiedTimer::registerAnimation(QAbstractAnimation *animation, bool isTopLevel) { - registerRunningAnimation(animation); + QUnifiedTimer *inst = instance(true); //we create the instance if needed + inst->registerRunningAnimation(animation); if (isTopLevel) { Q_ASSERT(!QAbstractAnimationPrivate::get(animation)->hasRegisteredTimer); QAbstractAnimationPrivate::get(animation)->hasRegisteredTimer = true; - animationsToStart << animation; - if (!startStopAnimationTimer.isActive()) - startStopAnimationTimer.start(STARTSTOP_TIMER_DELAY, this); + inst->animationsToStart << animation; + if (!inst->startStopAnimationTimer.isActive()) + inst->startStopAnimationTimer.start(STARTSTOP_TIMER_DELAY, inst); } } void QUnifiedTimer::unregisterAnimation(QAbstractAnimation *animation) { - unregisterRunningAnimation(animation); + QUnifiedTimer *inst = QUnifiedTimer::instance(false); + if (inst) { + //at this point the unified timer should have been created + //but it might also have been already destroyed in case the application is shutting down - if (!QAbstractAnimationPrivate::get(animation)->hasRegisteredTimer) - return; + inst->unregisterRunningAnimation(animation); - int idx = animations.indexOf(animation); - if (idx != -1) { - animations.removeAt(idx); - // this is needed if we unregister an animation while its running - if (idx <= currentAnimationIdx) - --currentAnimationIdx; + if (!QAbstractAnimationPrivate::get(animation)->hasRegisteredTimer) + return; - if (animations.isEmpty() && !startStopAnimationTimer.isActive()) - startStopAnimationTimer.start(STARTSTOP_TIMER_DELAY, this); - } else { - animationsToStart.removeOne(animation); + int idx = inst->animations.indexOf(animation); + if (idx != -1) { + inst->animations.removeAt(idx); + // this is needed if we unregister an animation while its running + if (idx <= inst->currentAnimationIdx) + --inst->currentAnimationIdx; + + if (inst->animations.isEmpty() && !inst->startStopAnimationTimer.isActive()) + inst->startStopAnimationTimer.start(STARTSTOP_TIMER_DELAY, inst); + } else { + inst->animationsToStart.removeOne(animation); + } } QAbstractAnimationPrivate::get(animation)->hasRegisteredTimer = false; } @@ -371,11 +392,11 @@ void QAbstractAnimationPrivate::setState(QAbstractAnimation::State newState) bool isTopLevel = !group || group->state() == QAbstractAnimation::Stopped; if (oldState == QAbstractAnimation::Running) { if (newState == QAbstractAnimation::Paused && hasRegisteredTimer) - QUnifiedTimer::instance()->ensureTimerUpdate(); + QUnifiedTimer::ensureTimerUpdate(); //the animation, is not running any more - QUnifiedTimer::instance()->unregisterAnimation(q); + QUnifiedTimer::unregisterAnimation(q); } else if (newState == QAbstractAnimation::Running) { - QUnifiedTimer::instance()->registerAnimation(q, isTopLevel); + QUnifiedTimer::registerAnimation(q, isTopLevel); } q->updateState(newState, oldState); @@ -397,7 +418,7 @@ void QAbstractAnimationPrivate::setState(QAbstractAnimation::State newState) if (oldState == QAbstractAnimation::Stopped) { if (isTopLevel) { // currentTime needs to be updated if pauseTimer is active - QUnifiedTimer::instance()->ensureTimerUpdate(); + QUnifiedTimer::ensureTimerUpdate(); q->setCurrentTime(totalCurrentTime); } } @@ -456,7 +477,7 @@ QAbstractAnimation::~QAbstractAnimation() d->state = Stopped; emit stateChanged(oldState, d->state); if (oldState == QAbstractAnimation::Running) - QUnifiedTimer::instance()->unregisterAnimation(this); + QUnifiedTimer::unregisterAnimation(this); } } @@ -555,14 +576,14 @@ void QAbstractAnimation::setDirection(Direction direction) // the commands order below is important: first we need to setCurrentTime with the old direction, // then update the direction on this and all children and finally restart the pauseTimer if needed if (d->hasRegisteredTimer) - QUnifiedTimer::instance()->ensureTimerUpdate(); + QUnifiedTimer::ensureTimerUpdate(); d->direction = direction; updateDirection(direction); if (d->hasRegisteredTimer) // needed to update the timer interval in case of a pause animation - QUnifiedTimer::instance()->restartAnimationTimer(); + QUnifiedTimer::updateAnimationTimer(); emit directionChanged(direction); } diff --git a/src/corelib/animation/qabstractanimation_p.h b/src/corelib/animation/qabstractanimation_p.h index 2282cdb..fcfe824 100644 --- a/src/corelib/animation/qabstractanimation_p.h +++ b/src/corelib/animation/qabstractanimation_p.h @@ -124,9 +124,10 @@ private: public: //XXX this is needed by dui static Q_CORE_EXPORT QUnifiedTimer *instance(); + static QUnifiedTimer *instance(bool create); - void registerAnimation(QAbstractAnimation *animation, bool isTopLevel); - void unregisterAnimation(QAbstractAnimation *animation); + static void registerAnimation(QAbstractAnimation *animation, bool isTopLevel); + static void unregisterAnimation(QAbstractAnimation *animation); //defines the timing interval. Default is DEFAULT_TIMER_INTERVAL void setTimingInterval(int interval) @@ -151,13 +152,13 @@ public: this is used for updating the currentTime of all animations in case the pause timer is active or, otherwise, only of the animation passed as parameter. */ - void ensureTimerUpdate(); + static void ensureTimerUpdate(); /* this will evaluate the need of restarting the pause timer in case there is still some pause animations running. */ - void restartAnimationTimer(); + static void updateAnimationTimer(); protected: void timerEvent(QTimerEvent *); @@ -187,6 +188,8 @@ private: void registerRunningAnimation(QAbstractAnimation *animation); void unregisterRunningAnimation(QAbstractAnimation *animation); + void restartAnimationTimer(); + void updateAnimationsTime(); int closestPauseAnimationTimeToFinish(); }; -- 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 e0314fa999e58a057604cdbd4bd6fdfe5248d75e Mon Sep 17 00:00:00 2001 From: Janne Koskinen Date: Wed, 14 Apr 2010 15:32:12 +0300 Subject: WINSCW compile fix for WebCore WINSCW fails to parse function pointer name if it is not introduced before use. Reviewed-by: Miikka Heikkinen --- src/3rdparty/webkit/WebCore/bindings/js/JSDOMGlobalObject.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/3rdparty/webkit/WebCore/bindings/js/JSDOMGlobalObject.h b/src/3rdparty/webkit/WebCore/bindings/js/JSDOMGlobalObject.h index 8eb55c1..2ad437b 100644 --- a/src/3rdparty/webkit/WebCore/bindings/js/JSDOMGlobalObject.h +++ b/src/3rdparty/webkit/WebCore/bindings/js/JSDOMGlobalObject.h @@ -70,6 +70,9 @@ namespace WebCore { virtual const JSC::ClassInfo* classInfo() const { return &s_info; } static const JSC::ClassInfo s_info; + private: + static void destroyJSDOMGlobalObjectData(void*); + protected: struct JSDOMGlobalObjectData : public JSC::JSGlobalObject::JSGlobalObjectData { JSDOMGlobalObjectData(DOMWrapperWorld* world, Destructor destructor = destroyJSDOMGlobalObjectData) @@ -89,8 +92,6 @@ namespace WebCore { }; private: - static void destroyJSDOMGlobalObjectData(void*); - JSDOMGlobalObjectData* d() const { return static_cast(JSC::JSVariableObject::d); } }; -- cgit v0.12 From c16ca6d08d7e3e7a0972aa1975a72882559edb26 Mon Sep 17 00:00:00 2001 From: Janne Koskinen Date: Fri, 16 Apr 2010 13:53:08 +0300 Subject: WINSCW compile fix for HashMap WINSCW with templates function declarations and definitions will have to use same names for variables or you get 'undefined identifier' Reviewed-by: Miikka Heikkinen --- src/3rdparty/webkit/JavaScriptCore/wtf/HashMap.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/3rdparty/webkit/JavaScriptCore/wtf/HashMap.h b/src/3rdparty/webkit/JavaScriptCore/wtf/HashMap.h index 09094d1..4631055 100644 --- a/src/3rdparty/webkit/JavaScriptCore/wtf/HashMap.h +++ b/src/3rdparty/webkit/JavaScriptCore/wtf/HashMap.h @@ -88,9 +88,9 @@ namespace WTF { // must have the following function members: // static unsigned hash(const T&); // static bool equal(const ValueType&, const T&); - template iterator find(const T&); - template const_iterator find(const T&) const; - template bool contains(const T&) const; + template iterator find(const TYPE&); + template const_iterator find(const TYPE&) const; + template bool contains(const TYPE&) const; // An alternate version of add() that finds the object by hashing and comparing // with some other type, to avoid the cost of type conversion if the object is already @@ -98,7 +98,7 @@ namespace WTF { // static unsigned hash(const T&); // static bool equal(const ValueType&, const T&); // static translate(ValueType&, const T&, unsigned hashCode); - template pair add(const T&, const MappedType&); + template pair add(const TYPE&, const MappedType&); void checkConsistency() const; -- cgit v0.12 From 07aa94196e5ab6827099c683c0be96edbc62e6c0 Mon Sep 17 00:00:00 2001 From: Janne Koskinen Date: Mon, 19 Apr 2010 18:36:56 +0300 Subject: WINSCW boolean fix for XPATH WINSCW cannot determine boolean type unless it is explicitly defined. This fix needs to be re-applied always when files are regenerated. Reviewed-by: Simon Hausmann --- src/3rdparty/webkit/WebCore/xml/XPathValue.cpp | 5 +++++ src/3rdparty/webkit/WebCore/xml/XPathValue.h | 13 +++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/3rdparty/webkit/WebCore/xml/XPathValue.cpp b/src/3rdparty/webkit/WebCore/xml/XPathValue.cpp index 29e211e..f5acb38 100644 --- a/src/3rdparty/webkit/WebCore/xml/XPathValue.cpp +++ b/src/3rdparty/webkit/WebCore/xml/XPathValue.cpp @@ -68,7 +68,12 @@ NodeSet& Value::modifiableNodeSet() return m_data->m_nodeSet; } +#if COMPILER(WINSCW) +// FIXME --nl-- Symbian WINSCW compiler complains with 'ambiguous access to overloaded function' (double, unsigned long, unsigned int) +unsigned int Value::toBoolean() const +#else bool Value::toBoolean() const +#endif { switch (m_type) { case NodeSetValue: diff --git a/src/3rdparty/webkit/WebCore/xml/XPathValue.h b/src/3rdparty/webkit/WebCore/xml/XPathValue.h index a0cd24d..bd44c91 100644 --- a/src/3rdparty/webkit/WebCore/xml/XPathValue.h +++ b/src/3rdparty/webkit/WebCore/xml/XPathValue.h @@ -66,8 +66,11 @@ namespace WebCore { Value(Node* value) : m_type(NodeSetValue), m_bool(false), m_number(0), m_data(ValueData::create()) { m_data->m_nodeSet.append(value); } // This is needed to safely implement constructing from bool - with normal function overloading, any pointer type would match. +#if COMPILER(WINSCW) + Value(bool); +#else template Value(T); - +#endif static const struct AdoptTag {} adopt; Value(NodeSet& value, const AdoptTag&) : m_type(NodeSetValue), m_bool(false), m_number(0), m_data(ValueData::create()) { value.swap(m_data->m_nodeSet); } @@ -80,7 +83,12 @@ namespace WebCore { const NodeSet& toNodeSet() const; NodeSet& modifiableNodeSet(); +#if COMPILER(WINSCW) + // FIXME --nl-- Symbian WINSCW compiler complains with 'ambiguous access to overloaded function' (double, unsigned long, unsigned int) + unsigned int toBoolean() const; +#else bool toBoolean() const; +#endif double toNumber() const; String toString() const; @@ -90,8 +98,9 @@ namespace WebCore { double m_number; RefPtr m_data; }; - +#if !COMPILER(WINSCW) template<> +#endif inline Value::Value(bool value) : m_type(BooleanValue) , m_bool(value) -- cgit v0.12 From 0d1739197015a651b88d710c9c961eb0f20278f9 Mon Sep 17 00:00:00 2001 From: Janne Koskinen Date: Mon, 19 Apr 2010 18:40:08 +0300 Subject: WINSCW compiler fix, too eager to solve inlines WINSCW tries immediately solve inlines causing forward declared classes to be used before they are defined. Reviewed-by: Simon Hausmann --- src/3rdparty/webkit/WebCore/svg/SVGAnimatedPropertySynchronizer.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/3rdparty/webkit/WebCore/svg/SVGAnimatedPropertySynchronizer.h b/src/3rdparty/webkit/WebCore/svg/SVGAnimatedPropertySynchronizer.h index ddd0493..695b71e 100644 --- a/src/3rdparty/webkit/WebCore/svg/SVGAnimatedPropertySynchronizer.h +++ b/src/3rdparty/webkit/WebCore/svg/SVGAnimatedPropertySynchronizer.h @@ -41,13 +41,15 @@ struct GetOwnerElementForType : public Noncopyable { template struct GetOwnerElementForType : public Noncopyable { - static SVGElement* ownerElement(OwnerType* type) + static SVGElement* ownerElement(OwnerType* type); +}; +template +SVGElement* GetOwnerElementForType::ownerElement(OwnerType* type) { SVGElement* context = type->contextElement(); ASSERT(context); return context; } -}; // IsDerivedFromSVGElement implementation template -- cgit v0.12 From cc26a3ec5c6bfde206c7354f87bebd36b70e1205 Mon Sep 17 00:00:00 2001 From: Janne Koskinen Date: Mon, 19 Apr 2010 18:45:41 +0300 Subject: Remove overloaded placement new operators WINSCW and Sun OS build fix. placement new is already defined in NonCopyable, no need for overloading. Reviewed-by: Simon Hausmann --- src/3rdparty/webkit/JavaScriptCore/runtime/UStringImpl.h | 1 - src/3rdparty/webkit/WebCore/platform/text/StringImpl.h | 1 - 2 files changed, 2 deletions(-) diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/UStringImpl.h b/src/3rdparty/webkit/JavaScriptCore/runtime/UStringImpl.h index 4dccb25..065443a 100644 --- a/src/3rdparty/webkit/JavaScriptCore/runtime/UStringImpl.h +++ b/src/3rdparty/webkit/JavaScriptCore/runtime/UStringImpl.h @@ -58,7 +58,6 @@ protected: }; using Noncopyable::operator new; - void* operator new(size_t, void* inPlace) { return inPlace; } // For SmallStringStorage, which allocates an array and uses an in-place new. UStringOrRopeImpl() { } diff --git a/src/3rdparty/webkit/WebCore/platform/text/StringImpl.h b/src/3rdparty/webkit/WebCore/platform/text/StringImpl.h index 81cd149..9a62cba 100644 --- a/src/3rdparty/webkit/WebCore/platform/text/StringImpl.h +++ b/src/3rdparty/webkit/WebCore/platform/text/StringImpl.h @@ -249,7 +249,6 @@ public: private: using Noncopyable::operator new; - void* operator new(size_t, void* inPlace) { ASSERT(inPlace); return inPlace; } static PassRefPtr createStrippingNullCharactersSlowCase(const UChar*, unsigned length); -- cgit v0.12 From 803c20871ca3d8fee85ffaca358474cc0a084962 Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Mon, 19 Apr 2010 10:52:11 +0200 Subject: QtWebKit: Remove translatable strings from tests/hybridPixmap. Reviewed-by: TrustMe --- src/3rdparty/webkit/WebKit/qt/tests/hybridPixmap/widget.ui | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/3rdparty/webkit/WebKit/qt/tests/hybridPixmap/widget.ui b/src/3rdparty/webkit/WebKit/qt/tests/hybridPixmap/widget.ui index 4f2b3b8..ae5e0b5 100644 --- a/src/3rdparty/webkit/WebKit/qt/tests/hybridPixmap/widget.ui +++ b/src/3rdparty/webkit/WebKit/qt/tests/hybridPixmap/widget.ui @@ -11,7 +11,7 @@ - Widget + Widget @@ -28,7 +28,7 @@ - + @@ -47,21 +47,21 @@ - Image from Qt to HTML + Image from Qt to HTML - Pixmap from Qt to HTML + Pixmap from Qt to HTML - + -- cgit v0.12 From 594f81c553d52901209c079e2887fb13990ecba4 Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Mon, 19 Apr 2010 16:26:35 +0200 Subject: QtWebKit: Fixes compilation on MSVC 64 This patch should be overwritten by the next import of QtWebKit trunk Reviewed-by: TrustMe --- src/3rdparty/webkit/WebCore/platform/text/TextStream.cpp | 2 +- src/3rdparty/webkit/WebCore/platform/text/TextStream.h | 2 +- src/3rdparty/webkit/WebCore/plugins/win/PluginViewWin.cpp | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/3rdparty/webkit/WebCore/platform/text/TextStream.cpp b/src/3rdparty/webkit/WebCore/platform/text/TextStream.cpp index baaa8b9..ab73891 100644 --- a/src/3rdparty/webkit/WebCore/platform/text/TextStream.cpp +++ b/src/3rdparty/webkit/WebCore/platform/text/TextStream.cpp @@ -108,7 +108,7 @@ String TextStream::release() return String::adopt(m_text); } -#if OS(WINDOWS) && PLATFORM(X86_64) && COMPILER(MSVC) +#if OS(WINDOWS) && CPU(X86_64) && COMPILER(MSVC) TextStream& TextStream::operator<<(__int64 i) { char buffer[printBufferSize]; diff --git a/src/3rdparty/webkit/WebCore/platform/text/TextStream.h b/src/3rdparty/webkit/WebCore/platform/text/TextStream.h index dfaa048..1225505 100644 --- a/src/3rdparty/webkit/WebCore/platform/text/TextStream.h +++ b/src/3rdparty/webkit/WebCore/platform/text/TextStream.h @@ -45,7 +45,7 @@ public: TextStream& operator<<(const char*); TextStream& operator<<(void*); TextStream& operator<<(const String&); -#if OS(WINDOWS) && PLATFORM(X86_64) && COMPILER(MSVC) +#if OS(WINDOWS) && CPU(X86_64) && COMPILER(MSVC) TextStream& operator<<(unsigned __int64); TextStream& operator<<(__int64); #endif diff --git a/src/3rdparty/webkit/WebCore/plugins/win/PluginViewWin.cpp b/src/3rdparty/webkit/WebCore/plugins/win/PluginViewWin.cpp index 01e425f..9d869ab 100644 --- a/src/3rdparty/webkit/WebCore/plugins/win/PluginViewWin.cpp +++ b/src/3rdparty/webkit/WebCore/plugins/win/PluginViewWin.cpp @@ -140,7 +140,7 @@ static BYTE* endPaint; typedef HDC (WINAPI *PtrBeginPaint)(HWND, PAINTSTRUCT*); typedef BOOL (WINAPI *PtrEndPaint)(HWND, const PAINTSTRUCT*); -#if OS(WINDOWS) && PLATFORM(X86_64) && COMPILER(MSVC) +#if OS(WINDOWS) && CPU(X86_64) && COMPILER(MSVC) extern "C" HDC __stdcall _HBeginPaint(HWND hWnd, LPPAINTSTRUCT lpPaint); extern "C" BOOL __stdcall _HEndPaint(HWND hWnd, const PAINTSTRUCT* lpPaint); #endif @@ -978,7 +978,7 @@ bool PluginView::platformStart() // Calling SetWindowLongPtrA here makes the window proc ASCII, which is required by at least // the Shockwave Director plug-in. -#if OS(WINDOWS) && PLATFORM(X86_64) && COMPILER(MSVC) +#if OS(WINDOWS) && CPU(X86_64) && COMPILER(MSVC) ::SetWindowLongPtrA(platformPluginWidget(), GWLP_WNDPROC, (LONG_PTR)DefWindowProcA); #elif OS(WINCE) ::SetWindowLong(platformPluginWidget(), GWL_WNDPROC, (LONG)DefWindowProc); -- 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 d738414926bc575a37c6ae6c6cca68d01439b2ef Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Tue, 20 Apr 2010 09:49:39 +0200 Subject: Fixed pixel-bleeding when stretching subrected pixmaps. When stretching a subrect of a pixmap we need to clamp the sampling to the subrect. This was done for the ARGB32_Premultiplied target format but not for the generic fallback. This patch adapts the code so that the two code paths are equivalent. Reviewed-by: Samuel --- src/gui/painting/qdrawhelper.cpp | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp index b440fce..bfa1136 100644 --- a/src/gui/painting/qdrawhelper.cpp +++ b/src/gui/painting/qdrawhelper.cpp @@ -674,6 +674,11 @@ const uint * QT_FASTCALL fetchTransformedBilinear(uint *buffer, const Operator * int image_width = data->texture.width; int image_height = data->texture.height; + int image_x1 = data->texture.x1; + int image_y1 = data->texture.y1; + int image_x2 = data->texture.x2; + int image_y2 = data->texture.y2; + const qreal cx = x + 0.5; const qreal cy = y + 0.5; @@ -708,17 +713,17 @@ const uint * QT_FASTCALL fetchTransformedBilinear(uint *buffer, const Operator * y2 = y1 + 1; y2 %= image_height; } else { - if (x1 < 0) { - x2 = x1 = 0; - } else if (x1 >= image_width - 1) { - x2 = x1 = image_width - 1; + if (x1 < image_x1) { + x2 = x1 = image_x1; + } else if (x1 >= image_x2 - 1) { + x2 = x1 = image_x2 - 1; } else { x2 = x1 + 1; } - if (y1 < 0) { - y2 = y1 = 0; - } else if (y1 >= image_height - 1) { - y2 = y1 = image_height - 1; + if (y1 < image_y1) { + y2 = y1 = image_y1; + } else if (y1 >= image_y2 - 1) { + y2 = y1 = image_y2 - 1; } else { y2 = y1 + 1; } -- cgit v0.12 From 2b55d52669beb72396f94e449fdf172735349b3b Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Tue, 20 Apr 2010 10:34:03 +0200 Subject: Fix crash on startup on Symbian OS The changes to QThread introduced by commit 9aa4538b219ed759a47e8d1f93c2797bf07b5e2f mean that the QThread constructor calls into the event dispatcher. The Symbian event dispatcher owns a QThread, so it crashed when the code re-entered the partially constructed event dispatcher and used an uninitialised pointer. This change delays construction of the QThread until the point of use, so that the event dispatcher is fully constructed. Task-number: QTBUG-10029 Reviewed-by: Jason Barron --- src/corelib/kernel/qeventdispatcher_symbian.cpp | 20 +++++++++++++++----- src/corelib/kernel/qeventdispatcher_symbian_p.h | 3 ++- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/src/corelib/kernel/qeventdispatcher_symbian.cpp b/src/corelib/kernel/qeventdispatcher_symbian.cpp index 8c96057..3b86e89 100644 --- a/src/corelib/kernel/qeventdispatcher_symbian.cpp +++ b/src/corelib/kernel/qeventdispatcher_symbian.cpp @@ -638,6 +638,7 @@ void QSocketActiveObject::deleteLater() QEventDispatcherSymbian::QEventDispatcherSymbian(QObject *parent) : QAbstractEventDispatcher(parent), + m_selectThread(0), m_activeScheduler(0), m_wakeUpAO(0), m_completeDeferredAOs(0), @@ -665,11 +666,19 @@ void QEventDispatcherSymbian::startingUp() wakeUp(); } +QSelectThread& QEventDispatcherSymbian::selectThread() { + if (!m_selectThread) + m_selectThread = new QSelectThread; + return *m_selectThread; +} + void QEventDispatcherSymbian::closingDown() { - if (m_selectThread.isRunning()) { - m_selectThread.stop(); + if (m_selectThread && m_selectThread->isRunning()) { + m_selectThread->stop(); } + delete m_selectThread; + m_selectThread = 0; delete m_completeDeferredAOs; delete m_wakeUpAO; @@ -941,12 +950,13 @@ void QEventDispatcherSymbian::registerSocketNotifier ( QSocketNotifier * notifie { QSocketActiveObject *socketAO = q_check_ptr(new QSocketActiveObject(this, notifier)); m_notifiers.insert(notifier, socketAO); - m_selectThread.requestSocketEvents(notifier, &socketAO->iStatus); + selectThread().requestSocketEvents(notifier, &socketAO->iStatus); } void QEventDispatcherSymbian::unregisterSocketNotifier ( QSocketNotifier * notifier ) { - m_selectThread.cancelSocketEvents(notifier); + if (m_selectThread) + m_selectThread->cancelSocketEvents(notifier); if (m_notifiers.contains(notifier)) { QSocketActiveObject *sockObj = *m_notifiers.find(notifier); m_deferredSocketEvents.removeAll(sockObj); @@ -957,7 +967,7 @@ void QEventDispatcherSymbian::unregisterSocketNotifier ( QSocketNotifier * notif void QEventDispatcherSymbian::reactivateSocketNotifier(QSocketNotifier *notifier) { - m_selectThread.requestSocketEvents(notifier, &m_notifiers[notifier]->iStatus); + selectThread().requestSocketEvents(notifier, &m_notifiers[notifier]->iStatus); } void QEventDispatcherSymbian::registerTimer ( int timerId, int interval, QObject * object ) diff --git a/src/corelib/kernel/qeventdispatcher_symbian_p.h b/src/corelib/kernel/qeventdispatcher_symbian_p.h index 1ab31cc..5281199 100644 --- a/src/corelib/kernel/qeventdispatcher_symbian_p.h +++ b/src/corelib/kernel/qeventdispatcher_symbian_p.h @@ -259,8 +259,9 @@ private: bool sendPostedEvents(); bool sendDeferredSocketEvents(); + QSelectThread& selectThread(); private: - QSelectThread m_selectThread; + QSelectThread *m_selectThread; CQtActiveScheduler *m_activeScheduler; -- cgit v0.12 From 67ffe10585bc683cd160cef95fef55e8301a6ab5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Mon, 19 Apr 2010 12:31:21 +0200 Subject: Fixed image drawing inconsistencies when drawing 1x1 images/subrects. We special cased 1x1 source rects by calling fillRect() with a solid color, but that produces slightly different rasterization leading to gaps when drawing 9-patch images for example. This patch makes us only use the optimized path for scaling transforms or simpler. Task-number: QTBUG-10018 Reviewed-by: Gunnar Sletta --- src/gui/painting/qpaintengine_raster.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index 8f14583..9148ac2 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -2552,7 +2552,7 @@ void QRasterPaintEngine::drawImage(const QRectF &r, const QImage &img, const QRe int sr_t = qFloor(sr.top()); int sr_b = qCeil(sr.bottom()) - 1; - if (!s->flags.antialiased && sr_l == sr_r && sr_t == sr_b) { + if (s->matrix.type() <= QTransform::TxScale && !s->flags.antialiased && sr_l == sr_r && sr_t == sr_b) { // as fillRect will apply the aliased coordinate delta we need to // subtract it here as we don't use it for image drawing QTransform old = s->matrix; -- 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 434d2312b63090cfd2ba7e0f3728b5b225bcaeec Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Mon, 19 Apr 2010 19:13:20 +0200 Subject: QDialog: user-moved dialog would not show on the same place after hide The Qt::WA_Moved was not being set during the move event as notified by the window manager. This is a behavior change for 4.7, but we think it's more user friendly than the previous behavior. Reviewed-by: mbm Task-number: QTBUG-9991 --- src/gui/dialogs/qdialog.cpp | 14 ++++++++------ src/gui/dialogs/qdialog.h | 2 -- src/gui/kernel/qwidget.cpp | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/gui/dialogs/qdialog.cpp b/src/gui/dialogs/qdialog.cpp index a6bd78a..e4f45ba 100644 --- a/src/gui/dialogs/qdialog.cpp +++ b/src/gui/dialogs/qdialog.cpp @@ -393,7 +393,6 @@ void QDialogPrivate::resetModalitySetByOpen() resetModalityTo = -1; } -#if defined(Q_WS_WINCE) || defined(Q_WS_S60) #ifdef Q_WS_WINCE_WM void QDialogPrivate::_q_doneAction() { @@ -408,12 +407,12 @@ void QDialogPrivate::_q_doneAction() bool QDialog::event(QEvent *e) { bool result = QWidget::event(e); -#ifdef Q_WS_WINCE +#if defined(Q_WS_WINCE) if (e->type() == QEvent::OkRequest) { accept(); result = true; - } -#else + } else +#elif defined(Q_WS_S60) if ((e->type() == QEvent::StyleChange) || (e->type() == QEvent::Resize )) { if (!testAttribute(Qt::WA_Moved)) { Qt::WindowStates state = windowState(); @@ -422,11 +421,14 @@ bool QDialog::event(QEvent *e) if (state != windowState()) setWindowState(state); } - } + } else #endif + if (e->type() == QEvent::Move) { + setAttribute(Qt::WA_Moved, true); // as explicit as the user wants it to be + } + return result; } -#endif /*! Returns the modal dialog's result code, \c Accepted or \c Rejected. diff --git a/src/gui/dialogs/qdialog.h b/src/gui/dialogs/qdialog.h index 777256a..7ab0cb6 100644 --- a/src/gui/dialogs/qdialog.h +++ b/src/gui/dialogs/qdialog.h @@ -107,9 +107,7 @@ public Q_SLOTS: protected: QDialog(QDialogPrivate &, QWidget *parent, Qt::WindowFlags f = 0); -#if defined(Q_WS_WINCE) || defined(Q_WS_S60) bool event(QEvent *e); -#endif void keyPressEvent(QKeyEvent *); void closeEvent(QCloseEvent *); void showEvent(QShowEvent *); diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index 10fa4b9..046bc7f 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -7307,9 +7307,9 @@ void QWidgetPrivate::show_helper() setVisible(false). - \note If you are working with QDialog or its subclasses and you invoke - the show() function after this function, the dialog will be displayed in - its original position. + \note Since Qt 4.7, when calling hide() and then show() on QDialog + derived widgets will show on the previous (as in "Where the user moved it to") + position. \sa hideEvent(), isHidden(), show(), setVisible(), isVisible(), close() */ -- 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 040b480b58f76ec689eea3b0f0518a0997080cc9 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Tue, 20 Apr 2010 14:26:15 +0300 Subject: Fix default_deployment.pkg_prerules Due to Symbian mkspecs refactoring, some changes from 4.6 didn't get properly merged into 4.7. Task-number: QTBUG-10050 Reviewed-by: Janne Koskinen --- mkspecs/common/symbian/symbian-mmp.conf | 11 ----------- mkspecs/common/symbian/symbian.conf | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/mkspecs/common/symbian/symbian-mmp.conf b/mkspecs/common/symbian/symbian-mmp.conf index 507b60c..1ab228f 100644 --- a/mkspecs/common/symbian/symbian-mmp.conf +++ b/mkspecs/common/symbian/symbian-mmp.conf @@ -38,17 +38,6 @@ INCLUDEPATH = \ # RVCT seems to do this automatically, but WINSCW compiler does not, so add it here. MMP_RULES += "USERINCLUDE ." -# Supports S60 3.0, 3.1, 3.2 and 5.0 by default -default_deployment.pkg_prerules = \ - "; Default HW/platform dependencies" \ - "[0x101F7961],0,0,0,{\"S60ProductID\"}" \ - "[0x102032BE],0,0,0,{\"S60ProductID\"}" \ - "[0x102752AE],0,0,0,{\"S60ProductID\"}" \ - "[0x1028315F],0,0,0,{\"S60ProductID\"}" \ - " " - -DEPLOYMENT += default_deployment - exists($${EPOCROOT}epoc32/release/winscw/udeb/z/system/install/series60v5.0.sis )|exists($${EPOCROOT}epoc32/data/z/system/install/series60v5.0.sis) { S60_VERSION = 5.0 } else { diff --git a/mkspecs/common/symbian/symbian.conf b/mkspecs/common/symbian/symbian.conf index 1df3671..0bd0bf2 100644 --- a/mkspecs/common/symbian/symbian.conf +++ b/mkspecs/common/symbian/symbian.conf @@ -112,3 +112,21 @@ QMAKE_GZIP = gzip -9f QT_ARCH = symbian load(qt_config) load(symbian/platform_paths) + +# pkg_depends_webkit, pkg_depends_core, and pkg_platform_dependencies can be removed by developer +# if multiple languages need to be supported by pkg file. In that case the developer should declare +# multiple language compatible dependency statements him/herself. + +default_deployment.pkg_prerules += pkg_depends_webkit pkg_depends_qt pkg_platform_dependencies + +# Supports S60 3.0, 3.1, 3.2 and 5.0 by default +pkg_platform_dependencies = \ + "; Default HW/platform dependencies" \ + "[0x101F7961],0,0,0,{\"S60ProductID\"}" \ + "[0x102032BE],0,0,0,{\"S60ProductID\"}" \ + "[0x102752AE],0,0,0,{\"S60ProductID\"}" \ + "[0x1028315F],0,0,0,{\"S60ProductID\"}" \ + " " + +DEPLOYMENT += default_deployment + -- cgit v0.12 From 88a332f92a5c660ce934ea0132c9814de0cb02b6 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Tue, 20 Apr 2010 14:36:31 +0300 Subject: Fixed vendor info in fluidlauncher sis package. Fluidlauncher was using default vendor info while all other demos used Nokia as vendor. Task-number: QTBUG-10051 Reviewed-by: Janne Koskinen --- demos/embedded/fluidlauncher/fluidlauncher.pro | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/demos/embedded/fluidlauncher/fluidlauncher.pro b/demos/embedded/fluidlauncher/fluidlauncher.pro index 13274c3..c6a105e 100644 --- a/demos/embedded/fluidlauncher/fluidlauncher.pro +++ b/demos/embedded/fluidlauncher/fluidlauncher.pro @@ -57,9 +57,10 @@ wince*{ symbian { load(data_caging_paths) + include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri) + RSS_RULES = # Clear RSS_RULES, otherwise fluidlauncher will get put into QtDemos folder TARGET.UID3 = 0xA000A641 - ICON = $$QT_SOURCE_TREE/src/s60installs/qt.svg defineReplace(regResourceDir) { symbian-abld|symbian-sbsv2 { -- cgit v0.12 From a057a48cbac8acbf54a121c63a795480d3f9a8c0 Mon Sep 17 00:00:00 2001 From: Aurelien Gateau Date: Tue, 20 Apr 2010 13:49:14 +0200 Subject: Added QIcon::name() This only works with icons loaded with QIcon::fromTheme() for now. Merge-request: 2367 Reviewed-by: Olivier Goffart Reviewed-by: jbache --- src/gui/image/qicon.cpp | 19 +++++++++++++++++++ src/gui/image/qicon.h | 2 ++ src/gui/image/qiconengine.cpp | 20 ++++++++++++++++++++ src/gui/image/qiconengine.h | 5 ++++- src/gui/image/qiconloader.cpp | 6 ++++++ tests/auto/qicon/tst_qicon.cpp | 23 +++++++++++++++++++++++ 6 files changed, 74 insertions(+), 1 deletion(-) diff --git a/src/gui/image/qicon.cpp b/src/gui/image/qicon.cpp index fad51f4..bc52e99 100644 --- a/src/gui/image/qicon.cpp +++ b/src/gui/image/qicon.cpp @@ -879,6 +879,25 @@ QList QIcon::availableSizes(Mode mode, State state) const } /*! + \since 4.7 + + Returns the name used to create the icon, if available. + + Depending on the way the icon was created, it may have an associated + name. This is the case for icons created with fromTheme() or icons + using a QIconEngine which supports the QIconEngineV2::IconNameHook. + + \sa fromTheme(), QIconEngine +*/ +QString QIcon::name() const +{ + if (!d || !d->engine || d->engine_version < 2) + return QString(); + QIconEngineV2 *engine = static_cast(d->engine); + return engine->iconName(); +} + +/*! \since 4.6 Sets the search paths for icon themes to \a paths. diff --git a/src/gui/image/qicon.h b/src/gui/image/qicon.h index 2812703..faef07b 100644 --- a/src/gui/image/qicon.h +++ b/src/gui/image/qicon.h @@ -81,6 +81,8 @@ public: QSize actualSize(const QSize &size, Mode mode = Normal, State state = Off) const; + QString name() const; + void paint(QPainter *painter, const QRect &rect, Qt::Alignment alignment = Qt::AlignCenter, Mode mode = Normal, State state = Off) const; inline void paint(QPainter *painter, int x, int y, int w, int h, Qt::Alignment alignment = Qt::AlignCenter, Mode mode = Normal, State state = Off) const { paint(painter, QRect(x, y, w, h), alignment, mode, state); } diff --git a/src/gui/image/qiconengine.cpp b/src/gui/image/qiconengine.cpp index 4c7c728..050d48d 100644 --- a/src/gui/image/qiconengine.cpp +++ b/src/gui/image/qiconengine.cpp @@ -183,6 +183,10 @@ void QIconEngine::addFile(const QString &/*fileName*/, const QSize &/*size*/, QI that should be filled with icon sizes. Engines that work in terms of a scalable, vectorial format normally return an empty list. + \value IconNameHook Allows to query the name used to create the + icon, for example when instantiating an icon using + QIcon::fromTheme(). + \sa virtual_hook() */ @@ -301,4 +305,20 @@ QList QIconEngineV2::availableSizes(QIcon::Mode mode, QIcon::State state) return arg.sizes; } +/*! + \since 4.7 + + Returns the name used to create the engine, if available. + + \note This is a helper method and the actual work is done by + virtual_hook() method, hence this method depends on icon engine support + and may not work with all icon engines. + */ +QString QIconEngineV2::iconName() +{ + QString name; + virtual_hook(QIconEngineV2::IconNameHook, reinterpret_cast(&name)); + return name; +} + QT_END_NAMESPACE diff --git a/src/gui/image/qiconengine.h b/src/gui/image/qiconengine.h index 1f9266b..6d8b6ad 100644 --- a/src/gui/image/qiconengine.h +++ b/src/gui/image/qiconengine.h @@ -80,7 +80,7 @@ public: virtual void virtual_hook(int id, void *data); public: - enum IconEngineHook { AvailableSizesHook = 1 }; + enum IconEngineHook { AvailableSizesHook = 1, IconNameHook }; struct AvailableSizesArgument { @@ -92,6 +92,9 @@ public: // ### Qt 5: make this function const and virtual. QList availableSizes(QIcon::Mode mode = QIcon::Normal, QIcon::State state = QIcon::Off); + + // ### Qt 5: make this function const and virtual. + QString iconName(); }; QT_END_NAMESPACE diff --git a/src/gui/image/qiconloader.cpp b/src/gui/image/qiconloader.cpp index 72ec2e8..a515ef8 100644 --- a/src/gui/image/qiconloader.cpp +++ b/src/gui/image/qiconloader.cpp @@ -554,6 +554,12 @@ void QIconLoaderEngine::virtual_hook(int id, void *data) } } break; + case QIconEngineV2::IconNameHook: + { + QString &name = *reinterpret_cast(data); + name = m_iconName; + } + break; default: QIconEngineV2::virtual_hook(id, data); } diff --git a/tests/auto/qicon/tst_qicon.cpp b/tests/auto/qicon/tst_qicon.cpp index fae9cc0..e68664c 100644 --- a/tests/auto/qicon/tst_qicon.cpp +++ b/tests/auto/qicon/tst_qicon.cpp @@ -76,6 +76,7 @@ private slots: void svg(); void addFile(); void availableSizes(); + void name(); void streamAvailableSizes_data(); void streamAvailableSizes(); void fromTheme(); @@ -550,6 +551,28 @@ void tst_QIcon::availableSizes() } } +void tst_QIcon::name() +{ + { + // No name if icon does not come from a theme + QIcon icon(":/image.png"); + QString name = icon.name(); + QVERIFY(name.isEmpty()); + } + + { + // Getting the name of an icon coming from a theme should work + QString searchPath = QLatin1String(":/icons"); + QIcon::setThemeSearchPaths(QStringList() << searchPath); + QString themeName("testtheme"); + QIcon::setThemeName(themeName); + + QIcon icon = QIcon::fromTheme("appointment-new"); + QString name = icon.name(); + QCOMPARE(name, QLatin1String("appointment-new")); + } +} + void tst_QIcon::streamAvailableSizes_data() { QTest::addColumn("icon"); -- 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 13732b74e07fe10e95f2601f6cf2d0be78467eaa Mon Sep 17 00:00:00 2001 From: Kim Motoyoshi Kalland Date: Tue, 20 Apr 2010 15:24:13 +0200 Subject: Fixed assert failure when trying to load invalid SVG file. Task-number: QTBUG-10022 Reviewed-by: Trond --- src/svg/qsvghandler.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/svg/qsvghandler.cpp b/src/svg/qsvghandler.cpp index 038aeb4..b6e771f 100644 --- a/src/svg/qsvghandler.cpp +++ b/src/svg/qsvghandler.cpp @@ -3525,7 +3525,11 @@ void QSvgHandler::parse() // namespaceUri is empty. The only possible strategy at // this point is to do what everyone else seems to do and // ignore the reported namespaceUri completely. - startElement(xml->name().toString(), xml->attributes()); + if (!startElement(xml->name().toString(), xml->attributes())) { + delete m_doc; + m_doc = 0; + return; + } break; case QXmlStreamReader::EndElement: endElement(xml->name()); @@ -3570,6 +3574,9 @@ bool QSvgHandler::startElement(const QString &localName, m_whitespaceMode.push(QSvgText::Default); } + if (!m_doc && localName != QLatin1String("svg")) + return false; + if (FactoryMethod method = findGroupFactory(localName)) { //group node = method(m_doc ? m_nodes.top() : 0, attributes, this); -- cgit v0.12 From ddf68c92b606b609d2db270c621af4f60ea0527f Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Tue, 20 Apr 2010 15:35:43 +0200 Subject: Fix to collections autotest The test was checking for an implementation detail, rather than behaviour which is part of the API. With the symbian text codecs backend, this test failed because the converter returns QByteArray() for empty input (for which isNull() returns true). Reviewed-by: Thiago --- tests/auto/collections/tst_collections.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/auto/collections/tst_collections.cpp b/tests/auto/collections/tst_collections.cpp index e7b01a1..d092c34 100644 --- a/tests/auto/collections/tst_collections.cpp +++ b/tests/auto/collections/tst_collections.cpp @@ -2260,7 +2260,6 @@ void tst_Collections::qstring() QVERIFY(s.isNull()); QVERIFY(s.toLocal8Bit().size() == 0); QVERIFY(s.toLocal8Bit().isEmpty()); - QVERIFY(!s.toLocal8Bit().isNull()); s = "first-ascii"; QVERIFY(s.toAscii() == "first-ascii"); -- cgit v0.12 From 4a059ff9042cca4105395f26f31d96f883fa416f Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Tue, 20 Apr 2010 15:42:16 +0200 Subject: Fix compile error in QFileDialog autotest Reviewed-by: Trust Me --- tests/auto/qfiledialog/tst_qfiledialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/qfiledialog/tst_qfiledialog.cpp b/tests/auto/qfiledialog/tst_qfiledialog.cpp index 9adb4fc..38a1ee7 100644 --- a/tests/auto/qfiledialog/tst_qfiledialog.cpp +++ b/tests/auto/qfiledialog/tst_qfiledialog.cpp @@ -548,7 +548,7 @@ void tst_QFiledialog::completer() // ### FIXME: This will fail on Symbian on some tests and some environments until the file engine and QFileSystemModel // are fixed to properly capitalize paths, so that some folders are not duplicated in QFileSystemModel. #if defined(Q_OS_SYMBIAN) - QSKIP("This will fail on Symbian on some tests and some environments until the file engine and QFileSystemModel are fixed to properly capitalize paths") + QSKIP("This will fail on Symbian on some tests and some environments until the file engine and QFileSystemModel are fixed to properly capitalize paths", SkipAll); #endif QTRY_COMPARE(cModel->rowCount(), expected); } QT_CATCH(...) { -- cgit v0.12 From dab8d4c77795ed195f23e427945267e9e9a4df20 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Tue, 30 Mar 2010 18:01:06 +0200 Subject: Micro optimisations in QMutexLocker Reviewed-by: Thiago --- src/corelib/thread/qmutex.h | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/corelib/thread/qmutex.h b/src/corelib/thread/qmutex.h index 677412e..509f300 100644 --- a/src/corelib/thread/qmutex.h +++ b/src/corelib/thread/qmutex.h @@ -95,21 +95,23 @@ class Q_CORE_EXPORT QMutexLocker { public: inline explicit QMutexLocker(QMutex *m) - : val(reinterpret_cast(m)) { - Q_ASSERT_X((val & quintptr(1u)) == quintptr(0), + Q_ASSERT_X((reinterpret_cast(m) & quintptr(1u)) == quintptr(0), "QMutexLocker", "QMutex pointer is misaligned"); - relock(); + if (m) { + m->lock(); + val = reinterpret_cast(m) | quintptr(1u); + } else { + val = 0; + } } inline ~QMutexLocker() { unlock(); } inline void unlock() { - if (val) { - if ((val & quintptr(1u)) == quintptr(1u)) { - val &= ~quintptr(1u); - mutex()->unlock(); - } + if ((val & quintptr(1u)) == quintptr(1u)) { + val &= ~quintptr(1u); + mutex()->unlock(); } } -- cgit v0.12 From c90b3ec191430e8b6bf5526124919df0bd0cf518 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Tue, 30 Mar 2010 18:01:49 +0200 Subject: Benchmark emission of signal connected to nothing --- tests/benchmarks/corelib/kernel/qobject/main.cpp | 9 +++++++-- tests/benchmarks/corelib/kernel/qobject/object.cpp | 3 +++ tests/benchmarks/corelib/kernel/qobject/object.h | 1 + 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/tests/benchmarks/corelib/kernel/qobject/main.cpp b/tests/benchmarks/corelib/kernel/qobject/main.cpp index 7f24ebd..8d05fcd 100644 --- a/tests/benchmarks/corelib/kernel/qobject/main.cpp +++ b/tests/benchmarks/corelib/kernel/qobject/main.cpp @@ -69,6 +69,7 @@ void QObjectBenchmark::signal_slot_benchmark_data() QTest::newRow("simple function") << 0; QTest::newRow("single signal/slot") << 1; QTest::newRow("multi signal/slot") << 2; + QTest::newRow("unconnected signal") << 3; } void QObjectBenchmark::signal_slot_benchmark() @@ -110,9 +111,13 @@ void QObjectBenchmark::signal_slot_benchmark() QBENCHMARK { singleObject.emitSignal0(); } - } else { + } else if (type == 2) { QBENCHMARK { - multiObject.emitSignal0(); + multiObject.emitSignal0(); + } + } else if (type == 3) { + QBENCHMARK { + singleObject.emitSignal1(); } } } diff --git a/tests/benchmarks/corelib/kernel/qobject/object.cpp b/tests/benchmarks/corelib/kernel/qobject/object.cpp index d775a32..3920e97 100644 --- a/tests/benchmarks/corelib/kernel/qobject/object.cpp +++ b/tests/benchmarks/corelib/kernel/qobject/object.cpp @@ -42,6 +42,9 @@ void Object::emitSignal0() { emit signal0(); } +void Object::emitSignal1() +{ emit signal1(); } + void Object::slot0() { } diff --git a/tests/benchmarks/corelib/kernel/qobject/object.h b/tests/benchmarks/corelib/kernel/qobject/object.h index 7e4933f..8f8fbe9 100644 --- a/tests/benchmarks/corelib/kernel/qobject/object.h +++ b/tests/benchmarks/corelib/kernel/qobject/object.h @@ -48,6 +48,7 @@ class Object : public QObject Q_OBJECT public: void emitSignal0(); + void emitSignal1(); signals: void signal0(); void signal1(); -- cgit v0.12 From 7f207df8cc63762e32803505aaf6e9b320fd6ba5 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Tue, 30 Mar 2010 18:03:24 +0200 Subject: Optimize QMetaObject::activate Mainly by inlining what should be inlined Reviewed-by: Thiago --- src/corelib/kernel/qobject.cpp | 27 +++------------------------ src/corelib/kernel/qobject_p.h | 28 ++++++++++++++++++++++++---- 2 files changed, 27 insertions(+), 28 deletions(-) diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index c13d829..3a37cb1 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -101,7 +101,7 @@ static QBasicAtomicInt objectCount = Q_BASIC_ATOMIC_INITIALIZER(0); /** \internal * mutex to be locked when accessing the connectionlists or the senders list */ -static QMutex *signalSlotLock(const QObject *o) +static inline QMutex *signalSlotLock(const QObject *o) { if (!signalSlotMutexes) { QMutexPool *mp = new QMutexPool; @@ -393,27 +393,6 @@ void QObjectPrivate::cleanConnectionLists() } } -QObjectPrivate::Sender *QObjectPrivate::setCurrentSender(QObject *receiver, - Sender *sender) -{ - Sender *previousSender = receiver->d_func()->currentSender; - receiver->d_func()->currentSender = sender; - return previousSender; -} - -void QObjectPrivate::resetCurrentSender(QObject *receiver, - Sender *currentSender, - Sender *previousSender) -{ - // ref is set to zero when this object is deleted during the metacall - if (currentSender->ref == 1) - receiver->d_func()->currentSender = previousSender; - // if we've recursed, we need to tell the caller about the objects deletion - if (previousSender) - previousSender->ref = currentSender->ref; -} - - typedef QMultiHash GuardHash; Q_GLOBAL_STATIC(GuardHash, guardHash) Q_GLOBAL_STATIC(QMutex, guardHashLock) @@ -3231,9 +3210,9 @@ void QMetaObject::activate(QObject *sender, const QMetaObject *m, int local_sign argv ? argv : empty_argv); } - QMutexLocker locker(signalSlotLock(sender)); QThreadData *currentThreadData = QThreadData::current(); + QMutexLocker locker(signalSlotLock(sender)); QObjectConnectionListVector *connectionLists = sender->d_func()->connectionLists; if (!connectionLists) { locker.unlock(); @@ -3329,7 +3308,7 @@ void QMetaObject::activate(QObject *sender, const QMetaObject *m, int local_sign if (connectionLists->orphaned) { if (!connectionLists->inUse) delete connectionLists; - } else { + } else if (connectionLists->dirty) { sender->d_func()->cleanConnectionLists(); } diff --git a/src/corelib/kernel/qobject_p.h b/src/corelib/kernel/qobject_p.h index 341b3e9..4800e6a 100644 --- a/src/corelib/kernel/qobject_p.h +++ b/src/corelib/kernel/qobject_p.h @@ -156,9 +156,9 @@ public: void removePendingChildInsertedEvents(QObject *child); #endif - static Sender *setCurrentSender(QObject *receiver, + static inline Sender *setCurrentSender(QObject *receiver, Sender *sender); - static void resetCurrentSender(QObject *receiver, + static inline void resetCurrentSender(QObject *receiver, Sender *currentSender, Sender *previousSender); static int *setDeleteWatch(QObjectPrivate *d, int *newWatch); @@ -215,9 +215,29 @@ public: inline bool QObjectPrivate::isSignalConnected(uint signal_index) const { return signal_index >= sizeof(connectedSignals) * 8 + || (connectedSignals[signal_index >> 5] & (1 << (signal_index & 0x1f)) || qt_signal_spy_callback_set.signal_begin_callback - || qt_signal_spy_callback_set.signal_end_callback - || (connectedSignals[signal_index >> 5] & (1 << (signal_index & 0x1f))); + || qt_signal_spy_callback_set.signal_end_callback); +} + +inline QObjectPrivate::Sender *QObjectPrivate::setCurrentSender(QObject *receiver, + Sender *sender) +{ + Sender *previousSender = receiver->d_func()->currentSender; + receiver->d_func()->currentSender = sender; + return previousSender; +} + +inline void QObjectPrivate::resetCurrentSender(QObject *receiver, + Sender *currentSender, + Sender *previousSender) +{ + // ref is set to zero when this object is deleted during the metacall + if (currentSender->ref == 1) + receiver->d_func()->currentSender = previousSender; + // if we've recursed, we need to tell the caller about the objects deletion + if (previousSender) + previousSender->ref = currentSender->ref; } -- 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" \ "