changeset 249:123e06d5d9af

* If the hgignore file doesn't exist when the user asks to edit it, create it with a "syntax: glob" line
author Chris Cannam
date Tue, 11 Jan 2011 17:56:22 +0000
parents 011312e59e44
children be483734bde5
files mainwindow.cpp
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mainwindow.cpp	Tue Jan 11 13:56:48 2011 +0000
+++ b/mainwindow.cpp	Tue Jan 11 17:56:22 2011 +0000
@@ -491,6 +491,16 @@
     
     hgIgnorePath = workFolderPath;
     hgIgnorePath += "/.hgignore";
+
+    if (!QDir(workFolderPath).exists()) return;
+    QFile f(hgIgnorePath);
+    if (!f.exists()) {
+        f.open(QFile::WriteOnly);
+        QTextStream *ts = new QTextStream(&f);
+        *ts << "syntax: glob\n";
+        delete ts;
+        f.close();
+    }
     
     params << hgIgnorePath;