Ticket #8272: filezilla.wx9.updated.3.diff
File filezilla.wx9.updated.3.diff, 66.3 KB (added by , 10 years ago) |
---|
-
configure.in
diff -r 0c89638d5302 -r c6f43e47a9eb configure.in
a b 95 95 AM_OPTIONS_WXCONFIG 96 96 97 97 MIN_WX_VERSION="2.8.12" 98 AM_PATH_WXCONFIG($MIN_WX_VERSION, wxWin=1, , [aui,xrc,adv,core,xml,net,base], [--unicode=yes --universal=no])98 WX_CONFIG_CHECK($MIN_WX_VERSION, wxWin=1, , [aui,html,xrc,adv,core,xml,net,base], [--unicode=yes --universal=no]) 99 99 if test "$wxWin" != 1; then 100 100 AC_MSG_ERROR([ 101 101 wxWidgets must be installed on your system … … 111 111 equivalent variable and wxWidgets version is $MIN_WX_VERSION or above. 112 112 ]) 113 113 fi 114 if test "$wx_config_major_version" -gt "2" || test "$wx_config_minor_version" -gt " 8"; then115 AC_MSG_ERROR([You need to use wxWidgets 2. 8.x to compile this program.])114 if test "$wx_config_major_version" -gt "2" || test "$wx_config_minor_version" -gt "9"; then 115 AC_MSG_ERROR([You need to use wxWidgets 2.9.x to compile this program.]) 116 116 fi 117 117 118 118 # --universal=no doesn't work correctly, it still accepts universal builds. Reject it manually here. -
m4/wxwin.m4
diff -r 0c89638d5302 -r c6f43e47a9eb m4/wxwin.m4
a b 1 dnl --------------------------------------------------------------------------- 2 dnl Author: wxWidgets development team, 3 dnl Francesco Montorsi, 4 dnl Bob McCown (Mac-testing) 5 dnl Creation date: 24/11/2001 6 dnl RCS-ID: $Id$ 7 dnl --------------------------------------------------------------------------- 8 9 dnl =========================================================================== 10 dnl Table of Contents of this macro file: 11 dnl ------------------------------------- 12 dnl 13 dnl SECTION A: wxWidgets main macros 14 dnl - WX_CONFIG_OPTIONS 15 dnl - WX_CONFIG_CHECK 16 dnl - WXRC_CHECK 17 dnl - WX_STANDARD_OPTIONS 18 dnl - WX_CONVERT_STANDARD_OPTIONS_TO_WXCONFIG_FLAGS 19 dnl - WX_DETECT_STANDARD_OPTION_VALUES 20 dnl 21 dnl SECTION B: wxWidgets-related utilities 22 dnl - WX_LIKE_LIBNAME 23 dnl - WX_ARG_ENABLE_YESNOAUTO 24 dnl - WX_ARG_WITH_YESNOAUTO 25 dnl 26 dnl SECTION C: messages to the user 27 dnl - WX_STANDARD_OPTIONS_SUMMARY_MSG 28 dnl - WX_STANDARD_OPTIONS_SUMMARY_MSG_BEGIN 29 dnl - WX_STANDARD_OPTIONS_SUMMARY_MSG_END 30 dnl - WX_BOOLOPT_SUMMARY 31 dnl 32 dnl The special "WX_DEBUG_CONFIGURE" variable can be set to 1 to enable extra 33 dnl debug output on stdout from these macros. 34 dnl =========================================================================== 35 36 1 37 dnl --------------------------------------------------------------------------- 2 38 dnl Macros for wxWidgets detection. Typically used in configure.in as: 3 39 dnl 4 40 dnl AC_ARG_ENABLE(...) 5 41 dnl AC_ARG_WITH(...) 6 42 dnl ... 7 dnl AM_OPTIONS_WXCONFIG43 dnl WX_CONFIG_OPTIONS 8 44 dnl ... 9 45 dnl ... 10 dnl AM_PATH_WXCONFIG(2.6.0, wxWin=1)46 dnl WX_CONFIG_CHECK([2.6.0], [wxWin=1]) 11 47 dnl if test "$wxWin" != 1; then 12 48 dnl AC_MSG_ERROR([ 13 49 dnl wxWidgets must be installed on your system … … 24 60 dnl CFLAGS="$CFLAGS $WX_CFLAGS_ONLY" 25 61 dnl 26 62 dnl LIBS="$LIBS $WX_LIBS" 63 dnl 64 dnl If you want to support standard --enable-debug/unicode/shared options, you 65 dnl may do the following: 66 dnl 67 dnl ... 68 dnl AC_CANONICAL_SYSTEM 69 dnl 70 dnl # define configure options 71 dnl WX_CONFIG_OPTIONS 72 dnl WX_STANDARD_OPTIONS([debug,unicode,shared,toolkit,wxshared]) 73 dnl 74 dnl # basic configure checks 75 dnl ... 76 dnl 77 dnl # we want to always have DEBUG==WX_DEBUG and UNICODE==WX_UNICODE 78 dnl WX_DEBUG=$DEBUG 79 dnl WX_UNICODE=$UNICODE 80 dnl 81 dnl WX_CONVERT_STANDARD_OPTIONS_TO_WXCONFIG_FLAGS 82 dnl WX_CONFIG_CHECK([2.8.0], [wxWin=1],,[html,core,net,base],[$WXCONFIG_FLAGS]) 83 dnl WX_DETECT_STANDARD_OPTION_VALUES 84 dnl 85 dnl # write the output files 86 dnl AC_CONFIG_FILES([Makefile ...]) 87 dnl AC_OUTPUT 88 dnl 89 dnl # optional: just to show a message to the user 90 dnl WX_STANDARD_OPTIONS_SUMMARY_MSG 91 dnl 27 92 dnl --------------------------------------------------------------------------- 28 93 94 29 95 dnl --------------------------------------------------------------------------- 30 dnl AM_OPTIONS_WXCONFIG96 dnl WX_CONFIG_OPTIONS 31 97 dnl 32 98 dnl adds support for --wx-prefix, --wx-exec-prefix, --with-wxdir and 33 99 dnl --wx-config command line options 34 100 dnl --------------------------------------------------------------------------- 35 101 36 AC_DEFUN([ AM_OPTIONS_WXCONFIG],102 AC_DEFUN([WX_CONFIG_OPTIONS], 37 103 [ 38 104 AC_ARG_WITH(wxdir, 39 105 [ --with-wxdir=PATH Use uninstalled version of wxWidgets in PATH], … … 76 142 ]) 77 143 78 144 dnl --------------------------------------------------------------------------- 79 dnl AM_PATH_WXCONFIG(VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND145 dnl WX_CONFIG_CHECK(VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND 80 146 dnl [, WX-LIBS [, ADDITIONAL-WX-CONFIG-FLAGS]]]]) 81 147 dnl 82 148 dnl Test for wxWidgets, and define WX_C*FLAGS, WX_LIBS and WX_LIBS_STATIC … … 86 152 dnl case the macro won't even waste time on tests for its existence. 87 153 dnl 88 154 dnl Optional WX-LIBS argument contains comma- or space-separated list of 89 dnl wxWidgets libraries to link against (it may include contrib libraries). If90 dnl it is not specified then WX_LIBS and WX_LIBS_STATIC will contain flags to91 dnl link with all of the corewxWidgets libraries.155 dnl wxWidgets libraries to link against. If it is not specified then WX_LIBS 156 dnl and WX_LIBS_STATIC will contain flags to link with all of the core 157 dnl wxWidgets libraries. 92 158 dnl 93 159 dnl Optional ADDITIONAL-WX-CONFIG-FLAGS argument is appended to wx-config 94 160 dnl invocation command in present. It can be used to fine-tune lookup of 95 161 dnl best wxWidgets build available. 96 162 dnl 97 163 dnl Example use: 98 dnl AM_PATH_WXCONFIG([2.6.0], [wxWin=1], [wxWin=0], [html,core,net]164 dnl WX_CONFIG_CHECK([2.6.0], [wxWin=1], [wxWin=0], [html,core,net] 99 165 dnl [--unicode --debug]) 100 166 dnl --------------------------------------------------------------------------- 101 167 102 168 dnl 103 169 dnl Get the cflags and libraries from the wx-config script 104 170 dnl 105 AC_DEFUN([ AM_PATH_WXCONFIG],171 AC_DEFUN([WX_CONFIG_CHECK], 106 172 [ 107 173 dnl do we have wx-config name: it can be wx-config or wxd-config or ... 108 174 if test x${WX_CONFIG_NAME+set} != xset ; then … … 145 211 AC_MSG_CHECKING([for wxWidgets version >= $min_wx_version ($5)]) 146 212 fi 147 213 148 WX_CONFIG_WITH_ARGS="$WX_CONFIG_PATH $wx_config_args $5 $4" 214 dnl don't add the libraries ($4) to this variable as this would result in 215 dnl an error when it's used with --version below 216 WX_CONFIG_WITH_ARGS="$WX_CONFIG_PATH $wx_config_args $5" 149 217 150 218 WX_VERSION=`$WX_CONFIG_WITH_ARGS --version 2>/dev/null` 151 219 wx_config_major_version=`echo $WX_VERSION | \ … … 167 235 [$wx_requested_micro_version]) 168 236 169 237 if test -n "$wx_ver_ok"; then 170 171 238 AC_MSG_RESULT(yes (version $WX_VERSION)) 172 WX_LIBS=`$WX_CONFIG_WITH_ARGS --libs `239 WX_LIBS=`$WX_CONFIG_WITH_ARGS --libs $4` 173 240 174 241 dnl is this even still appropriate? --static is a real option now 175 242 dnl and WX_CONFIG_WITH_ARGS is likely to contain it if that is 176 243 dnl what the user actually wants, making this redundant at best. 177 244 dnl For now keep it in case anyone actually used it in the past. 178 245 AC_MSG_CHECKING([for wxWidgets static library]) 179 WX_LIBS_STATIC=`$WX_CONFIG_WITH_ARGS --static --libs 2>/dev/null`246 WX_LIBS_STATIC=`$WX_CONFIG_WITH_ARGS --static --libs $4 2>/dev/null` 180 247 if test "x$WX_LIBS_STATIC" = "x"; then 181 248 AC_MSG_RESULT(no) 182 249 else … … 221 288 222 289 if test "x$wx_has_cppflags" = x ; then 223 290 dnl no choice but to define all flags like CFLAGS 224 WX_CFLAGS=`$WX_CONFIG_WITH_ARGS --cflags `291 WX_CFLAGS=`$WX_CONFIG_WITH_ARGS --cflags $4` 225 292 WX_CPPFLAGS=$WX_CFLAGS 226 293 WX_CXXFLAGS=$WX_CFLAGS 227 294 … … 229 296 WX_CXXFLAGS_ONLY=$WX_CFLAGS 230 297 else 231 298 dnl we have CPPFLAGS included in CFLAGS included in CXXFLAGS 232 WX_CPPFLAGS=`$WX_CONFIG_WITH_ARGS --cppflags `233 WX_CXXFLAGS=`$WX_CONFIG_WITH_ARGS --cxxflags `234 WX_CFLAGS=`$WX_CONFIG_WITH_ARGS --cflags `299 WX_CPPFLAGS=`$WX_CONFIG_WITH_ARGS --cppflags $4` 300 WX_CXXFLAGS=`$WX_CONFIG_WITH_ARGS --cxxflags $4` 301 WX_CFLAGS=`$WX_CONFIG_WITH_ARGS --cflags $4` 235 302 236 303 WX_CFLAGS_ONLY=`echo $WX_CFLAGS | sed "s@^$WX_CPPFLAGS *@@"` 237 304 WX_CXXFLAGS_ONLY=`echo $WX_CXXFLAGS | sed "s@^$WX_CFLAGS *@@"` … … 254 321 WX_LIBS="" 255 322 WX_LIBS_STATIC="" 256 323 WX_RESCOMP="" 257 ifelse([$3], , :, [$3]) 324 325 if test ! -z "$5"; then 326 327 wx_error_message=" 328 The configuration you asked for $PACKAGE_NAME requires a wxWidgets 329 build with the following settings: 330 $5 331 but such build is not available. 332 333 To see the wxWidgets builds available on this system, please use 334 'wx-config --list' command. To use the default build, returned by 335 'wx-config --selected-config', use the options with their 'auto' 336 default values." 337 338 fi 339 340 wx_error_message=" 341 The requested wxWidgets build couldn't be found. 342 $wx_error_message 343 344 If you still get this error, then check that 'wx-config' is 345 in path, the directory where wxWidgets libraries are installed 346 (returned by 'wx-config --libs' command) is in LD_LIBRARY_PATH 347 or equivalent variable and wxWidgets version is $1 or above." 348 349 ifelse([$3], , AC_MSG_ERROR([$wx_error_message]), [$3]) 258 350 259 351 fi 260 352 else … … 279 371 AC_SUBST(WX_LIBS_STATIC) 280 372 AC_SUBST(WX_VERSION) 281 373 AC_SUBST(WX_RESCOMP) 374 375 dnl need to export also WX_VERSION_MINOR and WX_VERSION_MAJOR symbols 376 dnl to support wxpresets bakefiles (we export also WX_VERSION_MICRO for completeness): 377 WX_VERSION_MAJOR="$wx_config_major_version" 378 WX_VERSION_MINOR="$wx_config_minor_version" 379 WX_VERSION_MICRO="$wx_config_micro_version" 380 AC_SUBST(WX_VERSION_MAJOR) 381 AC_SUBST(WX_VERSION_MINOR) 382 AC_SUBST(WX_VERSION_MICRO) 282 383 ]) 283 384 284 385 dnl --------------------------------------------------------------------------- … … 288 389 dnl AC_ARG_ENABLE(...) 289 390 dnl AC_ARG_WITH(...) 290 391 dnl ... 291 dnl AM_OPTIONS_WXCONFIG392 dnl WX_CONFIG_OPTIONS 292 393 dnl ... 293 dnl AM_PATH_WXCONFIG(2.6.0, wxWin=1)394 dnl WX_CONFIG_CHECK(2.6.0, wxWin=1) 294 395 dnl if test "$wxWin" != 1; then 295 396 dnl AC_MSG_ERROR([ 296 397 dnl wxWidgets must be installed on your system … … 303 404 dnl ]) 304 405 dnl fi 305 406 dnl 306 dnl AM_PATH_WXRC([HAVE_WXRC=1], [HAVE_WXRC=0])407 dnl WXRC_CHECK([HAVE_WXRC=1], [HAVE_WXRC=0]) 307 408 dnl if test "x$HAVE_WXRC" != x1; then 308 409 dnl AC_MSG_ERROR([ 309 410 dnl The wxrc program was not installed or not found. … … 319 420 dnl LDFLAGS="$LDFLAGS $WX_LIBS" 320 421 dnl --------------------------------------------------------------------------- 321 422 322 323 324 423 dnl --------------------------------------------------------------------------- 325 dnl AM_PATH_WXRC([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])424 dnl WXRC_CHECK([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) 326 425 dnl 327 426 dnl Test for wxWidgets' wxrc program for creating either C++, Python or XRS 328 427 dnl resources. The variable WXRC will be set and substituted in the configure 329 428 dnl script and Makefiles. 330 429 dnl 331 430 dnl Example use: 332 dnl AM_PATH_WXRC([wxrc=1], [wxrc=0])431 dnl WXRC_CHECK([wxrc=1], [wxrc=0]) 333 432 dnl --------------------------------------------------------------------------- 334 433 335 434 dnl 336 435 dnl wxrc program from the wx-config script 337 436 dnl 338 AC_DEFUN([ AM_PATH_WXRC],437 AC_DEFUN([WXRC_CHECK], 339 438 [ 340 439 AC_ARG_VAR([WXRC], [Path to wxWidget's wxrc resource compiler]) 341 440 … … 364 463 AC_SUBST(WXRC) 365 464 fi 366 465 ]) 466 467 dnl --------------------------------------------------------------------------- 468 dnl WX_LIKE_LIBNAME([output-var] [prefix], [name]) 469 dnl 470 dnl Sets the "output-var" variable to the name of a library named with same 471 dnl wxWidgets rule. 472 dnl E.g. for output-var=='lib', name=='test', prefix='mine', sets 473 dnl the $lib variable to: 474 dnl 'mine_gtk2ud_test-2.8' 475 dnl if WX_PORT=gtk2, WX_UNICODE=1, WX_DEBUG=1 and WX_RELEASE=28 476 dnl --------------------------------------------------------------------------- 477 AC_DEFUN([WX_LIKE_LIBNAME], 478 [ 479 wx_temp="$2""_""$WX_PORT" 480 481 dnl add the [u][d] string 482 if test "$WX_UNICODE" = "1"; then 483 wx_temp="$wx_temp""u" 484 fi 485 if test "$WX_DEBUG" = "1"; then 486 wx_temp="$wx_temp""d" 487 fi 488 489 dnl complete the name of the lib 490 wx_temp="$wx_temp""_""$3""-$WX_VERSION_MAJOR.$WX_VERSION_MINOR" 491 492 dnl save it in the user's variable 493 $1=$wx_temp 494 ]) 495 496 dnl --------------------------------------------------------------------------- 497 dnl WX_ARG_ENABLE_YESNOAUTO/WX_ARG_WITH_YESNOAUTO 498 dnl 499 dnl Two little custom macros which define the ENABLE/WITH configure arguments. 500 dnl Macro arguments: 501 dnl $1 = the name of the --enable / --with feature 502 dnl $2 = the name of the variable associated 503 dnl $3 = the description of that feature 504 dnl $4 = the default value for that feature 505 dnl $5 = additional action to do in case option is given with "yes" value 506 dnl --------------------------------------------------------------------------- 507 AC_DEFUN([WX_ARG_ENABLE_YESNOAUTO], 508 [AC_ARG_ENABLE($1, 509 AC_HELP_STRING([--enable-$1], [$3 (default is $4)]), 510 [], [enableval="$4"]) 511 512 dnl Show a message to the user about this option 513 AC_MSG_CHECKING([for the --enable-$1 option]) 514 if test "$enableval" = "yes" ; then 515 AC_MSG_RESULT([yes]) 516 $2=1 517 $5 518 elif test "$enableval" = "no" ; then 519 AC_MSG_RESULT([no]) 520 $2=0 521 elif test "$enableval" = "auto" ; then 522 AC_MSG_RESULT([will be automatically detected]) 523 $2="auto" 524 else 525 AC_MSG_ERROR([ 526 Unrecognized option value (allowed values: yes, no, auto) 527 ]) 528 fi 529 ]) 530 531 AC_DEFUN([WX_ARG_WITH_YESNOAUTO], 532 [AC_ARG_WITH($1, 533 AC_HELP_STRING([--with-$1], [$3 (default is $4)]), 534 [], [withval="$4"]) 535 536 dnl Show a message to the user about this option 537 AC_MSG_CHECKING([for the --with-$1 option]) 538 if test "$withval" = "yes" ; then 539 AC_MSG_RESULT([yes]) 540 $2=1 541 $5 542 dnl NB: by default we don't allow --with-$1=no option 543 dnl since it does not make much sense ! 544 elif test "$6" = "1" -a "$withval" = "no" ; then 545 AC_MSG_RESULT([no]) 546 $2=0 547 elif test "$withval" = "auto" ; then 548 AC_MSG_RESULT([will be automatically detected]) 549 $2="auto" 550 else 551 AC_MSG_ERROR([ 552 Unrecognized option value (allowed values: yes, auto) 553 ]) 554 fi 555 ]) 556 557 558 dnl --------------------------------------------------------------------------- 559 dnl WX_STANDARD_OPTIONS([options-to-add]) 560 dnl 561 dnl Adds to the configure script one or more of the following options: 562 dnl --enable-[debug|unicode|shared|wxshared|wxdebug] 563 dnl --with-[gtk|msw|motif|x11|mac|dfb] 564 dnl --with-wxversion 565 dnl Then checks for their presence and eventually set the DEBUG, UNICODE, SHARED, 566 dnl PORT, WX_SHARED, WX_DEBUG, variables to one of the "yes", "no", "auto" values. 567 dnl 568 dnl Note that e.g. UNICODE != WX_UNICODE; the first is the value of the 569 dnl --enable-unicode option (in boolean format) while the second indicates 570 dnl if wxWidgets was built in Unicode mode (and still is in boolean format). 571 dnl --------------------------------------------------------------------------- 572 AC_DEFUN([WX_STANDARD_OPTIONS], 573 [ 574 575 dnl the following lines will expand to WX_ARG_ENABLE_YESNOAUTO calls if and only if 576 dnl the $1 argument contains respectively the debug,unicode or shared options. 577 578 dnl be careful here not to set debug flag if only "wxdebug" was specified 579 ifelse(regexp([$1], [\bdebug]), [-1],, 580 [WX_ARG_ENABLE_YESNOAUTO([debug], [DEBUG], [Build in debug mode], [auto])]) 581 582 ifelse(index([$1], [unicode]), [-1],, 583 [WX_ARG_ENABLE_YESNOAUTO([unicode], [UNICODE], [Build in Unicode mode], [auto])]) 584 585 ifelse(regexp([$1], [\bshared]), [-1],, 586 [WX_ARG_ENABLE_YESNOAUTO([shared], [SHARED], [Build as shared library], [auto])]) 587 588 dnl WX_ARG_WITH_YESNOAUTO cannot be used for --with-toolkit since it's an option 589 dnl which must be able to accept the auto|gtk1|gtk2|msw|... values 590 ifelse(index([$1], [toolkit]), [-1],, 591 [ 592 AC_ARG_WITH([toolkit], 593 AC_HELP_STRING([--with-toolkit], 594 [Build against a specific wxWidgets toolkit (default is auto)]), 595 [], [withval="auto"]) 596 597 dnl Show a message to the user about this option 598 AC_MSG_CHECKING([for the --with-toolkit option]) 599 if test "$withval" = "auto" ; then 600 AC_MSG_RESULT([will be automatically detected]) 601 TOOLKIT="auto" 602 else 603 TOOLKIT="$withval" 604 605 dnl PORT must be one of the allowed values 606 if test "$TOOLKIT" != "gtk1" -a "$TOOLKIT" != "gtk2" -a \ 607 "$TOOLKIT" != "msw" -a "$TOOLKIT" != "motif" -a \ 608 "$TOOLKIT" != "osx_carbon" -a "$TOOLKIT" != "osx_cocoa" -a \ 609 "$TOOLKIT" != "dfb" -a "$TOOLKIT" != "x11"; then 610 AC_MSG_ERROR([ 611 Unrecognized option value (allowed values: auto, gtk1, gtk2, msw, motif, osx_carbon, osx_cocoa, dfb, x11) 612 ]) 613 fi 614 615 AC_MSG_RESULT([$TOOLKIT]) 616 fi 617 ]) 618 619 dnl ****** IMPORTANT ******* 620 dnl Unlike for the UNICODE setting, you can build your program in 621 dnl shared mode against a static build of wxWidgets. Thus we have the 622 dnl following option which allows these mixtures. E.g. 623 dnl 624 dnl ./configure --disable-shared --with-wxshared 625 dnl 626 dnl will build your library in static mode against the first available 627 dnl shared build of wxWidgets. 628 dnl 629 dnl Note that's not possible to do the viceversa: 630 dnl 631 dnl ./configure --enable-shared --without-wxshared 632 dnl 633 dnl Doing so you would try to build your library in shared mode against a static 634 dnl build of wxWidgets. This is not possible (you would mix PIC and non PIC code) ! 635 dnl A check for this combination of options is in WX_DETECT_STANDARD_OPTION_VALUES 636 dnl (where we know what 'auto' should be expanded to). 637 dnl 638 dnl If you try to build something in ANSI mode against a UNICODE build 639 dnl of wxWidgets or in RELEASE mode against a DEBUG build of wxWidgets, 640 dnl then at best you'll get ton of linking errors ! 641 dnl ************************ 642 643 ifelse(index([$1], [wxshared]), [-1],, 644 [ 645 WX_ARG_WITH_YESNOAUTO( 646 [wxshared], [WX_SHARED], 647 [Force building against a shared build of wxWidgets, even if --disable-shared is given], 648 [auto], [], [1]) 649 ]) 650 651 dnl Just like for SHARED and WX_SHARED it may happen that some adventurous 652 dnl peoples will want to mix a wxWidgets release build with a debug build of 653 dnl his app/lib. So, we have both DEBUG and WX_DEBUG variables. 654 ifelse(index([$1], [wxdebug]), [-1],, 655 [ 656 WX_ARG_WITH_YESNOAUTO( 657 [wxdebug], [WX_DEBUG], 658 [Force building against a debug build of wxWidgets, even if --disable-debug is given], 659 [auto], [], [1]) 660 ]) 661 662 dnl WX_ARG_WITH_YESNOAUTO cannot be used for --with-wxversion since it's an option 663 dnl which accepts the "auto|2.6|2.7|2.8|2.9|3.0" etc etc values 664 ifelse(index([$1], [wxversion]), [-1],, 665 [ 666 AC_ARG_WITH([wxversion], 667 AC_HELP_STRING([--with-wxversion], 668 [Build against a specific version of wxWidgets (default is auto)]), 669 [], [withval="auto"]) 670 671 dnl Show a message to the user about this option 672 AC_MSG_CHECKING([for the --with-wxversion option]) 673 if test "$withval" = "auto" ; then 674 AC_MSG_RESULT([will be automatically detected]) 675 WX_RELEASE="auto" 676 else 677 678 wx_requested_major_version=`echo $withval | \ 679 sed 's/\([[0-9]]*\).\([[0-9]]*\).*/\1/'` 680 wx_requested_minor_version=`echo $withval | \ 681 sed 's/\([[0-9]]*\).\([[0-9]]*\).*/\2/'` 682 683 dnl both vars above must be exactly 1 digit 684 if test "${#wx_requested_major_version}" != "1" -o \ 685 "${#wx_requested_minor_version}" != "1" ; then 686 AC_MSG_ERROR([ 687 Unrecognized option value (allowed values: auto, 2.6, 2.7, 2.8, 2.9, 3.0) 688 ]) 689 fi 690 691 WX_RELEASE="$wx_requested_major_version"".""$wx_requested_minor_version" 692 AC_MSG_RESULT([$WX_RELEASE]) 693 fi 694 ]) 695 696 if test "$WX_DEBUG_CONFIGURE" = "1"; then 697 echo "[[dbg]] DEBUG: $DEBUG, WX_DEBUG: $WX_DEBUG" 698 echo "[[dbg]] UNICODE: $UNICODE, WX_UNICODE: $WX_UNICODE" 699 echo "[[dbg]] SHARED: $SHARED, WX_SHARED: $WX_SHARED" 700 echo "[[dbg]] TOOLKIT: $TOOLKIT, WX_TOOLKIT: $WX_TOOLKIT" 701 echo "[[dbg]] VERSION: $VERSION, WX_RELEASE: $WX_RELEASE" 702 fi 703 ]) 704 705 706 dnl --------------------------------------------------------------------------- 707 dnl WX_CONVERT_STANDARD_OPTIONS_TO_WXCONFIG_FLAGS 708 dnl 709 dnl Sets the WXCONFIG_FLAGS string using the SHARED,DEBUG,UNICODE variable values 710 dnl which are different from "auto". 711 dnl Thus this macro needs to be called only once all options have been set. 712 dnl --------------------------------------------------------------------------- 713 AC_DEFUN([WX_CONVERT_STANDARD_OPTIONS_TO_WXCONFIG_FLAGS], 714 [ 715 if test "$WX_SHARED" = "1" ; then 716 WXCONFIG_FLAGS="--static=no " 717 elif test "$WX_SHARED" = "0" ; then 718 WXCONFIG_FLAGS="--static=yes " 719 fi 720 721 if test "$WX_DEBUG" = "1" ; then 722 WXCONFIG_FLAGS="$WXCONFIG_FLAGS""--debug=yes " 723 elif test "$WX_DEBUG" = "0" ; then 724 WXCONFIG_FLAGS="$WXCONFIG_FLAGS""--debug=no " 725 fi 726 727 dnl The user should have set WX_UNICODE=UNICODE 728 if test "$WX_UNICODE" = "1" ; then 729 WXCONFIG_FLAGS="$WXCONFIG_FLAGS""--unicode=yes " 730 elif test "$WX_UNICODE" = "0" ; then 731 WXCONFIG_FLAGS="$WXCONFIG_FLAGS""--unicode=no " 732 fi 733 734 if test "$TOOLKIT" != "auto" ; then 735 WXCONFIG_FLAGS="$WXCONFIG_FLAGS""--toolkit=$TOOLKIT " 736 fi 737 738 if test "$WX_RELEASE" != "auto" ; then 739 WXCONFIG_FLAGS="$WXCONFIG_FLAGS""--version=$WX_RELEASE " 740 fi 741 742 dnl strip out the last space of the string 743 WXCONFIG_FLAGS=${WXCONFIG_FLAGS% } 744 745 if test "$WX_DEBUG_CONFIGURE" = "1"; then 746 echo "[[dbg]] WXCONFIG_FLAGS: $WXCONFIG_FLAGS" 747 fi 748 ]) 749 750 751 dnl --------------------------------------------------------------------------- 752 dnl _WX_SELECTEDCONFIG_CHECKFOR([RESULTVAR], [STRING], [MSG] 753 dnl [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) 754 dnl 755 dnl Outputs the given MSG. Then searches the given STRING in the wxWidgets 756 dnl additional CPP flags and put the result of the search in WX_$RESULTVAR 757 dnl also adding the "yes" or "no" message result to MSG. 758 dnl --------------------------------------------------------------------------- 759 AC_DEFUN([_WX_SELECTEDCONFIG_CHECKFOR], 760 [ 761 if test "$$1" = "auto" ; then 762 763 dnl The user does not have particular preferences for this option; 764 dnl so we will detect the wxWidgets relative build setting and use it 765 AC_MSG_CHECKING([$3]) 766 767 dnl set WX_$1 variable to 1 if the $WX_SELECTEDCONFIG contains the $2 768 dnl string or to 0 otherwise. 769 dnl NOTE: 'expr match STRING REGEXP' cannot be used since on Mac it 770 dnl doesn't work; we use 'expr STRING : REGEXP' instead 771 WX_$1=$(expr "$WX_SELECTEDCONFIG" : ".*$2.*") 772 773 if test "$WX_$1" != "0"; then 774 WX_$1=1 775 AC_MSG_RESULT([yes]) 776 ifelse([$4], , :, [$4]) 777 else 778 WX_$1=0 779 AC_MSG_RESULT([no]) 780 ifelse([$5], , :, [$5]) 781 fi 782 else 783 784 dnl Use the setting given by the user 785 WX_$1=$$1 786 fi 787 ]) 788 789 dnl --------------------------------------------------------------------------- 790 dnl WX_DETECT_STANDARD_OPTION_VALUES 791 dnl 792 dnl Detects the values of the following variables: 793 dnl 1) WX_RELEASE 794 dnl 2) WX_UNICODE 795 dnl 3) WX_DEBUG 796 dnl 4) WX_SHARED (and also WX_STATIC) 797 dnl 5) WX_PORT 798 dnl from the previously selected wxWidgets build; this macro in fact must be 799 dnl called *after* calling the WX_CONFIG_CHECK macro. 800 dnl 801 dnl Note that the WX_VERSION_MAJOR, WX_VERSION_MINOR symbols are already set 802 dnl by WX_CONFIG_CHECK macro 803 dnl --------------------------------------------------------------------------- 804 AC_DEFUN([WX_DETECT_STANDARD_OPTION_VALUES], 805 [ 806 dnl IMPORTANT: WX_VERSION contains all three major.minor.micro digits, 807 dnl while WX_RELEASE only the major.minor ones. 808 WX_RELEASE="$WX_VERSION_MAJOR""$WX_VERSION_MINOR" 809 if test $WX_RELEASE -lt 26 ; then 810 811 AC_MSG_ERROR([ 812 Cannot detect the wxWidgets configuration for the selected wxWidgets build 813 since its version is $WX_VERSION < 2.6.0; please install a newer 814 version of wxWidgets. 815 ]) 816 fi 817 818 dnl The wx-config we are using understands the "--selected_config" 819 dnl option which returns an easy-parseable string ! 820 WX_SELECTEDCONFIG=$($WX_CONFIG_WITH_ARGS --selected_config) 821 822 if test "$WX_DEBUG_CONFIGURE" = "1"; then 823 echo "[[dbg]] Using wx-config --selected-config" 824 echo "[[dbg]] WX_SELECTEDCONFIG: $WX_SELECTEDCONFIG" 825 fi 826 827 828 dnl we could test directly for WX_SHARED with a line like: 829 dnl _WX_SELECTEDCONFIG_CHECKFOR([SHARED], [shared], 830 dnl [if wxWidgets was built in SHARED mode]) 831 dnl but wx-config --selected-config DOES NOT outputs the 'shared' 832 dnl word when wx was built in shared mode; it rather outputs the 833 dnl 'static' word when built in static mode. 834 if test $WX_SHARED = "1"; then 835 STATIC=0 836 elif test $WX_SHARED = "0"; then 837 STATIC=1 838 elif test $WX_SHARED = "auto"; then 839 STATIC="auto" 840 fi 841 842 dnl Now set the WX_UNICODE, WX_DEBUG, WX_STATIC variables 843 _WX_SELECTEDCONFIG_CHECKFOR([UNICODE], [unicode], 844 [if wxWidgets was built with UNICODE enabled]) 845 _WX_SELECTEDCONFIG_CHECKFOR([DEBUG], [debug], 846 [if wxWidgets was built in DEBUG mode]) 847 _WX_SELECTEDCONFIG_CHECKFOR([STATIC], [static], 848 [if wxWidgets was built in STATIC mode]) 849 850 dnl init WX_SHARED from WX_STATIC 851 if test "$WX_STATIC" != "0"; then 852 WX_SHARED=0 853 else 854 WX_SHARED=1 855 fi 856 857 AC_SUBST(WX_UNICODE) 858 AC_SUBST(WX_DEBUG) 859 AC_SUBST(WX_SHARED) 860 861 dnl detect the WX_PORT to use 862 if test "$TOOLKIT" = "auto" ; then 863 864 dnl The user does not have particular preferences for this option; 865 dnl so we will detect the wxWidgets relative build setting and use it 866 AC_MSG_CHECKING([which wxWidgets toolkit was selected]) 867 868 WX_GTKPORT1=$(expr "$WX_SELECTEDCONFIG" : ".*gtk1.*") 869 WX_GTKPORT2=$(expr "$WX_SELECTEDCONFIG" : ".*gtk2.*") 870 WX_MSWPORT=$(expr "$WX_SELECTEDCONFIG" : ".*msw.*") 871 WX_MOTIFPORT=$(expr "$WX_SELECTEDCONFIG" : ".*motif.*") 872 WX_OSXCOCOAPORT=$(expr "$WX_SELECTEDCONFIG" : ".*osx_cocoa.*") 873 WX_OSXCARBONPORT=$(expr "$WX_SELECTEDCONFIG" : ".*osx_carbon.*") 874 WX_X11PORT=$(expr "$WX_SELECTEDCONFIG" : ".*x11.*") 875 WX_DFBPORT=$(expr "$WX_SELECTEDCONFIG" : ".*dfb.*") 876 877 WX_PORT="unknown" 878 if test "$WX_GTKPORT1" != "0"; then WX_PORT="gtk1"; fi 879 if test "$WX_GTKPORT2" != "0"; then WX_PORT="gtk2"; fi 880 if test "$WX_MSWPORT" != "0"; then WX_PORT="msw"; fi 881 if test "$WX_MOTIFPORT" != "0"; then WX_PORT="motif"; fi 882 if test "$WX_OSXCOCOAPORT" != "0"; then WX_PORT="osx_cocoa"; fi 883 if test "$WX_OSXCARBONPORT" != "0"; then WX_PORT="osx_carbon"; fi 884 if test "$WX_X11PORT" != "0"; then WX_PORT="x11"; fi 885 if test "$WX_DFBPORT" != "0"; then WX_PORT="dfb"; fi 886 887 dnl NOTE: backward-compatible check for wx2.8; in wx2.9 the mac 888 dnl ports are called 'osx_cocoa' and 'osx_carbon' (see above) 889 WX_MACPORT=$(expr "$WX_SELECTEDCONFIG" : ".*mac.*") 890 if test "$WX_MACPORT" != "0"; then WX_PORT="mac"; fi 891 892 dnl check at least one of the WX_*PORT has been set ! 893 894 if test "$WX_PORT" = "unknown" ; then 895 AC_MSG_ERROR([ 896 Cannot detect the currently installed wxWidgets port ! 897 Please check your 'wx-config --cxxflags'... 898 ]) 899 fi 900 901 AC_MSG_RESULT([$WX_PORT]) 902 else 903 904 dnl Use the setting given by the user 905 if test -z "$TOOLKIT" ; then 906 WX_PORT=$TOOLKIT 907 else 908 dnl try with PORT 909 WX_PORT=$PORT 910 fi 911 fi 912 913 AC_SUBST(WX_PORT) 914 915 if test "$WX_DEBUG_CONFIGURE" = "1"; then 916 echo "[[dbg]] Values of all WX_* options after final detection:" 917 echo "[[dbg]] WX_DEBUG: $WX_DEBUG" 918 echo "[[dbg]] WX_UNICODE: $WX_UNICODE" 919 echo "[[dbg]] WX_SHARED: $WX_SHARED" 920 echo "[[dbg]] WX_RELEASE: $WX_RELEASE" 921 echo "[[dbg]] WX_PORT: $WX_PORT" 922 fi 923 924 dnl Avoid problem described in the WX_STANDARD_OPTIONS which happens when 925 dnl the user gives the options: 926 dnl ./configure --enable-shared --without-wxshared 927 dnl or just do 928 dnl ./configure --enable-shared 929 dnl but there is only a static build of wxWidgets available. 930 if test "$WX_SHARED" = "0" -a "$SHARED" = "1"; then 931 AC_MSG_ERROR([ 932 Cannot build shared library against a static build of wxWidgets ! 933 This error happens because the wxWidgets build which was selected 934 has been detected as static while you asked to build $PACKAGE_NAME 935 as shared library and this is not possible. 936 Use the '--disable-shared' option to build $PACKAGE_NAME 937 as static library or '--with-wxshared' to use wxWidgets as shared library. 938 ]) 939 fi 940 941 dnl now we can finally update the DEBUG,UNICODE,SHARED options 942 dnl to their final values if they were set to 'auto' 943 if test "$DEBUG" = "auto"; then 944 DEBUG=$WX_DEBUG 945 fi 946 if test "$UNICODE" = "auto"; then 947 UNICODE=$WX_UNICODE 948 fi 949 if test "$SHARED" = "auto"; then 950 SHARED=$WX_SHARED 951 fi 952 if test "$TOOLKIT" = "auto"; then 953 TOOLKIT=$WX_PORT 954 fi 955 956 dnl in case the user needs a BUILD=debug/release var... 957 if test "$DEBUG" = "1"; then 958 BUILD="debug" 959 elif test "$DEBUG" = "0" -o "$DEBUG" = ""; then 960 BUILD="release" 961 fi 962 963 dnl respect the DEBUG variable adding the optimize/debug flags 964 dnl NOTE: the CXXFLAGS are merged together with the CPPFLAGS so we 965 dnl don't need to set them, too 966 if test "$DEBUG" = "1"; then 967 CXXFLAGS="$CXXFLAGS -g -O0" 968 CFLAGS="$CFLAGS -g -O0" 969 else 970 CXXFLAGS="$CXXFLAGS -O2" 971 CFLAGS="$CFLAGS -O2" 972 fi 973 ]) 974 975 dnl --------------------------------------------------------------------------- 976 dnl WX_BOOLOPT_SUMMARY([name of the boolean variable to show summary for], 977 dnl [what to print when var is 1], 978 dnl [what to print when var is 0]) 979 dnl 980 dnl Prints $2 when variable $1 == 1 and prints $3 when variable $1 == 0. 981 dnl This macro mainly exists just to make configure.ac scripts more readable. 982 dnl 983 dnl NOTE: you need to use the [" my message"] syntax for 2nd and 3rd arguments 984 dnl if you want that m4 avoid to throw away the spaces prefixed to the 985 dnl argument value. 986 dnl --------------------------------------------------------------------------- 987 AC_DEFUN([WX_BOOLOPT_SUMMARY], 988 [ 989 if test "x$$1" = "x1" ; then 990 echo $2 991 elif test "x$$1" = "x0" ; then 992 echo $3 993 else 994 echo "$1 is $$1" 995 fi 996 ]) 997 998 dnl --------------------------------------------------------------------------- 999 dnl WX_STANDARD_OPTIONS_SUMMARY_MSG 1000 dnl 1001 dnl Shows a summary message to the user about the WX_* variable contents. 1002 dnl This macro is used typically at the end of the configure script. 1003 dnl --------------------------------------------------------------------------- 1004 AC_DEFUN([WX_STANDARD_OPTIONS_SUMMARY_MSG], 1005 [ 1006 echo 1007 echo " The wxWidgets build which will be used by $PACKAGE_NAME $PACKAGE_VERSION" 1008 echo " has the following settings:" 1009 WX_BOOLOPT_SUMMARY([WX_DEBUG], [" - DEBUG build"], [" - RELEASE build"]) 1010 WX_BOOLOPT_SUMMARY([WX_UNICODE], [" - UNICODE mode"], [" - ANSI mode"]) 1011 WX_BOOLOPT_SUMMARY([WX_SHARED], [" - SHARED mode"], [" - STATIC mode"]) 1012 echo " - VERSION: $WX_VERSION" 1013 echo " - PORT: $WX_PORT" 1014 ]) 1015 1016 1017 dnl --------------------------------------------------------------------------- 1018 dnl WX_STANDARD_OPTIONS_SUMMARY_MSG_BEGIN, WX_STANDARD_OPTIONS_SUMMARY_MSG_END 1019 dnl 1020 dnl Like WX_STANDARD_OPTIONS_SUMMARY_MSG macro but these two macros also gives info 1021 dnl about the configuration of the package which used the wxpresets. 1022 dnl 1023 dnl Typical usage: 1024 dnl WX_STANDARD_OPTIONS_SUMMARY_MSG_BEGIN 1025 dnl echo " - Package setting 1: $SETTING1" 1026 dnl echo " - Package setting 2: $SETTING1" 1027 dnl ... 1028 dnl WX_STANDARD_OPTIONS_SUMMARY_MSG_END 1029 dnl 1030 dnl --------------------------------------------------------------------------- 1031 AC_DEFUN([WX_STANDARD_OPTIONS_SUMMARY_MSG_BEGIN], 1032 [ 1033 echo 1034 echo " ----------------------------------------------------------------" 1035 echo " Configuration for $PACKAGE_NAME $PACKAGE_VERSION successfully completed." 1036 echo " Summary of main configuration settings for $PACKAGE_NAME:" 1037 WX_BOOLOPT_SUMMARY([DEBUG], [" - DEBUG build"], [" - RELEASE build"]) 1038 WX_BOOLOPT_SUMMARY([UNICODE], [" - UNICODE mode"], [" - ANSI mode"]) 1039 WX_BOOLOPT_SUMMARY([SHARED], [" - SHARED mode"], [" - STATIC mode"]) 1040 ]) 1041 1042 AC_DEFUN([WX_STANDARD_OPTIONS_SUMMARY_MSG_END], 1043 [ 1044 WX_STANDARD_OPTIONS_SUMMARY_MSG 1045 echo 1046 echo " Now, just run make." 1047 echo " ----------------------------------------------------------------" 1048 echo 1049 ]) 1050 1051 1052 dnl --------------------------------------------------------------------------- 1053 dnl Deprecated macro wrappers 1054 dnl --------------------------------------------------------------------------- 1055 1056 AC_DEFUN([AM_OPTIONS_WXCONFIG], [WX_CONFIG_OPTIONS]) 1057 AC_DEFUN([AM_PATH_WXCONFIG], [ 1058 WX_CONFIG_CHECK([$1],[$2],[$3],[$4],[$5]) 1059 ]) 1060 AC_DEFUN([AM_PATH_WXRC], [WXRC_CHECK([$1],[$2])]) -
src/engine/local_path.cpp
diff -r 0c89638d5302 -r c6f43e47a9eb src/engine/local_path.cpp
a b 48 48 49 49 wxChar* out; 50 50 wxChar* start; 51 wxStringBuffer* buffer = 0; 51 52 if (*in == '\\') 52 53 { 53 54 // possibly UNC … … 59 60 return false; 60 61 } 61 62 62 start = m_path.GetWriteBuf(path.Len() + 2); 63 buffer = new wxStringBuffer(m_path, path.Len() + 2); 64 start = *buffer; 63 65 out = start; 64 66 *out++ = '\\'; 65 67 *out++ = '\\'; … … 77 79 { 78 80 // not a valid UNC path 79 81 *start = 0; 80 m_path.UngetWriteBuf( 0 );82 delete buffer; 81 83 return false; 82 84 } 83 85 … … 87 89 { 88 90 // Regular path 89 91 90 start = m_path.GetWriteBuf(path.Len() + 2); 92 buffer = new wxStringBuffer(m_path, path.Len() + 2); 93 start = *buffer; 91 94 out = start; 92 95 *out++ = *in++; 93 96 94 97 if (*in++ != ':') 95 98 { 96 99 *start = 0; 97 m_path.UngetWriteBuf( 0 );100 delete buffer; 98 101 return false; 99 102 } 100 103 *out++ = ':'; 101 104 if (*in != '/' && *in != '\\' && *in) 102 105 { 103 106 *start = 0; 104 m_path.UngetWriteBuf( 0 );107 delete buffer; 105 108 return false; 106 109 } 107 110 *out++ = path_separator; … … 120 123 return false; 121 124 } 122 125 126 #if wxCHECK_VERSION(2, 9, 0) 127 wxStringBuffer* buffer = new wxStringBuffer(m_path, path.Len() + 2); 128 wxChar* out = *buffer; 129 #else 123 130 wxChar* start = m_path.GetWriteBuf(path.Len() + 2); 124 131 wxChar* out = start; 132 #endif 125 133 126 134 *out++ = '/'; 127 135 segments.push_back(out); … … 210 218 } 211 219 212 220 *out = 0; 213 221 #if !wxCHECK_VERSION(2, 9, 0) 214 222 m_path.UngetWriteBuf( out - start ); 215 223 #else 224 if (buffer != 0) { 225 delete buffer; 226 } 227 #endif 216 228 ::Coalesce(m_path); 217 229 218 230 return true; -
src/engine/logging.cpp
diff -r 0c89638d5302 -r c6f43e47a9eb src/engine/logging.cpp
a b 51 51 } 52 52 } 53 53 54 #if wxCHECK_VERSION(2, 9, 0) 55 void CLogging::LogMessage(MessageType nMessageType, const wxChar *msgFormat, int value1) const 56 { 57 LogMessage(nMessageType, msgFormat, (const char*)(wxString() << value1).c_str()); 58 } 59 60 void CLogging::LogMessage(MessageType nMessageType, const wxChar *msgFormat, int value1, wxCStrData value2) const 61 { 62 LogMessage(nMessageType, msgFormat, (const char*)(wxString() << value1).c_str(), value2.AsWChar()); 63 } 64 65 void CLogging::LogMessage(MessageType nMessageType, const wxChar *msgFormat, int value1, wxCStrData value2, wxCStrData value3) const 66 { 67 LogMessage(nMessageType, msgFormat, (const char*)(wxString() << value1).c_str(), value2.AsWChar(), value3.AsWChar()); 68 } 69 70 void CLogging::LogMessage(MessageType nMessageType, const wxChar *msgFormat, wxCStrData value1) const 71 { 72 LogMessage(nMessageType, msgFormat, value1.AsWChar()); 73 } 74 75 void CLogging::LogMessage(MessageType nMessageType, const wxChar *msgFormat, wxCStrData value1, wxCStrData value2) const 76 { 77 LogMessage(nMessageType, msgFormat, value1.AsWChar(), value2.AsWChar()); 78 } 79 80 void CLogging::LogMessage(MessageType nMessageType, const wxChar *msgFormat, wxCStrData value1, wxCStrData value2, wxCStrData value3, wxCStrData value4) const 81 { 82 LogMessage(nMessageType, msgFormat, value1.AsWChar(), value2.AsWChar(), value3.AsWChar(), value4.AsWChar()); 83 } 84 #endif 85 54 86 void CLogging::LogMessage(MessageType nMessageType, const wxChar *msgFormat, ...) const 55 87 { 56 88 InitLogFile(); -
src/engine/logging_private.h
diff -r 0c89638d5302 -r c6f43e47a9eb src/engine/logging_private.h
a b 6 6 public: 7 7 CLogging(CFileZillaEnginePrivate *pEngine); 8 8 virtual ~CLogging(); 9 10 #if wxCHECK_VERSION(2, 9, 0) 11 void LogMessage(MessageType nMessageType, const wxChar *msgFormat, int value1) const; 12 void LogMessage(MessageType nMessageType, const wxChar *msgFormat, int value1, wxCStrData value2) const; 13 void LogMessage(MessageType nMessageType, const wxChar *msgFormat, int value1, wxCStrData value2, wxCStrData value3) const; 14 void LogMessage(MessageType nMessageType, const wxChar *msgFormat, wxCStrData value1) const; 15 void LogMessage(MessageType nMessageType, const wxChar *msgFormat, wxCStrData value1, wxCStrData value2) const; 16 void LogMessage(MessageType nMessageType, const wxChar *msgFormat, wxCStrData value1, wxCStrData value2, wxCStrData value3, wxCStrData value4) const; 17 #endif 9 18 10 19 void LogMessage(MessageType nMessageType, const wxChar *msgFormat, ...) const; 11 20 void LogMessageRaw(MessageType nMessageType, const wxChar *msg) const; -
src/engine/misc.cpp
diff -r 0c89638d5302 -r c6f43e47a9eb src/engine/misc.cpp
a b 365 365 { 366 366 for (size_t i = 0; i < str.Len(); i++) 367 367 { 368 #if wxCHECK_VERSION(2, 9, 0) 369 char c; 370 str.GetChar(i).GetAsChar(&c); 371 if (c >= 'A' && c <= 'Z') 372 { 373 c += 32; 374 str.SetChar(i, wxUniChar(c)); 375 } 376 #else 368 377 wxChar& c = str[i]; 369 378 if (c >= 'A' && c <= 'Z') 370 379 c += 32; 380 #endif 371 381 } 372 382 } 373 383 -
src/engine/server.cpp
diff -r 0c89638d5302 -r c6f43e47a9eb src/engine/server.cpp
a b 12 12 }; 13 13 14 14 static const t_protocolInfo protocolInfos[] = { 15 { FTP, _T("ftp"), false, 21, true, wxTRANSLATE("FTP - File Transfer Protocol with optional encryption"), true },15 { FTP, _T("ftp"), false, 21, true, _T("FTP - File Transfer Protocol with optional encryption"), true }, 16 16 { SFTP, _T("sftp"), true, 22, false, _T("SFTP - SSH File Transfer Protocol"), false }, 17 17 { HTTP, _T("http"), true, 80, false, _T("HTTP - Hypertext Transfer Protocol"), true }, 18 { HTTPS, _T("https"), true, 443, true, wxTRANSLATE("HTTPS - HTTP over TLS"), true },19 { FTPS, _T("ftps"), true, 990, true, wxTRANSLATE("FTPS - FTP over implicit TLS/SSL"), true },20 { FTPES, _T("ftpes"), true, 21, true, wxTRANSLATE("FTPES - FTP over explicit TLS/SSL"), true },21 { INSECURE_FTP, _T("ftp"), false, 21, true, wxTRANSLATE("FTP - Insecure File Transfer Protocol"), true },18 { HTTPS, _T("https"), true, 443, true, _T("HTTPS - HTTP over TLS"), true }, 19 { FTPS, _T("ftps"), true, 990, true, _T("FTPS - FTP over implicit TLS/SSL"), true }, 20 { FTPES, _T("ftpes"), true, 21, true, _T("FTPES - FTP over explicit TLS/SSL"), true }, 21 { INSECURE_FTP, _T("ftp"), false, 21, true, _T("FTP - Insecure File Transfer Protocol"), true }, 22 22 { UNKNOWN, _T(""), false, 21, false, _T("") } 23 23 }; 24 24 -
src/engine/serverpath.cpp
diff -r 0c89638d5302 -r c6f43e47a9eb src/engine/serverpath.cpp
a b 276 276 len += iter->Length() + 2 + INTLENGTH; 277 277 278 278 wxString safepath; 279 #if wxCHECK_VERSION(2, 9, 0) 280 wxStringBuffer* buffer = new wxStringBuffer(safepath, len); 281 wxChar* t = *buffer; 282 #else 279 283 wxChar* start = safepath.GetWriteBuf(len); 280 284 wxChar* t = start; 285 #endif 281 286 282 287 t = fast_sprint_number(t, m_type); 283 288 *(t++) = ' '; … … 299 304 t += iter->size(); 300 305 } 301 306 *t = 0; 302 307 #if !wxCHECK_VERSION(2, 9, 0) 303 308 safepath.UngetWriteBuf( t - start ); 309 #else 310 delete buffer; 311 #endif 304 312 safepath.Shrink(); 305 313 306 314 return safepath; -
src/engine/socket.cpp
diff -r 0c89638d5302 -r c6f43e47a9eb src/engine/socket.cpp
a b 1273 1273 } 1274 1274 } 1275 1275 1276 #define ERRORDECL(c, desc) { c, _T(#c), wxTRANSLATE(desc) },1276 #define ERRORDECL(c, desc) { c, _T(#c), _T(desc) }, 1277 1277 1278 1278 struct Error_table 1279 1279 { -
src/engine/string_coalescer.cpp
diff -r 0c89638d5302 -r c6f43e47a9eb src/engine/string_coalescer.cpp
a b 66 66 { 67 67 // wxString is CoW, yet it doesn't even do this fast pointer 68 68 // comparison in it's less and/or equal operator(s). 69 #if wxCHECK_VERSION(2, 9, 0) 70 return lhs == rhs; 71 #else 69 72 return lhs.c_str() == rhs.c_str() || lhs == rhs; 73 #endif 70 74 } 71 75 }; 72 76 -
src/include/libfilezilla.h
diff -r 0c89638d5302 -r c6f43e47a9eb src/include/libfilezilla.h
a b 21 21 #include <wx/datetime.h> 22 22 #include <wx/event.h> 23 23 #include <wx/string.h> 24 #if wxCHECK_VERSION(2, 9, 0) 25 #include <wx/translation.h> 26 #include <wx/dcclient.h> 27 #endif 24 28 25 29 #include <list> 26 30 #include <vector> -
src/interface/FileZilla.cpp
diff -r 0c89638d5302 -r c6f43e47a9eb src/interface/FileZilla.cpp
a b 265 265 COptions::Get()->SetOption(OPTION_LANGUAGE, _T("")); 266 266 } 267 267 #else 268 if ( !pInfo || !SetLocale(pInfo->Language))268 if (pInfo && !pInfo->Description.IsEmpty()) 269 269 { 270 if (pInfo && pInfo->Description)270 if (pInfo && !pInfo->Description.IsEmpty()) 271 271 wxMessageBox(wxString::Format(_("Failed to set language to %s (%s), using default system language"), pInfo->Description.c_str(), language.c_str()), _("Failed to change language"), wxICON_EXCLAMATION); 272 272 else 273 273 wxMessageBox(wxString::Format(_("Failed to set language to %s, using default system language"), language.c_str()), _("Failed to change language"), wxICON_EXCLAMATION); … … 803 803 if (!found) 804 804 { 805 805 wxMessageBox(wxString::Format(_("%s could not be found. Without this component of FileZilla, SFTP will not work.\n\nPossible solutions:\n- Make sure %s is in a directory listed in your PATH environment variable.\n- Set the full path to %s in the FZ_FZSFTP environment variable."), program.c_str(), program.c_str(), program.c_str()), 806 _("File not found"), wxICON_ERROR );806 _("File not found"), wxICON_ERROR | wxOK); 807 807 executable.clear(); 808 808 } 809 809 #endif -
src/interface/Mainfrm.cpp
diff -r 0c89638d5302 -r c6f43e47a9eb src/interface/Mainfrm.cpp
a b 754 754 // Do a crude approach: Drop everything unexpected... 755 755 for (unsigned int i = 0; i < version.Len(); i++) 756 756 { 757 #if wxCHECK_VERSION(2, 9, 0) 758 char c; 759 version.GetChar(i).GetAsChar(&c); 760 #else 757 761 wxChar& c = version[i]; 762 #endif 758 763 if ((version[i] >= '0' && version[i] <= '9') || 759 764 (version[i] >= 'a' && version[i] <= 'z') || 760 765 (version[i] >= 'A' && version[i] <= 'Z') || 761 766 version[i] == '-' || version[i] == '.' || 762 767 version[i] == '_') 763 768 { 764 url += c;769 url.Append(c); 765 770 } 766 771 } 767 772 } … … 779 784 { 780 785 pStatusBar->Show(show); 781 786 wxSizeEvent evt; 787 #if wxCHECK_VERSION(2, 9, 0) 788 controls->pLocalListViewPanel->ProcessWindowEvent(evt); 789 #else 782 790 controls->pLocalListViewPanel->ProcessEvent(evt); 791 #endif 783 792 } 784 793 } 785 794 if (controls && controls->pRemoteListViewPanel) … … 789 798 { 790 799 pStatusBar->Show(show); 791 800 wxSizeEvent evt; 801 #if wxCHECK_VERSION(2, 9, 0) 802 controls->pRemoteListViewPanel->ProcessWindowEvent(evt); 803 #else 792 804 controls->pRemoteListViewPanel->ProcessEvent(evt); 805 #endif 793 806 } 794 807 } 795 808 } -
src/interface/QueueView.cpp
diff -r 0c89638d5302 -r c6f43e47a9eb src/interface/QueueView.cpp
a b 3419 3419 const wxChar replace = COptions::Get()->GetOption(OPTION_INVALID_CHAR_REPLACE)[0]; 3420 3420 3421 3421 wxString result; 3422 3422 #if wxCHECK_VERSION(2, 9, 0) 3423 wxStringBuffer* buffer = new wxStringBuffer(result, filename.Len() + 1); 3424 wxChar* buf = *buffer; 3425 #else 3423 3426 wxChar* start = result.GetWriteBuf(filename.Len() + 1); 3424 3427 wxChar* buf = start; 3428 #endif 3425 3429 3426 3430 const wxChar* p = filename.c_str(); 3427 3431 while (*p) … … 3456 3460 p++; 3457 3461 } 3458 3462 *buf = 0; 3459 3463 #if wxCHECK_VERSION(2, 9, 0) 3464 delete buffer; 3465 #else 3460 3466 result.UngetWriteBuf( buf - start ); 3461 3467 #endif 3462 3468 return result; 3463 3469 } 3464 3470 -
src/interface/RemoteTreeView.cpp
diff -r 0c89638d5302 -r c6f43e47a9eb src/interface/RemoteTreeView.cpp
a b 350 350 SetItemImages(parent, false); 351 351 352 352 #ifndef __WXMSW__ 353 m_freezeCount--;353 Thaw(); 354 354 #endif 355 355 if (!modified) 356 356 SafeSelectItem(parent); -
src/interface/StatusView.cpp
diff -r 0c89638d5302 -r c6f43e47a9eb src/interface/StatusView.cpp
a b 58 58 { 59 59 wxWindow* parent = GetParent(); 60 60 event.SetEventObject(parent); 61 parent-> ProcessEvent(event);61 parent->GetEventHandler()->ProcessEvent(event); 62 62 } 63 63 #else 64 64 void OnKeyDown(wxKeyEvent& event) … … 76 76 navEvent.SetDirection(!event.ShiftDown()); 77 77 navEvent.SetFromTab(true); 78 78 navEvent.ResumePropagation(1); 79 parent-> ProcessEvent(navEvent);79 parent->GetEventHandler()->ProcessEvent(navEvent); 80 80 } 81 81 #endif 82 82 }; -
src/interface/aui_notebook_ex.cpp
diff -r 0c89638d5302 -r c6f43e47a9eb src/interface/aui_notebook_ex.cpp
a b 3 3 #include "aui_notebook_ex.h" 4 4 #include <wx/dcmirror.h> 5 5 6 #if wxCHECK_VERSION(2, 9, 0) 7 wxColor wxAuiStepColour(const wxColor& c, int ialpha) 8 { 9 wxColor* result = new wxColor(c); 10 result->ChangeLightness(ialpha); 11 return *result; 12 } 13 #else 6 14 wxColor wxAuiStepColour(const wxColor& c, int ialpha); 15 #endif 7 16 8 17 #ifdef __WXMSW__ 9 18 #define TABCOLOUR wxSYS_COLOUR_3DFACE … … 184 193 } 185 194 } 186 195 187 #ifdef __WXGTK__188 virtual GdkWindow* GetGDKWindow() const { return m_original_dc->GetGDKWindow(); }189 #endif190 196 protected: 191 197 int m_gradient_called; 192 198 int m_rectangle_called; … … 215 221 virtual wxAuiTabArt* Clone() 216 222 { 217 223 wxAuiTabArtEx *art = new wxAuiTabArtEx(m_pNotebook, m_bottom, m_data); 224 #if wxCHECK_VERSION(2, 9, 0) 225 art->SetNormalFont(m_normalFont); 226 art->SetSelectedFont(m_selectedFont); 227 art->SetMeasuringFont(m_measuringFont); 228 #else 218 229 art->SetNormalFont(m_normal_font); 219 230 art->SetSelectedFont(m_selected_font); 220 231 art->SetMeasuringFont(m_measuring_font); 232 #endif 221 233 return art; 222 234 } 223 235 … … 257 269 int* x_extent) 258 270 { 259 271 #ifndef __WXMAC__ 272 #if wxCHECK_VERSION(2, 9, 0) 273 m_baseColour = wxSystemSettings::GetColour(TABCOLOUR); 274 #else 260 275 m_base_colour = wxSystemSettings::GetColour(TABCOLOUR); 261 276 #endif 277 #endif 262 278 if (!pane.active) 263 279 { 280 #if wxCHECK_VERSION(2, 9, 0) 281 if (m_baseColour.Red() + m_baseColour.Green() + m_baseColour.Blue() >= 384) 282 m_baseColour = wxColour( m_baseColour.Red() * 0.95, m_baseColour.Green() * 0.95, m_baseColour.Blue() * 0.95 ); 283 #else 264 284 if (m_base_colour.Red() + m_base_colour.Green() + m_base_colour.Blue() >= 384) 265 285 m_base_colour = wxColour( m_base_colour.Red() * 0.95, m_base_colour.Green() * 0.95, m_base_colour.Blue() * 0.95 ); 286 #endif 266 287 267 288 dc.SetTextForeground(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT)); 268 289 if (m_pNotebook->Highlighted(m_pNotebook->GetPageIndex(pane.window))) … … 270 291 if (!m_fonts_initialized) 271 292 { 272 293 m_fonts_initialized = true; 294 #if wxCHECK_VERSION(2, 9, 0) 295 m_original_normal_font = m_normalFont; 296 m_highlighted_font = m_normalFont; 297 #else 273 298 m_original_normal_font = m_normal_font; 274 299 m_highlighted_font = m_normal_font; 300 #endif 275 301 m_highlighted_font.SetWeight(wxFONTWEIGHT_BOLD); 276 302 m_highlighted_font.SetStyle(wxFONTSTYLE_ITALIC); 277 303 } 304 #if wxCHECK_VERSION(2, 9, 0) 305 m_normalFont = m_highlighted_font; 306 #else 278 307 m_normal_font = m_highlighted_font; 308 #endif 279 309 } 280 310 else if (m_fonts_initialized) 311 #if wxCHECK_VERSION(2, 9, 0) 312 m_normalFont = m_original_normal_font; 313 #else 281 314 m_normal_font = m_original_normal_font; 315 #endif 282 316 } 283 317 #if wxCHECK_VERSION(2, 9, 0) 318 CFilterDC filter_dc(dc, pane.active ? 1 : 0, (m_tabCtrlHeight % 2) != 0, m_bottom); 319 wxAuiGenericTabArt::DrawTab(*((wxDC*)&filter_dc), wnd, pane, in_rect, close_button_state, out_tab_rect, out_button_rect, x_extent); 320 m_baseColour = wxSystemSettings::GetColour(TABCOLOUR); 321 #else 284 322 CFilterDC filter_dc(dc, pane.active ? 1 : 0, (m_tab_ctrl_height % 2) != 0, m_bottom); 285 323 wxAuiDefaultTabArt::DrawTab(*((wxDC*)&filter_dc), wnd, pane, in_rect, close_button_state, out_tab_rect, out_button_rect, x_extent); 286 287 324 m_base_colour = wxSystemSettings::GetColour(TABCOLOUR); 325 #endif 288 326 } 289 327 290 328 virtual void DrawBackground(wxDC& dc, wxWindow* wnd, const wxRect& rect) 291 329 { 330 #if wxCHECK_VERSION(2, 9, 0) 331 CFilterDC filter_dc(dc, 2, (m_tabCtrlHeight % 2) != 0, m_bottom); 332 wxAuiGenericTabArt::DrawBackground(*((wxDC*)&filter_dc), wnd, rect); 333 #else 292 334 CFilterDC filter_dc(dc, 2, (m_tab_ctrl_height % 2) != 0, m_bottom); 293 335 wxAuiDefaultTabArt::DrawBackground(*((wxDC*)&filter_dc), wnd, rect); 336 #endif 294 337 } 295 338 protected: 296 339 wxAuiNotebookEx* m_pNotebook; -
src/interface/commandqueue.cpp
diff -r 0c89638d5302 -r c6f43e47a9eb src/interface/commandqueue.cpp
a b 289 289 290 290 wxCommandEvent evt(fzEVT_GRANTEXCLUSIVEENGINEACCESS); 291 291 evt.SetId(m_requestId); 292 m_pMainFrame->GetQueue()-> AddPendingEvent(evt);292 m_pMainFrame->GetQueue()->GetEventHandler()->AddPendingEvent(evt); 293 293 } 294 294 295 295 CFileZillaEngine* CCommandQueue::GetEngineExclusive(int requestId) -
src/interface/filezilla.h
diff -r 0c89638d5302 -r c6f43e47a9eb src/interface/filezilla.h
a b 71 71 #include <wx/toolbar.h> 72 72 #include <wx/treectrl.h> 73 73 #include <wx/xrc/xmlres.h> 74 #include <wx/xml/xml.h> 74 75 75 76 #endif -
src/interface/import.cpp
diff -r 0c89638d5302 -r c6f43e47a9eb src/interface/import.cpp
a b 146 146 return _T(""); 147 147 int number = (pass[i] - '0') * 100 + 148 148 (pass[i + 1] - '0') * 10 + 149 pass[i + 2] - '0';149 (pass[i + 2] - '0'); 150 150 wxChar c = number ^ key[(i / 3 + pos) % strlen(key)]; 151 151 output += c; 152 152 } -
src/interface/listctrlex.cpp
diff -r 0c89638d5302 -r c6f43e47a9eb src/interface/listctrlex.cpp
a b 73 73 #ifndef __WXMSW__ 74 74 wxScrolledWindow* wxListCtrlEx::GetMainWindow() const 75 75 { 76 #if def __WXMAC__76 #if defined(__WXMAC__) && !wxCHECK_VERSION(2, 9, 0) 77 77 return (wxScrolledWindow*)m_genericImpl->m_mainWin; 78 78 #else 79 79 return (wxScrolledWindow*)m_mainWin; -
src/interface/netconfwizard.cpp
diff -r 0c89638d5302 -r c6f43e47a9eb src/interface/netconfwizard.cpp
a b 777 777 wxString hexIP = ip; 778 778 for (unsigned int i = 0; i < hexIP.Length(); i++) 779 779 { 780 #if wxCHECK_VERSION(2, 9, 0) 781 char c; 782 hexIP.GetChar(i).GetAsChar(&c); 783 #else 780 784 wxChar& c = hexIP[i]; 785 #endif 781 786 if (c == '.') 782 787 c = '-'; 783 788 else -
src/interface/queue.cpp
diff -r 0c89638d5302 -r c6f43e47a9eb src/interface/queue.cpp
a b 1310 1310 } 1311 1311 else 1312 1312 { 1313 if (m_folderScanCount )1313 if (m_folderScanCount && m_fileCount > 0) 1314 1314 str.Printf(m_title + _T(" (0+)"), m_fileCount); 1315 1315 else 1316 1316 str = m_title; … … 1442 1442 void CQueueViewBase::OnNavigationKey(wxNavigationKeyEvent& event) 1443 1443 { 1444 1444 event.SetEventObject(m_pQueue); 1445 #if wxCHECK_VERSION(2, 9, 0) 1446 m_pQueue->ProcessWindowEvent(event); 1447 #else 1445 1448 m_pQueue->ProcessEvent(event); 1449 #endif 1446 1450 } 1447 1451 1448 1452 void CQueueViewBase::OnChar(wxKeyEvent& event) -
src/interface/queue_storage.cpp
diff -r 0c89638d5302 -r c6f43e47a9eb src/interface/queue_storage.cpp
a b 135 135 { 136 136 // wxString is CoW, yet it doesn't even do this fast pointer 137 137 // comparison in it's less and/or equal operator(s). 138 #if wxCHECK_VERSION(2, 9, 0) 139 return (const char*)lhs.c_str() == (const char*)rhs.c_str() || lhs == rhs; 140 #else 138 141 return lhs.c_str() == rhs.c_str() || lhs == rhs; 142 #endif 139 143 } 140 144 }; 141 145 … … 544 548 extern "C" { 545 549 static void custom_free(void* v) 546 550 { 547 #ifdef __WXMSW__ 551 #if defined(__WXMSW__) 552 #if !wxCHECK_VERSION(2, 9, 0) 548 553 wxStringData* data = reinterpret_cast<wxStringData*>(v) - 1; 549 554 data->Unlock(); 555 #endif 550 556 #else 551 557 char* s = reinterpret_cast<char*>(v); 552 558 delete [] s; … … 557 563 bool CQueueStorage::Impl::Bind(sqlite3_stmt* statement, int index, const wxString& value) 558 564 { 559 565 #ifdef __WXMSW__ 566 #if wxCHECK_VERSION(2, 9, 0) 567 char* data = value.char_str(); 568 return sqlite3_bind_text16(statement, index, data, value.length(), custom_free) == SQLITE_OK; 569 #else 560 570 // Increase string reference and pass the data to sqlite with a custom deallocator that 561 571 // reduces the reference once sqlite is done with it. 562 572 wxStringData* data = reinterpret_cast<wxStringData*>(const_cast<wxChar*>(value.c_str())) - 1; 563 573 data->Lock(); 564 574 return sqlite3_bind_text16(statement, index, data + 1, data->nDataLength * 2, custom_free) == SQLITE_OK; 575 #endif 565 576 #else 566 577 char* out = new char[value.size() * 2]; 567 578 size_t outlen = utf16_.FromWChar(out, value.size() * 2, value.c_str(), value.size()); … … 814 825 int len = sqlite3_column_bytes16(statement, index); 815 826 if (text) 816 827 { 828 #if wxCHECK_VERSION(2, 9, 0) 829 wxStringBuffer* buffer = new wxStringBuffer(ret, len); 830 wxChar* out = *buffer; 831 #else 817 832 wxChar* out = ret.GetWriteBuf( len ); 833 #endif 818 834 int outlen = utf16_.ToWChar( out, len, text, len ); 835 #if wxCHECK_VERSION(2, 9, 0) 836 delete buffer; 837 #else 819 838 ret.UngetWriteBuf( outlen ); 839 #endif 820 840 if (shrink) 821 841 ret.Shrink(); 822 842 } -
src/interface/quickconnectbar.cpp
diff -r 0c89638d5302 -r c6f43e47a9eb src/interface/quickconnectbar.cpp
a b 222 222 if (event.GetDirection() && event.GetEventObject() == XRCCTRL(*this, "ID_QUICKCONNECT_DROPDOWN", wxButton)) 223 223 { 224 224 event.SetEventObject(this); 225 GetParent()-> ProcessEvent(event);225 GetParent()->GetEventHandler()->ProcessEvent(event); 226 226 } 227 227 else if (!event.GetDirection() && event.GetEventObject() == m_pHost) 228 228 { 229 229 event.SetEventObject(this); 230 GetParent()-> ProcessEvent(event);230 GetParent()->GetEventHandler()->ProcessEvent(event); 231 231 } 232 232 else 233 233 event.Skip(); -
src/interface/resources/settings.xrc
diff -r 0c89638d5302 -r c6f43e47a9eb src/interface/resources/settings.xrc
a b 427 427 </object> 428 428 <cols>1</cols> 429 429 <vgap>3</vgap> 430 <rows> 2</rows>430 <rows>3</rows> 431 431 </object> 432 432 <flag>wxLEFT|wxRIGHT|wxBOTTOM</flag> 433 433 <border>4</border> … … 632 632 <object class="sizeritem"> 633 633 <object class="wxListCtrl" name="ID_KEYS"> 634 634 <style>wxLC_REPORT|wxSUNKEN_BORDER</style> 635 <size>400,-1</size> 635 636 </object> 636 <option>1</option> 637 <flag>wxGROW</flag> 637 <flag>wxSHAPED</flag> 638 638 </object> 639 639 <vgap>5</vgap> 640 640 <growablecols>0</growablecols> … … 1363 1363 <object class="sizeritem"> 1364 1364 <object class="wxFlexGridSizer"> 1365 1365 <cols>2</cols> 1366 <rows> 2</rows>1366 <rows>3</rows> 1367 1367 <object class="sizeritem"> 1368 1368 <object class="wxStaticText"> 1369 1369 <label>&Theme:</label> … … 2076 2076 </object> 2077 2077 <growablecols>1</growablecols> 2078 2078 </object> 2079 <flag>wxGROW</flag>2080 2079 <minsize>400,0</minsize> 2081 2080 </object> 2082 2081 <growablecols>0</growablecols> -
src/interface/settings/optionspage_dateformatting.cpp
diff -r 0c89638d5302 -r c6f43e47a9eb src/interface/settings/optionspage_dateformatting.cpp
a b 16 16 const wxString& dateFormat = m_pOptions->GetOption(OPTION_DATE_FORMAT); 17 17 if (dateFormat == _T("1")) 18 18 SetRCheck(XRCID("ID_DATEFORMAT_ISO"), true, failure); 19 else if ( dateFormat[0] == '2')19 else if (!dateFormat.IsEmpty() && dateFormat[0] == '2') 20 20 { 21 21 SetRCheck(XRCID("ID_DATEFORMAT_CUSTOM"), true, failure); 22 22 SetText(XRCID("ID_CUSTOM_DATEFORMAT"), dateFormat.Mid(1), failure); … … 27 27 const wxString& timeFormat = m_pOptions->GetOption(OPTION_TIME_FORMAT); 28 28 if (timeFormat == _T("1")) 29 29 SetRCheck(XRCID("ID_TIMEFORMAT_ISO"), true, failure); 30 else if ( timeFormat[0] == '2')30 else if (!timeFormat.IsEmpty() && timeFormat[0] == '2') 31 31 { 32 32 SetRCheck(XRCID("ID_TIMEFORMAT_CUSTOM"), true, failure); 33 33 SetText(XRCID("ID_CUSTOM_TIMEFORMAT"), timeFormat.Mid(1), failure); -
src/interface/sitemanager.cpp
diff -r 0c89638d5302 -r c6f43e47a9eb src/interface/sitemanager.cpp
a b 516 516 517 517 bool CSiteManager::GetBookmarks(wxString sitePath, std::list<wxString> &bookmarks) 518 518 { 519 if (sitePath.IsEmpty()) 520 return false; 519 521 wxChar c = sitePath[0]; 520 522 if (c != '0' && c != '1') 521 523 return false; -
src/interface/statusbar.cpp
diff -r 0c89638d5302 -r c6f43e47a9eb src/interface/statusbar.cpp
a b 153 153 void wxStatusBarEx::SetStatusText(const wxString& text, int number /*=0*/) 154 154 { 155 155 // Basically identical to the wx one, but not calling Update 156 wxString oldText = m_statusStrings[number];156 wxString oldText = GetStatusText(number); 157 157 if (oldText != text) 158 158 { 159 m_statusStrings[number] = text;159 wxStatusBar::SetStatusText(text, number); 160 160 161 161 wxRect rect; 162 162 GetFieldRect(number, rect); -
src/interface/timeformatting.cpp
diff -r 0c89638d5302 -r c6f43e47a9eb src/interface/timeformatting.cpp
a b 23 23 24 24 if (dateFormat == _T("1")) 25 25 m_dateFormat = _T("%Y-%m-%d"); 26 else if ( dateFormat[0] == '2')26 else if (!dateFormat.IsEmpty() && dateFormat[0] == '2') 27 27 m_dateFormat = dateFormat.Mid(1); 28 28 else 29 29 m_dateFormat = _T("%x"); … … 33 33 34 34 if (timeFormat == _T("1")) 35 35 m_dateTimeFormat += _T("%H:%M"); 36 else if ( timeFormat[0] == '2')36 else if (!timeFormat.IsEmpty() && timeFormat[0] == '2') 37 37 m_dateTimeFormat += timeFormat.Mid(1); 38 38 else 39 39 m_dateTimeFormat += _T("%X"); -
src/interface/viewheader.cpp
diff -r 0c89638d5302 -r c6f43e47a9eb src/interface/viewheader.cpp
a b 24 24 { 25 25 public: 26 26 CComboBoxEx(CViewHeader* parent) 27 : wxComboBox(parent, wxID_ANY, _T(""), wxDefaultPosition, wxDefaultSize, wxArrayString(), wxCB_DROPDOWN | wxTE_PROCESS_ENTER | wxCB_SORT) 27 : wxComboBox(parent, wxID_ANY, _T(""), wxDefaultPosition, wxDefaultSize, wxArrayString(), wxCB_DROPDOWN | wxTE_PROCESS_ENTER 28 #if !defined(__WXMAC__) || !wxCHECK_VERSION(2, 9, 0) 29 | wxCB_SORT 30 #endif 31 ) 28 32 { 29 33 m_parent = parent; 30 34 } … … 67 71 navEvent.SetDirection(!event.ShiftDown()); 68 72 navEvent.SetFromTab(true); 69 73 navEvent.ResumePropagation(1); 70 m_parent-> ProcessEvent(navEvent);74 m_parent->GetEventHandler()->ProcessEvent(navEvent); 71 75 } 72 76 73 77 void OnChar(wxKeyEvent& event) -
src/interface/wrapengine.cpp
diff -r 0c89638d5302 -r c6f43e47a9eb src/interface/wrapengine.cpp
a b 234 234 bool containsURL = false; 235 235 for (int i = 0; i <= strLen; i++) 236 236 { 237 if (( text[i] == ':' && text[i + 1] == '/' && text[i + 2] == '/') || // absolute238 ( text[i] == '/' && (!i || text[i - 1] == ' '))) // relative237 if ((i < strLen - 2 && text[i] == ':' && text[i + 1] == '/' && text[i + 2] == '/') || // absolute 238 (i < strLen && text[i] == '/' && (!i || text[i - 1] == ' '))) // relative 239 239 { 240 240 url = true; 241 241 containsURL = true; 242 242 } 243 if ( text[i] != ' ' && text[i] != 0)243 if (i < strLen && text[i] != ' ') 244 244 { 245 245 // If url, wrap on slashes and ampersands, but not first slash of something:// 246 246 if (!url || 247 (( text[i] != '/' || text[i + 1] == '/') && (text[i] != '&' || text[i + 1] == '&') && text[i] != '?'))247 ((i < strLen - 1 && (text[i] != '/' || text[i + 1] == '/')) && (i < strLen - 1 && (text[i] != '&' || text[i + 1] == '&')) && text[i] != '?')) 248 248 continue; 249 249 } 250 250 251 251 wxString segment; 252 252 if (wrapAfter == -1) 253 253 { 254 if ( text[i] == '/' || text[i] == '?' || text[i] == '&')254 if (i < strLen && (text[i] == '/' || text[i] == '?' || text[i] == '&')) 255 255 segment = text.Mid(start, i - start + 1); 256 256 else 257 257 segment = text.Mid(start, i - start); … … 259 259 } 260 260 else 261 261 { 262 if ( text[i] == '/' || text[i] == '?' || text[i] == '&')262 if (i < strLen && (text[i] == '/' || text[i] == '?' || text[i] == '&')) 263 263 segment = text.Mid(wrapAfter + 1, i - wrapAfter); 264 264 else 265 265 segment = text.Mid(wrapAfter + 1, i - wrapAfter - 1); … … 274 274 if (wrappedText != _T("")) 275 275 wrappedText += _T("\n"); 276 276 wrappedText += text.Mid(start, wrapAfter - start); 277 if ( text[wrapAfter] != ' ' && text[wrapAfter] != '\0')277 if (wrapAfter < strLen && text[wrapAfter] != ' ' && text[wrapAfter] != '\0') 278 278 wrappedText += text[wrapAfter]; 279 279 280 280 if (width + spaceWidth >= (int)maxLength) … … 304 304 if (wrappedText != _T("")) 305 305 wrappedText += _T("\n"); 306 306 wrappedText += text.Mid(start, i - start); 307 if ( text[i] != ' ' && text[i] != '\0')307 if (i < strLen && text[i] != ' ' && text[i] != '\0') 308 308 wrappedText += text[i]; 309 309 start = i + 1; 310 310 wrapAfter = -1; … … 318 318 wrapAfter = i; 319 319 } 320 320 321 if ( text[i] == ' ')321 if (i < strLen && text[i] == ' ') 322 322 url = false; 323 323 } 324 324 if (start < strLen)