void ULLineEditor::insertAtFirstLastGlyphFromPrevLine()
{
	PageBuffer *PB = PageBuffer::getInstance();

	if ( PB->maxId() == 0 ) //The line we are editing is the first one
		return;

	uint prevlineId;
	int curLineId;
	if ( reedit )
	{
		curLineId = reedit_id;
		prevlineId = reedit_id - 1;
	}
	else
	{
		prevlineId = PB->maxId();
		curLineId = prevlineId + 1;
	}

	slotEditGroup(m_mainScene->groupById(prevlineId));
	ULGlyphItem *it= takeLast();
	slotEditGroup(m_mainScene->groupById(curLineId));
	addGlyph(it, false);


}
Exemple #2
0
	void LayoutsConfigWidget::on_Disable__released ()
	{
		const auto& toDisableIdx = Ui_.EnabledView_->currentIndex ();
		if (!toDisableIdx.isValid ())
			return;

		auto row = EnabledModel_->takeRow (toDisableIdx.row ());
		delete row.takeLast ();

		auto pos = std::upper_bound (Util::ModelIterator (AvailableModel_, 0),
				Util::ModelIterator (AvailableModel_, AvailableModel_->rowCount ()),
				row.first ()->text (),
				[] (const QString& code, const QModelIndex& mi)
					{ return code < mi.data ().toString (); });
		AvailableModel_->insertRow (pos.GetRow (), row);
	}
void ULLineEditor::pushLastGlyphAtFirstOfNextLine()
{
	PageBuffer *PB = PageBuffer::getInstance();

	if ( !reedit ) //Last line is current
		return;
	if(reedit_id == PB->maxId())//We are the last
		return;

	uint nextlineId = reedit_id + 1;
	uint curId = reedit_id;

	ULGlyphItem *LaGlFrLi = takeLast();
	slotEditGroup(m_mainScene->groupById(nextlineId));
	addGlyph(LaGlFrLi, false);
	slotEditGroup(m_mainScene->groupById(curId));
	
	
}
	void AvatarsStorage::collectOldAvatars ()
	{
		auto list = AvatarsDir_.entryList (QDir::Files, QDir::Time | QDir::Reversed);
		while (list.size () > 4000)
			AvatarsDir_.remove (list.takeLast ());
	}
Exemple #5
0
Token *TokenStack::takeLastToken()
{
    return !isEmpty() ? takeLast().first : 0;
}