Changeset 4599c59


Ignore:
Timestamp:
08/26/14 11:18:07 (4 months ago)
Author:
Ken Moore <ken@…>
Branches:
master, releng/10.1
Children:
4de8568, a67a10f
Parents:
b1edcee
Message:

Give the PBI applications the same treatement as the categories: keep track of them by type, and allow retrieving them by type as well.

Example: "pbi list graphicalapps"
NOTE SYNTAX CHANGE: "pbi list apps" -> "pbi list allapps"

Location:
src-sh/syscache/daemon
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src-sh/syscache/daemon/DB-accesscommands.txt

    re4081c1 r4599c59  
    8686        So if the PBI info is empty, you will want to use the pkg info instead 
    8787         
    88  "pbi list apps" (list all applications in database by pkg origin) 
     88 "pbi list [all/server/text/graphical]apps" (list all applications in database by pkg origin) 
    8989 "pbi list [all/server/text/graphical]cats" (list all categories in database by pkg category) 
    9090 "pbi list new" (list all new applications by pkg origin) 
  • src-sh/syscache/daemon/DB.cpp

    r8205673 r4599c59  
    103103    }else if(request[0]=="pbi"){ 
    104104      if(request[1]=="list"){ 
    105         if(request[2]=="apps"){ hashkey="PBI/pbiList"; sortnames=true;} 
     105        if(request[2]=="allapps"){ hashkey="PBI/pbiList"; sortnames=true;} 
     106        else if(request[2]=="graphicalapps"){ hashkey="PBI/graphicalAppList"; sortnames=true;} 
     107        else if(request[2]=="textapps"){ hashkey="PBI/textAppList"; sortnames=true;} 
     108        else if(request[2]=="serverapps"){ hashkey="PBI/serverAppList"; sortnames=true;} 
    106109        else if(request[2]=="allcats"){ hashkey = "PBI/catList"; } 
    107110        else if(request[2]=="graphicalcats"){ hashkey = "PBI/graphicalCatList"; } 
     
    787790    QStringList pbilist, catlist; 
    788791    QStringList gcats, tcats, scats; //graphical/text/server categories 
     792    QStringList gapps, tapps, sapps; //graphical/text/server apps 
    789793    for(int i=0; i<info.length(); i++){ 
    790794      if(info[i].startsWith("PBI=")){ 
     
    816820        HASH->insert(prefix+"rating", pbi[17]); 
    817821        //Keep track of which category this type falls into 
    818         if(pbi[6].toLower()=="graphical"){ gcats << pbi[0].section("/",0,0); } 
    819         else if(pbi[6].toLower()=="server"){ scats << pbi[0].section("/",0,0); } 
    820         else{ tcats << pbi[0].section("/",0,0); } 
     822        if(pbi[6].toLower()=="graphical"){ gcats << pbi[0].section("/",0,0); gapps << pbi[0]; } 
     823        else if(pbi[6].toLower()=="server"){ scats << pbi[0].section("/",0,0); sapps << pbi[0]; } 
     824        else{ tcats << pbi[0].section("/",0,0); tapps << pbi[0]; } 
    821825         
    822826      }else if(info[i].startsWith("Cat=")){ 
     
    844848    HASH->insert("PBI/textCatList",tcats.join(LISTDELIMITER)); 
    845849    HASH->insert("PBI/serverCatList",scats.join(LISTDELIMITER)); 
     850    HASH->insert("PBI/graphicalAppList",gapps.join(LISTDELIMITER)); 
     851    HASH->insert("PBI/textAppList",tapps.join(LISTDELIMITER)); 
     852    HASH->insert("PBI/serverAppList",sapps.join(LISTDELIMITER)); 
    846853    //Now read/save the appcafe info as well 
    847854    info = readFile("/var/db/pbi/index/AppCafe-index"); 
Note: See TracChangeset for help on using the changeset viewer.