- string const desc = lex.getString();
- LYXERR(Debug::TCLASS, "Desc: " << desc);
- if (!lex.next())
- break;
- bool avail = lex.getBool();
- LYXERR(Debug::TCLASS, "Avail: " << avail);
- if (!lex.next())
- break;
- string const prereq = lex.getString();
- LYXERR(Debug::TCLASS, "Prereq: " << prereq);
- // This code is run when we have
- // fname, clname, desc, prereq, and avail
- LayoutFile * tmpl = new LayoutFile(fname, clname, desc, prereq, avail);
- if (lyxerr.debugging(Debug::TCLASS)) {
- // only system layout files are loaded here so no
- // buffer path is needed.
- tmpl->load();
- }
- classmap_[fname] = tmpl;
- }
- }
- LYXERR(Debug::TCLASS, "End of parsing of textclass.lst");
-
- // lyx will start with an empty classmap_, but only reconfigure is allowed
- // in this case. This gives users a second chance to configure lyx if
- // initial configuration fails. (c.f. bug 2829)
+ default:
+ string const fname = lex.getString();
+ LYXERR(Debug::TCLASS, "Fname: " << fname);
+ if (!lex.next())
+ break;
+ string const clname = lex.getString();
+ LYXERR(Debug::TCLASS, "Clname: " << clname);
+ if (!lex.next())
+ break;
+ string const desc = lex.getString();
+ LYXERR(Debug::TCLASS, "Desc: " << desc);
+ if (!lex.next())
+ break;
+ bool avail = lex.getBool();
+ LYXERR(Debug::TCLASS, "Avail: " << avail);
+ if (!lex.next())
+ break;
+ string const prereq = lex.getString();
+ LYXERR(Debug::TCLASS, "Prereq: " << prereq);
+ if (!lex.next())
+ break;
+ string const category = lex.getString();
+ LYXERR(Debug::TCLASS, "Category: " << category);
+ // This code is run when we have
+ // fname, clname, desc, prereq, and avail
+ LayoutFile * tmpl = new LayoutFile(fname, clname, desc, prereq, category, avail);
+ if (lyxerr.debugging(Debug::TCLASS)) {
+ // only system layout files are loaded here so no
+ // buffer path is needed.
+ tmpl->load();
+ }
+ classmap_[fname] = tmpl;
+ } // end of switch
+ } // end of while loop
+ LYXERR(Debug::TCLASS, "End parsing of textclass.lst");
+ success = true;
+ } // end of else
+
+ // LyX will start with an empty classmap_. This is OK because
+ // (a) we will give the user a chance to reconfigure (see bug 2829) and
+ // (b) even if that fails, we can use addEmptyClass() to get some basic
+ // functionality.