Commit 83fc120e authored by Dimitri van Heesch's avatar Dimitri van Heesch
Browse files

Minor changes to the way the code for config options is generated (thanks to Albert for the patch)

parent e2597756
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -15,4 +15,13 @@ bool parseConfig(

void writeStringValue(QTextStream &t,QTextCodec *codec,const QString &s);

// directly copied from ../../src/config.h to be consistent
enum
{
 /*! Maximum length of an option in the config file. Used for
  *  alignment purposes.
  */
  MAX_OPTION_LENGTH = 23
};

#endif
+382 −392

File changed.

Preview size limit exceeded, changes collapsed.

+72 −32
Original line number Diff line number Diff line
@@ -112,7 +112,8 @@ void Expert::createTopics(const QDomElement &rootElem)
  {
    if (childElem.tagName()==SA("group"))
    {
      QString name = childElem.attribute(SA("name"));
      // Remove _ from a group name like: Source_Browser
      QString name = childElem.attribute(SA("name")).replace(SA("_"),SA(" "));
      items.append(new QTreeWidgetItem((QTreeWidget*)0,QStringList(name)));
      QWidget *widget = createTopicWidget(childElem);
      m_topics[name] = widget;
@@ -152,6 +153,7 @@ static QString getDocsForNode(const QDomElement &child)
  // for an enum we list the values
  if (type==SA("enum"))
  {
    docs += SA("<br/>");
    docs += SA("Possible values are: ");
    int numValues=0;
    docsVal = child.firstChildElement();
@@ -192,18 +194,23 @@ static QString getDocsForNode(const QDomElement &child)
      docsVal = docsVal.nextSiblingElement();
    }
    docs+=SA("<br/>");
    docs+=SA("<br/>");
    docs+=SA(" The default value is: <code>")+
          child.attribute(SA("defval"))+
          SA("</code>.");
    docs+= SA("<br/>");
  }
  else if (type==SA("int"))
  {
    docs+=SA("<br/>");
    docs+=SA("Minimum value: ")+child.attribute(SA("minval"))+SA(", ");
    docs+=SA("maximum value: ")+child.attribute(SA("maxval"))+SA(", ");
    docs+=SA("default value: ")+child.attribute(SA("defval"))+SA(".");
    docs+= SA("<br/>");
  }
  else if (type==SA("bool"))
  {
    docs+=SA("<br/>");
    if (child.hasAttribute(SA("altdefval")))
    {
      docs+=SA(" The default value is: system dependent.");
@@ -215,6 +222,7 @@ static QString getDocsForNode(const QDomElement &child)
            (defval==SA("1")?SA("YES"):SA("NO"))+
            SA("</code>.");
    }
    docs+= SA("<br/>");
  }
  else if (type==SA("list"))
  {
@@ -226,7 +234,12 @@ static QString getDocsForNode(const QDomElement &child)
      {
        if (docsVal.tagName()==SA("value"))
        {
          if (docsVal.attribute(SA("name"))!=SA("")) numValues++;
          QString showDocu = SA("");
          if (docsVal.hasAttribute(SA("show_docu")))
          {
            showDocu = docsVal.attribute(SA("show_docu")).toLower();
          }
          if ((showDocu != SA("no")) && (docsVal.attribute(SA("name"))!=SA(""))) numValues++;
        }
        docsVal = docsVal.nextSiblingElement();
      }
@@ -237,6 +250,13 @@ static QString getDocsForNode(const QDomElement &child)
        while (!docsVal.isNull())
        {
          if (docsVal.tagName()==SA("value"))
          {
            QString showDocu = SA("");
            if (docsVal.hasAttribute(SA("show_docu")))
            {
              showDocu = docsVal.attribute(SA("show_docu")).toLower();
            }
            if ((showDocu != SA("no")) && (docsVal.attribute(SA("name"))!=SA("")))
            {
              i++;
              docs += SA("<code>") + docsVal.attribute(SA("name")) + SA("</code>");
@@ -258,9 +278,11 @@ static QString getDocsForNode(const QDomElement &child)
                docs += SA(", ");
              }
            }
          }
          docsVal = docsVal.nextSiblingElement();
        }
      }
      // docs+= SA("<br/>");
    }
  }
  else if (type==SA("string"))
