remove duplicated code, (fix cmake merge)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22557 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Peter Kümmel 2008-01-14 19:52:16 +00:00
parent 29d74c47a8
commit 421fa672a7
3 changed files with 19 additions and 26 deletions

View File

@ -59,6 +59,7 @@
using namespace std;
using namespace lyx::support;
///
template<class Pair>
vector<typename Pair::second_type> const
@ -70,6 +71,7 @@ getSecond(vector<Pair> const & pr)
return tmp;
}
char const * const tex_graphics[] =
{
"default", "dvips", "dvitops", "emtex",
@ -135,6 +137,19 @@ vector<pair<string, lyx::docstring> > pagestyles;
namespace lyx {
namespace frontend {
///
QModelIndex getSelectedIndex(QListView * lv)
{
QModelIndex retval = QModelIndex();
QModelIndexList selIdx =
lv->selectionModel()->selectedIndexes();
if (!selIdx.empty())
retval = selIdx.first();
return retval;
}
namespace {
vector<string> getRequiredList(string const & modName)
{
@ -195,19 +210,6 @@ GuiSelectionManager(availableLV, selectedLV, addPB, delPB,
upPB, downPB, availableModel, selectedModel)
{}
namespace {
QModelIndex getSelectedIndex(QListView * lv)
{
QModelIndex retval = QModelIndex();
QModelIndexList selIdx =
lv->selectionModel()->selectedIndexes();
if (!selIdx.empty())
retval = selIdx.first();
return retval;
}
}
void ModuleSelMan::updateAddPB()
{

View File

@ -52,6 +52,9 @@ namespace frontend {
class GuiBranches;
class PreambleModule;
///
QModelIndex getSelectedIndex(QListView * lv);
///
typedef void const * BufferId;

View File

@ -14,6 +14,7 @@
#include <config.h>
#include "GuiSelectionManager.h"
#include "GuiDocument.h"
#include "support/debug.h"
@ -166,19 +167,6 @@ void GuiSelectionManager::selectedChanged(const QModelIndex & idx, const QModelI
}
namespace {
QModelIndex getSelectedIndex(QListView * lv)
{
QModelIndex retval = QModelIndex();
QModelIndexList selIdx =
lv->selectionModel()->selectedIndexes();
if (!selIdx.empty())
retval = selIdx.first();
return retval;
}
}
bool GuiSelectionManager::insertRowToSelected(int i,
QMap<int, QVariant> const & itemData)
{