And now it should work again too

Sun, 04 Oct 2015 02:59:38 +0300

author
Teemu Piippo <crimsondusk64@gmail.com>
date
Sun, 04 Oct 2015 02:59:38 +0300
changeset 999
213a7c7a3ce4
parent 998
5be0ce31ce60
child 1000
c064cc048f14

And now it should work again too

src/dialogs/ldrawpathdialog.cpp file | annotate | diff | comparison | revisions
src/ldpaths.cpp file | annotate | diff | comparison | revisions
--- 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 ("<span style=\"color: %1\">%2</span>")
-			.arg (ok ? "#700" : "#270")
+			.arg (ok ? "#270" : "#700")
 			.arg (statusText));
 	}
 }
\ No newline at end of file
--- 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 <QDebug>
 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<br />have LDConfig.ldr, parts/ and p/.";
+		}
 		else
-			m_error = "Not an LDraw directory! Must<br />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)

mercurial