On 05/01/2012 12:39 AM, Scott Kostyshak wrote:
I'm not sure how to handle this. I have two .bst files with the same name:
/usr/local/texlive/2011/texmf-dist/bibtex/bst/beebe/econometrica.bst
/usr/local/texlive/2011/texmf-dist/bibtex/bst/economic/econometrica.bst
Because of this I get duplicate entries when choosing a bibstyle in
the bibtex inset dialog. Choosing one of the duplicate entries has the
same effect as choosing another because only the name, not the path,
is passed in the end. The attached patch makes it so the inset does
not display duplicate entries. I'm not sure this is the way to go.
Maybe the duplicate entries should be left so that the user knows
there is more than one entry with the same name.
It certainly does seem misleading to offer the user two choices that do
the same thing. But of course there could be cases where you had two bst
files with the same name that did different things, though LyX couldn't
support that.
So a different option might be to modify GuiBibtex::bibStyles() so that
it would give the full path, if that were necessary. But I'm not sure
what's best here. Any other views?
Richard
diff --git a/src/frontends/qt4/GuiBibtex.cpp b/src/frontends/qt4/GuiBibtex.cpp
index 6dd8d8f..4ef68ef 100644
--- a/src/frontends/qt4/GuiBibtex.cpp
+++ b/src/frontends/qt4/GuiBibtex.cpp
@@ -342,11 +342,15 @@ void GuiBibtex::updateContents()
int item_nr = -1;
QStringList str = bibStyles();
+ QString prevItem("?*?*");
for (int i = 0; i != str.count(); ++i) {
QString item = changeExtension(str[i], "");
if (item == bibstyle)
item_nr = i;
- styleCB->addItem(item);
+ if (item != prevItem) {
+ styleCB->addItem(item);
+ prevItem = item;
+ }
}
if (item_nr == -1&& !bibstyle.isEmpty()) {
Any comments?
Thanks,
Scott