Bug 385298

Summary: Deleting external scripts doesn't work
Product: [Applications] kdevelop Reporter: Ian H <master.haber>
Component: UI: generalAssignee: Amish Naidu <amhndu>
Status: RESOLVED FIXED    
Severity: normal CC: amhndu, mail
Priority: NOR    
Version First Reported In: 5.2.4   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Ian H 2017-10-02 15:13:51 UTC
When you delete an external script and reload kdevelop, it comes back. 

steps to reproduce: 
1.Add external script
2.Close/reopen kdevelop
3.Remove the external script
4.Close/reopen kdevelop

expected behavior: obviously the script should be gone when you reopen kdevelop
actual behavior: script is back in the list.
Comment 1 Ian H 2018-09-21 12:59:40 UTC
still not working in 5.2.4
Comment 2 Francis Herne 2018-09-21 17:00:32 UTC
Testing with 5.3-git:

In some cases the script is apparently removed, but still present after restarting KDevelop (as reported).
Sometimes a /different/ script is removed to the one intended.
Comment 3 Amish Naidu 2018-09-28 14:58:57 UTC
Git commit cef296113612ae72e561a1300d0622a46fcf1906 by Amish Naidu.
Committed on 28/09/2018 at 14:58.
Pushed by anaidu into branch '5.3'.

Fix removal of external scripts

Summary:
Previously, deleting a script which is in the middle of the config would invalidate indices
of the scripts that come after it in the config, this would mean deleting
anything later deletes the wrong script.

The config labels are now stored in the model itself and is no longer based on just the index,
but on the name of the script. Thus, deleting/updating one script does not interfere with the
other scripts.

Test Plan:
* Before applying the patch:
 - Delete "Google Selection"
 - Restart
 - Delete "Quick Compile"
 - Restart and check list of external scripts

* Apply the patch and repeat.

Reviewers: #kdevelop, flherne

Reviewed By: #kdevelop, flherne

Subscribers: flherne, kdevelop-devel

Tags: #kdevelop

Differential Revision: https://phabricator.kde.org/D15743

M  +11   -0    plugins/externalscript/externalscriptitem.cpp
M  +11   -0    plugins/externalscript/externalscriptitem.h
M  +34   -9    plugins/externalscript/externalscriptplugin.cpp
M  +12   -2    plugins/externalscript/externalscriptplugin.h

https://commits.kde.org/kdevelop/cef296113612ae72e561a1300d0622a46fcf1906