Changeset 769 for trunk/src/corelib/kernel
- Timestamp:
- Aug 2, 2010, 9:27:30 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 14 edited
-
. (modified) (1 prop)
-
src/corelib/kernel/qabstractitemmodel.cpp (modified) (1 diff)
-
src/corelib/kernel/qcore_symbian_p.cpp (modified) (2 diffs)
-
src/corelib/kernel/qcore_symbian_p.h (modified) (1 diff)
-
src/corelib/kernel/qcoreapplication.cpp (modified) (3 diffs)
-
src/corelib/kernel/qeventdispatcher_symbian.cpp (modified) (14 diffs)
-
src/corelib/kernel/qeventdispatcher_symbian_p.h (modified) (3 diffs)
-
src/corelib/kernel/qeventdispatcher_win.cpp (modified) (3 diffs)
-
src/corelib/kernel/qfunctions_wince.cpp (modified) (1 diff)
-
src/corelib/kernel/qmetaobject.cpp (modified) (1 diff)
-
src/corelib/kernel/qobject.cpp (modified) (3 diffs)
-
src/corelib/kernel/qobjectdefs.h (modified) (2 diffs)
-
src/corelib/kernel/qtranslator.cpp (modified) (1 diff)
-
src/corelib/kernel/qvariant.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.6.3 (added) merged: 768 /branches/vendor/nokia/qt/current merged: 767 /branches/vendor/nokia/qt/4.6.2 removed
- Property svn:mergeinfo changed
-
trunk/src/corelib/kernel/qabstractitemmodel.cpp
r651 r769 1006 1006 Returns the child of the model index that is stored in the given \a row and 1007 1007 \a column. 1008 1009 1010 1008 1011 1009 1012 \sa parent(), sibling() -
trunk/src/corelib/kernel/qcore_symbian_p.cpp
r651 r769 72 72 return QString::fromLocal8Bit(aDescriptor.Ptr(), aDescriptor.Length()); 73 73 #else 74 return QString ::fromUtf16(aDescriptor.Ptr(), aDescriptor.Length());74 return QString), aDescriptor.Length()); 75 75 #endif 76 76 } … … 133 133 { 134 134 #ifdef Q_WS_S60 135 _LIT(KLibName_3_1, "qts60plugin_3_1.dll"); 136 _LIT(KLibName_3_2, "qts60plugin_3_2.dll"); 137 _LIT(KLibName_5_0, "qts60plugin_5_0.dll"); 135 _LIT(KLibName_3_1, "qts60plugin_3_1" QT_LIBINFIX_UNICODE L".dll"); 136 _LIT(KLibName_3_2, "qts60plugin_3_2" QT_LIBINFIX_UNICODE L".dll"); 137 _LIT(KLibName_5_0, "qts60plugin_5_0" QT_LIBINFIX_UNICODE L".dll"); 138 138 139 TPtrC libName; 139 140 TInt uidValue; -
trunk/src/corelib/kernel/qcore_symbian_p.h
r651 r769 60 60 #include <qhash.h> 61 61 #include <f32file.h> 62 63 64 65 66 67 68 69 70 62 71 63 72 QT_BEGIN_HEADER -
trunk/src/corelib/kernel/qcoreapplication.cpp
r651 r769 68 68 # include <exception> 69 69 # include <f32file.h> 70 70 71 # include "qeventdispatcher_symbian_p.h" 71 72 # include "private/qcore_symbian_p.h" … … 597 598 extern void qt_core_eval_init(uint); 598 599 qt_core_eval_init(d->application_type); 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 599 621 #endif 600 622 … … 2250 2272 TInt err = finder.FindByDir(tempPathPtr, tempPathPtr); 2251 2273 while (err == KErrNone) { 2252 QString foundDir = QString::fromUtf16(finder.File().Ptr(), finder.File().Length()); 2274 QString foundDir(reinterpret_cast<const QChar *>(finder.File().Ptr()), 2275 finder.File().Length()); 2253 2276 foundDir = QDir(foundDir).canonicalPath(); 2254 2277 if (!app_libpaths->contains(foundDir)) -
trunk/src/corelib/kernel/qeventdispatcher_symbian.cpp
r651 r769 44 44 #include <qcoreapplication.h> 45 45 #include <private/qcoreapplication_p.h> 46 #include <qdatetime.h>47 46 48 47 #include <unistd.h> 49 48 #include <errno.h> 50 49 50 51 51 52 QT_BEGIN_NAMESPACE 53 54 55 56 57 58 59 52 60 53 61 #define WAKE_UP_PRIORITY CActive::EPriorityStandard … … 93 101 { 94 102 public: 95 QSelectMutexGrabber(int fd, QMutex * mutex)96 : m_ mutex(mutex)103 QSelectMutexGrabber(int fd, QMutex *utex) 104 : m_) 97 105 { 98 if (m_mutex->tryLock()) 106 // see if selectThread is waiting m_waitCond 107 // if yes ... dont write to pipe 108 if (m_threadMutex->tryLock()) { 109 bHasThreadLock = true; 99 110 return; 111 112 113 114 115 116 117 118 100 119 101 120 char dummy = 0; 102 121 qt_pipe_write(fd, &dummy, 1); 103 122 104 m_mutex->lock(); 123 m_threadMutex->lock(); 124 bHasThreadLock = true; 105 125 } 106 126 107 127 ~QSelectMutexGrabber() 108 128 { 109 m_mutex->unlock(); 129 if(bHasThreadLock) 130 m_threadMutex->unlock(); 110 131 } 111 132 112 133 private: 113 QMutex *m_mutex; 134 QMutex *m_threadMutex; 135 QMutex *m_selectCallMutex; 136 bool bHasThreadLock; 114 137 }; 115 138 … … 393 416 int ret; 394 417 int savedSelectErrno; 395 ret = qt_socket_select(maxfd, &readfds, &writefds, &exceptionfds, 0); 418 { 419 // helps fighting the race condition between 420 // selctthread and new socket requests (cancel, restart ...) 421 QMutexLocker locker(&m_selectCallMutex); 422 ret = qt_socket_select(maxfd, &readfds, &writefds, &exceptionfds, 0); 423 } 396 424 savedSelectErrno = errno; 397 425 … … 457 485 458 486 // traversed all, so update 487 459 488 updateActivatedNotifiers(QSocketNotifier::Read, &readfds); 460 489 updateActivatedNotifiers(QSocketNotifier::Write, &writefds); 461 updateActivatedNotifiers(QSocketNotifier::Exception, &exceptionfds);462 490 463 491 break; … … 469 497 } 470 498 } else { 499 471 500 updateActivatedNotifiers(QSocketNotifier::Read, &readfds); 472 501 updateActivatedNotifiers(QSocketNotifier::Write, &writefds); 473 updateActivatedNotifiers(QSocketNotifier::Exception, &exceptionfds);474 502 } 475 503 … … 488 516 } 489 517 490 QSelectMutexGrabber lock(m_pipeEnds[1], &m_mutex); 518 QMutexLocker locker(&m_grabberMutex); 519 520 QSelectMutexGrabber lock(m_pipeEnds[1], &m_mutex, &m_selectCallMutex); 491 521 492 522 Q_ASSERT(!m_AOStatuses.contains(notifier)); … … 499 529 void QSelectThread::cancelSocketEvents ( QSocketNotifier *notifier ) 500 530 { 501 QSelectMutexGrabber lock(m_pipeEnds[1], &m_mutex); 531 QMutexLocker locker(&m_grabberMutex); 532 533 QSelectMutexGrabber lock(m_pipeEnds[1], &m_mutex, &m_selectCallMutex); 502 534 503 535 m_AOStatuses.remove(notifier); … … 508 540 void QSelectThread::restart() 509 541 { 510 QSelectMutexGrabber lock(m_pipeEnds[1], &m_mutex); 542 QMutexLocker locker(&m_grabberMutex); 543 544 QSelectMutexGrabber lock(m_pipeEnds[1], &m_mutex, &m_selectCallMutex); 511 545 512 546 m_waitCond.wakeAll(); … … 564 598 * then signal RequestComplete for it 565 599 */ 566 qWarning("exception on %d", i.key()->socket()); 600 qWarning("exception on %d [will do setdefaultif(0) - hack]", i.key()->socket()); 601 // quick fix; there is a bug 602 // when doing read on socket 603 // errors not preoperly mapped 604 // after offline-ing the device 605 // on some devices we do get exception 606 // close all exiting sockets 607 // and reset default IAP 608 if(::setdefaultif(0) != KErrNone) // well we can't do much about it 609 qWarning("setdefaultif(0) failed"); 610 567 611 toRemove.append(i.key()); 568 612 TRequestStatus *status = i.value(); … … 623 667 } 624 668 } 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 625 737 626 738 QEventDispatcherSymbian::QEventDispatcherSymbian(QObject *parent) … … 634 746 m_noSocketEvents(false) 635 747 { 748 749 750 751 752 636 753 } 637 754 638 755 QEventDispatcherSymbian::~QEventDispatcherSymbian() 639 756 { 640 m_processHandle.Close();641 757 } 642 758 … … 698 814 m_interrupt = false; 699 815 700 /* 701 * This QTime variable is used to measure the time it takes to finish 702 * the event loop. If we take too long in the loop, other processes 703 * may be starved and killed. After the first event has completed, we 704 * take the current time, and if the remaining events take longer than 705 * a preset time, we temporarily lower the priority to force a context 706 * switch. For applications that do not take unecessarily long in the 707 * event loop, the priority will not be altered. 708 */ 709 QTime time; 710 enum { 711 FirstRun, 712 SubsequentRun, 713 TimeStarted 714 } timeState = FirstRun; 715 716 TProcessPriority priority; 816 #ifdef QT_SYMBIAN_PRIORITY_DROP 817 QTime eventTimer; 818 #endif 717 819 718 820 while (1) { … … 728 830 } 729 831 730 if (timeState == SubsequentRun) { 731 time.start(); 732 timeState = TimeStarted; 832 #ifdef QT_SYMBIAN_PRIORITY_DROP 833 if (idleDetectorThread()->hasRun()) { 834 if (m_delay > baseDelay) 835 m_delay -= baseDelay; 836 m_lastIdleRequestTimer.start(); 837 idleDetectorThread()->kick(); 838 } else if (m_lastIdleRequestTimer.elapsed() > maxBusyTime) { 839 User::AfterHighRes(m_delay); 840 // allow delay to be up to 1/4 of execution time 841 if (!idleDetectorThread()->hasRun() && m_delay*3 < m_avgEventTime) 842 m_delay += baseDelay; 733 843 } 844 845 734 846 735 847 TInt error; 736 handledSymbianEvent = CActiveScheduler::RunIfReady(error, CActive::EPriorityIdle);848 handledSymbianEvent = CActiveScheduler::RunIfReady(error, ); 737 849 if (error) { 738 850 qWarning("CActiveScheduler::RunIfReady() returned error: %i\n", error); 739 851 CActiveScheduler::Current()->Error(error); 740 852 } 853 854 855 856 857 858 741 859 742 860 if (!handledSymbianEvent) { … … 748 866 } 749 867 block = false; 750 if (timeState == TimeStarted && time.elapsed() > 100) {751 priority = m_processHandle.Priority();752 m_processHandle.SetPriority(EPriorityBackground);753 time.start();754 // Slight chance of race condition in the next lines, but nothing fatal755 // will happen, just wrong priority.756 if (m_processHandle.Priority() == EPriorityBackground) {757 m_processHandle.SetPriority(priority);758 }759 }760 if (timeState == FirstRun)761 timeState = SubsequentRun;762 868 }; 763 869 -
trunk/src/corelib/kernel/qeventdispatcher_symbian_p.h
r651 r769 63 63 #include <qwaitcondition.h> 64 64 #include <qsocketnotifier.h> 65 65 66 66 67 #include <e32base.h> … … 211 212 QWaitCondition m_waitCond; 212 213 bool m_quit; 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 213 234 }; 214 235 … … 280 301 QList<QActiveObject *> m_deferredActiveObjects; 281 302 282 RProcess m_processHandle; 303 int m_delay; 304 int m_avgEventTime; 305 QTime m_lastIdleRequestTimer; 283 306 }; 284 307 -
trunk/src/corelib/kernel/qeventdispatcher_win.cpp
r651 r769 69 69 #endif 70 70 71 72 73 74 75 76 77 78 71 79 enum { 72 80 WM_QT_SOCKETNOTIFIER = WM_USER, … … 503 511 if (localSerialNumber != d->lastSerialNumber 504 512 // if this message IS the one that triggers sendPostedEvents(), no need to post it again 505 && msg->hwnd != d->internalHwnd506 && msg->message != WM_QT_SENDPOSTEDEVENTS) {513 && msg->hwnd != d->internalHwnd 514 ) { 507 515 PostMessage(d->internalHwnd, WM_QT_SENDPOSTEDEVENTS, 0, 0); 508 516 } … … 715 723 || msg.message == WM_MOUSEWHEEL 716 724 || msg.message == WM_MOUSEHWHEEL 725 726 727 717 728 || msg.message == WM_CLOSE)) { 718 729 // queue user input events for later processing -
trunk/src/corelib/kernel/qfunctions_wince.cpp
r651 r769 353 353 size_t high = num - 1; 354 354 while (low <= high) { 355 unsigned int mid = ((unsigned) (low + high)) >> 1;355 ) >> 1; 356 356 int c = compare(key, (char*)base + mid * size); 357 if (c < 0) 357 if (c < 0) { 358 if (!mid) 359 break; 358 360 high = mid - 1; 359 else if (c > 0)361 else if (c > 0) 360 362 low = mid + 1; 361 363 else 362 364 return (char*) base + mid * size; 363 365 } 364 return (NULL);366 return ; 365 367 } 366 368 -
trunk/src/corelib/kernel/qmetaobject.cpp
r651 r769 944 944 return result; 945 945 946 QVarLengthArray<char> stackbuf( int(strlen(type)) + 1);946 QVarLengthArray<char> stackbuf() + 1); 947 947 qRemoveWhitespace(type, stackbuf.data()); 948 948 int templdepth = 0; -
trunk/src/corelib/kernel/qobject.cpp
r651 r769 3265 3265 const int method = c->method; 3266 3266 QObjectPrivate::Sender currentSender; 3267 currentSender.sender = sender; 3268 currentSender.signal = signal_absolute_index; 3269 currentSender.ref = 1; 3267 const bool receiverInSameThread = currentThreadData == receiver->d_func()->threadData; 3270 3268 QObjectPrivate::Sender *previousSender = 0; 3271 if (currentThreadData == receiver->d_func()->threadData) 3269 if (receiverInSameThread) { 3270 currentSender.sender = sender; 3271 currentSender.signal = signal_absolute_index; 3272 currentSender.ref = 1; 3272 3273 previousSender = QObjectPrivate::setCurrentSender(receiver, ¤tSender); 3274 3273 3275 locker.unlock(); 3274 3276 … … 3286 3288 } QT_CATCH(...) { 3287 3289 locker.relock(); 3288 3289 QObjectPrivate::resetCurrentSender(receiver, ¤tSender, previousSender);3290 if (receiverInSameThread) 3291 QObjectPrivate::resetCurrentSender(receiver, ¤tSender, previousSender); 3290 3292 3291 3293 --connectionLists->inUse; … … 3302 3304 locker.relock(); 3303 3305 3304 QObjectPrivate::resetCurrentSender(receiver, ¤tSender, previousSender); 3306 if (receiverInSameThread) 3307 QObjectPrivate::resetCurrentSender(receiver, ¤tSender, previousSender); 3305 3308 3306 3309 if (connectionLists->orphaned) -
trunk/src/corelib/kernel/qobjectdefs.h
r651 r769 79 79 #define Q_INTERFACES(x) 80 80 #define Q_PROPERTY(text) 81 81 82 #define Q_OVERRIDE(text) 82 83 #define Q_ENUMS(x) … … 179 180 #define Q_INTERFACES(x) Q_INTERFACES(x) 180 181 #define Q_PROPERTY(text) Q_PROPERTY(text) 182 181 183 #define Q_OVERRIDE(text) Q_OVERRIDE(text) 182 184 #define Q_ENUMS(x) Q_ENUMS(x) -
trunk/src/corelib/kernel/qtranslator.cpp
r651 r769 634 634 if (!tn) 635 635 return QString(); 636 QString str = QString ::fromUtf16((const ushort*)tn, tn_length/2);636 QString str = QString *)tn, tn_length/2); 637 637 if (QSysInfo::ByteOrder == QSysInfo::LittleEndian) { 638 638 for (int i = 0; i < str.length(); ++i) -
trunk/src/corelib/kernel/qvariant.cpp
r651 r769 467 467 * user defined pointer types. */ 468 468 const char *const typeName = QMetaType::typeName(a->type); 469 if (typeName[qstrlen(typeName) - 1] == '*') 469 uint typeNameLen = qstrlen(typeName); 470 if (typeNameLen > 0 && typeName[typeNameLen - 1] == '*') 470 471 return *static_cast<void *const *>(a_ptr) == *static_cast<void *const *>(b_ptr); 472 473 474 471 475 472 476 return a_ptr == b_ptr;
Note:
See TracChangeset
for help on using the changeset viewer.
