// @pymethod |PyIApplicationDestinations|RemoveAllDestinations|Removes all Recent and Frequent jump list entries PyObject *PyIApplicationDestinations::RemoveAllDestinations(PyObject *self, PyObject *args) { IApplicationDestinations *pIAD = GetI(self); if ( pIAD == NULL ) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIAD->RemoveAllDestinations( ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIAD, IID_IApplicationDestinations ); Py_INCREF(Py_None); return Py_None; }
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; }
// @pymethod |PyIApplicationDestinations|RemoveDestination|Removes a single entry from the jump lists // @comm Does not remove pinned items PyObject *PyIApplicationDestinations::RemoveDestination(PyObject *self, PyObject *args) { IApplicationDestinations *pIAD = GetI(self); if ( pIAD == NULL ) return NULL; IUnknown *punk; PyObject *obpunk; // @pyparm <o PyIUnknown>|punk||IShellItem or IShellLink representing an item in the application's jump list if ( !PyArg_ParseTuple(args, "O:RemoveDestination", &obpunk)) return NULL; if (!PyCom_InterfaceFromPyObject(obpunk, IID_IUnknown, (void **)&punk, FALSE)) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIAD->RemoveDestination( punk ); punk->Release(); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIAD, IID_IApplicationDestinations ); Py_INCREF(Py_None); return Py_None; }