Skip to content
This repository has been archived by the owner on Dec 1, 2023. It is now read-only.

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
plfiorini committed Oct 27, 2018
2 parents dfffe1c + ac431c8 commit ebee5a8
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 23 deletions.
11 changes: 3 additions & 8 deletions modules/LiriTranslations/LiriTranslations.qbs
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,8 @@ Module {
var cmd = new JavaScriptCommand();
cmd.description = "merge translations of " + input.filePath;
cmd.highlight = "filegen";
cmd.input = input;
cmd.inputFilePath = input.filePath;
cmd.sourceCode = function() {
// Read original desktop entry
var file = new TextFile(input.filePath, TextFile.ReadOnly);
var contents = file.readAll();
file.close();

// Collect translations
var translations = "";
for (var j in inputs["liri.desktop.translations"]) {
Expand All @@ -45,15 +40,15 @@ Module {
while (!file.atEof()) {
var line = file.readLine();
var re = /\w+\[\w+\]=/
if (line.match(re))
if (line.match(re) && !line.startsWith("Icon"))
translations += line + "\n";
}
file.close();
}

// Replace marker with translations
var contents = "";
var file = new TextFile(input.filePath, TextFile.ReadOnly);
var file = new TextFile(inputFilePath, TextFile.ReadOnly);
while (!file.atEof()) {
var line = file.readLine();
var re = /#TRANSLATIONS/;
Expand Down
32 changes: 18 additions & 14 deletions modules/WaylandScanner/scanner.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@ function createCommands(product, type, input, outputs)
hppCmd.description = "wayland-scanner " + input.fileName + " -> " + hppOutput.fileName;
hppCmd.highlight = "codegen";
hppCmd.exe = waylandScanner;
hppCmd.hppOutput = hppOutput;
hppCmd.inputFilePath = input.filePath;
hppCmd.outputFilePath = hppOutput.filePath;
hppCmd.type = type === "client" ? "client-header" : "server-header";
hppCmd.sourceCode = function() {
var p = new Process();
try {
p.setEnv("LC_ALL", "C");
p.setWorkingDirectory(FileInfo.path(hppOutput.filePath));
var hppArgs = [type, input.filePath, hppOutput.filePath];
p.setWorkingDirectory(FileInfo.path(outputFilePath));
var hppArgs = [type, inputFilePath, outputFilePath];
p.exec(exe, hppArgs, true);
} finally {
p.close();
Expand All @@ -29,13 +30,14 @@ function createCommands(product, type, input, outputs)
cppCmd.description = "wayland-scanner " + input.fileName + " -> " + cppOutput.fileName;
cppCmd.highlight = "codegen";
cppCmd.exe = waylandScanner;
cppCmd.cppOutput = cppOutput;
cppCmd.inputFilePath = input.filePath;
cppCmd.outputFilePath = cppOutput.filePath;
cppCmd.sourceCode = function() {
var p = new Process();
try {
p.setEnv("LC_ALL", "C");
p.setWorkingDirectory(FileInfo.path(cppOutput.filePath));
var cppArgs = ["code", input.filePath, cppOutput.filePath];
p.setWorkingDirectory(FileInfo.path(outputFilePath));
var cppArgs = ["code", inputFilePath, outputFilePath];
p.exec(exe, cppArgs, true);
} finally {
p.close();
Expand All @@ -54,16 +56,17 @@ function createQtCommands(product, type, input, outputs)
hppCmd.description = "qtwaylandscanner " + input.fileName + " -> " + hppOutput.fileName;
hppCmd.highlight = "codegen";
hppCmd.exe = qtwaylandScanner;
hppCmd.hppOutput = hppOutput;
hppCmd.inputFilePath = input.filePath;
hppCmd.outputFilePath = hppOutput.filePath;
hppCmd.type = type === "client" ? "client-header" : "server-header";
hppCmd.sourceCode = function() {
var p = new Process();
try {
p.setEnv("LC_ALL", "C");
p.setWorkingDirectory(FileInfo.path(hppOutput.filePath));
var hppArgs = [type, input.filePath, ""];
p.setWorkingDirectory(FileInfo.path(outputFilePath));
var hppArgs = [type, inputFilePath, ""];
p.exec(exe, hppArgs, true);
var file = new TextFile(hppOutput.filePath, TextFile.WriteOnly);
var file = new TextFile(outputFilePath, TextFile.WriteOnly);
file.write(p.readStdOut());
file.close();
} finally {
Expand All @@ -76,16 +79,17 @@ function createQtCommands(product, type, input, outputs)
cppCmd.description = "qtwaylandscanner " + input.fileName + " -> " + cppOutput.fileName;
cppCmd.highlight = "codegen";
cppCmd.exe = qtwaylandScanner;
cppCmd.cppOutput = cppOutput;
cppCmd.inputFilePath = input.filePath;
cppCmd.outputFilePath = cppOutput.filePath;
cppCmd.type = type === "client" ? "client-code" : "server-code";
cppCmd.sourceCode = function() {
var p = new Process();
try {
p.setEnv("LC_ALL", "C");
p.setWorkingDirectory(FileInfo.path(cppOutput.filePath));
var cppArgs = [type, input.filePath, ""];
p.setWorkingDirectory(FileInfo.path(outputFilePath));
var cppArgs = [type, inputFilePath, ""];
p.exec(exe, cppArgs, true);
var file = new TextFile(cppOutput.filePath, TextFile.WriteOnly);
var file = new TextFile(outputFilePath, TextFile.WriteOnly);
file.write(p.readStdOut());
file.close();
} finally {
Expand Down
2 changes: 1 addition & 1 deletion qbs-shared.qbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import qbs 1.0
Project {
name: "QbsShared"

readonly property string version: "1.3.0"
readonly property string version: "1.4.0"
readonly property var versionParts: version.split('.').map(function(part) { return parseInt(part); })

property string prefix: "/usr/local"
Expand Down

0 comments on commit ebee5a8

Please sign in to comment.