Ejemplo n.º 1
0
inline void stringListFromFlList(QStringList& sl, const FileLocationList& fll)
{
	FileLocationList* pList;
	FileLocation* pLoc;
	QString sLoc;

	// Nasty...
	pList = (FileLocationList*)&fll;
	sl.clear();
	
	// Turn the object list into a string list, so that it can be written in
	// the configuration file
	for (pLoc = pList->first(); pLoc != NULL; pLoc = pList->next()) {
		sLoc = "";
		QTextOStream(&sLoc) << pLoc->m_sPath << ":" << pLoc->m_nLine << ":" 
				<< pLoc->m_nCol;
		sl.append(sLoc);
	}
}
Ejemplo n.º 2
0
inline void flListFromStringList(FileLocationList& fll, const QStringList& sl)
{
	QStringList::ConstIterator itr;
	QString sPath;
	uint nLine, nCol;

	// Transform the string into a list of file locations
	for (itr = sl.begin(); itr != sl.end(); ++itr) {
		sPath = (*itr).section(':', 0, 0);
		nLine = (*itr).section(':', 1, 1).toUInt();
		nCol = (*itr).section(':', 2, 2).toUInt();
		fll.append(new FileLocation(sPath, nLine, nCol));
	}
}
Ejemplo n.º 3
0
/**
 * Retrieves a list of all bookmarks in this page.
 */
void EditorPage::getBookmarks(FileLocationList& fll)
{
	KTextEditor::MarkInterface* pMarkIf;
	QPtrList<KTextEditor::Mark> plMarks;
	KTextEditor::Mark* pMark;
	
	// Get the marks interface
	pMarkIf = dynamic_cast<KTextEditor::MarkInterface*>(m_pDoc);
	if (!pMarkIf)
		return;
	
	// Find all bookmarks
	plMarks = pMarkIf->marks();
	for (pMark = plMarks.first(); pMark; pMark = plMarks.next()) {
		if (pMark->type == KTextEditor::MarkInterface::markType01)
			fll.append(new FileLocation(getFilePath(), pMark->line, 0));
	}
}
Ejemplo n.º 4
0
/**
 * Retrieves a list of all bookmarks in this page.
 */
void EditorPage::getBookmarks(FileLocationList& fll)
{
	// Get the marks interface
	KTextEditor::MarkInterface* pMarkIf;
	pMarkIf = qobject_cast<KTextEditor::MarkInterface*>(m_pDoc);
	if (!pMarkIf)
		return;

	// Find all bookmarks
	KTextEditor::Mark* pMark;
	QHashIterator<int, KTextEditor::Mark*> hItr(pMarkIf->marks());
	while(hItr.hasNext()) {
		hItr.next();
		pMark = hItr.value();
		if (pMark->type == KTextEditor::MarkInterface::markType01)
			fll.append(new FileLocation(getFilePath(), pMark->line, 0));
	}
}
Ejemplo n.º 5
0
/**
 * Retrieves a list of all bookmarks in this page.
 */
void EditorPage::getBookmarks(FileLocationList& fll)
{
	KTextEditor::MarkInterface* pMarkIf;
	QList<KTextEditor::Mark *> plMarks;
	KTextEditor::Mark* pMark;
	
	// Get the marks interface
	pMarkIf = qobject_cast<KTextEditor::MarkInterface*>(m_pDoc);
	if (!pMarkIf)
		return;

	// Find all bookmarks
    const QHash<int, KTextEditor::Mark *> marks = pMarkIf->marks();
    QHashIterator<int, KTextEditor::Mark *> i(marks);

    while (i.hasNext()) {
        i.next();
        pMark = i.value();
		if (pMark->type == KTextEditor::MarkInterface::markType01)
			fll.append(new FileLocation(getFilePath(), pMark->line, 0));
    }
}