]> git.lyx.org Git - features.git/commitdiff
Don't write a \bibtex_command to the preferences file if not needed.
authorEnrico Forestieri <forenr@lyx.org>
Thu, 28 May 2009 00:25:40 +0000 (00:25 +0000)
committerEnrico Forestieri <forenr@lyx.org>
Thu, 28 May 2009 00:25:40 +0000 (00:25 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29871 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiDocument.cpp
src/frontends/qt4/GuiIndices.cpp
src/frontends/qt4/GuiPrefs.cpp

index 8e47d9ed2481a658c0862bf141087386d738aecf..ec015597e9f07b87b2b357ed932ba9abeda55330 100644 (file)
@@ -1744,11 +1744,12 @@ void GuiDocument::applyView()
        string const bibtex_command =
                fromqstr(biblioModule->bibtexCO->itemData(
                        biblioModule->bibtexCO->currentIndex()).toString());
-       if (bibtex_command == "default")
+       string const bibtex_options =
+               fromqstr(biblioModule->bibtexOptionsED->text());
+       if (bibtex_command == "default" || bibtex_options.empty())
                bp_.bibtex_command = bibtex_command;
        else
-               bp_.bibtex_command = bibtex_command + " "
-                       + fromqstr(biblioModule->bibtexOptionsED->text());
+               bp_.bibtex_command = bibtex_command + " " + bibtex_options;
 
        // Indices
        indicesModule->apply(bp_);
index d44a377d1317935de709862f651fd3f9d5eeaa7c..969b86ad5d22b4e5ff58d1556d63696c74823146 100644 (file)
@@ -136,11 +136,11 @@ void GuiIndices::apply(BufferParams & params) const
        string const index_command =
                fromqstr(indexCO->itemData(
                        indexCO->currentIndex()).toString());
-       if (index_command == "default")
+       string const index_options = fromqstr(indexOptionsED->text());
+       if (index_command == "default" || index_options.empty())
                params.index_command = index_command;
        else
-               params.index_command = index_command + " "
-                       + fromqstr(indexOptionsED->text());
+               params.index_command = index_command + " " + index_options;
 }
 
 
index 596233bdb8f1638e8d03c2515b7bd330311106e5..818a3e2396aa0ac5243d976b2a40fc41564d02c1 100644 (file)
@@ -670,19 +670,29 @@ void PrefLatex::on_latexIndexCO_activated(int n)
 
 void PrefLatex::apply(LyXRC & rc) const
 {
+       // If bibtex is not empty, bibopt contains the options, otherwise
+       // it is a customized bibtex command with options.
        QString const bibtex = latexBibtexCO->itemData(
                latexBibtexCO->currentIndex()).toString();
+       QString const bibopt = latexBibtexED->text();
        if (bibtex.isEmpty())
-               rc.bibtex_command = fromqstr(latexBibtexED->text());
+               rc.bibtex_command = fromqstr(bibopt);
+       else if (bibopt.isEmpty())
+               rc.bibtex_command = fromqstr(bibtex);
        else
-               rc.bibtex_command = fromqstr(bibtex) + " " + fromqstr(latexBibtexED->text());
+               rc.bibtex_command = fromqstr(bibtex) + " " + fromqstr(bibopt);
 
+       // If index is not empty, idxopt contains the options, otherwise
+       // it is a customized index command with options.
        QString const index = latexIndexCO->itemData(
                latexIndexCO->currentIndex()).toString();
+       QString const idxopt = latexIndexED->text();
        if (index.isEmpty())
-               rc.index_command = fromqstr(latexIndexED->text());
+               rc.index_command = fromqstr(idxopt);
+       else if (idxopt.isEmpty())
+               rc.index_command = fromqstr(index);
        else
-               rc.index_command = fromqstr(index) + " " + fromqstr(latexIndexED->text());
+               rc.index_command = fromqstr(index) + " " + fromqstr(idxopt);
 
        rc.fontenc = fromqstr(latexEncodingED->text());
        rc.chktex_command = fromqstr(latexChecktexED->text());