MCPcopy Create free account
hub / github.com/KDE/kdevelop / showDialog

Method showDialog

plugins/grepview/grepviewplugin.cpp:165–201  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

163}
164
165void GrepViewPlugin::showDialog(bool setLastUsed, const QString& pattern, bool show)
166{
167 // check if dialog pointers are still valid, remove them otherwise
168 m_currentDialogs.removeAll(QPointer<GrepDialog>());
169
170 auto* const dlg = new GrepDialog(this, nullptr, core()->uiController()->activeMainWindow(), show);
171 m_currentDialogs << dlg;
172
173 if (!show) {
174 // The UI is uninitialized, so the settings must be read from config.
175 dlg->setLastUsedSettings();
176 }
177
178 if(!pattern.isEmpty())
179 {
180 dlg->setPattern(pattern);
181 }
182 else if(!setLastUsed)
183 {
184 QString pattern = patternFromSelection(core()->documentController()->activeDocument());
185 if (!pattern.isEmpty()) {
186 dlg->setPattern(std::move(pattern));
187 }
188 }
189
190 //if directory is empty then use a default value from the config file.
191 if (!m_directory.isEmpty()) {
192 dlg->setSearchLocations(m_directory);
193 }
194
195 if(show)
196 dlg->show();
197 else{
198 dlg->startSearch();
199 dlg->deleteLater();
200 }
201}
202
203void GrepViewPlugin::showDialogFromMenu()
204{

Callers

nothing calls this directly

Calls 11

patternFromSelectionFunction · 0.85
uiControllerMethod · 0.80
setLastUsedSettingsMethod · 0.80
setPatternMethod · 0.80
activeDocumentMethod · 0.80
documentControllerMethod · 0.80
setSearchLocationsMethod · 0.80
showMethod · 0.80
activeMainWindowMethod · 0.45
isEmptyMethod · 0.45
startSearchMethod · 0.45

Tested by

no test coverage detected