@@ -270,7 +292,9 @@ static QString getDocsForNode(const QDomElement &child)
    {
      if (defval != SA(""))
      {
        docs+=SA("<br/>");
        docs += SA(" The default directory is: <code>") + defval + SA("</code>.");
        docs += SA("<br/>");
      }
    }
    else if (child.attribute(SA("format")) == SA("file"))
@@ -278,6 +302,7 @@ static QString getDocsForNode(const QDomElement &child)
      QString abspath = child.attribute(SA("abspath"));
      if (defval != SA(""))
      {
        docs+=SA("<br/>");
        if (abspath != SA("1"))
        {
          docs += SA(" The default file is: <code>") + defval + SA("</code>.");
@@ -286,12 +311,15 @@ static QString getDocsForNode(const QDomElement &child)
        {
          docs += SA(" The default file (with absolute path) is: <code>") + defval + SA("</code>.");
        }
        docs += SA("<br/>");
      }
      else
      {
        if (abspath == SA("1"))
        {
          docs+=SA("<br/>");
          docs += SA(" The file has to be specified with full path.");
          docs += SA("<br/>");
        }
      }
    }
@@ -299,7 +327,9 @@ static QString getDocsForNode(const QDomElement &child)
    {
      if (defval != SA(""))
      {
        docs+=SA("<br/>");
        docs += SA(" The default value is: <code>") + defval + SA("</code>.");
        docs += SA("<br/>");
      }
    }
  }
@@ -324,7 +354,16 @@ static QString getDocsForNode(const QDomElement &child)
  // remove <br> at end
  regexp.setPattern(SA("<br> *$"));
  docs.replace(regexp,SA(" "));
  // \c word -> <code>word</code>
  // \c word -> <code>word</code>; word ends with ')', ',', '.' or ' '
  regexp.setPattern(SA("\\\\c[ ]+([^ \\)]+)\\)"));
  docs.replace(regexp,SA("<code>\\1</code>)"));

  regexp.setPattern(SA("\\\\c[ ]+([^ ,]+),"));
  docs.replace(regexp,SA("<code>\\1</code>,"));

  regexp.setPattern(SA("\\\\c[ ]+([^ \\.]+)\\."));
  docs.replace(regexp,SA("<code>\\1</code>."));

  regexp.setPattern(SA("\\\\c[ ]+([^ ]+) "));
  docs.replace(regexp,SA("<code>\\1</code> "));
  // `word` -> <code>word</code>
@@ -683,7 +722,7 @@ void Expert::saveTopic(QTextStream &t,QDomElement &elem,QTextCodec *codec,
          t << convertToComment(option->templateDocs());
          t << endl;
        }
        t << name.leftJustified(23) << "= ";
        t << name.leftJustified(MAX_OPTION_LENGTH) << "= ";
        if (option)
        {
          option->writeValue(t,codec);
@@ -744,9 +783,10 @@ void Expert::showHelp(Input *option)
    m_helper->setText(
        QString::fromAscii("<qt><b>")+option->id()+
        QString::fromAscii("</b><br>")+
        QString::fromAscii("<br/>")+
        option->docs().
        replace(QChar::fromAscii('\n'),QChar::fromAscii(' '))+
        QString::fromAscii("<qt>")
        QString::fromAscii("</qt>")
        );
    m_inShowHelp = FALSE;
  }
+326 −16

File changed.

Preview size limit exceeded, changes collapsed.

+11 −14
Original line number Diff line number Diff line
@@ -734,11 +734,11 @@ Go to the <a href="commands.html">next</a> section or return to the
 entities in documentation are documented, even if no documentation was 
 available. Private class members and static file members will be hidden 
 unless the \ref cfg_extract_private "EXTRACT_PRIVATE" respectively 
 \ref cfg_extract_static "EXTRACT_STATIC" tags are set to \c YES
 \ref cfg_extract_static "EXTRACT_STATIC" tags are set to \c YES.

 \note This will also disable the warnings about undocumented members 
 that are normally produced when \ref cfg_warnings "WARNINGS" is 
 set to \c YES
 set to \c YES.
]]>
      </docs>
    </option>
