Bug 241013 - If we delete a file with declarations, suggest to delete the files with the definitions
Summary: If we delete a file with declarations, suggest to delete the files with the d...
Status: RESOLVED NOT A BUG
Alias: None
Product: kdevelop
Classification: Applications
Component: Language Support: CPP (old) (show other bugs)
Version: 4.0.0
Platform: Arch Linux Linux
: VLO wishlist
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-07 13:38 UTC by Mark
Modified: 2018-04-30 11:17 UTC (History)
2 users (show)

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 Mark 2010-06-07 13:38:22 UTC
Version:           4.0.0 (using KDE 4.4.3) 
OS:                Linux

Hi,

When i delete a class i noticed i had to delete both the .cpp and the .h file manually. Why not add an option to "delete a class" that deletes both the .cpp and .h file?

Or, when you select a .cpp file let kdevelop check if the same filename with .h is also present and if it is ask if it should be deleted as well.

Reproducible: Didn't try
Comment 1 Andreas Pakulat 2010-06-07 14:15:05 UTC
How did you delete the class? I can't find any GUI option to do that. Also a class doesn't necessarily have any connection to the .cpp and/or .h file. One can have .h files with various different classes or have them just in the .cpp. That means kdevelop either has to be as smart as a human user (which is impossible) or it'll fail to do the right thing in some cases which is not desireable.
Comment 2 Mark 2010-06-07 14:20:22 UTC
Right now there is no option to delete a class. There is only an option to "delete" by right clicking on a file and pressing delete (which is what i did).

What i proposed is when you right click a .cpp file that kdevelop suggests to delete the same file with .h as well (same when you right click on the .h that it suggests to delete the .cpp).
Comment 3 Andreas Pakulat 2010-06-07 15:03:31 UTC
But thats neither what the bugtitle nor the first paragraph of your report said. Please be more clear in future reports.

Also I think its highly unlikely that this is going to be implemented. The part that deletes files has no idea that there's a correlation between foo.cpp and foo.h. Not to mention that often enough there might be multiple .cpp files that #include foo.h and you usually don't want to delete them all.