diff --git a/smb/kio_smb_browse.cpp b/smb/kio_smb_browse.cpp --- a/smb/kio_smb_browse.cpp +++ b/smb/kio_smb_browse.cpp @@ -309,6 +309,7 @@ int dirfd; struct smbc_dirent *dirp = NULL; UDSEntry udsentry; + bool dir_is_root = true; dirfd = smbc_opendir( m_current_url.toSmbcUrl() ); if (dirfd > 0){ @@ -350,8 +351,12 @@ udsentry.insert(KIO::UDSEntry::UDS_HIDDEN, 1); } - if (udsName == "." || udsName == "..") + if (udsName == ".") { + } + else if (udsName == "..") + { + dir_is_root = false; // fprintf(stderr,"----------- hide: -%s-\n",dirp->name); // do nothing and hide the hidden shares } @@ -430,6 +435,20 @@ udsentry.clear(); } while (dirp); // checked already in the head + if (dir_is_root) { + udsentry.insert(KIO::UDSEntry::UDS_FILE_TYPE, S_IFDIR); + udsentry.insert(KIO::UDSEntry::UDS_NAME, "."); + udsentry.insert(KIO::UDSEntry::UDS_ACCESS, (S_IRUSR | S_IRGRP | S_IROTH | S_IXUSR | S_IXGRP | S_IXOTH)); + udsentry.insert(KIO::UDSEntry::UDS_MIME_TYPE, QLatin1String("application/x-smb-server")); + } + else + { + udsentry.insert(KIO::UDSEntry::UDS_NAME, "."); + browse_stat_path(m_current_url, udsentry, true); + } + listEntry(udsentry); + udsentry.clear(); + // clean up smbc_closedir(dirfd); }