Changeset View
Changeset View
Standalone View
Standalone View
plugins/grepview/grepviewplugin.cpp
Show First 20 Lines • Show All 157 Lines • ▼ Show 20 Line(s) | 147 | if(context->type() == KDevelop::Context::FileContext) { | |||
---|---|---|---|---|---|
158 | } | 158 | } | ||
159 | } | 159 | } | ||
160 | return extension; | 160 | return extension; | ||
161 | } | 161 | } | ||
162 | 162 | | |||
163 | void GrepViewPlugin::showDialog(bool setLastUsed, QString pattern, bool show) | 163 | void GrepViewPlugin::showDialog(bool setLastUsed, QString pattern, bool show) | ||
164 | { | 164 | { | ||
165 | GrepDialog* dlg = new GrepDialog( this, core()->uiController()->activeMainWindow() ); | 165 | GrepDialog* dlg = new GrepDialog( this, core()->uiController()->activeMainWindow() ); | ||
166 | GrepJobSettings dlgSettings = dlg->settings(); | ||||
166 | KDevelop::IDocument* doc = core()->documentController()->activeDocument(); | 167 | KDevelop::IDocument* doc = core()->documentController()->activeDocument(); | ||
167 | 168 | | |||
168 | if(!pattern.isEmpty()) | 169 | if(!pattern.isEmpty()) | ||
169 | { | 170 | { | ||
170 | dlg->setPattern(pattern); | 171 | dlgSettings.pattern = pattern; | ||
172 | dlg->setSettings(dlgSettings); | ||||
171 | } | 173 | } | ||
172 | else if(!setLastUsed) | 174 | else if(!setLastUsed) | ||
173 | { | 175 | { | ||
174 | QString pattern = patternFromSelection(doc); | 176 | QString pattern = patternFromSelection(doc); | ||
175 | if (!pattern.isEmpty()) { | 177 | if (!pattern.isEmpty()) { | ||
176 | dlg->setPattern( pattern ); | 178 | dlgSettings.pattern = pattern; | ||
179 | dlg->setSettings(dlgSettings); | ||||
177 | } | 180 | } | ||
178 | } | 181 | } | ||
179 | 182 | | |||
180 | //if directory is empty then use a default value from the config file. | 183 | //if directory is empty then use a default value from the config file. | ||
181 | if (!m_directory.isEmpty()) { | 184 | if (!m_directory.isEmpty()) { | ||
182 | dlg->setSearchLocations(m_directory); | 185 | dlg->setSearchLocations(m_directory); | ||
183 | } | 186 | } | ||
184 | 187 | | |||
▲ Show 20 Lines • Show All 48 Lines • Show Last 20 Lines |