]> git.lyx.org Git - features.git/commitdiff
We don't need to rescan everything from the BibTeX dialog, just
authorRichard Heck <rgheck@lyx.org>
Tue, 1 May 2012 16:54:17 +0000 (12:54 -0400)
committerRichard Heck <rgheck@lyx.org>
Tue, 1 May 2012 16:54:17 +0000 (12:54 -0400)
the bib and bst files.

src/frontends/qt4/GuiBibtex.cpp
src/frontends/qt4/qt_helpers.cpp
src/frontends/qt4/qt_helpers.h

index 6dd8d8f650b56b2ba492037f61829a8caae8c974..8a2a27d7f35c98ea1ffc57152cf12a44ab774d17 100644 (file)
@@ -484,7 +484,7 @@ QStringList GuiBibtex::bibFiles() const
 
 void GuiBibtex::rescanBibStyles() const
 {
-       rescanTexStyles();
+       rescanTexStyles("bst bib");
 }
 
 
index 59a3d67fd2e224aa0fe25cf5f4f0d5bdc72fc7fd..dcbd2e9cb192d8fffefe0f672fc130d16ee37e1e 100644 (file)
@@ -210,20 +210,21 @@ QString const qt_(string const & str)
 }
 
 
-void rescanTexStyles()
+void rescanTexStyles(string const & arg)
 {
        // Run rescan in user lyx directory
        PathChanger p(package().user_support());
-       FileName const command = support::libFileSearch("scripts", "TeXFiles.py");
+       FileName const prog = support::libFileSearch("scripts", "TeXFiles.py");
        Systemcall one;
-       int const status = one.startscript(Systemcall::Wait,
-                       os::python() + ' ' +
-                       quoteName(command.toFilesystemEncoding()));
+       string const command = os::python() + ' ' +
+           quoteName(prog.toFilesystemEncoding()) + ' ' +
+           arg;
+       int const status = one.startscript(Systemcall::Wait, command);
        if (status == 0)
                return;
        // FIXME UNICODE
        frontend::Alert::error(_("Could not update TeX information"),
-               bformat(_("The script `%1$s' failed."), from_utf8(command.absFileName())));
+               bformat(_("The script `%1$s' failed."), from_utf8(prog.absFileName())));
 }
 
 
index d7a471ca069bce8c4d2b98585afe70c49ba0ce3e..4a3855d5c36bd4adb1ff0c7c33d2422d6654edf2 100644 (file)
@@ -127,8 +127,10 @@ QString browseRelToSub(QString const & filename,
 
 /** Build filelists of all availabe bst/cls/sty-files. Done through
 *  kpsewhich and an external script, saved in *Files.lst.
+*  \param arg: cls, sty, bst, or bib, as required by TeXFiles.py.
+*         Can be a list of these, too.
 */
-void rescanTexStyles();
+void rescanTexStyles(std::string const & arg = empty_string());
 
 /** Fill \c contents from one of the three texfiles.
  *  Each entry in the file list is returned as a name_with_path