OESF | ELSI | pdaXrom | OpenZaurus | Zaurus Themes | Community Links | Ibiblio

IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Naming Of Locations In The Files Tab, adding new storage locations...
iamasmith
post Mar 23 2005, 02:57 PM
Post #1





Group: Members
Posts: 1,248
Joined: 6-July 04
Member No.: 3,928



Hi,

On Sharp ROMs with the Files tab you seem to be able to mount anything that you like under /mnt and there's something that maps the device name thats mounted to a meaningful name.

Mount anything on /dev/mtdblockx and it gets called 'Internal Flash' on the Files tab.

Mount SD Card or CF card and you get the appropriate Icon and an appropriately named file.

Bind mount /tmp into /mnt somewhere and it comes back as 'Temporary Storage'.

Anyone know how to set up new mappings? It would be nicer to have an Icon and a name appear when USB storage is mounted... I looked at Anton's card manager and I'm pretty sure we can add the prerequisite functionality to mount/unount USB storage like SD Card or CF Card... it would be good to have an Icon and a Name though and this is the only bit that isn't particularly obvious.

- Andy
Go to the top of the page
 
+Quote Post
adf
post Mar 25 2005, 02:16 PM
Post #2





Group: Members
Posts: 2,821
Joined: 13-September 04
From: Wasilla Ak.
Member No.: 4,572



Maybe have a shot at editing /etc/mtab?
Go to the top of the page
 
+Quote Post
iamasmith
post Mar 25 2005, 02:31 PM
Post #3





Group: Members
Posts: 1,248
Joined: 6-July 04
Member No.: 3,928



QUOTE(adf @ Mar 25 2005, 10:16 PM)
Maybe have a shot at editing /etc/mtab?
*


mtab just holds the list of current mounts... it's standard Linux stuff... not related to Qtopia.
Go to the top of the page
 
+Quote Post
kahm
post Mar 30 2005, 10:40 AM
Post #4





Group: Members
Posts: 657
Joined: 29-September 04
Member No.: 4,809



I suspect this might be one of those "Built-In-Qtopia" things like application font selection.

Of course I haven't taken the time to dissect the rom, so I could be entirely wrong. I certainly hope so - USB storage showing up in the files tab might be nice.

A downside is that some applications search *everything* in the file tab during some operations - so if you stuck a portable hard drive on there you'd be stuck waiting for 40 minutes trying to open your app as it enumerates every file on the hard drive.
Go to the top of the page
 
+Quote Post
iamasmith
post Apr 7 2005, 03:30 AM
Post #5





Group: Members
Posts: 1,248
Joined: 6-July 04
Member No.: 3,928



QUOTE(kahm @ Mar 30 2005, 06:40 PM)
I suspect this might be one of those "Built-In-Qtopia" things like application font selection.


It is indeed, trawled through the Qtopia source and found it in src/libraries/qtopia/storage.cpp (which becomes part of libqpe.so)

It's implemented as part of the StorageInfo class on the update() member function and looks like this in Qtopia 1.7 (which is the source that I'm reading)...

CODE
           if ( isCF(humanname) ) {
               humanname = tr("CF Card");
               removable = TRUE;
           } else if ( humanname == "/dev/hda1" ) {
               humanname = tr("Hard Disk");
           } else if ( humanname.left(9) == "/dev/mmcd" ) {
               humanname = tr("SD Card");
               removable = TRUE;
           } else if ( humanname.left(7) == "/dev/hd" )
               humanname = tr("Hard Disk") + " " + humanname.mid(7);
           else if ( humanname.left(7) == "/dev/sd" )
               humanname = tr("SCSI Hard Disk") + " " + humanname.mid(7);
           else if ( humanname == "/dev/mtdblock1" || humanname == "/dev/mtdblock/1" )
               humanname = tr("Internal Storage");
           else if ( humanname.left(14) == "/dev/mtdblock/" )
               humanname = tr("Internal Storage") + " " + humanname.mid(14);
           else if ( humanname.left(13) == "/dev/mtdblock" )
               humanname = tr("Internal Storage") + " " + humanname.mid(13);
           else if ( humanname.left(8) == "/dev/ram" )
               humanname = tr("RAM disk") + " " + humanname.mid(8);
           FileSystem *fs = new FileSystem( *it, *fsit, humanname, removable, opts );


I can only assume that in the Sharp Qtopia 1.5 build that the "SCSI Hard Disk" bit is missing which is why /dev/sda1 mounts show up without the name sad.gif

Since the FileSystem class does not expose a function to modify the humanname member it can't be done... in fact the FileSystem class has no entry to these members apart from the constructor for the class....hmm....great thinking (NOT) and exposes only one member - update() - which uses statfs to update the file system stats in the class.

You may ask how Qtopia gets the info out of the class with only one member.. the answer is in storage.h and is pretty rudimentary..

CODE
class QTOPIA_EXPORT FileSystem
{
public:
   const QString &disk() const { return fsdisk; }
   const QString &path() const { return fspath; }
   const QString &name() const { return humanname; }
   const QString &options() const { return opts; }
   long blockSize() const { return blkSize; }
   long totalBlocks() const { return totalBlks; }
   long availBlocks() const { return availBlks; }
   bool isRemovable() const { return removable; }
   bool isWritable() const { return opts.contains("rw"); }

private:
   friend class StorageInfo;
   FileSystem( const QString &disk, const QString &path, const QString &humanname, bool rem, const QString &opts );
   void update();
....


Ah well, at least I tried.

- Andy
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 21st April 2014 - 06:41 AM