Merge lp:~tintou/switchboard/library-cleanup into lp:~elementary-pantheon/switchboard/switchboard

Proposed by Corentin Noël
Status: Merged
Approved by: Cody Garver
Approved revision: 558
Merged at revision: 558
Proposed branch: lp:~tintou/switchboard/library-cleanup
Merge into: lp:~elementary-pantheon/switchboard/switchboard
Diff against target: 75 lines (+26/-12)
3 files modified
lib/CMakeLists.txt (+4/-3)
lib/config.h.cmake (+12/-9)
lib/config.vapi (+10/-0)
To merge this branch: bzr merge lp:~tintou/switchboard/library-cleanup
Reviewer Review Type Date Requested Status
Rico Tzschichholz Approve
Review via email: mp+258313@code.launchpad.net

Commit message

Removed the configuration file from the library.

To post a comment you must log in.
Revision history for this message
Cody Garver (codygarver) wrote :

Why is more lines better?

Revision history for this message
Corentin Noël (tintou) wrote :

Because currently config.vala is a part of the API where it shoudn't.

558. By Corentin Noël

Removed the configuration file from the library.

Revision history for this message
Rico Tzschichholz (ricotz) wrote :

> Why is more lines better?

Fewer lines are not always better.

Revision history for this message
Rico Tzschichholz (ricotz) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/CMakeLists.txt'
2--- lib/CMakeLists.txt 2013-12-14 17:34:09 +0000
3+++ lib/CMakeLists.txt 2015-05-06 19:53:14 +0000
4@@ -2,7 +2,7 @@
5 # Set Variables
6 ######################
7
8-set (CONFIG_FILE ${CMAKE_CURRENT_BINARY_DIR}/config.vala)
9+set (CONFIG_FILE ${CMAKE_CURRENT_BINARY_DIR}/config.h)
10 set (PREFIX ${CMAKE_INSTALL_PREFIX})
11 set (DOLLAR "$") # You hear that? It's kittens being killed by the gods of cmake
12 set (LIB_VERSION 2.0)
13@@ -12,11 +12,10 @@
14 set (LIB_NAME ${CMAKE_PROJECT_NAME}-${LIB_VERSION})
15 set (LIB_NAME ${LIB_NAME} PARENT_SCOPE)
16
17-configure_file (${CMAKE_CURRENT_SOURCE_DIR}/config.vala.cmake ${CONFIG_FILE})
18+configure_file (${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CONFIG_FILE})
19 configure_file (${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/${LIB_NAME}.pc)
20
21 set (LIB_SOURCE
22- ${CONFIG_FILE}
23 Plug.vala
24 PlugsManager.vala
25 )
26@@ -37,6 +36,8 @@
27 ${LIB_PACKAGES}
28 OPTIONS
29 ${GLOBAL_VALAC_OPTIONS}
30+ CUSTOM_VAPIS
31+ config.vapi
32 GENERATE_VAPI
33 ${LIB_NAME}
34 GENERATE_HEADER
35
36=== renamed file 'lib/config.vala.cmake' => 'lib/config.h.cmake'
37--- lib/config.vala.cmake 2013-11-08 18:02:11 +0000
38+++ lib/config.h.cmake 2015-05-06 19:53:14 +0000
39@@ -1,9 +1,12 @@
40-namespace Switchboard.Build {
41- public const string DATADIR = "@DATADIR@";
42- public const string PKGDATADIR = "@PKGDATADIR@";
43- public const string PLUGS_DIR = "@PLUGS_DIR@";
44- public const string GETTEXT_PACKAGE = "@GETTEXT_PACKAGE@";
45- public const string RELEASE_NAME = "@RELEASE_NAME@";
46- public const string VERSION = "@VERSION@";
47- public const string VERSION_INFO = "@VERSION_INFO@";
48-}
49+#ifndef CONFIG_H
50+#define CONFIG_H
51+
52+#cmakedefine DATADIR "@DATADIR@"
53+#cmakedefine PKGDATADIR "@PKGDATADIR@"
54+#cmakedefine PLUGS_DIR "@PLUGS_DIR@"
55+#cmakedefine GETTEXT_PACKAGE "@GETTEXT_PACKAGE@"
56+#cmakedefine RELEASE_NAME "@RELEASE_NAME@"
57+#cmakedefine VERSION "@VERSION@"
58+#cmakedefine VERSION_INFO "@VERSION_INFO@"
59+
60+#endif // CONFIG_H
61
62=== added file 'lib/config.vapi'
63--- lib/config.vapi 1970-01-01 00:00:00 +0000
64+++ lib/config.vapi 2015-05-06 19:53:14 +0000
65@@ -0,0 +1,10 @@
66+[CCode (cprefix = "", lower_case_cprefix = "", cheader_filename = "config.h")]
67+namespace Build {
68+ public const string DATADIR;
69+ public const string PKGDATADIR;
70+ public const string PLUGS_DIR;
71+ public const string GETTEXT_PACKAGE;
72+ public const string RELEASE_NAME;
73+ public const string VERSION;
74+ public const string VERSION_INFO;
75+}

Subscribers

People subscribed via source and target branches

to all changes: