Bug 330001 - Popup submenu 'Create New' is disabled for rw ntfs partition mounted as ufsd.
Summary: Popup submenu 'Create New' is disabled for rw ntfs partition mounted as ufsd.
Status: RESOLVED FIXED
Alias: None
Product: dolphin
Classification: Applications
Component: general (show other bugs)
Version: 4.12.1
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-15 16:17 UTC by Alex Levkovich
Modified: 2014-01-30 21:13 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.12.2


Attachments
Patch for kde-baseapps v4.12.1 that adds some debug output (3.37 KB, patch)
2014-01-16 16:17 UTC, Frank Reininghaus
Details
Patch to (possibly) fix the disabled "new file menu" on viewport (1.78 KB, patch)
2014-01-16 17:05 UTC, Emmanuel Pescosta
Details
Workaround (1.07 KB, patch)
2014-01-17 08:45 UTC, Frank Reininghaus
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Levkovich 2014-01-15 16:17:28 UTC
I mounted ntfs partition by ufsd driver (closed-source driver for Microsoft's NTFS file system developed by Paragon GmbH). Popup submenu 'Create New' is disabled for rw ntfs partition mounted as ufsd. I can create the files using touch command or directories - using mkdir command.
This menu is enabled in konquerror.

Reproducible: Always

Steps to Reproduce:
1. mount any partition using ufsd
2. try to create the file or folder on this partition in dolphin.

Actual Results:  
submenu 'Create New' is disabled

Expected Results:  
it should be workable.
Comment 1 Emmanuel Pescosta 2014-01-15 16:31:19 UTC
> This menu is enabled in konquerror.
Can you please mount your ntfs partition read only and test if Konquerror disables the "Create new" submenu in this case? - So we have a better chance to find the root cause of this problem ;)
Thanks!

If Konquerror works as expected in all two cases, then it's definitely a problem in Dolphin.
Comment 2 Frank Reininghaus 2014-01-15 16:33:38 UTC
Thanks for the bug report. Is the "Create New..." menu also disabled if you right-click a directory on the NTFS drive?
Comment 3 Alex Levkovich 2014-01-15 18:41:09 UTC
I remounted as ro and check the konquerror: this menu is absent at all in this case. So it is ok.
"Create New..." menu is enabled if I right-click a directory .
Comment 4 Frank Reininghaus 2014-01-16 07:46:43 UTC
Thanks for the quick reply. I cannot reproduce the problem with OpenSuse's default NTFS driver.

Today, a bug which looks similar has been reported (for smb): bug 330015. It indicates that this is a regression. Moreover, it is probably not a coincidence that an issue which has never been reported earlier is reported twice after the 4.12 release. Can you also confirm that this used to work in earlier Dolphin /KDE SC releases?

I'm not aware of any recent changes in Dolphin that could cause such a problem (in particular considering that this happens only with some protocols).

Do you build Dolphin from source? We could send you a patch that adds some debug output to DolphinView::updateWritableState(), and possibly other places, that might help to debug this problem.
Comment 5 Alex Levkovich 2014-01-16 08:06:21 UTC
Yes there are no problems with ntfs-3g. I can confirm that this bug exists in all 4.12 releases only because I didn't use ufsd earlier. I can recompile kdebase-dolphin-4.12.1 package if will send the patch. Also let me know where I will see this debug output.
Comment 6 Frank Reininghaus 2014-01-16 16:17:55 UTC
Created attachment 84670 [details]
Patch for kde-baseapps v4.12.1 that adds some debug output

Cool! If you build Dolphin with this patch applied, you should be able to run the modified Dolphin version by entering something like

path/to/build/directory/dolphin/src/dolphin.shell

in a terminal (if you install the modified Dolphin, the ".shell" is not required. The "dolphin.shell" script sets up the linker paths such that the executable uses modified libraries from the build directory, and not those that are installed on the system).

It would be great if you could then enter a directory where the "Create New..." menu is incorrectly disabled (I forgot to ask, but I assume that this happens if you right-click the empty space in the view?). The next step would be to right-click a directory (such that the menu is enabled, see comment 3). Finally, enter this directory by left-clicking it.

There will be some debug output in the terminal. Please paste or attach it here. I'm not sure if it will be sufficient to find out what the root cause of the problem is, but maybe it will at least provide a first step towards understanding what's going on, or an idea about what we could investigate with further debug output. Thanks for your help!
Comment 7 Alex Levkovich 2014-01-16 16:52:05 UTC
when I opened  the directory with root of ntfs disk

