03-10-2014 11:08 PM
I'm trying to read the list of jpg files on in the sdcard's camera directory. It seems to see some of the images, but not all of them. Currently I've deleted all photos and copied a JPG file into that directory from my computer, and it's not seeing it, My code, roughly, is as follows:
QFileInfoList sdPhotos = sdDir.entryInfoList(nameFilters, QDir::Files, QDir::Time);
qDebug() << "Number of SD photos: " << sdPhotos.size();
There is definitely a jpg file in that directory. I have also used the "Target File System Navigator" in the IDE to browse to:
... and I can see the file.
And yes, my app has permission to used shared files.
I don't have any brilliant ideas for why the app can't see the file. (and even stranger that my recollection was that, before I cleared the directory, it saw a small subset of the files in the directory)
Solved! Go to Solution.
03-10-2014 11:09 PM
Yeah... as I thought: If I take a photo with the camera and try again, it now sees that 1 file, but doesn't see the other test.jpg file there. What gives?
03-10-2014 11:14 PM
If I connect to the device via telnet and go to that directory, I see this:
$ cd camera
$ ls -ltr
-rw-rw---- 1 root 1000_shared 894237 Mar 10 21:27 test.jpg
-rw-rw---- 1 root 1000_shared 777109 Mar 10 23:07 IMG_20140310_230720.jpg
So the two files are plainly there, and they both have the same permissions, but:
Number of SD photos: 1
03-10-2014 11:15 PM
03-11-2014 08:02 AM
Wow.... *rolls eyes*
This is when I say "REALLY?!?!?".
If this was reported early last year and was never fixed in the API, I am scarce to come up with a good excuse for team BlackBerry... oh yoy yoy.
I'll give this theory a try tonight to see if resolve the issue. Thanks very much for pointing me to that forum post.
03-11-2014 08:12 AM
03-11-2014 08:15 AM
The related forum post does refer to two tickets, but when I click them, I get:
You cannot view this issue because you are not the issue reporter or assignee, a member of the project group, or a member of the issue group and this issue is closed or in triage.
If you think this message is wrong, please consult your administrators about getting the necessary permissions.
03-11-2014 08:18 AM - edited 03-11-2014 08:24 AM
03-11-2014 08:23 AM
I gave it a try, and sure enough, adding:
DEFINES += _FILE_OFFSET_BITS=64
DEFINES += _LARGEFILE64_SOURCE=1
... to the .pro file solves the issue.