📄 kscopeconfig.cpp
字号:
/** * Adds the given project path to the beginning of the recently used projects * list. * @param sProjPath The path of the project to add */void KScopeConfig::addRecentProject(const QString& sProjPath){ QStringList::Iterator itr; itr = m_slProjects.find(sProjPath); if (itr != m_slProjects.end()) m_slProjects.remove(itr); m_slProjects.prepend(sProjPath);}/** * Removes the given project path from recently used projects list. * @param sProjPath The path of the project to remove */void KScopeConfig::removeRecentProject(const QString& sProjPath){ m_slProjects.remove(sProjPath);}/** * @return true if the tag list should be visible, false otherwise */bool KScopeConfig::getShowTagList() const{ return m_cp.bShowTagList;}/** * @param bShowTagList true to make the tag list visible, false otherwise */void KScopeConfig::setShowTagList(bool bShowTagList){ m_cp.bShowTagList = bShowTagList;}/** * @return A list containing the widths of the Ctags list part and the * editor part in an editor page. */const SPLIT_SIZES& KScopeConfig::getEditorSizes() const{ return m_cp.siEditor;}/** * @param siEditor A list containing the widths of the Ctags list part * and the editor part in an editor page. */void KScopeConfig::setEditorSizes(const SPLIT_SIZES& siEditor){ m_cp.siEditor = siEditor;}/** * Finds a colour to use for a GUI element. * @param ce Identifies the GUI element * @return A reference to the colour object to use */const QColor& KScopeConfig::getColor(ColorElement ce) const{ return m_cp.clrs[ce];}/** * Returns the display name of a GUI element whose colour can be configured. * @param ce The GUI element * @return A name used in the colour configuration page */QString KScopeConfig::getColorName(ColorElement ce) const{ return COLOR_NAME(ce);}/** * Sets a new colour to a GUI element. * @param ce Identifies the GUI element * @param clr The colour to use */ void KScopeConfig::setColor(ColorElement ce, const QColor& clr){ m_cp.clrs[ce] = clr;}/** * Finds a font to use for a GUI element. * @param fe Identifies the GUI element * @return A reference to the font object to use */const QFont& KScopeConfig::getFont(FontElement fe) const{ return m_cp.fonts[fe];}/** * Returns the display name of a GUI element whose font can be configured. * @param ce The GUI element * @return A name used in the font configuration page */QString KScopeConfig::getFontName(FontElement ce) const{ return FONT_NAME(ce);}/** * Sets a new font to a GUI element. * @param fe Identifies the GUI element * @param font The font to use */ void KScopeConfig::setFont(FontElement fe, const QFont& font){ m_bFontsChanged = true; m_cp.fonts[fe] = font;}/** * @return The column and direction by which the tags should be sorted */KScopeConfig::CtagSort KScopeConfig::getCtagSortOrder(){ return m_cp.ctagSortOrder;}/** * @param ctagSortOrder The column and direction by which the tags should * be sorted */void KScopeConfig::setCtagSortOrder(CtagSort ctagSortOrder){ m_cp.ctagSortOrder = ctagSortOrder;}/** * @return true to work in Read-Only mode, false otherwise */bool KScopeConfig::getReadOnlyMode(){ return m_cp.bReadOnlyMode;}/** * @param bReadOnlyMode true to work in Read-Only mode, false otherwise */void KScopeConfig::setReadOnlyMode(bool bReadOnlyMode){ m_cp.bReadOnlyMode = bReadOnlyMode;}/** * @return true to load the last project on start-up, false otherwise */bool KScopeConfig::getLoadLastProj(){ return m_cp.bLoadLastProj;}/** * @param bLoadLastProj true to load the last project on start-up, false * otherwise */void KScopeConfig::setLoadLastProj(bool bLoadLastProj){ m_cp.bLoadLastProj = bLoadLastProj;}/** * @return true to enable tag highlighting based on cursor position, false * to disable this feature */bool KScopeConfig::getAutoTagHl(){ return m_cp.bAutoTagHl;}/** * @param bAutoTagHl true to enable tag highlighting based on cursor * position, false to disable this feature */void KScopeConfig::setAutoTagHl(bool bAutoTagHl){ m_cp.bAutoTagHl = bAutoTagHl;}/** * @return true to use the short version of the query captions, false to use * the long version */bool KScopeConfig::getUseBriefQueryCaptions(){ return m_cp.bBriefQueryCaptions;}/** * @param bBrief true to use the short version of the query captions, false * to use the long version */void KScopeConfig::setUseBriefQueryCaptions(bool bBrief){ m_cp.bBriefQueryCaptions = bBrief;}/** * @return true to warn user when file is modified on disk, false * otherwise */bool KScopeConfig::getWarnModifiedOnDisk(){ return m_cp.bWarnModifiedOnDisk;}/** * @param bWarn true to warn user when file is modified on disk, * false otherwise */void KScopeConfig::setWarnModifiedOnDisk(bool bWarn){ m_cp.bWarnModifiedOnDisk = bWarn;}/** * @return true to sort files when a project is loaded, false otherwise */bool KScopeConfig::getAutoSortFiles(){ return m_cp.bAutoSortFiles;}/** * @param bSort true to sort files when a project is loaded, false * otherwise */void KScopeConfig::setAutoSortFiles(bool bSort){ m_cp.bAutoSortFiles = bSort;}/** * @return A command line for launching an external editor */const QString& KScopeConfig::getExtEditor(){ return m_cp.sExtEditor;}/** * @param sExtEditor A command line for launching an external editor */void KScopeConfig::setExtEditor(const QString& sExtEditor){ m_cp.sExtEditor = sExtEditor;}/** * Determines if an external editor should be used. * An external editor is used if KScope is in Read-Only mode, and a command- * line for the editor was specified. * @return true to use an external editor, false otherwise */bool KScopeConfig::useExtEditor(){ return !m_cp.sExtEditor.isEmpty();}/** * @return The chosen profile for this system (@see SysProfile) */KScopeConfig::SysProfile KScopeConfig::getSysProfile() const{ return m_cp.profile;}/** * @param profile The system profile to use (@see SysProfile) */void KScopeConfig::setSysProfile(KScopeConfig::SysProfile profile){ m_cp.profile = profile;}/** * @return The chosen popup menu type for the embedded editor (@see * EditorPopup) */KScopeConfig::EditorPopup KScopeConfig::getEditorPopup() const{ return m_cp.popup;}/** * @return The name of the popup menu to use in the embedded editor */QString KScopeConfig::getEditorPopupName() const{ switch (m_cp.popup) { case Embedded: return "ktexteditor_popup"; case KScopeOnly: return "kscope_popup"; } // Will not happen, but the compiler complains if no return statement is // given here return "";}/** * @param popup The popup menu to use for the embedded editor (@see * EditorPopup) */void KScopeConfig::setEditorPopup(KScopeConfig::EditorPopup popup){ m_cp.popup = popup;}/** * @return The default orientation for call graphs */QString KScopeConfig::getGraphOrientation() const{ return m_cp.sGraphOrient;}/** * @param sOrient The default orientation for call graphs */void KScopeConfig::setGraphOrientation(const QString& sOrient){ m_cp.sGraphOrient = sOrient;}/** * @return The maximal number of calls per graph node */int KScopeConfig::getGraphMaxNodeDegree() const{ return m_cp.nGraphMaxNodeDegree;}/** * @param nMaxNodeDegree The maximal number of calls per graph node */void KScopeConfig::setGraphMaxNodeDegree(int nMaxNodeDegree){ m_cp.nGraphMaxNodeDegree = nMaxNodeDegree;}/** * @return The default view in the call graph dialogue */int KScopeConfig::getDefGraphView() const{ return m_cp.nDefGraphView;}/** * @param nDefGraphView The default view in the call graph dialogue */void KScopeConfig::setDefGraphView(int nDefGraphView){ m_cp.nDefGraphView = nDefGraphView;}/** * Returns a reference to a global configuration object. * The static object defined is this function should be the only KSCopeConfig * object in this programme. Any code that wishes to get or set global * configuration parameters, should call Config(), instead of defining its * own object. * @return Reference to a statically allocated configuration object */KScopeConfig& Config(){ static KScopeConfig conf; return conf;}#include "kscopeconfig.moc"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -