示例#1
0
	void Core::handleAddToFavorites (QString title, QString url)
	{
		Util::DefaultHookProxy_ptr proxy = Util::DefaultHookProxy_ptr (new Util::DefaultHookProxy ());
		emit hookAddToFavoritesRequested (proxy, title, url);
		if (proxy->IsCancelled ())
			return;
		
		proxy->FillValue ("title", title);
		proxy->FillValue ("url", url);

		std::auto_ptr<AddToFavoritesDialog> dia (new AddToFavoritesDialog (title,
					url,
					qApp->activeWindow ()));

		bool result = false;
		do
		{
			if (dia->exec () == QDialog::Rejected)
				return;

			result = FavoritesModel_->addItem (dia->GetTitle (),
					url, dia->GetTags ());
		}
		while (!result);
	}
示例#2
0
void Core::handleAddToFavorites (QString title, QString url)
{
    Util::DefaultHookProxy_ptr proxy = Util::DefaultHookProxy_ptr (new Util::DefaultHookProxy ());
    emit hookAddToFavoritesRequested (proxy, title, url);
    if (proxy->IsCancelled ())
        return;

    proxy->FillValue ("title", title);
    proxy->FillValue ("url", url);

    bool oneClick = XmlSettingsManager::Instance ()->property ("BookmarkInOneClick").toBool ();

    const auto& index = FavoritesModel_->addItem (title, url, QStringList ());

    if (!oneClick)
        FavoritesModel_->EditBookmark (index);

    emit bookmarkAdded (url);
}