From e7812d3e2674d3fc115654f8ba0203ea65b5de9d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Sat, 20 Sep 2008 12:17:15 +0000 Subject: [PATCH] cosmetics git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26465 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiDocument.cpp | 95 +++++++++++++++++-------------- src/frontends/qt4/GuiDocument.h | 8 +-- 2 files changed, 56 insertions(+), 47 deletions(-) diff --git a/src/frontends/qt4/GuiDocument.cpp b/src/frontends/qt4/GuiDocument.cpp index 4fc4c75c31..28a334426b 100644 --- a/src/frontends/qt4/GuiDocument.cpp +++ b/src/frontends/qt4/GuiDocument.cpp @@ -171,53 +171,61 @@ QModelIndex getSelectedIndex(QListView * lv) namespace { - vector getRequiredList(string const & modName) - { - LyXModule const * const mod = moduleList[modName]; - if (!mod) - return vector(); //empty such thing - return mod->getRequiredModules(); - } +vector getRequiredList(string const & modName) +{ + LyXModule const * const mod = moduleList[modName]; + if (!mod) + return vector(); //empty such thing + return mod->getRequiredModules(); +} - vector getExcludedList(string const & modName) - { - LyXModule const * const mod = moduleList[modName]; - if (!mod) - return vector(); //empty such thing - return mod->getExcludedModules(); - } +vector getExcludedList(string const & modName) +{ + LyXModule const * const mod = moduleList[modName]; + if (!mod) + return vector(); //empty such thing + return mod->getExcludedModules(); +} - docstring getModuleDescription(string const & modName) - { - LyXModule const * const mod = moduleList[modName]; - if (!mod) - return _("Module not found!"); - return _(mod->getDescription()); - } +docstring getModuleDescription(string const & modName) +{ + LyXModule const * const mod = moduleList[modName]; + if (!mod) + return _("Module not found!"); + return _(mod->getDescription()); +} - vector getPackageList(string const & modName) - { - LyXModule const * const mod = moduleList[modName]; - if (!mod) - return vector(); //empty such thing - return mod->getPackageList(); - } +vector getPackageList(string const & modName) +{ + LyXModule const * const mod = moduleList[modName]; + if (!mod) + return vector(); //empty such thing + return mod->getPackageList(); +} - bool isModuleAvailable(string const & modName) - { - LyXModule * mod = moduleList[modName]; - if (!mod) - return false; - return mod->isAvailable(); - } -} //anonymous namespace +bool isModuleAvailable(string const & modName) +{ + LyXModule * mod = moduleList[modName]; + if (!mod) + return false; + return mod->isAvailable(); +} + +} // anonymous namespace + + +///////////////////////////////////////////////////////////////////// +// +// ModuleSelectionManager +// +///////////////////////////////////////////////////////////////////// -ModuleSelMan::ModuleSelMan( +ModuleSelectionManager::ModuleSelectionManager( QListView * availableLV, QListView * selectedLV, QPushButton * addPB, @@ -231,7 +239,7 @@ GuiSelectionManager(availableLV, selectedLV, addPB, delPB, {} -void ModuleSelMan::updateAddPB() +void ModuleSelectionManager::updateAddPB() { int const arows = availableModel->rowCount(); QModelIndexList const availSels = @@ -292,7 +300,7 @@ void ModuleSelMan::updateAddPB() } -void ModuleSelMan::updateDownPB() +void ModuleSelectionManager::updateDownPB() { int const srows = selectedModel->rowCount(); if (srows == 0) { @@ -331,7 +339,7 @@ void ModuleSelMan::updateDownPB() find(reqs.begin(), reqs.end(), curModName) == reqs.end()); } -void ModuleSelMan::updateUpPB() +void ModuleSelectionManager::updateUpPB() { int const srows = selectedModel->rowCount(); if (srows == 0) { @@ -370,7 +378,7 @@ void ModuleSelMan::updateUpPB() upPB->setEnabled(find(reqs.begin(), reqs.end(), preModName) == reqs.end()); } -void ModuleSelMan::updateDelPB() +void ModuleSelectionManager::updateDelPB() { int const srows = selectedModel->rowCount(); if (srows == 0) { @@ -445,7 +453,7 @@ void ModuleSelMan::updateDelPB() // ///////////////////////////////////////////////////////////////////// -PreambleModule::PreambleModule(): current_id_(0) +PreambleModule::PreambleModule() : current_id_(0) { // This is not a memory leak. The object will be destroyed // with this. @@ -888,7 +896,8 @@ GuiDocument::GuiDocument(GuiView & lv) this, SLOT(browseMaster())); selectionManager = - new ModuleSelMan(latexModule->availableLV, latexModule->selectedLV, + new ModuleSelectionManager(latexModule->availableLV, + latexModule->selectedLV, latexModule->addPB, latexModule->deletePB, latexModule->upPB, latexModule->downPB, availableModel(), selectedModel()); diff --git a/src/frontends/qt4/GuiDocument.h b/src/frontends/qt4/GuiDocument.h index 47d854127d..9a37ad5cfe 100644 --- a/src/frontends/qt4/GuiDocument.h +++ b/src/frontends/qt4/GuiDocument.h @@ -64,10 +64,10 @@ public: /// SelectionManager for use with modules -class ModuleSelMan : public GuiSelectionManager +class ModuleSelectionManager : public GuiSelectionManager { public: - ModuleSelMan( + ModuleSelectionManager( QListView * availableLV, QListView * selectedLV, QPushButton * addPB, @@ -89,12 +89,12 @@ private: GuiIdListModel * getAvailableModel() { return dynamic_cast(availableModel); - }; + } /// returns selectedModel as a GuiIdListModel GuiIdListModel * getSelectedModel() { return dynamic_cast(selectedModel); - }; + } }; -- 2.39.2