void FGameplayTagContainer::RemoveTags(FGameplayTagContainer TagsToRemove)
{
	SCOPE_CYCLE_COUNTER(STAT_FGameplayTagContainer_RemoveTags);

	for (auto Tag : TagsToRemove)
	{
		RemoveTag(Tag);
	}
}
	void LevelInitPostEntity()
	{
		if ( GameRules()->GetGameMode() == GAMEMODE_CLASSIC && 
				lf_reverse_flags.GetBool() )
		{
			AddTag( REVERSE_CTF_TAG );
		}
		else
		{
			RemoveTag( REVERSE_CTF_TAG );
		}
	}
Exemplo n.º 3
0
void cMenuFileBrowserBase::FlagAllTaggedFiles(bool onlyXinePlayable)
{
   for (int i = 0; i < Count(); i++)
    {
        cMenuBrowserItem *item = GetItem(i);
        if(item->IsFile() && IsTagged(item) &&
	(!onlyXinePlayable || static_cast<cMenuFileItem *>(item)->IsXinePlayable()))
        {
	    RemoveTag(item, false);
            FlagItem(item, false);
        }
    } 
}  
bool FGameplayTagContainer::RemoveTagByExplicitName(const FName& TagName)
{
	SCOPE_CYCLE_COUNTER(STAT_FGameplayTagContainer_RemoveTagByExplicitName);

	for (auto GameplayTag : this->GameplayTags)
	{
		if (GameplayTag.GetTagName() == TagName)
		{
			RemoveTag(GameplayTag);
			return true;
		}
	}

	return false;
}
Exemplo n.º 5
0
void cMenuFileBrowserBase::ClearTags(bool next)
{
    while(!taggedEntries_.empty())
    {
        cMenuBrowserItem *item = GetItem(*taggedEntries_.begin());
        /* TB: after renaming the item has changed and is NULL */
        if(item)
        {
            SetCurrent(Get(GetItemPos(*taggedEntries_.begin())));
            RemoveTag(item, next);
        }
	else
	    break;
    }
    taggedEntries_.clear();
}
Exemplo n.º 6
0
void cMenuFileBrowserBase::TagUntagCurrentItem()
{
    cMenuBrowserItem *item = GetCurrentItem();
    if (item && (item->IsFile() || item->IsDir()))
    {
        if(!IsTagged(GetCurrentItem()))
        {
            //select line
            TagItem(GetCurrentItem());
        }
        else
        {
            //deselect line
            RemoveTag(GetCurrentItem());
        }
        Display();
     }
} 
/*
*	Copy string with removing Escape chars from text
*   And BBcodes
*/
static int CopySkipUnprintableChars(TCHAR *to, TCHAR * buf, DWORD size)
{
	DWORD i;
	BOOL keep = 0;
	TCHAR * cp = to;
	if (!to) return 0;
	if (!buf) {
		to[0] = '\0';
		return 0;
	}

	for (i = 0; i < size; i++) {
		if (buf[i] == 0) break;
		if (buf[i] > 0 && buf[i] < ' ') {
			*cp = ' ';
			if (!keep) cp++;
			keep = 1;
		}
		else {
			keep = 0;
			*cp = buf[i];
			cp++;
		}
	}
	*cp = 0;

	//remove bbcodes: [b] [i] [u]  <b> <i> <u>
	RemoveTag(to, _T("[b]")); RemoveTag(to, _T("[/b]"));
	RemoveTag(to, _T("[u]")); RemoveTag(to, _T("[/u]"));
	RemoveTag(to, _T("[i]")); RemoveTag(to, _T("[/i]"));

	RemoveTag(to, _T("<b>")); RemoveTag(to, _T("</b>"));
	RemoveTag(to, _T("<u>")); RemoveTag(to, _T("</u>"));
	RemoveTag(to, _T("<i>")); RemoveTag(to, _T("</i>"));

	RemoveTag(to, _T("[B]")); RemoveTag(to, _T("[/b]"));
	RemoveTag(to, _T("[U]")); RemoveTag(to, _T("[/u]"));
	RemoveTag(to, _T("[I]")); RemoveTag(to, _T("[/i]"));

	RemoveTag(to, _T("<B>")); RemoveTag(to, _T("</B>"));
	RemoveTag(to, _T("<U>")); RemoveTag(to, _T("</U>"));
	RemoveTag(to, _T("<I>")); RemoveTag(to, _T("</I>"));
	return i;
}
Exemplo n.º 8
0
	QVariant ItemsListModel::data (const QModelIndex& index, int role) const
	{
		if (!index.isValid () || index.row () >= rowCount ())
			return QVariant ();

		if (role == Qt::DisplayRole)
		{
			switch (index.column ())
			{
				case 0:
					{
						auto title = CurrentItems_ [index.row ()].Title_;
						auto pos = 0;
						while ((pos = title.indexOf ('<', pos)) != -1)
						{
							auto end = title.indexOf ('>', pos);
							if (end > 0)
								title.remove (pos, end - pos + 1);
							else
								break;
						}

						title.replace ("&laquo;", QString::fromUtf8 ("«"));
						title.replace ("&raquo;", QString::fromUtf8 ("»"));
						title.replace ("&quot;", "\"");
						title.replace ("&ndash;", "-");
						title.replace ("&mdash;", QString::fromUtf8 ("—"));

						return title;
					}
				case 1:
					return CurrentItems_ [index.row ()].PubDate_;
				default:
					return QVariant ();
			}
		}
		//Color mark an items as read/unread
		else if (role == Qt::ForegroundRole)
		{
			bool palette = XmlSettingsManager::Instance ()->
					property ("UsePaletteColors").toBool ();
			if (CurrentItems_ [index.row ()].Unread_)
			{
				if (XmlSettingsManager::Instance ()->
						property ("UnreadCustomColor").toBool ())
					return XmlSettingsManager::Instance ()->
							property ("UnreadItemsColor").value<QColor> ();
				else
					return palette ?
						QApplication::palette ().link ().color () :
						QVariant ();
			}
			else
				return palette ?
					QApplication::palette ().linkVisited ().color () :
					QVariant ();
		}
		else if (role == Qt::FontRole &&
				CurrentItems_ [index.row ()].Unread_)
			return XmlSettingsManager::Instance ()->
				property ("UnreadItemsFont");
		else if (role == Qt::ToolTipRole &&
				XmlSettingsManager::Instance ()->property ("ShowItemsTooltips").toBool ())
		{
			IDType_t id = CurrentItems_ [index.row ()].ItemID_;
			Item_ptr item = Core::Instance ()
					.GetStorageBackend ()->GetItem (id);
			QString result = QString ("<qt><strong>%1</strong><br />").arg (item->Title_);
			if (item->Author_.size ())
			{
				result += tr ("<b>Author</b>: %1").arg (item->Author_);
				result += "<br />";
			}
			if (item->Categories_.size ())
			{
				result += tr ("<b>Categories</b>: %1").arg (item->Categories_.join ("; "));
				result += "<br />";
			}
			if (item->NumComments_ > 0)
			{
				result += tr ("%n comment(s)", "", item->NumComments_);
				result += "<br />";
			}
			if (item->Enclosures_.size () > 0)
			{
				result += tr ("%n enclosure(s)", "", item->Enclosures_.size ());
				result += "<br />";
			}
			if (item->MRSSEntries_.size () > 0)
			{
				result += tr ("%n MediaRSS entry(s)", "", item->MRSSEntries_.size ());
				result += "<br />";
			}
			if (item->CommentsLink_.size ())
			{
				result += tr ("RSS with comments is available");
				result += "<br />";
			}
			result += "<br />";

			const int maxDescriptionSize = 1000;
			auto descr = item->Description_;
			RemoveTag ("img", descr);
			result += descr.left (maxDescriptionSize);
			if (descr.size () > maxDescriptionSize)
				result += "...";

			return result;
		}
		else if (role == Qt::BackgroundRole)
		{
			const QPalette& p = QApplication::palette ();
			QLinearGradient grad (0, 0, 0, 10);
			grad.setColorAt (0, p.color (QPalette::AlternateBase));
			grad.setColorAt (1, p.color (QPalette::Base));
			return QBrush (grad);
		}
		else
			return QVariant ();
	}
