Ignore:
Timestamp:
May 5, 2011, 5:36:53 AM (14 years ago)
Author:
Dmitry A. Kuminov
Message:

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

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

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

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    4242#include <qsettings.h>
    4343#include <qdir.h>
    44 #include <qlibrary.h>
     44#include <private/qsystemlibrary_p.h>
    4545#include <qurl.h>
    4646#include <qstringlist.h>
     
    6060#endif
    6161
    62 #if defined(Q_CC_MINGW) && !defined(CSIDL_MYMUSIC)
     62#ifndef CSIDL_MYMUSIC
    6363#define CSIDL_MYMUSIC   13
    6464#define CSIDL_MYVIDEO   14
     
    9898        //Retrieve the commandline for the default mail client
    9999        //the default key used below is the command line for the mailto: shell command
    100         DWORD  bufferSize = 2 * MAX_PATH;
     100        DWORD  bufferSize = sizeof(wchar_t) * MAX_PATH;
    101101        long  returnValue =  -1;
    102102        QString command;
     
    104104        HKEY handle;
    105105        LONG res;
    106         wchar_t keyValue[2 * MAX_PATH] = {0};
     106        wchar_t keyValue[MAX_PATH] = {0};
    107107        QString keyName(QLatin1String("mailto"));
    108108
    109109        //Check if user has set preference, otherwise use default.
    110         res = RegOpenKeyExW(HKEY_CURRENT_USER,
    111                             L"Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\mailto\\UserChoice",
    112                             0, KEY_READ, &handle);
     110        res = RegOpenKeyEx(HKEY_CURRENT_USER,
     111                           L"Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\mailto\\UserChoice",
     112                           0, KEY_READ, &handle);
    113113        if (res == ERROR_SUCCESS) {
    114114            returnValue = RegQueryValueEx(handle, L"Progid", 0, 0, reinterpret_cast<unsigned char*>(keyValue), &bufferSize);
     
    122122            return false;
    123123
    124         bufferSize = 2 * MAX_PATH;
    125         returnValue = RegQueryValueExW(handle, L"", 0, 0, reinterpret_cast<unsigned char*>(keyValue), &bufferSize);
     124        bufferSize = sizeof(wchar_t) * MAX_PATH;
     125        returnValue = RegQueryValueEx(handle, L"", 0, 0, reinterpret_cast<unsigned char*>(keyValue), &bufferSize);
    126126        if (!returnValue)
    127127            command = QString::fromRawData((QChar*)keyValue, bufferSize);
     
    178178
    179179#ifndef Q_OS_WINCE
    180         QLibrary library(QLatin1String("shell32"));
    181 #else
    182         QLibrary library(QLatin1String("coredll"));
     180        QSystemLibrary library(QLatin1String("shell32"));
     181#else
     182        QSystemLibrary library(QLatin1String("coredll"));
    183183#endif // Q_OS_WINCE
    184184    typedef BOOL (WINAPI*GetSpecialFolderPath)(HWND, LPWSTR, int, BOOL);
Note: See TracChangeset for help on using the changeset viewer.