maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   Find installed package version with Qt (https://talk.maemo.org/showthread.php?t=75049)

XenGi 2011-07-18 17:54

Find installed package version with Qt
 
Hi,

I'm developing a tool to upload the highscores from Angrybirds to the website angrybirds-score.com.
I need to find out if angrybirds is installed and if yes which version of it.

So I need to call something like:
Code:

dpkg -l | grep "angrybirds " | head -1
I found the system() function but that stops the rendering of my Qt GUI so this is no option for me. Another tip was QProcess but I have no idea how to use it.
Does anybody know how to do this in a "correct" way?

Another question is, how can I ensure that angrybirds is installed when somebody wants to install my app? I'm thinking of dependencies here. I have no experience with this.
I'm usings the Qt SDK 1.1 and the included Qt Creator.

I have the same problem for Symbian, Windows and MeeGo 1.2 Harmattan but first I want to make my app availale for Maemo5.

I hope somebody can help.

MohammadAG 2011-07-18 21:54

Re: Find installed package version with Qt
 
Does the version matter?

If not
Code:

#include <QFile>
#include <QDebug>

int main()
{
    if (!QFile::exists("/var/lib/dpkg/info/angrybirds.list")
        qFatal("Angry birds not installed.")

    return 0;
}


SHARP66 2011-07-18 23:38

Re: Find installed package version with Qt
 
just a thought....better... do a program for downloading scores......best helpers from for this community and spends time for us (no charge) that is more interesting for me ....not ovi store money makers

XenGi 2011-07-19 07:09

Re: Find installed package version with Qt
 
Quote:

Originally Posted by SHARP66 (Post 1053717)
just a thought....better... do a program for downloading scores......best helpers from for this community and spends time for us (no charge) that is more interesting for me ....not ovi store money makers

Thats a good idea. So you can use the site as a backup. Why have I never thought about that?

I will talk to the guy who maintains the site and maybe I can add this feature. Thanks.

@MohammadAG
I will check the files off the game directly so this is not the problem but it would be nice to display the installed version. It isn't a "must have" so if there is no small simple way I will not implement it.


All times are GMT. The time now is 11:14.

vBulletin® Version 3.8.8