device dataengine sources

Rafał Miłecki zajec5 at gmail.com
Mon Apr 7 06:45:09 CEST 2008


2008/4/7, Sebastian Kuegler <sebas at kde.org>:
>  I'm currently writing an article explaining how to write a plasmoid for a
>  magazine. I want to have a small plasmoid shown when you stick in a USB
>  stick.
>
>  To show this in the soliddevice dataengine. Which DataSource do I have to
>  connect to?

Why don't you check source of devicenotifier? You can use simply websvn:
http://websvn.kde.org/trunk/KDE/kdebase/workspace/plasma/applets/devicenotifier/devicenotifier.cpp?view=log

As you can see in this file:
    m_solidEngine = dataEngine("hotplug");
    (...)
    //connect to engine when a device is plug
    connect(m_solidEngine, SIGNAL(newSource(const QString&)),
            this, SLOT(onSourceAdded(const QString&)));
    connect(m_solidEngine, SIGNAL(sourceRemoved(const QString&)),
            this, SLOT(onSourceRemoved(const QString&)));

-- 
Rafał Miłecki


More information about the Panel-devel mailing list