]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiRef.cpp
Fix handling of the add branch textfield in GuiBranches
[lyx.git] / src / frontends / qt4 / GuiRef.cpp
index defc14856f194d28141409fb90644a05b04e2f1b..5082daa2667023ff9fe9595372bd0403ce2cd776 100644 (file)
@@ -32,6 +32,7 @@
 #include <QPushButton>
 #include <QToolTip>
 #include <QCloseEvent>
+#include <QHeaderView>
 
 using namespace std;
 using namespace lyx::support;
@@ -254,7 +255,7 @@ void GuiRef::updateContents()
        FileNameList const & buffers = theBufferList().fileNames();
        for (FileNameList::const_iterator it = buffers.begin();
             it != buffers.end(); ++it) {
-               bufferCO->addItem(toqstr(makeDisplayPath(it->absFilename())));
+               bufferCO->addItem(toqstr(makeDisplayPath(it->absFileName())));
        }
 
        int const thebuffer = theBufferList().bufferNum(buffer().fileName());
@@ -354,7 +355,6 @@ void GuiRef::redoRefs()
 
        QStringList refsStrings;
        QStringList refsCategories;
-       refsCategories.append(qt_("No prefix"));
        vector<docstring>::const_iterator iter;
        for (iter = refs_.begin(); iter != refs_.end(); ++iter) {
                QString const lab = toqstr(*iter);
@@ -365,6 +365,10 @@ void GuiRef::redoRefs()
                                  refsCategories.append(pref);
                }
        }
+       // sort categories case-intensively
+       qSort(refsCategories.begin(), refsCategories.end(),
+             caseInsensitiveLessThan /*defined above*/);
+       refsCategories.insert(0, qt_("<No prefix>"));
 
        if (sortCB->isEnabled() && sortCB->isChecked()) {
                if(caseSensitiveCB->isEnabled() && caseSensitiveCB->isChecked())
@@ -383,7 +387,7 @@ void GuiRef::redoRefs()
                        for (int i = 0; i < refsStrings.size(); ++i) {
                                QString const ref = refsStrings.at(i);
                                if ((ref.startsWith(cat + QString(":")))
-                                   || (cat == qt_("No prefix")
+                                   || (cat == qt_("<No prefix>")
                                        && !ref.contains(":"))) {
                                        QTreeWidgetItem * child =
                                                new QTreeWidgetItem(item);
@@ -492,14 +496,14 @@ void GuiRef::filterLabels()
 
 bool GuiRef::initialiseParams(std::string const & data)
 {
-       InsetCommand::string2params("ref", data, params_);
+       InsetCommand::string2params(data, params_);
        return true;
 }
 
 
 void GuiRef::dispatchParams()
 {
-       std::string const lfun = InsetCommand::params2string("ref", params_);
+       std::string const lfun = InsetCommand::params2string(params_);
        dispatch(FuncRequest(getLfun(), lfun));
 }