示例#1
0
	void VkAccount::RemoveEntry (QObject *entryObj)
	{
		auto entry = qobject_cast<VkEntry*> (entryObj);
		if (!entry)
		{
			qWarning () << Q_FUNC_INFO
					<< entry
					<< "is not a VkEntry";
			return;
		}

		if (entry->IsNonRoster ())
		{
			emit removedCLItems ({ entry });

			const auto id = entry->GetInfo ().ID_;
			Entries_.remove (id);
			entry->deleteLater ();

			NonRosterItems_.removeOne (id);
			Conn_->SetNRIList (NonRosterItems_);

			return;
		}
	}
示例#2
0
	void GlooxAccount::handleEntryRemoved (QObject *entry)
	{
		emit removedCLItems ({ entry });

		if (ExistingEntry2JoinConflict_.contains (entry))
		{
			const auto& pair = ExistingEntry2JoinConflict_.take (entry);
			JoinRoom (pair.first, pair.second);
		}
	}
示例#3
0
void VkAccount::finishOffline ()
{
    SelfEntry_ = nullptr;

    emit removedCLItems (GetCLEntries ());
    qDeleteAll (Entries_);
    Entries_.clear ();

    qDeleteAll (ChatEntries_);
    ChatEntries_.clear ();
}
示例#4
0
	Xep0313ModelManager::Xep0313ModelManager (GlooxAccount *acc)
	: QObject { acc }
	, Model_ { new QStandardItemModel { this } }
	{
		Model_->setHorizontalHeaderLabels ({ tr ("Entry name"), tr ("JID") });

		connect (acc,
				SIGNAL (gotCLItems (QList<QObject*>)),
				this,
				SLOT (handleGotCLItems (QList<QObject*>)));
		connect (acc,
				SIGNAL (removedCLItems (QList<QObject*>)),
				this,
				SLOT (handleRemovedCLItems (QList<QObject*>)));
	}
示例#5
0
	void RosterSaver::handleAccount (QObject *account)
	{
		connect (account,
				SIGNAL (gotCLItems (QList<QObject*>)),
				this,
				SLOT (checkItemsInvalidation (QList<QObject*>)));
		connect (account,
				SIGNAL (removedCLItems (QList<QObject*>)),
				this,
				SLOT (checkItemsInvalidation (QList<QObject*>)));
		connect (account,
				SIGNAL (rosterSaveRequested ()),
				this,
				SLOT (scheduleSaveRoster ()));
	}
示例#6
0
	void MRIMAccount::DenyAuth (QObject *obj)
	{
		qDebug () << Q_FUNC_INFO << GetAccountName ();
		MRIMBuddy *buddy = qobject_cast<MRIMBuddy*> (obj);
		if (!buddy)
		{
			qWarning () << Q_FUNC_INFO
					<< "wrong object"
					<< obj;
			return;
		}

		emit removedCLItems (QList<QObject*> () << buddy);
		Buddies_.value (buddy->GetHumanReadableID (), buddy)->deleteLater ();
		Buddies_.remove (buddy->GetHumanReadableID ());
	}
	void MSNAccount::handleRemovedBuddy (const QString& cid, const QString& pass)
	{
		Entries_.remove (pass);
		auto buddy = CID2Entry_.take (cid);
		if (!buddy)
		{
			qWarning () << Q_FUNC_INFO
					<< "unknown buddy"
					<< cid
					<< pass;
			return;
		}

		emit removedCLItems (QList<QObject*> () << buddy);

		buddy->deleteLater ();
	}
示例#8
0
	void MetaEntry::ConnectStandardSignals (QObject *entryObj)
	{
		connect (entryObj,
				SIGNAL (gotMessage (QObject*)),
				this,
				SLOT (handleRealGotMessage (QObject*)));
		connect (entryObj,
				SIGNAL (statusChanged (const EntryStatus&, const QString&)),
				this,
				SLOT (handleRealStatusChanged (const EntryStatus&, const QString&)));
		connect (entryObj,
				SIGNAL (availableVariantsChanged (const QStringList&)),
				this,
				SLOT (handleRealVariantsChanged (const QStringList&)));
		connect (entryObj,
				SIGNAL (nameChanged (const QString&)),
				this,
				SLOT (handleRealNameChanged (const QString&)));
		connect (entryObj,
				SIGNAL (chatPartStateChanged (const ChatPartState&, const QString&)),
				this,
				SLOT (handleRealCPSChanged (const ChatPartState&, const QString&)));
		connect (entryObj,
				SIGNAL (entryGenerallyChanged ()),
				this,
				SIGNAL (entryGenerallyChanged ()));

		const auto entry = qobject_cast<ICLEntry*> (entryObj);
		connect (entry->GetParentAccount ()->GetQObject (),
				SIGNAL (removedCLItems (QList<QObject*>)),
				this,
				SLOT (checkRemovedCLItems (QList<QObject*>)));

		/*
		IAccount *account = qobject_cast<IAccount*> (entry->GetParentAccount ());
		connect (account->GetParentProtocol (),
				SIGNAL (accountRemoved (QObject*)),
				this,
				SLOT (handleAccountRemoved (QObject*)),
				Qt::QueuedConnection);
				*/
	}
示例#9
0
	void VkAccount::finishOffline ()
	{
		if (!ChatEntries_.isEmpty ())
		{
			QList<QObject*> toRemove;
			for (auto item : ChatEntries_)
				toRemove << item;
			emit removedCLItems (toRemove);

			qDeleteAll (ChatEntries_);
			ChatEntries_.clear ();
		}

		for (auto entry : Entries_)
		{
			auto info = entry->GetInfo ();
			info.IsOnline_ = false;
			entry->UpdateInfo (info, false);
		}
	}
示例#10
0
	void MRIMAccount::RemoveEntry (QObject *obj)
	{
		MRIMBuddy *buddy = qobject_cast<MRIMBuddy*> (obj);
		if (!buddy)
		{
			qWarning () << Q_FUNC_INFO
					<< "wrong object"
					<< obj;
			return;
		}

		const qint64 id = buddy->GetID ();
		if (id < 0)
		{
			qWarning () << Q_FUNC_INFO
					<< "cannot remove buddy with negative ID";
			return;
		}

		Buddies_.take (buddy->GetHumanReadableID ())->deleteLater ();
		emit removedCLItems (QList<QObject*> () << buddy);

		Conn_->RemoveContact (id, buddy->GetHumanReadableID (), buddy->GetEntryName ());
	}
示例#11
0
	void GlooxAccount::handleEntryRemoved (QObject *entry)
	{
		emit removedCLItems (QObjectList () << entry);
	}