void QWinJumpListCategoryPrivate::clearRecents() { IApplicationDestinations *pDest = 0; HRESULT hresult = CoCreateInstance(qCLSID_ApplicationDestinations, 0, CLSCTX_INPROC_SERVER, qIID_IApplicationDestinations, reinterpret_cast<void **>(&pDest)); if (SUCCEEDED(hresult)) { const QString identifier = jumpList ? jumpList->identifier() : QString(); if (!identifier.isEmpty()) { wchar_t *id = qt_qstringToNullTerminated(identifier); hresult = pDest->SetAppID(id); delete[] id; } hresult = pDest->RemoveAllDestinations(); pDest->Release(); } if (FAILED(hresult)) QWinJumpListPrivate::warning("clearRecents", hresult); }
// @pymethod |PyIApplicationDestinations|SetAppID|Specifies the application whose jump list is to be accessed // @comm This method is only needed if the application sets its own taskbar identifier PyObject *PyIApplicationDestinations::SetAppID(PyObject *self, PyObject *args) { IApplicationDestinations *pIAD = GetI(self); if ( pIAD == NULL ) return NULL; // @pyparm str|AppID||Taskbar identifier for the application PyObject *obappid; TmpWCHAR appid; if ( !PyArg_ParseTuple(args, "O:SetAppID", &obappid) ) return NULL; if (!PyWinObject_AsWCHAR(obappid, &appid, FALSE)) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIAD->SetAppID(appid); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIAD, IID_IApplicationDestinations); Py_INCREF(Py_None); return Py_None; }