MCPcopy Create free account
hub / github.com/LeFroid/Viper-Browser / removeSearchEngine

Method removeSearchEngine

src/ui/window/SearchEngineLineEdit.cpp:103–120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101}
102
103void SearchEngineLineEdit::removeSearchEngine(const QString &name)
104{
105 // Find the item in the menu, and its index so it may be removed
106 QList<QAction*> menuActions = m_searchEngineMenu->actions();
107 for (QAction *currAction : menuActions)
108 {
109 if (currAction->text().compare(name) == 0)
110 {
111 m_searchEngineMenu->removeAction(currAction);
112 break;
113 }
114 }
115
116 // Check if the current search engine is the one that was just removed, and if so change
117 // the current engine to the search engine manager's default
118 if (m_currentEngineName.compare(name) == 0)
119 setSearchEngine(SearchEngineManager::instance().getDefaultSearchEngine());
120}
121
122void SearchEngineLineEdit::resizeEvent(QResizeEvent *event)
123{

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected