Symbian-Developers

The Official Developers Section => Symbian Software Development Discussions => The Developers Section => Qt Application Development => Topic started by: huellif on January 16, 2014, 12:42:44 am

Title: QCenRep wrapper
Post by: huellif on January 16, 2014, 12:42:44 am
Hello,
I wrote a little central repository wrapper for Qt based apps.

1. Preconditions:

a) in your .pro file:

- link against centralrepository via:
Code: [Select]
LIBS += -lcentralrepositorydepending on the cenrep keys you're reading/writing you have to modify the capabilities of your app.

- add QCenRep.cpp to SOURCES +=
- add QCenRep.h to HEADERS +=

b) in your implementation include the wrapper via
Code: [Select]
#include "QCenRep.h"
2. How to use it:

        - all calls are static
        - to get a CenRep key's value use this format:

                getCenrep(int iUID, int iKey);
                getCenrep(QString iUID, QString iKey);
                getCenrep(char *iUID, char *iKey);

          it always will return a QString, you don't have to care about the original format (int or string). If the key doesn't exist you will get "Missing key!"
         

        - to set a new value:

                setCenrep(int iUID, int iKey, QString qValue);
                setCenrep(int iUID, int iKey, const char *qValue);
                setCenrep(QString iUID, QString iKey, QString qValue);
                setCenrep(const char *iUID, const char *iKey, const char *qValue);

           the type of the value (string or int) gets detected, you don't have to worry about it.

    Example code:

        get the current product improvment status:

            qDebug() << QCenRep::getCenrep(0x2003e081, 0x1);
            qDebug() << QCenRep::getCenrep(QString("0x2003e081"), QString("0x1"));
            qDebug() << QCenRep::getCenrep("0x2003e081", "0x1");

        disable product improvment:

            QCenRep::setCenrep(0x2003e081, 0x1, QString("0"));
            QCenRep::setCenrep(0x2003e081, 0x1, "0");
            QCenRep::setCenrep(QString("0x2003e081"), QString("0x1"), QString("0"));
            QCenRep::setCenrep("0x2003e081", "0x1", "0");


maybe something is buggy, doesn't work or causes problems I didn't test it very much and it's a bit old.

thanks faenil for his cenrep example code from:
https://github.com/faenil/i8910tuning/blob/master/i8910tuning.cpp

GitHub repo: https://github.com/huellif/QCenRep
Title: Re: QCenRep wrapper
Post by: matthew on January 16, 2014, 12:58:23 am
:D
Nice share, mate. i'll test anything for you ;)
Title: Re: QCenRep wrapper
Post by: Allstar12345 on January 16, 2014, 01:28:19 am
Would make that settings Qt App on DMF a whole lot more possible.
Title: Re: QCenRep wrapper
Post by: Motaz on January 16, 2014, 04:52:17 am
Thank you huellif ;)
Did you known how to change number mode from Hindi to Arabic?
I known it stored in 101F8780 and I try this but not worked :(

Code: [Select]
QCenRep::setCenrep("0x101f8780", "0x1", "0");
Title: Re: QCenRep wrapper
Post by: huellif on January 16, 2014, 07:16:16 pm
Thank you huellif ;)
Did you known how to change number mode from Hindi to Arabic?
I known it stored in 101F8780 and I try this but not worked :(

Code: [Select]
QCenRep::setCenrep("0x101f8780", "0x1", "0");

set 0x1 to 0 and 0x2 to 1

[via] (https://sites.google.com/site/i8910wizard/calendar/the-vmp-of-the-game/101f8780-txt)

Would make that settings Qt App on DMF a whole lot more possible.

project seems to be dead
Title: Re: QCenRep wrapper
Post by: Motaz on January 17, 2014, 01:57:05 am
set 0x1 to 0 and 0x2 to 1

[via] (https://sites.google.com/site/i8910wizard/calendar/the-vmp-of-the-game/101f8780-txt)
It's not work .. I test it on Nokia 700 Belle FP2 :(
Title: Re: QCenRep wrapper
Post by: huellif on January 17, 2014, 10:45:11 pm
seems like the old method has stopped working :-\
did you check the .txt in an arabic firmware?
Title: Re: QCenRep wrapper
Post by: Motaz on January 17, 2014, 11:15:03 pm
Yes and there it's:
Code: [Select]
cenrep
version 1
[owner]
0x100058EC
[defaultmeta]
 16777216
[platsec]
 cap_rd=alwayspass cap_wr=WriteDeviceData
[Main]
0x1 int 0 16777216 cap_rd=alwayspass cap_wr=WriteDeviceData
0x2 int 0 16777216 cap_rd=alwayspass cap_wr=WriteDeviceData
Title: Re: QCenRep wrapper
Post by: huellif on January 19, 2014, 04:47:12 pm
did you add wtite devicedata to your app?

Use qDebug() << to get the current status of both entries.
Title: Re: QCenRep wrapper
Post by: Motaz on January 19, 2014, 05:43:18 pm
did you add wtite devicedata to your app?

Use qDebug() << to get the current status of both entries.
Yes, The value saved but the number mode not changed !
Title: Re: QCenRep wrapper
Post by: huellif on February 04, 2014, 12:43:06 am
sorry for delay, I did a little research but didn't found something useful