### DolphinView::slotDirectoryLoadingStarted() 
### DolphinView::slotDirectoryLoadingStarted(): Emitting writeStateChanged( false ) for URL KUrl("file:///run/media/alex/Games") 
### DolphinMainWindow::slotWriteStateChanged( false ) 
### DolphinView::updateWritableState()[begin]: m_isFolderWritable is false 
### DolphinView::updateWritableState(): root item is [null KFileItem] 
### DolphinView::updateWritableState()[end]: m_isFolderWritable is false 

right click on empty space (menu is disabled)

dolphin(11296) KConfigGroup::readXdgListEntry: List entry MimeType in "/usr/share/kde4/services/ServiceMenus/QPacmanKDEService.desktop" is not compliant with XDG standard (missing trailing semicolon). 
dolphin(11296) KBookmarkManager::notifyChanged: KBookmarkManager::notifyChanged (  "" )

right click on folder (menu is enabled)

### DolphinContextMenu::openItemContextMenu(): ([KFileItem forKUrl("file:///run/media/alex/Games/WEBDIOS_installer") ] )  
### DolphinContextMenu::openItemContextMenu(): selectedItemsProps.supportsWriting() is true 
dolphin(11296) KConfigGroup::readXdgListEntry: List entry MimeType in "/usr/share/kde4/services/ServiceMenus/QPacmanKDEService.desktop" is not compliant with XDG standard (missing trailing semicolon). 
dolphin(11296) KBookmarkManager::notifyChanged: KBookmarkManager::notifyChanged (  "" )

when I opened WEBDIOS_installer directory

## DolphinView::loadDirectory( KUrl("file:///run/media/alex/Games/WEBDIOS_installer") , false )
 
### DolphinView::slotDirectoryLoadingStarted() 
### DolphinView::updateWritableState()[begin]: m_isFolderWritable is false 
### DolphinView::updateWritableState(): root item is [null KFileItem] 
### DolphinView::updateWritableState()[end]: m_isFolderWritable is false 

and rightclicked on empty space (menu is disabled)

dolphin(11296) KConfigGroup::readXdgListEntry: List entry MimeType in "/usr/share/kde4/services/ServiceMenus/QPacmanKDEService.desktop" is not compliant with XDG standard (missing trailing semicolon). 
dolphin(11296) KBookmarkManager::notifyChanged: KBookmarkManager::notifyChanged (  "" )
Comment 8 Emmanuel Pescosta 2014-01-16 17:05:41 UTC
Created attachment 84673 [details]
Patch to (possibly) fix the disabled "new file menu" on viewport

Can you please try this patch?

Apply it to Dolphin (git apply patch_new_file_menu.diff) and recompile.

Thanks!
Comment 9 Emmanuel Pescosta 2014-01-16 17:10:50 UTC
Oh no, openViewportContextMenu() doesn't use selectedItemsProperties(), sorry! :(
Comment 10 Frank Reininghaus 2014-01-16 17:14:17 UTC
(In reply to comment #7)
> ### DolphinView::updateWritableState(): root item is [null KFileItem] 

The problem is that the KFileItem which KDirLister::rootItem() returns for the current URL is null. I think that this should not happen (at least not after we have received the KDirLister's completed() signal) - maybe something is going wrong somewhere in KIO.
Comment 11 Alex Levkovich 2014-01-16 17:25:18 UTC
menu is still disabled
Comment 12 Frank Reininghaus 2014-01-17 08:45:59 UTC
Created attachment 84677 [details]
Workaround

This patch might fix it. It's more a workaround than a real fix though - it might be worth investigating why KDirLister tells us that the "root item" is null. Still, it would be cool if you could test it.
Comment 13 Alex Levkovich 2014-01-17 10:35:59 UTC
It helped. 
I hope the real fix will be released also.
Comment 14 Michael Marley 2014-01-26 13:52:54 UTC
This bug affects other filesystems too.  In my case, when browsing to a Samba share using smb:/, the Create New menu is grayed out despite the fact that I have write permissions to the share.  I can delete files from the share and copy/move new files to it from the local filesystem, but not create new files/directories directly on it.
Comment 15 Frank Reininghaus 2014-01-30 21:13:57 UTC
Git commit 4865303004e1eba6e73342960bac614171323588 by Frank Reininghaus.
Committed on 30/01/2014 at 21:10.
Pushed by freininghaus into branch 'KDE/4.12'.

Always enable the "Create New..." menu if the URL is writable

This commit works around the problem that KDirLister may not provide a
"rootItem" for some kioslaves by setting up a KFileItem with the view
URL and using this to find out if the URL is writable.
Related: bug 330015
REVIEW: 115405
FIXED-IN: 4.12.2

M  +9    -4    dolphin/src/views/dolphinview.cpp

http://commits.kde.org/kde-baseapps/4865303004e1eba6e73342960bac614171323588