mirror of
https://bitbucket.org/smil3y/kde-workspace.git
synced 2025-02-23 18:32:50 +00:00
ktimezoned: reuse variable
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
f65f0f63a9
commit
3d177ec896
1 changed files with 3 additions and 5 deletions
|
@ -556,22 +556,20 @@ bool KTimeZoned::matchZoneFile(const QString &path)
|
|||
bool KTimeZoned::setLocalZone(const QString &zoneName)
|
||||
{
|
||||
KTimeZone local = mZones.zone(zoneName);
|
||||
const QString path = mZoneinfoDir + '/' + zoneName;
|
||||
if (!local.isValid()) {
|
||||
// It isn't a recognised zone in zone.tab.
|
||||
// Note that some systems (e.g. Gentoo) have zones under zoneinfo which
|
||||
// are not in zone.tab, so check if it points to another zone file.
|
||||
if (mZoneinfoDir.isEmpty())
|
||||
return false;
|
||||
QString path = mZoneinfoDir + '/' + zoneName;
|
||||
QFile qf;
|
||||
qf.setFileName(path);
|
||||
QFileInfo fi(qf);
|
||||
QFileInfo fi(path);
|
||||
if (fi.isSymLink())
|
||||
fi.setFile(fi.canonicalFilePath());
|
||||
if (!fi.exists() || !fi.isReadable())
|
||||
return false;
|
||||
}
|
||||
mLocalZone = zoneName;
|
||||
mLocalZoneDataFile = mZoneinfoDir.isEmpty() ? QString() : mZoneinfoDir + '/' + zoneName;
|
||||
mLocalZoneDataFile = mZoneinfoDir.isEmpty() ? QString() : path;
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue