From 0054d4e8efe62bbd9f2ba026eab80d0deb5d0466 Mon Sep 17 00:00:00 2001 From: Montel Laurent Date: Sun, 9 Apr 2017 16:36:06 +0200 Subject: [PATCH] Use QFileInfo::exists(...) static method --- src/identity/identitydialog.cpp | 6 +++--- src/identity/identityeditvcarddialog.cpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/identity/identitydialog.cpp b/src/identity/identitydialog.cpp index 754fbef8c..0843d83d1 100644 --- a/src/identity/identitydialog.cpp +++ b/src/identity/identitydialog.cpp @@ -953,7 +953,7 @@ void IdentityDialog::setIdentity(KIdentityManagement::Identity &ident) } else { //Convert path. const QString path = QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + QLatin1Char('/') + ident.identityName() + QLatin1String(".vcf"); - if (QFile(path).exists() && (mVcardFilename != path)) { + if (QFileInfo::exists(path) && (mVcardFilename != path)) { mVcardFilename = path; } } @@ -1056,7 +1056,7 @@ void IdentityDialog::updateIdentity(KIdentityManagement::Identity &ident) } void IdentityDialog::slotEditVcard() { - if (QFile(mVcardFilename).exists()) { + if (QFileInfo::exists(mVcardFilename)) { editVcard(mVcardFilename); } else { if (!MailCommon::Kernel::self()->kernelIsRegistered()) { @@ -1113,7 +1113,7 @@ void IdentityDialog::slotVCardRemoved() void IdentityDialog::updateVcardButton() { - if (mVcardFilename.isEmpty() || !QFile(mVcardFilename).exists()) { + if (mVcardFilename.isEmpty() || !QFileInfo::exists(mVcardFilename)) { mEditVCard->setText(i18n("Create...")); } else { mEditVCard->setText(i18n("Edit...")); diff --git a/src/identity/identityeditvcarddialog.cpp b/src/identity/identityeditvcarddialog.cpp index d114102e7..9179fe9d4 100644 --- a/src/identity/identityeditvcarddialog.cpp +++ b/src/identity/identityeditvcarddialog.cpp @@ -25,7 +25,7 @@ #include #include -#include +#include #include #include #include @@ -46,7 +46,7 @@ IdentityEditVcardDialog::IdentityEditVcardDialog(const QString &fileName, QWidge connect(buttonBox, &QDialogButtonBox::accepted, this, &IdentityEditVcardDialog::accept); connect(buttonBox, &QDialogButtonBox::rejected, this, &IdentityEditVcardDialog::reject); - if (QFile(fileName).exists()) { + if (QFileInfo::exists(fileName)) { setWindowTitle(i18n("Edit own vCard")); QPushButton *user1Button = new QPushButton; buttonBox->addButton(user1Button, QDialogButtonBox::ActionRole);