~ubuntu-branches/ubuntu/oneiric/kdeplasma-addons/oneiric

« back to all changes in this revision

Viewing changes to libs/plasmaweather/weatherconfig.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2010-11-26 13:35:18 UTC
  • mto: (0.4.3 experimental)
  • mto: This revision was merged to the branch mainline in revision 84.
  • Revision ID: james.westby@ubuntu.com-20101126133518-remqkgqjafk2a4jc
Tags: upstream-4.5.80
ImportĀ upstreamĀ versionĀ 4.5.80

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 
22
22
#include <QLineEdit>
23
23
 
 
24
#include <KDebug>
24
25
#include <KInputDialog>
25
26
#include <KPixmapSequence>
26
27
#include <kpixmapsequencewidget.h>
71
72
 
72
73
        if (!busyWidget) {
73
74
            busyWidget = new KPixmapSequenceWidget(q);
74
 
            KPixmapSequence seq("process-working", 22);
 
75
            KPixmapSequence seq(QLatin1String( "process-working" ), 22);
75
76
            busyWidget->setSequence(seq);
76
77
            ui.locationSearchLayout->insertWidget(1, busyWidget);
77
78
        }
158
159
 
159
160
void WeatherConfig::getNewStuff()
160
161
{
161
 
    KNS3::DownloadDialog dialog("kmediafactory.knsrc", this);
 
162
    KNS3::DownloadDialog dialog(QLatin1String( "kmediafactory.knsrc" ), this);
162
163
    dialog.exec();
163
164
    KNS3::Entry::List entries = dialog.changedEntries();
164
165
}
170
171
    qDeleteAll(d->validators);
171
172
    d->validators.clear();
172
173
    if (d->dataengine) {
173
 
        const QVariantList plugins = d->dataengine->query("ions").values();
 
174
        const QVariantList plugins = d->dataengine->query(QLatin1String( "ions" )).values();
174
175
        foreach (const QVariant& plugin, plugins) {
175
 
            const QStringList pluginInfo = plugin.toString().split('|');
 
176
            const QStringList pluginInfo = plugin.toString().split(QLatin1Char( '|' ));
176
177
            if (pluginInfo.count() > 1) {
177
178
                //kDebug() << "ion: " << pluginInfo[0] << pluginInfo[1];
178
179
                //d->ions.insert(pluginInfo[1], pluginInfo[0]);
198
199
 
199
200
    while (it.hasNext()) {
200
201
        it.next();
201
 
        QStringList list = it.value().split('|', QString::SkipEmptyParts);
 
202
        QStringList list = it.value().split(QLatin1Char( '|' ), QString::SkipEmptyParts);
202
203
        if (list.count() > 2) {
203
204
            //kDebug() << list;
204
205
            QString result = i18nc("A weather station location and the weather service it comes from",
266
267
void WeatherConfig::setSource(const QString &source)
267
268
{
268
269
    //kDebug() << "source set to" << source;
269
 
    const QStringList list = source.split('|');
 
270
    const QStringList list = source.split(QLatin1Char( '|' ));
270
271
    if (list.count() > 2) {
271
272
        QString result = i18nc("A weather station location and the weather service it comes from",
272
273
                               "%1 (%2)", list[2], list[0]);
275
276
    d->source = source;
276
277
}
277
278
 
278
 
QString WeatherConfig::source()
 
279
QString WeatherConfig::source() const
279
280
{
280
281
    return d->source;
281
282
}
282
283
 
283
 
int WeatherConfig::updateInterval()
 
284
int WeatherConfig::updateInterval() const
284
285
{
285
286
    return d->ui.updateIntervalSpinBox->value();
286
287
}
287
288
 
288
 
int WeatherConfig::temperatureUnit()
 
289
int WeatherConfig::temperatureUnit() const
289
290
{
290
291
    return d->ui.temperatureComboBox->itemData(d->ui.temperatureComboBox->currentIndex()).toInt();
291
292
}
292
293
 
293
 
int WeatherConfig::pressureUnit()
 
294
int WeatherConfig::pressureUnit() const
294
295
{
295
296
    return d->ui.pressureComboBox->itemData(d->ui.pressureComboBox->currentIndex()).toInt();
296
297
}
297
298
 
298
 
int WeatherConfig::speedUnit()
 
299
int WeatherConfig::speedUnit() const
299
300
{
300
301
    return d->ui.speedComboBox->itemData(d->ui.speedComboBox->currentIndex()).toInt();
301
302
}
302
303
 
303
 
int WeatherConfig::visibilityUnit()
 
304
int WeatherConfig::visibilityUnit() const
304
305
{
305
306
    return d->ui.visibilityComboBox->itemData(d->ui.visibilityComboBox->currentIndex()).toInt();
306
307
}