Merge lp:~larryprice/acolyterm/minor-cleanup into lp:acolyterm

Proposed by Larry Price
Status: Merged
Approved by: Christopher Townsend
Approved revision: 220
Merged at revision: 213
Proposed branch: lp:~larryprice/acolyterm/minor-cleanup
Merge into: lp:acolyterm
Prerequisite: lp:~larryprice/acolyterm/pkexec
Diff against target: 230 lines (+43/-58)
6 files modified
CMakeLists.txt (+14/-7)
debian/control (+1/-1)
debian/rules (+2/-0)
src/app/CMakeLists.txt (+5/-8)
src/app/main.cpp (+21/-41)
src/app/qml/TerminalComponent.qml (+0/-1)
To merge this branch: bzr merge lp:~larryprice/acolyterm/minor-cleanup
Reviewer Review Type Date Requested Status
Libertine CI Bot continuous-integration Approve
Libertine Developers Pending
Review via email: mp+298138@code.launchpad.net

Commit message

Remove unused flags and update cmake to support QML auto-loading.

Description of the change

Remove unused flags and update cmake to support QML auto-loading.

To post a comment you must log in.
Revision history for this message
Libertine CI Bot (libertine-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
218. By Larry Price

adding pkg-config to control file

Revision history for this message
Libertine CI Bot (libertine-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
219. By Larry Price

working qt5 deps

220. By Larry Price

attempting to remove metapackage for lintian

Revision history for this message
Libertine CI Bot (libertine-ci-bot) wrote :

PASSED: Continuous integration, rev:220
https://jenkins.canonical.com/libertine/job/lp-acolyterm-ci/28/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/libertine/job/build/77
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=autopilot/50
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=autopilot/50
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=i386,release=vivid+overlay,testname=autopilot/50
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=i386,release=xenial+overlay,testname=autopilot/50
    None: https://jenkins.canonical.com/libertine/job/lp-generic-update-mp/65/console
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-0-fetch/78
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-1-sourcepkg/release=vivid+overlay/68
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-1-sourcepkg/release=xenial+overlay/68
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=vivid+overlay/61
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=vivid+overlay/61/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=xenial+overlay/61
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=xenial+overlay/61/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=vivid+overlay/61
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=vivid+overlay/61/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=xenial+overlay/61
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=xenial+overlay/61/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/libertine/job/lp-acolyterm-ci/28/rebuild

review: Approve (continuous-integration)
Revision history for this message
Libertine CI Bot (libertine-ci-bot) wrote :

PASSED: Continuous integration, rev:220
https://jenkins.canonical.com/libertine/job/lp-acolyterm-ci/29/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/libertine/job/build/84
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=default/53
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=default/53
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=i386,release=vivid+overlay,testname=default/53
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=i386,release=xenial+overlay,testname=default/53
    None: https://jenkins.canonical.com/libertine/job/lp-generic-update-mp/71/console
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-0-fetch/87
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-1-sourcepkg/release=vivid+overlay/72
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-1-sourcepkg/release=xenial+overlay/72
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=vivid+overlay/65
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=vivid+overlay/65/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=xenial+overlay/65
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=xenial+overlay/65/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=vivid+overlay/65
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=vivid+overlay/65/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=xenial+overlay/65
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=xenial+overlay/65/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/libertine/job/lp-acolyterm-ci/29/rebuild

review: Approve (continuous-integration)
Revision history for this message
Christopher Townsend (townsend) wrote :

LGTM

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2016-06-20 20:11:12 +0000
3+++ CMakeLists.txt 2016-06-22 17:13:41 +0000
4@@ -1,16 +1,24 @@
5 project(com.ubuntu.acolyterm C CXX)
6-cmake_minimum_required(VERSION 2.8.9)
7+cmake_minimum_required(VERSION 3.0.2)
8+cmake_policy(SET CMP0048 NEW)
9+
10+set(CMAKE_AUTOMOC ON)
11+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fno-permissive -pedantic -Wall -Wextra -fPIC")
12+
13+
14+find_package(PkgConfig REQUIRED)
15+find_package(Qt5Core REQUIRED)
16+find_package(Qt5Gui REQUIRED)
17+find_package(Qt5Quick REQUIRED)
18+find_package(Gettext REQUIRED)
19 find_program(INTLTOOL_MERGE intltool-merge)
20 find_program(INTLTOOL_EXTRACT intltool-extract)
21
22-set(CMAKE_AUTOMOC ON)
23-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fno-permissive -pedantic -Wall -Wextra -fPIC")
24-
25 # Standard install paths
26 include(GNUInstallDirs)
27
28 option(INSTALL_TESTS "Install the tests on make install" on)
29-option(CLICK_MODE "Installs to a contained location" on)
30+option(CLICK_MODE "Installs to a contained location" off)
31
32 set(APP_NAME acolyterm)
33 set(DESKTOP_FILE "${PROJECT_NAME}.desktop")
34@@ -44,8 +52,7 @@
35 COMMAND bzr revno
36 OUTPUT_VARIABLE BZR_REVNO
37 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
38- OUTPUT_STRIP_TRAILING_WHITESPACE
39- )
40+ OUTPUT_STRIP_TRAILING_WHITESPACE)
41 endif(NOT BZR_REVNO)
42
43 execute_process(
44
45=== modified file 'debian/control'
46--- debian/control 2016-06-21 20:15:38 +0000
47+++ debian/control 2016-06-22 17:13:41 +0000
48@@ -3,11 +3,11 @@
49 Maintainer: Libertine Developers <libertine-team@lists.launchpad.net>
50 Build-Depends: cmake,
51 cmake-extras,
52+ pkg-config,
53 debhelper (>= 9),
54 python3-all,
55 gettext,
56 intltool,
57- qt5-default,
58 qtbase5-dev,
59 qtdeclarative5-dev,
60 Standards-Version: 3.9.7
61
62=== modified file 'debian/rules'
63--- debian/rules 2016-06-20 13:15:29 +0000
64+++ debian/rules 2016-06-22 17:13:41 +0000
65@@ -4,6 +4,8 @@
66 # Uncomment this to turn on verbose mode.
67 #export DH_VERBOSE=1
68
69+export QT_SELECT=qt5
70+
71 %:
72 dh $@
73
74
75=== modified file 'src/app/CMakeLists.txt'
76--- src/app/CMakeLists.txt 2016-06-20 15:02:13 +0000
77+++ src/app/CMakeLists.txt 2016-06-22 17:13:41 +0000
78@@ -1,5 +1,4 @@
79 file(GLOB_RECURSE QML_SRCS *.qml *.js *.json)
80-
81 set(acolyterm_SRCS
82 main.cpp
83 fileio.cpp
84@@ -10,16 +9,14 @@
85
86 qt5_use_modules(acolyterm Gui Qml Quick Widgets)
87
88-if(NOT "${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
89 add_custom_target(acolyterm-qmlfiles ALL
90- COMMAND cp -r ${CMAKE_CURRENT_SOURCE_DIR}/qml ${CMAKE_CURRENT_BINARY_DIR}
91- DEPENDS ${QMLFILES}
92-)
93-endif(NOT "${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
94+ COMMAND cp -r ${CMAKE_CURRENT_SOURCE_DIR}/qml ${CMAKE_CURRENT_BINARY_DIR}
95+ DEPENDS ${QMLFILES})
96
97 install(DIRECTORY qml DESTINATION ${DATA_DIR})
98+
99 if(CLICK_MODE)
100 install(TARGETS acolyterm DESTINATION ${BIN_DIR})
101-else()
102+else(CLICK_MODE)
103 install(TARGETS acolyterm RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
104-endif()
105+endif(CLICK_MODE)
106
107=== modified file 'src/app/main.cpp'
108--- src/app/main.cpp 2016-06-21 19:32:33 +0000
109+++ src/app/main.cpp 2016-06-22 17:13:41 +0000
110@@ -61,7 +61,7 @@
111
112 // Prepend the location of the plugin in the build dir,
113 // so that Qt Creator finds it there, thus overriding the one installed
114- // in the sistem if there is one
115+ // in the system if there is one
116 importPathList.prepend(QCoreApplication::applicationDirPath() + "/../plugin/");
117
118 // Setup useful environmental variables.
119@@ -79,16 +79,14 @@
120 }
121 }
122 }
123+ view.engine()->setImportPathList(importPathList);
124
125 setenv("TERM", QString("xterm").toUtf8().data(), 0);
126
127 QStringList args = a.arguments();
128 if (args.contains("-h") || args.contains("--help")) {
129- qDebug() << "usage: " + args.at(0) + " [--workdir <dir>] [-h|--help] [-I <path>] [-c <command> [-- <args>]]";
130+ qDebug() << "usage: " + args.at(0) + " [-h|--help] [-c <command> [-- <args>]]";
131 qDebug() << " -h|--help Print this help.";
132- qDebug() << " -I <path> Give a path for an additional QML import directory. May be used multiple times.";
133- qDebug() << " -q <qmlfile> Give an alternative location for the main qml file.";
134- qDebug() << " --workdir <dir> Change working directory to 'dir'";
135 qDebug() << " -c <command> -- <args> Command to be executed. Everything after -- will be considered args to command.";
136 return 0;
137 }
138@@ -114,44 +112,28 @@
139 view.engine()->rootContext()->setContextProperty("command", command);
140 view.engine()->rootContext()->setContextProperty("commandArguments", commandArguments);
141
142- //Dynamic folder home
143- view.engine()->rootContext()->setContextProperty("workdir", getNamedArgument(args, "--workdir", "$HOME"));
144+ QStringList paths = QStandardPaths::standardLocations(QStandardPaths::DataLocation);
145+ paths.prepend(QCoreApplication::applicationDirPath());
146+ paths.prepend(QDir::currentPath());
147
148+ const QStringList subpaths{"", "/src/app"};
149 QString qmlfile;
150- for (auto i = 0; i < args.count(); ++i)
151+ for (auto const& path: paths)
152 {
153- if (args.at(i) == "-I" && args.count() > i + 1)
154- {
155- QString addedPath = args.at(i+1);
156- if (addedPath.startsWith('.')) {
157- addedPath = addedPath.right(addedPath.length() - 1);
158- addedPath.prepend(QDir::currentPath());
159- }
160- importPathList.append(addedPath);
161- }
162- else if (args.at(i) == "-q" && args.count() > i + 1)
163- {
164- qmlfile = args.at(i+1);
165- }
166- }
167-
168- view.engine()->setImportPathList(importPathList);
169-
170- // load the qml file
171- if (qmlfile.isEmpty()) {
172- QStringList paths = QStandardPaths::standardLocations(QStandardPaths::DataLocation);
173- paths.prepend(QDir::currentPath());
174- paths.prepend(QCoreApplication::applicationDirPath());
175-
176- for (auto const& path: paths)
177- {
178- QFileInfo fi(path + "/qml/acolyterm.qml");
179- qDebug() << "Trying to load QML from:" << path + "/qml/acolyterm.qml";
180- if (fi.exists()) {
181- qmlfile = path + "/qml/acolyterm.qml";
182+ for (auto const& subpath: subpaths)
183+ {
184+ QFileInfo fi(path + subpath + "/qml/acolyterm.qml");
185+ qDebug() << "Trying to load QML from:" << fi.absoluteFilePath();
186+ if (fi.exists())
187+ {
188+ qmlfile = fi.absoluteFilePath();
189 break;
190 }
191 }
192+ if (!qmlfile.isEmpty())
193+ {
194+ break;
195+ }
196 }
197
198 // Look for default layouts
199@@ -180,9 +162,8 @@
200 qDebug() << "Not able to locate default keyboard profiles folder:" << keybLayoutDir.canonicalPath() + "/" + layoutsDir;
201 }
202
203- // Look for user-defined layouts
204- QStringList configLocations = QStandardPaths::standardLocations(QStandardPaths::ConfigLocation);
205- for (auto const& path: configLocations)
206+ // Look for user-defined keyboard layouts
207+ for (auto const& path: QStandardPaths::standardLocations(QStandardPaths::ConfigLocation))
208 {
209 QString fullPath = path + "/com.ubuntu.acolyterm/Layouts/";
210 qDebug() << "Retrieving keyboard profiles from folder: " << fullPath;
211@@ -195,7 +176,6 @@
212 view.setSource(QUrl::fromLocalFile(qmlfile));
213 view.show();
214
215- // Connect the quit signal
216 QObject::connect(view.engine(), &QQmlEngine::quit, &a, &QApplication::quit);
217
218 return a.exec();
219
220=== modified file 'src/app/qml/TerminalComponent.qml'
221--- src/app/qml/TerminalComponent.qml 2016-06-22 13:17:48 +0000
222+++ src/app/qml/TerminalComponent.qml 2016-06-22 17:13:41 +0000
223@@ -38,7 +38,6 @@
224
225 session: QMLTermSession {
226 id: terminalSession
227- initialWorkingDirectory: workdir
228
229 onFinished: tabsModel.removeTabWithSession(terminalSession);
230 }

Subscribers

People subscribed via source and target branches

to all changes: