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

View File

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

View File

@ -14,6 +14,7 @@
#include <config.h> #include <config.h>
#include "GuiSelectionManager.h" #include "GuiSelectionManager.h"
#include "GuiDocument.h"
#include "support/debug.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, bool GuiSelectionManager::insertRowToSelected(int i,
QMap<int, QVariant> const & itemData) QMap<int, QVariant> const & itemData)
{ {