Project file list support for the grepview part

Kris Wong wongk at seapine.com
Thu Oct 19 18:35:59 UTC 2006


> Um, why do you not 'cat <project>.filelist | sed 1d | xargs ...'? 
> Wouldn't this be a lot simpler, and not need the extra (and redundant)

> temp file?

This file does not exist for qmake or automake projects.  I would
imagine there are other project types that this file does not exist for
as well.  For projects in which this file does exist, it contains
relative paths.

> I see you disable files_combo (good), dir_combo (ditto), and 
> no_find_err_box (also good), but why do you disable exclude_combo?
This 
> should work fine with cat'ing a file list, since it operates
downstream 
> of 'find'. (You'll have to move it outside your added if-block, of 
> course.)

The exclude combo removes find results that match certain strings (such
as directories that have files the user doesn't care about such as
version control files).  I am no longer doing a find, and I am limiting
the search to files in the project, which makes exclude combobox
somewhat useless (unless for some reason the user wanted to disclude
files that were in the project).  In order to avoid user confusion, I
disabled this combo.  An argument could be made that user might still
want to use this combo, in which case I can re-enable it and implement
its functionality.

> Also removing the 'quote spaces before going into xargs' sed 
> pipe looks like a bug waiting to happen. Both of these look like they 
> would be resolved by restoring the original indentation and bumping
your 
> closing '}' up to just above the line 'QStringList excludelist = ...'.

The sed command replaces all " " characters with "\ ".  The files listed
in the temporary file are enclosed in "'" characters, so escaping the
spaces causes issues.  I did find 2 other bugs in my code though in
testing this out.  I also found that the code that changes the working
directory for the konsole part does not work if there are spaces in the
project directory path.

This new patch contains fixes for the 2 bugs (both caused by spaces in
the project directory path) and updated tabbing.  There was mixed
tabbing in these files so I tried to match the surrounding code the best
I could.  If it is desired I can also re-enable the exclude_combo.

On a separate note, there is a bug (actually 2) in the new qmake stuff
that is causing issues with this feature, as well as anything else that
calls allFiles on the project.  I have seen this cause a problem on the
Quick Open dialog, and it looks like it may be affecting valgrind and
some other features.  TrollProjectWidget::allFiles is returning multiple
strings for each individual file, 1 for each scope that the file appears
in.  In addition, the scope name is present in the file path, which
means the path is invalid for any file not in the top level scope.
Removing the code that prepends the QMakeScopeItem::relativePath to the
item fixes the second issue, but there is still the issue that the files
appear multiple times in the file list.  When a user clicks on a scope
below the top level scope, all files from any parent scopes are visible
along with the files in the current scope.  I would imagine this is the
root of the problem and this seems to be less intuitive for the user
than only showing the files that in current scope.  I was a bit thrown
off by it myself when I first noticed it.

Kris Wong
Seapine Software, Inc.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: grepview_with_project_support.patch
Type: application/octet-stream
Size: 10117 bytes
Desc: grepview_with_project_support.patch
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20061019/43e84d24/attachment.obj>


More information about the KDevelop-devel mailing list