Profile-bound custom commands now execute

Rather than starting ksession right away, PreprocessedTerminal now waits
for ApplicationSettings to finish loading custom command settings from
storage. If a custom command is specified, PreprocessedTerminal will
tokenize it and pass it onto ksession as a shell program similar to the
-e option. If both a -e command and a custom command is specified, the
-e version overrides the custom command.
This commit is contained in:
Vincent Wong
2016-03-21 12:55:09 -07:00
parent 674097f672
commit cc57fbdcd5
3 changed files with 85 additions and 2 deletions

View File

@@ -129,13 +129,17 @@ Item{
kterminal.lineSpacing = lineSpacing;
}
Component.onCompleted: {
appSettings.terminalFontChanged.connect(handleFontChange);
function startSession() {
appSettings.initializedSettings.disconnect(startSession);
// Retrieve the variable set in main.cpp if arguments are passed.
if (defaultCmd) {
ksession.setShellProgram(defaultCmd);
ksession.setArgs(defaultCmdArgs);
} else if (appSettings.useCustomCommand) {
var args = Utils.tokenizeCommandLine(appSettings.customCommand);
ksession.setShellProgram(args[0]);
ksession.setArgs(args.slice(1));
} else if (!defaultCmd && Qt.platform.os === "osx") {
// OSX Requires the following default parameters for auto login.
ksession.setArgs(["-i", "-l"]);
@@ -147,6 +151,10 @@ Item{
ksession.startShellProgram();
forceActiveFocus();
}
Component.onCompleted: {
appSettings.terminalFontChanged.connect(handleFontChange);
appSettings.initializedSettings.connect(startSession);
}
}
Component {
id: linuxContextMenu