My two cents. I check how dolphin do it.

Dolphin keep global settings in the ~/.kde4/share/apps/dolphin/view_properties/global/.directory file

If local folder is writable, dolphin create .directory file in it, like
[Dolphin]                                                                                                                                      
Timestamp=2013,11,7,15,41,52                                                                                                                   
Version=3                                                                                                                                      
ViewMode=1                                                                                                                                     
         
If local directory isn't writable, dolphin create path of directories in it's config dir. And put .directory file to this path. For example, I changed properties of /usr, as result ~/.kde4/share/apps/dolphin/view_properties/local/usr/.directory file was created.

For all remote filesystems (I test ftp & smb) dolphin use one file ~/.kde4/share/apps/dolphin/view_properties/remote/.directory.


--
Best regards,
Alexander.