diff mainwindow.cpp @ 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 0689dada1419 669f2a8ff1a8
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;