Commit 3beddc04 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

using QFileInfo::exists( ) here too

parent 33d9a05b
...@@ -447,7 +447,7 @@ KAEvent KAlarmDirResource::loadFile(const QString &path, const QString &file) ...@@ -447,7 +447,7 @@ KAEvent KAlarmDirResource::loadFile(const QString &path, const QString &file)
if (!fileStorage->load()) { if (!fileStorage->load()) {
// Don't output an error in the case of the creation of a temporary // Don't output an error in the case of the creation of a temporary
// file which triggered fileChanged() but no longer exists. // file which triggered fileChanged() but no longer exists.
if (QFile(path).exists()) { if (QFileInfo::exists(path)) {
qCWarning(KALARMDIRRESOURCE_LOG) << "Error loading" << path; qCWarning(KALARMDIRRESOURCE_LOG) << "Error loading" << path;
} }
return KAEvent(); return KAEvent();
...@@ -1167,7 +1167,7 @@ bool KAlarmDirResource::isFileValid(const QString &file) const ...@@ -1167,7 +1167,7 @@ bool KAlarmDirResource::isFileValid(const QString &file) const
return !file.isEmpty() return !file.isEmpty()
&& !file.startsWith(QLatin1Char('.')) && !file.endsWith(QLatin1Char('~')) && !file.startsWith(QLatin1Char('.')) && !file.endsWith(QLatin1Char('~'))
&& file != QLatin1String(warningFile) && file != QLatin1String(warningFile)
&& QFile(filePath(file)).exists(); // a temporary file may no longer exist && QFileInfo::exists(filePath(file)); // a temporary file may no longer exist
} }
AKONADI_RESOURCE_MAIN(KAlarmDirResource) AKONADI_RESOURCE_MAIN(KAlarmDirResource)
...@@ -226,7 +226,7 @@ void SingleFileResourceBase::fileChanged(const QString &fileName) ...@@ -226,7 +226,7 @@ void SingleFileResourceBase::fileChanged(const QString &fileName)
int i = 0; int i = 0;
do { do {
lostFoundFileName = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1Char('/') + identifier() + QDir::separator() + prevUrl.fileName() + QLatin1Char('-') + QString::number(++i); lostFoundFileName = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1Char('/') + identifier() + QDir::separator() + prevUrl.fileName() + QLatin1Char('-') + QString::number(++i);
} while (QFile(lostFoundFileName).exists()); } while (QFileInfo::exists(lostFoundFileName));
// create the directory if it doesn't exist yet // create the directory if it doesn't exist yet
QDir dir = QFileInfo(lostFoundFileName).dir(); QDir dir = QFileInfo(lostFoundFileName).dir();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment