Files
MINGW-packages/mingw-w64-qt-installer-framework-git/0004-add-dirExists-fuction.patch
Christoph Reiter 4d8828efed Make pkgbase of all packages match the name of the PKGBUILD directory (#2878)
This either changes the pkgbase to match the directory name
or the other way around.

The motivation for this is to make it possible to automatically generate
an URL to the PKGBUILD file from the package information alone.
2017-09-12 14:25:41 +03:00

48 lines
1.5 KiB
Diff

From d9df0f66c4474890888fa6f0beeca0b2b56d08fe Mon Sep 17 00:00:00 2001
From: Ray Donnelly <mingw.android@gmail.com>
Date: Thu, 8 May 2014 12:01:54 +0100
Subject: [PATCH 4/9] add dirExists() fuction
---
src/libs/installer/packagemanagercore.cpp | 11 +++++++++++
src/libs/installer/packagemanagercore.h | 1 +
2 files changed, 12 insertions(+)
diff --git a/src/libs/installer/packagemanagercore.cpp b/src/libs/installer/packagemanagercore.cpp
index 2b7ec45..5ef4d7b 100644
--- a/src/libs/installer/packagemanagercore.cpp
+++ b/src/libs/installer/packagemanagercore.cpp
@@ -812,6 +812,17 @@ QString PackageManagerCore::readFile(const QString &filePath, const QString &cod
return stream.readAll();
}
+/*!
+ \qmlmethod boolean QInstaller::dirExists(string dirPath)
+
+ Returns \c true if the \a dirPath exists; otherwise returns \c false.
+
+ */
+bool PackageManagerCore::dirExists(const QString &dirPath) const
+{
+ return QFileInfo(dirPath).isDir();
+}
+
// -- QInstaller
/*!
diff --git a/src/libs/installer/packagemanagercore.h b/src/libs/installer/packagemanagercore.h
index f00f33e..3e47573 100644
--- a/src/libs/installer/packagemanagercore.h
+++ b/src/libs/installer/packagemanagercore.h
@@ -189,6 +189,7 @@ public:
Q_INVOKABLE bool isFileExtensionRegistered(const QString &extension) const;
Q_INVOKABLE bool fileExists(const QString &filePath) const;
+ Q_INVOKABLE bool dirExists(const QString &dirPath) const;
Q_INVOKABLE QString readFile(const QString &filePath, const QString &codecName) const;
public:
--
2.7.0