# HG changeset patch # User Teemu Piippo # Date 1443916778 -10800 # Node ID 213a7c7a3ce4479f9ee44a7aa18d84c090badac8 # Parent 5be0ce31ce603f696257413a3063982d86a19953 And now it should work again too diff -r 5be0ce31ce60 -r 213a7c7a3ce4 src/dialogs/ldrawpathdialog.cpp --- a/src/dialogs/ldrawpathdialog.cpp Sun Oct 04 02:52:03 2015 +0300 +++ b/src/dialogs/ldrawpathdialog.cpp Sun Oct 04 02:59:38 2015 +0300 @@ -90,7 +90,7 @@ else { ui.status->setText (QString ("%2") - .arg (ok ? "#700" : "#270") + .arg (ok ? "#270" : "#700") .arg (statusText)); } } \ No newline at end of file diff -r 5be0ce31ce60 -r 213a7c7a3ce4 src/ldpaths.cpp --- a/src/ldpaths.cpp Sun Oct 04 02:52:03 2015 +0300 +++ b/src/ldpaths.cpp Sun Oct 04 02:59:38 2015 +0300 @@ -26,28 +26,33 @@ } } +#include bool LDPaths::isValid (const QDir& dir) const { - if (dir.exists() && dir.isReadable()) + if (dir.exists()) { - QStringList mustHave = { "LDConfig.ldr", "parts", "p" }; - QStringList contents = dir.entryList (mustHave); - - if (contents.size() == mustHave.size()) - m_error = ""; + if (dir.isReadable()) + { + QStringList mustHave = { "LDConfig.ldr", "parts", "p" }; + QStringList contents = dir.entryList (mustHave); + + if (contents.size() == mustHave.size()) + m_error = ""; + else + m_error = "That is not an LDraw directory! It must
have LDConfig.ldr, parts/ and p/."; + } else - m_error = "Not an LDraw directory! Must
have LDConfig.ldr, parts/ and p/."; + m_error = "That directory cannot be read."; } else - m_error = "Directory does not exist or is not readable."; + m_error = "That directory does not exist."; return m_error.isEmpty(); } bool LDPaths::configurePaths (QString path) { - QDir dir; - dir.cd (path); + QDir dir (path); bool ok = isValid (dir); if (ok)