コード例 #1
0
ファイル: kateproject.cpp プロジェクト: dividedmind/kate
void KateProject::loadProjectDone (KateProjectSharedQStandardItem topLevel, KateProjectSharedQMapStringItem file2Item)
{
  /**
   * setup model data
   */
  m_model.clear ();
  m_model.invisibleRootItem()->appendColumn (topLevel->takeColumn (0));

  /**
   * setup file => item map
   */
  m_file2Item = file2Item;
  
  /**
   * readd the documents that are open atm
   */
  m_documentsParent = 0;
  foreach (KTextEditor::Document *document, m_documents.keys ())
    registerDocument (document);

  /**
   * model changed
   */
  emit modelChanged ();
}
コード例 #2
0
ファイル: kateviewspace.cpp プロジェクト: cmacq2/kate
void KateViewSpace::mergeLruList(const QVector<KTextEditor::Document*> & lruList)
{
    // merge lruList documents that are not in m_lruDocList
    QVectorIterator<KTextEditor::Document*> it(lruList);
    it.toBack();
    while (it.hasPrevious()) {
        KTextEditor::Document *doc = it.previous();
        if (! m_lruDocList.contains(doc)) {
            registerDocument(doc, false);
        }
    }
}
コード例 #3
0
ファイル: kateviewspace.cpp プロジェクト: cmacq2/kate
KTextEditor::View *KateViewSpace::createView(KTextEditor::Document *doc)
{
    // should only be called if a view does not yet exist
    Q_ASSERT(! m_docToView.contains(doc));

    /**
     * Create a fresh view
     */
    KTextEditor::View *v = doc->createView(stack, m_viewManager->mainWindow()->wrapper());

    // set status bar to right state
    v->setStatusBarEnabled(m_viewManager->mainWindow()->showStatusBar());

    // restore the config of this view if possible
    if (!m_group.isEmpty()) {
        QString fn = v->document()->url().toString();
        if (! fn.isEmpty()) {
            QString vgroup = QString::fromLatin1("%1 %2").arg(m_group).arg(fn);

            KateSession::Ptr as = KateApp::self()->sessionManager()->activeSession();
            if (as->config() && as->config()->hasGroup(vgroup)) {
                KConfigGroup cg(as->config(), vgroup);
                v->readSessionConfig(cg);
            }
        }
    }

    // register document, it is shown below through showView() then
    if (! m_lruDocList.contains(doc)) {
        registerDocument(doc);
        Q_ASSERT(m_lruDocList.contains(doc));
    }

    // insert View into stack
    stack->addWidget(v);
    m_docToView[doc] = v;
    showView(v);

    return v;
}