mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-10 03:39:55 +00:00
Small refactoring.
This commit is contained in:
parent
d0a52b7b24
commit
7594bcf97a
@ -149,7 +149,7 @@ void CSVWorld::GenericCreator::create()
|
||||
}
|
||||
}
|
||||
|
||||
void CSVWorld::GenericCreator::cloneMode(const std::string& originid,
|
||||
void CSVWorld::GenericCreator::cloneMode(const std::string& originid,
|
||||
const CSMWorld::UniversalId::Type type,
|
||||
const CSMWorld::UniversalId::ArgumentType argumentType)
|
||||
{
|
||||
|
@ -16,6 +16,7 @@
|
||||
|
||||
#include "recordstatusdelegate.hpp"
|
||||
#include "util.hpp"
|
||||
#include <qt4/QtCore/qabstractitemmodel.h>
|
||||
|
||||
void CSVWorld::Table::contextMenuEvent (QContextMenuEvent *event)
|
||||
{
|
||||
@ -308,10 +309,10 @@ void CSVWorld::Table::cloneRecord()
|
||||
if (!mEditLock)
|
||||
{
|
||||
QModelIndexList selectedRows = selectionModel()->selectedRows();
|
||||
|
||||
if (selectedRows.size()==1)
|
||||
const CSMWorld::UniversalId& toClone = getUniversalId(selectedRows.begin()->row());
|
||||
if (selectedRows.size()==1 && !mModel->getRecord(toClone.getId()).isDeleted())
|
||||
{
|
||||
emit cloneRequest (selectedRows.begin()->row(), mModel);
|
||||
emit cloneRequest (toClone);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ namespace CSVWorld
|
||||
/// \param modified Number of added and modified records
|
||||
|
||||
void createRequest();
|
||||
void cloneRequest(int row, const CSMWorld::IdTable*);
|
||||
void cloneRequest(const CSMWorld::UniversalId&);
|
||||
|
||||
private slots:
|
||||
|
||||
|
@ -49,7 +49,7 @@ CSVWorld::TableSubView::TableSubView (const CSMWorld::UniversalId& id, CSMDoc::D
|
||||
{
|
||||
connect (mTable, SIGNAL (createRequest()), mBottom, SLOT (createRequest()));
|
||||
|
||||
connect (mTable, SIGNAL (cloneRequest(int, const CSMWorld::IdTable*)), this, SLOT(cloneRequest(int, const CSMWorld::IdTable*)));
|
||||
connect (mTable, SIGNAL (cloneRequest(const CSMWorld::UniversalId&)), this, SLOT(cloneRequest(const CSMWorld::UniversalId&)));
|
||||
connect (this, SIGNAL(cloneRequest(const std::string&, const CSMWorld::UniversalId::Type, const CSMWorld::UniversalId::ArgumentType)),
|
||||
mBottom, SLOT(cloneRequest(const std::string&, const CSMWorld::UniversalId::Type, const CSMWorld::UniversalId::ArgumentType)));
|
||||
}
|
||||
@ -82,11 +82,7 @@ void CSVWorld::TableSubView::setStatusBar (bool show)
|
||||
mBottom->setStatusBar (show);
|
||||
}
|
||||
|
||||
void CSVWorld::TableSubView::cloneRequest(int row, const CSMWorld::IdTable* table)
|
||||
void CSVWorld::TableSubView::cloneRequest(const CSMWorld::UniversalId& toClone)
|
||||
{
|
||||
const CSMWorld::UniversalId& toClone(mTable->getUniversalId(row));
|
||||
if (!(table->getRecord(toClone.getId()).isDeleted()))
|
||||
{
|
||||
emit cloneRequest(toClone.getId(), toClone.getType(), toClone.getArgumentType());
|
||||
}
|
||||
emit cloneRequest(toClone.getId(), toClone.getType(), toClone.getArgumentType());
|
||||
}
|
||||
|
@ -40,14 +40,14 @@ namespace CSVWorld
|
||||
virtual void setStatusBar (bool show);
|
||||
|
||||
signals:
|
||||
void cloneRequest(const std::string& id,
|
||||
const CSMWorld::UniversalId::Type type,
|
||||
const CSMWorld::UniversalId::ArgumentType argumentType);
|
||||
void cloneRequest(const std::string&,
|
||||
const CSMWorld::UniversalId::Type,
|
||||
const CSMWorld::UniversalId::ArgumentType);
|
||||
|
||||
private slots:
|
||||
|
||||
void editRequest (int row);
|
||||
void cloneRequest (int row, const CSMWorld::IdTable* table);
|
||||
void cloneRequest (const CSMWorld::UniversalId& toClone);
|
||||
};
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user