Git Product home page Git Product logo

Comments (3)

karip avatar karip commented on June 21, 2024

Hi and thanks for raising this issue.

QStorageInfo would be the ideal solution, but according to Jolla "We're currently investigating if QStorageInfo is fully suitable for providing SD card access, and will update developer FAQs once done."
https://lists.sailfishos.org/pipermail/devel/2014-March/003724.html

So, I would suggest a quick and dirty fix now and then perhaps properly fixing it once Jolla has investigated QStorageInfo.

My proposal to fix this is to check how many directories /media/sdcard has. If it has only one, then it is used as the SD Card directory. If there are several directories (case of multiple partitions), then the /media/sdcard directory is used and the user needs to manually select the partition.

In 99% of the cases people are going to have only one partition, so it would make sense to go straight to it. Also, I don't think many will be manually creating extra directories under /media/sdcard.

What do you think of this approach? Or should it also check that the directories are actually mount points?

The latest version of the app (not yet available in the Jolla store) is also showing the space available on the SD Card by running the du shell command. In one partition case, it could just show the space on that one partition. On multiple partition case, perhaps it shouldn't show anything. Any comments about that?

I could actually use the du command output to determine the sd card mount point. Let's see if it is easy to do..

from harbour-file-browser.

foolab avatar foolab commented on June 21, 2024

We leave the directories behind when we unmount them so you can't assume they are all mount points. I guess a matching against /proc/mounts would be the ideal way.
You can also get the names of all the directories under /media/sdcard/ and check /dev/disk/by-uuid/ for the existence of such directories I guess.

Another idea if you feel like it is to use glib GVolumeMonitor. It's the same code used by tracker so it should work fine and glib is whitelisted. I can help with that part if needed.

I'd do it that way:
If there is 1 partition mounted then move to it. If more then I'd show a dialog that allows the user to select which partition should be used. What do you think?

from harbour-file-browser.

karip avatar karip commented on June 21, 2024

I have now modified the app to get all dirs under /media/sdcard and to parse and match against /proc/mounts. The change is available in github and you can see the changes in Engine::sdcardPath().

If there are several partitions, it just goes to /media/sdcard. The user can then select the correct folder. So, it kind of functions as a dialog...

And thanks for telling me that the directories are left behind and how to check against /proc/mounts. I wouldn't have known about those.

from harbour-file-browser.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.