← Back to team overview

ubuntu-touch-coreapps-reviewers team mailing list archive

[Merge] lp:~developersw/ubuntu-terminal-app/CarloSpenguinFix into lp:ubuntu-terminal-app

 

Carlo Giordano has proposed merging lp:~developersw/ubuntu-terminal-app/CarloSpenguinFix into lp:ubuntu-terminal-app.

Requested reviews:
  Ubuntu Terminal Developers (ubuntu-terminal-dev)

For more details, see:
https://code.launchpad.net/~developersw/ubuntu-terminal-app/CarloSpenguinFix/+merge/253864

Folder-Dynamic-Home
-- 
Your team Ubuntu Terminal Developers is requested to review the proposed merge of lp:~developersw/ubuntu-terminal-app/CarloSpenguinFix into lp:ubuntu-terminal-app.
=== modified file 'po/com.ubuntu.terminal.pot'
--- po/com.ubuntu.terminal.pot	2015-02-26 10:57:55 +0000
+++ po/com.ubuntu.terminal.pot	2015-03-23 17:48:21 +0000
@@ -8,7 +8,7 @@
 msgstr ""
 "Project-Id-Version: \n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-20 14:00+0100\n"
+"POT-Creation-Date: 2015-03-21 13:11+0100\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@xxxxxx>\n"
@@ -81,7 +81,7 @@
 msgid "New tab"
 msgstr ""
 
-#: ../src/app/qml/TerminalPage.qml:111
+#: ../src/app/qml/TerminalPage.qml:164
 msgid "Selection Mode"
 msgstr ""
 

=== modified file 'src/app/main.cpp'
--- src/app/main.cpp	2015-02-14 10:33:32 +0000
+++ src/app/main.cpp	2015-03-23 17:48:21 +0000
@@ -31,6 +31,11 @@
 
 #include <QDebug>
 
+QString getNamedArgument(QStringList args, QString name, QString defaultName)
+{
+    int index = args.indexOf(name);
+    return (index != -1) ? args[index + 1] : QString(defaultName);
+}
 QStringList getProfileFromDir(const QString &path) {
     QDir layoutDir(path);
     layoutDir.setNameFilters(QStringList("*.json"));
@@ -78,16 +83,20 @@
 
     QStringList args = a.arguments();
     if (args.contains("-h") || args.contains("--help")) {
-        qDebug() << "usage: " + args.at(0) + " [-p|--phone] [-t|--tablet] [-h|--help] [-I <path>]";
+        qDebug() << "usage: " + args.at(0) + " [-p|--phone] [--workdir <dir>] [-t|--tablet] [-h|--help] [-I <path>]";
         qDebug() << "    -p|--phone    If running on Desktop, start in a phone sized window.";
         qDebug() << "    -t|--tablet   If running on Desktop, start in a tablet sized window.";
         qDebug() << "    --forceAuth <true|false> Force authentication on or off.";
         qDebug() << "    -h|--help     Print this help.";
         qDebug() << "    -I <path>     Give a path for an additional QML import directory. May be used multiple times.";
         qDebug() << "    -q <qmlfile>  Give an alternative location for the main qml file.";
+        qDebug() << " --workdir <dir> Change working directory to 'dir'";
         return 0;
     }
 
+    //Dynamic folder home
+    view.engine()->rootContext()->setContextProperty("workdir", getNamedArgument(args, "--workdir", "$HOME"));
+
     // Desktop doesn't have yet Unity8 and so no unity greeter either. Consequently it doesn't
     // also have any "PIN code" or "Password" extra authentication. Don't require any extra
     // authentication there by default

=== modified file 'src/app/qml/TerminalComponent.qml'
--- src/app/qml/TerminalComponent.qml	2014-11-16 22:38:02 +0000
+++ src/app/qml/TerminalComponent.qml	2015-03-23 17:48:21 +0000
@@ -15,7 +15,7 @@
 
         session: QMLTermSession {
             id: terminalSession
-            initialWorkingDirectory: "$HOME"
+            initialWorkingDirectory: workdir
         }
 
         QMLTermScrollbar {


Follow ups