Version: 3.0.0b2 (using KDE 3.1.94 (3.2 Beta 2), SuSE) Compiler: gcc version 3.3.1 (SuSE Linux) OS: Linux (i686) release 2.4.21-144-default The grep dialog should populate the pattern field with the selected text.
Created attachment 4132 [details] Patch Here is a suggested patch.
Nice patch. But the file is written with four spaces indentention, why did you use three spaces in the patch? The rule is look at the code surrounding the are you want to patch. And then use the same type (2 spaces, 4 spaces, tabs or whatever) Thanks for the patch
Now in english :) Nice patch. But the file is written with four spaces indentention, why did you use three spaces in your patch? The rule is to look at the code surrounding the area you want to patch. And then use the same type (2 spaces, 4 spaces, tabs or whatever) of indentation.
Sorry about that. I thought that I had matched the style of the file. I guess I wasn't paying close enough attention.
Created attachment 4147 [details] Updated patch I've updated the patch to use the correct indentation style
Thanks, we'll commit it as soon as CVS is unfrozen. :)
Subject: kdevelop/parts/grepview CVS commit by dagerbo: Commit suggested patch for bug 72523. Thanks to Dan Christensen for the patch. CCMAIL: 72523-done@bugs.kde.org M +17 -0 grepviewwidget.cpp 1.26 --- kdevelop/parts/grepview/grepviewwidget.cpp #1.25:1.26 @@ -17,4 +17,7 @@ #include <klocale.h> #include <kprocess.h> +#include <kparts/part.h> +#include <ktexteditor/selectioninterface.h> +using namespace KTextEditor; #include "kdevcore.h" @@ -119,4 +122,18 @@ GrepViewWidget::~GrepViewWidget() void GrepViewWidget::showDialog() { + // Get the selected text if there is any + KParts::ReadOnlyPart *ro_part = dynamic_cast<KParts::ReadOnlyPart*>(m_part->partController()->activePart()); + if (ro_part) + { + SelectionInterface *selectIface = dynamic_cast<SelectionInterface*>(ro_part); + if(selectIface && selectIface->hasSelection()) + { + QString selText = selectIface->selection(); + if(!selText.contains('\n')) + { + grepdlg->setPattern(selText); + } + } + } grepdlg->show(); }