mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-09-28 07:32:00 -04:00
Features implemented. Time to debug.
This commit is contained in:
parent
3ad6df1f92
commit
7dff34ebf1
@ -108,20 +108,36 @@ void CSVFilter::EditWidget::createFilterRequest (std::vector< std::pair< std::st
|
|||||||
replaceMode = true;
|
replaceMode = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!replaceMode)
|
||||||
|
{
|
||||||
|
int index = oldContent.indexOf ('(');
|
||||||
|
|
||||||
|
if (index != 0)
|
||||||
|
{
|
||||||
|
oldContent.remove ('!');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
std::string orAnd;
|
std::string orAnd;
|
||||||
|
|
||||||
if (orMode)
|
if (orMode)
|
||||||
{
|
{
|
||||||
orAnd = "or";
|
orAnd = "!or(";
|
||||||
} else {
|
} else {
|
||||||
orAnd = "and";
|
orAnd = "!and(";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
clear();
|
||||||
|
std::stringstream ss;
|
||||||
|
|
||||||
if (multipleElements) //TODO appending to the existing filter
|
if (multipleElements) //TODO appending to the existing filter
|
||||||
{
|
{
|
||||||
std::stringstream ss;
|
|
||||||
if (replaceMode)
|
if (replaceMode)
|
||||||
{
|
{
|
||||||
ss<<"!or(";
|
ss<<"!or(";
|
||||||
|
} else {
|
||||||
|
ss << orAnd << oldContent.toStdString() << ',';
|
||||||
|
}
|
||||||
|
|
||||||
for (unsigned i = 0; i < count; ++i)
|
for (unsigned i = 0; i < count; ++i)
|
||||||
{
|
{
|
||||||
@ -135,27 +151,25 @@ void CSVFilter::EditWidget::createFilterRequest (std::vector< std::pair< std::st
|
|||||||
|
|
||||||
ss<<')';
|
ss<<')';
|
||||||
|
|
||||||
if (ss.str().length() >2)
|
if (ss.str().length() >5)
|
||||||
{
|
{
|
||||||
clear();
|
|
||||||
insert (QString::fromUtf8 (ss.str().c_str()));
|
insert (QString::fromUtf8 (ss.str().c_str()));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//not handled (yet) TODO
|
if (!replaceMode)
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (replaceMode)
|
|
||||||
{
|
{
|
||||||
std::string filter(generateFilter(filterSource[0]));
|
ss << orAnd << oldContent.toStdString()<<',';
|
||||||
|
} else {
|
||||||
|
ss<<'!';
|
||||||
|
}
|
||||||
|
|
||||||
if (!filter.empty())
|
ss << generateFilter (filterSource[0]);
|
||||||
|
if (!replaceMode)
|
||||||
{
|
{
|
||||||
clear();
|
ss<<')';
|
||||||
insert ('!' + QString::fromUtf8 (generateFilter(filterSource[0]).c_str()));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
//not handled (yet) TODO
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
insert (QString::fromStdString (ss.str().c_str()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user