Exemplo n.º 9
0
NBT_Reader::~NBT_Reader()
{
	while (RemoveTag());
	if (data)
		delete[] data;
}
Exemplo n.º 10
0
// Read next tag in data stream
NBTTag NBT_Reader::ReadData()
{
	if (!data)
		return TAG_Unknown;
	// Remove non-list tags and empty lists
	if (!tags.empty())
	{
		NBTData * last = GetData();
		if (last->tag <= TAG_String)
			RemoveTag();
		last = GetData();
		if (last->tag == TAG_List && last->size <= 0)
			RemoveTag();
	}
	
	// Check for list
	NBTData * last = GetData();
	bool isList = last && last->tag == TAG_List;
	
	NBTData * tagdata = CreateTag();
	
	if (isList)
	{
		--last->size;
		tagdata->tag = last->list;
	}
	else
	{
		BYTE type = 0;
		// Get type
		ReadByte(&type);
		tagdata->tag = (NBTTag)type;
		// Get name
		if (tagdata->tag != TAG_End)
			ReadString(&tagdata->name);
	}
	
	// Read tag
	switch (tagdata->tag)
	{
		case TAG_End:
			RemoveTag();
			RemoveTag();
			if (tags.empty())
				return TAG_Unknown;
			return TAG_End;
			break;
		case TAG_Byte:
			tagdata->size = ReadByte(&tagdata->b);
			break;
		case TAG_Short:
			tagdata->size = ReadShort(&tagdata->s);
			break;
		case TAG_Int:
			tagdata->size = ReadInt(&tagdata->i);
			break;
		case TAG_Long:
			tagdata->size = ReadLong(&tagdata->l);
			break;
		case TAG_Float:
			tagdata->size = ReadFloat(&tagdata->f);
			break;
		case TAG_Double:
			tagdata->size = ReadDouble(&tagdata->d);
			break;
		case TAG_ByteArray:
			tagdata->size = ReadByteArray(&tagdata->bas);
			break;
		case TAG_String:
			tagdata->size = ReadString(&tagdata->bas);
			break;
		case TAG_List:
			tagdata->size = ReadList(&tagdata->list);
			break;
		case TAG_Compound:
			ReadCompound();
			break;
	}
	return tagdata->tag;
}