void EditorTabWidget::loadMarks(Document_t& d, KTextEditor::Document* doc)
{
  /*
    QString s = "result: ";
    for(int i = 0; i < d.marks.count(); i++) {
      s += "(" + QString::number((*(d.marks.at(i))).line+1) + ")*" + QString::number((*(d.marks.at(i))).type) + "*; ";
    }
    kdDebug() << s;
  */

  d.marks.clear();

  KTextEditor::MarkInterface* imark =
    dynamic_cast<KTextEditor::MarkInterface*>(doc);

  //this 'for' doesn't use first()/next() because it modifies the current item in the list
  //and it is already being used in the 'for' of slotMarkChanged()

  //QString s = "result: ";
  int size = imark->marks().count();
  for(int i = 0; i < size; i++) {
    //s += "(" + QString::number(m->line+1) + ")*" + QString::number(m->type) + "*; ";
    d.marks.append((*imark->marks().at(i)));
  }
  //kdDebug() << s;
}
void EditorPage::getBookmarks(FileListLocation& fll)
{
    KTextEditor::MarkInterface* pMarkIf;
    QHash<int, 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();

    QHashIterator<int, KTextEditor::Mark*> i(plMarks);
    while (i.hasNext()) {
        i.next();
        fll.append(getFilePath(), i.key(), 0);
    }

    /*
    for (pMark = plMarks.first(); pMark; pMark = plMarks.next()) {
    	if (pMark->type == KTextEditor::MarkInterface::markType01)
    		fll.append(new FileLocation(getFilePath(), pMark->line, 0));
    }
    */

}
Exemple #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));
	}
}
/**
 * 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));
	}
}
void QXsldbgDoc::clearMarks(bool allMarkTypes)
{
    if (locked)
	return;

    KTextEditor::MarkInterface *markIf = KTextEditor::markInterface(kDoc);
    if (markIf){
        if (!allMarkTypes){
            QPtrList<KTextEditor::Mark> marks = markIf->marks();
            while ( marks.current()) {
                markIf->removeMark(marks.current()->line, KTextEditor::MarkInterface::Execution);
                markIf->removeMark(marks.current()->line, KTextEditor::MarkInterface::BreakpointReached);
                marks.next();
            }
        }else {
            markIf->clearMarks();
        }
    }

}
Exemple #6
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));
    }
}