コード例 #1
0
void KoColorConversionSystem::insertColorSpace(const KoColorSpaceFactory* csf)
{
    dbgPigment << "Inserting color space " << csf->name() << " (" << csf->id() << ") Model: " << csf->colorModelId() << " Depth: " << csf->colorDepthId() << " into the CCS";
    QList<const KoColorProfile*> profiles = KoColorSpaceRegistry::instance()->profilesFor(csf);
    QString modelId = csf->colorModelId().id();
    QString depthId = csf->colorDepthId().id();
    if (profiles.isEmpty()) { // There is no profile for this CS, create a node without profile name if the color engine isn't icc-based
        if (csf->colorSpaceEngine() != "icc") {
            Node* n = nodeFor(modelId, depthId, "");
            n->init(csf);
        }
        else {
            dbgPigment << "Cannot add node for " << csf->name() << ", since there are no profiles available";
        }
    } else {
        // Initialise the nodes
        foreach(const KoColorProfile* profile, profiles) {
            Node* n = nodeFor(modelId, depthId, profile->name());
            n->init(csf);
            if (!csf->colorSpaceEngine().isEmpty()) {
                KoColorSpaceEngine* engine = KoColorSpaceEngineRegistry::instance()->get(csf->colorSpaceEngine());
                Q_ASSERT(engine);
                NodeKey engineKey(engine->id(), engine->id(), engine->id());
                Node* engineNode = 0;
                if (d->graph.contains(engineKey)) {
                    engineNode = d->graph[engineKey];
                } else {
                    engineNode = insertEngine(engine);
                }
                connectToEngine(n, engineNode);
            }
        }
    }
コード例 #2
0
ファイル: hdd.cpp プロジェクト: mgottschlag/kwin-tiling
void Hdd::configChanged()
{
    KConfigGroup cg = config();
    QStringList sources = cg.readEntry("uuids", mounted());
    setSources(sources);
    setInterval(cg.readEntry("interval", 2) * 60 * 1000);
    connectToEngine();
}
コード例 #3
0
ファイル: hwinfo.cpp プロジェクト: mgottschlag/kwin-tiling
void HWInfo::init()
{
    KGlobal::locale()->insertCatalog("plasma_applet_system-monitor");
    setTitle(i18n("Hardware Info"));
    setEngine(dataEngine("soliddevice"));
    setSources();
    connectToEngine();
}
コード例 #4
0
void PlasmaMuleApplet::init()
{
	m_debugChannel = KDebug::registerArea ("plasmamule-applet",
#ifdef __DEBUG__
	true
#else
	false
#endif
	);
	connectToEngine();
}
コード例 #5
0
ファイル: luna.cpp プロジェクト: KDE/kdeplasma-addons
void Luna::init()
{
    configChanged();
    m_theme = new Plasma::Svg(this);
    m_theme->setImagePath("widgets/luna");
    m_theme->setContainsMultipleImages(true);

    if (!m_theme->isValid()) {
        setFailedToLaunch(true, i18n("The luna SVG file was not found"));
        return;
    }

    Plasma::ToolTipManager::self()->registerWidget(this);

    connectToEngine();
}
コード例 #6
0
ファイル: clock.cpp プロジェクト: mgottschlag/kwin-tiling
void Clock::clockConfigChanged()
{
    KConfigGroup cg = config();
    m_showSecondHand = cg.readEntry("showSecondHand", false);
    m_showTimezoneString = cg.readEntry("showTimezoneString", false);
    m_showingTimezone = m_showTimezoneString;
    m_fancyHands = cg.readEntry("fancyHands", false);
    setCurrentTimezone(cg.readEntry("timezone", localTimezone()));

    if (m_showSecondHand) {
        //We don't need to cache the applet if it update every seconds
        setCacheMode(QGraphicsItem::NoCache);
    } else {
        setCacheMode(QGraphicsItem::DeviceCoordinateCache);
    }

    connectToEngine();
    invalidateCache();
}
コード例 #7
0
ファイル: clock.cpp プロジェクト: mgottschlag/kwin-tiling
void Clock::clockConfigAccepted()
{
    KConfigGroup cg = config();
    m_showTimezoneString = ui.showTimezoneStringCheckBox->isChecked();
    m_showingTimezone = m_showTimezoneString || shouldDisplayTimezone();
    m_showSecondHand = ui.showSecondHandCheckBox->isChecked();

    if (m_showSecondHand) {
        //We don't need to cache the applet if it update every seconds
        setCacheMode(QGraphicsItem::NoCache);
    } else {
        setCacheMode(QGraphicsItem::DeviceCoordinateCache);
    }

    cg.writeEntry("showSecondHand", m_showSecondHand);
    cg.writeEntry("showTimezoneString", m_showTimezoneString);
    update();

    dataEngine("time")->disconnectSource(currentTimezone(), this);
    connectToEngine();

    constraintsEvent(Plasma::AllConstraints);
    emit configNeedsSaving();
}