contentstorage/casoftwareregistry/src/casoftwareregistry.cpp
changeset 102 8b8b34fa9751
parent 98 d2f833ab7940
child 107 b34d53f6acdf
equal deleted inserted replaced
100:0920c6a9b6c8 102:8b8b34fa9751
    40  \endcode
    40  \endcode
    41 
    41 
    42  Subsequent calls to CaSoftwareRegistry::create() may return pointers to different
    42  Subsequent calls to CaSoftwareRegistry::create() may return pointers to different
    43  instances. It is a case when between the calls instance counter of the created
    43  instances. It is a case when between the calls instance counter of the created
    44  object dropped to 0 and it was deleted.
    44  object dropped to 0 and it was deleted.
    45  
    45 
    46  */
    46  */
    47 
    47 
    48 /*! \typedef typedef QHash<QString, QString> DetailMap;
    48 /*! \typedef typedef QHash<QString, QString> DetailMap;
    49  * Defines map type for component details.
    49  * Defines map type for component details.
    50  * 
    50  *
    51  */
    51  */
    52 
    52 
    53 /*!
    53 /*!
    54  \var CaSoftwareRegistryPrivate::m_q
    54  \var CaSoftwareRegistryPrivate::m_q
    55  Points to the CaSoftwareRegistry instance that uses this private implementation.
    55  Points to the CaSoftwareRegistry instance that uses this private implementation.
    56  */
    56  */
    57 
    57 
    58 
    58 
    59 // Initialization of a static member variable.
    59 // Initialization of a static member variable.
    60 QWeakPointer<CaSoftwareRegistry> CaSoftwareRegistry::m_instance = 
    60 QWeakPointer<CaSoftwareRegistry> CaSoftwareRegistry::m_instance =
    61     QWeakPointer<CaSoftwareRegistry>();
    61     QWeakPointer<CaSoftwareRegistry>();
    62 
    62 
    63 
    63 
    64 /*!
    64 /*!
    65  Constructor.
    65  Constructor.
   147  CaSoftwareRegistry::DetailMap detailMap = service->entryDetails(5);
   147  CaSoftwareRegistry::DetailMap detailMap = service->entryDetails(5);
   148  QString appName = detailMap[CaSoftwareRegistry::componentNameKey()];
   148  QString appName = detailMap[CaSoftwareRegistry::componentNameKey()];
   149  \endcode
   149  \endcode
   150  \param componentId Component id of the entry details are requested for.
   150  \param componentId Component id of the entry details are requested for.
   151  \return Map of the component details if component id was greater than 0 or
   151  \return Map of the component details if component id was greater than 0 or
   152  empty map otherwise. 
   152  empty map otherwise.
   153 
   153 
   154  */
   154  */
   155 CaSoftwareRegistry::DetailMap CaSoftwareRegistry::entryDetails(
   155 CaSoftwareRegistry::DetailMap CaSoftwareRegistry::entryDetails(
   156     int componentId) const
   156     int componentId) const
   157 {
   157 {
   158     return m_d->entryDetails(componentId);
   158     return m_d->entryDetails(componentId);
   159 }
   159 }
   160 
   160 
   161 /*!
   161 /*!
       
   162  The method provides installation details from USIF.
       
   163  \return QList of DetailMap.
       
   164  */
       
   165 QList<CaSoftwareRegistry::DetailMap>
       
   166         CaSoftwareRegistry::retrieveLogEntries() const
       
   167 {
       
   168     return m_d->retrieveLogEntries();
       
   169 }
       
   170 
       
   171 /*!
   162  * \return Component name key in CaSoftwareRegistry::DetailMap.
   172  * \return Component name key in CaSoftwareRegistry::DetailMap.
   163  */
   173  */
   164 QString CaSoftwareRegistry::componentNameKey()
   174 QString CaSoftwareRegistry::componentNameKey()
   165 {
   175 {
   166     static const QString key("name");
   176     static const QString key("name");
   193     static const QString key("driveInfo");
   203     static const QString key("driveInfo");
   194     return key;
   204     return key;
   195 }
   205 }
   196 
   206 
   197 /*!
   207 /*!
       
   208  * \return Component protection domainkey in CaSoftwareRegistry::DetailMap.
       
   209  */
       
   210 QString CaSoftwareRegistry::componentProtectionDomainKey()
       
   211 {
       
   212     static const QString key("protectiondomain");
       
   213     return key;
       
   214 }
       
   215 
       
   216 /*!
   198  * \return Component size info key in CaSoftwareRegistry::DetailMap.
   217  * \return Component size info key in CaSoftwareRegistry::DetailMap.
   199  */
   218  */
   200 QString CaSoftwareRegistry::componentSizeKey()
   219 QString CaSoftwareRegistry::componentSizeKey()
   201 {
   220 {
   202     static const QString key("size");
   221     static const QString key("size");
   210 {
   229 {
   211     static const QString key("type");
   230     static const QString key("type");
   212     return key;
   231     return key;
   213 }
   232 }
   214 
   233 
       
   234 /*!
       
   235  * \return Component description key in CaSoftwareRegistry::DetailMap.
       
   236  */
       
   237 QString CaSoftwareRegistry::componentDescriptionKey()
       
   238 {
       
   239     static const QString key("description");
       
   240     return key;
       
   241 }
       
   242 
       
   243 /*!
       
   244  * \return Component instalation/uninstallation
       
   245  * time key in CaSoftwareRegistry::DetailMap.
       
   246  */
       
   247 QString CaSoftwareRegistry::componentTimeKey()
       
   248 {
       
   249     static const QString key("time");
       
   250     return key;
       
   251 }
       
   252 
       
   253 /*!
       
   254  * \return Component instalation/uninstallation/upgrade/hidden
       
   255  * operation type key in CaSoftwareRegistry::DetailMap.
       
   256  */
       
   257 QString CaSoftwareRegistry::componentOperationTypeKey()
       
   258 {
       
   259     static const QString key("operationType");
       
   260     return key;
       
   261 }
       
   262 
       
   263 /*!
       
   264  * \return Component instalation
       
   265  * operation value in CaSoftwareRegistry::DetailMap.
       
   266  */
       
   267 QString CaSoftwareRegistry::componentInstallValue()
       
   268 {
       
   269     static const QString value("install");
       
   270     return value;
       
   271 }
       
   272 
       
   273 /*!
       
   274  * \return Component uninstallation
       
   275  * operation value in CaSoftwareRegistry::DetailMap.
       
   276  */
       
   277 QString CaSoftwareRegistry::componentUninstallValue()
       
   278 {
       
   279     static const QString value("uninstall");
       
   280     return value;
       
   281 }
       
   282 
       
   283 /*!
       
   284  * \return Component upgrade
       
   285  * operation value in CaSoftwareRegistry::DetailMap.
       
   286  */
       
   287 QString CaSoftwareRegistry::componentUpgradeValue()
       
   288 {
       
   289     static const QString value("upgrade");
       
   290     return value;
       
   291 }
       
   292 
       
   293 /*!
       
   294  * \return Component hidden
       
   295  * operation value in CaSoftwareRegistry::DetailMap.
       
   296  */
       
   297 QString CaSoftwareRegistry::componentHiddenValue()
       
   298 {
       
   299     static const QString value("hidden");
       
   300     return value;
       
   301 }
       
   302