diff options
Diffstat (limited to 'src/winextras/qwinjumplist.cpp')
-rw-r--r-- | src/winextras/qwinjumplist.cpp | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/src/winextras/qwinjumplist.cpp b/src/winextras/qwinjumplist.cpp index ca1b20a..92b3ccc 100644 --- a/src/winextras/qwinjumplist.cpp +++ b/src/winextras/qwinjumplist.cpp @@ -159,11 +159,11 @@ void QWinJumpListPrivate::_q_rebuild() void QWinJumpListPrivate::destroy() { delete recent; - recent = 0; + recent = nullptr; delete frequent; - frequent = 0; + frequent = nullptr; delete tasks; - tasks = 0; + tasks = nullptr; qDeleteAll(categories); categories.clear(); invalidate(); @@ -179,7 +179,7 @@ bool QWinJumpListPrivate::beginList() } if (SUCCEEDED(hresult)) { UINT maxSlots = 0; - IUnknown *array = 0; + IUnknown *array = nullptr; hresult = pDestList->BeginList(&maxSlots, qIID_IUnknown, reinterpret_cast<void **>(&array)); if (array) array->Release(); @@ -234,15 +234,15 @@ QList<QWinJumpListItem *> QWinJumpListPrivate::fromComCollection(IObjectArray *a UINT count = 0; array->GetCount(&count); for (UINT i = 0; i < count; ++i) { - IUnknown *collectionItem = 0; + IUnknown *collectionItem = nullptr; HRESULT hresult = array->GetAt(i, qIID_IUnknown, reinterpret_cast<void **>(&collectionItem)); if (FAILED(hresult)) { QWinJumpListPrivate::warning("GetAt", hresult); continue; } - IShellItem2 *shellItem = 0; - IShellLinkW *shellLink = 0; - QWinJumpListItem *jumplistItem = 0; + IShellItem2 *shellItem = nullptr; + IShellLinkW *shellLink = nullptr; + QWinJumpListItem *jumplistItem = nullptr; if (SUCCEEDED(collectionItem->QueryInterface(qIID_IShellItem2, reinterpret_cast<void **>(&shellItem)))) { jumplistItem = fromIShellItem(shellItem); shellItem->Release(); @@ -262,12 +262,12 @@ QList<QWinJumpListItem *> QWinJumpListPrivate::fromComCollection(IObjectArray *a IObjectCollection *QWinJumpListPrivate::toComCollection(const QList<QWinJumpListItem *> &list) { if (list.isEmpty()) - return 0; - IObjectCollection *collection = 0; - HRESULT hresult = CoCreateInstance(qCLSID_EnumerableObjectCollection, 0, CLSCTX_INPROC_SERVER, qIID_IObjectCollection, reinterpret_cast<void **>(&collection)); + return nullptr; + IObjectCollection *collection = nullptr; + HRESULT hresult = CoCreateInstance(qCLSID_EnumerableObjectCollection, nullptr, CLSCTX_INPROC_SERVER, qIID_IObjectCollection, reinterpret_cast<void **>(&collection)); if (FAILED(hresult)) { QWinJumpListPrivate::warning("QWinJumpList: failed to instantiate IObjectCollection", hresult); - return 0; + return nullptr; } for (QWinJumpListItem *item : list) { IUnknown *iitem = toICustomDestinationListItem(item); @@ -327,17 +327,17 @@ IUnknown *QWinJumpListPrivate::toICustomDestinationListItem(const QWinJumpListIt case QWinJumpListItem::Separator : return makeSeparatorShellItem(); default: - return 0; + return nullptr; } } IShellLinkW *QWinJumpListPrivate::toIShellLink(const QWinJumpListItem *item) { - IShellLinkW *link = 0; - HRESULT hresult = CoCreateInstance(CLSID_ShellLink, 0, CLSCTX_INPROC_SERVER, qIID_IShellLinkW, reinterpret_cast<void **>(&link)); + IShellLinkW *link = nullptr; + HRESULT hresult = CoCreateInstance(CLSID_ShellLink, nullptr, CLSCTX_INPROC_SERVER, qIID_IShellLinkW, reinterpret_cast<void **>(&link)); if (FAILED(hresult)) { QWinJumpListPrivate::warning("QWinJumpList: failed to instantiate IShellLinkW", hresult); - return 0; + return nullptr; } const QString args = createArguments(item->arguments()); @@ -380,7 +380,7 @@ IShellLinkW *QWinJumpListPrivate::toIShellLink(const QWinJumpListItem *item) hresult = link->QueryInterface(qIID_IPropertyStore, reinterpret_cast<void **>(&properties)); if (FAILED(hresult)) { link->Release(); - return 0; + return nullptr; } qt_qstringToNullTerminated(item->title(), buffer); @@ -396,24 +396,24 @@ IShellLinkW *QWinJumpListPrivate::toIShellLink(const QWinJumpListItem *item) IShellItem2 *QWinJumpListPrivate::toIShellItem(const QWinJumpListItem *item) { - IShellItem2 *shellitem = 0; + IShellItem2 *shellitem = nullptr; QScopedArrayPointer<wchar_t> buffer(qt_qstringToNullTerminated(item->filePath())); - SHCreateItemFromParsingName(buffer.data(), 0, qIID_IShellItem2, reinterpret_cast<void **>(&shellitem)); + SHCreateItemFromParsingName(buffer.data(), nullptr, qIID_IShellItem2, reinterpret_cast<void **>(&shellitem)); return shellitem; } IShellLinkW *QWinJumpListPrivate::makeSeparatorShellItem() { IShellLinkW *separator; - HRESULT res = CoCreateInstance(CLSID_ShellLink, 0, CLSCTX_INPROC_SERVER, qIID_IShellLinkW, reinterpret_cast<void **>(&separator)); + HRESULT res = CoCreateInstance(CLSID_ShellLink, nullptr, CLSCTX_INPROC_SERVER, qIID_IShellLinkW, reinterpret_cast<void **>(&separator)); if (FAILED(res)) - return 0; + return nullptr; IPropertyStore *properties; res = separator->QueryInterface(qIID_IPropertyStore, reinterpret_cast<void **>(&properties)); if (FAILED(res)) { separator->Release(); - return 0; + return nullptr; } PROPVARIANT isSeparator; @@ -434,7 +434,7 @@ QWinJumpList::QWinJumpList(QObject *parent) : { Q_D(QWinJumpList); d->q_ptr = this; - HRESULT hresult = CoCreateInstance(qCLSID_DestinationList, 0, CLSCTX_INPROC_SERVER, qIID_ICustomDestinationList, reinterpret_cast<void **>(&d_ptr->pDestList)); + HRESULT hresult = CoCreateInstance(qCLSID_DestinationList, nullptr, CLSCTX_INPROC_SERVER, qIID_ICustomDestinationList, reinterpret_cast<void **>(&d_ptr->pDestList)); if (FAILED(hresult)) QWinJumpListPrivate::warning("CoCreateInstance", hresult); d->invalidate(); @@ -450,7 +450,7 @@ QWinJumpList::~QWinJumpList() d->_q_rebuild(); if (d->pDestList) { d->pDestList->Release(); - d->pDestList = 0; + d->pDestList = nullptr; } d->destroy(); } |