Those are always hidden as far as NTFS is concerned but leads to unwanted side-effects of NTFS volumes becoming inaccessible in the UI
BUG: 392913
Those are always hidden as far as NTFS is concerned but leads to unwanted side-effects of NTFS volumes becoming inaccessible in the UI
BUG: 392913
My NTFS drive in /media is visible again
Inside the folder I get /media/foo/. where the mapping fails again. Any QUrl or KIO resolve magic to fix that?
No idea this patch is the right approach, just throwing it out for discussion
Lint Skipped |
Unit Tests Skipped |
Only check for folders, a file cannot be a mount, saves querying mount points for hidden files
I tried the patch and it doesn't make a difference here, the mountpoint of my NTFS partition is still hidden.
(it's on an internal drive and mounted to /windows/C via fstab in case it matters)
Additional debug output showed that ep->d_type is not DT_DIR but 0 (which would be DT_UNKNOWN IIANM?) in my case.
It does seem to matter.
I just created an NTFS partition on an USB stick, mounted it via dolphin (to /run/media/...) and in this case ep->d_type is indeed DT_DIR, the patch works as intended in this case.
So maybe you should check for DT_UNKNOWN as well...
src/ioslaves/file/file_unix.cpp | ||
---|---|---|
566 ↗ | (On Diff #36838) | Changing this to 'if (ep->d_type == DT_DIR || ep->d_type == DT_UNKNOWN) {' makes it work in both mentioned cases (internal harddisk mounted on boot via fstab, and external USB stick mounted via dolphin/solid) for me. And hidden directories on the filesystem still are hidden. |
Yes, it does work as expected now here in all cases I tested, and I didn't notice problems.
With additional debug output I do see the '.' entry in the root dir still marked as hidden (as mentioned in the test plan), and also the '..' entry in (first-level) subdirs is hidden.
This could be fixed e.g. by using QDir::cleanPath(), i.e.:
const QString fullFilePath = QDir::cleanPath(path + QLatin1Char('/') + filename);
But I'm not sure that is really necessary as those entries are not displayed at all anyway (even with hidden files enabled).
src/ioslaves/file/file_unix.cpp | ||
---|---|---|
575 | This is entry.fastInsert(...) now as of KIO 5.48.0, see https://cgit.kde.org/kio.git/commit/?id=7048d259529fd37134e9bc1bc8d3edc3d4ac8ef4 |
I also found another problem though: symlinks to the mountpoint/NTFS root dir are (still) hidden as well (also if they are on different partitions).
Using QDir::canonicalPath() (instead of QDir::cleanPath() ) would fix all 3 cases:
const QString fullFilePath = QDir(path + QLatin1Char('/') + filename).canonicalPath();
(that one isn't static...)
Or rather, as the current directory is set to path in line#507, this would actually suffice:
const QString fullFilePath = QDir(filename).canonicalPath();
I cannot speak for the code, but this seems to work perfectly well when I tested it today. I used Kate and KBackup to open some files/directories on an external NTFS, and used KBackup to write a backup to the drive. I didn't have to check 'Show hidden folders' and the device shortcut for the NTFS drive in the Open dialog worked as expected.
I hope this can be pushed soon.
src/ioslaves/file/file_unix.cpp | ||
---|---|---|
567 ↗ | (On Diff #36838) | This still doesn't handle symlinks. As mentioned, const QString fullFilePath = QDir(filename).canonicalPath(); instead should fix that (and still handle . and ..). |
src/ioslaves/file/file_unix.cpp | ||
---|---|---|
567 ↗ | (On Diff #36838) | Sorry I overlooked that, fixed. [1] [1] https://cgit.kde.org/kio.git/commit/?id=4376c0dd4173682a9d91ac071584d784e51a39c2 |