]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiIdListModel.cpp
do what the FIXME suggested
[lyx.git] / src / frontends / qt4 / GuiIdListModel.cpp
index 658be130237e877c8bfc4a0f32db8ea0bff0ce8b..2d15b0efabf511c46c25b3660e67fbdbac4c8dcc 100644 (file)
@@ -93,7 +93,7 @@ void GuiIdListModel::insertRow(int const i, QString const & uiString,
 }
 
 
-QMap<int, QVariant> GuiIdListModel::itemData(QModelIndex const & index ) const
+QMap<int, QVariant> GuiIdListModel::itemData(QModelIndex const & index) const
 {
        int const row = index.row();
        if (!rowIsValid(row))
@@ -103,6 +103,18 @@ QMap<int, QVariant> GuiIdListModel::itemData(QModelIndex const & index ) const
        return qm;
 }
 
+
+int GuiIdListModel::findIDString(std::string const & idString) 
+{
+       vector<OurData>::const_iterator it  = userData_.begin();
+       vector<OurData>::const_iterator end = userData_.end();
+       for (; it != end; ++it)
+               if (fromqstr(it->idString.toString()) == idString)
+                       return it - userData_.begin();
+       return -1;
+}
+
+
 #if 0
 // The following functions are currently unused but are retained here in
 //   case they should at some point be useful.
@@ -126,15 +138,6 @@ void GuiIdListModel::insertRow(int const i, QString const & uiString,
        setIDString(i, idString);
 }
 
-bool GuiIdListModel::containsID(QVariant const & q) const
-{
-       vector<OurData>::const_iterator it  = userData_.begin();
-       vector<OurData>::const_iterator end = userData_.end();
-       for (; it != end; ++it)
-               if (it->idString == q)
-                       return true;
-       return false;
-}
 #endif
 
 } // namespace frontend