Changeset 769 for trunk/src/gui/util


Ignore:
Timestamp:
Aug 2, 2010, 9:27:30 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.3 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
8 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/gui/util/qcompleter.cpp

    r651 r769  
    528528    cost = cost + m.indices.cost() - old.indices.cost();
    529529    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()) {
    532532            CacheItem& ci = it1.value();
    533533            int sz = ci.count()/2;
    534534            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) {
    536537                cost -= it2.value().indices.cost();
    537                 ci.erase(it2);
     538                it2 = ci.erase(it2);
     539                i++;
    538540            }
    539             if (ci.count() == 0)
    540                 cache.erase(it1);
     541            if (ci.count() == 0) {
     542              it1 = cache.erase(it1);
     543            } else {
     544              ++it1;
     545            }
    541546        }
    542547    }
     
    17491754    This signal is sent when an item in the popup() is highlighted by
    17501755    the user. It is also sent if complete() is called with the completionMode()
    1751     set to QCOmpleter::InlineCompletion. The item's \a text is given.
     1756    set to QCompleter::InlineCompletion. The item's \a text is given.
    17521757*/
    17531758
  • trunk/src/gui/util/qdesktopservices_s60.cpp

    r651 r769  
    4949#include <private/qcore_symbian_p.h>
    5050
    51 #include <miutset.h>                // KUidMsgTypeSMTP
    5251#include <txtrich.h>                // CRichText
    5352#include <f32file.h>                // TDriveUnit etc
     
    5857#include <rsendasmessage.h>         // RSendAsMessage
    5958
     59// copied from miutset.h, so we don't get a dependency into the app layer
     60const TUid KUidMsgTypeSMTP                      = {0x10001028}; // 268439592
     61
    6062#ifdef Q_WS_S60
    6163#  include <pathinfo.h>             // PathInfo
    6264#  ifdef USE_DOCUMENTHANDLER
    63 #    include <documenthandler.h>    // CDocumentHandler
    64 #    include <aknserverapp.h>
     65#    include <DocumentHandler.h>    // CDocumentHandler
     66#    include <AknServerApp.h>
    6567#  endif
    6668#else
  • trunk/src/gui/util/qsystemtrayicon_mac.mm

    r651 r769  
    531531            const QIcon icon = action->icon();
    532532            if(!icon.isNull()) {
     533#ifndef QT_MAC_USE_COCOA
     534                const short scale = GetMBarHeight();
     535#else
    533536                const short scale = [[NSApp mainMenu] menuBarHeight];
     537#endif
    534538                NSImage *nsimage = static_cast<NSImage *>(qt_mac_create_nsimage(icon.pixmap(QSize(scale, scale))));
    535539                [item setImage: nsimage];
     
    570574@end
    571575
    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  
    165165    void mousePressEvent(QMouseEvent *event);
    166166    void mouseDoubleClickEvent(QMouseEvent *event);
     167#ifndef QT_NO_WHEELEVENT
    167168    void wheelEvent(QWheelEvent *event);
     169#endif
    168170    bool event(QEvent *e);
    169171
  • trunk/src/gui/util/qsystemtrayicon_win.cpp

    r651 r769  
    6262#include <QSettings>
    6363
    64 #if defined(Q_WS_WINCE) && !defined(STANDARDSHELL_UI_MODEL)
    65 #   include <streams.h>
    66 #endif
    67 
    6864QT_BEGIN_NAMESPACE
    6965
    70 #if defined(Q_WS_WINCE)
    71 static const UINT q_uNOTIFYICONID = 13;     // IDs from 0 to 12 are reserved on WinCE.
    72 #else
    7366static const UINT q_uNOTIFYICONID = 0;
    74 #endif
    7567
    7668static uint MYWM_TASKBARCREATED = 0;
     
    126118bool QSystemTrayIconSys::supportsMessages()
    127119{
    128 #ifndef Q_OS_WINCE
    129120    return allowsMessages();
    130 #endif
    131     return false;
    132121}
    133122
     
    136125
    137126{
    138 #ifndef Q_OS_WINCE
    139127    notifyIconSize = FIELD_OFFSET(NOTIFYICONDATA, guidItem); // NOTIFYICONDATAW_V2_SIZE;
    140128    maxTipLength = 128;
    141 #else
    142     notifyIconSize = FIELD_OFFSET(NOTIFYICONDATA, szTip[64]); // NOTIFYICONDATAW_V1_SIZE;
    143     maxTipLength = 64;
    144 #endif
    145129
    146130    // For restoring the tray icon after explorer crashes
     
    318302                if (q->contextMenu()) {
    319303                    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 #endif
    329304                    q->contextMenu()->activateWindow();
    330305                    //Must be activated for proper keyboardfocus and menu closing on windows:
     
    333308                break;
    334309
    335 #if !defined(Q_WS_WINCE)
    336310            case NIN_BALLOONUSERCLICK:
    337311                emit q->messageClicked();
    338312                break;
    339 #endif
    340313
    341314            case WM_MBUTTONUP:
     
    404377    //find the toolbar used in the notification area
    405378    if (trayHandle) {
    406 #if defined(Q_OS_WINCE)
    407         trayHandle = FindWindow(L"TrayNotifyWnd", NULL);
    408 #else
    409379        trayHandle = FindWindowEx(trayHandle, NULL, L"TrayNotifyWnd", NULL);
    410 #endif
    411380        if (trayHandle) {
    412 #if defined(Q_OS_WINCE)
    413             HWND hwnd = FindWindow(L"SysPager", NULL);
    414 #else
    415381            HWND hwnd = FindWindowEx(trayHandle, NULL, L"SysPager", NULL);
    416 #endif
    417382            if (hwnd) {
    418 #if defined(Q_OS_WINCE)
    419                 hwnd = FindWindow(L"ToolbarWindow32", NULL);
    420 #else
    421383                hwnd = FindWindowEx(hwnd, NULL, L"ToolbarWindow32", NULL);
    422 #endif
    423384                if (hwnd)
    424385                    trayHandle = hwnd;
     
    439400
    440401    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 #else
    444402    LPVOID data = VirtualAllocEx(trayProcess, NULL, sizeof(TBBUTTON), MEM_COMMIT, PAGE_READWRITE);
    445 #endif
    446403
    447404    if ( buttonCount < 1 || !data ) {
     
    481438        }
    482439    }
    483 #if defined(Q_OS_WINCE)
    484     VirtualFree(data, 0, MEM_RELEASE);
    485 #else
    486440    VirtualFreeEx(trayProcess, data, 0, MEM_RELEASE);
    487 #endif
    488441    CloseHandle(trayProcess);
    489442    return ret;
     
    559512void QSystemTrayIconPrivate::updateToolTip_sys()
    560513{
    561 #ifdef Q_WS_WINCE
    562     // 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 #else
    566514    if (!sys)
    567515        return;
    568516
    569517    sys->trayMessage(NIM_MODIFY);
    570 #endif
    571518}
    572519
  • trunk/src/gui/util/qsystemtrayicon_x11.cpp

    r651 r769  
    309309}
    310310
     311#ifndef QT_NO_WHEELEVENT
    311312void QSystemTrayIconSys::wheelEvent(QWheelEvent *e)
    312313{
    313314    QApplication::sendEvent(q, e);
    314315}
     316#endif
    315317
    316318bool QSystemTrayIconSys::event(QEvent *e)
  • trunk/src/gui/util/util.pri

    r561 r769  
    2121
    2222
    23 win32 {
     23wince* {
     24                SOURCES += \
     25                                util/qsystemtrayicon_wince.cpp
     26} else:win32 {
    2427                SOURCES += \
    2528                                util/qsystemtrayicon_win.cpp
     
    5053symbian {
    5154    LIBS += -lsendas2 -letext -lapmime
    52     contains(QT_CONFIG, s60): LIBS += -lplatformenv -lcommonui
     55    contains(QT_CONFIG, s60): LIBS += -lplatformenv -lCommonUI
    5356}
Note: See TracChangeset for help on using the changeset viewer.