[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-buildsystem
Subject:    Iconcache additions
From:       Rivo Laks <rivolaks () hot ! ee>
Date:       2007-07-20 15:12:33
Message-ID: 200707201812.33338.rivolaks () hot ! ee
[Download RAW message or body]

Hi

The attached patch adds KDE4_ICONS_INSTALLED macro which updates mtime of the 
hicolor icontheme directory, to make the icon cache update itself. It also 
makes the KDE4_INSTALL_ICONS macro use it.

On k-c-d it was suggested that this could be a generic FD.org macro, but I'm 
not sure where to put it in that case. Should another file be created in 
kdelibs/cmake/modules/? Or should it even go into cmake itself (in that case 
I believe we also have to ship a kde version of it though)?

As touch doesn't exist on windows, I create a temporary file in the theme dir 
there and then delete it. It should work but I haven't tested it, so if 
anyone could make sure it really does what it should, I'd appreciate it.

And finally, I'm open to renaming the macro if you have better ideas 
(KDE4_UPDATE_ICONCACHE?) ;-)

Rivo

["cmake-iconcache.diff" (text/x-diff)]

Index: FindKDE4Internal.cmake
===================================================================
--- FindKDE4Internal.cmake	(revision 690217)
+++ FindKDE4Internal.cmake	(working copy)
@@ -183,6 +183,10 @@
 #    KGlobal::dirs()->addResourceDir( "data", KDESRCDIR ); to be able to use xmlgui
 #    and other things in the test, that normally require installation
 #
+# KDE4_ICONS_INSTALLED( path )
+#    Notifies the icon cache that new icons have been installed by updating
+#    mtime of ${path}/hicolor directory.
+#
 # KDE4_INSTALL_ICONS( path theme)
 #    Installs all png and svgz files in the current directory to the icon
 #    directoy given in path, in the subdirectory for the given icon theme.
Index: KDE4Macros.cmake
===================================================================
--- KDE4Macros.cmake	(revision 690217)
+++ KDE4Macros.cmake	(working copy)
@@ -15,6 +15,7 @@
 # KDE4_ADD_TEST_EXECUTABLE
 # KDE4_ADD_EXECUTABLE
 # KDE4_ADD_WIDGET_FILES
+# KDE4_ICONS_INSTALLED
 # KDE4_INSTALL_ICONS
 # KDE4_REMOVE_OBSOLETE_CMAKE_FILES
 # KDE4_NO_ENABLE_FINAL
@@ -328,6 +329,17 @@
 endmacro (KDE4_CREATE_HTML_HANDBOOK)
 
 
+macro (KDE4_ICONS_INSTALLED _install_PATH)
+    if (WIN32)
+        # Under Windows we don't have touch command.
+        # Instead, create and delete a temporary file in the theme dir.
+        install(CODE "file(WRITE \"${_install_PATH}/hicolor/temp.txt\" \"update\")")
+        install(CODE "file(REMOVE \"${_install_PATH}/hicolor/temp.txt\")")
+    else (WIN32)
+        install(CODE "exec_program(touch ARGS -m \"${_install_PATH}/hicolor\")")
+    endif (WIN32)
+endmacro (KDE4_ICONS_INSTALLED)
+
 # a "map" of short type names to the directories
 # unknown names should give empty results
 # KDE 3 compatibility
@@ -417,6 +429,8 @@
       endif( _theme_GROUP)
    endforeach (_current_ICON)
 
+   KDE4_ICONS_INSTALLED(${_defaultpath})
+
 endmacro (KDE4_INSTALL_ICONS)
 
 


_______________________________________________
Kde-buildsystem mailing list
Kde-buildsystem@kde.org
https://mail.kde.org/mailman/listinfo/kde-buildsystem


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic