diff --git a/src/main_window.cpp b/src/main_window.cpp index 40301ae..8b9e583 100644 --- a/src/main_window.cpp +++ b/src/main_window.cpp @@ -176,6 +176,14 @@ AC_MainWindow::AC_MainWindow(QWidget *parent) : QMainWindow(parent) { } +bool AC_MainWindow::checkAdd(QString str) { + const char *ex[] = { "Bars", "BilateralFilter", "BilateralFilterFade", "BoxFilter", "CurrentDesktopRect", "HorizontalTrailsInter", "IntertwineAlpha", "IntertwineAlphaBlend", "IntertwineVideo640", "RandomAlphaBlendFilter", "RandomOrigFrame", "RectangleGlitch", "SquareSwap64x32", "VideoColorMap", 0}; + + for(int i = 0; ex[i] != 0; ++i) + if(str == ex[i]) + return true; + return false; +} void AC_MainWindow::createControls() { custom_filters = new QListWidget(this); @@ -1559,6 +1567,7 @@ void AC_MainWindow::menuFilterChanged(int index) { for(int i = 0; i < static_cast(v.size()); ++i) { if(map_values.find(v[i]) == map_values.end()) { map_values[v[i]] = v[i]; + if(checkAdd(v[i].c_str()) == false) filters->addItem(v[i].c_str()); } } diff --git a/src/main_window.h b/src/main_window.h index bc58ae8..ab02312 100644 --- a/src/main_window.h +++ b/src/main_window.h @@ -78,6 +78,7 @@ public: void setSpeedIndex(int index); void setOptionString(std::string op, std::string value); void setProcMode(int index); + bool checkAdd(QString str); public slots: void showRange(); void chk_Joystick(); diff --git a/src/search_box.cpp b/src/search_box.cpp index 3871594..ee636cf 100644 --- a/src/search_box.cpp +++ b/src/search_box.cpp @@ -15,6 +15,14 @@ SearchWindow::SearchWindow(QWidget *parent) : QDialog(parent) { createControls(); } +bool SearchWindow::checkAdd(QString str) { + const char *ex[] = { "Bars", "BilateralFilter", "BilateralFilterFade", "BoxFilter", "CurrentDesktopRect", "HorizontalTrailsInter", "IntertwineAlpha", "IntertwineAlphaBlend", "IntertwineVideo640", "RandomAlphaBlendFilter", "RandomOrigFrame", "RectangleGlitch", "SquareSwap64x32", "VideoColorMap", 0}; + + for(int i = 0; ex[i] != 0; ++i) + if(str == ex[i]) + return true; + return false; +} void SearchWindow::createControls() { search_list = new QListWidget(this); @@ -47,7 +55,7 @@ void SearchWindow::search_filter() { for(int i = 0; i < ac::draw_max-6; ++i) { std::string search_value = lowerString(ac::draw_strings[i]); for(unsigned int q = 0; q < tokens.size(); ++q) { - if(search_value.find(tokens[q]) != std::string::npos) { + if(search_value.find(tokens[q]) != std::string::npos && checkAdd(ac::draw_strings[i].c_str()) == false) { search_list->addItem(ac::draw_strings[i].c_str()); break; } diff --git a/src/search_box.h b/src/search_box.h index 3b0f2c4..202cf92 100644 --- a/src/search_box.h +++ b/src/search_box.h @@ -21,6 +21,8 @@ private: QLineEdit *search_text; QPushButton *search, *add, *subf; QComboBox *filters; + + bool checkAdd(QString str); }; #endif