×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Regular Contributor
    Join Date
    Nov 2010
    Posts
    52

    Help me choose a solution to a problem

    Hi all

    I would like to add "favorites" functionality to my app but i am a little confused on which way to implement this.

    There are a few bits of information i want to record, For example: int ID, QString item, QString itemname

    I was thinking of creating a new connection to another sqlite db but i think it would be abit excessive for my needs.

    Is it possible to save an item favorite to a file, maybe xml? and then search, edit and update the file with new favorires items?

    Any advice or examples for really be appriciated.

    Thanks in advance

  2. #2
    Nokia Developer Moderator
    Join Date
    Oct 2009
    Location
    Finland
    Posts
    327

    Re: Help me choose a solution to a problem

    Is this supposed to be online or offline ? If offline, just use QSettings and put the data under a 'favorites' group.

  3. #3
    Super Contributor
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968

    Re: Help me choose a solution to a problem

    if your all records are stored in DB then i suggest adding an extra element to record that will indicate it is favorite record or not.

  4. #4
    Nokia Developer Champion
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: Help me choose a solution to a problem

    For small amounts of data (maybe a few dozen values) QSettings is generally the way to go. For more data you can go with a flat file or a DB. The flat file can be encoded however you wish -- XML, JSON, CSV, or whatever floats your boat, but you generally have to read/write the whole file unless you do a roll-your-own random access setup. A DB file does random access (to update indivifdual entries) without you having to think much about it.

    If you already have a SQLite DB then it's easy enough to add another table (or simply another column) for this data.

  5. #5
    Regular Contributor
    Join Date
    Nov 2010
    Posts
    52

    Re: Help me choose a solution to a problem

    Quote Originally Posted by achipa View Post
    Is this supposed to be online or offline ? If offline, just use QSettings and put the data under a 'favorites' group.
    Hi achipa

    Thanks veyr much for replying i have taken a look at the QSettings documentation but i am a little confused on how to use it to implement a favorites feature (Offline) Could you please provide an example.

  6. #6
    Regular Contributor
    Join Date
    Oct 2008
    Location
    Oslo, Norway
    Posts
    329

    Re: Help me choose a solution to a problem

    Hi,

    Quote Originally Posted by ginda1 View Post
    Could you please provide an example.
    The examples provided in the documentation for beginWriteArray and beginReadArray should be more or less what you need. You probably want to save the settings file in a private application folder on Symbian, check this thread for more info.

Similar Threads

  1. J2ME: Problem in Nokia Solution for a software problem
    By mte01 in forum Mobile Java Tools & SDKs
    Replies: 4
    Last Post: 2011-06-08, 05:52
  2. Problem and solution
    By danhicksbyron in forum Qt
    Replies: 6
    Last Post: 2010-05-18, 11:13
  3. J2ME: Problem in Nokia Solution for a media problem
    By mte01 in forum Mobile Java Tools & SDKs
    Replies: 0
    Last Post: 2005-08-12, 11:30
  4. Preferification problem - The Solution!
    By dejaniv in forum Mobile Java Tools & SDKs
    Replies: 2
    Last Post: 2003-08-14, 10:18
  5. What is solution of this sms messaging problem?
    By imjdev in forum General Messaging
    Replies: 1
    Last Post: 2003-06-04, 09:13

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •