summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin T. H. Sandsmark <martin.sandsmark@kde.org>2016-10-15 15:30:56 (GMT)
committerMartin T. H. Sandsmark <martin.sandsmark@kde.org>2016-10-15 15:37:59 (GMT)
commit2d3a5775485ba84ad21c84523064708998aa6cac (patch)
tree0d7eecc7d552b28629740c57194e4b5b8e037aaa
parent759234c0e3666536496660746e97995024dc61c2 (diff)
Port away from KIO::NetAccess, kde_file.h
-rw-r--r--lib/document/document.h3
-rw-r--r--lib/urlutils.cpp16
2 files changed, 7 insertions, 12 deletions
diff --git a/lib/document/document.h b/lib/document/document.h
index 9b1ee4d..3417569 100644
--- a/lib/document/document.h
+++ b/lib/document/document.h
@@ -30,9 +30,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include <QSharedData>
#include <QSize>
-// KDE
-#include <KSharedPtr>
-
// Local
#include <lib/mimetypeutils.h>
#include <lib/cms/cmsprofile.h>
diff --git a/lib/urlutils.cpp b/lib/urlutils.cpp
index a1a32df..e89169b 100644
--- a/lib/urlutils.cpp
+++ b/lib/urlutils.cpp
@@ -28,8 +28,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA
#include <QUrl>
// KDE
-#include <kde_file.h>
-#include <KIO/NetAccess>
+#include <KIO/StatJob>
+#include <KJobWidgets>
#include <kmountpoint.h>
#include <KProtocolManager>
@@ -68,10 +68,7 @@ bool urlIsDirectory(const QUrl &url)
// Do direct stat instead of using KIO if the file is local (faster)
if (UrlUtils::urlIsFastLocalFile(url)) {
- KDE_struct_stat buff;
- if (KDE_stat(QFile::encodeName(url.toLocalFile()), &buff) == 0) {
- return S_ISDIR(buff.st_mode);
- }
+ return QFileInfo(url.toLocalFile()).isDir();
}
QWidgetList list = QApplication::topLevelWidgets();
@@ -81,9 +78,10 @@ bool urlIsDirectory(const QUrl &url)
} else {
parent = 0;
}
- KIO::UDSEntry entry;
- if (KIO::NetAccess::stat(url, entry, parent)) {
- return entry.isDir();
+ KIO::StatJob *job = KIO::stat(url);
+ KJobWidgets::setWindow(job, parent);
+ if (job->exec()) {
+ return job->statResult().isDir();
}
return false;
}