summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/corelib/io/qstorageinfo_unix.cpp21
-rw-r--r--src/plugins/platforms/android/qandroidplatformfiledialoghelper.cpp3
-rw-r--r--src/plugins/platforms/android/qandroidplatformfiledialoghelper.h2
-rw-r--r--src/tools/androiddeployqt/main.cpp3
4 files changed, 25 insertions, 4 deletions
diff --git a/src/corelib/io/qstorageinfo_unix.cpp b/src/corelib/io/qstorageinfo_unix.cpp
index 37b8a60c37..698c4ddf41 100644
--- a/src/corelib/io/qstorageinfo_unix.cpp
+++ b/src/corelib/io/qstorageinfo_unix.cpp
@@ -60,6 +60,7 @@
#elif defined(Q_OS_LINUX) || defined(Q_OS_HURD)
# include <mntent.h>
# include <sys/statvfs.h>
+# include <sys/sysmacros.h>
#elif defined(Q_OS_SOLARIS)
# include <sys/mnttab.h>
# include <sys/statvfs.h>
@@ -152,7 +153,7 @@ private:
//(2) parent ID: the ID of the parent mount (or of self for the top of the mount tree).
// int parent_id;
//(3) major:minor: the value of st_dev for files on this filesystem (see stat(2)).
-// dev_t rdev;
+ dev_t rdev;
//(4) root: the pathname of the directory in the filesystem which forms the root of this mount.
char *subvolume;
//(5) mount point: the pathname of the mount point relative to the process's root directory.
@@ -503,8 +504,7 @@ inline bool QStorageIterator::next()
int rdevminor = qstrtoll(ptr + 1, const_cast<const char **>(&ptr), 10, &ok);
if (!ptr || !ok)
return false;
- Q_UNUSED(rdevmajor);
- Q_UNUSED(rdevminor);
+ mnt.rdev = makedev(rdevmajor, rdevminor);
if (*ptr != ' ')
return false;
@@ -566,6 +566,21 @@ inline QByteArray QStorageIterator::fileSystemType() const
inline QByteArray QStorageIterator::device() const
{
+ // check that the device exists
+ if (mnt.mnt_fsname[0] == '/' && access(mnt.mnt_fsname, F_OK) != 0) {
+ // It doesn't, so let's try to resolve the dev_t from /dev/block.
+ // Note how strlen("4294967295") == digits10 + 1, so we need to add 1
+ // for each number, plus the ':'.
+ char buf[sizeof("/dev/block/") + 2 * std::numeric_limits<unsigned>::digits10 + 3];
+ QByteArray dev(PATH_MAX, Qt::Uninitialized);
+ char *devdata = dev.data();
+
+ snprintf(buf, sizeof(buf), "/dev/block/%u:%u", major(mnt.rdev), minor(mnt.rdev));
+ if (realpath(buf, devdata)) {
+ dev.truncate(strlen(devdata));
+ return dev;
+ }
+ }
return QByteArray(mnt.mnt_fsname);
}
diff --git a/src/plugins/platforms/android/qandroidplatformfiledialoghelper.cpp b/src/plugins/platforms/android/qandroidplatformfiledialoghelper.cpp
index 7585b7eb95..fb979ab6cc 100644
--- a/src/plugins/platforms/android/qandroidplatformfiledialoghelper.cpp
+++ b/src/plugins/platforms/android/qandroidplatformfiledialoghelper.cpp
@@ -100,10 +100,13 @@ bool QAndroidPlatformFileDialogHelper::show(Qt::WindowFlags windowFlags, Qt::Win
void QAndroidPlatformFileDialogHelper::exec()
{
+ m_eventLoop.exec(QEventLoop::DialogExec);
}
void QAndroidPlatformFileDialogHelper::hide()
{
+ if (m_eventLoop.isRunning())
+ m_eventLoop.exit();
QtAndroidPrivate::unregisterActivityResultListener(this);
}
diff --git a/src/plugins/platforms/android/qandroidplatformfiledialoghelper.h b/src/plugins/platforms/android/qandroidplatformfiledialoghelper.h
index e445aa2fef..5cd26af7c9 100644
--- a/src/plugins/platforms/android/qandroidplatformfiledialoghelper.h
+++ b/src/plugins/platforms/android/qandroidplatformfiledialoghelper.h
@@ -41,6 +41,7 @@
#define QANDROIDPLATFORMFILEDIALOGHELPER_H
#include <jni.h>
+#include <QEventLoop>
#include <qpa/qplatformdialoghelper.h>
#include <QtCore/private/qjnihelpers_p.h>
@@ -72,6 +73,7 @@ public:
bool handleActivityResult(jint requestCode, jint resultCode, jobject data) override;
private:
+ QEventLoop m_eventLoop;
QUrl m_selectedFile;
};
diff --git a/src/tools/androiddeployqt/main.cpp b/src/tools/androiddeployqt/main.cpp
index 5ac22287e2..3d378024c9 100644
--- a/src/tools/androiddeployqt/main.cpp
+++ b/src/tools/androiddeployqt/main.cpp
@@ -2287,7 +2287,8 @@ static bool mergeGradleProperties(const QString &path, GradleProperties properti
bool buildAndroidProject(const Options &options)
{
GradleProperties localProperties;
- localProperties["sdk.dir"] = options.sdkPath.toLocal8Bit();
+ localProperties["sdk.dir"] = options.sdkPath.toUtf8();
+ localProperties["ndk.dir"] = options.ndkPath.toUtf8();
if (!mergeGradleProperties(options.outputDirectory + QLatin1String("local.properties"), localProperties))
return false;