AllocatedPath AllocatedPath::Build(const_pointer a, const_pointer b) { size_t a_length = StringLength(a); size_t b_length = StringLength(b); auto result = new char_type[a_length + 1 + b_length + 1]; auto p = std::copy_n(a, a_length, result); *p++ = DIR_SEPARATOR; p = std::copy_n(b, b_length, p); *p = SENTINEL; return Donate(result); }
void SomaFMServiceBase::ShowContextMenu(const QPoint& global_pos) { if (!context_menu_) { context_menu_ = new QMenu; context_menu_->addActions(GetPlaylistActions()); context_menu_->addAction(IconLoader::Load("download"), tr("Open %1 in browser").arg(homepage_url_.host()), this, SLOT(Homepage())); if (!donate_page_url_.isEmpty()) { context_menu_->addAction(IconLoader::Load("download"), tr("Donate"), this, SLOT(Donate())); } context_menu_->addAction(IconLoader::Load("view-refresh"), tr("Refresh channels"), this, SLOT(ForceRefreshStreams())); } context_menu_->popup(global_pos); }