mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-09-27 15:11:36 -04:00
dealing with unset attribute fields
This commit is contained in:
parent
ec6bdbeb40
commit
384c88182d
@ -61,7 +61,7 @@ CSVDoc::ViewManager::ViewManager (CSMDoc::DocumentManager& documentManager)
|
|||||||
new CSVWorld::EnumDelegateFactory (sSpecialisations));
|
new CSVWorld::EnumDelegateFactory (sSpecialisations));
|
||||||
|
|
||||||
mDelegateFactories->add (CSMWorld::ColumnBase::Display_Attribute,
|
mDelegateFactories->add (CSMWorld::ColumnBase::Display_Attribute,
|
||||||
new CSVWorld::EnumDelegateFactory (sAttributes));
|
new CSVWorld::EnumDelegateFactory (sAttributes, true));
|
||||||
}
|
}
|
||||||
|
|
||||||
CSVDoc::ViewManager::~ViewManager()
|
CSVDoc::ViewManager::~ViewManager()
|
||||||
|
@ -92,10 +92,13 @@ void CSVWorld::EnumDelegate::paint (QPainter *painter, const QStyleOptionViewIte
|
|||||||
|
|
||||||
CSVWorld::EnumDelegateFactory::EnumDelegateFactory() {}
|
CSVWorld::EnumDelegateFactory::EnumDelegateFactory() {}
|
||||||
|
|
||||||
CSVWorld::EnumDelegateFactory::EnumDelegateFactory (const char **names)
|
CSVWorld::EnumDelegateFactory::EnumDelegateFactory (const char **names, bool allowNone)
|
||||||
{
|
{
|
||||||
assert (names);
|
assert (names);
|
||||||
|
|
||||||
|
if (allowNone)
|
||||||
|
add (-1, "");
|
||||||
|
|
||||||
for (int i=0; names[i]; ++i)
|
for (int i=0; names[i]; ++i)
|
||||||
add (i, names[i]);
|
add (i, names[i]);
|
||||||
}
|
}
|
||||||
|
@ -47,8 +47,9 @@ namespace CSVWorld
|
|||||||
|
|
||||||
EnumDelegateFactory();
|
EnumDelegateFactory();
|
||||||
|
|
||||||
EnumDelegateFactory (const char **names);
|
EnumDelegateFactory (const char **names, bool allowNone = false);
|
||||||
///< \param names Array of char pointer with a 0-pointer as end mark
|
///< \param names Array of char pointer with a 0-pointer as end mark
|
||||||
|
/// \param allowNone Use value of -1 for "none selected" (empty string)
|
||||||
|
|
||||||
virtual CommandDelegate *makeDelegate (QUndoStack& undoStack, QObject *parent) const;
|
virtual CommandDelegate *makeDelegate (QUndoStack& undoStack, QObject *parent) const;
|
||||||
///< The ownership of the returned CommandDelegate is transferred to the caller.
|
///< The ownership of the returned CommandDelegate is transferred to the caller.
|
||||||
|
@ -127,15 +127,18 @@ void Skill::save(ESMWriter &esm)
|
|||||||
{
|
{
|
||||||
std::ostringstream stream;
|
std::ostringstream stream;
|
||||||
|
|
||||||
stream << "#";
|
if (index!=-1)
|
||||||
|
{
|
||||||
|
stream << "#";
|
||||||
|
|
||||||
if (index<10)
|
if (index<10)
|
||||||
stream << "0";
|
stream << "0";
|
||||||
|
|
||||||
stream << index;
|
stream << index;
|
||||||
|
|
||||||
if (index>=0 && index<Length)
|
if (index>=0 && index<Length)
|
||||||
stream << sSkillNameIds[index].substr (6);
|
stream << sSkillNameIds[index].substr (6);
|
||||||
|
}
|
||||||
|
|
||||||
return stream.str();
|
return stream.str();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user