[rkward/frameworks] rkward/dialogs: Fix detection of read-only library location on Windows/NTFS.

Thomas Friedrichsmeier null at kde.org
Sun Mar 25 08:12:39 UTC 2018

Git commit 543aeb586257ae294a4d2a6e81df4d63833e104e by Thomas Friedrichsmeier.
Committed on 25/03/2018 at 08:12.
Pushed by tfry into branch 'frameworks'.

Fix detection of read-only library location on Windows/NTFS.

M  +12   -1    rkward/dialogs/rkloadlibsdialog.cpp


diff --git a/rkward/dialogs/rkloadlibsdialog.cpp b/rkward/dialogs/rkloadlibsdialog.cpp
index bfebe5be..d58ce541 100644
--- a/rkward/dialogs/rkloadlibsdialog.cpp
+++ b/rkward/dialogs/rkloadlibsdialog.cpp
@@ -252,6 +252,9 @@ bool RKLoadLibsDialog::removePackages (QStringList packages, QStringList from_li
 	return true;
+#ifdef Q_OS_WIN
+extern Q_CORE_EXPORT int qt_ntfs_permission_lookup;
 bool RKLoadLibsDialog::installPackages (const QStringList &packages, QString to_libloc, bool install_suggested_packages, const QStringList& repos) {
@@ -259,8 +262,16 @@ bool RKLoadLibsDialog::installPackages (const QStringList &packages, QString to_
 	bool as_root = false;
 	QString altlibloc = QDir (RKSettingsModuleGeneral::filesPath ()).absoluteFilePath ("library");
+#ifdef Q_OS_WIN
+	extern Q_CORE_EXPORT int qt_ntfs_permission_lookup;
+	qt_ntfs_permission_lookup++;
 	QFileInfo fi = QFileInfo (to_libloc);
-	if (!fi.isWritable ()) {
+	bool writable = fi.isWritable ();
+#ifdef Q_OS_WIN
+	qt_ntfs_permission_lookup--;
+	if (!writable) {
 		QString mcaption = i18n ("Selected library location not writable");
 		QString message = i18n ("<p>The directory you have selected for installation (%1) is not writable with your current user permissions.</p>"
 			"<p>Would you like to install to %2, instead (you can also press \"Cancel\" and use the \"Configure Repositories\"-button to set up a different directory)?</p>", to_libloc, altlibloc);

More information about the rkward-tracker mailing list