Bug 74068 - WISH USABILITY - add full directory (recursive and not) to project
Summary: WISH USABILITY - add full directory (recursive and not) to project
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: Build tools: Custom Makefiles (show other bugs)
Version: 3.0.0b1
Platform: unspecified Linux
: NOR wishlist
Target Milestone: ---
Assignee: KDevelop Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-03 13:45 UTC by Danny Angelo Carminati Grein
Modified: 2007-02-16 15:48 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Danny Angelo Carminati Grein 2004-02-03 13:45:33 UTC
Version:           3.0.0 beta 1 (using KDE KDE 3.2.0)
Compiler:          gcc 3.2 
OS:          Linux

When creating a existing project (Makefile), I only can add files one by one to project... can be created two option on right-click menu to 'add directory to project' and 'add directory recursively to project' (catching all masks valid for that project .. like *.cpp *.h *.c *.hh *.cc *.hpp)
Comment 1 Amilcar do Carmo Lucas 2004-02-04 11:52:33 UTC
I think this one is a dupe. Will check later
Comment 2 Danny Angelo Carminati Grein 2004-08-19 23:12:36 UTC
It can be done this way:

on "Add directory and files"

command to exec: 

find $DIRECTORY_FROM_RIGHT_CLICK -iname '*.cpp' -or -iname '*.h' <and all other file mask from current project> -maxdepth 1 >> $PROJECTNAME.kdevelop.filelist


and  

on "Add directory and files recursively"

command to exec:

find $DIRECTORY_FROM_RIGHT_CLICK -iname '*.cpp' -or -iname '*.h' <and all other file mask from current project> >> $PROJECTNAME.kdevelop.filelist

Comment 3 Danny Angelo Carminati Grein 2004-09-17 02:37:51 UTC
This little script added to "External Tools" can help a little with this problem.. Go to Settings > Configure KDevelop   select "External Tools" and select tab "Directory Context Menu" then click Add and write this:

Menu text: Add Directory (Recursive)
Executable: path/to/this/script/diraddrecursive.sh
Parameters: %D %S

This will put all subdirs and files into your Project.kdevelop.filelist, but this will but full path to files, not relative to project home. This isnt a problem. Its usefull this way. What we can do, is ask some more work on part_tools.cpp/h to get more Enviroment variables to work with.. but this is another wish report..  

Myself can work on this, but Im little lazy to set a full cvs env to build kdevelop here...  Someday I will do this..  If anybody can help me work in this script to get working better.. 

more features needed in this script:
- use relative path to project home.
- checking dup files

I think that using some regexp will solve this... anybody can help me?

If this script get fully working this can be added in future kdevelop release?

Bye


---diraddrecusive.sh---
#!/bin/bash

PWD=`pwd`
PROJECT_PATH=$1
PROJECT_SELECTED=$2
cd $PROJECT_PATH
PROJECT=`find . -iname "*.kdevelop.filelist"`
find $PROJECT_SELECTED -iname '*.cpp' -or -iname '*.h' >> $PROJECT
cd $PWD
---diraddrecursive.sh---
Comment 4 Andreas Pakulat 2007-02-16 02:06:43 UTC
SVN commit 634006 by apaku:

Implemented subdir-adding/removing, so files in the selected dir will be added/removed recursivly. Currently this adds all existing files, I'm planning to allow customization here.
Also added a small filter on project opening to remove non-existent files, this fixes half of 140914
BUG:74068
CCBUG:140914


 M  +576 -450  customprojectpart.cpp  
 M  +16 -12    customprojectpart.h  
Comment 5 Danny Angelo Carminati Grein 2007-02-16 15:48:31 UTC
Thank you Andreas for your implementation.

Its a little strange to remember that I asked this. It was needed 3 years to a simple usability feature like this to get implemented by some good soul :D

Well, I only sorry to have changed about 1,5yr to Eclipse. It doesn't lack usability features. If someday kdevelop usability get close to eclipse usability or even Visual Studio 2005 and I'm not too old, I will think to get back. Anyway, thanks.