@@ -1038,7 +1038,7 @@ Go to the <a href="commands.html">next</a> section or return to the
<![CDATA[
 Set the \c SHOW_FILES tag to \c NO to disable the generation of the Files page.
 This will remove the Files entry from the Quick Index and from the
 Folder Tree View (if specified). The default is \c YES.
 Folder Tree View (if specified).
]]>
      </docs>
    </option>
@@ -1047,7 +1047,7 @@ Go to the <a href="commands.html">next</a> section or return to the
<![CDATA[
 Set the \c SHOW_NAMESPACES tag to \c NO to disable the generation of the
 Namespaces page. This will remove the Namespaces entry from the Quick Index
 and from the Folder Tree View (if specified). The default is \c YES.
 and from the Folder Tree View (if specified).
]]>
      </docs>
    </option>
@@ -1131,8 +1131,7 @@ FILE_VERSION_INFO = "cleartool desc -fmt \%Vn"
      <docs>
<![CDATA[
 The \c QUIET tag can be used to turn on/off the messages that are generated
 to standard output by doxygen. Possible values are \c YES and \c NO, 
 where \c YES implies that the messages are off.
 to standard output by doxygen. If \c QUIET is set to \c YES this implies that the messages are off.
]]>
      </docs>
    </option>
@@ -1140,8 +1139,8 @@ FILE_VERSION_INFO = "cleartool desc -fmt \%Vn"
      <docs>
<![CDATA[
 The \c WARNINGS tag can be used to turn on/off the warning messages that are
 generated to standard error (\c stderr) by doxygen. Possible values are \c YES and \c NO, 
 where \c YES implies that the warnings are on.
 generated to standard error (\c stderr) by doxygen. If \c WARNINGS is set to 
 \c YES this implies that the warnings are on.
<br>
 \b Tip: Turn warnings on while writing the documentation.
]]>
@@ -1196,7 +1195,7 @@ FILE_VERSION_INFO = "cleartool desc -fmt \%Vn"
<![CDATA[
 The \c WARN_LOGFILE tag can be used to specify a file to which warning
 and error messages should be written. If left blank the output is written 
 to standard error (\c stderr).
 to standard error (`stderr`).
]]>
      </docs>
    </option>
@@ -1282,8 +1281,7 @@ FILE_VERSION_INFO = "cleartool desc -fmt \%Vn"
      <docs>
<![CDATA[
 The \c RECURSIVE tag can be used to specify whether or not subdirectories
 should be searched for input files as well. Possible values are \c YES 
 and \c NO.
 should be searched for input files as well.
]]>
      </docs>
    </option>
@@ -1350,7 +1348,7 @@ FILE_VERSION_INFO = "cleartool desc -fmt \%Vn"
 blank all files are included.
]]>
      </docs>
      <value name='*'/>
      <value name='*' show_docu='NO'/>
    </option>
    <option type='bool' id='EXAMPLE_RECURSIVE' defval='0'>
      <docs>
@@ -1829,7 +1827,6 @@ hr.footer {
 see http://en.wikipedia.org/wiki/Hue for more information. 
 For instance the value 0 represents red, 60 is yellow, 120 is green, 
 180 is cyan, 240 is blue, 300 purple, and 360 is red again. 
 The allowed range is 0 to 359. 
]]>
      </docs>
    </option>
@@ -2746,7 +2743,7 @@ front of it.
      </docs>
    </option>
  </group>
  <group name='DEF' docs='Configuration options for the AutoGen Definitions output'>
  <group name='AutoGen' docs='Configuration options for the AutoGen Definitions output'>
    <option type='bool' id='GENERATE_AUTOGEN_DEF' defval='0'>
      <docs>
<![CDATA[
Loading