/** * Promts the user for a symbol, an starts a new Cscope query. * @param nType The numeric query type code * @param bPrompt true to always prompt for a symbol, false to try to * obtain the symbol automatically */ void KScope::slotQuery(uint nType, bool bPrompt) { QString sSymbol; CallTreeDlg* pCallTreeDlg; bool bCase; // Get the requested symbol and query type if (!getSymbol(nType, sSymbol, bCase, bPrompt)) return; if (nType == SymbolDlg::CallTree) { // Create and display a call tree dialogue pCallTreeDlg = m_pCallTreeMgr->addDialog(); pCallTreeDlg->setRoot(sSymbol); pCallTreeDlg->show(); } else { // Run the requested query nType = SymbolDlg::getQueryType(nType); m_pQueryWidget->initQuery(nType, sSymbol, bCase); // Ensure Query Window is visible toggleQueryWindow(true); } }
/** * Saves all call trees into the project directory. * @param sProjPath The project's directory * @param slFiles Holds a list of saved file names, upon return */ void CallTreeManager::saveOpenDialogs(const QString& sProjPath, QStringList& slFiles) { QListIterator<CallTreeDlg*> itr(m_lstDialogs); CallTreeDlg *pDlg; // Iterate over the open dialogues while (itr.hasNext()){ (pDlg = itr.next())->store(sProjPath); slFiles += pDlg->getFileName(); } }
/** * Loads all call trees according to the list of files * @param sProjPath The project's directory * @param slFiles A list of file names to open */ void CallTreeManager::loadOpenDialogs(const QString& sProjPath, const QStringList& slFiles) { QStringList::ConstIterator itr; CallTreeDlg *pDlg; for (itr = slFiles.begin(); itr != slFiles.end(); ++itr) { // Create a new dialogue for this file pDlg = addDialog(); // Try to load the graph from the file if (!pDlg->load(sProjPath, *itr)) { slotRemoveDialog(pDlg); continue; } // Show the call tree pDlg->show(); } }
/** * Saves all call trees into the project directory. * @param sProjPath The project's directory * @param slFiles Holds a list of saved file names, upon return */ void CallTreeManager::saveOpenDialogs(const QString& sProjPath, QStringList& slFiles) { CallTreeDlg *pDlg; // Iterate over the open dialogues /* for (pDlg = m_lstDialogs.first(); pDlg != NULL; pDlg = m_lstDialogs.next()) { pDlg->store(sProjPath); slFiles += pDlg->getFileName(); } I REIMPLEMENT THIS SO: */ for (int i = 0; i < m_lstDialogs.size(); ++i) { pDlg = m_lstDialogs.at(i); pDlg->store(sProjPath); slFiles += pDlg->getFileName(); } }