diff --git a/src/core/knfsshare.cpp b/src/core/knfsshare.cpp --- a/src/core/knfsshare.cpp +++ b/src/core/knfsshare.cpp @@ -18,6 +18,7 @@ #include "knfsshare.h" +#include #include #include #include @@ -64,7 +65,7 @@ KConfigGroup config(&knfsshare, "General"); exportsFile = config.readPathEntry("exportsFile", QString()); - if (QFile::exists(exportsFile)) { + if (!exportsFile.isEmpty() && QFileInfo::exists(exportsFile)) { return true; } @@ -167,7 +168,7 @@ KNFSShare::KNFSShare() : d(new KNFSSharePrivate(this)) { - if (QFile::exists(d->exportsFile)) { + if (!d->exportsFile.isEmpty() && QFileInfo::exists(d->exportsFile)) { KDirWatch::self()->addFile(d->exportsFile); connect(KDirWatch::self(), SIGNAL(dirty(QString)), this, SLOT(_k_slotFileChange(QString))); diff --git a/src/core/ksambashare.cpp b/src/core/ksambashare.cpp --- a/src/core/ksambashare.cpp +++ b/src/core/ksambashare.cpp @@ -435,7 +435,7 @@ , d_ptr(new KSambaSharePrivate(this)) { Q_D(const KSambaShare); - if (QFile::exists(d->userSharePath)) { + if (!d->userSharePath.isEmpty() && QFileInfo::exists(d->userSharePath)) { KDirWatch::self()->addDir(d->userSharePath, KDirWatch::WatchFiles); connect(KDirWatch::self(), SIGNAL(dirty(QString)), this, SLOT(_k_slotFileChange(QString)));