diff options
| author | 2008-03-26 05:01:53 +0000 | |
|---|---|---|
| committer | 2008-03-26 05:01:53 +0000 | |
| commit | 751840855dff580bc2f5debe6369cee2313bd3e2 (patch) | |
| tree | 55d39eb8fbba3b23c9b5cdfc35772b9be2d94a3b | |
| parent | fix for compiling (diff) | |
| download | KVIrc-751840855dff580bc2f5debe6369cee2313bd3e2.tar.gz KVIrc-751840855dff580bc2f5debe6369cee2313bd3e2.tar.bz2 KVIrc-751840855dff580bc2f5debe6369cee2313bd3e2.zip | |
ported KviTalHBox and KviTalVBox to Qt4;
removed some qt3 include files and cleaned a bit the code around;
moved config dir to ~/.config/KVIrc according to LSB 2.0 standards;
changed codename to 'Insomnia';
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@1293 17fca916-40b9-46aa-a4ea-0a15b648b75c
31 files changed, 773 insertions, 1616 deletions
diff --git a/admin/config.guess b/admin/config.guess index 34093cc6b..917bbc50f 100755 --- a/admin/config.guess +++ b/admin/config.guess @@ -1,10 +1,9 @@ #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, -# Inc. +# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. -timestamp='2007-07-22' +timestamp='2005-07-08' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -107,7 +106,7 @@ set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; - { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; @@ -139,23 +138,6 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown -if [ "${UNAME_SYSTEM}" = "Linux" ] ; then - eval $set_cc_for_build - cat << EOF > $dummy.c - #include <features.h> - #ifdef __UCLIBC__ - # ifdef __UCLIBC_CONFIG_VERSION__ - LIBC=uclibc __UCLIBC_CONFIG_VERSION__ - # else - LIBC=uclibc - # endif - #else - LIBC=gnu - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep LIBC= | sed -e 's: ::g'` -fi - # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in @@ -178,7 +160,6 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; - sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched @@ -225,11 +206,8 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; - *:SolidBSD:*:*) - echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} - exit ;; macppc:MirBSD:*:*) - echo powerpc-unknown-mirbsd${UNAME_RELEASE} + echo powerppc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} @@ -347,7 +325,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; - i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) + i86pc:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) @@ -786,19 +764,12 @@ EOF echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) - case ${UNAME_MACHINE} in - pc98) - echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - amd64) - echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - *) - echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - esac + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; - *:MINGW*:*) + i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) @@ -808,15 +779,9 @@ EOF i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; - *:Interix*:[3456]*) - case ${UNAME_MACHINE} in - x86) - echo i586-pc-interix${UNAME_RELEASE} - exit ;; - EM64T | authenticamd) - echo x86_64-unknown-interix${UNAME_RELEASE} - exit ;; - esac ;; + x86:Interix*:[34]*) + echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' + exit ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; @@ -829,7 +794,7 @@ EOF i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; - amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + amd64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) @@ -850,28 +815,25 @@ EOF echo ${UNAME_MACHINE}-pc-minix exit ;; arm*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - avr32*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) - echo cris-axis-linux-${LIBC} + echo cris-axis-linux-gnu exit ;; crisv32:Linux:*:*) - echo crisv32-axis-linux-${LIBC} + echo crisv32-axis-linux-gnu exit ;; frv:Linux:*:*) - echo frv-unknown-linux-${LIBC} + echo frv-unknown-linux-gnu exit ;; ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; mips:Linux:*:*) eval $set_cc_for_build @@ -889,12 +851,8 @@ EOF #endif #endif EOF - eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' - /^CPU/{ - s: ::g - p - }'`" - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; mips64:Linux:*:*) eval $set_cc_for_build @@ -912,21 +870,14 @@ EOF #endif #endif EOF - eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' - /^CPU/{ - s: ::g - p - }'`" - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; - or32:Linux:*:*) - echo or32-unknown-linux-${LIBC} - exit ;; ppc:Linux:*:*) - echo powerpc-unknown-linux-${LIBC} + echo powerpc-unknown-linux-gnu exit ;; ppc64:Linux:*:*) - echo powerpc64-unknown-linux-${LIBC} + echo powerpc64-unknown-linux-gnu exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in @@ -939,40 +890,34 @@ EOF EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null - if test "$?" = 0 ; then LIBC="gnulibc1" ; fi - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; - PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; - *) echo hppa-unknown-linux-${LIBC} ;; + PA7*) echo hppa1.1-unknown-linux-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; esac exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-${LIBC} + echo hppa64-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - vax:Linux:*:*) - echo ${UNAME_MACHINE}-dec-linux-${LIBC} + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; x86_64:Linux:*:*) - echo x86_64-unknown-linux-${LIBC} - exit ;; - xtensa:Linux:*:*) - echo xtensa-unknown-linux-${LIBC} + echo x86_64-unknown-linux-gnu exit ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so @@ -987,22 +932,20 @@ EOF p'` case "$ld_supported_targets" in elf32-i386) - TENTATIVE="${UNAME_MACHINE}-pc-linux-${LIBC}" + TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; a.out-i386-linux) - echo "${UNAME_MACHINE}-pc-linux-${LIBC}aout" + echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit ;; coff-i386) - echo "${UNAME_MACHINE}-pc-linux-${LIBC}coff" + echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. - echo "${UNAME_MACHINE}-pc-linux-${LIBC}oldld" + echo "${UNAME_MACHINE}-pc-linux-gnuoldld" exit ;; esac - # This should get integrated into the C code below, but now we hack - if [ "$LIBC" != "gnu" ] ; then echo "$TENTATIVE" && exit 0 ; fi # Determine whether the default compiler is a.out or elf eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c @@ -1018,7 +961,7 @@ EOF LIBC=gnulibc1 # endif #else - #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) + #ifdef __INTEL_COMPILER LIBC=gnu #else LIBC=gnuaout @@ -1028,11 +971,7 @@ EOF LIBC=dietlibc #endif EOF - eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' - /^LIBC/{ - s: ::g - p - }'`" + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` test x"${LIBC}" != x && { echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit @@ -1234,15 +1173,6 @@ EOF SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; - SX-7:SUPER-UX:*:*) - echo sx7-nec-superux${UNAME_RELEASE} - exit ;; - SX-8:SUPER-UX:*:*) - echo sx8-nec-superux${UNAME_RELEASE} - exit ;; - SX-8R:SUPER-UX:*:*) - echo sx8r-nec-superux${UNAME_RELEASE} - exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; @@ -1252,6 +1182,7 @@ EOF *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in + *86) UNAME_PROCESSOR=i686 ;; unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} @@ -1330,9 +1261,6 @@ EOF i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; - i*86:rdos:*:*) - echo ${UNAME_MACHINE}-pc-rdos - exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 diff --git a/admin/config.sub b/admin/config.sub index 63cdd0a35..1c366dfde 100755 --- a/admin/config.sub +++ b/admin/config.sub @@ -1,10 +1,9 @@ #! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, -# Inc. +# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. -timestamp='2007-06-28' +timestamp='2005-07-08' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -120,9 +119,8 @@ esac # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in - nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ - uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ - storm-chaos* | os2-emx* | rtmk-nova*) + nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \ + kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; @@ -173,10 +171,6 @@ case $os in -hiux*) os=-hiuxwe2 ;; - -sco6) - os=-sco5v6 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` @@ -193,10 +187,6 @@ case $os in # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; - -sco5v6*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` @@ -241,16 +231,15 @@ case $basic_machine in | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ - | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ | bfin \ | c4x | clipper \ - | d10v | d30v | dlx | dsp16xx | dvp \ - | fido | fr30 | frv \ + | d10v | d30v | dlx | dsp16xx \ + | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ - | m32c | m32r | m32rle | m68000 | m68k | m88k \ - | maxq | mb | microblaze | mcore | mep \ + | m32r | m32rle | m68000 | m68k | m88k | maxq | mcore \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ @@ -268,27 +257,28 @@ case $basic_machine in | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ - | mt \ + | ms1 \ | msp430 \ - | nios | nios2 \ | ns16k | ns32k \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ - | score \ - | sh | sh[1234] | sh[24]a | sh[24]a*eb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ - | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ - | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ - | spu | strongarm \ + | sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b \ + | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ - | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ + | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; + m32c) + basic_machine=$basic_machine-unknown + ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown @@ -296,9 +286,6 @@ case $basic_machine in ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; - ms1) - basic_machine=mt-unknown - ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and @@ -318,18 +305,18 @@ case $basic_machine in | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ - | avr-* | avr32-* \ + | avr-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ - | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ + | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ - | m32c-* | m32r-* | m32rle-* \ + | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ @@ -349,30 +336,31 @@ case $basic_machine in | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ - | mt-* \ + | ms1-* \ | msp430-* \ - | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ - | sh-* | sh[1234]-* | sh[24]a-* | sh[24]a*eb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ - | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \ | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ - | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ + | x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa-* \ | ymp-* \ | z8k-*) ;; + m32c-*) + ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) @@ -475,8 +463,8 @@ case $basic_machine in basic_machine=craynv-cray os=-unicosmp ;; - cr16) - basic_machine=cr16-unknown + cr16c) + basic_machine=cr16c-unknown os=-elf ;; crds | unos) @@ -683,10 +671,6 @@ case $basic_machine in basic_machine=i386-pc os=-mingw32 ;; - mingw32ce) - basic_machine=arm-unknown - os=-mingw32ce - ;; miniframe) basic_machine=m68000-convergent ;; @@ -694,24 +678,6 @@ case $basic_machine in basic_machine=m68k-atari os=-mint ;; - mipsEE* | ee | ps2) - basic_machine=mips64r5900el-scei - case $os in - -linux*) - ;; - *) - os=-elf - ;; - esac - ;; - iop) - basic_machine=mipsel-scei - os=-irx - ;; - dvp) - basic_machine=dvp-scei - os=-elf - ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; @@ -730,9 +696,6 @@ case $basic_machine in basic_machine=i386-pc os=-msdos ;; - ms1-*) - basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` - ;; mvs) basic_machine=i370-ibm os=-mvs @@ -840,12 +803,6 @@ case $basic_machine in pc532 | pc532-*) basic_machine=ns32k-pc532 ;; - pc98) - basic_machine=i386-pc - ;; - pc98-*) - basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; @@ -902,10 +859,6 @@ case $basic_machine in basic_machine=i586-unknown os=-pw32 ;; - rdos) - basic_machine=i386-pc - os=-rdos - ;; rom68k) basic_machine=m68k-rom68k os=-coff @@ -932,10 +885,6 @@ case $basic_machine in sb1el) basic_machine=mipsisa64sb1el-unknown ;; - sde) - basic_machine=mipsisa32-sde - os=-elf - ;; sei) basic_machine=mips-sei os=-seiux @@ -947,9 +896,6 @@ case $basic_machine in basic_machine=sh-hitachi os=-hms ;; - sh5el) - basic_machine=sh5le-unknown - ;; sh64) basic_machine=sh64-unknown ;; @@ -1155,7 +1101,7 @@ case $basic_machine in sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; - sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) + sparc | sparcv8 | sparcv9 | sparcv9b) basic_machine=sparc-sun ;; cydra) @@ -1228,23 +1174,21 @@ case $os in | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ - | -openbsd* | -solidbsd* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ - | -uxpv* | -beos* | -mpeix* | -udk* \ + | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -irx*) + | -skyos* | -haiku*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1396,12 +1340,6 @@ else # system, and we'll never get to this point. case $basic_machine in - score-*) - os=-elf - ;; - spu-*) - os=-elf - ;; *-acorn) os=-riscix1.2 ;; @@ -1411,9 +1349,9 @@ case $basic_machine in arm*-semi) os=-aout ;; - c4x-* | tic4x-*) - os=-coff - ;; + c4x-* | tic4x-*) + os=-coff + ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 @@ -1439,9 +1377,6 @@ case $basic_machine in m68*-cisco) os=-aout ;; - mep-*) - os=-elf - ;; mips*-cisco) os=-elf ;; diff --git a/admin/depcomp b/admin/depcomp index ca5ea4e1e..04701da53 100755 --- a/admin/depcomp +++ b/admin/depcomp @@ -1,10 +1,9 @@ #! /bin/sh # depcomp - compile a program generating dependencies as side-effects -scriptversion=2006-10-15.18 +scriptversion=2005-07-09.11 -# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006 Free Software -# Foundation, Inc. +# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -92,20 +91,7 @@ gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. -## Unfortunately, FreeBSD c89 acceptance of flags depends upon -## the command line argument order; so add the flags where they -## appear in depend2.am. Note that the slowdown incurred here -## affects only configure: in makefiles, %FASTDEP% shortcuts this. - for arg - do - case $arg in - -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; - *) set fnord "$@" "$arg" ;; - esac - shift # fnord - shift # $arg - done - "$@" + "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else @@ -290,46 +276,6 @@ icc) rm -f "$tmpdepfile" ;; -hp2) - # The "hp" stanza above does not work with aCC (C++) and HP's ia64 - # compilers, which have integrated preprocessors. The correct option - # to use with these is +Maked; it writes dependencies to a file named - # 'foo.d', which lands next to the object file, wherever that - # happens to be. - # Much of this is similar to the tru64 case; see comments there. - dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` - test "x$dir" = "x$object" && dir= - base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` - if test "$libtool" = yes; then - tmpdepfile1=$dir$base.d - tmpdepfile2=$dir.libs/$base.d - "$@" -Wc,+Maked - else - tmpdepfile1=$dir$base.d - tmpdepfile2=$dir$base.d - "$@" +Maked - fi - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile1" "$tmpdepfile2" - exit $stat - fi - - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" - do - test -f "$tmpdepfile" && break - done - if test -f "$tmpdepfile"; then - sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" - # Add `dependent.h:' lines. - sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile" - else - echo "#dummy" > "$depfile" - fi - rm -f "$tmpdepfile" "$tmpdepfile2" - ;; - tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. @@ -342,13 +288,13 @@ tru64) if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a - # static library. This mechanism is used in libtool 1.4 series to + # static library. This mecanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # generates 2 separate objects for the 2 libraries. These two - # compilations output dependencies in $dir.libs/$base.o.d and + # compilations output dependencies in in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is diff --git a/admin/install-sh b/admin/install-sh index 4fbbae7b7..4d4a9519e 100755 --- a/admin/install-sh +++ b/admin/install-sh @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2006-10-14.15 +scriptversion=2005-05-14.22 # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -39,24 +39,15 @@ scriptversion=2006-10-14.15 # when there is no Makefile. # # This script is compatible with the BSD install script, but was written -# from scratch. - -nl=' -' -IFS=" "" $nl" +# from scratch. It can only install one file at a time, a restriction +# shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" -if test -z "$doit"; then - doit_exec=exec -else - doit_exec=$doit -fi -# Put in absolute file names if you don't have them in your path; -# or use environment vars. +# put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" @@ -67,13 +58,7 @@ stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" -posix_glob= -posix_mkdir= - -# Desired mode of installed file. -mode=0755 - -chmodcmd=$chmodprog +chmodcmd="$chmodprog 0755" chowncmd= chgrpcmd= stripcmd= @@ -110,7 +95,7 @@ Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " -while test $# -ne 0; do +while test -n "$1"; do case $1 in -c) shift continue;; @@ -126,15 +111,9 @@ while test $# -ne 0; do --help) echo "$usage"; exit $?;; - -m) mode=$2 + -m) chmodcmd="$chmodprog $2" shift shift - case $mode in - *' '* | *' '* | *' -'* | *'*'* | *'?'* | *'['*) - echo "$0: invalid mode: $mode" >&2 - exit 1;; - esac continue;; -o) chowncmd="$chownprog $2" @@ -157,33 +136,25 @@ while test $# -ne 0; do --version) echo "$0 $scriptversion"; exit $?;; - --) shift + *) # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + test -n "$dir_arg$dstarg" && break + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dstarg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dstarg" + shift # fnord + fi + shift # arg + dstarg=$arg + done break;; - - -*) echo "$0: invalid option: $1" >&2 - exit 1;; - - *) break;; esac done -if test $# -ne 0 && test -z "$dir_arg$dstarg"; then - # When -d is used, all remaining arguments are directories to create. - # When -t is used, the destination is already specified. - # Otherwise, the last argument is the destination. Remove it from $@. - for arg - do - if test -n "$dstarg"; then - # $@ is not empty: it contains at least $arg. - set fnord "$@" "$dstarg" - shift # fnord - fi - shift # arg - dstarg=$arg - done -fi - -if test $# -eq 0; then +if test -z "$1"; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 @@ -193,33 +164,6 @@ if test $# -eq 0; then exit 0 fi -if test -z "$dir_arg"; then - trap '(exit $?); exit' 1 2 13 15 - - # Set umask so as not to create temps with too-generous modes. - # However, 'strip' requires both read and write access to temps. - case $mode in - # Optimize common cases. - *644) cp_umask=133;; - *755) cp_umask=22;; - - *[0-7]) - if test -z "$stripcmd"; then - u_plus_rw= - else - u_plus_rw='% 200' - fi - cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; - *) - if test -z "$stripcmd"; then - u_plus_rw= - else - u_plus_rw=,u+rw - fi - cp_umask=$mode$u_plus_rw;; - esac -fi - for src do # Protect names starting with `-'. @@ -229,11 +173,15 @@ do if test -n "$dir_arg"; then dst=$src - dstdir=$dst - test -d "$dstdir" - dstdir_status=$? - else + src= + if test -d "$dst"; then + mkdircmd=: + chmodcmd= + else + mkdircmd=$mkdirprog + fi + else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. @@ -260,188 +208,53 @@ do echo "$0: $dstarg: Is a directory" >&2 exit 1 fi - dstdir=$dst - dst=$dstdir/`basename "$src"` - dstdir_status=0 - else - # Prefer dirname, but fall back on a substitute if dirname fails. - dstdir=` - (dirname "$dst") 2>/dev/null || - expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$dst" : 'X\(//\)[^/]' \| \ - X"$dst" : 'X\(//\)$' \| \ - X"$dst" : 'X\(/\)' \| . 2>/dev/null || - echo X"$dst" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q' - ` - - test -d "$dstdir" - dstdir_status=$? + dst=$dst/`basename "$src"` fi fi - obsolete_mkdir_used=false - - if test $dstdir_status != 0; then - case $posix_mkdir in - '') - # Create intermediate dirs using mode 755 as modified by the umask. - # This is like FreeBSD 'install' as of 1997-10-28. - umask=`umask` - case $stripcmd.$umask in - # Optimize common cases. - *[2367][2367]) mkdir_umask=$umask;; - .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; - - *[0-7]) - mkdir_umask=`expr $umask + 22 \ - - $umask % 100 % 40 + $umask % 20 \ - - $umask % 10 % 4 + $umask % 2 - `;; - *) mkdir_umask=$umask,go-w;; - esac + # This sed command emulates the dirname command. + dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'` - # With -d, create the new directory with the user-specified mode. - # Otherwise, rely on $mkdir_umask. - if test -n "$dir_arg"; then - mkdir_mode=-m$mode - else - mkdir_mode= - fi - - posix_mkdir=false - case $umask in - *[123567][0-7][0-7]) - # POSIX mkdir -p sets u+wx bits regardless of umask, which - # is incompatible with FreeBSD 'install' when (umask & 300) != 0. - ;; - *) - tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ - trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 - - if (umask $mkdir_umask && - exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 - then - if test -z "$dir_arg" || { - # Check for POSIX incompatibilities with -m. - # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or - # other-writeable bit of parent directory when it shouldn't. - # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. - ls_ld_tmpdir=`ls -ld "$tmpdir"` - case $ls_ld_tmpdir in - d????-?r-*) different_mode=700;; - d????-?--*) different_mode=755;; - *) false;; - esac && - $mkdirprog -m$different_mode -p -- "$tmpdir" && { - ls_ld_tmpdir_1=`ls -ld "$tmpdir"` - test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" - } - } - then posix_mkdir=: - fi - rmdir "$tmpdir/d" "$tmpdir" - else - # Remove any dirs left behind by ancient mkdir implementations. - rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null - fi - trap '' 0;; - esac;; - esac - - if - $posix_mkdir && ( - umask $mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" - ) - then : - else + # Make sure that the destination directory exists. - # The umask is ridiculous, or mkdir does not conform to POSIX, - # or it failed possibly due to a race condition. Create the - # directory the slow way, step by step, checking for races as we go. + # Skip lots of stat calls in the usual case. + if test ! -d "$dstdir"; then + defaultIFS=' + ' + IFS="${IFS-$defaultIFS}" - case $dstdir in - /*) prefix=/ ;; - -*) prefix=./ ;; - *) prefix= ;; - esac + oIFS=$IFS + # Some sh's can't handle IFS=/ for some reason. + IFS='%' + set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` + shift + IFS=$oIFS - case $posix_glob in - '') - if (set -f) 2>/dev/null; then - posix_glob=true - else - posix_glob=false - fi ;; - esac + pathcomp= - oIFS=$IFS - IFS=/ - $posix_glob && set -f - set fnord $dstdir + while test $# -ne 0 ; do + pathcomp=$pathcomp$1 shift - $posix_glob && set +f - IFS=$oIFS - - prefixes= - - for d - do - test -z "$d" && continue - - prefix=$prefix$d - if test -d "$prefix"; then - prefixes= - else - if $posix_mkdir; then - (umask=$mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break - # Don't fail if two instances are running concurrently. - test -d "$prefix" || exit 1 - else - case $prefix in - *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; - *) qprefix=$prefix;; - esac - prefixes="$prefixes '$qprefix'" - fi - fi - prefix=$prefix/ - done - - if test -n "$prefixes"; then - # Don't fail if two instances are running concurrently. - (umask $mkdir_umask && - eval "\$doit_exec \$mkdirprog $prefixes") || - test -d "$dstdir" || exit 1 - obsolete_mkdir_used=true + if test ! -d "$pathcomp"; then + $mkdirprog "$pathcomp" + # mkdir can fail with a `File exist' error in case several + # install-sh are creating the directory concurrently. This + # is OK. + test -d "$pathcomp" || exit fi - fi + pathcomp=$pathcomp/ + done fi if test -n "$dir_arg"; then - { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && - { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && - { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || - test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 + $doit $mkdircmd "$dst" \ + && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \ + && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \ + && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \ + && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; } + else + dstfile=`basename "$dst"` # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ @@ -449,9 +262,10 @@ do # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + trap '(exit $?); exit' 1 2 13 15 # Copy the file name to the temp name. - (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && + $doit $cpprog "$src" "$dsttmp" && # and set any options; do chmod last to preserve setuid bits. # @@ -462,10 +276,10 @@ do { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ - && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && + && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } && # Now rename the file to the real destination. - { $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null \ + { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \ || { # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not @@ -477,12 +291,11 @@ do # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { - if test -f "$dst"; then - $doit $rmcmd -f "$dst" 2>/dev/null \ - || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null \ - && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }; }\ + if test -f "$dstdir/$dstfile"; then + $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \ + || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \ || { - echo "$0: cannot unlink or rename $dst" >&2 + echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 (exit 1); exit 1 } else @@ -491,14 +304,17 @@ do } && # Now rename the file to the real destination. - $doit $mvcmd "$dsttmp" "$dst" + $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" } - } || exit 1 - - trap '' 0 - fi + } + fi || { (exit 1); exit 1; } done +# The final little trick to "correctly" pass the exit status to the exit trap. +{ + (exit 0); exit 0 +} + # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" diff --git a/admin/ltmain.sh b/admin/ltmain.sh index d74b5a67a..b4583e7e2 100644 --- a/admin/ltmain.sh +++ b/admin/ltmain.sh @@ -44,7 +44,7 @@ EXIT_FAILURE=1 PROGRAM=ltmain.sh PACKAGE=libtool VERSION=1.5.24 -TIMESTAMP=" (1.1220.2.456 2007/06/24 02:25:32)" +TIMESTAMP=" (1.1220.2.455 2007/06/24 02:13:29)" # Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE). if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then @@ -275,21 +275,7 @@ func_infer_tag () esac CC_quoted="$CC_quoted $arg" done - # user sometimes does CC=<HOST>-gcc so we need to match that to 'gcc' - trimedcc=`echo ${CC} | $SED -e "s/${host}-//g"` - # and sometimes libtool has CC=<HOST>-gcc but user does CC=gcc - extendcc=${host}-${CC} - # and sometimes libtool has CC=<OLDHOST>-gcc but user has CC=<NEWHOST>-gcc - # (Gentoo-specific hack because we always export $CHOST) - mungedcc=${CHOST-${host}}-${trimedcc} case "$@ " in - "cc "* | " cc "* | "${host}-cc "* | " ${host}-cc "*|\ - "gcc "* | " gcc "* | "${host}-gcc "* | " ${host}-gcc "*) - tagname=CC - break ;; - "$trimedcc "* | " $trimedcc "* | "`$echo $trimedcc` "* | " `$echo $trimedcc` "*|\ - "$extendcc "* | " $extendcc "* | "`$echo $extendcc` "* | " `$echo $extendcc` "*|\ - "$mungedcc "* | " $mungedcc "* | "`$echo $mungedcc` "* | " `$echo $mungedcc` "*|\ " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) # The compiler in the base compile command matches # the one in the tagged configuration. @@ -895,7 +881,7 @@ if test -z "$show_help"; then # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then - until $run ln "$srcfile" "$lockfile" 2>/dev/null; do + until $run ln "$progpath" "$lockfile" 2>/dev/null; do $show "Waiting for $lockfile to be removed" sleep 2 done @@ -2948,9 +2934,9 @@ EOF $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi - if test "$absdir" != "$libdir"; then - $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 - fi + #if test "$absdir" != "$libdir"; then + # $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 + #fi path="$absdir" fi depdepl= @@ -5456,11 +5442,6 @@ else $echo >> $output "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. - - # Make sure env LD_LIBRARY_PATH does not mess us up - if test -n \"\${LD_LIBRARY_PATH+set}\"; then - export LD_LIBRARY_PATH=\$progdir:\$LD_LIBRARY_PATH - fi " case $host in # Backslashes separate directories on plain windows @@ -5688,53 +5669,9 @@ fi\ $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi - if test "X$EGREP" = X ; then - EGREP=egrep - fi - # We do not want portage's install root ($D) present. Check only for - # this if the .la is being installed. - if test "$installed" = yes && test "$D"; then - eval mynewdependency_lib=`echo "$libdir/$name" |sed -e "s:$D:/:g" -e 's:/\+:/:g'` - else - mynewdependency_lib="$libdir/$name" - fi - # Do not add duplicates - if test "$mynewdependency_lib"; then - my_little_ninja_foo_1=`echo $newdependency_libs |$EGREP -e "$mynewdependency_lib"` - if test -z "$my_little_ninja_foo_1"; then - newdependency_libs="$newdependency_libs $mynewdependency_lib" - fi - fi - ;; - *) - if test "$installed" = yes; then - # Rather use S=WORKDIR if our version of portage supports it. - # This is because some ebuild (gcc) do not use $S as buildroot. - if test "$PWORKDIR"; then - S="$PWORKDIR" - fi - # We do not want portage's build root ($S) present. - my_little_ninja_foo_2=`echo $deplib |$EGREP -e "$S"` - # We do not want portage's install root ($D) present. - my_little_ninja_foo_3=`echo $deplib |$EGREP -e "$D"` - if test -n "$my_little_ninja_foo_2" && test "$S"; then - mynewdependency_lib="" - elif test -n "$my_little_ninja_foo_3" && test "$D"; then - eval mynewdependency_lib=`echo "$deplib" |sed -e "s:$D:/:g" -e 's:/\+:/:g'` - else - mynewdependency_lib="$deplib" - fi - else - mynewdependency_lib="$deplib" - fi - # Do not add duplicates - if test "$mynewdependency_lib"; then - my_little_ninja_foo_4=`echo $newdependency_libs |$EGREP -e "$mynewdependency_lib"` - if test -z "$my_little_ninja_foo_4"; then - newdependency_libs="$newdependency_libs $mynewdependency_lib" - fi - fi + newdependency_libs="$newdependency_libs $libdir/$name" ;; + *) newdependency_libs="$newdependency_libs $deplib" ;; esac done dependency_libs="$newdependency_libs" @@ -5786,10 +5723,6 @@ fi\ case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; esac - # Do not add duplicates - if test "$installed" = yes && test "$D"; then - install_libdir=`echo "$install_libdir" |sed -e "s:$D:/:g" -e 's:/\+:/:g'` - fi $echo > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP diff --git a/admin/missing b/admin/missing index 1c8ff7049..894e786e1 100755 --- a/admin/missing +++ b/admin/missing @@ -1,9 +1,9 @@ #! /bin/sh # Common stub for a few missing GNU programs while installing. -scriptversion=2006-05-10.23 +scriptversion=2005-06-08.21 -# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006 +# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996. @@ -33,8 +33,6 @@ if test $# -eq 0; then fi run=: -sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' -sed_minuso='s/.* -o \([^ ]*\).*/\1/p' # In the cases where this matters, `missing' is being run in the # srcdir already. @@ -46,7 +44,7 @@ fi msg="missing on your system" -case $1 in +case "$1" in --run) # Try to run requested program, and just exit if it succeeds. run= @@ -79,7 +77,6 @@ Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' - autom4te touch the output file, or create a stub one automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c @@ -109,7 +106,7 @@ esac # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). -case $1 in +case "$1" in lex|yacc) # Not GNU programs, they don't have --version. ;; @@ -138,7 +135,7 @@ esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. -case $1 in +case "$1" in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if @@ -167,7 +164,7 @@ WARNING: \`$1' is $msg. You should only need it if test -z "$files" && files="config.h" touch_files= for f in $files; do - case $f in + case "$f" in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; @@ -195,8 +192,8 @@ WARNING: \`$1' is needed, but is $msg. You can get \`$1' as part of \`Autoconf' from any GNU archive site." - file=`echo "$*" | sed -n "$sed_output"` - test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` + test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` if test -f "$file"; then touch $file else @@ -217,25 +214,25 @@ WARNING: \`$1' $msg. You should only need it if in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h - if test $# -ne 1; then + if [ $# -ne 1 ]; then eval LASTARG="\${$#}" - case $LASTARG in + case "$LASTARG" in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` - if test -f "$SRCFILE"; then + if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` - if test -f "$SRCFILE"; then + if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.h fi ;; esac fi - if test ! -f y.tab.h; then + if [ ! -f y.tab.h ]; then echo >y.tab.h fi - if test ! -f y.tab.c; then + if [ ! -f y.tab.c ]; then echo 'main() { return 0; }' >y.tab.c fi ;; @@ -247,18 +244,18 @@ WARNING: \`$1' is $msg. You should only need it if in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c - if test $# -ne 1; then + if [ $# -ne 1 ]; then eval LASTARG="\${$#}" - case $LASTARG in + case "$LASTARG" in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` - if test -f "$SRCFILE"; then + if [ -f "$SRCFILE" ]; then cp "$SRCFILE" lex.yy.c fi ;; esac fi - if test ! -f lex.yy.c; then + if [ ! -f lex.yy.c ]; then echo 'main() { return 0; }' >lex.yy.c fi ;; @@ -270,9 +267,11 @@ WARNING: \`$1' is $msg. You should only need it if \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." - file=`echo "$*" | sed -n "$sed_output"` - test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` - if test -f "$file"; then + file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` + if test -z "$file"; then + file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` + fi + if [ -f "$file" ]; then touch $file else test -z "$file" || exec >$file @@ -290,17 +289,11 @@ WARNING: \`$1' is $msg. You should only need it if DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... - file=`echo "$*" | sed -n "$sed_output"` - test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` - file=`sed -n ' - /^@setfilename/{ - s/.* \([^ ]*\) *$/\1/ - p - q - }' $infile` + file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi @@ -324,13 +317,13 @@ WARNING: \`$1' is $msg. You should only need it if fi firstarg="$1" if shift; then - case $firstarg in + case "$firstarg" in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac - case $firstarg in + case "$firstarg" in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 diff --git a/src/kvilib/build/Makefile.am b/src/kvilib/build/Makefile.am index 90d4b97e3..543fa68e7 100644 --- a/src/kvilib/build/Makefile.am +++ b/src/kvilib/build/Makefile.am @@ -183,22 +183,15 @@ headers_HEADERS = \ ../tal/kvi_tal_filedialog.h \ ../tal/kvi_tal_filedialog_kde.h \ ../tal/kvi_tal_filedialog_qt.h \ - ../tal/kvi_tal_filedialog_qt4.h \ ../tal/kvi_tal_grid.h \ - ../tal/kvi_tal_grid_qt3.h \ - ../tal/kvi_tal_grid_qt4.h \ ../tal/kvi_tal_groupbox.h \ ../tal/kvi_tal_groupbox_qt3.h \ ../tal/kvi_tal_groupbox_qt4.h \ ../tal/kvi_tal_hbox.h \ - ../tal/kvi_tal_hbox_qt3.h \ - ../tal/kvi_tal_hbox_qt4.h \ ../tal/kvi_tal_iconview.h \ ../tal/kvi_tal_iconview_qt3.h \ ../tal/kvi_tal_iconview_qt4.h \ ../tal/kvi_tal_listbox.h \ - ../tal/kvi_tal_listbox_qt3.h \ - ../tal/kvi_tal_listbox_qt4.h \ ../tal/kvi_tal_listview.h \ ../tal/kvi_tal_listview_qt3.h \ ../tal/kvi_tal_listview_qt4.h \ @@ -224,8 +217,6 @@ headers_HEADERS = \ ../tal/kvi_tal_toolbardocktype.h \ ../tal/kvi_tal_tooltip.h \ ../tal/kvi_tal_vbox.h \ - ../tal/kvi_tal_vbox_qt3.h \ - ../tal/kvi_tal_vbox_qt4.h \ ../tal/kvi_tal_widgetstack.h \ ../tal/kvi_tal_widgetstack_qt3.h \ ../tal/kvi_tal_widgetstack_qt4.h \ @@ -276,21 +267,16 @@ headers_HEADERS = \ ../tal/kvi_tal_menubar.cpp: ../tal/kvi_tal_menubar_qt.moc ../tal/kvi_tal_filedialog.cpp: ../tal/kvi_tal_filedialog_kde.moc ../tal/kvi_tal_filedialog.cpp: ../tal/kvi_tal_filedialog_qt.moc -../tal/kvi_tal_filedialog.cpp: ../tal/kvi_tal_filedialog_qt4.moc -../tal/kvi_tal_grid.cpp: ../tal/kvi_tal_grid_qt3.moc -../tal/kvi_tal_grid.cpp: ../tal/kvi_tal_grid_qt4.moc +../tal/kvi_tal_grid.cpp: ../tal/kvi_tal_grid.moc ../tal/kvi_tal_groupbox.cpp: ../tal/kvi_tal_groupbox_qt3.moc ../tal/kvi_tal_groupbox.cpp: ../tal/kvi_tal_groupbox_qt4.moc -../tal/kvi_tal_hbox.cpp: ../tal/kvi_tal_hbox_qt3.moc -../tal/kvi_tal_hbox.cpp: ../tal/kvi_tal_hbox_qt4.moc -../tal/kvi_tal_vbox.cpp: ../tal/kvi_tal_vbox_qt3.moc -../tal/kvi_tal_vbox.cpp: ../tal/kvi_tal_vbox_qt4.moc +../tal/kvi_tal_hbox.cpp: ../tal/kvi_tal_hbox.moc +../tal/kvi_tal_vbox.cpp: ../tal/kvi_tal_vbox.moc ../tal/kvi_tal_popupmenu.cpp: ../tal/kvi_tal_popupmenu_qt3.moc ../tal/kvi_tal_popupmenu.cpp: ../tal/kvi_tal_popupmenu_qt4.moc ../tal/kvi_tal_listview.cpp: ../tal/kvi_tal_listview_qt3.moc ../tal/kvi_tal_listview.cpp: ../tal/kvi_tal_listview_qt4.moc -../tal/kvi_tal_listbox.cpp: ../tal/kvi_tal_listbox_qt3.moc -../tal/kvi_tal_listbox.cpp: ../tal/kvi_tal_listbox_qt4.moc +../tal/kvi_tal_listbox.cpp: ../tal/kvi_tal_listbox.moc ../tal/kvi_tal_iconview.cpp: ../tal/kvi_tal_iconview_qt3.moc ../tal/kvi_tal_iconview.cpp: ../tal/kvi_tal_iconview_qt4.moc ../tal/kvi_tal_scrollview.cpp: ../tal/kvi_tal_scrollview.moc diff --git a/src/kvilib/config/kvi_settings.h b/src/kvilib/config/kvi_settings.h index 67f917005..ff6375078 100644 --- a/src/kvilib/config/kvi_settings.h +++ b/src/kvilib/config/kvi_settings.h @@ -96,7 +96,7 @@ #define KVI_BUILD_DATE BUILD_DATE #define KVI_BUILD_FLAGS BUILD_FLAGS -#define KVI_RELEASE_NAME "Virgo" +#define KVI_RELEASE_NAME "Insomnia" // We want _GNU_SOURCE features #ifndef _GNU_SOURCE diff --git a/src/kvilib/tal/kvi_tal_filedialog.cpp b/src/kvilib/tal/kvi_tal_filedialog.cpp index 8d15c27aa..305af0990 100644 --- a/src/kvilib/tal/kvi_tal_filedialog.cpp +++ b/src/kvilib/tal/kvi_tal_filedialog.cpp @@ -27,9 +27,58 @@ #include "kvi_tal_filedialog.h" -#ifdef COMPILE_USE_QT4 +#ifdef COMPILE_KDE_SUPPORT + + KviTalFileDialog::KviTalFileDialog(const QString &dirName,const QString &filter,QWidget *parent,const char *name,bool modal) + : KFileDialog(dirName,filter,parent,name,modal) + { + clearWFlags(WDestructiveClose); + } + + KviTalFileDialog::~KviTalFileDialog() + { + } + + void KviTalFileDialog::setFileMode(FileMode m) + { + switch(m) + { + case AnyFile: + setMode(KFile::File | KFile::LocalOnly); + setOperationMode(Saving); + break; + case ExistingFile: + setMode(KFile::File | KFile::ExistingOnly | KFile::LocalOnly); + setOperationMode(Opening); + break; + case ExistingFiles: + setMode(KFile::Files | KFile::ExistingOnly | KFile::LocalOnly); + setOperationMode(Opening); + break; + case Directory: + setMode(KFile::Directory); + break; + case DirectoryOnly: + setMode(KFile::Directory); + break; + default: + setMode(KFile::File | KFile::LocalOnly); + setOperationMode(Saving); + break; + } + } + + void KviTalFileDialog::setDirectory(const QString &szDirectory) + { + setURL(szDirectory); + } - #include <qdir.h> + + #include "kvi_tal_filedialog_kde.moc" + +#else + + #include <QDir> KviTalFileDialog::KviTalFileDialog(const QString &dirName,const QString &filter,QWidget *parent,const char *name,bool modal) : QFileDialog(parent,"",dirName,filter) @@ -72,105 +121,6 @@ } - #include "kvi_tal_filedialog_qt4.moc" - -#else + #include "kvi_tal_filedialog_qt.moc" - #ifdef COMPILE_KDE_SUPPORT - - KviTalFileDialog::KviTalFileDialog(const QString &dirName,const QString &filter,QWidget *parent,const char *name,bool modal) - : KFileDialog(dirName,filter,parent,name,modal) - { - clearWFlags(WDestructiveClose); - } - - KviTalFileDialog::~KviTalFileDialog() - { - } - - void KviTalFileDialog::setFileMode(FileMode m) - { - switch(m) - { - case AnyFile: - setMode(KFile::File | KFile::LocalOnly); - setOperationMode(Saving); - break; - case ExistingFile: - setMode(KFile::File | KFile::ExistingOnly | KFile::LocalOnly); - setOperationMode(Opening); - break; - case ExistingFiles: - setMode(KFile::Files | KFile::ExistingOnly | KFile::LocalOnly); - setOperationMode(Opening); - break; - case Directory: - setMode(KFile::Directory); - break; - case DirectoryOnly: - setMode(KFile::Directory); - break; - default: - setMode(KFile::File | KFile::LocalOnly); - setOperationMode(Saving); - break; - } - } - - void KviTalFileDialog::setDirectory(const QString &szDirectory) - { - setURL(szDirectory); - } - - - #include "kvi_tal_filedialog_kde.moc" - - #else - - #include <qdir.h> - - KviTalFileDialog::KviTalFileDialog(const QString &dirName,const QString &filter,QWidget *parent,const char *name,bool modal) - : QFileDialog(dirName,filter,parent,name,modal) - { - clearWFlags(WDestructiveClose); - } - - KviTalFileDialog::~KviTalFileDialog() - { - } - - void KviTalFileDialog::setFileMode(FileMode m) - { - switch(m) - { - case AnyFile: - setMode(QFileDialog::AnyFile); - break; - case ExistingFile: - setMode(QFileDialog::ExistingFile); - break; - case ExistingFiles: - setMode(QFileDialog::ExistingFiles); - break; - case Directory: - setMode(QFileDialog::Directory); - break; - case DirectoryOnly: - setMode(QFileDialog::DirectoryOnly); - break; - default: - setMode(QFileDialog::AnyFile); - break; - } - } - - void KviTalFileDialog::setDirectory(const QString &szDirectory) - { - setDir(QDir(szDirectory)); - } - - - #include "kvi_tal_filedialog_qt.moc" - - #endif #endif diff --git a/src/kvilib/tal/kvi_tal_filedialog.h b/src/kvilib/tal/kvi_tal_filedialog.h index 4de6b6f90..d6bb3dc2c 100644 --- a/src/kvilib/tal/kvi_tal_filedialog.h +++ b/src/kvilib/tal/kvi_tal_filedialog.h @@ -27,14 +27,10 @@ #include "kvi_settings.h" -#ifdef COMPILE_USE_QT4 - #include "kvi_tal_filedialog_qt4.h" +#ifdef COMPILE_KDE_SUPPORT + #include "kvi_tal_filedialog_kde.h" #else - #ifdef COMPILE_KDE_SUPPORT - #include "kvi_tal_filedialog_kde.h" - #else - #include "kvi_tal_filedialog_qt.h" - #endif + #include "kvi_tal_filedialog_qt.h" #endif #endif // _KVI_TAL_FILEDIALOG_H_ diff --git a/src/kvilib/tal/kvi_tal_filedialog_kde.h b/src/kvilib/tal/kvi_tal_filedialog_kde.h index 4670215a3..464768162 100644 --- a/src/kvilib/tal/kvi_tal_filedialog_kde.h +++ b/src/kvilib/tal/kvi_tal_filedialog_kde.h @@ -24,7 +24,7 @@ // #include <kfiledialog.h> -#include <qfiledialog.h> +#include <QFileDialog> class KVILIB_API KviTalFileDialog : public KFileDialog { diff --git a/src/kvilib/tal/kvi_tal_filedialog_qt.h b/src/kvilib/tal/kvi_tal_filedialog_qt.h index 931cd1206..4e57258b0 100644 --- a/src/kvilib/tal/kvi_tal_filedialog_qt.h +++ b/src/kvilib/tal/kvi_tal_filedialog_qt.h @@ -1,12 +1,13 @@ #ifndef _KVI_TAL_FILEDIALOG_QT_H_ #define _KVI_TAL_FILEDIALOG_QT_H_ +//============================================================================= // -// File : kvi_tal_filedialog_qt.h -// Creation date : Thu Aug 11 2003 04:43:58 by Szymon Stefanek +// File : kvi_tal_filedialog_qt4.h +// Creation date : Fri 19 Jan 2007 02:17:12 by Szymon Stefanek // // This file is part of the KVirc irc client distribution -// Copyright (C) 2003 Szymon Stefanek (pragma at kvirc dot net) +// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) // // This program is FREE software. You can redistribute it and/or // modify it under the terms of the GNU General Public License @@ -22,8 +23,9 @@ // along with this program. If not, write to the Free Software Foundation, // Inc. ,59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // +//============================================================================= -#include <qfiledialog.h> +#include <QFileDialog> class KVILIB_API KviTalFileDialog : public QFileDialog { @@ -38,7 +40,7 @@ public: void setDirectory(const QString &szDirectory); static QString getExistingDirectoryPath(const QString &dir = QString::null,const QString &caption = QString::null,QWidget *parent = 0) - { return getExistingDirectory(dir,parent,0 /* name */,caption); }; + { return getExistingDirectory(parent,caption,dir); }; }; #endif // _KVI_TAL_FILEDIALOG_QT_H_ diff --git a/src/kvilib/tal/kvi_tal_filedialog_qt4.h b/src/kvilib/tal/kvi_tal_filedialog_qt4.h deleted file mode 100644 index 7407cfec4..000000000 --- a/src/kvilib/tal/kvi_tal_filedialog_qt4.h +++ /dev/null @@ -1,46 +0,0 @@ -#ifndef _KVI_TAL_FILEDIALOG_QT4_H_ -#define _KVI_TAL_FILEDIALOG_QT4_H_ - -//============================================================================= -// -// File : kvi_tal_filedialog_qt4.h -// Creation date : Fri 19 Jan 2007 02:17:12 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// This program is FREE software. You can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your opinion) any later version. -// -// This program is distributed in the HOPE that it will be USEFUL, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -// See the GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, write to the Free Software Foundation, -// Inc. ,59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -//============================================================================= - -#include <qfiledialog.h> - -class KVILIB_API KviTalFileDialog : public QFileDialog -{ - Q_OBJECT -public: - KviTalFileDialog(const QString &dirName,const QString &filter = QString::null,QWidget *parent = 0,const char *name = 0,bool modal = FALSE); - ~KviTalFileDialog(); -public: - enum FileMode { AnyFile, ExistingFile, ExistingFiles, Directory, DirectoryOnly }; - - void setFileMode(FileMode m); - void setDirectory(const QString &szDirectory); - - static QString getExistingDirectoryPath(const QString &dir = QString::null,const QString &caption = QString::null,QWidget *parent = 0) - { return getExistingDirectory(parent,caption,dir); }; -}; - -#endif // _KVI_TAL_FILEDIALOG_QT_H_ diff --git a/src/kvilib/tal/kvi_tal_grid.cpp b/src/kvilib/tal/kvi_tal_grid.cpp index a72b06384..74b7bf986 100644 --- a/src/kvilib/tal/kvi_tal_grid.cpp +++ b/src/kvilib/tal/kvi_tal_grid.cpp @@ -25,10 +25,4 @@ #define __KVILIB__ #include "kvi_tal_grid.h" - -#ifdef COMPILE_USE_QT4 - #include "kvi_tal_grid_qt4.moc" -#else - #include "kvi_tal_grid_qt3.moc" -#endif - +#include "kvi_tal_grid.moc" diff --git a/src/kvilib/tal/kvi_tal_grid.h b/src/kvilib/tal/kvi_tal_grid.h index d0794b996..20fd95f4b 100644 --- a/src/kvilib/tal/kvi_tal_grid.h +++ b/src/kvilib/tal/kvi_tal_grid.h @@ -27,10 +27,16 @@ #include "kvi_settings.h" -#ifdef COMPILE_USE_QT4 - #include "kvi_tal_grid_qt4.h" -#else - #include "kvi_tal_grid_qt3.h" -#endif +#include <q3grid.h> +/* FIXME: #include <Q3Grid> */ + +class KVILIB_API KviTalGrid : public Q3Grid +{ + Q_OBJECT +public: + KviTalGrid(int n,Qt::Orientation orient,QWidget * pParent = 0) + : Q3Grid(n,orient,pParent) {}; + ~KviTalGrid() {}; +}; #endif // _KVI_TAL_GRID_H_ diff --git a/src/kvilib/tal/kvi_tal_grid_qt3.h b/src/kvilib/tal/kvi_tal_grid_qt3.h deleted file mode 100644 index b6163a280..000000000 --- a/src/kvilib/tal/kvi_tal_grid_qt3.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef _KVI_TAL_GRID_QT3_H_ -#define _KVI_TAL_GRID_QT3_H_ - -//============================================================================= -// -// File : kvi_tal_grid_qt3.h -// Creation date : Mon Jan 22 2007 11:25:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// This program is FREE software. You can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your opinion) any later version. -// -// This program is distributed in the HOPE that it will be USEFUL, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -// See the GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, write to the Free Software Foundation, -// Inc. ,59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -//============================================================================= - -#include <qgrid.h> - -class KVILIB_API KviTalGrid : public QGrid -{ - Q_OBJECT -public: - KviTalGrid(int n,Qt::Orientation orient,QWidget * pParent = 0) - : QGrid(n,orient,pParent) {}; - ~KviTalGrid() {}; -}; - -#endif // _KVI_TAL_GRID_QT3_H_ diff --git a/src/kvilib/tal/kvi_tal_grid_qt4.h b/src/kvilib/tal/kvi_tal_grid_qt4.h deleted file mode 100644 index c0c6938d0..000000000 --- a/src/kvilib/tal/kvi_tal_grid_qt4.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef _KVI_TAL_GRID_QT4_H_ -#define _KVI_TAL_GRID_QT4_H_ - -//============================================================================= -// -// File : kvi_tal_grid_qt4.h -// Creation date : Mon Jan 22 2007 11:25:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// This program is FREE software. You can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your opinion) any later version. -// -// This program is distributed in the HOPE that it will be USEFUL, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -// See the GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, write to the Free Software Foundation, -// Inc. ,59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -//============================================================================= - -#include "kvi_settings.h" - -#include <q3grid.h> - -class KVILIB_API KviTalGrid : public Q3Grid -{ - Q_OBJECT -public: - KviTalGrid(int n,Qt::Orientation orient,QWidget * pParent = 0) - : Q3Grid(n,orient,pParent) {}; - ~KviTalGrid() {}; -}; - -#endif // _KVI_TAL_GRID_QT4_H_ diff --git a/src/kvilib/tal/kvi_tal_hbox.cpp b/src/kvilib/tal/kvi_tal_hbox.cpp index 749664498..bbb419cbf 100644 --- a/src/kvilib/tal/kvi_tal_hbox.cpp +++ b/src/kvilib/tal/kvi_tal_hbox.cpp @@ -25,8 +25,46 @@ #define __KVILIB__ #include "kvi_tal_hbox.h" -#ifdef COMPILE_USE_QT4 - #include "kvi_tal_hbox_qt4.moc" -#else - #include "kvi_tal_hbox_qt3.moc" -#endif +#include <QChildEvent> + +KviTalHBox::KviTalHBox(QWidget * pParent,char* name) +: QWidget(pParent) +{ + this->setObjectName(name); + + m_pLayout = new QHBoxLayout(); + this->setLayout(m_pLayout); +} + +void KviTalHBox::childEvent(QChildEvent * e) +{ + if(!e->child()->isWidgetType()) return; + if(e->child()->parent() != this) return; + + switch(e->type()) + { + case QEvent::ChildAdded: + m_pLayout->addWidget((QWidget *)(e->child())); + break; + case QEvent::ChildRemoved: + m_pLayout->removeWidget((QWidget *)(e->child())); + break; + } +} + +void KviTalHBox::setStretchFactor(QWidget * child,int stretch) +{ + m_pLayout->setStretchFactor(child,stretch); +} + +void KviTalHBox::setSpacing(int spacing) +{ + m_pLayout->setSpacing(spacing); +} + +void KviTalHBox::setMargin(int margin) +{ + m_pLayout->setContentsMargins(margin,margin,margin,margin); +} + +#include "kvi_tal_hbox.moc" diff --git a/src/kvilib/tal/kvi_tal_hbox.h b/src/kvilib/tal/kvi_tal_hbox.h index 1122ea3d1..fded12a6e 100644 --- a/src/kvilib/tal/kvi_tal_hbox.h +++ b/src/kvilib/tal/kvi_tal_hbox.h @@ -27,10 +27,22 @@ #include "kvi_settings.h" -#ifdef COMPILE_USE_QT4 - #include "kvi_tal_hbox_qt4.h" -#else - #include "kvi_tal_hbox_qt3.h" -#endif +#include <QWidget> +#include <QHBoxLayout> + +class KVILIB_API KviTalHBox : public QWidget +{ + Q_OBJECT +public: + KviTalHBox(QWidget * pParent,char* name=0); + virtual ~KviTalHBox() {}; + void setStretchFactor(QWidget * child,int stretch); + void setSpacing(int spacing); + void setMargin(int margin); +protected: + virtual void childEvent(QChildEvent * e); +private: + QHBoxLayout * m_pLayout; +}; #endif // _KVI_TAL_HBOX_H_ diff --git a/src/kvilib/tal/kvi_tal_hbox_qt3.h b/src/kvilib/tal/kvi_tal_hbox_qt3.h deleted file mode 100644 index 2749143db..000000000 --- a/src/kvilib/tal/kvi_tal_hbox_qt3.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef _KVI_TAL_HBOX_QT3_H_ -#define _KVI_TAL_HBOX_QT3_H_ - -//============================================================================= -// -// File : kvi_tal_hbox_qt3.h -// Creation date : Mon Jan 22 2007 11:25:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// This program is FREE software. You can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your opinion) any later version. -// -// This program is distributed in the HOPE that it will be USEFUL, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -// See the GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, write to the Free Software Foundation, -// Inc. ,59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -//============================================================================= - -#include "kvi_settings.h" - -#include <qhbox.h> - -class KVILIB_API KviTalHBox : public QHBox -{ - Q_OBJECT -public: - KviTalHBox(QWidget * pParent) - : QHBox(pParent) {}; - virtual ~KviTalHBox() {}; -}; - -#endif // _KVI_TAL_HBOX_QT3_H_ diff --git a/src/kvilib/tal/kvi_tal_hbox_qt4.h b/src/kvilib/tal/kvi_tal_hbox_qt4.h deleted file mode 100644 index e58dbd20b..000000000 --- a/src/kvilib/tal/kvi_tal_hbox_qt4.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef _KVI_TAL_HBOX_QT4_H_ -#define _KVI_TAL_HBOX_QT4_H_ - -//============================================================================= -// -// File : kvi_tal_hbox_qt4.h -// Creation date : Mon Jan 22 2007 11:25:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// This program is FREE software. You can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your opinion) any later version. -// -// This program is distributed in the HOPE that it will be USEFUL, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -// See the GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, write to the Free Software Foundation, -// Inc. ,59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -//============================================================================= - -#include "kvi_settings.h" - -#include <q3hbox.h> - -class KVILIB_API KviTalHBox : public Q3HBox -{ - Q_OBJECT -public: - KviTalHBox(QWidget * pParent,char* name=0) - : Q3HBox(pParent,name) {}; - virtual ~KviTalHBox() {}; -}; - -#endif // _KVI_TAL_HBOX_QT4_H_ diff --git a/src/kvilib/tal/kvi_tal_listbox.cpp b/src/kvilib/tal/kvi_tal_listbox.cpp index 76eaa4dc7..58df1d22a 100644 --- a/src/kvilib/tal/kvi_tal_listbox.cpp +++ b/src/kvilib/tal/kvi_tal_listbox.cpp @@ -25,489 +25,241 @@ #define __KVILIB__ #include "kvi_tal_listbox.h" -#ifdef COMPILE_USE_QT4 - #include <qpainter.h> - #include <qstyle.h> - #include <qapplication.h> - - KviTalListBox::KviTalListBox(QWidget * pParent,Qt::WFlags f) - : Q3ListBox(pParent,0,f) - { - connect(this,SIGNAL(highlighted(Q3ListBoxItem *)),this,SLOT(redirect_highlighted(Q3ListBoxItem *))); - connect(this,SIGNAL(selected(Q3ListBoxItem *)),this,SLOT(redirect_selected(Q3ListBoxItem *))); - connect(this,SIGNAL(selectionChanged(Q3ListBoxItem *)),this,SLOT(redirect_selectionChanged(Q3ListBoxItem *))); - connect(this,SIGNAL(currentChanged(Q3ListBoxItem *)),this,SLOT(redirect_currentChanged(Q3ListBoxItem *))); - connect(this,SIGNAL(clicked(Q3ListBoxItem *)),this,SLOT(redirect_clicked(Q3ListBoxItem *))); - connect(this,SIGNAL(clicked(Q3ListBoxItem *,const QPoint &)),this,SLOT(redirect_clicked(Q3ListBoxItem *,const QPoint &))); - connect(this,SIGNAL(pressed(Q3ListBoxItem *)),this,SLOT(redirect_pressed(Q3ListBoxItem *))); - connect(this,SIGNAL(pressed(Q3ListBoxItem *,const QPoint &)),this,SLOT(redirect_pressed(Q3ListBoxItem *,const QPoint &))); - connect(this,SIGNAL(doubleClicked(Q3ListBoxItem *)),this,SLOT(redirect_doubleClicked(Q3ListBoxItem *))); - connect(this,SIGNAL(returnPressed(Q3ListBoxItem *)),this,SLOT(redirect_returnPressed(Q3ListBoxItem *))); - connect(this,SIGNAL(rightButtonClicked(Q3ListBoxItem *, const QPoint &)),this,SLOT(redirect_rightButtonClicked(Q3ListBoxItem *, const QPoint &))); - connect(this,SIGNAL(rightButtonPressed(Q3ListBoxItem *, const QPoint &)),this,SLOT(redirect_rightButtonPressed(Q3ListBoxItem *, const QPoint &))); - connect(this,SIGNAL(mouseButtonPressed(int,Q3ListBoxItem *,const QPoint &)),this,SLOT(redirect_mouseButtonPressed(int,Q3ListBoxItem *,const QPoint &))); - connect(this,SIGNAL(mouseButtonClicked(int,Q3ListBoxItem *,const QPoint &)),this,SLOT(redirect_mouseButtonClicked(int,Q3ListBoxItem *,const QPoint &))); - connect(this,SIGNAL(contextMenuRequested(Q3ListBoxItem *,const QPoint &)),this,SLOT(redirect_contextMenuRequested(Q3ListBoxItem *,const QPoint &))); - connect(this,SIGNAL(onItem(Q3ListBoxItem *)),this,SLOT(redirect_onItem(Q3ListBoxItem *))); - } +#include <QPainter> +#include <QStyle> +#include <QApplication> - void KviTalListBox::redirect_highlighted(Q3ListBoxItem *item) - { - emit highlighted((KviTalListBoxItem *)item); - } +KviTalListBox::KviTalListBox(QWidget * pParent,Qt::WFlags f) +: Q3ListBox(pParent,0,f) +{ + connect(this,SIGNAL(highlighted(Q3ListBoxItem *)),this,SLOT(redirect_highlighted(Q3ListBoxItem *))); + connect(this,SIGNAL(selected(Q3ListBoxItem *)),this,SLOT(redirect_selected(Q3ListBoxItem *))); + connect(this,SIGNAL(selectionChanged(Q3ListBoxItem *)),this,SLOT(redirect_selectionChanged(Q3ListBoxItem *))); + connect(this,SIGNAL(currentChanged(Q3ListBoxItem *)),this,SLOT(redirect_currentChanged(Q3ListBoxItem *))); + connect(this,SIGNAL(clicked(Q3ListBoxItem *)),this,SLOT(redirect_clicked(Q3ListBoxItem *))); + connect(this,SIGNAL(clicked(Q3ListBoxItem *,const QPoint &)),this,SLOT(redirect_clicked(Q3ListBoxItem *,const QPoint &))); + connect(this,SIGNAL(pressed(Q3ListBoxItem *)),this,SLOT(redirect_pressed(Q3ListBoxItem *))); + connect(this,SIGNAL(pressed(Q3ListBoxItem *,const QPoint &)),this,SLOT(redirect_pressed(Q3ListBoxItem *,const QPoint &))); + connect(this,SIGNAL(doubleClicked(Q3ListBoxItem *)),this,SLOT(redirect_doubleClicked(Q3ListBoxItem *))); + connect(this,SIGNAL(returnPressed(Q3ListBoxItem *)),this,SLOT(redirect_returnPressed(Q3ListBoxItem *))); + connect(this,SIGNAL(rightButtonClicked(Q3ListBoxItem *, const QPoint &)),this,SLOT(redirect_rightButtonClicked(Q3ListBoxItem *, const QPoint &))); + connect(this,SIGNAL(rightButtonPressed(Q3ListBoxItem *, const QPoint &)),this,SLOT(redirect_rightButtonPressed(Q3ListBoxItem *, const QPoint &))); + connect(this,SIGNAL(mouseButtonPressed(int,Q3ListBoxItem *,const QPoint &)),this,SLOT(redirect_mouseButtonPressed(int,Q3ListBoxItem *,const QPoint &))); + connect(this,SIGNAL(mouseButtonClicked(int,Q3ListBoxItem *,const QPoint &)),this,SLOT(redirect_mouseButtonClicked(int,Q3ListBoxItem *,const QPoint &))); + connect(this,SIGNAL(contextMenuRequested(Q3ListBoxItem *,const QPoint &)),this,SLOT(redirect_contextMenuRequested(Q3ListBoxItem *,const QPoint &))); + connect(this,SIGNAL(onItem(Q3ListBoxItem *)),this,SLOT(redirect_onItem(Q3ListBoxItem *))); +} - void KviTalListBox::redirect_selected(Q3ListBoxItem *item) - { - emit selected((KviTalListBoxItem *)item); - } +void KviTalListBox::redirect_highlighted(Q3ListBoxItem *item) +{ + emit highlighted((KviTalListBoxItem *)item); +} - void KviTalListBox::redirect_selectionChanged(Q3ListBoxItem * item) - { - emit selectionChanged((KviTalListBoxItem *)item); - } +void KviTalListBox::redirect_selected(Q3ListBoxItem *item) +{ + emit selected((KviTalListBoxItem *)item); +} - void KviTalListBox::redirect_currentChanged(Q3ListBoxItem * item) - { - emit currentChanged((KviTalListBoxItem *)item); - } - - void KviTalListBox::redirect_clicked(Q3ListBoxItem * item) - { - emit clicked((KviTalListBoxItem *)item); - } - - void KviTalListBox::redirect_clicked(Q3ListBoxItem * item,const QPoint & pnt) - { - emit clicked((KviTalListBoxItem *)item,pnt); - } +void KviTalListBox::redirect_selectionChanged(Q3ListBoxItem * item) +{ + emit selectionChanged((KviTalListBoxItem *)item); +} - void KviTalListBox::redirect_pressed(Q3ListBoxItem * item) - { - emit pressed((KviTalListBoxItem *)item); - } +void KviTalListBox::redirect_currentChanged(Q3ListBoxItem * item) +{ + emit currentChanged((KviTalListBoxItem *)item); +} - void KviTalListBox::redirect_pressed(Q3ListBoxItem * item,const QPoint & pnt) - { - emit pressed((KviTalListBoxItem *)item,pnt); - } +void KviTalListBox::redirect_clicked(Q3ListBoxItem * item) +{ + emit clicked((KviTalListBoxItem *)item); +} - void KviTalListBox::redirect_doubleClicked(Q3ListBoxItem * item) - { - emit doubleClicked((KviTalListBoxItem *)item); - } +void KviTalListBox::redirect_clicked(Q3ListBoxItem * item,const QPoint & pnt) +{ + emit clicked((KviTalListBoxItem *)item,pnt); +} - void KviTalListBox::redirect_returnPressed(Q3ListBoxItem * item) - { - emit returnPressed((KviTalListBoxItem *)item); - } +void KviTalListBox::redirect_pressed(Q3ListBoxItem * item) +{ + emit pressed((KviTalListBoxItem *)item); +} - void KviTalListBox::redirect_rightButtonClicked(Q3ListBoxItem * item, const QPoint &pnt) - { - emit rightButtonClicked((KviTalListBoxItem *)item,pnt); - } +void KviTalListBox::redirect_pressed(Q3ListBoxItem * item,const QPoint & pnt) +{ + emit pressed((KviTalListBoxItem *)item,pnt); +} - void KviTalListBox::redirect_rightButtonPressed(Q3ListBoxItem * item, const QPoint &pnt) - { - emit rightButtonPressed((KviTalListBoxItem *)item,pnt); - } +void KviTalListBox::redirect_doubleClicked(Q3ListBoxItem * item) +{ + emit doubleClicked((KviTalListBoxItem *)item); +} - void KviTalListBox::redirect_mouseButtonPressed(int button,Q3ListBoxItem * item,const QPoint & pos) - { - emit mouseButtonPressed(button,(KviTalListBoxItem *)item,pos); - } +void KviTalListBox::redirect_returnPressed(Q3ListBoxItem * item) +{ + emit returnPressed((KviTalListBoxItem *)item); +} - void KviTalListBox::redirect_mouseButtonClicked(int button,Q3ListBoxItem * item,const QPoint & pos) - { - emit mouseButtonClicked(button,(KviTalListBoxItem *)item,pos); - } +void KviTalListBox::redirect_rightButtonClicked(Q3ListBoxItem * item, const QPoint &pnt) +{ + emit rightButtonClicked((KviTalListBoxItem *)item,pnt); +} - void KviTalListBox::redirect_contextMenuRequested(Q3ListBoxItem * item,const QPoint & pos) - { - emit contextMenuRequested((KviTalListBoxItem *)item,pos); - } +void KviTalListBox::redirect_rightButtonPressed(Q3ListBoxItem * item, const QPoint &pnt) +{ + emit rightButtonPressed((KviTalListBoxItem *)item,pnt); +} - void KviTalListBox::redirect_onItem(Q3ListBoxItem * i) - { - emit onItem((KviTalListBoxItem *)i); - } +void KviTalListBox::redirect_mouseButtonPressed(int button,Q3ListBoxItem * item,const QPoint & pos) +{ + emit mouseButtonPressed(button,(KviTalListBoxItem *)item,pos); +} - KviTalListBoxText::KviTalListBoxText(KviTalListBox *listbox, const QString &text) - :KviTalListBoxItem(listbox) - { - setText(text); - } +void KviTalListBox::redirect_mouseButtonClicked(int button,Q3ListBoxItem * item,const QPoint & pos) +{ + emit mouseButtonClicked(button,(KviTalListBoxItem *)item,pos); +} - KviTalListBoxText::KviTalListBoxText(const QString &text) - :KviTalListBoxItem() - { - setText(text); - } - - KviTalListBoxText::KviTalListBoxText(KviTalListBox* listbox, const QString &text, KviTalListBoxItem *after) - : KviTalListBoxItem(listbox, after) - { - setText(text); - } - - KviTalListBoxText::~KviTalListBoxText() - { - } - - void KviTalListBoxText::paint(QPainter *painter) - { - int itemHeight = height(listBox()); - QFontMetrics fm = painter->fontMetrics(); - int yPos = ((itemHeight - fm.height()) / 2) + fm.ascent(); - painter->drawText(3, yPos, text()); - } - - int KviTalListBoxText::height(const KviTalListBox* lb) const - { - int h = lb ? lb->fontMetrics().lineSpacing() + 2 : 0; - return qMax(h, QApplication::globalStrut().height()); - } - - int KviTalListBoxText::width(const KviTalListBox* lb) const - { - int w = lb ? lb->fontMetrics().width(text()) + 6 : 0; - return qMax(w, QApplication::globalStrut().width()); - } - - int KviTalListBoxText::rtti() const - { - return RTTI; - } - - KviTalListBoxPixmap::KviTalListBoxPixmap(KviTalListBox* listbox, const QPixmap &pixmap) - : KviTalListBoxItem(listbox) - { - pm = pixmap; - } - - KviTalListBoxPixmap::KviTalListBoxPixmap(const QPixmap &pixmap) - : KviTalListBoxItem() - { - pm = pixmap; - } - - KviTalListBoxPixmap::KviTalListBoxPixmap(KviTalListBox* listbox, const QPixmap &pixmap, KviTalListBoxItem *after) - : KviTalListBoxItem(listbox, after) - { - pm = pixmap; - } - - KviTalListBoxPixmap::~KviTalListBoxPixmap() - { - } +void KviTalListBox::redirect_contextMenuRequested(Q3ListBoxItem * item,const QPoint & pos) +{ + emit contextMenuRequested((KviTalListBoxItem *)item,pos); +} - KviTalListBoxPixmap::KviTalListBoxPixmap(KviTalListBox* listbox, const QPixmap &pix, const QString& text) - : KviTalListBoxItem(listbox) - { - pm = pix; - setText(text); - } - - KviTalListBoxPixmap::KviTalListBoxPixmap(const QPixmap & pix, const QString& text) - : KviTalListBoxItem() - { - pm = pix; - setText(text); - } - - KviTalListBoxPixmap::KviTalListBoxPixmap(KviTalListBox* listbox, const QPixmap & pix, const QString& text, - KviTalListBoxItem *after) - : KviTalListBoxItem(listbox, after) - { - pm = pix; - setText(text); - } - - void KviTalListBoxPixmap::paint(QPainter *painter) - { - int itemHeight = height(listBox()); - int yPos; - - const QPixmap *pm = pixmap(); - if (pm && ! pm->isNull()) { - yPos = (itemHeight - pm->height()) / 2; - painter->drawPixmap(3, yPos, *pm); - } - - if (!text().isEmpty()) { - QFontMetrics fm = painter->fontMetrics(); - yPos = ((itemHeight - fm.height()) / 2) + fm.ascent(); - painter->drawText(pm->width() + 5, yPos, text()); - } - } - - int KviTalListBoxPixmap::height(const KviTalListBox* lb) const - { - int h; - if (text().isEmpty()) - h = pm.height(); - else - h = qMax(pm.height(), lb->fontMetrics().lineSpacing() + 2); - return qMax(h, QApplication::globalStrut().height()); - } - - int KviTalListBoxPixmap::width(const KviTalListBox* lb) const - { - if (text().isEmpty()) - return qMax(pm.width() + 6, QApplication::globalStrut().width()); - return qMax(pm.width() + lb->fontMetrics().width(text()) + 6, - QApplication::globalStrut().width()); - } - - int KviTalListBoxPixmap::rtti() const - { - return RTTI; - } - +void KviTalListBox::redirect_onItem(Q3ListBoxItem * i) +{ + emit onItem((KviTalListBoxItem *)i); +} - #include "kvi_tal_listbox_qt4.moc" -#else - #include <qpainter.h> - #include <qstyle.h> - #include <qapplication.h> +KviTalListBoxText::KviTalListBoxText(KviTalListBox *listbox, const QString &text) +:KviTalListBoxItem(listbox) +{ + setText(text); +} +KviTalListBoxText::KviTalListBoxText(const QString &text) +:KviTalListBoxItem() +{ + setText(text); +} - KviTalListBox::KviTalListBox(QWidget * pParent,Qt::WFlags f) - : QListBox(pParent,0,f) - { - connect(this,SIGNAL(highlighted(QListBoxItem *)),this,SLOT(redirect_highlighted(QListBoxItem *))); - connect(this,SIGNAL(selected(QListBoxItem *)),this,SLOT(redirect_selected(QListBoxItem *))); - connect(this,SIGNAL(selectionChanged(QListBoxItem *)),this,SLOT(redirect_selectionChanged(QListBoxItem *))); - connect(this,SIGNAL(currentChanged(QListBoxItem *)),this,SLOT(redirect_currentChanged(QListBoxItem *))); - connect(this,SIGNAL(clicked(QListBoxItem *)),this,SLOT(redirect_clicked(QListBoxItem *))); - connect(this,SIGNAL(clicked(QListBoxItem *,const QPoint &)),this,SLOT(redirect_clicked(QListBoxItem *,const QPoint &))); - connect(this,SIGNAL(pressed(QListBoxItem *)),this,SLOT(redirect_pressed(QListBoxItem *))); - connect(this,SIGNAL(pressed(QListBoxItem *,const QPoint &)),this,SLOT(redirect_pressed(QListBoxItem *,const QPoint &))); - connect(this,SIGNAL(doubleClicked(QListBoxItem *)),this,SLOT(redirect_doubleClicked(QListBoxItem *))); - connect(this,SIGNAL(returnPressed(QListBoxItem *)),this,SLOT(redirect_returnPressed(QListBoxItem *))); - connect(this,SIGNAL(rightButtonClicked(QListBoxItem *, const QPoint &)),this,SLOT(redirect_rightButtonClicked(QListBoxItem *, const QPoint &))); - connect(this,SIGNAL(rightButtonPressed(QListBoxItem *, const QPoint &)),this,SLOT(redirect_rightButtonPressed(QListBoxItem *, const QPoint &))); - connect(this,SIGNAL(mouseButtonPressed(int,QListBoxItem *,const QPoint &)),this,SLOT(redirect_mouseButtonPressed(int,QListBoxItem *,const QPoint &))); - connect(this,SIGNAL(mouseButtonClicked(int,QListBoxItem *,const QPoint &)),this,SLOT(redirect_mouseButtonClicked(int,QListBoxItem *,const QPoint &))); - connect(this,SIGNAL(contextMenuRequested(QListBoxItem *,const QPoint &)),this,SLOT(redirect_contextMenuRequested(QListBoxItem *,const QPoint &))); - connect(this,SIGNAL(onItem(QListBoxItem *)),this,SLOT(redirect_onItem(QListBoxItem *))); - } +KviTalListBoxText::KviTalListBoxText(KviTalListBox* listbox, const QString &text, KviTalListBoxItem *after) +: KviTalListBoxItem(listbox, after) +{ + setText(text); +} - void KviTalListBox::redirect_highlighted(QListBoxItem *item) - { - emit highlighted((KviTalListBoxItem *)item); - } +KviTalListBoxText::~KviTalListBoxText() +{ +} - void KviTalListBox::redirect_selected(QListBoxItem *item) - { - emit selected((KviTalListBoxItem *)item); - } +void KviTalListBoxText::paint(QPainter *painter) +{ + int itemHeight = height(listBox()); + QFontMetrics fm = painter->fontMetrics(); + int yPos = ((itemHeight - fm.height()) / 2) + fm.ascent(); + painter->drawText(3, yPos, text()); +} - void KviTalListBox::redirect_selectionChanged(QListBoxItem * item) - { - emit selectionChanged((KviTalListBoxItem *)item); - } +int KviTalListBoxText::height(const KviTalListBox* lb) const +{ + int h = lb ? lb->fontMetrics().lineSpacing() + 2 : 0; + return qMax(h, QApplication::globalStrut().height()); +} - void KviTalListBox::redirect_currentChanged(QListBoxItem * item) - { - emit currentChanged((KviTalListBoxItem *)item); - } +int KviTalListBoxText::width(const KviTalListBox* lb) const +{ + int w = lb ? lb->fontMetrics().width(text()) + 6 : 0; + return qMax(w, QApplication::globalStrut().width()); +} - void KviTalListBox::redirect_clicked(QListBoxItem * item) - { - emit clicked((KviTalListBoxItem *)item); - } +int KviTalListBoxText::rtti() const +{ + return RTTI; +} - void KviTalListBox::redirect_clicked(QListBoxItem * item,const QPoint & pnt) - { - emit clicked((KviTalListBoxItem *)item,pnt); - } +KviTalListBoxPixmap::KviTalListBoxPixmap(KviTalListBox* listbox, const QPixmap &pixmap) +: KviTalListBoxItem(listbox) +{ + pm = pixmap; +} - void KviTalListBox::redirect_pressed(QListBoxItem * item) - { - emit pressed((KviTalListBoxItem *)item); - } +KviTalListBoxPixmap::KviTalListBoxPixmap(const QPixmap &pixmap) +: KviTalListBoxItem() +{ + pm = pixmap; +} - void KviTalListBox::redirect_pressed(QListBoxItem * item,const QPoint & pnt) - { - emit pressed((KviTalListBoxItem *)item,pnt); - } +KviTalListBoxPixmap::KviTalListBoxPixmap(KviTalListBox* listbox, const QPixmap &pixmap, KviTalListBoxItem *after) +: KviTalListBoxItem(listbox, after) +{ + pm = pixmap; +} - void KviTalListBox::redirect_doubleClicked(QListBoxItem * item) - { - emit doubleClicked((KviTalListBoxItem *)item); - } +KviTalListBoxPixmap::~KviTalListBoxPixmap() +{ +} - void KviTalListBox::redirect_returnPressed(QListBoxItem * item) - { - emit returnPressed((KviTalListBoxItem *)item); - } +KviTalListBoxPixmap::KviTalListBoxPixmap(KviTalListBox* listbox, const QPixmap &pix, const QString& text) +: KviTalListBoxItem(listbox) +{ + pm = pix; + setText(text); +} - void KviTalListBox::redirect_rightButtonClicked(QListBoxItem * item, const QPoint &pnt) - { - emit rightButtonClicked((KviTalListBoxItem *)item,pnt); - } +KviTalListBoxPixmap::KviTalListBoxPixmap(const QPixmap & pix, const QString& text) +: KviTalListBoxItem() +{ + pm = pix; + setText(text); +} - void KviTalListBox::redirect_rightButtonPressed(QListBoxItem * item, const QPoint &pnt) - { - emit rightButtonPressed((KviTalListBoxItem *)item,pnt); - } +KviTalListBoxPixmap::KviTalListBoxPixmap(KviTalListBox* listbox, const QPixmap & pix, const QString& text,KviTalListBoxItem *after) +: KviTalListBoxItem(listbox, after) +{ + pm = pix; + setText(text); +} - void KviTalListBox::redirect_mouseButtonPressed(int button,QListBoxItem * item,const QPoint & pos) - { - emit mouseButtonPressed(button,(KviTalListBoxItem *)item,pos); - } +void KviTalListBoxPixmap::paint(QPainter *painter) +{ + int itemHeight = height(listBox()); + int yPos; - void KviTalListBox::redirect_mouseButtonClicked(int button,QListBoxItem * item,const QPoint & pos) - { - emit mouseButtonClicked(button,(KviTalListBoxItem *)item,pos); + const QPixmap *pm = pixmap(); + if (pm && ! pm->isNull()) { + yPos = (itemHeight - pm->height()) / 2; + painter->drawPixmap(3, yPos, *pm); } - void KviTalListBox::redirect_contextMenuRequested(QListBoxItem * item,const QPoint & pos) - { - emit contextMenuRequested((KviTalListBoxItem *)item,pos); + if (!text().isEmpty()) { + QFontMetrics fm = painter->fontMetrics(); + yPos = ((itemHeight - fm.height()) / 2) + fm.ascent(); + painter->drawText(pm->width() + 5, yPos, text()); } +} - void KviTalListBox::redirect_onItem(QListBoxItem * i) - { - emit onItem((KviTalListBoxItem *)i); - } +int KviTalListBoxPixmap::height(const KviTalListBox* lb) const +{ + int h; + if (text().isEmpty()) + h = pm.height(); + else + h = qMax(pm.height(), lb->fontMetrics().lineSpacing() + 2); + return qMax(h, QApplication::globalStrut().height()); +} - KviTalListBoxText::KviTalListBoxText( KviTalListBox *listbox, const QString &text ) - :KviTalListBoxItem( listbox ) - { - setText( text ); - } - - KviTalListBoxText::KviTalListBoxText( const QString &text ) - :KviTalListBoxItem() - { - setText( text ); - } - - KviTalListBoxText::KviTalListBoxText( KviTalListBox* listbox, const QString &text, KviTalListBoxItem *after ) - : KviTalListBoxItem( listbox, after ) - { - setText( text ); - } - - KviTalListBoxText::~KviTalListBoxText() - { - } - - void KviTalListBoxText::paint( QPainter *painter ) - { - int itemHeight = height( listBox() ); - QFontMetrics fm = painter->fontMetrics(); - int yPos = ( ( itemHeight - fm.height() ) / 2 ) + fm.ascent(); - painter->drawText( 3, yPos, text() ); - } - - int KviTalListBoxText::height( const KviTalListBox* lb ) const - { - int h = lb ? lb->fontMetrics().lineSpacing() + 2 : 0; - return QMAX( h, QApplication::globalStrut().height() ); - } - - int KviTalListBoxText::width( const KviTalListBox* lb ) const - { - int w = lb ? lb->fontMetrics().width( text() ) + 6 : 0; - return QMAX( w, QApplication::globalStrut().width() ); - } - - int KviTalListBoxText::RTTI = 1; - - int KviTalListBoxText::rtti() const - { - return RTTI; - } +int KviTalListBoxPixmap::width(const KviTalListBox* lb) const +{ + if (text().isEmpty()) + return qMax(pm.width() + 6, QApplication::globalStrut().width()); + return qMax(pm.width() + lb->fontMetrics().width(text()) + 6, + QApplication::globalStrut().width()); +} - KviTalListBoxPixmap::KviTalListBoxPixmap( KviTalListBox* listbox, const QPixmap &pixmap ) - : KviTalListBoxItem( listbox ) - { - pm = pixmap; - } - - KviTalListBoxPixmap::KviTalListBoxPixmap( const QPixmap &pixmap ) - : KviTalListBoxItem() - { - pm = pixmap; - } - - KviTalListBoxPixmap::KviTalListBoxPixmap( KviTalListBox* listbox, const QPixmap &pixmap, KviTalListBoxItem *after ) - : KviTalListBoxItem( listbox, after ) - { - pm = pixmap; - } - - KviTalListBoxPixmap::~KviTalListBoxPixmap() - { - } - - KviTalListBoxPixmap::KviTalListBoxPixmap( KviTalListBox* listbox, const QPixmap &pix, const QString& text) - : KviTalListBoxItem( listbox ) - { - pm = pix; - setText( text ); - } +int KviTalListBoxPixmap::rtti() const +{ + return RTTI; +} - KviTalListBoxPixmap::KviTalListBoxPixmap( const QPixmap & pix, const QString& text) - : KviTalListBoxItem() - { - pm = pix; - setText( text ); - } - - KviTalListBoxPixmap::KviTalListBoxPixmap( KviTalListBox* listbox, const QPixmap & pix, const QString& text, - KviTalListBoxItem *after ) - : KviTalListBoxItem( listbox, after ) - { - pm = pix; - setText( text ); - } - - void KviTalListBoxPixmap::paint( QPainter *painter ) - { - int itemHeight = height( listBox() ); - int yPos; - - const QPixmap *pm = pixmap(); - if ( pm && ! pm->isNull() ) { - yPos = ( itemHeight - pm->height() ) / 2; - painter->drawPixmap( 3, yPos, *pm); - } - - if ( !text().isEmpty() ) { - QFontMetrics fm = painter->fontMetrics(); - yPos = ( ( itemHeight - fm.height() ) / 2 ) + fm.ascent(); - painter->drawText( pm->width() + 5, yPos, text() ); - } - } - - int KviTalListBoxPixmap::height( const KviTalListBox* lb ) const - { - int h; - if ( text().isEmpty() ) - h = pm.height(); - else - h = QMAX( pm.height(), lb->fontMetrics().lineSpacing() + 2 ); - return QMAX( h, QApplication::globalStrut().height() ); - } - - int KviTalListBoxPixmap::width( const KviTalListBox* lb ) const - { - if ( text().isEmpty() ) - return QMAX( pm.width() + 6, QApplication::globalStrut().width() ); - return QMAX( pm.width() + lb->fontMetrics().width( text() ) + 6, - QApplication::globalStrut().width() ); - } - - int KviTalListBoxPixmap::RTTI = 2; - - int KviTalListBoxPixmap::rtti() const - { - return RTTI; - } - - #include "kvi_tal_listbox_qt3.moc" -#endif +#include "kvi_tal_listbox.moc" diff --git a/src/kvilib/tal/kvi_tal_listbox.h b/src/kvilib/tal/kvi_tal_listbox.h index 89c4af14c..912784c81 100644 --- a/src/kvilib/tal/kvi_tal_listbox.h +++ b/src/kvilib/tal/kvi_tal_listbox.h @@ -41,10 +41,122 @@ // present in qt 3.3.6 AND in qt 4.1.2. // -#ifdef COMPILE_USE_QT4 - #include "kvi_tal_listbox_qt4.h" -#else - #include "kvi_tal_listbox_qt3.h" -#endif +#include <q3listbox.h> + +class KviTalListBoxItem; + + +class KVILIB_API KviTalListBox : public Q3ListBox +{ + Q_OBJECT +public: + KviTalListBox(QWidget * pParent,Qt::WFlags f = 0); + virtual ~KviTalListBox() {}; +public: + KviTalListBoxItem * firstItem() const { return (KviTalListBoxItem *)Q3ListBox::firstItem(); }; + KviTalListBoxItem * selectedItem() const { return (KviTalListBoxItem *)Q3ListBox::selectedItem(); }; + KviTalListBoxItem * item(int iIndex) const { return (KviTalListBoxItem *)Q3ListBox::item(iIndex); }; +signals: + void highlighted(KviTalListBoxItem *); + void selected(KviTalListBoxItem *); + void selectionChanged(KviTalListBoxItem * item); + void currentChanged(KviTalListBoxItem * item); + void clicked(KviTalListBoxItem * item); + void clicked(KviTalListBoxItem * item,const QPoint & pnt); + void pressed(KviTalListBoxItem * item); + void pressed(KviTalListBoxItem * item,const QPoint & pnt); + void doubleClicked(KviTalListBoxItem * item); + void returnPressed(KviTalListBoxItem * item); + void rightButtonClicked(KviTalListBoxItem *, const QPoint &); + void rightButtonPressed(KviTalListBoxItem *, const QPoint &); + void mouseButtonPressed(int button,KviTalListBoxItem * item,const QPoint & pos); + void mouseButtonClicked(int button,KviTalListBoxItem * item,const QPoint & pos); + void contextMenuRequested(KviTalListBoxItem * item,const QPoint & pos); + void onItem(KviTalListBoxItem * i); +protected slots: + void redirect_highlighted(Q3ListBoxItem *); + void redirect_selected(Q3ListBoxItem *); + void redirect_selectionChanged(Q3ListBoxItem * item); + void redirect_currentChanged(Q3ListBoxItem * item); + void redirect_clicked(Q3ListBoxItem * item); + void redirect_clicked(Q3ListBoxItem * item,const QPoint & pnt); + void redirect_pressed(Q3ListBoxItem * item); + void redirect_pressed(Q3ListBoxItem * item,const QPoint & pnt); + void redirect_doubleClicked(Q3ListBoxItem * item); + void redirect_returnPressed(Q3ListBoxItem *); + void redirect_rightButtonClicked(Q3ListBoxItem *, const QPoint &); + void redirect_rightButtonPressed(Q3ListBoxItem *, const QPoint &); + void redirect_mouseButtonPressed(int button,Q3ListBoxItem * item,const QPoint & pos); + void redirect_mouseButtonClicked(int button,Q3ListBoxItem * item,const QPoint & pos); + void redirect_contextMenuRequested(Q3ListBoxItem * item,const QPoint & pos); + void redirect_onItem(Q3ListBoxItem * i); +}; + +class KVILIB_API KviTalListBoxItem : public Q3ListBoxItem +{ +public: + KviTalListBoxItem() + : Q3ListBoxItem() {}; + KviTalListBoxItem(KviTalListBox * pParent) + : Q3ListBoxItem(pParent) {}; + KviTalListBoxItem(KviTalListBox * pParent,KviTalListBoxItem * pAfter) + : Q3ListBoxItem(pParent,pAfter) {}; + virtual ~KviTalListBoxItem() {}; +public: + KviTalListBoxItem * next() const { return (KviTalListBoxItem *)Q3ListBoxItem::next(); }; + KviTalListBoxItem * prev() const { return (KviTalListBoxItem *)Q3ListBoxItem::prev(); }; + KviTalListBox * listBox() const { return (KviTalListBox *)Q3ListBoxItem::listBox(); }; + virtual int height(const KviTalListBox *) const { return 0; }; + int height(const Q3ListBox *lb) const { return height((KviTalListBox *)lb); }; + virtual int width(const KviTalListBox *) const { return 0; }; + int width(const Q3ListBox *lb) const { return width((KviTalListBox *)lb); }; +}; + + +class KVILIB_API KviTalListBoxText : public KviTalListBoxItem +{ +public: + KviTalListBoxText(KviTalListBox* listbox, const QString & text=QString()); + KviTalListBoxText(const QString & text=QString()); + KviTalListBoxText(KviTalListBox* listbox, const QString & text, KviTalListBoxItem *after); + ~KviTalListBoxText(); + + int height(const KviTalListBox *) const; + int width(const KviTalListBox *) const; + + int rtti() const; + enum { RTTI = 1 }; +protected: + virtual void paint(QPainter *); +private: + Q_DISABLE_COPY(KviTalListBoxText) +}; + + +class KVILIB_API KviTalListBoxPixmap : public KviTalListBoxItem +{ +public: + KviTalListBoxPixmap(KviTalListBox* listbox, const QPixmap &); + KviTalListBoxPixmap(const QPixmap &); + KviTalListBoxPixmap(KviTalListBox* listbox, const QPixmap & pix, KviTalListBoxItem *after); + KviTalListBoxPixmap(KviTalListBox* listbox, const QPixmap &, const QString&); + KviTalListBoxPixmap(const QPixmap &, const QString&); + KviTalListBoxPixmap(KviTalListBox* listbox, const QPixmap & pix, const QString&, KviTalListBoxItem *after); + ~KviTalListBoxPixmap(); + + const QPixmap *pixmap() const { return ± } + + int height(const KviTalListBox *) const; + int width(const KviTalListBox *) const; + + int rtti() const; + enum { RTTI = 2 }; +protected: + virtual void paint(QPainter *); +private: + Q_DISABLE_COPY(KviTalListBoxPixmap) + + QPixmap pm; +}; #endif // _KVI_TAL_LISTBOX_H_ diff --git a/src/kvilib/tal/kvi_tal_vbox.cpp b/src/kvilib/tal/kvi_tal_vbox.cpp index 6ac47d2f6..7e135570d 100644 --- a/src/kvilib/tal/kvi_tal_vbox.cpp +++ b/src/kvilib/tal/kvi_tal_vbox.cpp @@ -25,9 +25,46 @@ #define __KVILIB__ #include "kvi_tal_vbox.h" -#ifdef COMPILE_USE_QT4 - #include "kvi_tal_vbox_qt4.moc" -#else - #include "kvi_tal_vbox_qt3.moc" -#endif +#include <QChildEvent> +KviTalVBox::KviTalVBox(QWidget * pParent,char* name) +: QWidget(pParent) +{ + this->setObjectName(name); + + m_pLayout = new QVBoxLayout(); + this->setLayout(m_pLayout); +} + +void KviTalVBox::childEvent(QChildEvent * e) +{ + if(!e->child()->isWidgetType()) return; + if(e->child()->parent() != this) return; + + switch(e->type()) + { + case QEvent::ChildAdded: + m_pLayout->addWidget((QWidget *)(e->child())); + break; + case QEvent::ChildRemoved: + m_pLayout->removeWidget((QWidget *)(e->child())); + break; + } +} + +void KviTalVBox::setStretchFactor(QWidget * child,int stretch) +{ + m_pLayout->setStretchFactor(child,stretch); +} + +void KviTalVBox::setSpacing(int spacing) +{ + m_pLayout->setSpacing(spacing); +} + +void KviTalVBox::setMargin(int margin) +{ + m_pLayout->setContentsMargins(margin,margin,margin,margin); +} + +#include "kvi_tal_vbox.moc" diff --git a/src/kvilib/tal/kvi_tal_vbox.h b/src/kvilib/tal/kvi_tal_vbox.h index ee35a98d7..8ed46b8c3 100644 --- a/src/kvilib/tal/kvi_tal_vbox.h +++ b/src/kvilib/tal/kvi_tal_vbox.h @@ -27,10 +27,22 @@ #include "kvi_settings.h" -#ifdef COMPILE_USE_QT4 - #include "kvi_tal_vbox_qt4.h" -#else - #include "kvi_tal_vbox_qt3.h" -#endif +#include <QWidget> +#include <QVBoxLayout> + +class KVILIB_API KviTalVBox : public QWidget +{ + Q_OBJECT +public: + KviTalVBox(QWidget * pParent,char* name=0); + virtual ~KviTalVBox() {}; + void setStretchFactor(QWidget * child,int stretch); + void setSpacing(int spacing); + void setMargin(int margin); +protected: + virtual void childEvent(QChildEvent * e); +private: + QVBoxLayout * m_pLayout; +}; #endif // _KVI_TAL_VBOX_H_ diff --git a/src/kvilib/tal/kvi_tal_vbox_qt3.h b/src/kvilib/tal/kvi_tal_vbox_qt3.h deleted file mode 100644 index 1bd01bb2e..000000000 --- a/src/kvilib/tal/kvi_tal_vbox_qt3.h +++ /dev/null @@ -1,42 +0,0 @@ -#ifndef _KVI_TAL_VBOX_QT3_H_ -#define _KVI_TAL_VBOX_QT3_H_ - -//============================================================================= -// -// File : kvi_tal_vbox_qt3.h -// Creation date : Mon Jan 22 2007 11:25:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// This program is FREE software. You can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your opinion) any later version. -// -// This program is distributed in the HOPE that it will be USEFUL, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -// See the GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, write to the Free Software Foundation, -// Inc. ,59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -//============================================================================= - -#include "kvi_settings.h" - -#include <qvbox.h> - -class KVILIB_API KviTalVBox : public QVBox -{ - Q_OBJECT -public: - KviTalVBox(QWidget * pParent) - : QVBox(pParent) {}; - virtual ~KviTalVBox() {}; -}; - - -#endif // _KVI_TAL_VBOX_QT3_H_ diff --git a/src/kvilib/tal/kvi_tal_vbox_qt4.h b/src/kvilib/tal/kvi_tal_vbox_qt4.h deleted file mode 100644 index 661b25eed..000000000 --- a/src/kvilib/tal/kvi_tal_vbox_qt4.h +++ /dev/null @@ -1,42 +0,0 @@ -#ifndef _KVI_TAL_VBOX_QT4_H_ -#define _KVI_TAL_VBOX_QT4_H_ - -//============================================================================= -// -// File : kvi_tal_vbox_qt4.h -// Creation date : Mon Jan 22 2007 11:25:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// This program is FREE software. You can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your opinion) any later version. -// -// This program is distributed in the HOPE that it will be USEFUL, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -// See the GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, write to the Free Software Foundation, -// Inc. ,59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -//============================================================================= - -#include "kvi_settings.h" - -#include <q3vbox.h> - -class KVILIB_API KviTalVBox : public Q3VBox -{ - Q_OBJECT -public: - KviTalVBox(QWidget * pParent) - : Q3VBox(pParent) {}; - virtual ~KviTalVBox() {}; -}; - - -#endif // _KVI_TAL_VBOX_QT4_H_ diff --git a/src/kvirc/ui/kvi_input.h b/src/kvirc/ui/kvi_input.h index 0fd4031be..0e13ab214 100644 --- a/src/kvirc/ui/kvi_input.h +++ b/src/kvirc/ui/kvi_input.h @@ -26,14 +26,16 @@ //============================================================================= #include "kvi_settings.h" +#include "kvi_pointerlist.h" +#include "kvi_string.h" +#include "kvi_tal_hbox.h" #include <qwidget.h> -#include "kvi_tal_hbox.h" #include <qpixmap.h> -#include "kvi_pointerlist.h" +#include <QFrame> + -#include "kvi_string.h" //#include <qdialog.h> #include <qtoolbutton.h> diff --git a/src/modules/setup/libkvisetup.cpp b/src/modules/setup/libkvisetup.cpp index 701daf62a..49d629eb3 100644 --- a/src/modules/setup/libkvisetup.cpp +++ b/src/modules/setup/libkvisetup.cpp @@ -4,7 +4,7 @@ // Creation date : Sat Oct 6 02:08:24 2001 GMT by Szymon Stefanek // // This file is part of the KVirc irc client distribution -// Copyright (C) 2001-2004 Szymon Stefanek (pragma at kvirc dot net) +// Copyright (C) 2001-2008 Szymon Stefanek (pragma at kvirc dot net) // // This program is FREE software. You can redistribute it and/or // modify it under the terms of the GNU General Public License @@ -22,13 +22,9 @@ // //============================================================================= -#include "kvi_module.h" - #include "setupwizard.h" -#include <qstring.h> -#include <qfile.h> - +#include "kvi_module.h" #include "kvi_options.h" #include "kvi_defaults.h" #include "kvi_app.h" @@ -38,6 +34,10 @@ #include "kvi_theme.h" #include "kvi_ircserverdb.h" +#include <QString> +#include <QFile> + + // this will be choosen during the setup process QString g_szChoosenIncomingDirectory; //int g_iThemeToApply = THEME_APPLY_NONE; @@ -148,8 +148,8 @@ static bool setup_module_can_unload(KviModule *m) KVIRC_MODULE( "Setup wizard", - "1.0.0", - "Szymon Stefanek <pragma at kvirc dot net>" , + "4.0.0", + "Szymon Stefanek <pragma at kvirc dot net>", "First-time-run setup wizard", setup_module_init , setup_module_can_unload, diff --git a/src/modules/setup/setupwizard.cpp b/src/modules/setup/setupwizard.cpp index e22bc91f5..379351158 100644 --- a/src/modules/setup/setupwizard.cpp +++ b/src/modules/setup/setupwizard.cpp @@ -4,7 +4,7 @@ // Creation date : Sat Oct 6 02:06:53 2001 GMT by Szymon Stefanek // // This file is part of the KVirc irc client distribution -// Copyright (C) 2001-2004 Szymon Stefanek (pragma at kvirc dot net) +// Copyright (C) 2001-2008 Szymon Stefanek (pragma at kvirc dot net) // // This program is FREE software. You can redistribute it and/or // modify it under the terms of the GNU General Public License @@ -38,13 +38,15 @@ bool g_bFoundMirc; #include "kvi_config.h" #include <kvi_tal_textedit.h> -#include <qmessagebox.h> -#include <qdir.h> -#include <qpushbutton.h> -#include <qvalidator.h> -#include <qtextcodec.h> -#include <qlayout.h> -#include "kvi_tal_hbox.h" +#include "kvi_tal_hbox.h" + +#include <QMessageBox> +#include <QDir> +#include <QPushButton> +#include <QValidator> +#include <QTextCodec> +#include <QLayout> +#include <QDesktopWidget> #ifdef COMPILE_ON_WINDOWS #include <windows.h> @@ -55,9 +57,6 @@ bool g_bFoundMirc; #include <unistd.h> // for symlink() #endif -#ifdef COMPILE_USE_QT4 - #include <QDesktopWidget> -#endif // libkvisetup.cpp extern QString g_szChoosenIncomingDirectory; @@ -72,7 +71,7 @@ extern QString szMircIni; #ifdef COMPILE_ON_WINDOWS #define KVI_LOCAL_KVIRC_SUBDIRECTORY_NAME "KVIrc4" #else - #define KVI_LOCAL_KVIRC_SUBDIRECTORY_NAME ".kvirc4" + #define KVI_LOCAL_KVIRC_SUBDIRECTORY_NAME ".config/KVIrc" #endif KviSetupPage::KviSetupPage(KviSetupWizard * w) @@ -125,9 +124,7 @@ KviSetupPage::KviSetupPage(KviSetupWizard * w) l->setBackgroundColor(QColor(48,48,48)); m_pTextLabel = new QLabel(m_pVBox); -#ifdef COMPILE_USE_QT4 m_pTextLabel->setWordWrap(true); -#endif m_pTextLabel->setAlignment(Qt::AlignJustify | Qt::AlignTop); m_pVBox->setStretchFactor(m_pTextLabel,1); } @@ -184,13 +181,13 @@ KviSetupWizard::KviSetupWizard() #ifndef COMPILE_ON_WINDOWS //it have been already shown by installer KviSetupPage * m_pLicense = new KviSetupPage(this); m_pLicense->m_pTextLabel->setText(__tr2qs( \ - "<p>All of the files in this distribution are covered by the GPL. " \ - "In human terms this can be read as follows:<br>" \ - "<ul>" \ - "<li><b>KVIrc is free</b>, use it, have fun! <b>:)</b></li>" \ - "<li>If you use <b>any</b> part of KVIrc in your own project, you <b>must</b> release that project under the same license.</li>" \ - "</ul></p>" \ - "<p>The \"legalese\" version of the license is shown in the box below.</p>")); + "<p>All of the files in this distribution are covered by the GPL. " \ + "In human terms this can be read as follows:<br>" \ + "<ul>" \ + "<li><b>KVIrc is free</b>, use it, have fun! <b>:)</b></li>" \ + "<li>If you use <b>any</b> part of KVIrc in your own project, you <b>must</b> release that project under the same license.</li>" \ + "</ul></p>" \ + "<p>The \"legalese\" version of the license is shown in the box below.</p>")); KviTalTextEdit * ed = new KviTalTextEdit(m_pLicense->m_pVBox); ed->setReadOnly(true); @@ -201,8 +198,8 @@ KviSetupWizard::KviSetupWizard() if(!KviFileUtils::loadFile(szLicensePath,szLicense)) { szLicense = __tr("Oops... can't find the license file.\n" \ - "It MUST be included in the distribution...\n" \ - "Please report to <pragma at kvirc dot net>"); + "It MUST be included in the distribution...\n" \ + "Please report to <pragma at kvirc dot net>"); } ed->setText(szLicense); @@ -488,13 +485,13 @@ KviSetupWizard::KviSetupWizard() m_pDesktopIntegration = new KviSetupPage(this); szText = __tr2qs( \ - "<p>" \ - "Here you can choose how much KVIrc will integrate with " \ - "your system." \ - "<br><br>" \ - "The default settings are fine for most users so if " \ - "you're in doubt just click \"<b>Next</b>\" and go to the next screen." \ - "</p>"); + "<p>" \ + "Here you can choose how much KVIrc will integrate with " \ + "your system." \ + "<br><br>" \ + "The default settings are fine for most users so if " \ + "you're in doubt just click \"<b>Next</b>\" and go to the next screen." \ + "</p>"); m_pDesktopIntegration->m_pTextLabel->setText(szText); @@ -646,7 +643,7 @@ KviSetupWizard::KviSetupWizard() } free(buffer); -#endif +#endif // COMPILE_ON:WINDOWS //setMinimumSize(630,450); } @@ -722,6 +719,7 @@ void KviSetupWizard::newDirClicked() if(m_pDataPathEdit->text().isEmpty() || m_pIncomingPathEdit->text().isEmpty()) setNextEnabled(m_pDirectory,false); else setNextEnabled(m_pDirectory,true); } + void KviSetupWizard::chooseOldDataPath() { QString szBuffer = KviTalFileDialog::getExistingDirectoryPath(m_pDataPathEdit->text(),__tr2qs("Choose an Old Configuration Folder - KVIrc Setup"),0); @@ -789,19 +787,19 @@ void KviSetupWizard::makeLink() // otherwise there would be 150 lines for a stupid symlink!) HKEY hCU; - DWORD lpType; - ULONG ulSize = MAX_PATH; + DWORD lpType; + ULONG ulSize = MAX_PATH; char szLink[MAX_PATH]; // Dig in the registry looking up the Desktop path - if(RegOpenKeyEx(HKEY_CURRENT_USER, + if(RegOpenKeyEx(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", 0,KEY_QUERY_VALUE,&hCU) == ERROR_SUCCESS) { RegQueryValueEx(hCU,"Desktop",NULL,&lpType, - (unsigned char *)&szLink,&ulSize); + (unsigned char *)&szLink,&ulSize); RegCloseKey(hCU); - } + } // Build our paths QString szLinkTarget = szLink; @@ -816,8 +814,8 @@ void KviSetupWizard::makeLink() // Fiddle with an obscure shell interface IShellLink* psl; - // Get a pointer to the IShellLink interface: this is kinda ugly :) - if(CoCreateInstance(CLSID_ShellLink,NULL,CLSCTX_INPROC_SERVER, + // Get a pointer to the IShellLink interface: this is kinda ugly :) + if(CoCreateInstance(CLSID_ShellLink,NULL,CLSCTX_INPROC_SERVER, IID_IShellLink,(void **)&psl) == S_OK) { // just for fun , lookup another shell interface diff --git a/src/modules/setup/setupwizard.h b/src/modules/setup/setupwizard.h index 39e9ad81f..04e86f1cc 100644 --- a/src/modules/setup/setupwizard.h +++ b/src/modules/setup/setupwizard.h @@ -24,28 +24,30 @@ // //============================================================================= +#include "kvi_settings.h" +#include "kvi_string.h" +#include "kvi_selectors.h" #include <kvi_tal_wizard.h> #include "kvi_tal_vbox.h" #include "kvi_tal_hbox.h" #include "kvi_tal_groupbox.h" -#include <qlabel.h> -#include <qpixmap.h> -#include <qlineedit.h> -#ifdef COMPILE_USE_QT4 -#include <q3buttongroup.h> + +#include <QLabel> +#include <QPixmap> +#include <QLineEdit> +#include <QRadioButton> +#include <QComboBox> +#include <QCheckBox> +/* +#include <Q3ButtonGroup> #define KviTalVButtonGroup Q3VButtonGroup -#else - #include <qvbuttongroup.h> -#define KviTalVButtonGroup QVButtonGroup -#endif -#include <qradiobutton.h> -#include <qcombobox.h> -#include <qcheckbox.h> +*/ +/* FIXME: Qt4 */ +#include <QGroupBox> +#define KviTalVButtonGroup QGroupBox + -#include "kvi_settings.h" -#include "kvi_string.h" -#include "kvi_selectors.h" class KviSetupWizard; @@ -59,7 +61,6 @@ public: KviTalVBox * m_pVBox; QLabel * m_pPixmapLabel; QLabel * m_pTextLabel; - }; |
