Peter Kümmel wrote:
Peter Kümmel wrote:
Enrico Forestieri wrote:
On Fri, Oct 19, 2007 at 05:22:30PM +0200, Abdelrazak Younes wrote:
[EMAIL PROTECTED] wrote:
Author: forenr
Date: Fri Oct 19 17:16:40 2007
New Revision: 21065
URL: http://www.lyx.org/trac/changeset/21065
Log:
Compile fix
static void initializeResources()
{
+ extern void qInitResources();
static bool initialized = false;
if (!initialized) {
- Q_INIT_RESOURCE(Resources);
+ qInitResources();
Didn't Peter said that Q_INIT_RESOURCE is the Qt official way and
that Windows rcc doesn't generate qInitResources() but something else?
The rcc source does not use Q_INIT_RESOURCE, it uses qInitResources(),
unless you use -name xxx, in which case it uses qInitResources_xxx().
OK, now I understand why it compiles with automake. But wouldn't it be
better to fix the automake call of rcc and to use Q_INIT_RESOURCE?
Peter
Checked again, but here I need
static int qInitResources();
Therefore I think it is better to use Q_INIT_RESOURCE than to
speculate about the output of rcc. Above solution will not work
when TT changes the output rcc, but Q_INIT_RESOURCE is always in
sync with rcc.
Peter
What about this patch?
If the scons and .am chnages are correct I check it in.
--
Peter Kümmel
Index: development/cmake/modules/FindQt4.cmake
===================================================================
--- development/cmake/modules/FindQt4.cmake (revision 21071)
+++ development/cmake/modules/FindQt4.cmake (working copy)
@@ -787,7 +787,7 @@
set(outfile ${CMAKE_CURRENT_BINARY_DIR}/qrc_${outfilename}.cxx)
ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
COMMAND ${QT_RCC_EXECUTABLE}
- ARGS -o ${outfile} ${infile}
+ ARGS -name ${outfilename} -o ${outfile} ${infile}
MAIN_DEPENDENCY ${infile} )
set(${outfiles} ${${outfiles}} ${outfile})
ENDFOREACH (it)
Index: development/scons/qt4.py
===================================================================
--- development/scons/qt4.py (revision 21071)
+++ development/scons/qt4.py (working copy)
@@ -249,7 +249,7 @@
argument = None,
skeys = ['.qrc'])
qrcbuilder = Builder(
- action ='$QT4_RCC $QT4_QRCFLAGS $SOURCE -o $TARGET',
+ action ='$QT4_RCC $QT4_QRCFLAGS -name Resources $SOURCE -o
$TARGET',
source_scanner = qrcscanner,
src_suffix = '$QT4_QRCSUFFIX',
suffix = '$QT4_QRCCXXSUFFIX',
Index: src/frontends/qt4/GuiToolbar.cpp
===================================================================
--- src/frontends/qt4/GuiToolbar.cpp (revision 21071)
+++ src/frontends/qt4/GuiToolbar.cpp (working copy)
@@ -45,10 +45,9 @@
static void initializeResources()
{
- extern void qInitResources();
static bool initialized = false;
if (!initialized) {
- qInitResources();
+ Q_INIT_RESOURCE(Resources);
initialized = true;
}
}
Index: src/frontends/qt4/Makefile.am
===================================================================
--- src/frontends/qt4/Makefile.am (revision 21071)
+++ src/frontends/qt4/Makefile.am (working copy)
@@ -26,7 +26,7 @@
echo "</qresource></RCC>" >> $@
Resources.cpp: Resources.qrc
- $(RCC4) $< -o $@
+ $(RCC4) $< -name Resources -o $@
######################### LIBRARIES #############################