diff main.cpp @ 145:644bd31e8301

* Include the uncommitted item in general graph layout (in case it is not at the head, when other items will need to avoid it)
author Chris Cannam
date Wed, 01 Dec 2010 17:41:14 +0000
parents 1928f9b408e6
children edab92f3ea0b
line wrap: on
line diff
--- a/main.cpp	Wed Dec 01 11:54:01 2010 +0000
+++ b/main.cpp	Wed Dec 01 17:41:14 2010 +0000
@@ -15,12 +15,13 @@
     COPYING included with this distribution for more information.
 */
 
-#include <QApplication>
-
 #include "mainwindow.h"
 #include "common.h"
 #include "debug.h"
 
+#include <QApplication>
+#include <QDir>
+
 int main(int argc, char *argv[])
 {
     QApplication::setOrganizationName("easymercurial");
@@ -34,7 +35,18 @@
     installSignalHandlers();
 
     QApplication app(argc, argv);
+    QStringList args = app.arguments();
     MainWindow mainWin;
     mainWin.show();
+
+    if (args.size() == 2) {
+        QString path = args[1];
+        DEBUG << "Opening " << args[1] << endl;
+        if (QDir(path).exists()) {
+            path = QDir(path).canonicalPath();
+            mainWin.open(path);
+        }
+    }
+
     return app.exec();
 }