ssu
Loading...
Searching...
No Matches
SsuDeviceInfo Class Reference
Inheritance diagram for SsuDeviceInfo:

Public Member Functions

 SsuDeviceInfo (const QString &model=QString())
QStringList adaptationRepos ()
QString adaptationVariables (const QString &adaptationName, QHash< QString, QString > *storageHash)
bool contains (const QString &model=QString())
Q_INVOKABLE QString deviceFamily ()
Q_INVOKABLE QString deviceVariant (bool fallback=false)
Q_INVOKABLE QString deviceModel ()
Q_INVOKABLE QString deviceUid ()
QStringList disabledRepos ()
Q_INVOKABLE QString displayName (int type)
QStringList repos (bool rnd=false, int filter=Ssu::NoFilter)
Q_INVOKABLE void setDeviceModel (const QString &model=QString())
QVariant variable (const QString &section, const QString &key)
void variableSection (const QString &section, QHash< QString, QString > *storageHash)
QVariant value (const QString &key, const QVariant &value=QVariant())

Detailed Description

Definition at line 17 of file ssudeviceinfo.h.

Constructor & Destructor Documentation

◆ SsuDeviceInfo()

SsuDeviceInfo::SsuDeviceInfo ( const QString & model = QString())

Initialize with device to override autodetection

Definition at line 26 of file ssudeviceinfo.cpp.

◆ ~SsuDeviceInfo()

SsuDeviceInfo::~SsuDeviceInfo ( )
virtual

Definition at line 34 of file ssudeviceinfo.cpp.

Member Function Documentation

◆ adaptationRepos()

QStringList SsuDeviceInfo::adaptationRepos ( )

Return the list of adaptations used for the set model

Definition at line 39 of file ssudeviceinfo.cpp.

◆ adaptationVariables()

QString SsuDeviceInfo::adaptationVariables ( const QString & adaptationName,
QHash< QString, QString > * storageHash )

Resolve adaptation-specific variables for adaptationName, and store them in storageHash Returns "adaptation" if a valid adaptation was found, adaptationName otherwise

Definition at line 51 of file ssudeviceinfo.cpp.

◆ contains()

bool SsuDeviceInfo::contains ( const QString & model = QString())

Check if a given model is available in the deviceinfo database, either directly, or as variant. If no model is provided as argument the autodetected or previously set model is used.

Attention
This function temporarily changes the detected model, and therefore should not be used in a multithreaded environment, unless you like funny results.

Definition at line 128 of file ssudeviceinfo.cpp.

◆ deviceFamily()

QString SsuDeviceInfo::deviceFamily ( )

Try to find the device family for the system this is running on.

Definition at line 150 of file ssudeviceinfo.cpp.

◆ deviceModel()

QString SsuDeviceInfo::deviceModel ( )

Try to find out ond what kind of system this is running

Definition at line 185 of file ssudeviceinfo.cpp.

◆ deviceUid()

QString SsuDeviceInfo::deviceUid ( )

Calculate the device ID used in ssu requests

Returns
The first imei from oFono ModemManager API, if available, or WLAN mac address, or device uid fallback code similar to QDeviceInfo::uniqueDeviceID()

Definition at line 320 of file ssudeviceinfo.cpp.

◆ deviceVariant()

QString SsuDeviceInfo::deviceVariant ( bool fallback = false)

Try to find the device variant for the system this is running on. If the device is not a variant it will return an empty string. If fallback is set to true it return the device model in this case.

Definition at line 170 of file ssudeviceinfo.cpp.

◆ disabledRepos()

QStringList SsuDeviceInfo::disabledRepos ( )

Return the list of repositories explicitely disabled for this device This does not include repositories only disabled in the user configuration.

Definition at line 354 of file ssudeviceinfo.cpp.

◆ displayName()

QString SsuDeviceInfo::displayName ( int type)

Return a string suitable for display in dialogs, ...

See Ssu::DeviceTypes for supported types.

If not configured the model name used by ssu will be returned instead for product and type. If no manufacturer is found UNKNOWN is returned. For an invalid type an empty string is returned.

Definition at line 366 of file ssudeviceinfo.cpp.

◆ repos()

QStringList SsuDeviceInfo::repos ( bool rnd = false,
int filter = Ssu::NoFilter )

Return the complete list of repositories configured for a device. Depending on the filter options, all repostories (user and board), only board-specific, or only user-specific are returned. Disabled repositories are excluded depending on filter settings.

Definition at line 411 of file ssudeviceinfo.cpp.

◆ setDeviceModel()

void SsuDeviceInfo::setDeviceModel ( const QString & model = QString())

Override device model autodetection

Definition at line 479 of file ssudeviceinfo.cpp.

◆ value()

QVariant SsuDeviceInfo::value ( const QString & key,
const QVariant & value = QVariant() )

Return a value from an adaptation section. Returns an empty string or a given default value if key does not exist.

If a device is marked as variant, and the requested key exists in a dedicated device section the key from the device section will get returned, otherwise the one from the variant.

Definition at line 490 of file ssudeviceinfo.cpp.

◆ variable()

QVariant SsuDeviceInfo::variable ( const QString & section,
const QString & key )

Return a variable from the given variable section. 'var'- is automatically prepended to the section name if not specified already. Recursive search through several variable sections (specified in the section) is supported, returned will be the first occurence of the variable.

Todo
compat-setting as ssudeviceinfo guaranteed to prepend sections with var-; SsuVariables does not have this guarantee. Remove from here as well.

Definition at line 459 of file ssudeviceinfo.cpp.

◆ variableSection()

void SsuDeviceInfo::variableSection ( const QString & section,
QHash< QString, QString > * storageHash )

Return the requested variable section. 'var-' is automatically prepended to the section name if not specified already.

Definition at line 470 of file ssudeviceinfo.cpp.


The documentation for this class was generated from the following files: