Changeset 846 for trunk/src/network/kernel/qhostinfo.cpp
- Timestamp:
- May 5, 2011, 5:36:53 AM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
src/network/kernel/qhostinfo.cpp (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.7.2 (added) merged: 845 /branches/vendor/nokia/qt/current merged: 844 /branches/vendor/nokia/qt/4.6.3 removed
- Property svn:mergeinfo changed
-
trunk/src/network/kernel/qhostinfo.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 201 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation ([email protected]) … … 169 169 QHostInfo hostInfo(id); 170 170 hostInfo.setError(QHostInfo::HostNotFound); 171 hostInfo.setErrorString(Q Object::tr("No host name given"));171 hostInfo.setErrorString(Q"No host name given")); 172 172 QScopedPointer<QHostInfoResult> result(new QHostInfoResult); 173 173 QObject::connect(result.data(), SIGNAL(resultsReady(QHostInfo)), … … 244 244 #endif 245 245 246 return QHostInfoAgent::fromName(name); 246 QHostInfo hostInfo = QHostInfoAgent::fromName(name); 247 QHostInfoLookupManager *manager = theHostInfoLookupManager(); 248 manager->cache.put(name, hostInfo); 249 return hostInfo; 247 250 } 248 251 … … 468 471 resultEmitter.emitResultsReady(hostInfo); 469 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 470 488 manager->lookupFinished(this); 471 489 … … 485 503 486 504 // don't qDeleteAll currentLookups, the QThreadPool has ownership 487 qDeleteAll(postponedLookups); 488 qDeleteAll(scheduledLookups); 489 qDeleteAll(finishedLookups); 505 clear(); 506 } 507 508 void QHostInfoLookupManager::clear() 509 { 510 { 511 QMutexLocker locker(&mutex); 512 qDeleteAll(postponedLookups); 513 qDeleteAll(scheduledLookups); 514 qDeleteAll(finishedLookups); 515 postponedLookups.clear(); 516 scheduledLookups.clear(); 517 finishedLookups.clear(); 518 } 519 520 threadPool.waitForDone(); 521 cache.clear(); 490 522 } 491 523 … … 579 611 580 612 QMutexLocker locker(&this->mutex); 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 581 630 if (!abortedLookups.contains(id)) 582 631 abortedLookups.append(id); … … 605 654 } 606 655 607 // This function returns immediat ly when we had a result in the cache, else it will later emit a signal656 // This function returns immediatly when we had a result in the cache, else it will later emit a signal 608 657 QHostInfo qt_qhostinfo_lookup(const QString &name, QObject *receiver, const char *member, bool *valid, int *id) 609 658 { … … 631 680 QHostInfoLookupManager* manager = theHostInfoLookupManager(); 632 681 if (manager) { 633 manager->c ache.clear();682 manager->clear(); 634 683 } 635 684 }
Note:
See TracChangeset
for help on using the changeset viewer.
