Changeset 769 for trunk/src/gui/util
- Timestamp:
- Aug 2, 2010, 9:27:30 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
- 1 copied
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/gui/util/qcompleter.cpp
r651 r769 528 528 cost = cost + m.indices.cost() - old.indices.cost(); 529 529 if (cost * sizeof(int) > 1024 * 1024) { 530 QMap<QModelIndex, CacheItem>::iterator it1 ;531 for (it1 = cache.begin(); it1 != cache.end(); ++it1) {530 QMap<QModelIndex, CacheItem>::iterator it1 = cache.begin(); 531 while (it1 != cache.end()) { 532 532 CacheItem& ci = it1.value(); 533 533 int sz = ci.count()/2; 534 534 QMap<QString, QMatchData>::iterator it2 = ci.begin(); 535 for (int i = 0; it2 != ci.end() && i < sz; i++, ++it2) { 535 int i = 0; 536 while (it2 != ci.end() && i < sz) { 536 537 cost -= it2.value().indices.cost(); 537 ci.erase(it2); 538 it2 = ci.erase(it2); 539 i++; 538 540 } 539 if (ci.count() == 0) 540 cache.erase(it1); 541 if (ci.count() == 0) { 542 it1 = cache.erase(it1); 543 } else { 544 ++it1; 545 } 541 546 } 542 547 } … … 1749 1754 This signal is sent when an item in the popup() is highlighted by 1750 1755 the user. It is also sent if complete() is called with the completionMode() 1751 set to QC Ompleter::InlineCompletion. The item's \a text is given.1756 set to QCompleter::InlineCompletion. The item's \a text is given. 1752 1757 */ 1753 1758 -
trunk/src/gui/util/qdesktopservices_s60.cpp
r651 r769 49 49 #include <private/qcore_symbian_p.h> 50 50 51 #include <miutset.h> // KUidMsgTypeSMTP52 51 #include <txtrich.h> // CRichText 53 52 #include <f32file.h> // TDriveUnit etc … … 58 57 #include <rsendasmessage.h> // RSendAsMessage 59 58 59 // copied from miutset.h, so we don't get a dependency into the app layer 60 const TUid KUidMsgTypeSMTP = {0x10001028}; // 268439592 61 60 62 #ifdef Q_WS_S60 61 63 # include <pathinfo.h> // PathInfo 62 64 # ifdef USE_DOCUMENTHANDLER 63 # include < documenthandler.h> // CDocumentHandler64 # include < aknserverapp.h>65 # include <DocumentHandler.h> // CDocumentHandler 66 # include <AknServerApp.h> 65 67 # endif 66 68 #else -
trunk/src/gui/util/qsystemtrayicon_mac.mm
r651 r769 531 531 const QIcon icon = action->icon(); 532 532 if(!icon.isNull()) { 533 #ifndef QT_MAC_USE_COCOA 534 const short scale = GetMBarHeight(); 535 #else 533 536 const short scale = [[NSApp mainMenu] menuBarHeight]; 537 #endif 534 538 NSImage *nsimage = static_cast<NSImage *>(qt_mac_create_nsimage(icon.pixmap(QSize(scale, scale)))); 535 539 [item setImage: nsimage]; … … 570 574 @end 571 575 572 573 /* Done here because this is the only .mm for now! -Sam */574 QMacCocoaAutoReleasePool::QMacCocoaAutoReleasePool()575 {576 NSApplicationLoad();577 pool = (void*)[[NSAutoreleasePool alloc] init];578 }579 580 QMacCocoaAutoReleasePool::~QMacCocoaAutoReleasePool()581 {582 [(NSAutoreleasePool*)pool release];583 }584 -
trunk/src/gui/util/qsystemtrayicon_p.h
r651 r769 165 165 void mousePressEvent(QMouseEvent *event); 166 166 void mouseDoubleClickEvent(QMouseEvent *event); 167 #ifndef QT_NO_WHEELEVENT 167 168 void wheelEvent(QWheelEvent *event); 169 #endif 168 170 bool event(QEvent *e); 169 171 -
trunk/src/gui/util/qsystemtrayicon_win.cpp
r651 r769 62 62 #include <QSettings> 63 63 64 #if defined(Q_WS_WINCE) && !defined(STANDARDSHELL_UI_MODEL)65 # include <streams.h>66 #endif67 68 64 QT_BEGIN_NAMESPACE 69 65 70 #if defined(Q_WS_WINCE)71 static const UINT q_uNOTIFYICONID = 13; // IDs from 0 to 12 are reserved on WinCE.72 #else73 66 static const UINT q_uNOTIFYICONID = 0; 74 #endif75 67 76 68 static uint MYWM_TASKBARCREATED = 0; … … 126 118 bool QSystemTrayIconSys::supportsMessages() 127 119 { 128 #ifndef Q_OS_WINCE129 120 return allowsMessages(); 130 #endif131 return false;132 121 } 133 122 … … 136 125 137 126 { 138 #ifndef Q_OS_WINCE139 127 notifyIconSize = FIELD_OFFSET(NOTIFYICONDATA, guidItem); // NOTIFYICONDATAW_V2_SIZE; 140 128 maxTipLength = 128; 141 #else142 notifyIconSize = FIELD_OFFSET(NOTIFYICONDATA, szTip[64]); // NOTIFYICONDATAW_V1_SIZE;143 maxTipLength = 64;144 #endif145 129 146 130 // For restoring the tray icon after explorer crashes … … 318 302 if (q->contextMenu()) { 319 303 q->contextMenu()->popup(gpos); 320 #if defined(Q_WS_WINCE)321 // We must ensure that the popup menu doesn't show up behind the task bar.322 QRect desktopRect = qApp->desktop()->availableGeometry();323 int maxY = desktopRect.y() + desktopRect.height() - q->contextMenu()->height();324 if (gpos.y() > maxY) {325 gpos.ry() = maxY;326 q->contextMenu()->move(gpos);327 }328 #endif329 304 q->contextMenu()->activateWindow(); 330 305 //Must be activated for proper keyboardfocus and menu closing on windows: … … 333 308 break; 334 309 335 #if !defined(Q_WS_WINCE)336 310 case NIN_BALLOONUSERCLICK: 337 311 emit q->messageClicked(); 338 312 break; 339 #endif340 313 341 314 case WM_MBUTTONUP: … … 404 377 //find the toolbar used in the notification area 405 378 if (trayHandle) { 406 #if defined(Q_OS_WINCE)407 trayHandle = FindWindow(L"TrayNotifyWnd", NULL);408 #else409 379 trayHandle = FindWindowEx(trayHandle, NULL, L"TrayNotifyWnd", NULL); 410 #endif411 380 if (trayHandle) { 412 #if defined(Q_OS_WINCE)413 HWND hwnd = FindWindow(L"SysPager", NULL);414 #else415 381 HWND hwnd = FindWindowEx(trayHandle, NULL, L"SysPager", NULL); 416 #endif417 382 if (hwnd) { 418 #if defined(Q_OS_WINCE)419 hwnd = FindWindow(L"ToolbarWindow32", NULL);420 #else421 383 hwnd = FindWindowEx(hwnd, NULL, L"ToolbarWindow32", NULL); 422 #endif423 384 if (hwnd) 424 385 trayHandle = hwnd; … … 439 400 440 401 int buttonCount = SendMessage(trayHandle, TB_BUTTONCOUNT, 0, 0); 441 #if defined(Q_OS_WINCE)442 LPVOID data = VirtualAlloc(NULL, sizeof(TBBUTTON), MEM_COMMIT, PAGE_READWRITE);443 #else444 402 LPVOID data = VirtualAllocEx(trayProcess, NULL, sizeof(TBBUTTON), MEM_COMMIT, PAGE_READWRITE); 445 #endif446 403 447 404 if ( buttonCount < 1 || !data ) { … … 481 438 } 482 439 } 483 #if defined(Q_OS_WINCE)484 VirtualFree(data, 0, MEM_RELEASE);485 #else486 440 VirtualFreeEx(trayProcess, data, 0, MEM_RELEASE); 487 #endif488 441 CloseHandle(trayProcess); 489 442 return ret; … … 559 512 void QSystemTrayIconPrivate::updateToolTip_sys() 560 513 { 561 #ifdef Q_WS_WINCE562 // Calling sys->trayMessage(NIM_MODIFY) on an existing icon is broken on Windows CE.563 // So we need to call updateIcon_sys() which creates a new icon handle.564 updateIcon_sys();565 #else566 514 if (!sys) 567 515 return; 568 516 569 517 sys->trayMessage(NIM_MODIFY); 570 #endif571 518 } 572 519 -
trunk/src/gui/util/qsystemtrayicon_x11.cpp
r651 r769 309 309 } 310 310 311 #ifndef QT_NO_WHEELEVENT 311 312 void QSystemTrayIconSys::wheelEvent(QWheelEvent *e) 312 313 { 313 314 QApplication::sendEvent(q, e); 314 315 } 316 #endif 315 317 316 318 bool QSystemTrayIconSys::event(QEvent *e) -
trunk/src/gui/util/util.pri
r561 r769 21 21 22 22 23 win32 { 23 wince* { 24 SOURCES += \ 25 util/qsystemtrayicon_wince.cpp 26 } else:win32 { 24 27 SOURCES += \ 25 28 util/qsystemtrayicon_win.cpp … … 50 53 symbian { 51 54 LIBS += -lsendas2 -letext -lapmime 52 contains(QT_CONFIG, s60): LIBS += -lplatformenv -l commonui55 contains(QT_CONFIG, s60): LIBS += -lplatformenv -lCommonUI 53 56 }
Note:
See TracChangeset
for help on using the changeset viewer.