Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
Dredvard
Posts: 156
Registered: ‎01-27-2012
My Carrier: Rogers
Accepted Solution

Filtering File System

Within Android Java you can search pre-existing indexed filestructure to locate all shared folder containing files of a certain media type (eg. jpg, png, bmp) using managedQuery()

 

Is there a similar method within cascades? (other than parsing the entire directory structure).    The file browser that was previously posted has a filter but is built into a dialog.  I am interested in creating my own gallery - and so I need to be able to do the querying dirctly.

 

 

 

---
If you find my post helpful please "like" it and "accept as a solution"
Please use plain text.
Developer
Innovatology
Posts: 1,277
Registered: ‎03-03-2011
My Carrier: Vodafone

Re: Filtering File System

I'm not sure whether it's available and stable on BB10, but this may be interesting:

 

http://www.qnx.com/developers/docs/6.4.0/neutrino/sys_arch/mme.html

 

Files & Folders, the unified file & cloud manager for PlayBook and BB10 with SkyDrive, SugarSync, Box, Dropbox, Google Drive, Google Docs. Free 3-day trial! - Jon Webb - Innovatology - Utrecht, Netherlands
Please use plain text.
BlackBerry Development Advisor (Retired)
gperry
Posts: 138
Registered: ‎05-11-2012
My Carrier: Developer

Re: Filtering File System

Please use plain text.
Developer
Dredvard
Posts: 156
Registered: ‎01-27-2012
My Carrier: Rogers

Re: Filtering File System

Graham -  All these QNX functions provide info in a single direcitory, such as "Returns a list of QFileInfo objects for all the files and directories in the directory".    BB10 doesn't have a managed BB10 media index?    So the best plan is then to recursively go through the root structure and create my own database?  My fear is that creating this databse each start-up time will delay the initiial population of my gallery - making the start-up of my app kind of sluggish. 

 

Innovatology - The qdb in that Multimedia does sound exactly like what I was looking for.  However, I was unable to find it anywhere in the BlackBerry site.  I'm thinking it doesn't exist.

 

 

---
If you find my post helpful please "like" it and "accept as a solution"
Please use plain text.
Developer
kylefowler
Posts: 525
Registered: ‎05-17-2009
My Carrier: ATT

Re: Filtering File System

I assume that by the time the gold release is out that there will be a file picker control that will allow you to filter by file type before you open it. That may not be exactly what you want but, maybe?

Like all of my posts
Please use plain text.
Developer
Dredvard
Posts: 156
Registered: ‎01-27-2012
My Carrier: Rogers

Re: Filtering File System

True. Tried to implement Graham solution using QDir however I ran into a strange error. Copied this from the Qdir example in the Qt area and just modified it slightly. However the problem I'm running into is that dirinfo.absoluteDir() is returning a QDir not Qstring as it should. Is this a bug where the .at(i) is not implementing right or a bug with the absoluteDir() implementation?

QDir dir1("shared/photos");
dir1.setFilter(QDir::smileyvery-happy:irs | QDir::Hidden | QDir::NoSymLinks);
QFileInfoList dirlist = dir1.entryInfoList();
for (int i = 0; i < dirlist.size(); ++i) {
QFileInfo dirInfo = dirlist.at(i);
// qDebug() << QString("%1 ").arg(dirInfo.absoluteDir());
QString dirstr = dirInfo.absoluteDir();
qDebug() << dirstr<< " AbsDir**** ";
//
}
---
If you find my post helpful please "like" it and "accept as a solution"
Please use plain text.
Developer
borceg
Posts: 670
Registered: ‎03-21-2012
My Carrier: Vip

Re: Filtering File System

[ Edited ]

qdb from QNX 6.5.x http://www.qnx.com/developers/docs/6.5.0/index.jsp?topic=/com.qnx.doc.qdb_en_dev_guide/example.html
qdb.h is present in BB10NDK (C:\bbndk-10.0.06\target_10_0_6_384\qnx6\usr\include\qdb)

And, from Qt docs: http://qt-project.org/doc/qt-4.8/qfileinfo.html
QDir QFileInfo::absoluteDir () const
Returns the file's absolute path as a QDir object.

Please use plain text.
Developer
Dredvard
Posts: 156
Registered: ‎01-27-2012
My Carrier: Rogers

Re: Filtering File System

[ Edited ]

Thanks!! 

 

My bad.  Got messed up between absoluteDir and abosultePath.  Stared at that so many times and just missed the forest cuz of the trees.

 

So Qdb is there.   Cool.  Then probably we'll have to wait to gold until  we are provide with a BB10 DB to do any media querying.

---
If you find my post helpful please "like" it and "accept as a solution"
Please use plain text.
BlackBerry Development Advisor (Retired)
gperry
Posts: 138
Registered: ‎05-11-2012
My Carrier: Developer

Re: Filtering File System

Excellent

Please use plain text.