Imported cb2bib-1.4.0

Summary: Imported cb2bib-1.4.0
Keywords:

Imported cb2bib-1.4.0
into Git repository
parent 9a77ae3a
2010-04-24 RELEASE OF VERSION 1.4.0
2010-04-23 Set c2bCiter to remember display format
2010-04-22 Set clipboard connected mode default in c2bCiter
2010-04-22 Remember last current citation in c2bCiter
2010-04-22 Updated several icons in editor
2010-03-21 Set workaround for cleared line edits showing cursor (QTBUG-7866)
2010-03-21 Postprocess DOI to clear URL formatting
2010-03-21 Added chronological view in c2bCiter
2010-02-22 RELEASE OF VERSION 1.3.7
2010-02-21 Validate author in PubMed XML parser
2010-02-21 Avoid stopping network queries when one fails
2010-02-21 Set minor improvements for year, volume, page recognition
2010-02-21 Updated style sheet for reference browsing
2010-02-20 Fallback title to booktitle to file name in views
2010-02-20 Set --sloppy to accept all files
2010-02-20 Consider shortcut to write/update source document's metadata (Thanks to S. Kreisel)
2010-02-20 Consider c2bCiter's filter to be connected to clipboard (Thanks to H. Seifzadeh)
2010-02-20 Fixed Medline parsing in some cases with uppercased hyphenated words (Thanks to F. Rusconi)
2010-01-05 RELEASE OF VERSION 1.3.6
2010-01-04 Added 'Fore IJ Last' formatted author recognition
2010-01-02 Minor improvements in journal recognition
......
/* cb2Bib References CSS */
/* general */
body {
font-size: 100%;
font-family: sans-serif;
background-color: #5C656D;
color: #ECECEC;
padding: 0;
margin: 0;
}
a {
color: #EDE159;
text-decoration: none;
}
a:link {
color: #EDE159;
text-decoration: underline;
}
h1
{
color: #ECECEC;
font-size: 20px;
font-variant: small-caps;
font-family: sans-serif;
}
/* references */
#references{
background-color: #23445b;
}
#references blockquote{
font-size: small;
}
#references span{
color: #FFFFFF;
font-weight: bold;
}
#excerpt{
font-style: italic;
}
/* header */
#header {
vertical-align: middle;
}
/* footer */
#footer {
color: #E4E3E2;
font-family: arial, sans-serif;
font-size: small;
}
#footer td{
padding: 10px;
padding-left: 5px;
padding-right: 5px;
}
......@@ -5,34 +5,35 @@
body {
font-size: 100%;
font-family: sans-serif;
background-color: #5C656D;
color: #ECECEC;
background-color: #818B93;
color: black;
padding: 0;
margin: 0;
}
a {
color: #EDE159;
color: #D8D7D7;
text-decoration: none;
}
a:link {
color: #EDE159;
color: #D8D7D7;
text-decoration: underline;
}
h1
{
color: #ECECEC;
color: #C7C6C6;
font-size: 20px;
font-variant: small-caps;
font-family: sans-serif;
}
/* references */
#references{
background-color: #23445b;
background-color: #818B93;
}
#references blockquote{
......@@ -40,8 +41,7 @@ font-size: small;
}
#references span{
color: #FFFFFF;
font-weight: bold;
color: #E4E3E2;
}
#excerpt{
......@@ -57,7 +57,7 @@ vertical-align: middle;
/* footer */
#footer {
color: #E4E3E2;
color: #C7C6C6;
font-family: arial, sans-serif;
font-size: small;
}
......
/***************************************************************************
* Copyright (C) 2004-2010 by Pere Constans
* constans@molspaces.com
* cb2Bib version 1.3.6. Licensed under the GNU GPL version 3.
* cb2Bib version 1.4.0. Licensed under the GNU GPL version 3.
* See the LICENSE file that comes with this distribution.
***************************************************************************/
#include "bookmarkPlugin.h"
......
/***************************************************************************
* Copyright (C) 2004-2010 by Pere Constans
* constans@molspaces.com
* cb2Bib version 1.3.6. Licensed under the GNU GPL version 3.
* cb2Bib version 1.4.0. Licensed under the GNU GPL version 3.
* See the LICENSE file that comes with this distribution.
***************************************************************************/
#ifndef BOOKMARKPLUGIN_H
......
/***************************************************************************
* Copyright (C) 2004-2010 by Pere Constans
* constans@molspaces.com
* cb2Bib version 1.3.6. Licensed under the GNU GPL version 3.
* cb2Bib version 1.4.0. Licensed under the GNU GPL version 3.
* See the LICENSE file that comes with this distribution.
***************************************************************************/
#include "c2b.h"
#include "c2bClipboard.h"
#include "c2bConfigure.h"
#include "ui_proxyDialog.h"
......@@ -20,33 +21,37 @@
*/
c2b::c2b(QWidget* main, QObject* parento) : QObject(parento)
{
Q_ASSERT_X(!c2b_single_instance, "c2b", "cb2Bib resources already instantiated");
c2b::c2b_single_instance = this;
c2b_main = main;
Q_ASSERT_X(!_c2b_single_instance, "c2b", "cb2Bib resources already instantiated");
c2b::_c2b_single_instance = this;
_c2b_main = main;
if (c2b_main->inherits("cb2Bib"))
if (_c2b_main->inherits("cb2Bib"))
{
// Creating Bibliographic Parser
c2b_bibparser = new c2bBibParser(this);
// Create bibliographic parser
_c2b_bibparser = new c2bBibParser(this);
// Creating cb2Bib network
c2b_network = new network(this);
connect(c2b_network, SIGNAL(proxyAuthenticationRequired(const QNetworkProxy&, QAuthenticator*)),
// Create cb2Bib network
_c2b_network = new network(this);
connect(_c2b_network, SIGNAL(proxyAuthenticationRequired(const QNetworkProxy&, QAuthenticator*)),
this, SLOT(proxyAuthenticationRequired(const QNetworkProxy&, QAuthenticator*)));
connect(c2b_network, SIGNAL(downloadProgress(qint64, qint64)), this, SLOT(updateDownloadProgress(qint64, qint64)));
downloadProgress = new QProgressDialog(c2b_main);
downloadProgress->setWindowTitle("cb2Bib");
connect(downloadProgress, SIGNAL(canceled()), c2b_network, SLOT(cancelDownload()));
connect(_c2b_network, SIGNAL(downloadProgress(qint64, qint64)), this, SLOT(updateDownloadProgress(qint64, qint64)));
_download_progress = new QProgressDialog(_c2b_main);
_download_progress->setWindowTitle("cb2Bib");
connect(_download_progress, SIGNAL(canceled()), _c2b_network, SLOT(cancelDownload()));
// Creating cb2Bib network query info
c2b_netqinf = new c2bNetworkQueryInfo(this);
// Create cb2Bib network query info
_c2b_netqinf = new c2bNetworkQueryInfo(this);
// Creating cb2Bib metadata parser
c2b_metadataparser = new metadataParser(c2b_bibparser, this);
connect(c2b_metadataparser, SIGNAL(showMessage(const QString&, const QString&)),
// Create cb2Bib metadata parser
_c2b_metadataparser = new metadataParser(_c2b_bibparser, this);
connect(_c2b_metadataparser, SIGNAL(showMessage(const QString&, const QString&)),
this, SLOT(showMessage(const QString&, const QString&)));
// Create cb2Bib clipboard
_c2b_clipboard = new c2bClipboard(this);
_c2b_clipboard->setConnected(true);
}
else if (c2b_main->inherits("c2bAnnote"))
else if (_c2b_main->inherits("c2bAnnote"))
{
// Nothing is needed at present for the c2bAnnote
}
......@@ -56,16 +61,16 @@ c2b::c2b(QWidget* main, QObject* parento) : QObject(parento)
c2b::~c2b()
{
c2b_single_instance = 0;
_c2b_single_instance = 0;
}
c2b* c2b::c2b_single_instance = 0;
c2b* c2b::_c2b_single_instance = 0;
void c2b::showMessage(const QString& title, const QString& ms)
{
QMessageBox::warning(c2b_main, title, ms, QMessageBox::Ok);
QMessageBox::warning(_c2b_main, title, ms, QMessageBox::Ok);
}
void c2b::configure(int index)
......@@ -82,7 +87,7 @@ void c2b::configure(int index)
void c2b::exitRequested()
{
foreach(QWidget* w, QApplication::topLevelWidgets())
foreach(QWidget * w, QApplication::topLevelWidgets())
{
// So far only editors grant user exit cancellation
// Avoid closing other visible widgets until exit is granted
......@@ -91,7 +96,7 @@ void c2b::exitRequested()
w->close();
}
qApp->processEvents();
foreach(QWidget* widget, QApplication::topLevelWidgets())
foreach(QWidget * widget, QApplication::topLevelWidgets())
{
if (widget->isVisible())
if (widget->inherits("c2bEditor"))
......@@ -109,17 +114,17 @@ void c2b::updateDownloadProgress(qint64 bytesReceived, qint64 bytesTotal)
return;
if (bytesReceived == bytesTotal)
{
downloadProgress->reset();
_download_progress->reset();
return;
}
downloadProgress->setLabelText(tr("Retrieving from %1...").arg(QUrl(c2b_network->sourceFilename()).host()));
downloadProgress->setMaximum((int)bytesTotal);
downloadProgress->setValue((int)bytesReceived);
_download_progress->setLabelText(tr("Retrieving from %1...").arg(QUrl(_c2b_network->sourceFilename()).host()));
_download_progress->setMaximum((int)bytesTotal);
_download_progress->setValue((int)bytesReceived);
}
void c2b::proxyAuthenticationRequired(const QNetworkProxy& proxy, QAuthenticator* auth)
{
QDialog dialog(c2b_main);
QDialog dialog(_c2b_main);
Ui::proxyDialog proxyDialog;
proxyDialog.setupUi(&dialog);
dialog.setWindowTitle(tr("Proxy %1 Authentication - cb2Bib").arg(proxy.hostName()));
......@@ -129,5 +134,5 @@ void c2b::proxyAuthenticationRequired(const QNetworkProxy& proxy, QAuthenticator
auth->setPassword(proxyDialog.passwordLineEdit->text());
}
else
c2b_network->cancelDownload();
_c2b_network->cancelDownload();
}
/***************************************************************************
* Copyright (C) 2004-2010 by Pere Constans
* constans@molspaces.com
* cb2Bib version 1.3.6. Licensed under the GNU GPL version 3.
* cb2Bib version 1.4.0. Licensed under the GNU GPL version 3.
* See the LICENSE file that comes with this distribution.
***************************************************************************/
#ifndef C2B_H
......@@ -15,6 +15,9 @@
#include <QObject>
class c2bClipboard;
class QProgressDialog;
class QWidget;
......@@ -52,33 +55,38 @@ public:
// Pointers
inline static c2b* instance()
{
Q_ASSERT_X(c2b_single_instance, "c2b", "cb2Bib resources were not instantiated");
return c2b_single_instance;
Q_ASSERT_X(_c2b_single_instance, "c2b", "cb2Bib resources were not instantiated");
return _c2b_single_instance;
}
inline static QWidget* mainWidget()
{
return instance()->c2b_main;
return instance()->_c2b_main;
}
inline static c2bClipboard* clipboard()
{
return instance()->_c2b_clipboard;
}
inline static network* net()
{
return instance()->c2b_network;
return instance()->_c2b_network;
}
inline static c2bNetworkQueryInfo* netqinf()
{
return instance()->c2b_netqinf;
return instance()->_c2b_netqinf;
}
inline static c2bBibParser* bibParser()
{
return instance()->c2b_bibparser;
return instance()->_c2b_bibparser;
}
inline static metadataParser* metaParser()
{
return instance()->c2b_metadataparser;
return instance()->_c2b_metadataparser;
}
......@@ -93,13 +101,14 @@ signals:
private:
QProgressDialog* downloadProgress;
QWidget* c2b_main;
c2bBibParser* c2b_bibparser;
c2bNetworkQueryInfo* c2b_netqinf;
metadataParser* c2b_metadataparser;
network* c2b_network;
static c2b* c2b_single_instance;
QProgressDialog* _download_progress;
QWidget* _c2b_main;
c2bBibParser* _c2b_bibparser;
c2bClipboard* _c2b_clipboard;
c2bNetworkQueryInfo* _c2b_netqinf;
metadataParser* _c2b_metadataparser;
network* _c2b_network;
static c2b* _c2b_single_instance;
inline void emitMessage(const QString& message)
{
......
/***************************************************************************
* Copyright (C) 2004-2010 by Pere Constans
* constans@molspaces.com
* cb2Bib version 1.3.6. Licensed under the GNU GPL version 3.
* cb2Bib version 1.4.0. Licensed under the GNU GPL version 3.
* See the LICENSE file that comes with this distribution.
*
* Class implementation of the approximate search algorithm
......@@ -66,8 +66,8 @@ void approximatePattern::setPattern(const QString& pattern, const Qt::CaseSensit
qDebug() << _string_pieces << max_blocks << scan_factor << requested_blocks << pieces_per_block << _string_pieces.count() % blocks;
for (int b = 0; b < blocks; ++b)
for (int i = 0; i < pieces_per_block; ++i)
if (b + (i*blocks) < _string_pieces.count())
qDebug() << "block# " << b << "pick item " << b + (i*blocks) << _string_pieces.at(b + (i*blocks));
if (b + (i * blocks) < _string_pieces.count())
qDebug() << "block# " << b << "pick item " << b + (i * blocks) << _string_pieces.at(b + (i * blocks));
#endif
_ranks.clear();
......@@ -256,9 +256,9 @@ int approximatePattern::stretch(int piece_i, int piece_j) const
const int minStretch(3);
const int maxStretch(20);
if (_string_pieces.at(piece_j).length() > 4)
return qMax((maxStretch*(piece_j - piece_i)), minStretch*(_piece_starts.at(piece_j) - _piece_ends.at(piece_i)));
return qMax((maxStretch * (piece_j - piece_i)), minStretch * (_piece_starts.at(piece_j) - _piece_ends.at(piece_i)));
else
return minStretch*(_piece_starts.at(piece_j) - _piece_ends.at(piece_i)); // Estimated error ratio only
return minStretch * (_piece_starts.at(piece_j) - _piece_ends.at(piece_i)); // Estimated error ratio only
}
void approximatePattern::mergeIndices(int* index_in, const QString& str) const
......
/***************************************************************************
* Copyright (C) 2004-2010 by Pere Constans
* constans@molspaces.com
* cb2Bib version 1.3.6. Licensed under the GNU GPL version 3.
* cb2Bib version 1.4.0. Licensed under the GNU GPL version 3.
* See the LICENSE file that comes with this distribution.
*
* Class implementation of the approximate search algorithm
......
/***************************************************************************
* Copyright (C) 2004-2010 by Pere Constans
* constans@molspaces.com
* cb2Bib version 1.3.6. Licensed under the GNU GPL version 3.
* cb2Bib version 1.4.0. Licensed under the GNU GPL version 3.
* See the LICENSE file that comes with this distribution.
***************************************************************************/
#include "authorString.h"
......@@ -200,7 +200,7 @@ QString authorString::toBibTeX(const QString& author, bool full_form)
const int fore_length(fore_name.length());
const bool is_uppercase(!containLowerCaseLetter(fore_name));
if (fore_name_parts.count() == 1 && fore_length > 1 &&
!are_authors_in_uppercase && is_uppercase)
!are_authors_in_uppercase && is_uppercase)
{
// Cases 'Last, FST': Always abbreviated, no call to processFirstMiddle
for (int l = 0; l < fore_length; ++l)
......
/***************************************************************************
* Copyright (C) 2004-2010 by Pere Constans
* constans@molspaces.com
* cb2Bib version 1.3.6. Licensed under the GNU GPL version 3.
* cb2Bib version 1.4.0. Licensed under the GNU GPL version 3.
* See the LICENSE file that comes with this distribution.
***************************************************************************/
#ifndef AUTHORSTRING_H
......
/***************************************************************************
* Copyright (C) 2004-2010 by Pere Constans
* constans@molspaces.com
* cb2Bib version 1.3.6. Licensed under the GNU GPL version 3.
* cb2Bib version 1.4.0. Licensed under the GNU GPL version 3.
* See the LICENSE file that comes with this distribution.
***************************************************************************/
#include "bibExtractor.h"
......@@ -27,7 +27,7 @@ bibExtractor::bibExtractor(QObject* parento) : QObject(parento), cout(*(new QTex
}
bibExtractor::bibExtractor(bibParser* bp, metadataParser* mp, networkQuery* nq, QObject* parento) :
QObject(parento), cout(*(new QTextStream(stdout))), _bpP(bp), _mpP(mp), _networkQP(nq)
QObject(parento), cout(*(new QTextStream(stdout))), _bpP(bp), _mpP(mp), _networkQP(nq)
{
_settingsP = settings::instance();
Q_ASSERT_X(_bpP, "bibExtractor", "bibParser was not instantiated");
......@@ -179,16 +179,18 @@ void bibExtractor::extract(const QString& text)
void bibExtractor::_extract(const QString& text)
{
_bpP->clearCurrentReference();
_bpP->setReferenceType("unknown");
if (text.trimmed().isEmpty())
{
logMessage(tr("Warning: Empty input string."));
return;
}
_bpP->setReferenceType("article");
QString out_text, out_tagtext;
if (_settingsP->value("cb2Bib/PreparserAutomatic").toBool())
_bpP->preparse(text, &out_text);
_bpP->parse(text, &out_text, &out_tagtext);
if (_bpP->fieldCount() > 0)
_bpP->setReferenceType("article");
logMessage(_bpP->autoRecognizedString());
}
......@@ -225,7 +227,7 @@ void bibExtractor::logMessage(const QString& ms) const
bool bibExtractor::isReliable() const
{
if (_settingsP->cl_sloppy)
return _bpP->fieldCount() > 0;
return true;
else
return _bpP->isAutoRecognized();
}
......
/***************************************************************************
* Copyright (C) 2004-2010 by Pere Constans
* constans@molspaces.com
* cb2Bib version 1.3.6. Licensed under the GNU GPL version 3.
* cb2Bib version 1.4.0. Licensed under the GNU GPL version 3.
* See the LICENSE file that comes with this distribution.
***************************************************************************/
#ifndef BIBEXTRACTOR_H
......
/***************************************************************************
* Copyright (C) 2004-2010 by Pere Constans
* constans@molspaces.com
* cb2Bib version 1.3.6. Licensed under the GNU GPL version 3.
* cb2Bib version 1.4.0. Licensed under the GNU GPL version 3.
* See the LICENSE file that comes with this distribution.
***************************************************************************/
#include "bibParser.h"
......@@ -88,6 +88,8 @@ QString bibParser::parse(const QString& field, const QString& value, const QStri
else
v = init_value + " and " + _authorString.toBibTeX(v, _settingsP->value("cb2Bib/UseFullNames").toBool());
}
else if (field == "doi")
v.remove(QRegExp("^.+(?=10\\.[\\d\\.]+/\\S+)"));
else if (field == "journal")
{
if (_settingsP->value("cb2Bib/SetJournalsToFullname").toBool())
......@@ -100,6 +102,9 @@ QString bibParser::parse(const QString& field, const QString& value, const QStri
v.replace(" - ", ",");
QStringList kl(v.split(QRegExp("[^\\w\\s-']"), QString::SkipEmptyParts));
kl.removeAll(" ");
#if QT_VERSION >= 0x040500
kl.removeDuplicates();
#endif
v = kl.join(", ");
v.replace(QRegExp("\\s+,"), ",");
v = v.toLower();
......@@ -285,7 +290,7 @@ void bibParser::preparse(const QString& text, QString* out_text)
- Check if input stream is already a BibTeX entry. If so, process entry.
- Check if input stream is a PubMed - Medline Journal entry. If so, process entry.
- Check if input stream is a PubMed XML or Medline entry. If so, process entry.
- Preprocess author names: PI JOAN III -> Pi III, J.
(care of name prefixes, suffixes, and removal of ambiguities).
......@@ -310,7 +315,7 @@ void bibParser::preparse(const QString& text, QString* out_text)
If the automatic recognition engine fails, optionally, a heuristic guessing
will be performed. See also \ref heuristic_guess and \ref metadata.
will be performed. See also \ref heuristicguess and \ref metadata.
*/
void bibParser::parse(const QString& text, QString* out_text, QString* out_tagtext)
......@@ -349,13 +354,14 @@ void bibParser::parse(const QString& text, QString* out_text, QString* out_tagte
_current_reference.typeName = "article";
otext = ' ' + otext;
ottext = otext;
ottext.replace(QRegExp("[\\n\\r]\\s*([A-Z]{1,4}\\s*-)"), "][\\1");
// http://www.nlm.nih.gov/bsd/mms/medlineelements.html
ottext.replace(QRegExp("[\\n\\r]\\s*([A-Z]{2,4}\\s*-)"), "][\\1"); // Two to four capital letter in field tags
ottext = c2bUtils::simplifyString(ottext);
if (!ottext.contains(QRegExp("\\[FAU\\s+-")))
ottext.replace(QRegExp("\\[(AU\\s*-\\s*[-'\\w]+)"), "[F\\1 ");
QStringList fList(ottext.split("]["));
QString kw;
QRegExp fld("^([A-Z]{1,4})\\s{0,1}-\\s*(.+)$");
QRegExp fld("^([A-Z]{2,4})\\s{0,1}-\\s*(.+)$");
fld.setPatternSyntax(QRegExp::RegExp2);
for (QStringList::Iterator it = fList.begin(); it != fList.end(); ++it)
{
......@@ -399,28 +405,7 @@ void bibParser::parse(const QString& text, QString* out_text, QString* out_tagte
return;
}
QRegExp rxdoi("(10.[\\d\\.]+/\\S+)");
if (rxdoi.indexIn(otext) > -1)
{
QString cdoi(rxdoi.cap(1));
// This happens when publishers set doi to title in metadata: <title>doi:10. ... </title>
if (cdoi.endsWith("</title>"))
cdoi.chop(8);
if (cdoi.endsWith(','))
cdoi.chop(1);
_current_reference["doi"] = parse("doi", cdoi);
}
QRegExp rxarxiv("arXiv:([\\w\\./-]+)");
if (rxarxiv.indexIn(otext) > -1)
{
_current_reference["journal"] = parse("journal", rxarxiv.cap(0));
_current_reference["url"] = parse("url", QString("http://arxiv.org/abs/%1").arg(rxarxiv.cap(1)));
}
QRegExp rxhtml("((http://|https://|ftp://|www\\.|ftp\\.)(www\\.|ftp\\.){0,1}\\S+)");
if (rxhtml.indexIn(otext) > -1)
_current_reference["url"] = parse("url", rxhtml.cap(1));
_heuristic_parserP->heuristicFields(otext);
// Set tags and start regular expression extraction
ottext = setTags(otext);
......@@ -538,6 +523,7 @@ void bibParser::guessFields(const QString& text)
{
const QString clean_text(text.simplified());
const QString tagged_text(setTags(text));
_heuristic_parserP->heuristicFields(clean_text);
_heuristic_parserP->guessFields(clean_text, tagged_text);
currentReferenceUpdated();
_auto_recognized_string = tr("%1 fields guessed.").arg(fieldCount());
......@@ -558,7 +544,7 @@ QString bibParser::setTags(const QString& text) const
tagged_text += spText[n-1];
spText = tagged_text.split(QRegExp("(\\s{10,}|\\t)"));
n = spText.count();
tagged_text = "";
tagged_text.clear();
for (int i = 0; i < n - 1; i++)
tagged_text += spText.at(i) + QString("<Tab%1>").arg(i + 1);
tagged_text += spText[n-1];
......
/***************************************************************************
* Copyright (C) 2004-2010 by Pere Constans
* constans@molspaces.com
* cb2Bib version 1.3.6. Licensed under the GNU GPL version 3.
* cb2Bib version 1.4.0. Licensed under the GNU GPL version 3.
* See the LICENSE file that comes with this distribution.
***************************************************************************/
#ifndef BIBPARSER_H
......
/***************************************************************************
* Copyright (C) 2004-2010 by Pere Constans
* constans@molspaces.com
* cb2Bib version 1.3.6. Licensed under the GNU GPL version 3.
* cb2Bib version 1.4.0. Licensed under the GNU GPL version 3.
* See the LICENSE file that comes with this distribution.
***************************************************************************/
#include "bibPreparser.h"
......
/***************************************************************************
* Copyright (C) 2004-2010 by Pere Constans
* constans@molspaces.com
* cb2Bib version 1.3.6. Licensed under the GNU GPL version 3.
* cb2Bib version 1.4.0. Licensed under the GNU GPL version 3.
* See the LICENSE file that comes with this distribution.
***************************************************************************/
#ifndef BIBPREPARSER_H
......
/***************************************************************************
* Copyright (C) 2004-2010 by Pere Constans
* constans@molspaces.com
* cb2Bib version 1.3.6. Licensed under the GNU GPL version 3.
* cb2Bib version 1.4.0. Licensed under the GNU GPL version 3.
* See the LICENSE file that comes with this distribution.
***************************************************************************/
#ifndef BIBREFERENCE_H
......@@ -60,7 +60,12 @@ public:
{
const QString v(value("title"));
if (v.isEmpty())
return value("booktitle");
{
const QString v1(value("booktitle"));
if (v1.isEmpty())
return QFileInfo(value("file")).fileName();
return v1;
}