Beispiel #1
0
void KGameThemeSelector::KGameThemeSelectorPrivate::setupData(KConfigSkeleton * aconfig, KGameThemeSelector::NewStuffState knsflags)
{
    ui.setupUi(q);
    ui.getNewButton->setIcon(QIcon::fromTheme( QLatin1String( "get-hot-new-stuff" )));

    //The lineEdit widget holds our theme path for automatic connection via KConfigXT.
    //But the user should not manipulate it directly, so we hide it.
    ui.kcfg_Theme->hide();
    connect(ui.kcfg_Theme, SIGNAL(textChanged(QString)), q, SLOT(_k_updateThemeList(QString)));

    //Disable KNS button?
    if (knsflags==KGameThemeSelector::NewStuffDisableDownload) {
      ui.getNewButton->hide();
    }

    //Get the last used theme path from the KConfigSkeleton
    KConfigSkeletonItem * configItem = aconfig->findItem(QLatin1String( "Theme" ));
    QString lastUsedTheme = configItem->property().toString();

    //Now get our themes into the list widget

    findThemes(lastUsedTheme);

    connect(ui.getNewButton, SIGNAL(clicked()), q, SLOT(_k_openKNewStuffDialog()));
}
Beispiel #2
0
 QString DcopScriptHandler::readConfig(const QString& key)
 {
     QString cleanKey = key;
     KConfigSkeletonItem* configItem = AmarokConfig::self()->findItem(cleanKey.remove(' '));
     if (configItem)
         return configItem->property().toString();
     else
         return QString::null;
 }
Beispiel #3
0
QString KStars::getOption( const QString &name ) {
    //Some config items are not stored in the Options object while
    //the program is running; catch these here and returntheir current value.
    if ( name == "FocusRA" ) { return QString::number( map()->focus()->ra().Hours(), 'f', 6 ); }
    if ( name == "FocusDec" ) { return QString::number( map()->focus()->dec().Degrees(), 'f', 6 ); }

    KConfigSkeletonItem *it = Options::self()->findItem( name );
    if ( it ) return it->property().toString();
    else return QString();
}
Beispiel #4
0
 QStringList DcopScriptHandler::readListConfig(const QString& key)
 {
     QString cleanKey = key;
     KConfigSkeletonItem* configItem = AmarokConfig::self()->findItem(cleanKey.remove(' '));
     QStringList stringList;
     if(configItem)
     {
         QValueList<QVariant> variantList = configItem->property().toList();
         QValueList<QVariant>::Iterator it = variantList.begin();
         while(it != variantList.end())
         {
             stringList << (*it).toString();
             ++it;
         }
     }
     return stringList;
 }
Beispiel #5
0
QMap<QString, QVariant> Service::parametersFromDescription(const KConfigGroup &description)
{
    QMap<QString, QVariant> params;

    if (!d->config || !description.isValid()) {
        return params;
    }

    const QString op = description.name();
    foreach (const QString &key, description.keyList()) {
        KConfigSkeletonItem *item = d->config->findItem(op, key);
        if (item) {
            params.insert(key, description.readEntry(key, item->property()));
        }
    }

    return params;
}