Use QFile::exists(f) instead of QFile(f).exists().
It's faster. Change-Id: Ie57619b4e0c53975aa955c83c833c34e1446e4c8 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>bb10
parent
c195fde37a
commit
97b448b152
|
|
@ -747,7 +747,7 @@ QFile::copy(const QString &newName)
|
|||
qWarning("QFile::copy: Empty or null file name");
|
||||
return false;
|
||||
}
|
||||
if (QFile(newName).exists()) {
|
||||
if (QFile::exists(newName)) {
|
||||
// ### Race condition. If a file is moved in after this, it /will/ be
|
||||
// overwritten. On Unix, the proper solution is to use hardlinks:
|
||||
// return ::link(old, new) && ::remove(old); See also rename().
|
||||
|
|
|
|||
|
|
@ -273,7 +273,7 @@ QString TableGenerator::findComposeFile()
|
|||
// check if user’s home directory has a file named .XCompose
|
||||
if (cleanState()) {
|
||||
QString path = qgetenv("HOME") + QStringLiteral("/.XCompose");
|
||||
if (QFile(path).exists())
|
||||
if (QFile::exists(path))
|
||||
return path;
|
||||
}
|
||||
|
||||
|
|
@ -286,7 +286,7 @@ QString TableGenerator::findComposeFile()
|
|||
m_state = UnsupportedLocale;
|
||||
else {
|
||||
QString path = QDir(systemComposeDir()).filePath(table);
|
||||
if (QFile(path).exists())
|
||||
if (QFile::exists(path))
|
||||
return path;
|
||||
}
|
||||
}
|
||||
|
|
@ -308,7 +308,7 @@ bool TableGenerator::findSystemComposeDir()
|
|||
bool found = false;
|
||||
for (int i = 0; i < m_possibleLocations.size(); ++i) {
|
||||
QString path = m_possibleLocations.at(i);
|
||||
if (QFile(path + QLatin1String("/compose.dir")).exists()) {
|
||||
if (QFile::exists(path + QLatin1String("/compose.dir"))) {
|
||||
m_systemComposeDir = path;
|
||||
found = true;
|
||||
break;
|
||||
|
|
|
|||
Loading…
Reference in New Issue