Example #1
0
QString CityInfo::text() const
{
    QString line;
    QDateTime cityTime;

    if ( !mZone.isNull() ) {
        QTimeZone curZone( mZone.toLocal8Bit().constData() );
        if ( curZone.isValid() )
            cityTime = curZone.fromUtc(mUtc);
        line = QTimeString::localHMDayOfWeek(cityTime).simplified();
        return line;
    }
    else {
        return QString();
    }
}
Example #2
0
QString CityInfo::text() const
{
    QString line;
    QDateTime cityTime;

    if ( !mZone.isNull() ) {
        QTimeZone curZone( mZone.toLocal8Bit().constData() );
        if ( curZone.isValid() )
            cityTime = curZone.fromUtc(mUtc);
//        else
        //          qLog(Time) << "CityInfo()::text() curZone Not valid!";
        line = QTimeString::localHMDayOfWeek(cityTime).simplified();
        
//         qLog(Time) << "CityInfo()::text() cityTime=" << cityTime.toString("hh:mm");
//         qLog(Time) << "CityInfo()::text() timestring=" << line.toLocal8Bit().constData();
        return line;
    }
    else {
//        qLog(Time) << "CityInfo()::text() - mZone is NULL!";
        return QString();
    }
}