Bug 183812 - Dolphin does not enable or disable "Create New..." menu when switching between left and right view
Summary: Dolphin does not enable or disable "Create New..." menu when switching betwee...
Status: RESOLVED FIXED
Alias: None
Product: dolphin
Classification: Applications
Component: general (show other bugs)
Version: 16.12.2
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Peter Penz
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-09 19:01 UTC by Frank Reininghaus
Modified: 2009-09-07 09:47 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Suggested patch (2.19 KB, patch)
2009-02-09 19:03 UTC, Frank Reininghaus
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Frank Reininghaus 2009-02-09 19:01:50 UTC
Version:            (using KDE 4.2.0)
OS:                Linux
Installed from:    Ubuntu Packages

Steps to reproduce (applies to 4.2.0 and trunk):

1. Open Dolphin (in home folder)
2. Split the view, navigate to a non-writable folder in one of the views -> "Create New..." is disabled
3. Click the other view (still showing the home directory) -> "Create New..." is still disabled.

The reason is that enabling/disabling of the "Create New..." menu only happens in DolphinViewContainer::setUrl() and DolphinViewContainer::slotDirListerCompleted(), but not in DolphinViewContainer::setActive().

I'll attach a patch in a minute...
Comment 1 Frank Reininghaus 2009-02-09 19:03:49 UTC
Created attachment 31157 [details]
Suggested patch 

My patch does the following:

1. Add a new member 'm_folderWritable' to DolphinViewContainer

2. Replace updates of the status of the 'Create New...' menu by updates of 'm_folderWritable' in the existing code in DolphinViewContainer. If the view is really active, change also the status of the 'Create New...' menu

3. If the view is activated in DolphinViewContainer::setActive (), set the status of the 'Create New...' menu according to 'm_folderWritable'.

It's just a suggestion, maybe there's a better way to do it. However, I can't see how to avoid a new bool member. I hope nobody requires binary compatibility for DolphinViewContainer ;-)
Comment 2 Peter Penz 2009-02-09 20:49:38 UTC
Thanks Frank for your patch and the good analyzes! I'll have a detailed look until the end of this week (I'm not sure whether yet there might be another approach too).
Comment 3 Peter Penz 2009-02-10 08:09:49 UTC
SVN commit 924120 by ppenz:

Fixed issue that the 'Create New' menu might be disabled although creating of files is allowed. Thanks to Frank Reininghaus for the patch!

BUG: 183812

 M  +14 -4     dolphinviewcontainer.cpp  
 M  +1 -0      dolphinviewcontainer.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=924120
Comment 4 Peter Penz 2009-02-10 08:14:29 UTC
SVN commit 924123 by ppenz:

Backport of SVN commit 924120:Fixed issue that the 'Create New' menu might be disabled although creating of files is allowed. Thanks to Frank Reininghaus for the patch!

CCBUG: 183812

 M  +14 -4     dolphinviewcontainer.cpp  
 M  +2 -1      dolphinviewcontainer.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=924123
Comment 5 Brendon Higgins 2009-09-07 07:52:18 UTC
Something isn't quite right with this fix. I have Dolphin open with a bunch of tabs showing different folders. With some of them, "Create New" is enabled, and with others it is disabled, but all the folders have the same permissions. F5 refresh doesn't change anything. Furthermore, I can open a new Dolphin window and browse to one of the "disabled" folders, or even just hit Ctrl-T to make a duplicate tab in the same window, and "Create New" is enabled there.

It might be the case that these particular "disabled" tabs were opened by a session restart, so that might have something to do with it. I'll try to pay attention to that next time I restart.
Comment 6 Frank Reininghaus 2009-09-07 09:47:26 UTC
Brendan, thanks for the report! If you find a way to reproduce this issue reliably, please file a new bug report because this is almost certainly unrelated to the "split view" issue that has been discussed here.

It might be that the problem you've found is related to restoring sessions. I'm not quite sure at the moment, but I think that DolphinViewContainer's m_isFolderWritable member is not stored when saving the session.