Merge lp:~gue5t/midori/builtInIcons2 into lp:~midori/midori/builtInIcons

Proposed by gue5t gue5t
Status: Merged
Merged at revision: 7026
Proposed branch: lp:~gue5t/midori/builtInIcons2
Merge into: lp:~midori/midori/builtInIcons
Diff against target: 45 lines (+6/-5)
2 files modified
icons/CMakeLists.txt (+4/-0)
katze/midori-paths.vala (+2/-5)
To merge this branch: bzr merge lp:~gue5t/midori/builtInIcons2
Reviewer Review Type Date Requested Status
Cris Dywan Pending
Review via email: mp+268864@code.launchpad.net

Commit message

simplify path handing and make a symlink at build-time to show adblock icons without install

Description of the change

I think this fulfills the required directory layout. Hopefully it's okay to invoke `ln`; as far as I could tell CMake doesn't have a built-in symlink command, but this works on any POSIX system (and isn't run on Windows).

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'icons/CMakeLists.txt'
--- icons/CMakeLists.txt 2015-08-09 20:44:57 +0000
+++ icons/CMakeLists.txt 2015-08-24 01:04:00 +0000
@@ -1,5 +1,9 @@
1# Copyright (C) 2013 Christian Dywan <christian@twotoasts.de>1# Copyright (C) 2013 Christian Dywan <christian@twotoasts.de>
22
3if (UNIX)
4 EXECUTE_PROCESS(COMMAND ln -sf ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_BINARY_DIR}/hicolor)
5endif ()
6
3macro(install_icon name cat size)7macro(install_icon name cat size)
4 file(GLOB FILENAME RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "${size}/${name}.*")8 file(GLOB FILENAME RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "${size}/${name}.*")
5 install(FILES ${FILENAME} DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/${size}/${cat})9 install(FILES ${FILENAME} DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/${size}/${cat})
610
=== modified file 'katze/midori-paths.vala'
--- katze/midori-paths.vala 2015-08-16 17:27:46 +0000
+++ katze/midori-paths.vala 2015-08-24 01:04:00 +0000
@@ -185,8 +185,7 @@
185 }185 }
186186
187 #if !HAVE_WIN32187 #if !HAVE_WIN32
188 string builtin_path = build_folder ("icons", null, "index.theme", true);188 Gtk.IconTheme.get_default ().append_search_path (exec_path);
189 Gtk.IconTheme.get_default ().append_search_path (builtin_path);
190 #endif189 #endif
191190
192 if (strcmp (Environment.get_variable ("MIDORI_DEBUG"), "paths") == 0) {191 if (strcmp (Environment.get_variable ("MIDORI_DEBUG"), "paths") == 0) {
@@ -392,7 +391,7 @@
392 }391 }
393392
394 #if !HAVE_WIN32393 #if !HAVE_WIN32
395 string? build_folder (string folder, string? middle, string filename, bool folder_only=false) {394 string? build_folder (string folder, string? middle, string filename) {
396 /* Fallback to build folder */395 /* Fallback to build folder */
397 File? parent = File.new_for_path (exec_path);396 File? parent = File.new_for_path (exec_path);
398 while (parent != null) {397 while (parent != null) {
@@ -400,8 +399,6 @@
400 if (middle != null)399 if (middle != null)
401 data = data.get_child (middle);400 data = data.get_child (middle);
402 var child = data.get_child (filename);401 var child = data.get_child (filename);
403 if (folder_only && child.query_exists ())
404 return data.get_path ();
405 if (child.query_exists ())402 if (child.query_exists ())
406 return child.get_path ();403 return child.get_path ();
407 parent = parent.get_parent ();404 parent = parent.get_parent ();

Subscribers

People subscribed via source and target branches

to all changes: