← Back to team overview

ubuntu-touch-coreapps-reviewers team mailing list archive

[Merge] lp:~verzegnassi-stefano/ubuntu-terminal-app/layouts-q-argument into lp:ubuntu-terminal-app

 

Stefano Verzegnassi has proposed merging lp:~verzegnassi-stefano/ubuntu-terminal-app/layouts-q-argument into lp:ubuntu-terminal-app.

Commit message:
Fixed layouts not found when terminal-app is launched with '-q' argument

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

For more details, see:
https://code.launchpad.net/~verzegnassi-stefano/ubuntu-terminal-app/layouts-q-argument/+merge/283786

Fixed layouts not found when terminal-app is launched with '-q' argument
-- 
Your team Ubuntu Terminal Developers is requested to review the proposed merge of lp:~verzegnassi-stefano/ubuntu-terminal-app/layouts-q-argument into lp:ubuntu-terminal-app.
=== modified file 'src/app/main.cpp'
--- src/app/main.cpp	2015-03-23 17:46:34 +0000
+++ src/app/main.cpp	2016-01-25 11:26:52 +0000
@@ -40,7 +40,7 @@
     QDir layoutDir(path);
     layoutDir.setNameFilters(QStringList("*.json"));
 
-    QStringList jsonFiles = layoutDir.entryList();
+    QStringList jsonFiles = layoutDir.entryList();   
 
     QStringList result;
     foreach (QString s, jsonFiles) {
@@ -174,12 +174,18 @@
             qDebug() << "Trying to load QML from:" << path + "/qml/ubuntu-terminal-app.qml";
             if (fi.exists()) {
                 qmlfile = path +  "/qml/ubuntu-terminal-app.qml";
-                keyboardLayouts << getProfileFromDir(path + "/qml/KeyboardRows/Layouts/");
                 break;
             }
         }
     }
 
+    // Look for default layouts
+    QDir keybLayoutDir = QFileInfo(qmlfile).dir();
+    if (keybLayoutDir.cd("KeyboardRows/Layouts")) {
+        keyboardLayouts << getProfileFromDir(keybLayoutDir.canonicalPath() + "/");
+    }
+
+    // Look for user-defined layouts
     QStringList configLocations = QStandardPaths::standardLocations(QStandardPaths::ConfigLocation);
     foreach (const QString &path, configLocations) {
         QString fullPath = path + "/com.ubuntu.terminal/Layouts/";


Follow ups