Ejemplo n.º 1
0
bool ThemeManager::applyTheme(const QString &file)
{
    bool ok = false;
    QXmlSimpleReader reader;
    reader.setContentHandler(this);
    reader.setErrorHandler(this);
    QFile f(file);
    QXmlInputSource xmlsource(&f);

    if (reader.parse(&xmlsource)) {
        ok = true;
    } else {
        #ifdef K_DEBUG
            QString msg = "ThemeManager::applyTheme() - Fatal Error: Can't process the theme file: " + file;
            #ifdef Q_OS_WIN
                qDebug() << msg;
            #else
                tError() << msg;
            #endif
        #endif

        ok = false;
    }
    
    return ok;
}
Ejemplo n.º 2
0
bool KThemeManager::applyTheme(const QString &file)
{
    bool ok = false;
    QXmlSimpleReader reader;
    reader.setContentHandler(this);
    reader.setErrorHandler(this);
    QFile f(file);
    QXmlInputSource xmlsource(&f);

    if (reader.parse(&xmlsource)) {
        ok = true;
    } else {
        kError() <<  QObject::tr("I can't analize the theme file: %1").arg(file) << endl;
        ok = false;
    }
    
    return ok;
}