wxTaskBarJumpListCategory& wxTaskBarJumpListImpl::GetTasks() { if ( m_tasks.get() == NULL ) m_tasks.reset(new wxTaskBarJumpListCategory(m_jumpList, wxT("Tasks"))); return *(m_tasks.get()); }
const wxTaskBarJumpListCategory& wxTaskBarJumpListImpl::GetRecentCategory() { wxString title = wxT("Recent"); if ( m_recent.get() == NULL ) m_recent.reset(new wxTaskBarJumpListCategory(m_jumpList, title)); LoadKnownCategory(title); return *m_recent.get(); }
wxMenu::~wxMenu() { #if wxOSX_USE_CARBON // when destroying the empty menu bar from the static scoped ptr // the peer destructor removes an association from an already deleted // hashmap leading to crashes. The guard avoids this, accepting some leaks... static bool finalmenubar = false; if ( this == gs_emptyMenuBar.get() ) finalmenubar = true; if ( !finalmenubar ) #endif delete m_peer; }
void SocketTestCase::UrlTest() { if ( gs_serverHost.empty() ) return; SocketTestEventLoop loop(ms_useLoop); wxURL url("http://" + gs_serverHost); const wxScopedPtr<wxInputStream> in(url.GetInputStream()); CPPUNIT_ASSERT( in.get() ); wxStringOutputStream out; CPPUNIT_ASSERT_EQUAL( wxSTREAM_EOF, in->Read(out).GetLastError() ); }
void wxTaskBarJumpListImpl::AddTasksToDestinationList() { if ( !m_tasks.get() ) return; wxCOMPtr<IObjectCollection> collection(CreateObjectCollection()); if ( !collection ) return; const wxTaskBarJumpListItems& tasks = m_tasks->GetItems(); for ( wxTaskBarJumpListItems::const_iterator it = tasks.begin(); it != tasks.end(); ++it ) { wxASSERT_MSG( ((*it)->GetType() == wxTASKBAR_JUMP_LIST_TASK || (*it)->GetType() == wxTASKBAR_JUMP_LIST_SEPARATOR), "Invalid task Item." ); AddShellLink(collection, *(*it)); } m_destinationList->AddUserTasks(collection); }