[referencer] Potential Bug fix and Extending Functionality

modphive at gmail.com modphive at gmail.com
Wed Oct 14 17:01:17 EDT 2009


So I am new to this list, so forgive me if I break any rules. I have been  
using referencer for a bit, and I came across a bug. When you select  
multiple items and click new library the program crashes. I mange to fix  
this by changing the onNewLibrary() function in RefWindow.C to:

{
if (ensureSaved ()) {
setDirty (false);

ignoreDocSelectionChanged_ = true;
ignoreTagSelectionChanged_ = true;

clearTagList ();
docview_->clear ();

library_->clear ();

populateTagList ();
docview_->populateDocStore ();

ignoreDocSelectionChanged_ = false;
ignoreTagSelectionChanged_ = false;

updateStatusBar ();
setOpenedLib ("");
}
}

Also, I am currently writing my Thesis, and I was wanting to have a library  
for each chapter of my thesis, however I was unable to copy from my main  
library to each individual library. My solution to this was to write a  
copyBib() function that would copy the bibTex information and you can use  
the PasteBibtex() function to paste into your new library. The copyBib()  
function looked like:

{
std::vector<Document*> docs = docview_->getSelectedDocs ();
std::vector<Document*>::iterator it = docs.begin ();
std::vector<Document*>::iterator const end = docs.end ();

Glib::ustring citationBib;

for (; it != end; ++it) {
Glib::ustring const bibValues = (*it)->printBibtex (false, false);
citationBib += bibValues;
}

Glib::RefPtr<Gtk::Clipboard> clipboard = Gtk::Clipboard::get ();

clipboard->set_text (citationBib);
}

Finally you just need to modify the header file and the ui file to make  
everything work. I hope this helps.

Cheers,
Chip
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://icculus.org/pipermail/referencer/attachments/20091014/538657c5/attachment.htm>


More information about the referencer mailing list