#include "greeterutils.h"
#include <QSettings>


namespace UKUIGreeter::Utils {

bool isCommunity()
{
    static int sIsCommunity = -1;
    if (sIsCommunity == -1) {
        QString filename = "/etc/os-release";
        QSettings osSettings(filename, QSettings::IniFormat);

        QString versionID = osSettings.value("VERSION_ID").toString();

        if (versionID.compare("22.04", Qt::CaseSensitive)) {
            sIsCommunity = 0;
        } else {
            sIsCommunity = 1;
        }
    }
    return (bool)(sIsCommunity);
}

QString getDefaultFace()
{
    if (isCommunity()) {
        return ":/images/01-default-community.png";
    } else {
        return ":/images/01-default-commercial.png";
    }
}

}
