void TemplateIconView::searchLaTeXClassFiles() { if(!m_templateManager) return; QString command = "kpsewhich -format=tex scrartcl.cls beamer.cls prosper.cls HA-prosper.sty"; delete m_proc; m_proc = new KProcess(this); m_proc->clearArguments(); m_proc->setUseShell(true); (*m_proc) << QStringList::split(' ', command); m_output = QString::null; connect(m_proc, SIGNAL(receivedStdout(KProcess*,char*,int)), this, SLOT(slotProcessOutput(KProcess*,char*,int)) ); connect(m_proc, SIGNAL(receivedStderr(KProcess*,char*,int)), this, SLOT(slotProcessOutput(KProcess*,char*,int)) ); connect(m_proc, SIGNAL(processExited(KProcess*)), this, SLOT(slotProcessExited(KProcess*)) ); KILE_DEBUG() << "=== NewFileWidget::searchClassFiles() ====================" << endl; KILE_DEBUG() << "\texecute: " << command << endl; if ( ! m_proc->start(KProcess::NotifyOnExit, KProcess::AllOutput) ) { KILE_DEBUG() << "\tstart of shell process failed" << endl; addTemplateIcons(KileDocument::LaTeX); } }
void Manager::scanForTemplates() { KILE_DEBUG() << "===scanForTemplates()===================" << endl; QStringList dirs = KGlobal::dirs()->findDirs("appdata", "templates"); QDir templates; KileTemplate::Info ti; KileDocument::Extensions *extensions = m_kileInfo->extensions(); m_TemplateList.clear(); for ( QValueListIterator<QString> i = dirs.begin(); i != dirs.end(); ++i) { templates = QDir(*i, "template_*"); for ( uint j = 0; j< templates.count(); ++j) { ti.path = templates.path() + '/' + templates[j]; QFileInfo fileInfo(ti.path); ti.name = fileInfo.baseName(true).mid(9); //remove "template_", do it this way to avoid problems with user input! ti.type = extensions->determineDocumentType(KURL::fromPathOrURL(ti.path)); ti.icon = KGlobal::dirs()->findResource("appdata","pics/type_" + ti.name + extensions->defaultExtensionForDocumentType(ti.type) + ".kileicon"); if (m_TemplateList.contains(ti)) { KILE_DEBUG() << "\tignoring: " << ti.path << endl; } else { m_TemplateList.append(ti); KILE_DEBUG() << "\tadding: " << ti.name << " " << ti.path << endl; } } } }
void ProjectView::refreshProjectTree(const KileProject *project) { KILE_DEBUG() << "\tProjectView::refreshProjectTree(" << project->name() << ")"; ProjectViewItem *parent= projectViewItemFor(project->url()); //clean the tree if(parent) { KILE_DEBUG() << "\tusing parent projectviewitem " << parent->url().fileName(); parent->setFolder(-1); QList<QTreeWidgetItem*> children = parent->takeChildren(); for(QList<QTreeWidgetItem*>::iterator it = children.begin(); it != children.end(); ++it) { delete(*it); } } else { return; } //create the non-sources dir //ProjectViewItem *nonsrc = new ProjectViewItem(parent, i18n("non-sources")); //parent->setNonSrc(nonsrc); QList<KileProjectItem*> list = project->rootItems(); for(QList<KileProjectItem*>::iterator it = list.begin(); it != list.end(); ++it) { addTree(*it, parent); } parent->sortChildren(0, Qt::AscendingOrder); // seems to be necessary to get a correct refreh (Qt 4.4.3) bool expanded = parent->isExpanded(); parent->setExpanded(!expanded); parent->setExpanded(expanded); }
void LaTeXInfo::installParserOutput(KileParser::ParserOutput *parserOutput) { KILE_DEBUG(); KileParser::LaTeXParserOutput *latexParserOutput = dynamic_cast<KileParser::LaTeXParserOutput*>(parserOutput); Q_ASSERT(latexParserOutput); if(!latexParserOutput) { KILE_DEBUG() << "wrong type given"; return; } m_labels = latexParserOutput->labels; m_bibItems = latexParserOutput->bibItems; m_deps = latexParserOutput->deps; m_bibliography = latexParserOutput->bibliography; m_packages = latexParserOutput->packages; m_newCommands = latexParserOutput->newCommands; m_asyFigures = latexParserOutput->asyFigures; m_preamble = latexParserOutput->preamble; m_bIsRoot = latexParserOutput->bIsRoot; checkChangedDeps(); emit(isrootChanged(isLaTeXRoot())); setDirty(false); emit(parsingComplete()); }
void Help::readHelpList(const QString &filename) { // clear old map m_dictHelpTex.clear(); QString file = m_helpDir + filename; if(file.isEmpty()) { KILE_DEBUG() << " file not found: " << filename << endl; return; } // KILE_DEBUG() << " read file: " << filename << endl; KILE_DEBUG() << "read keyword file: " << file; QRegExp reg("\\s*(\\S+)\\s*=>\\s*(\\S+)"); QFile f(file); if(f.open(QIODevice::ReadOnly)) { // file opened successfully QTextStream t(&f); // use a text stream while(!t.atEnd()) { // until end of file... QString s = t.readLine().trimmed(); // line of text excluding '\n' if(!(s.isEmpty() || s.at(0)=='#')) { int pos = reg.indexIn(s); if ( pos != -1 ) { m_dictHelpTex[reg.cap(1)] = reg.cap(2); } } } f.close(); } }
void Help::readHelpList(const QString &filename,QMap<QString,QString> &map) { QString file = KGlobal::dirs()->findResource("appdata","help/" + filename); if ( file.isEmpty() ) { KILE_DEBUG() << " file not found: " << filename << endl; return; } KILE_DEBUG() << " read file: " << filename << endl; QRegExp reg("\\s*(\\S+)\\s*=>\\s*(\\S+)"); QFile f(file); if ( f.open(IO_ReadOnly) ) { // file opened successfully QTextStream t( &f ); // use a text stream while ( ! t.eof() ) { // until end of file... QString s = t.readLine().stripWhiteSpace(); // line of text excluding '\n' if ( ! (s.isEmpty() || s.at(0)=='#') ) { int pos = reg.search(s); if ( pos != -1 ) { map[reg.cap(1)] = reg.cap(2); } } } f.close(); } }
bool UserMenuDialog::saveClicked() { if ( m_currentXmlFile.isEmpty() ) { return false; } KILE_DEBUG() << "save menutree: " << m_currentXmlFile; // read current entry QTreeWidgetItem *current = m_menutree->currentItem(); if ( current ) { kdDebug() << "read current item ..."; readMenuentryData( dynamic_cast<UserMenuItem *>(current) ); } if ( saveCheck() == false ) { return false; } // force to save file in local directory QStringList dirs = KGlobal::dirs()->findDirs("appdata", "usermenu/"); if ( dirs.size() > 1 ) { if ( m_currentXmlFile.startsWith(dirs[1]) ) { m_currentXmlFile.replace(dirs[1],dirs[0]); KILE_DEBUG() << "change filename to local directory: " << m_currentXmlFile; } } // save file m_menutree->writeXml(m_currentXmlFile); return true; }
QString UserMenuDialog::saveAsClicked() { KILE_DEBUG() << "menutree should be saved as ..."; // read current entry QTreeWidgetItem *current = m_menutree->currentItem(); if ( current ) { KILE_DEBUG() << "read current item ..."; readMenuentryData( dynamic_cast<UserMenuItem *>(current) ); } if ( saveCheck() == false ) { return QString(); } QString directory = KStandardDirs::locateLocal("appdata", "usermenu/"); QString filter = i18n("*.xml|Latex Menu Files"); QString filename = KFileDialog::getSaveFileName(directory, filter, this, i18n("Save Menu File")); if(filename.isEmpty()) { return QString(); } if( QFile::exists(filename) ) { if ( KMessageBox::questionYesNo(this, i18n("File '%1' does already exist.\nOverwrite this file?", filename)) == KMessageBox::No ) { return QString(); } } // save file m_menutree->writeXml(filename); return filename; }
void FindFilesDialog::slotSearch() { KILE_DEBUG() << "\tgrep: start slot search" << m_proc; if (m_proc) { clearGrepJobs(); finish(); return; } if (template_combo->currentIndex() < KileGrep::tmEnv && pattern_combo->currentText().isEmpty()) { return; } KILE_DEBUG() << "\tgrep: start new search"; QRegExp re(getPattern()); if(!re.isValid()) { KMessageBox::error(m_ki->mainWindow(), i18n("Invalid regular expression: %1", re.errorString()), i18n("Grep Tool Error")); return; } resultbox->setCursor(QCursor(Qt::WaitCursor)); search_button->setText(i18n("&Cancel")); if (template_combo->currentIndex() < KileGrep::tmEnv) { m_TemplateList[m_lastTemplateIndex] = template_edit->text(); } // start grep command m_grepJobs = (m_mode == KileGrep::Project) ? m_projectfiles.count() : 1; startGrep(); }
void ProjectView::makeTheConnection(ProjectViewItem *item, KileDocument::TextInfo *textInfo) { KILE_DEBUG() << "\tmakeTheConnection " << item->text(0); if (item->type() == KileType::Project) { KileProject *project = m_ki->docManager()->projectFor(item->url()); if (!project) { kWarning() << "makeTheConnection COULD NOT FIND AN PROJECT OBJECT FOR " << item->url().toLocalFile(); } else { connect(project, SIGNAL(nameChanged(const QString &)), item, SLOT(nameChanged(const QString &))); } } else { if(!textInfo) { textInfo = m_ki->docManager()->textInfoFor(item->url().toLocalFile()); if(!textInfo) { KILE_DEBUG() << "\tmakeTheConnection COULD NOT FIND A DOCINFO"; return; } } item->setInfo(textInfo); connect(textInfo, SIGNAL(urlChanged(KileDocument::Info*, const KUrl&)), item, SLOT(slotURLChanged(KileDocument::Info*, const KUrl&))); connect(textInfo, SIGNAL(isrootChanged(bool)), item, SLOT(isrootChanged(bool))); //set the pixmap item->isrootChanged(textInfo->isLaTeXRoot()); } }
void SideBar::showPage(QWidget *widget) { KILE_DEBUG() << "===SideBar::showPage(" << widget << ")"; int i = m_tabStack->indexOf(widget); KILE_DEBUG() << "i is " << i; if(i >= 0) { switchToTab(i); } }
// read an xml file and check for errors bool UserMenuTree::readXml(const QString &filename) { KILE_DEBUG() << "read xml file " << filename; QDomDocument doc("UserMenu"); QFile file(filename); if ( !file.open(QFile::ReadOnly | QFile::Text) ) { KMessageBox::error(this, i18n("File '%1' does not exist.", filename)); return false; } if ( !doc.setContent( &file ) ) { file.close(); return false; } file.close(); KILE_DEBUG() << "parse xml ..."; blockSignals(true); // clear menutree clear(); // read toplevelitems QDomElement root = doc.documentElement(); QDomElement e = root.firstChildElement(); while ( !e.isNull()) { QString tag = e.tagName(); UserMenuItem *item = NULL; if ( tag == "submenu" ) { item = readXmlSubmenu(e); } else if ( tag == "separator" ) { item = readXmlSeparator(); } else /* if ( tag == "menu" ) */ { item = readXmlMenuentry(e); } if ( item ) { addTopLevelItem(item); } e = e.nextSiblingElement(); } // the xml menu is built, now check for errors setErrorCodes(); // polish menutree expandAll(); if ( topLevelItemCount() > 0 ) { setCurrentItem( topLevelItem(0) ); } blockSignals(false); return true; }
void UserMenuDialog::loadXmlFile(const QString &filename, bool installed) { KILE_DEBUG() << "load xml started ..."; m_menutree->readXml(filename); initDialog(); m_modified = false; setXmlFile(filename,installed); updateDialogButtons(); KILE_DEBUG() << "load xml finished ..."; }
void Help::helpTexRefsKeyword(Kate::View *view) { QString word = getKeyword(view); KILE_DEBUG() << "keyword: " << word << endl; if ( !word.isNull() && m_dictHelpTex.contains(word) ) { KILE_DEBUG() << "about to show help for " << word << " (section " << m_dictHelpTex[word] << " )" << endl; showHelpFile( m_texdocPath + m_texReference + m_dictHelpTex[word] ); } else noHelpAvailableFor(word); }
// Executes script code in this environment. void ScriptEnvironment::execute(const Script *script) { // initialize engine to work with Cursor and Range objects m_engine->evaluate(m_enginePluginCode,i18n("Cursor/Range plugin")); if ( m_engine->hasUncaughtException() ) { scriptError(i18n("Cursor/Range plugin")); return; } else { KILE_DEBUG() << "Cursor/Range plugin successfully installed "; } // set global objects if ( m_scriptView->view() ) { m_engine->globalObject().setProperty("view", m_engine->newQObject(m_scriptView)); m_engine->globalObject().setProperty("document", m_engine->newQObject(m_scriptDocument)); } m_engine->globalObject().setProperty("kile", m_engine->newQObject(m_kileScriptObject)); // export debug function m_engine->globalObject().setProperty("debug", m_engine->newFunction(KileScript::debug)); // start engine m_engine->evaluate(script->getCode()); // success or error if ( m_engine->hasUncaughtException() ) { scriptError(script->getName()); } else { KILE_DEBUG() << "script finished without errors"; } //FIXME: add time execution limit once it becomes available // bool useGuard = KileConfig::timeLimitEnabled(); // uint timeLimit = (uint)KileConfig::timeLimit(); // KJSCPUGuard guard; // if(useGuard) { // guard.start(timeLimit*1000); // } // KJS::Completion completion = m_interpreter->evaluate(QString(), 0, s); // if(useGuard) { // guard.stop(); // } QTimer::singleShot(0, m_scriptView->view(), SLOT(setFocus())); // remove global objects m_engine->globalObject().setProperty("view", QScriptValue()); m_engine->globalObject().setProperty("document", QScriptValue()); m_engine->globalObject().setProperty("kile", QScriptValue()); }
void Help::initTexDocumentation() { // use documentation for teTeX v3.x, TexLive 2005-2007, TexLive 2009, TexLive2 010-2011 (TUG) m_texdocPath = KileConfig::location(); // first check for TexLive 2010-2011 (TUG) m_texlivePath = locateTexLive201x(); if ( !m_texlivePath.isEmpty() ) { KILE_DEBUG() << "found TexLive 2010-2011 (TUG): " << m_texlivePath; m_texVersion = TEXLIVE_201x_TUG; m_texVersionText = "TexLive " + m_texlivePath.right(4) + " (TUG)"; m_texrefsReference = "/generic/tex-refs/"; return; } // then check for TexLive 2009 (as found with Debian, Ubuntu, ...) QDir dir(m_texdocPath + "/generic/tex-refs/"); if ( dir.exists() ) { KILE_DEBUG() << "found TexLive 2009: " << m_texdocPath; m_texVersion = TEXLIVE2009; m_texVersionText = "TexLive 2009"; m_texrefsReference = "/generic/tex-refs/"; return; } // then check for older versions of TexLive 2005-2007 dir.setPath(m_texdocPath + "/english/tex-refs"); if ( dir.exists() ) { KILE_DEBUG() << "found TexLive 2005-2007: " << m_texdocPath; m_texVersion = TEXLIVE2005; m_texVersionText = "TexLive 2005-2007"; m_texrefsReference = "/english/tex-refs/"; return; } // finally we check for tetex3 dir.setPath(m_texdocPath + "/latex/tex-refs"); if ( dir.exists() ) { m_texVersion = TETEX3; m_texVersionText = "teTeX v3.x"; // check if this is buggy tetex3.0 or an updated version with subdirectory 'html' dir.setPath(m_texdocPath + "/latex/tex-refs/html"); m_texrefsReference = ( dir.exists() ) ? "/latex/tex-refs/html/" : "/latex/tex-refs/"; return; } // found no tex documents for LaTeX help m_texVersion = TEX_UNKNOWN; }
void BibInfo::installParserOutput(KileParser::ParserOutput *parserOutput) { KILE_DEBUG(); KileParser::BibTeXParserOutput *bibtexParserOutput = dynamic_cast<KileParser::BibTeXParserOutput*>(parserOutput); Q_ASSERT(bibtexParserOutput); if(!bibtexParserOutput) { KILE_DEBUG() << "wrong type given"; return; } m_bibItems = bibtexParserOutput->bibItems; setDirty(false); emit(parsingComplete()); }
bool ViewBib::determineSource() { KILE_DEBUG() << "==ViewBib::determineSource()=======" << endl; if (!View::determineSource()) return false; QString path = source(true); QFileInfo info(path); //get the bibliographies for this source const QStringList *bibs = manager()->info()->allBibliographies(manager()->info()->docManager()->textInfoFor(path)); KILE_DEBUG() << "\tfound " << bibs->count() << " bibs" << endl; if (bibs->count() > 0) { QString bib = bibs->front(); if (bibs->count() > 1) { //show dialog bool bib_selected = false; KileListSelector *dlg = new KileListSelector(*bibs, i18n("Select Bibliography"),i18n("Select a bibliography")); if (dlg->exec()) { bib = (*bibs)[dlg->currentItem()]; bib_selected = true; KILE_DEBUG() << "Bibliography selected : " << bib << endl; } delete dlg; if ( ! bib_selected ) { sendMessage(Warning, i18n("No bibliography selected.")); return false; } } KILE_DEBUG() << "filename before: " << info.dirPath() << endl; setSource(manager()->info()->checkOtherPaths(info.dirPath(),bib + ".bib",KileInfo::bibinputs)); } else if( info.exists() ) //active doc is a bib file { KILE_DEBUG() << "filename before: " << info.dirPath() << endl; setSource(manager()->info()->checkOtherPaths(info.dirPath(),info.fileName(),KileInfo::bibinputs)); } else { sendMessage(Error, i18n("No bibliographies found.")); return false; } return true; }
void FindFilesDialog::slotFinished() { KILE_DEBUG() << "\tgrep: slot finished"; clearGrepJobs(); finish(); delayedDestruct(); }
void FindFilesDialog::slotClose() { KILE_DEBUG() << "\tgrep: slot close"; clearGrepJobs(); finish(); delayedDestruct(); }
void FindFilesDialog::slotClear() { KILE_DEBUG() << "\tgrep: slot clear"; clearGrepJobs(); finish(); resultbox->clear(); }
void UserMenuDialog::slotLoadClicked() { KILE_DEBUG() << "load xml file "; if ( !m_menutree->isEmpty() && m_modified ) { if ( KMessageBox::questionYesNo(this, i18n("Current menu tree was modified, but not saved.\nDiscard this tree?")) == KMessageBox::No ) { return; } } QString directory = UserMenu::selectUserMenuDir(); QString filter = i18n("*.xml|Latex Menu Files"); QString filename = KFileDialog::getOpenFileName(directory, filter, this, i18n("Select Menu File")); if(filename.isEmpty()) { return; } if( QFile::exists(filename) ) { loadXmlFile(filename,false); // includes buttons update } else { KMessageBox::error(this, i18n("File '%1' does not exist.", filename)); } }
void FindFilesDialog::startGrep() { m_proc = new KProcess(this); m_proc->setOutputChannelMode(KProcess::SeparateChannels); m_buf.clear(); m_errbuf.clear(); QString command; if (m_mode == KileGrep::Project) { command = buildProjectCommand() + ' ' + KShell::quoteArg(m_projectfiles[m_grepJobs-1]); } else { command = buildFilesCommand(); } KILE_DEBUG() << "\tgrep (project): " << command; (*m_proc) << KShell::splitArgs(command); m_grepJobs--; connect(m_proc, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(processExited(int, QProcess::ExitStatus))); connect(m_proc, SIGNAL(readyReadStandardOutput()), this, SLOT(processStandardOutputReady())); connect(m_proc, SIGNAL(readyReadStandardError()), this, SLOT(processErrorOutputReady())); m_proc->start(); }
void FindFilesDialog::slotItemSelected(const QString& item) { KILE_DEBUG() << "\tgrep: start item selected"; int pos; QString filename, linenumber; QString str = item; if((pos = str.indexOf(':')) != -1) { filename = str.left(pos); str = str.right(str.length() - 1 - pos); if((pos = str.indexOf(':')) != -1) { linenumber = str.left(pos); QFileInfo fileInfo(filename); if(fileInfo.isAbsolute()) { emit itemSelected(filename, linenumber.toInt()); } else if(m_mode == KileGrep::Project) { emit itemSelected(m_projectdir + QDir::separator() + filename, linenumber.toInt()); } else { emit itemSelected(dir_combo->comboBox()->itemText(0) + QDir::separator() + filename, linenumber.toInt()); } } } }
void UserMenuDialog::slotCurrentItemChanged(QTreeWidgetItem *current,QTreeWidgetItem *previous) { QString from = ( previous ) ? previous->text(0) : "---"; QString to = ( current ) ? current->text(0) : "---"; KILE_DEBUG() << "currentItemChanged: from=" << from << " to=" << to; bool modifiedState = m_modified; bool installState = m_UserMenuDialog.m_pbInstall->isEnabled(); bool saveState = m_UserMenuDialog.m_pbSave->isEnabled(); bool saveAsState = m_UserMenuDialog.m_pbSaveAs->isEnabled(); // read old data readMenuentryData( dynamic_cast<UserMenuItem *>(previous) ); // set new data showMenuentryData( dynamic_cast<UserMenuItem *>(current) ); // update buttons for treewidget updateTreeButtons(); // restore saved states m_modified = modifiedState; m_UserMenuDialog.m_pbInstall->setEnabled(installState); m_UserMenuDialog.m_pbSave->setEnabled(saveState); m_UserMenuDialog.m_pbSaveAs->setEnabled(saveAsState); }
void UserMenuDialog::readMenuentryData(UserMenuItem *item) { KILE_DEBUG() << "read current menu item ..."; if ( !item ) { return; } UserMenuData::MenuType type = UserMenuData::MenuType( m_listMenutypes.indexOf(m_UserMenuDialog.m_lbMenuentryType->text()) ); item->setMenutype(type); if ( type == UserMenuData::Separator ) { return; } item->setMenutitle( m_UserMenuDialog.m_leMenuEntry->text().trimmed() ); item->setFilename( m_UserMenuDialog.m_urlRequester->text().trimmed() ); item->setParameter( m_UserMenuDialog.m_leParameter->text().trimmed() ); item->setPlaintext( m_UserMenuDialog.m_teText->toPlainText() ); item->setMenuicon( m_currentIcon ); item->setShortcut(m_UserMenuDialog.m_keyChooser->keySequence().toString(QKeySequence::NativeText) ); item->setNeedsSelection( m_UserMenuDialog.m_cbNeedsSelection->checkState() ); item->setUseContextMenu( m_UserMenuDialog.m_cbContextMenu->checkState() ); item->setReplaceSelection( m_UserMenuDialog.m_cbReplaceSelection->checkState() ); item->setSelectInsertion( m_UserMenuDialog.m_cbSelectInsertion->checkState() ); item->setInsertOutput( m_UserMenuDialog.m_cbInsertOutput->checkState() ); bool executable = ( type==UserMenuData::Program && m_menutree->isItemExecutable(item->filename()) ); item->setModelData(executable); item->setText(0, item->updateMenutitle()); }
ProjectViewItem* ProjectView::folder(const KileProjectItem *pi, ProjectViewItem *item) { ProjectViewItem *parent = parentFor(pi, item); if(!parent) { kError() << "no parent for " << pi->url().toLocalFile(); return NULL; } // we have already found the parent folder if(parent->type() == KileType::Folder) { return parent; } // we are looking at the children, if there is an existing folder for this type ProjectViewItem *folder; // determine the foldername for this type QString foldername; switch(pi->type()) { case (KileProjectItem::ProjectFile): foldername = i18n("projectfile"); break; case (KileProjectItem::Package): foldername = i18n("packages"); break; case (KileProjectItem::Image): foldername = i18n("images"); break; case (KileProjectItem::Other): default : foldername = i18n("other"); break; } // if there already a folder for this type on this level? bool found = false; QTreeWidgetItemIterator it(parent); ++it; // skip 'parent' while(*it) { folder = dynamic_cast<ProjectViewItem*>(*it); if(folder && folder->text(0) == foldername) { found = true; break; } ++it; } // if no folder was found, we must create a new one if(!found) { folder = new ProjectViewItem(parent, foldername); KILE_DEBUG() << "new folder: parent=" << parent->url().url() << ", foldername=" << foldername; folder->setFolder(pi->type()); folder->setType(KileType::Folder); } return folder; }
bool UserMenuTree::writeXml(const QString &filename) { KILE_DEBUG() << "write xml file " << filename; QFile file(filename); if ( !file.open(QFile::WriteOnly | QFile::Text) ) { KMessageBox::error(this, i18n("File '%1' could not be opened to save the usermenu file.", filename)); return false; } QXmlStreamWriter xmlWriter(&file); xmlWriter.setAutoFormatting(true); xmlWriter.setAutoFormattingIndent(2) ; xmlWriter.writeStartDocument(); xmlWriter.writeStartElement("UserMenu"); for (int i = 0; i < topLevelItemCount(); ++i) { writeXmlItem(&xmlWriter, dynamic_cast<UserMenuItem *>(topLevelItem(i)) ); } xmlWriter.writeEndDocument(); file.close(); return true; }
void UserMenuTree::checkMenuTitle(UserMenuItem *item) { if ( item->menutitle().isEmpty() ) { item->setText(0,EMPTY_MENUENTRY); KILE_DEBUG() << "empty menutitle changed to " << EMPTY_MENUENTRY; } }
void Help::helpTexGuide() { QString filename = m_texdocPath; switch(m_texVersion) { case TEXLIVE_201x_TUG: filename = filename.replace("texmf-dist","texmf"); filename += "/texlive/texlive-en/texlive-en.html"; break; case TEXLIVE2009: filename += "/texlive/texlive-en/texlive-en.html"; break; case TEXLIVE2005: filename += "/english/texlive-en/live.html"; break; case TETEX3: filename += "/index.html"; break; default: return; } KILE_DEBUG() << "show TeX Guide: " << m_texVersionText << " file=" << filename; showHelpFile( filename ); }