Version: 1.0 (using KDE 4.4.0)
Compiler: gcc (Gentoo 4.3.4 p1.0, pie-10.1.5) 4.3.4
Installed from: Gentoo Packages
- open systemsettings
- go to Advanced
- go to Autostart
- click "add script"
- select a script, leave "create as symlink" checked
- click OK
--> script is aded to the "Scripts listing"
- in the scripts listing in the "Run On" column, select "shutdown"
- Click "Overview" button to exit Autostart settings
- re-enter "Autostart" settings
--> script is still in the listing, but set to run on startup.
Effects in ~/.kde4/:
- symlink to the script file is correctly created in ~/.kde4/Autostart
- if it does not exist, ~/.kde4/shutdown directory is created
- *but* symlink is never moved to the ~/.kde4/shutdown directory
for got one thing:
If I later move the symlink from ~/.kde4/Autostart to ~/.kde4/shutdown, the Autostart settings shows it correctly configured to run on shutdown.
I'd like to confirm this bug in KDE 4.6.3 "release 4", exactly as the OP described.
I can confirm this bug exists in KDE 4.6.4 as well. Additionally, setting a script to run on shutdown will often move the wrong script to the shutdown folder!
I figured out what is happening:
1) When a script is set to "Startup", it is to be placed in ~/.kde/Autostart. When a script is set to "Shutdown", it is to be placed in ~/.kde/shutdown.
2) When you select one of these options, the KDE autostart module is moving the script that is currently highlighted (blue by default) regardless of which script's combo box you have just accessed.
So, the current workaround is to click on the script's entry so it is highlighted in blue, then select its startup option from the combo box.
BTW: I didn't test with the "Pre-KDE Startup" option, but I'd assume it's the same story there.
I face the same problem too.
I figure out the problem. This happens when there are more than one items under the "Script File". Every time when manipulate an item which does not has the focus, the focused item is moved! So item selection is wrong.
void Autostart::slotChangeStartup( int index )
if ( widget->listCMD->currentItem() == 0 )
ScriptStartItem* entry = dynamic_cast<ScriptStartItem*>( widget->listCMD->currentItem() );
if ( entry )
if ( ( index != 0 ) && !entry->fileName().path().endsWith( ".sh" ))
KMessageBox::information( this, i18n( "Only files with “.sh” extensions are allowed for setting up the environment." ) );
QListWidget::currentItem() does not return the item which is manipulated, but returns the item which has the focus. I don't know what is the correct logic to select the item though.
Thanks for the helpful steps and investigation. I will see whether I can do something to fix this :)
Git commit 044c91d6f6adf3e3d935c652c659f5346c6c2011 by Jekyll Wu.
Committed on 10/11/2012 at 05:40.
Pushed by jekyllwu into branch 'KDE/4.9'.
Make sure the right item is operated on when changing startup type
The problem was the "current" item was sometime not the one you would
have expected when changing the startup type of item A:
* it could be "none"
* it could be the previous "current" item
The fix is a little hacky, but better than none.
M +8 -7 kcontrol/autostart/autostart.cpp
M +1 -1 kcontrol/autostart/autostart.h
M +8 -1 kcontrol/autostart/autostartitem.cpp
M +11 -1 kcontrol/autostart/autostartitem.h
*** Bug 171139 has been marked as a duplicate of this bug. ***
Thanks for the fix, Jekyll!
Thank you for the fix! The fix looks reasonable.
*** Bug 310629 has been marked as a duplicate of this bug. ***