| 51 |
void Temperature::init() |
void Temperature::init() |
| 52 |
{ |
{ |
| 53 |
KGlobal::locale()->insertCatalog("plasma_applet_system-monitor"); |
KGlobal::locale()->insertCatalog("plasma_applet_system-monitor"); |
|
KConfigGroup cg = config(); |
|
| 54 |
setEngine(dataEngine("systemmonitor")); |
setEngine(dataEngine("systemmonitor")); |
|
setInterval(cg.readEntry("interval", 2.0) * 1000); |
|
| 55 |
setTitle(i18n("Temperature")); |
setTitle(i18n("Temperature")); |
| 56 |
|
|
| 57 |
|
configChanged(); |
| 58 |
|
|
| 59 |
/* At the time this method is running, not all source may be connected. */ |
/* At the time this method is running, not all source may be connected. */ |
| 60 |
connect(engine(), SIGNAL(sourceAdded(QString)), this, SLOT(sourceAdded(const QString))); |
connect(engine(), SIGNAL(sourceAdded(QString)), this, SLOT(sourceAdded(const QString))); |
| 61 |
foreach (const QString& source, engine()->sources()) { |
foreach (const QString& source, engine()->sources()) { |
| 63 |
} |
} |
| 64 |
} |
} |
| 65 |
|
|
| 66 |
|
void Temperature::configChanged() |
| 67 |
|
{ |
| 68 |
|
KConfigGroup cg = config(); |
| 69 |
|
setInterval(cg.readEntry("interval", 2.0) * 1000); |
| 70 |
|
} |
| 71 |
|
|
| 72 |
void Temperature::sourceAdded(const QString& name) |
void Temperature::sourceAdded(const QString& name) |
| 73 |
{ |
{ |
| 74 |
if (m_rx.indexIn(name) != -1) { |
if (m_rx.indexIn(name) != -1) { |