Esempio n. 1
0
void TextInfo::registerCodeCompletionModels()
{
	if(!m_doc) {
		return;
	}
	QList<KTextEditor::View*> views = m_doc->views();
	for(QList<KTextEditor::View*>::iterator i = views.begin(); i != views.end(); ++i) {
		registerCodeCompletionModels(*i);
	}
}
Esempio n. 2
0
KTextEditor::View* TextInfo::createView(QWidget *parent, const char* /* name */)
{
	if(!m_doc) {
		return NULL;
	}
	KTextEditor::View *view = m_doc->createView(parent);
	installEventFilters(view);
	installSignalConnections(view);
	registerCodeCompletionModels(view);
	connect(view, SIGNAL(destroyed(QObject*)), this, SLOT(slotViewDestroyed(QObject*)));
	return view;
}
Esempio n. 3
0
void TextInfo::setDocument(KTextEditor::Document *doc)
{
	KILE_DEBUG_MAIN << "===void TextInfo::setDoc(KTextEditor::Document *doc)===";

	if(m_doc == doc) {
		return;
	}

	detach();
	if(doc) {
		m_doc = doc;
		m_documentContents.clear();
		connect(m_doc, SIGNAL(documentNameChanged(KTextEditor::Document*)), this, SLOT(slotFileNameChanged()));
		connect(m_doc, SIGNAL(documentUrlChanged(KTextEditor::Document*)), this, SLOT(slotFileNameChanged()));
		connect(m_doc, SIGNAL(completed()), this, SLOT(slotCompleted()));
		connect(m_doc, SIGNAL(modifiedChanged(KTextEditor::Document*)), this, SLOT(makeDirtyIfModified()));
		// this could be a KatePart bug, and as "work-around" we manually set the highlighting mode again
		connect(m_doc, SIGNAL(completed()), this, SLOT(activateDefaultMode()));
		setMode(m_defaultMode);
		installEventFilters();
		registerCodeCompletionModels();
	}
}