File Open dialog does not show mounted servers under Ubuntu
In my Ubuntu-10.04 Qt application I need to access files (and select directory) on connected servers, which I see as folder icons on my desktop. However, the open file/select directory dialog does not include these connections.
What should I do let them be visible in the dialogs?
I use
QFileDialog::getOpenFileName(this,tr("Open pattern file"),patternfilepath, tr("Pattern files Files (%1)").arg(pname));
and
QFileDialog::getExistingDirectory(this, tr("Open Directory"), "/home", patterndirpath,QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks);
Are there dialog variants that will work better?
BN
Re: File Open dialog does not show mounted servers under Ubuntu
What do you consider a "connected server"?
Re: File Open dialog does not show mounted servers under Ubuntu
As you may know, at the top of the Ubuntu desktop, there is a menubar.
In this menubar there are Applications, Places and System menus.
In the Places menu, there is an item called "Connect to server...".
Activating this item will give a dialog where you can select SSH, FTP (with login), Public FTP, Windows share, WebDAV, Secure WebDAV and Custom Location.
I have so far used SSH and Windows share.
For both of these, after supplying the connection details and authentication in to the server, a folder symbol is created on the desktop, containing the files present on the server I am connected to.
In my application, this server symbol is not present in the File Open.. or Select Directory.. dialogs.
Please tell me if you need a more detailed explanation of the situation.
BN
Re: File Open dialog does not show mounted servers under Ubuntu
Quote:
Originally Posted by
bnilsson
As you may know, at the top of the Ubuntu desktop, there is a menubar.
I don't, I don't use Gnome.
Quote:
Please tell me if you need a more detailed explanation of the situation.
Open a console, run "mount" and see if your "connected servers" are listed there. If so, there will be paths listed alongside them where the "connected servers" have been mounted. In Unix there is no concept or "drives" or "servers", there is a coherent filesystem tree starting with the root (/). Mounted devices (be it local or remote) become parts of the tree.
Re: File Open dialog does not show mounted servers under Ubuntu
bnilsson@ubuntu:~$ mount
/dev/sda1 on / type ext4 (rw,errors=remount-ro,commit=0)
proc on /proc type proc (rw,noexec,nosuid,nodev)
none on /sys type sysfs (rw,noexec,nosuid,nodev)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
none on /dev type devtmpfs (rw,mode=0755)
none on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
none on /dev/shm type tmpfs (rw,nosuid,nodev)
none on /var/run type tmpfs (rw,nosuid,mode=0755)
none on /var/lock type tmpfs (rw,noexec,nosuid,nodev)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
.host:/ on /mnt/hgfs type vmhgfs (rw,ttl=1)
none on /proc/fs/vmblock/mountPoint type vmblock (rw)
gvfs-fuse-daemon on /home/bnilsson/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=bnilsson)
I can also tell you that the native Ubuntu Application/Acessories/Text Editor does show the mounted server symbol in the file browser, while my Qt application does not.
Re: File Open dialog does not show mounted servers under Ubuntu
There is no such thing as "native Ubuntu Application". It's an application that uses the Gnome filesystem abstraction. You can handle a similar thing in Qt as well if you implement it yourself but don't expect Qt to handle every possible abstraction of every possible system and solution in the world. You can reverse the situation and ask whether Gnome handles this situation in such a way instead of using someone else's "standard solution". I could ask why my GIMP doesn't handle KDE's "Places" container in its file dialogs.
Re: File Open dialog does not show mounted servers under Ubuntu
So what you are saying is that Qt's implementation of file dialogs in Ubuntu is not working it is my problem to solve it?
Re: File Open dialog does not show mounted servers under Ubuntu
What I'm saying is that if you need something extra they you have to implement it on your own. For static file dialogs Qt uses by default the desktop implementation of the dialog (so it should pick up what your desktop manager (Gnome+Metacity) offers). If you are not getting some functionality it might offer, you can't expect Qt to handle every possible case of calling the native dialog. You can always call the native dialog yourself with options and API the dialog offers.
Re: File Open dialog does not show mounted servers under Ubuntu
Ok, I would think this feature is pretty darn basic...
However this is a real bonafide show-stopper for my application.
Any hints on how I can gather information on how I should proceed?
I would invite other readers to respond too, if possible.
Re: File Open dialog does not show mounted servers under Ubuntu
So is your "connected server" in the list of mounted filesystems or not?
Re: File Open dialog does not show mounted servers under Ubuntu
The line from 'mount'
gvfs-fuse-daemon on /home/bnilsson/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=bnilsson)
is related.
/home/bnilsson/.gvfs contains an item with the same name as the folder symbol on my desktop.
For a windows share on the server mc2-p007 it is called: bnilsson on mc2-p007
For a ssh mount on the server mc2-p007 it is called: sftp for bnilsson on mc2-p007
BN
Re: File Open dialog does not show mounted servers under Ubuntu
So it's not mounted thus it gets mounted once you actually first access it or it's only accessible from gnome's file dialogs. If you run a file dialog from your Qt apps, do you get the standard gtk file dialog as for other apps on your system or do you get a custom Qt-based dialog?
Re: File Open dialog does not show mounted servers under Ubuntu
Quote:
Originally Posted by
wysota
So it's not mounted thus it gets mounted once you actually first access it or it's only accessible from gnome's file dialogs. If you run a file dialog from your Qt apps, do you get the standard gtk file dialog as for other apps on your system or do you get a custom Qt-based dialog?
As far as I can tell it is native. It looks the same as in other Ubuntu apps with an Open File menu the except that in the left column for "Places" there is nothing inbetween "File system" and "Floppy drive", where my "server" symbol is placed in the other apps.
Maybe this information is meningless for you since you don't run Ubuntu, but this is what I see.
Re: File Open dialog does not show mounted servers under Ubuntu
Trust me, the fact that you are using Ubuntu has nothing to do with this. I can install Gnome with gvfs on my Mandriva and have a similar behaviour. If the dialog doesn't contain the "places" part then either Qt does it on purpose because of some reason or there is a Gnome-originated reason for not showing the places container.
Re: File Open dialog does not show mounted servers under Ubuntu
Quote:
Originally Posted by
wysota
If the dialog doesn't contain the "places" part then either Qt does it on purpose because of some reason or there is a Gnome-originated reason for not showing the places container.
I want to point out that the "Places " section is NOT missing from the File Dialog, it is only the "server" item in the "Places" list that is not there.
Re: File Open dialog does not show mounted servers under Ubuntu
Re: File Open dialog does not show mounted servers under Ubuntu
Quote:
Originally Posted by
wysota
Qt does it on purpose because of some reason or there is a Gnome-originated reason for not showing the places container.
You cannot be serious...
Added after 13 minutes:
A workaround for the time being:
mkdir servers
ln -s .gvfs servers
I can open the "server" folder and then find my files.
But I still it is a bug/flaw in the QFileDialog. You can argue about secret reasons, but this is my standpoint.
Re: File Open dialog does not show mounted servers under Ubuntu
I don't argue about "secret reasons", Qt is open-source - take its source code and check it out yourself. Do you expect me to do that for you? Qt uses Gnome's file dialog - it just calls a function from some Gnome library, it doesn't "delete" the entries from the dialog and it doesn't try to "mimic" the original dialog.
Re: File Open dialog does not show mounted servers under Ubuntu
Well, it seems this discussion has reached a dead end.
I filed a bug report, we'll se what happens next. Maybe someone will take care of it.
Re: File Open dialog does not show mounted servers under Ubuntu
I'm using WinXP. I have mounted disks from our local server on fedora. I set to mount them on system startup. Your code works good at my app.
In My Computer I have three mounted disks and in QFileDialog they displayed properly.