updated search window

This commit is contained in:
lostjared
2018-09-17 15:14:56 -07:00
parent f9b9664b8a
commit ac65958e1e

View File

@@ -1144,24 +1144,28 @@ void AC_MainWindow::setSubFilter(const QString &filter_num) {
int filter_index = filter_map[filter_num.toStdString()].filter; int filter_index = filter_map[filter_num.toStdString()].filter;
int crow = custom_filters->currentRow(); int crow = custom_filters->currentRow();
if(value_index == 0 && crow >= 0) { if(value_index == 0 && crow >= 0) {
std::string text = filter_num.toStdString(); std::ostringstream stream;
if(text.find("SubFilter") != std::string::npos) { QListWidgetItem *item = custom_filters->item(crow);
std::ostringstream stream; std::string fname = filter_num.toStdString();
stream << "SubFilter function: " << filter_num.toStdString() << " cannot be set to a SubFilter function.\n"; std::string filter_val = item->text().toStdString();
if(filter_val.find(":") != std::string::npos)
filter_val = filter_val.substr(0, filter_val.find(":"));
if(!(fname.find("SubFilter") == std::string::npos && filter_val.find("SubFilter") != std::string::npos)) {
stream << filter_val << " does not support a subfilter.\n";
Log(stream.str().c_str()); Log(stream.str().c_str());
return; return;
} }
QListWidgetItem *item = custom_filters->item(crow); stream << "SubFilter set to: " << filter_num.toStdString() << "\n";
std::ostringstream stream; stream << "SubFilter index: " << filter_index << "\n";
stream << "SubFilter set to: " << filter_num.toStdString() << "\n"; std::ostringstream stream1;
stream << "SubFilter index: " << filter_index << "\n"; stream1 << filter_val << ":" << fname;
std::ostringstream stream1; item->setText(stream1.str().c_str());
stream1 << filter_num.toStdString() << ":" << item->text().toStdString(); std::vector<FilterValue> v;
item->setText(stream1.str().c_str()); buildVector(v);
std::vector<FilterValue> v; playback->setVector(v);
buildVector(v); QString l = stream.str().c_str();
QString l = stream.str().c_str(); Log(l);
Log(l);
} else { } else {
QString txt; QString txt;
QTextStream stream(&txt); QTextStream stream(&txt);