Bug 385298 - Deleting external scripts doesn't work
Summary: Deleting external scripts doesn't work
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: UI: general (show other bugs)
Version: 5.2.4
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Amish Naidu
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-10-02 15:13 UTC by Ian H
Modified: 2018-09-28 14:58 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 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