Results 1 to 2 of 2

Thread: How to access files from specific folder using QContentSet

  1. #1
    Join Date
    Jun 2008
    Posts
    6
    Thanks
    1
    Qt products
    Platforms
    Unix/X11

    Post How to access files from specific folder using QContentSet

    hi,

    i downloaded qplay application form http://www.qtopia.net/modules/mydown...wcat.php?cid=2
    it conations code

    Qt Code:
    1. void QPlay::init()
    2. {
    3. QContentSet rtones;
    4. rtones.addCriteria(QContentSet::Location, Qtopia::qtopiaDir() + "etc/SystemRingTones");
    5. rtones.addCriteria(QContentSet::Location, "/mnt/sd");
    6. rtones.addCriteria(QContentSet::Location, QDir::homePath() );
    7.  
    8. rtones.addCriteria(QContentSet::MimeType, "audio/*");
    9.  
    10. QContentSetModel model(&rtones);
    11. for(int i = 0; i < model.rowCount(); i++) {
    12. const QContent &dl = model.content(i);
    13. if (dl.fileKnown()) {
    14. QFileInfo fi(dl.file());
    15. list << fi.fileName() << dl.file();
    16. new QTreeWidgetItem( treeWidget, list);
    17. }
    18. }
    19. }
    To copy to clipboard, switch view to plain text mode 

    QContentSet::Location not present in the qtopia library(QContentSet)..
    i commented below three lines....
    1. rtones.addCriteria(QContentSet::Location, Qtopia::qtopiaDir() + "etc/SystemRingTones");
    2. rtones.addCriteria(QContentSet::Location, "/mnt/sd");
    3. rtones.addCriteria(QContentSet::Location, QDir::homePath() );

    Not it working fine....

    it showing 2 files only...

    how to specify the file path so that i can get more files from my specified directory path. or how to access files from specific path using QContentSet.

    Hrudhay
    Last edited by jpn; 30th June 2008 at 14:06. Reason: missing [code] tags

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to access files from specific folder using QContentSet

    Shouldn't it be QContentFilter::Location and not QContentSet::Location?

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.