diff options
Diffstat (limited to 'src')
366 files changed, 17342 insertions, 2380 deletions
diff --git a/src/3rdparty/libconninet.pri b/src/3rdparty/libconninet.pri new file mode 100644 index 0000000..e041e2b --- /dev/null +++ b/src/3rdparty/libconninet.pri @@ -0,0 +1,18 @@ +INCLUDEPATH += $$PWD/libconninet/src + +QMAKE_CXXFLAGS += $$QT_CFLAGS_GLIB + +HEADERS += \ + $$PWD/libconninet/src/dbusdispatcher.h \ + $$PWD/libconninet/src/iapconf.h \ + $$PWD/libconninet/src/iapmonitor.h \ + $$PWD/libconninet/src/maemo_icd.h \ + $$PWD/libconninet/src/proxyconf.h + +SOURCES += \ + $$PWD/libconninet/src/dbusdispatcher.cpp \ + $$PWD/libconninet/src/iapconf.cpp \ + $$PWD/libconninet/src/iapmonitor.cpp \ + $$PWD/libconninet/src/maemo_icd.cpp \ + $$PWD/libconninet/src/proxyconf.cpp + diff --git a/src/3rdparty/libconninet/AUTHORS b/src/3rdparty/libconninet/AUTHORS new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/3rdparty/libconninet/AUTHORS diff --git a/src/3rdparty/libconninet/COPYING b/src/3rdparty/libconninet/COPYING new file mode 100644 index 0000000..b124cf5 --- /dev/null +++ b/src/3rdparty/libconninet/COPYING @@ -0,0 +1,510 @@ + + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations +below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it +becomes a de-facto standard. To achieve this, non-free programs must +be allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control +compilation and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at least + three years, to give the same user the materials specified in + Subsection 6a, above, for a charge no more than the cost of + performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply, and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License +may add an explicit geographical distribution limitation excluding those +countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms +of the ordinary General Public License). + + To apply these terms, attach the following notices to the library. +It is safest to attach them to the start of each source file to most +effectively convey the exclusion of warranty; and each file should +have at least the "copyright" line and a pointer to where the full +notice is found. + + + <one line to give the library's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or +your school, if any, to sign a "copyright disclaimer" for the library, +if necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James + Random Hacker. + + <signature of Ty Coon>, 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + diff --git a/src/3rdparty/libconninet/ChangeLog b/src/3rdparty/libconninet/ChangeLog new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/3rdparty/libconninet/ChangeLog diff --git a/src/3rdparty/libconninet/INSTALL b/src/3rdparty/libconninet/INSTALL new file mode 100644 index 0000000..54caf7c --- /dev/null +++ b/src/3rdparty/libconninet/INSTALL @@ -0,0 +1,229 @@ +Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software +Foundation, Inc. + + This file is free documentation; the Free Software Foundation gives +unlimited permission to copy, distribute and modify it. + +Basic Installation +================== + + These are generic installation instructions. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, and a +file `config.log' containing compiler output (useful mainly for +debugging `configure'). + + It can also use an optional file (typically called `config.cache' +and enabled with `--cache-file=config.cache' or simply `-C') that saves +the results of its tests to speed up reconfiguring. (Caching is +disabled by default to prevent problems with accidental use of stale +cache files.) + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If you are using the cache, and at +some point `config.cache' contains results you don't want to keep, you +may remove or edit it. + + The file `configure.ac' (or `configure.in') is used to create +`configure' by a program called `autoconf'. You only need +`configure.ac' if you want to change it or regenerate `configure' using +a newer version of `autoconf'. + +The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. If you're + using `csh' on an old version of System V, you might need to type + `sh ./configure' instead to prevent `csh' from trying to execute + `configure' itself. + + Running `configure' takes awhile. While running, it prints some + messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Optionally, type `make check' to run any self-tests that come with + the package. + + 4. Type `make install' to install the programs and any data files and + documentation. + + 5. You can remove the program binaries and object files from the + source code directory by typing `make clean'. To also remove the + files that `configure' created (so you can compile the package for + a different kind of computer), type `make distclean'. There is + also a `make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + +Compilers and Options +===================== + + Some systems require unusual options for compilation or linking that +the `configure' script does not know about. Run `./configure --help' +for details on some of the pertinent environment variables. + + You can give `configure' initial values for configuration parameters +by setting variables in the command line or in the environment. Here +is an example: + + ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix + + *Note Defining Variables::, for more details. + +Compiling For Multiple Architectures +==================================== + + You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you must use a version of `make' that +supports the `VPATH' variable, such as GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. + + If you have to use a `make' that does not support the `VPATH' +variable, you have to compile the package for one architecture at a +time in the source code directory. After you have installed the +package for one architecture, use `make distclean' before reconfiguring +for another architecture. + +Installation Names +================== + + By default, `make install' will install the package's files in +`/usr/local/bin', `/usr/local/man', etc. You can specify an +installation prefix other than `/usr/local' by giving `configure' the +option `--prefix=PATH'. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +give `configure' the option `--exec-prefix=PATH', the package will use +PATH as the prefix for installing programs and libraries. +Documentation and other data files will still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like `--bindir=PATH' to specify different values for particular +kinds of files. Run `configure --help' for a list of the directories +you can set and what kinds of files go in them. + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving `configure' the +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. + +Optional Features +================= + + Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=DIR' and +`--x-libraries=DIR' to specify their locations. + +Specifying the System Type +========================== + + There may be some features `configure' cannot figure out +automatically, but needs to determine by the type of machine the package +will run on. Usually, assuming the package is built to be run on the +_same_ architectures, `configure' can figure that out, but if it prints +a message saying it cannot guess the machine type, give it the +`--build=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name which has the form: + + CPU-COMPANY-SYSTEM + +where SYSTEM can have one of these forms: + + OS KERNEL-OS + + See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the machine type. + + If you are _building_ compiler tools for cross-compiling, you should +use the `--target=TYPE' option to select the type of system they will +produce code for. + + If you want to _use_ a cross compiler, that generates code for a +platform different from the build platform, you should specify the +"host" platform (i.e., that on which the generated programs will +eventually be run) with `--host=TYPE'. + +Sharing Defaults +================ + + If you want to set default values for `configure' scripts to share, +you can create a site shell script called `config.site' that gives +default values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Defining Variables +================== + + Variables not defined in a site shell script can be set in the +environment passed to `configure'. However, some packages may run +configure again during the build, and the customized values of these +variables may be lost. In order to avoid this problem, you should set +them in the `configure' command line, using `VAR=value'. For example: + + ./configure CC=/usr/local2/bin/gcc + +will cause the specified gcc to be used as the C compiler (unless it is +overridden in the site shell script). + +`configure' Invocation +====================== + + `configure' recognizes the following options to control how it +operates. + +`--help' +`-h' + Print a summary of the options to `configure', and exit. + +`--version' +`-V' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`--cache-file=FILE' + Enable the cache: use and save the results of the tests in FILE, + traditionally `config.cache'. FILE defaults to `/dev/null' to + disable caching. + +`--config-cache' +`-C' + Alias for `--cache-file=config.cache'. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`configure' also accepts some other, not widely useful, options. Run +`configure --help' for more details. + diff --git a/src/3rdparty/libconninet/Makefile.am b/src/3rdparty/libconninet/Makefile.am new file mode 100644 index 0000000..250637a --- /dev/null +++ b/src/3rdparty/libconninet/Makefile.am @@ -0,0 +1,49 @@ +SUBDIRS = src tests + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = conninet.pc + +MAINTAINERCLEANFILES = \ + Makefile.in config.h.in configure \ + install-sh ltmain.sh missing mkinstalldirs \ + config.log config.status config.guess config.sub \ + build-stamp compile depcomp acinclude.m4 aclocal.m4 \ + debian/files \ + debian/libconninet0.postinst.debhelper \ + debian/libconninet0.postrm.debhelper \ + debian/libconninet0.substvars + +EXTRA_DIST = \ + debian/changelog \ + debian/compat \ + debian/control \ + debian/copyright \ + debian/libconninet0-dev.dirs \ + debian/libconninet0-dev.files \ + debian/libconninet0.dirs \ + debian/libconninet0.files \ + debian/rules + +# get rid of debian build dirs +maintainer-clean-local: + -rm -rf debian/build debian/tmp \ + debian/libconninet0 \ + debian/libconninet0-dev \ + debian/libconninet0-dbg + +if DOXYGEN_DOCS_ENABLED + DOXYGEN_LINE = $(DOXYGEN) doxygen.cfg +else + DOXYGEN_LINE = +endif + +.PHONY : doc + +doc: + $(DOXYGEN_LINE) + +deb: dist + -mkdir $(top_builddir)/debian-build + cd $(top_builddir)/debian-build && tar zxf ../$(top_builddir)/$(PACKAGE)-$(VERSION).tar.gz + cd $(top_builddir)/debian-build/$(PACKAGE)-$(VERSION) && dpkg-buildpackage -rfakeroot -sa -D + -rm -rf $(top_builddir)/debian-build/$(PACKAGE)-$(VERSION) diff --git a/src/3rdparty/libconninet/NEWS b/src/3rdparty/libconninet/NEWS new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/3rdparty/libconninet/NEWS diff --git a/src/3rdparty/libconninet/README b/src/3rdparty/libconninet/README new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/3rdparty/libconninet/README diff --git a/src/3rdparty/libconninet/autogen.sh b/src/3rdparty/libconninet/autogen.sh new file mode 100755 index 0000000..a8fd885 --- /dev/null +++ b/src/3rdparty/libconninet/autogen.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +autoreconf --verbose --install --force diff --git a/src/3rdparty/libconninet/config.guess b/src/3rdparty/libconninet/config.guess new file mode 100755 index 0000000..e3a2116 --- /dev/null +++ b/src/3rdparty/libconninet/config.guess @@ -0,0 +1,1533 @@ +#! /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, 2007, 2008, 2009 +# Free Software Foundation, Inc. + +timestamp='2009-06-10' + +# 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 +# the Free Software Foundation; either version 2 of the License, or +# (at your option) 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., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Originally written by Per Bothner <per@bothner.com>. +# Please send patches to <config-patches@gnu.org>. Submit a context +# diff and a properly formatted ChangeLog entry. +# +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# exits with 0. Otherwise, it exits with 1. +# +# The plan is that this can be called by configure scripts if you +# don't specify an explicit build system type. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to <config-patches@gnu.org>." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +trap 'exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +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" ; } || + { 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 ; } ; +dummy=$tmp/dummy ; +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ; set_cc_for_build= ;' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +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 + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + armeb) machine=armeb-unknown ;; + 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 + # to ELF recently, or will in the future. + case "${UNAME_MACHINE_ARCH}" in + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ELF__ + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "${UNAME_VERSION}" in + Debian*) + release='-gnu' + ;; + *) + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + exit ;; + *: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} + exit ;; + *:MirBSD:*:*) + echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + exit ;; + alpha:OSF1:*:*) + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE="alpha" ;; + "EV4.5 (21064)") + UNAME_MACHINE="alpha" ;; + "LCA4 (21066/21068)") + UNAME_MACHINE="alpha" ;; + "EV5 (21164)") + UNAME_MACHINE="alphaev5" ;; + "EV5.6 (21164A)") + UNAME_MACHINE="alphaev56" ;; + "EV5.6 (21164PC)") + UNAME_MACHINE="alphapca56" ;; + "EV5.7 (21164PC)") + UNAME_MACHINE="alphapca57" ;; + "EV6 (21264)") + UNAME_MACHINE="alphaev6" ;; + "EV6.7 (21264A)") + UNAME_MACHINE="alphaev67" ;; + "EV6.8CB (21264C)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8AL (21264B)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8CX (21264D)") + UNAME_MACHINE="alphaev68" ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE="alphaev69" ;; + "EV7 (21364)") + UNAME_MACHINE="alphaev7" ;; + "EV7.9 (21364A)") + UNAME_MACHINE="alphaev79" ;; + esac + # A Pn.n version is a patched version. + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + exit ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit ;; + arm:riscos:*:*|arm:RISCOS:*:*) + echo arm-unknown-riscos + exit ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit ;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7; exit ;; + esac ;; + s390x:SunOS:*:*) + echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) + eval $set_cc_for_build + SUN_ARCH="i386" + # If there is a compiler, see if it is configured for 64-bit objects. + # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. + # This test works for both compilers. + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + SUN_ARCH="x86_64" + fi + fi + echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; + m68k:machten:*:*) + echo m68k-apple-machten${UNAME_RELEASE} + exit ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include <stdio.h> /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && + dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`$dummy $dummyarg` && + { echo "$SYSTEM_NAME"; exit; } + echo mips-mips-riscos${UNAME_RELEASE} + exit ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include <sys/systemcfg.h> + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + then + echo "$SYSTEM_NAME" + else + echo rs6000-ibm-aix3.2.5 + fi + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit ;; + *:AIX:*:[456]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include <stdlib.h> + #include <unistd.h> + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if [ ${HP_ARCH} = "hppa2.0w" ] + then + eval $set_cc_for_build + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + grep -q __LP64__ + then + HP_ARCH="hppa2.0w" + else + HP_ARCH="hppa64" + fi + fi + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include <unistd.h> + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + echo unknown-hitachi-hiuxwe2 + exit ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + *:UNICOS/mp:*:*) + echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:BSD/OS:*:*) + 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 + exit ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit ;; + *:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit ;; + i*:windows32*:*) + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 + exit ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit ;; + *:Interix*:[3456]*) + case ${UNAME_MACHINE} in + x86) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + EM64T | authenticamd | genuineintel) + echo x86_64-unknown-interix${UNAME_RELEASE} + exit ;; + IA64) + echo ia64-unknown-interix${UNAME_RELEASE} + exit ;; + esac ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks + exit ;; + 8664:Windows_NT:*) + echo x86_64-pc-mks + exit ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i586-pc-interix + exit ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + *:GNU:*:*) + # the GNU system + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu + exit ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit ;; + arm*:Linux:*:*) + eval $set_cc_for_build + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then + echo ${UNAME_MACHINE}-unknown-linux-gnu + else + echo ${UNAME_MACHINE}-unknown-linux-gnueabi + fi + exit ;; + avr32*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + cris:Linux:*:*) + echo cris-axis-linux-gnu + exit ;; + crisv32:Linux:*:*) + echo crisv32-axis-linux-gnu + exit ;; + frv:Linux:*:*) + echo frv-unknown-linux-gnu + exit ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + mips:Linux:*:* | mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef ${UNAME_MACHINE} + #undef ${UNAME_MACHINE}el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=${UNAME_MACHINE}el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=${UNAME_MACHINE} + #else + CPU= + #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-gnu"; exit; } + ;; + or32:Linux:*:*) + echo or32-unknown-linux-gnu + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep -q ld.so.1 + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit ;; + padre:Linux:*:*) + echo sparc-unknown-linux-gnu + 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-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + exit ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + vax:Linux:*:*) + echo ${UNAME_MACHINE}-dec-linux-gnu + exit ;; + x86_64:Linux:*:*) + echo x86_64-unknown-linux-gnu + exit ;; + xtensa*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + i*86:Linux:*:*) + # The BFD linker knows what the default object file format is, so + # first see if it will tell us. cd to the root directory to prevent + # problems with other programs or directories called `ld' in the path. + # Set LC_ALL=C to ensure ld outputs messages in English. + ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ + | sed -ne '/supported targets:/!d + s/[ ][ ]*/ /g + s/.*supported targets: *// + s/ .*// + p'` + case "$ld_supported_targets" in + elf32-i386) + TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" + ;; + esac + # Determine whether the default compiler is a.out or elf + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include <features.h> + #ifdef __ELF__ + # ifdef __GLIBC__ + # if __GLIBC__ >= 2 + LIBC=gnu + # else + LIBC=gnulibc1 + # endif + # else + LIBC=gnulibc1 + # endif + #else + #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) + LIBC=gnu + #else + LIBC=gnuaout + #endif + #endif + #ifdef __dietlibc__ + LIBC=dietlibc + #endif +EOF + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^LIBC/{ + s: ::g + p + }'`" + test x"${LIBC}" != x && { + echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + exit + } + test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } + ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit ;; + i*86:syllable:*:*) + echo ${UNAME_MACHINE}-pc-syllable + exit ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` + echo ${UNAME_MACHINE}-pc-isc$UNAME_REL + elif /bin/uname -X 2>/dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i586. + # Note: whatever this is, it MUST be the same as what config.sub + # prints for the "djgpp" host, or else GDB configury will decide that + # this is a cross-build. + echo i586-pc-msdosdjgpp + exit ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit ;; + M68*:*:R3V[5678]*:*) + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + NCR*:*:4.2:* | MPRAS*:*:4.2:*) + OS_REL='.3' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says <Richard.M.Bartel@ccMail.Census.GOV> + echo i586-unisys-sysv4 + exit ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes <hewes@openmarket.com>. + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + echo ${UNAME_MACHINE}-stratus-vos + exit ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit ;; + BePC:Haiku:*:*) # Haiku running on Intel PC compatible. + echo i586-pc-haiku + exit ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit ;; + 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 ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + case $UNAME_PROCESSOR in + unknown) UNAME_PROCESSOR=powerpc ;; + esac + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + exit ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = "x86"; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + exit ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit ;; + NSE-?:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk${UNAME_RELEASE} + exit ;; + NSR-?:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux${UNAME_RELEASE} + exit ;; + *:DragonFly:*:*) + echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "${UNAME_MACHINE}" in + A*) echo alpha-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; + V*) echo vax-dec-vms ; exit ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit ;; + i*86:skyos:*:*) + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' + exit ;; + i*86:rdos:*:*) + echo ${UNAME_MACHINE}-pc-rdos + exit ;; + i*86:AROS:*:*) + echo ${UNAME_MACHINE}-pc-aros + exit ;; +esac + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +eval $set_cc_for_build +cat >$dummy.c <<EOF +#ifdef _SEQUENT_ +# include <sys/types.h> +# include <sys/utsname.h> +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include <sys/param.h> + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix\n"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +# if !defined (ultrix) +# include <sys/param.h> +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# else + printf ("vax-dec-ultrix\n"); exit (0); +# endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + c34*) + echo c34-convex-bsd + exit ;; + c38*) + echo c38-convex-bsd + exit ;; + c4*) + echo c4-convex-bsd + exit ;; + esac +fi + +cat >&2 <<EOF +$0: unable to guess system type + +This script, last modified $timestamp, has failed to recognize +the operating system you are using. It is advised that you +download the most up to date version of the config scripts from + + http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD +and + http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD + +If the version you run ($0) is already up to date, please +send the following data and any information you think might be +pertinent to <config-patches@gnu.org> in order to provide the needed +information to handle your system. + +config.guess timestamp = $timestamp + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/src/3rdparty/libconninet/config.sub b/src/3rdparty/libconninet/config.sub new file mode 100755 index 0000000..eb0389a --- /dev/null +++ b/src/3rdparty/libconninet/config.sub @@ -0,0 +1,1693 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 +# Free Software Foundation, Inc. + +timestamp='2009-06-11' + +# This file is (in principle) common to ALL GNU software. +# The presence of a machine in this file suggests that SOME GNU software +# can handle that machine. It does not imply ALL GNU software can. +# +# 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 +# the Free Software Foundation; either version 2 of the License, or +# (at your option) 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., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Please send patches to <config-patches@gnu.org>. Submit a context +# diff and a properly formatted ChangeLog entry. +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to <config-patches@gnu.org>." + +version="\ +GNU config.sub ($timestamp) + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit ;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# 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* | \ + kopensolaris*-gnu* | \ + storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis | -knuth | -cray) + os= + basic_machine=$1 + ;; + -bluegene*) + os=-cnk + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -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/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # 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/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | 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 \ + | bfin \ + | c4x | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | fido | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ + | lm32 \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | maxq | mb | microblaze | mcore | mep | metag \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64octeon | mips64octeonel \ + | mips64orion | mips64orionel \ + | mips64r5900 | mips64r5900el \ + | mips64vr | mips64vrel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | moxie \ + | mt \ + | 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]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ + | spu | strongarm \ + | tahoe | thumb | tic4x | tic80 | tron \ + | v850 | v850e \ + | we32k \ + | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ + | z8k | z80) + basic_machine=$basic_machine-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12) + # Motorola 68HC11/12. + basic_machine=$basic_machine-unknown + os=-none + ;; + 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 + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* | avr32-* \ + | 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-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* | iq2000-* \ + | lm32-* \ + | m32c-* | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64octeon-* | mips64octeonel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64r5900-* | mips64r5900el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr5900-* | mips64vr5900el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | mt-* \ + | 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]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ + | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ + | tahoe-* | thumb-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \ + | tron-* \ + | v850-* | v850e-* | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ + | xstormy16-* | xtensa*-* \ + | ymp-* \ + | z8k-* | z80-*) + ;; + # Recognize the basic CPU types without company name, with glob match. + xtensa*) + basic_machine=$basic_machine-unknown + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + abacus) + basic_machine=abacus-unknown + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amd64) + basic_machine=x86_64-pc + ;; + amd64-*) + basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aros) + basic_machine=i386-pc + os=-aros + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + blackfin) + basic_machine=bfin-unknown + os=-linux + ;; + blackfin-*) + basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + bluegene*) + basic_machine=powerpc-ibm + os=-cnk + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + cegcc) + basic_machine=arm-unknown + os=-cegcc + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + craynv) + basic_machine=craynv-cray + os=-unicosmp + ;; + cr16) + basic_machine=cr16-unknown + os=-elf + ;; + crds | unos) + basic_machine=m68k-crds + ;; + crisv32 | crisv32-* | etraxfs*) + basic_machine=crisv32-axis + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + crx) + basic_machine=crx-unknown + os=-elf + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + dicos) + basic_machine=i686-pc + os=-dicos + ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; +# I'm not sure what "Sysv32" means. Should this be sysv3.2? + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m68knommu) + basic_machine=m68k-unknown + os=-linux + ;; + m68knommu-*) + basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + mingw32) + basic_machine=i386-pc + os=-mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + os=-mingw32ce + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + ms1-*) + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + openrisc | openrisc-*) + basic_machine=or32-unknown + ;; + os400) + basic_machine=powerpc-ibm + os=-os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + parisc) + basic_machine=hppa-unknown + os=-linux + ;; + parisc-*) + basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + 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 + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2 | pentiumiii | pentium3) + basic_machine=i686-pc + ;; + pentium4) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium4-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc) basic_machine=powerpc-unknown + ;; + ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rdos) + basic_machine=i386-pc + os=-rdos + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sde) + basic_machine=mipsisa32-sde + os=-elf + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sh5el) + basic_machine=sh5le-unknown + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tic54x | c54x*) + basic_machine=tic54x-unknown + os=-coff + ;; + tic55x | c55x*) + basic_machine=tic55x-unknown + os=-coff + ;; + tic6x | c6x*) + basic_machine=tic6x-unknown + os=-coff + ;; + tile*) + basic_machine=tile-unknown + os=-linux-gnu + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + tpf) + basic_machine=s390x-ibm + os=-tpf + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + xbox) + basic_machine=i686-pc + os=-mingw32 + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + z80-*-coff) + basic_machine=z80-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + mmix) + basic_machine=mmix-knuth + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ + | -kopensolaris* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* | -aros* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ + | -openbsd* | -solidbsd* \ + | -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* | -cegcc* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -linux-newlib* | -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*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto-qnx*) + ;; + -nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux-dietlibc) + os=-linux-dietlibc + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -os400*) + os=-os400 + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -syllable*) + os=-syllable + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -tpf*) + os=-tpf + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -aros*) + os=-aros + ;; + -kaos*) + os=-kaos + ;; + -zvmoe) + os=-zvmoe + ;; + -dicos*) + os=-dicos + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + score-*) + os=-elf + ;; + spu-*) + os=-elf + ;; + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + c4x-* | tic4x-*) + os=-coff + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + # This also exists in the configure program, but was not the + # default. + # os=-sunos4 + ;; + m68*-cisco) + os=-aout + ;; + mep-*) + os=-elf + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-haiku) + os=-haiku + ;; + *-ibm) + os=-aix + ;; + *-knuth) + os=-mmixware + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -cnk*|-aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -os400*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -tpf*) + vendor=ibm + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/src/3rdparty/libconninet/configure.ac b/src/3rdparty/libconninet/configure.ac new file mode 100644 index 0000000..2a383ee --- /dev/null +++ b/src/3rdparty/libconninet/configure.ac @@ -0,0 +1,90 @@ +AC_INIT([libconninet], patsubst(esyscmd([dpkg-parsechangelog | sed -n '/^Version: \(.*\)$/ {s//\1/;p}']), [ +]), [jukka.rissanen@nokia.com]) +AM_INIT_AUTOMAKE([foreign]) + +AC_PROG_CXX +AC_PROG_LIBTOOL + +AC_ARG_ENABLE(docs, [ --enable-docs Build DOXYGEN documentation (requires Doxygen)],enable_docs=$enableval,enable_docs=auto) + +AC_PATH_PROG(DOXYGEN, doxygen, no) +AC_MSG_CHECKING([whether to build Doxygen documentation]) + +if test x$DOXYGEN = xno ; then + have_doxygen=no +else + have_doxygen=yes +fi +if test x$enable_docs = xauto ; then + if test x$have_doxygen = xno ; then + enable_docs=no + else + enable_docs=yes + fi +fi +if test x$enable_docs = xyes; then + if test x$have_doxygen = xno; then + AC_MSG_ERROR([Building Doxygen docs explicitly required, but Doxygen not found]) + else + AC_MSG_RESULT(yes) + fi +else + AC_MSG_RESULT(no) +fi + +AM_CONDITIONAL(DOXYGEN_DOCS_ENABLED, test x$enable_docs = xyes) +AC_SUBST(DOXYGEN) + +PKG_CHECK_MODULES(GLIB, glib-2.0) +AC_SUBST(GLIB_CFLAGS) +AC_SUBST(GLIB_LIBS) + +PKG_CHECK_MODULES(QTCORE, QtCore) +AC_SUBST(QTCORE_CFLAGS) +AC_SUBST(QTCORE_LIBS) + +PKG_CHECK_MODULES(QTNETWORK, QtNetwork) +AC_SUBST(QTNETWORK_CFLAGS) +AC_SUBST(QTNETWORK_LIBS) + +PKG_CHECK_MODULES(QTDBUS, QtDBus) +AC_SUBST(QTDBUS_CFLAGS) +AC_SUBST(QTDBUS_LIBS) + +PKG_CHECK_MODULES(QTTEST, QtTest) +AC_SUBST(QTTEST_CFLAGS) +AC_SUBST(QTTEST_LIBS) + +PKG_CHECK_MODULES(DBUS, dbus-glib-1) +AC_SUBST(DBUS_CFLAGS) +AC_SUBST(DBUS_LIBS) + +PKG_CHECK_MODULES(CONNSETTINGS, connsettings) +AC_SUBST(CONNSETTINGS_CFLAGS) +AC_SUBST(CONNSETTINGS_LIBS) + +PKG_CHECK_MODULES(OSSO_IC, osso-ic) +AC_SUBST(OSSO_IC_CFLAGS) +AC_SUBST(OSSO_IC_LIBS) + +PKG_CHECK_MODULES(ICD_DEV, icd2) +AC_SUBST(ICD_DEV_CFLAGS) +AC_SUBST(ICD_DEV_LIBS) + +PKG_CHECK_MODULES(GCONF, gconf-2.0) +AC_SUBST(GCONF_CFLAGS) +AC_SUBST(GCONF_LIBS) + +PKG_CHECK_MODULES(QGCONF, gq-gconf) +AC_SUBST(QGCONF_CFLAGS) +AC_SUBST(QGCONF_LIBS) + +CONCFLAGS="-Wall -Werror -Wmissing-prototypes" +AC_SUBST(CONCFLAGS) + +AC_CONFIG_FILES([Makefile \ + src/Makefile \ + tests/Makefile \ + conninet.pc \ + doxygen.cfg]) +AC_OUTPUT diff --git a/src/3rdparty/libconninet/conninet.pc.in b/src/3rdparty/libconninet/conninet.pc.in new file mode 100644 index 0000000..68cdee0 --- /dev/null +++ b/src/3rdparty/libconninet/conninet.pc.in @@ -0,0 +1,11 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: libconninet +Description: Internet Connectivity support library +Version: @VERSION@ +Requires: dbus-1 >= 0.60 glib-2.0 QtCore QtDBus QtGui +Libs: -lconninet +Cflags: -I${includedir}/conninet diff --git a/src/3rdparty/libconninet/debian/changelog b/src/3rdparty/libconninet/debian/changelog new file mode 100644 index 0000000..436d318 --- /dev/null +++ b/src/3rdparty/libconninet/debian/changelog @@ -0,0 +1,285 @@ +libconninet (0.41+0m6) unstable; urgency=low + + * This entry has been added by BIFH queue processor + version has been changed to 0.41+0m6 + + -- Qing Jin <ext-qing.1.jin@nokia.com> Thu, 15 Jul 2010 15:56:38 +0300 + +libconninet (0.41) unstable; urgency=low + + * Fixes: NB#175098 - Qt4.7 Webkit crashes when bearer API QNetworkSession + constructor calls QNetworkSession::syncStateWithInterface() which in turn + calls Maemo::state() and Maemo::addrinfo() and webkit expects that event + loop is not run but those function process main loop events. + Now Maemo::state() and Maemo::addrinfo() are changed to be synchronous + and fully blocking functions. The old non-blocking versions are called + Maemo::state_non_blocking() and Maemo::addrinfo_non_blocking(). + + -- Jukka Rissanen <jukka.rissanen@nokia.com> Wed, 14 Jul 2010 10:12:47 +0300 + +libconninet (0.40) unstable; urgency=low + + * Fixes: NB#167465 - Unable to open network connection using libbearer + + -- Jukka Rissanen <jukka.rissanen@nokia.com> Tue, 11 May 2010 10:47:10 +0300 + +libconninet (0.39) unstable; urgency=low + + * Fixes: NB#167982 - initialize DBus vtable in DBusDispatcher. + + -- Aapo Makela <aapo.makela@nokia.com> Mon, 10 May 2010 14:42:39 +0300 + +libconninet (0.38) unstable; urgency=low + + * Changing icd2 connect_req to be synchronous as the check for + returned connect signal did not work correctly, this caused a + long timeout when connect() was called. + * Scan sometimes missed results and did not return them to caller. + * HTTP proxy settings were not set correctly. + + -- Jukka Rissanen <jukka.rissanen@nokia.com> Thu, 15 Apr 2010 11:25:06 +0300 + +libconninet (0.37) unstable; urgency=low + + * Make proxy config reference counting atomic. + + -- Jukka Rissanen <jukka.rissanen@nokia.com> Wed, 3 Mar 2010 13:23:08 +0200 + +libconninet (0.36) unstable; urgency=low + + * Fixes: NB#157586 - Cleanup dbus listener when WLAN scanning object is + deleted. + + -- Jukka Rissanen <jukka.rissanen@nokia.com> Fri, 26 Feb 2010 13:30:41 +0200 + +libconninet (0.35) unstable; urgency=low + + * Fixes: NB#156883 - libconninet fails to build under the Platform SDK (SB2) + + -- Jukka Rissanen <jukka.rissanen@nokia.com> Thu, 18 Feb 2010 12:14:40 +0200 + +libconninet (0.34) unstable; urgency=low + + * Coverity fix + + -- Jukka Rissanen <jukka.rissanen@nokia.com> Tue, 16 Feb 2010 16:38:00 +0200 + +libconninet (0.33) unstable; urgency=low + + * Added API to update Qt proxy config. + + -- Jukka Rissanen <jukka.rissanen@nokia.com> Tue, 26 Jan 2010 15:48:36 +0200 + +libconninet (0.32) unstable; urgency=low + + * Fixed IAPConf to unset value when set value is invalid. + * Updated IAPMonitor to use libconnsettings. + + -- Aapo Makela <aapo.makela@nokia.com> Wed, 03 Feb 2010 07:32:45 +0200 + +libconninet (0.31) unstable; urgency=low + + * Fixes: NB#154892 - Check nulls in IAPConf. + + -- Aapo Makela <aapo.makela@nokia.com> Mon, 01 Feb 2010 09:32:06 +0200 + +libconninet (0.30) unstable; urgency=low + + * Updated IAPConf to use libconnsettings. + + -- Aapo Makela <aapo.makela@nokia.com> Fri, 29 Jan 2010 12:58:03 +0200 + +libconninet (0.29) unstable; urgency=low + + * Fixed dependencies + + -- Jukka Rissanen <jukka.rissanen@nokia.com> Fri, 15 Jan 2010 10:16:07 +0200 + +libconninet (0.28) unstable; urgency=low + + * Get rid of libdui dependency + + -- Jukka Rissanen <jukka.rissanen@nokia.com> Wed, 13 Jan 2010 09:56:26 +0200 + +libconninet (0.27) unstable; urgency=low + + * Insert new pending calls to the list in DBusDispatcher. + + -- Aapo Makela <aapo.makela@nokia.com> Tue, 22 Dec 2009 14:27:32 +0200 + +libconninet (0.26) unstable; urgency=low + + * Added possibility to specify different signal path for DBusDispatcher. + + -- Aapo Makela <aapo.makela@nokia.com> Wed, 25 Nov 2009 14:27:34 +0200 + +libconninet (0.25) unstable; urgency=low + + * Fixes: NB#146450 - All scan results were not returned to the caller. + + -- Jukka Rissanen <jukka.rissanen@nokia.com> Mon, 16 Nov 2009 17:23:15 +0200 + +libconninet (0.24) unstable; urgency=low + + * Wait all scan results for all network types in Maemo::Icd::scan() + + -- Jukka Rissanen <jukka.rissanen@nokia.com> Fri, 6 Nov 2009 14:45:23 +0200 + +libconninet (0.23) unstable; urgency=low + + * Fixes: NB#143361 - Assert failure in session class for GPRS IAP. + + -- Jukka Rissanen <jukka.rissanen@nokia.com> Mon, 19 Oct 2009 16:00:14 +0300 + +libconninet (0.22) unstable; urgency=low + + * Fixed the error checking if scan returns 0 results. + + -- Jukka Rissanen <jukka.rissanen@nokia.com> Wed, 7 Oct 2009 13:50:27 +0300 + +libconninet (0.21) unstable; urgency=low + + * Support multiple DBusDispatcher classes at the same time. This is + required by Maemo::Icd class so that multiple instances of it can + be used the same time. + + -- Jukka Rissanen <jukka.rissanen@nokia.com> Mon, 5 Oct 2009 16:33:43 +0300 + +libconninet (0.20) unstable; urgency=low + + * Fixed memory leak in IAPConf::setValue() + + -- Jukka Rissanen <jukka.rissanen@nokia.com> Fri, 2 Oct 2009 13:02:21 +0300 + +libconninet (0.19) unstable; urgency=low + + * Fixed connect_req to one specific IAP in Icd class. + + -- Jukka Rissanen <jukka.rissanen@nokia.com> Tue, 29 Sep 2009 17:02:46 +0300 + +libconninet (0.18) unstable; urgency=low + + * Make sure the library will not abort in Icd class if scan does + not return any results. + + -- Jukka Rissanen <jukka.rissanen@nokia.com> Tue, 22 Sep 2009 17:00:12 +0300 + +libconninet (0.17) unstable; urgency=low + + * Added IAP monitoring support. + + -- Jukka Rissanen <jukka.rissanen@nokia.com> Mon, 21 Sep 2009 16:29:31 +0300 + +libconninet (0.16) unstable; urgency=low + + * Disabled the old osso-ic dbus interface as it is currently not used. + * Fixed the addrinfo request, now addresses are returned correctly to + the caller. + + -- Jukka Rissanen <jukka.rissanen@nokia.com> Thu, 17 Sep 2009 15:56:13 +0300 + +libconninet (0.15) unstable; urgency=low + + * Enabling state_req, statistics_req and addrinfo_req support + functions in Maemo::Icd as the corresponding DBUS API functions are + fixed in icd2 v0.89 + + -- Jukka Rissanen <jukka.rissanen@nokia.com> Fri, 24 Jul 2009 15:23:02 +0300 + +libconninet (0.14) unstable; urgency=low + + * Icd statistics support added. + * Icd address information support added. + * Icd scan method does not return the final (and empty) result any more. + * Added initial unit test implementation for Icd class. + * Some of the status functions in Icd class disabled because of issues + in icd2 and the dbus api. + + -- Jukka Rissanen <jukka.rissanen@nokia.com> Thu, 23 Jul 2009 11:03:05 +0300 + +libconninet (0.13) unstable; urgency=low + + * Added API to get all the configured IAPs. + + -- Jukka Rissanen <jukka.rissanen@nokia.com> Tue, 21 Jul 2009 09:47:18 +0300 + +libconninet (0.12) unstable; urgency=low + + * Replaced duivaluespace by Dui in pkg-config file because the + duivaluespace is deprecated. + + -- Jukka Rissanen <jukka.rissanen@nokia.com> Mon, 20 Jul 2009 16:00:10 +0300 + +libconninet (0.11) unstable; urgency=low + + * Using libdui instead of libduivaluespace because it is deprecated. + * The IAPConf::clear() uses native gconf API instead of launching gconftool + * Check that state_req call returned list and the list contains entries + before trying to access it. + + -- Jukka Rissanen <jukka.rissanen@nokia.com> Mon, 20 Jul 2009 14:55:15 +0300 + +libconninet (0.10) unstable; urgency=low + + * connect() did not return ok when connection succeeded. + + -- Jukka Rissanen <jukka.rissanen@nokia.com> Thu, 25 Jun 2009 09:31:21 +0300 + +libconninet (0.9) unstable; urgency=low + + * Connection timeout set to 2.5min, same as in fremantle. + + -- Jukka Rissanen <jukka.rissanen@nokia.com> Wed, 17 Jun 2009 13:36:40 +0300 + +libconninet (0.8) unstable; urgency=low + + * Fix state_req signal received from Icd + + -- Jukka Rissanen <jukka.rissanen@nokia.com> Thu, 11 Jun 2009 17:19:33 +0300 + +libconninet (0.7) unstable; urgency=low + + * Icd disconnect and select reqs are made synchronous as we do not + wait the return status. The previous async version was causing core + dumps if Icd class was destroyed too early. + + -- Jukka Rissanen <jukka.rissanen@nokia.com> Thu, 11 Jun 2009 11:52:36 +0300 + +libconninet (0.6) unstable; urgency=low + + * Fixed the libconninet0-dev dependencies. + + -- Jukka Rissanen <jukka.rissanen@nokia.com> Mon, 8 Jun 2009 10:47:56 +0300 + +libconninet (0.5) unstable; urgency=low + + * Fixed missing QObject connect functions. + * Fixed IAPConf to return invalid QVariant if the value does not exist. + + -- Jukka Rissanen <jukka.rissanen@nokia.com> Mon, 01 Jun 2009 13:58:53 +0300 + +libconninet (0.4) unstable; urgency=low + + * Fixed QObject signal setting for Maemo::Icd + + -- Jukka Rissanen <jukka.rissanen@nokia.com> Wed, 20 May 2009 13:51:11 +0300 + +libconninet (0.3) unstable; urgency=low + + * Refactoring classes + * Added IAPConf class. + + -- Jukka Rissanen <jukka.rissanen@nokia.com> Thu, 14 May 2009 13:24:11 +0300 + +libconninet (0.2) unstable; urgency=low + + * Fixed pkgconfig file which had wrong dependency + * Added DBus array and struct support to DBusDispatcher. + + -- Jukka Rissanen <jukka.rissanen@nokia.com> Wed, 13 May 2009 12:11:00 +0300 + +libconninet (0.1) unstable; urgency=low + + * Initial Release. + + -- Jukka Rissanen <jukka.rissanen@nokia.com> Tue, 12 May 2009 16:10:27 +0200 diff --git a/src/3rdparty/libconninet/debian/compat b/src/3rdparty/libconninet/debian/compat new file mode 100644 index 0000000..b8626c4 --- /dev/null +++ b/src/3rdparty/libconninet/debian/compat @@ -0,0 +1 @@ +4 diff --git a/src/3rdparty/libconninet/debian/control b/src/3rdparty/libconninet/debian/control new file mode 100644 index 0000000..2db660f --- /dev/null +++ b/src/3rdparty/libconninet/debian/control @@ -0,0 +1,39 @@ +Source: libconninet +Priority: optional +Maintainer: Jukka Rissanen <jukka.rissanen@nokia.com> +Build-Depends: debhelper (>= 4.0.0), autotools-dev, libglib2.0-dev (>= 2.8), + libdbus-1-dev (>= 0.60), libconnsettings0-dev (>= 0.4), icd2-osso-ic-dev, + icd2-dev, libqt4-dev, libgconf2-dev (>> 2.6.4), libgq-gconf-dev +Standards-Version: 3.6.2 +Section: libs + +Package: libconninet0-dev +Section: libdevel +Architecture: any +Depends: libconninet0 (= ${Source-Version}), libdbus-1-dev (>= 0.60), + libglib2.0-dev (>= 2.8), libconnsettings0-dev (>= 0.4), libqt4-dev, + icd2-osso-ic-dev, icd2-dev, libgconf2-dev (>> 2.6.4), libgq-gconf-dev +Description: Internet Connectivity support library development files + Internet Connectivity support library (libconninet) provides common + support functions for connecting to icd2 and accessing configuration + data. + . + This package contains the header files. + +Package: libconninet0 +Section: libs +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Internet Connectivity support library + Internet Connectivity support library (libconninet) provides common + support functions for connecting to icd2 and accessing configuration + data. + . + This package contains the shared libraries. + +Package: libconninet0-dbg +Section: libs +Architecture: any +Depends: libconninet0 (= ${Source-Version}), ${shlibs:Depends}, ${misc:Depends} +Description: Debug symbols for the Internet Connectivity support library + Internet Connectivity support library (libconninet) debug symbols. diff --git a/src/3rdparty/libconninet/debian/copyright b/src/3rdparty/libconninet/debian/copyright new file mode 100644 index 0000000..97e8e68 --- /dev/null +++ b/src/3rdparty/libconninet/debian/copyright @@ -0,0 +1,19 @@ +libconninet - Internet Connectivity support library + +Copyright (C) 2009 Nokia Corporation. All rights reserved. + +Contact: Jukka Rissanen <jukka.rissanen@nokia.com> + +This library is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License version 2.1 +as published by the Free Software Foundation. + +This library 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 +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with this library; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +02110-1301 USA diff --git a/src/3rdparty/libconninet/debian/libconninet0-dev.dirs b/src/3rdparty/libconninet/debian/libconninet0-dev.dirs new file mode 100644 index 0000000..4418816 --- /dev/null +++ b/src/3rdparty/libconninet/debian/libconninet0-dev.dirs @@ -0,0 +1,2 @@ +usr/lib +usr/include diff --git a/src/3rdparty/libconninet/debian/libconninet0-dev.files b/src/3rdparty/libconninet/debian/libconninet0-dev.files new file mode 100644 index 0000000..78bbac8 --- /dev/null +++ b/src/3rdparty/libconninet/debian/libconninet0-dev.files @@ -0,0 +1,4 @@ +usr/include/* +usr/lib/lib*.so +usr/lib/pkgconfig/* +usr/share/pkgconfig/* diff --git a/src/3rdparty/libconninet/debian/libconninet0.dirs b/src/3rdparty/libconninet/debian/libconninet0.dirs new file mode 100644 index 0000000..6845771 --- /dev/null +++ b/src/3rdparty/libconninet/debian/libconninet0.dirs @@ -0,0 +1 @@ +usr/lib diff --git a/src/3rdparty/libconninet/debian/libconninet0.files b/src/3rdparty/libconninet/debian/libconninet0.files new file mode 100644 index 0000000..d0dbfd1 --- /dev/null +++ b/src/3rdparty/libconninet/debian/libconninet0.files @@ -0,0 +1 @@ +usr/lib/lib*.so.* diff --git a/src/3rdparty/libconninet/debian/rules b/src/3rdparty/libconninet/debian/rules new file mode 100755 index 0000000..2a3d395 --- /dev/null +++ b/src/3rdparty/libconninet/debian/rules @@ -0,0 +1,123 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + + +# These are used for cross-compiling and for saving the configure script +# from having to guess our platform (since we know it already) +DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) +DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) + + +CFLAGS = -Wall -g + +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 +else + CFLAGS += -O2 +endif + +# shared library versions, option 1 +#version=2.0.5 +#major=2 +# option 2, assuming the library is created as src/.libs/libfoo.so.2.0.5 or so +version=`ls src/.libs/lib*.so.* | \ + awk '{if (match($$0,/[0-9]+\.[0-9]+\.[0-9]+$$/)) print substr($$0,RSTART)}'` +major=`ls src/.libs/lib*.so.* | \ + awk '{if (match($$0,/\.so\.[0-9]+$$/)) print substr($$0,RSTART+4)}'` + +configure: configure.ac debian/changelog + -./autogen.sh + +config.status: configure + dh_testdir + # Add here commands to configure the package. + CFLAGS="$(CFLAGS)" ./configure \ + --host=$(DEB_HOST_GNU_TYPE) \ + --build=$(DEB_BUILD_GNU_TYPE) \ + --prefix=/usr \ + --mandir=\$${prefix}/share/man \ + --infodir=\$${prefix}/share/info + + +build: build-stamp +build-stamp: config.status + dh_testdir + + # Add here commands to compile the package. + $(MAKE) + + touch build-stamp + +clean: + dh_testdir + dh_testroot + rm -f build-stamp + + # Add here commands to clean up after the build process. + -$(MAKE) distclean +ifneq "$(wildcard /usr/share/misc/config.sub)" "" + cp -f /usr/share/misc/config.sub config.sub +endif +ifneq "$(wildcard /usr/share/misc/config.guess)" "" + cp -f /usr/share/misc/config.guess config.guess +endif + + + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + # Add here commands to install the package into debian/tmp + $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp + + +# Build architecture-independent files here. +binary-indep: build install +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot + dh_movefiles + dh_installchangelogs ChangeLog + dh_installdocs + dh_installexamples +# dh_install +# dh_installmenu +# dh_installdebconf +# dh_installlogrotate +# dh_installemacsen +# dh_installpam +# dh_installmime +# dh_installinit +# dh_installcron +# dh_installinfo + dh_installman + dh_link + dh_strip --dbg-package=libconninet0 + dh_compress + dh_fixperms +# dh_perl +# dh_python + dh_makeshlibs + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install diff --git a/src/3rdparty/libconninet/doxygen.cfg.in b/src/3rdparty/libconninet/doxygen.cfg.in new file mode 100644 index 0000000..80a4c8d --- /dev/null +++ b/src/3rdparty/libconninet/doxygen.cfg.in @@ -0,0 +1,1147 @@ +# Doxyfile 1.3.7 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project +# +# All text after a hash (#) is considered a comment and will be ignored +# The format is: +# TAG = value [value, ...] +# For lists items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (" ") + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded +# by quotes) that should identify the project. + +PROJECT_NAME = "Internet Connectivity Support Library" + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. +# This could be handy for archiving the generated documentation or +# if some version control system is used. + +PROJECT_NUMBER = @VERSION@ + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) +# base path where the generated documentation will be put. +# If a relative path is entered, it will be relative to the location +# where doxygen was started. If left blank the current directory will be used. + +OUTPUT_DIRECTORY = doc + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create +# 2 levels of 10 sub-directories under the output directory of each output +# format and will distribute the generated files over these directories. +# Enabling this option can be useful when feeding doxygen a huge amount of source +# files, where putting all generated files in the same directory would otherwise +# cause performance problems for the file system. + +CREATE_SUBDIRS = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# The default language is English, other supported languages are: +# Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, Dutch, +# Finnish, French, German, Greek, Hungarian, Italian, Japanese, Japanese-en +# (Japanese with English messages), Korean, Korean-en, Norwegian, Polish, Portuguese, +# Romanian, Russian, Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian. + +OUTPUT_LANGUAGE = English + +# This tag can be used to specify the encoding used in the generated output. +# The encoding is not always determined by the language that is chosen, +# but also whether or not the output is meant for Windows or non-Windows users. +# In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES +# forces the Windows encoding (this is the default for the Windows binary), +# whereas setting the tag to NO uses a Unix-style encoding (the default for +# all platforms other than Windows). + +USE_WINDOWS_ENCODING = NO + +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will +# include brief member descriptions after the members that are listed in +# the file and class documentation (similar to JavaDoc). +# Set to NO to disable this. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend +# the brief description of a member or function before the detailed description. +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator +# that is used to form the text in various listings. Each string +# in this list, if found as the leading text of the brief description, will be +# stripped from the text and the result after processing the whole list, is used +# as the annotated text. Otherwise, the brief description is used as-is. If left +# blank, the following values are used ("$name" is automatically replaced with the +# name of the entity): "The $name class" "The $name widget" "The $name file" +# "is" "provides" "specifies" "contains" "represents" "a" "an" "the" + +ABBREVIATE_BRIEF = + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# Doxygen will generate a detailed section even if there is only a brief +# description. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all inherited +# members of a class in the documentation of that class as if those members were +# ordinary class members. Constructors, destructors and assignment operators of +# the base classes will not be shown. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full +# path before files name in the file list and in the header files. If set +# to NO the shortest path that makes the file name unique will be used. + +FULL_PATH_NAMES = NO + +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag +# can be used to strip a user-defined part of the path. Stripping is +# only done if one of the specified strings matches the left-hand part of +# the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the +# path to strip. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of +# the path mentioned in the documentation of a class, which tells +# the reader which header file to include in order to use a class. +# If left blank only the name of the header file containing the class +# definition is used. Otherwise one should specify the include paths that +# are normally passed to the compiler using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter +# (but less readable) file names. This can be useful is your file systems +# doesn't support long names like on DOS, Mac, or CD-ROM. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen +# will interpret the first line (until the first dot) of a JavaDoc-style +# comment as the brief description. If set to NO, the JavaDoc +# comments will behave just like the Qt-style comments (thus requiring an +# explicit @brief command for a brief description. + +JAVADOC_AUTOBRIEF = YES + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen +# treat a multi-line C++ special comment block (i.e. a block of //! or /// +# comments) as a brief description. This used to be the default behaviour. +# The new default is to treat a multi-line C++ comment block as a detailed +# description. Set this tag to YES if you prefer the old behaviour instead. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the DETAILS_AT_TOP tag is set to YES then Doxygen +# will output the detailed description near the top, like JavaDoc. +# If set to NO, the detailed description appears after the member +# documentation. + +DETAILS_AT_TOP = YES + +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented +# member inherits the documentation from any documented member that it +# re-implements. + +INHERIT_DOCS = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. + +DISTRIBUTE_GROUP_DOC = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. +# Doxygen uses this value to replace tabs by spaces in code fragments. + +TAB_SIZE = 8 + +# This tag can be used to specify a number of aliases that acts +# as commands in the documentation. An alias has the form "name=value". +# For example adding "sideeffect=\par Side Effects:\n" will allow you to +# put the command \sideeffect (or @sideeffect) in the documentation, which +# will result in a user-defined paragraph with heading "Side Effects:". +# You can put \n's in the value part of an alias to insert newlines. + +ALIASES = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources +# only. Doxygen will then generate output that is more tailored for C. +# For instance, some of the names that are used will be different. The list +# of all members will be omitted, etc. + +OPTIMIZE_OUTPUT_FOR_C = YES + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java sources +# only. Doxygen will then generate output that is more tailored for Java. +# For instance, namespaces will be presented as packages, qualified scopes +# will look different, etc. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the SUBGROUPING tag to YES (the default) to allow class member groups of +# the same type (for instance a group of public functions) to be put as a +# subgroup of that type (e.g. under the Public Functions section). Set it to +# NO to prevent subgrouping. Alternatively, this can be done per class using +# the \nosubgrouping command. + +SUBGROUPING = YES + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. +# Private class members and static file members will be hidden unless +# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES + +EXTRACT_ALL = NO + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class +# will be included in the documentation. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_STATIC tag is set to YES all static members of a file +# will be included in the documentation. + +EXTRACT_STATIC = NO + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) +# defined locally in source files will be included in the documentation. +# If set to NO only classes defined in header files are included. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. When set to YES local +# methods, which are defined in the implementation section but not in +# the interface are included in the documentation. +# If set to NO (the default) only methods in the interface are included. + +EXTRACT_LOCAL_METHODS = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all +# undocumented members of documented classes, files or namespaces. +# If set to NO (the default) these members will be included in the +# various overviews, but no documentation section is generated. +# This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_MEMBERS = YES + +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. +# If set to NO (the default) these classes will be included in the various +# overviews. This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all +# friend (class|struct|union) declarations. +# If set to NO (the default) these declarations will be included in the +# documentation. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any +# documentation blocks found inside the body of a function. +# If set to NO (the default) these blocks will be appended to the +# function's detailed documentation block. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation +# that is typed after a \internal command is included. If the tag is set +# to NO (the default) then the documentation will be excluded. +# Set it to YES to include the internal documentation. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate +# file names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# users are advised to set this option to NO. + +CASE_SENSE_NAMES = YES + +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen +# will show members with their full class and namespace scopes in the +# documentation. If set to YES the scope will be hidden. + +HIDE_SCOPE_NAMES = NO + +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen +# will put a list of the files that are included by a file in the documentation +# of that file. + +SHOW_INCLUDE_FILES = YES + +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] +# is inserted in the documentation for inline members. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen +# will sort the (detailed) documentation of file and class members +# alphabetically by member name. If set to NO the members will appear in +# declaration order. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the +# brief documentation of file, namespace and class members alphabetically +# by member name. If set to NO (the default) the members will appear in +# declaration order. + +SORT_BRIEF_DOCS = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be +# sorted by fully-qualified names, including namespaces. If set to +# NO (the default), the class list will be sorted only by class name, +# not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the +# alphabetical list. + +SORT_BY_SCOPE_NAME = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or +# disable (NO) the todo list. This list is created by putting \todo +# commands in the documentation. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or +# disable (NO) the test list. This list is created by putting \test +# commands in the documentation. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or +# disable (NO) the bug list. This list is created by putting \bug +# commands in the documentation. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or +# disable (NO) the deprecated list. This list is created by putting +# \deprecated commands in the documentation. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional +# documentation sections, marked by \if sectionname ... \endif. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines +# the initial value of a variable or define consists of for it to appear in +# the documentation. If the initializer consists of more lines than specified +# here it will be hidden. Use a value of 0 to hide initializers completely. +# The appearance of the initializer of individual variables and defines in the +# documentation can be controlled using \showinitializer or \hideinitializer +# command in the documentation regardless of this setting. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated +# at the bottom of the documentation of classes and structs. If set to YES the +# list will mention the files that were used to generate the documentation. + +SHOW_USED_FILES = YES + +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated +# by doxygen. Possible values are YES and NO. If left blank NO is used. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated by doxygen. Possible values are YES and NO. If left blank +# NO is used. + +WARNINGS = YES + +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will +# automatically be disabled. + +WARN_IF_UNDOCUMENTED = YES + +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some +# parameters in a documented function, or documenting parameters that +# don't exist or using markup commands wrongly. + +WARN_IF_DOC_ERROR = YES + +# The WARN_FORMAT tag determines the format of the warning messages that +# doxygen can produce. The string should contain the $file, $line, and $text +# tags, which will be replaced by the file and line number from which the +# warning originated and the warning text. + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning +# and error messages should be written. If left blank the output is written +# to stderr. + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag can be used to specify the files and/or directories that contain +# documented source files. You may enter file names like "myfile.cpp" or +# directories like "/usr/src/myproject". Separate the files or directories +# with spaces. + +INPUT = conic/conic.h \ + conic/conicconnection.h \ + conic/conicconnectionevent.h \ + conic/conicevent.h \ + conic/coniciap.h \ + conic/conicstatisticsevent.h + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank the following patterns are tested: +# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx *.hpp +# *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm + +FILE_PATTERNS = + +# The RECURSIVE tag can be used to turn specify whether or not subdirectories +# should be searched for input files as well. Possible values are YES and NO. +# If left blank NO is used. + +RECURSIVE = NO + +# The EXCLUDE tag can be used to specify files and/or directories that should +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used select whether or not files or directories +# that are symbolic links (a Unix filesystem feature) are excluded from the input. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. + +EXCLUDE_PATTERNS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or +# directories that contain example code fragments that are included (see +# the \include command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank all files are included. + +EXAMPLE_PATTERNS = + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude +# commands irrespective of the value of the RECURSIVE tag. +# Possible values are YES and NO. If left blank NO is used. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or +# directories that contain image that are included in the documentation (see +# the \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command <filter> <input-file>, where <filter> +# is the value of the INPUT_FILTER tag, and <input-file> is the name of an +# input file. Doxygen will then use the output that the filter program writes +# to standard output. + +INPUT_FILTER = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will be used to filter the input files when producing source +# files to browse (i.e. when SOURCE_BROWSER is set to YES). + +FILTER_SOURCE_FILES = NO + +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will +# be generated. Documented entities will be cross-referenced with these sources. +# Note: To get rid of all source code in the generated output, make sure also +# VERBATIM_HEADERS is set to NO. + +SOURCE_BROWSER = NO + +# Setting the INLINE_SOURCES tag to YES will include the body +# of functions and classes directly in the documentation. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct +# doxygen to hide any special comment blocks from generated source code +# fragments. Normal C and C++ comments will always remain visible. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES (the default) +# then for each documented function all documented +# functions referencing it will be listed. + +REFERENCED_BY_RELATION = YES + +# If the REFERENCES_RELATION tag is set to YES (the default) +# then for each documented function all documented entities +# called/used by that function will be listed. + +REFERENCES_RELATION = YES + +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen +# will generate a verbatim copy of the header file for each class for +# which an include is specified. Set to NO to disable this. + +VERBATIM_HEADERS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index +# of all compounds will be generated. Enable this if the project +# contains a lot of classes, structs, unions or interfaces. + +ALPHABETICAL_INDEX = NO + +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns +# in which this list will be split (can be a number in the range [1..20]) + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all +# classes will be put under the same header in the alphabetical index. +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that +# should be ignored while generating the index headers. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will +# generate HTML output. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `html' will be used as the default path. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank +# doxygen will generate files with .html extension. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a personal HTML header for +# each generated HTML page. If it is left blank doxygen will generate a +# standard header. + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a personal HTML footer for +# each generated HTML page. If it is left blank doxygen will generate a +# standard footer. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading +# style sheet that is used by each HTML page. It can be used to +# fine-tune the look of the HTML output. If the tag is left blank doxygen +# will generate a default style sheet. Note that doxygen will try to copy +# the style sheet file to the HTML output directory, so don't put your own +# stylesheet in the HTML output directory as well, or it will be erased! + +HTML_STYLESHEET = + +# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, +# files or namespaces will be aligned in HTML using tables. If set to +# NO a bullet list will be used. + +HTML_ALIGN_MEMBERS = YES + +# If the GENERATE_HTMLHELP tag is set to YES, additional index files +# will be generated that can be used as input for tools like the +# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) +# of the generated HTML documentation. + +GENERATE_HTMLHELP = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can +# be used to specify the file name of the resulting .chm file. You +# can add a path in front of the file if the result should not be +# written to the html output directory. + +CHM_FILE = + +# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can +# be used to specify the location (absolute path including file name) of +# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run +# the HTML help compiler on the generated index.hhp. + +HHC_LOCATION = + +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag +# controls if a separate .chi index file is generated (YES) or that +# it should be included in the master .chm file (NO). + +GENERATE_CHI = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag +# controls whether a binary table of contents is generated (YES) or a +# normal table of contents (NO) in the .chm file. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members +# to the contents of the HTML help documentation and to the tree view. + +TOC_EXPAND = NO + +# The DISABLE_INDEX tag can be used to turn on/off the condensed index at +# top of each HTML page. The value NO (the default) enables the index and +# the value YES disables it. + +DISABLE_INDEX = NO + +# This tag can be used to set the number of enum values (range [1..20]) +# that doxygen will group on one line in the generated HTML documentation. + +ENUM_VALUES_PER_LINE = 4 + +# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be +# generated containing a tree-like index structure (just like the one that +# is generated for HTML Help). For this to work a browser that supports +# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, +# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are +# probably better off using the HTML help feature. + +GENERATE_TREEVIEW = NO + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be +# used to set the initial width (in pixels) of the frame in which the tree +# is shown. + +TREEVIEW_WIDTH = 250 + +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will +# generate Latex output. + +GENERATE_LATEX = YES + +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `latex' will be used as the default path. + +LATEX_OUTPUT = latex + +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# invoked. If left blank `latex' will be used as the default command name. + +LATEX_CMD_NAME = latex + +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to +# generate index for LaTeX. If left blank `makeindex' will be used as the +# default command name. + +MAKEINDEX_CMD_NAME = makeindex + +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact +# LaTeX documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_LATEX = NO + +# The PAPER_TYPE tag can be used to set the paper type that is used +# by the printer. Possible values are: a4, a4wide, letter, legal and +# executive. If left blank a4wide will be used. + +PAPER_TYPE = a4wide + +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX +# packages that should be included in the LaTeX output. + +EXTRA_PACKAGES = + +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for +# the generated latex document. The header should contain everything until +# the first chapter. If it is left blank doxygen will generate a +# standard header. Notice: only use this tag if you know what you are doing! + +LATEX_HEADER = + +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated +# is prepared for conversion to pdf (using ps2pdf). The pdf file will +# contain links (just like the HTML output) instead of page references +# This makes the output suitable for online browsing using a pdf viewer. + +PDF_HYPERLINKS = YES + +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of +# plain latex in the generated Makefile. Set this option to YES to get a +# higher quality PDF documentation. + +USE_PDFLATEX = YES + +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. +# command to the generated LaTeX files. This will instruct LaTeX to keep +# running if errors occur, instead of asking the user for help. +# This option is also used when generating formulas in HTML. + +LATEX_BATCHMODE = NO + +# If LATEX_HIDE_INDICES is set to YES then doxygen will not +# include the index chapters (such as File Index, Compound Index, etc.) +# in the output. + +LATEX_HIDE_INDICES = NO + +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- + +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output +# The RTF output is optimized for Word 97 and may not look very pretty with +# other RTF readers or editors. + +GENERATE_RTF = NO + +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `rtf' will be used as the default path. + +RTF_OUTPUT = rtf + +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact +# RTF documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_RTF = NO + +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated +# will contain hyperlink fields. The RTF file will +# contain links (just like the HTML output) instead of page references. +# This makes the output suitable for online browsing using WORD or other +# programs which support those fields. +# Note: wordpad (write) and others do not support links. + +RTF_HYPERLINKS = NO + +# Load stylesheet definitions from file. Syntax is similar to doxygen's +# config file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. + +RTF_STYLESHEET_FILE = + +# Set optional variables used in the generation of an rtf document. +# Syntax is similar to doxygen's config file. + +RTF_EXTENSIONS_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- + +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will +# generate man pages + +GENERATE_MAN = NO + +# The MAN_OUTPUT tag is used to specify where the man pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `man' will be used as the default path. + +MAN_OUTPUT = man + +# The MAN_EXTENSION tag determines the extension that is added to +# the generated man pages (default is the subroutine's section .3) + +MAN_EXTENSION = .3 + +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, +# then it will generate one additional man file for each entity +# documented in the real man page(s). These additional files +# only source the real man page, but without them the man command +# would be unable to find the correct page. The default is NO. + +MAN_LINKS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- + +# If the GENERATE_XML tag is set to YES Doxygen will +# generate an XML file that captures the structure of +# the code including all documentation. + +GENERATE_XML = NO + +# The XML_OUTPUT tag is used to specify where the XML pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `xml' will be used as the default path. + +XML_OUTPUT = xml + +# The XML_SCHEMA tag can be used to specify an XML schema, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_SCHEMA = + +# The XML_DTD tag can be used to specify an XML DTD, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_DTD = + +# If the XML_PROGRAMLISTING tag is set to YES Doxygen will +# dump the program listings (including syntax highlighting +# and cross-referencing information) to the XML output. Note that +# enabling this will significantly increase the size of the XML output. + +XML_PROGRAMLISTING = YES + +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will +# generate an AutoGen Definitions (see autogen.sf.net) file +# that captures the structure of the code including all +# documentation. Note that this feature is still experimental +# and incomplete at the moment. + +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- + +# If the GENERATE_PERLMOD tag is set to YES Doxygen will +# generate a Perl module file that captures the structure of +# the code including all documentation. Note that this +# feature is still experimental and incomplete at the +# moment. + +GENERATE_PERLMOD = NO + +# If the PERLMOD_LATEX tag is set to YES Doxygen will generate +# the necessary Makefile rules, Perl scripts and LaTeX code to be able +# to generate PDF and DVI output from the Perl module output. + +PERLMOD_LATEX = NO + +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be +# nicely formatted so it can be parsed by a human reader. This is useful +# if you want to understand what is going on. On the other hand, if this +# tag is set to NO the size of the Perl module output will be much smaller +# and Perl will parse it just the same. + +PERLMOD_PRETTY = YES + +# The names of the make variables in the generated doxyrules.make file +# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. +# This is useful so different doxyrules.make files included by the same +# Makefile don't overwrite each other's variables. + +PERLMOD_MAKEVAR_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will +# evaluate all C-preprocessor directives found in the sources and include +# files. + +ENABLE_PREPROCESSING = YES + +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro +# names in the source code. If set to NO (the default) only conditional +# compilation will be performed. Macro expansion can be done in a controlled +# way by setting EXPAND_ONLY_PREDEF to YES. + +MACRO_EXPANSION = NO + +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES +# then the macro expansion is limited to the macros specified with the +# PREDEFINED and EXPAND_AS_PREDEFINED tags. + +EXPAND_ONLY_PREDEF = NO + +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files +# in the INCLUDE_PATH (see below) will be search if a #include is found. + +SEARCH_INCLUDES = YES + +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by +# the preprocessor. + +INCLUDE_PATH = + +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will +# be used. + +INCLUDE_FILE_PATTERNS = + +# The PREDEFINED tag can be used to specify one or more macro names that +# are defined before the preprocessor is started (similar to the -D option of +# gcc). The argument of the tag is a list of macros of the form: name +# or name=definition (no spaces). If the definition and the = are +# omitted =1 is assumed. + +PREDEFINED = + +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then +# this tag can be used to specify a list of macro names that should be expanded. +# The macro definition that is found in the sources will be used. +# Use the PREDEFINED tag if you want to use a different macro definition. + +EXPAND_AS_DEFINED = + +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then +# doxygen's preprocessor will remove all function-like macros that are alone +# on a line, have an all uppercase name, and do not end with a semicolon. Such +# function macros are typically used for boiler-plate code, and will confuse the +# parser if not removed. + +SKIP_FUNCTION_MACROS = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- + +# The TAGFILES option can be used to specify one or more tagfiles. +# Optionally an initial location of the external documentation +# can be added for each tagfile. The format of a tag file without +# this location is as follows: +# TAGFILES = file1 file2 ... +# Adding location for the tag files is done as follows: +# TAGFILES = file1=loc1 "file2 = loc2" ... +# where "loc1" and "loc2" can be relative or absolute paths or +# URLs. If a location is present for each tag, the installdox tool +# does not have to be run to correct the links. +# Note that each tag file must have a unique name +# (where the name does NOT include the path) +# If a tag file is not located in the directory in which doxygen +# is run, you must also specify the path to the tagfile here. + +TAGFILES = + +# When a file name is specified after GENERATE_TAGFILE, doxygen will create +# a tag file that is based on the input files it reads. + +GENERATE_TAGFILE = + +# If the ALLEXTERNALS tag is set to YES all external classes will be listed +# in the class index. If set to NO only the inherited external classes +# will be listed. + +ALLEXTERNALS = NO + +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will +# be listed. + +EXTERNAL_GROUPS = YES + +# The PERL_PATH should be the absolute path and name of the perl script +# interpreter (i.e. the result of `which perl'). + +PERL_PATH = /usr/bin/perl + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will +# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base or +# super classes. Setting the tag to NO turns the diagrams off. Note that this +# option is superseded by the HAVE_DOT option below. This is only a fallback. It is +# recommended to install and use dot, since it yields more powerful graphs. + +CLASS_DIAGRAMS = YES + +# If set to YES, the inheritance and collaboration graphs will hide +# inheritance and usage relations if the target is undocumented +# or is not a class. + +HIDE_UNDOC_RELATIONS = YES + +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz, a graph visualization +# toolkit from AT&T and Lucent Bell Labs. The other options in this section +# have no effect if this option is set to NO (the default) + +HAVE_DOT = NO + +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect inheritance relations. Setting this tag to YES will force the +# the CLASS_DIAGRAMS tag to NO. + +CLASS_GRAPH = YES + +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect implementation dependencies (inheritance, containment, and +# class references variables) of the class with other documented classes. + +COLLABORATION_GRAPH = YES + +# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# collaboration diagrams in a style similar to the OMG's Unified Modeling +# Language. + +UML_LOOK = NO + +# If set to YES, the inheritance and collaboration graphs will show the +# relations between templates and their instances. + +TEMPLATE_RELATIONS = NO + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT +# tags are set to YES then doxygen will generate a graph for each documented +# file showing the direct and indirect include dependencies of the file with +# other documented files. + +INCLUDE_GRAPH = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each +# documented header file showing the documented files that directly or +# indirectly include this file. + +INCLUDED_BY_GRAPH = YES + +# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will +# generate a call dependency graph for every global function or class method. +# Note that enabling this option will significantly increase the time of a run. +# So in most cases it will be better to enable call graphs for selected +# functions only using the \callgraph command. + +CALL_GRAPH = NO + +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen +# will graphical hierarchy of all classes instead of a textual one. + +GRAPHICAL_HIERARCHY = YES + +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images +# generated by dot. Possible values are png, jpg, or gif +# If left blank png will be used. + +DOT_IMAGE_FORMAT = png + +# The tag DOT_PATH can be used to specify the path where the dot tool can be +# found. If left blank, it is assumed the dot tool can be found on the path. + +DOT_PATH = + +# The DOTFILE_DIRS tag can be used to specify one or more directories that +# contain dot files that are included in the documentation (see the +# \dotfile command). + +DOTFILE_DIRS = + +# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width +# (in pixels) of the graphs generated by dot. If a graph becomes larger than +# this value, doxygen will try to truncate the graph, so that it fits within +# the specified constraint. Beware that most browsers cannot cope with very +# large images. + +MAX_DOT_GRAPH_WIDTH = 1024 + +# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height +# (in pixels) of the graphs generated by dot. If a graph becomes larger than +# this value, doxygen will try to truncate the graph, so that it fits within +# the specified constraint. Beware that most browsers cannot cope with very +# large images. + +MAX_DOT_GRAPH_HEIGHT = 1024 + +# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the +# graphs generated by dot. A depth value of 3 means that only nodes reachable +# from the root by following a path via at most 3 edges will be shown. Nodes that +# lay further from the root node will be omitted. Note that setting this option to +# 1 or 2 may greatly reduce the computation time needed for large code bases. Also +# note that a graph may be further truncated if the graph's image dimensions are +# not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH and MAX_DOT_GRAPH_HEIGHT). +# If 0 is used for the depth value (the default), the graph is not depth-constrained. + +MAX_DOT_GRAPH_DEPTH = 0 + +# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will +# generate a legend page explaining the meaning of the various boxes and +# arrows in the dot generated graphs. + +GENERATE_LEGEND = YES + +# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will +# remove the intermediate dot files that are used to generate +# the various graphs. + +DOT_CLEANUP = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to the search engine +#--------------------------------------------------------------------------- + +# The SEARCHENGINE tag specifies whether or not a search engine should be +# used. If set to NO the values of all tags below this one will be ignored. + +SEARCHENGINE = NO diff --git a/src/3rdparty/libconninet/src/Makefile.am b/src/3rdparty/libconninet/src/Makefile.am new file mode 100644 index 0000000..be7a1e5 --- /dev/null +++ b/src/3rdparty/libconninet/src/Makefile.am @@ -0,0 +1,36 @@ +DEFS = -DDBUS_API_SUBJECT_TO_CHANGE -DGCONF_DISABLE_DEPRECATED +INCLUDES = @GLIB_CFLAGS@ @DBUS_CFLAGS@ @GCONF_CFLAGS@ @OSSO_IC_CFLAGS@ @ICD_DEV_CFLAGS@ @QTCORE_CFLAGS@ @QTNETWORK_CFLAGS@ @QTDBUS_CFLAGS@ @QGCONF_CFLAGS@ @CONNSETTINGS_CFLAGS@ +LIBS = @GLIB_LIBS@ @DBUS_LIBS@ @GCONF_LIBS@ @OSSO_IC_LIBS@ @ICD_DEV_LIBS@ @QTCORE_LIBS@ @QTDBUS_LIBS@ @QTNETWORK_CFLAGS@ @QGCONF_LIBS@ @CONNSETTINGS_LIBS@ + +AM_CFLAGS = $(CONCFLAGS) + +lib_LTLIBRARIES = libconninet.la +libconninet_la_SOURCES = \ + maemo_icd.cpp \ + dbusdispatcher.cpp \ + iapconf.cpp \ + iapmonitor.cpp \ + proxyconf.cpp + +#libconninet_la_LDFLAGS = -version-info 0:0:0 + +conninetincludedir = $(includedir)/conninet +conninetinclude_HEADERS = \ + maemo_icd.h \ + dbusdispatcher.h \ + iapconf.h \ + iapmonitor.h \ + proxyconf.h + +nodist_libconninet_la_SOURCES = \ + moc_maemo_icd.cpp \ + moc_dbusdispatcher.cpp + +MAINTAINERCLEANFILES = Makefile.in + +# This rule lets GNU make create any moc_*.cpp from the equivalent *.h +moc_%.cpp: %.h + moc $< -o $@ + +# This line ensures that generated moc files are deleted when we make clean. +CLEANFILES = *_moc.cpp *.loT diff --git a/src/3rdparty/libconninet/src/dbusdispatcher.cpp b/src/3rdparty/libconninet/src/dbusdispatcher.cpp new file mode 100644 index 0000000..f5b830a --- /dev/null +++ b/src/3rdparty/libconninet/src/dbusdispatcher.cpp @@ -0,0 +1,611 @@ +/* * This file is part of conninet * + * + * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * + * Contact: Aapo Makela <aapo.makela@nokia.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * version 2.1 as published by the Free Software Foundation. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA + */ + +#include <QDebug> +#include <QtCore> +#include <poll.h> +#include <dbus/dbus.h> +#include <dbus/dbus-glib-lowlevel.h> +#include <glib.h> +#include "dbusdispatcher.h" + +namespace Maemo { + +/*! + \class Maemo::DBusDispatcher + + \brief DBusDispatcher is a class, which is able to send DBUS method call + messages and receive unicast signals from DBUS object. +*/ + +class DBusDispatcherPrivate +{ +public: + DBusDispatcherPrivate(const QString& service, + const QString& path, + const QString& interface, + const QString& signalPath) + : service(service), path(path), interface(interface), + signalPath(signalPath), connection(0) + { + memset(&signal_vtable, 0, sizeof(signal_vtable)); + } + + ~DBusDispatcherPrivate() + { + foreach(DBusPendingCall *call, pending_calls) { + dbus_pending_call_cancel(call); + dbus_pending_call_unref(call); + } + } + + QString service; + QString path; + QString interface; + QString signalPath; + struct DBusConnection *connection; + QList<DBusPendingCall *> pending_calls; + struct DBusObjectPathVTable signal_vtable; +}; + +static bool constantVariantList(const QVariantList& variantList) { + // Special case, empty list == empty struct + if (variantList.isEmpty()) { + return false; + } else { + QVariant::Type type = variantList[0].type(); + // Iterate items in the list and check if they are same type + foreach(QVariant variant, variantList) { + if (variant.type() != type) { + return false; + } + } + } + return true; +} + +static QString variantToSignature(const QVariant& argument, + bool constantList = true) { + switch (argument.type()) { + case QVariant::Bool: + return "b"; + case QVariant::ByteArray: + return "ay"; + case QVariant::Char: + return "y"; + case QVariant::Int: + return "i"; + case QVariant::UInt: + return "u"; + case QVariant::StringList: + return "as"; + case QVariant::String: + return "s"; + case QVariant::LongLong: + return "x"; + case QVariant::ULongLong: + return "t"; + case QVariant::List: + { + QString signature; + QVariantList variantList = argument.toList(); + if (!constantList) { + signature += DBUS_STRUCT_BEGIN_CHAR_AS_STRING; + foreach(QVariant listItem, variantList) { + signature += variantToSignature(listItem); + } + signature += DBUS_STRUCT_END_CHAR_AS_STRING; + } else { + if (variantList.isEmpty()) + return ""; + signature = "a" + variantToSignature(variantList[0]); + } + + return signature; + } + default: + qDebug() << "Unsupported variant type: " << argument.type(); + break; + } + + return ""; +} + +static bool appendVariantToDBusMessage(const QVariant& argument, + DBusMessageIter *dbus_iter) { + int idx = 0; + DBusMessageIter array_iter; + QStringList str_list; + dbus_bool_t bool_data; + dbus_int32_t int32_data; + dbus_uint32_t uint32_data; + dbus_int64_t int64_data; + dbus_uint64_t uint64_data; + char *str_data; + char char_data; + + switch (argument.type()) { + + case QVariant::Bool: + bool_data = argument.toBool(); + dbus_message_iter_append_basic(dbus_iter, DBUS_TYPE_BOOLEAN, + &bool_data); + break; + + case QVariant::ByteArray: + str_data = argument.toByteArray().data(); + dbus_message_iter_open_container(dbus_iter, DBUS_TYPE_ARRAY, + DBUS_TYPE_BYTE_AS_STRING, &array_iter); + dbus_message_iter_append_fixed_array(&array_iter, + DBUS_TYPE_BYTE, + &str_data, + argument.toByteArray().size()); + dbus_message_iter_close_container(dbus_iter, &array_iter); + break; + + case QVariant::Char: + char_data = argument.toChar().toAscii(); + dbus_message_iter_append_basic(dbus_iter, DBUS_TYPE_BYTE, + &char_data); + break; + + case QVariant::Int: + int32_data = argument.toInt(); + dbus_message_iter_append_basic(dbus_iter, DBUS_TYPE_INT32, + &int32_data); + break; + + case QVariant::String: + str_data = argument.toString().toLatin1().data(); + dbus_message_iter_append_basic(dbus_iter, DBUS_TYPE_STRING, + &str_data); + break; + + case QVariant::StringList: + str_list = argument.toStringList(); + dbus_message_iter_open_container(dbus_iter, DBUS_TYPE_ARRAY, + "s", &array_iter); + for (idx = 0; idx < str_list.size(); idx++) { + str_data = str_list.at(idx).toLatin1().data(); + dbus_message_iter_append_basic(&array_iter, + DBUS_TYPE_STRING, + &str_data); + } + dbus_message_iter_close_container(dbus_iter, &array_iter); + break; + + case QVariant::UInt: + uint32_data = argument.toUInt(); + dbus_message_iter_append_basic(dbus_iter, DBUS_TYPE_UINT32, + &uint32_data); + break; + + case QVariant::ULongLong: + uint64_data = argument.toULongLong(); + dbus_message_iter_append_basic(dbus_iter, DBUS_TYPE_UINT64, + &uint64_data); + break; + + case QVariant::LongLong: + int64_data = argument.toLongLong(); + dbus_message_iter_append_basic(dbus_iter, DBUS_TYPE_INT64, + &int64_data); + break; + + case QVariant::List: + { + QVariantList variantList = argument.toList(); + bool constantList = constantVariantList(variantList); + DBusMessageIter array_iter; + + // List is mapped either as an DBUS array (all items same type) + // DBUS struct (variable types) depending on constantList + if (constantList) { + // Resolve the signature for the first item + QString signature = ""; + if (!variantList.isEmpty()) { + signature = variantToSignature( + variantList[0], + constantVariantList(variantList[0].toList())); + } + + // Mapped as DBUS array + dbus_message_iter_open_container(dbus_iter, DBUS_TYPE_ARRAY, + signature.toAscii(), + &array_iter); + + foreach(QVariant listItem, variantList) { + appendVariantToDBusMessage(listItem, &array_iter); + } + + dbus_message_iter_close_container(dbus_iter, &array_iter); + } else { + // Mapped as DBUS struct + dbus_message_iter_open_container(dbus_iter, DBUS_TYPE_STRUCT, + NULL, + &array_iter); + + foreach(QVariant listItem, variantList) { + appendVariantToDBusMessage(listItem, &array_iter); + } + + dbus_message_iter_close_container(dbus_iter, &array_iter); + } + + break; + } + default: + qDebug() << "Unsupported variant type: " << argument.type(); + break; + } + + return true; +} + +static QVariant getVariantFromDBusMessage(DBusMessageIter *iter) { + dbus_bool_t bool_data; + dbus_int32_t int32_data; + dbus_uint32_t uint32_data; + dbus_int64_t int64_data; + dbus_uint64_t uint64_data; + char *str_data; + char char_data; + int argtype = dbus_message_iter_get_arg_type(iter); + + switch (argtype) { + + case DBUS_TYPE_BOOLEAN: + { + dbus_message_iter_get_basic(iter, &bool_data); + QVariant variant((bool)bool_data); + return variant; + } + + case DBUS_TYPE_ARRAY: + { + // Handle all arrays here + int elem_type = dbus_message_iter_get_element_type(iter); + DBusMessageIter array_iter; + + dbus_message_iter_recurse(iter, &array_iter); + + if (elem_type == DBUS_TYPE_BYTE) { + QByteArray byte_array; + do { + dbus_message_iter_get_basic(&array_iter, &char_data); + byte_array.append(char_data); + } while (dbus_message_iter_next(&array_iter)); + QVariant variant(byte_array); + return variant; + } else if (elem_type == DBUS_TYPE_STRING) { + QStringList str_list; + do { + dbus_message_iter_get_basic(&array_iter, &str_data); + str_list.append(str_data); + } while (dbus_message_iter_next(&array_iter)); + QVariant variant(str_list); + return variant; + } else { + QVariantList variantList; + do { + variantList << getVariantFromDBusMessage(&array_iter); + } while (dbus_message_iter_next(&array_iter)); + QVariant variant(variantList); + return variant; + } + break; + } + + case DBUS_TYPE_BYTE: + { + dbus_message_iter_get_basic(iter, &char_data); + QChar ch(char_data); + QVariant variant(ch); + return variant; + } + + case DBUS_TYPE_INT32: + { + dbus_message_iter_get_basic(iter, &int32_data); + QVariant variant((int)int32_data); + return variant; + } + + case DBUS_TYPE_UINT32: + { + dbus_message_iter_get_basic(iter, &uint32_data); + QVariant variant((uint)uint32_data); + return variant; + } + + case DBUS_TYPE_STRING: + { + dbus_message_iter_get_basic(iter, &str_data); + QString str(str_data); + QVariant variant(str); + return variant; + } + + case DBUS_TYPE_INT64: + { + dbus_message_iter_get_basic(iter, &int64_data); + QVariant variant((qlonglong)int64_data); + return variant; + } + + case DBUS_TYPE_UINT64: + { + dbus_message_iter_get_basic(iter, &uint64_data); + QVariant variant((qulonglong)uint64_data); + return variant; + } + + case DBUS_TYPE_STRUCT: + { + // Handle all structs here + DBusMessageIter struct_iter; + dbus_message_iter_recurse(iter, &struct_iter); + + QVariantList variantList; + do { + variantList << getVariantFromDBusMessage(&struct_iter); + } while (dbus_message_iter_next(&struct_iter)); + QVariant variant(variantList); + return variant; + } + + default: + qDebug() << "Unsupported DBUS type: " << argtype; + } + + return QVariant(); +} + +static DBusHandlerResult signalHandler (DBusConnection *connection, + DBusMessage *message, + void *object_ref) { + (void)connection; + QString interface; + QString signal; + DBusDispatcher *dispatcher = (DBusDispatcher *)object_ref; + + if (dbus_message_get_type(message) == DBUS_MESSAGE_TYPE_SIGNAL) { + interface = dbus_message_get_interface(message); + signal = dbus_message_get_member(message); + + QList<QVariant> arglist; + DBusMessageIter dbus_iter; + + if (dbus_message_iter_init(message, &dbus_iter)) { + // Read return arguments + while (dbus_message_iter_get_arg_type (&dbus_iter) != DBUS_TYPE_INVALID) { + arglist << getVariantFromDBusMessage(&dbus_iter); + dbus_message_iter_next(&dbus_iter); + } + } + + dispatcher->emitSignalReceived(interface, signal, arglist); + return DBUS_HANDLER_RESULT_HANDLED; + } + (void)message; + return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; +} + +DBusDispatcher::DBusDispatcher(const QString& service, + const QString& path, + const QString& interface, + QObject *parent) + : QObject(parent), + d_ptr(new DBusDispatcherPrivate(service, path, interface, path)) { + setupDBus(); +} + +DBusDispatcher::DBusDispatcher(const QString& service, + const QString& path, + const QString& interface, + const QString& signalPath, + QObject *parent) + : QObject(parent), + d_ptr(new DBusDispatcherPrivate(service, path, interface, signalPath)) { + setupDBus(); +} + +DBusDispatcher::~DBusDispatcher() +{ + if (d_ptr->connection) { + dbus_connection_close(d_ptr->connection); + dbus_connection_unref(d_ptr->connection); + } + delete d_ptr; +} + +void DBusDispatcher::setupDBus() +{ + d_ptr->connection = dbus_bus_get_private(DBUS_BUS_SYSTEM, NULL); + + if (d_ptr->connection == NULL) + qDebug() << "Unable to get DBUS connection!"; + else { + d_ptr->signal_vtable.message_function = signalHandler; + + dbus_connection_set_exit_on_disconnect(d_ptr->connection, FALSE); + dbus_connection_setup_with_g_main(d_ptr->connection, NULL); + dbus_connection_register_object_path(d_ptr->connection, + d_ptr->signalPath.toLatin1(), + &d_ptr->signal_vtable, + this); + } +} + +static DBusMessage *prepareDBusCall(const QString& service, + const QString& path, + const QString& interface, + const QString& method, + const QVariant& arg1 = QVariant(), + const QVariant& arg2 = QVariant(), + const QVariant& arg3 = QVariant(), + const QVariant& arg4 = QVariant(), + const QVariant& arg5 = QVariant(), + const QVariant& arg6 = QVariant(), + const QVariant& arg7 = QVariant(), + const QVariant& arg8 = QVariant()) +{ + DBusMessage *message = dbus_message_new_method_call(service.toLatin1(), + path.toLatin1(), + interface.toLatin1(), + method.toLatin1()); + DBusMessageIter dbus_iter; + + // Append variants to DBUS message + QList<QVariant> arglist; + if (arg1.isValid()) arglist << arg1; + if (arg2.isValid()) arglist << arg2; + if (arg3.isValid()) arglist << arg3; + if (arg4.isValid()) arglist << arg4; + if (arg5.isValid()) arglist << arg5; + if (arg6.isValid()) arglist << arg6; + if (arg7.isValid()) arglist << arg7; + if (arg8.isValid()) arglist << arg8; + + dbus_message_iter_init_append (message, &dbus_iter); + + while (!arglist.isEmpty()) { + QVariant argument = arglist.takeFirst(); + appendVariantToDBusMessage(argument, &dbus_iter); + } + + return message; +} + +QList<QVariant> DBusDispatcher::call(const QString& method, + const QVariant& arg1, + const QVariant& arg2, + const QVariant& arg3, + const QVariant& arg4, + const QVariant& arg5, + const QVariant& arg6, + const QVariant& arg7, + const QVariant& arg8) { + DBusMessageIter dbus_iter; + DBusMessage *message = prepareDBusCall(d_ptr->service, d_ptr->path, + d_ptr->interface, method, + arg1, arg2, arg3, arg4, arg5, + arg6, arg7, arg8); + DBusMessage *reply = dbus_connection_send_with_reply_and_block( + d_ptr->connection, + message, -1, NULL); + dbus_message_unref(message); + + QList<QVariant> replylist; + if (reply != NULL && dbus_message_iter_init(reply, &dbus_iter)) { + // Read return arguments + while (dbus_message_iter_get_arg_type (&dbus_iter) != DBUS_TYPE_INVALID) { + replylist << getVariantFromDBusMessage(&dbus_iter); + dbus_message_iter_next(&dbus_iter); + } + } + if (reply != NULL) dbus_message_unref(reply); + return replylist; +} + +class PendingCallInfo { +public: + QString method; + DBusDispatcher *dispatcher; + DBusDispatcherPrivate *priv; +}; + +static void freePendingCallInfo(void *memory) { + PendingCallInfo *info = (PendingCallInfo *)memory; + delete info; +} + +static void pendingCallFunction (DBusPendingCall *pending, + void *memory) { + PendingCallInfo *info = (PendingCallInfo *)memory; + QString errorStr; + QList<QVariant> replyList; + DBusMessage *reply = dbus_pending_call_steal_reply (pending); + + Q_ASSERT(reply != NULL); + + if (dbus_message_get_type(reply) == DBUS_MESSAGE_TYPE_ERROR) { + errorStr = dbus_message_get_error_name (reply); + } else { + DBusMessageIter dbus_iter; + dbus_message_iter_init(reply, &dbus_iter); + // Read return arguments + while (dbus_message_iter_get_arg_type (&dbus_iter) != DBUS_TYPE_INVALID) { + replyList << getVariantFromDBusMessage(&dbus_iter); + dbus_message_iter_next(&dbus_iter); + } + } + + info->priv->pending_calls.removeOne(pending); + info->dispatcher->emitCallReply(info->method, replyList, errorStr); + dbus_message_unref(reply); + dbus_pending_call_unref(pending); +} + +bool DBusDispatcher::callAsynchronous(const QString& method, + const QVariant& arg1, + const QVariant& arg2, + const QVariant& arg3, + const QVariant& arg4, + const QVariant& arg5, + const QVariant& arg6, + const QVariant& arg7, + const QVariant& arg8) { + DBusMessage *message = prepareDBusCall(d_ptr->service, d_ptr->path, + d_ptr->interface, method, + arg1, arg2, arg3, arg4, arg5, + arg6, arg7, arg8); + DBusPendingCall *call = NULL; + dbus_bool_t ret = dbus_connection_send_with_reply(d_ptr->connection, + message, &call, -1); + PendingCallInfo *info = new PendingCallInfo; + info->method = method; + info->dispatcher = this; + info->priv = d_ptr; + + dbus_pending_call_set_notify(call, pendingCallFunction, info, freePendingCallInfo); + d_ptr->pending_calls.append(call); + return (bool)ret; +} + +void DBusDispatcher::emitSignalReceived(const QString& interface, + const QString& signal, + const QList<QVariant>& args) { + emit signalReceived(interface, signal, args); } + +void DBusDispatcher::emitCallReply(const QString& method, + const QList<QVariant>& args, + const QString& error) { + emit callReply(method, args, error); } + +void DBusDispatcher::synchronousDispatch(int timeout_ms) +{ + dbus_connection_read_write_dispatch(d_ptr->connection, timeout_ms); +} + +} // Maemo namespace + diff --git a/src/3rdparty/libconninet/src/dbusdispatcher.h b/src/3rdparty/libconninet/src/dbusdispatcher.h new file mode 100644 index 0000000..2f71b6f --- /dev/null +++ b/src/3rdparty/libconninet/src/dbusdispatcher.h @@ -0,0 +1,91 @@ +/* * This file is part of conn-dui-settings-inet * + * + * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * + * Contact: Aapo Makela <aapo.makela@nokia.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * version 2.1 as published by the Free Software Foundation. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA + */ + +#ifndef DBUSDISPATCHER_H +#define DBUSDISPATCHER_H + +#include <QObject> +#include <QVariant> + +namespace Maemo { + +class DBusDispatcherPrivate; +class DBusDispatcher : public QObject +{ + Q_OBJECT + +public: + DBusDispatcher(const QString& service, + const QString& path, + const QString& interface, + QObject *parent = 0); + DBusDispatcher(const QString& service, + const QString& path, + const QString& interface, + const QString& signalPath, + QObject *parent = 0); + ~DBusDispatcher(); + + QList<QVariant> call(const QString& method, + const QVariant& arg1 = QVariant(), + const QVariant& arg2 = QVariant(), + const QVariant& arg3 = QVariant(), + const QVariant& arg4 = QVariant(), + const QVariant& arg5 = QVariant(), + const QVariant& arg6 = QVariant(), + const QVariant& arg7 = QVariant(), + const QVariant& arg8 = QVariant()); + bool callAsynchronous(const QString& method, + const QVariant& arg1 = QVariant(), + const QVariant& arg2 = QVariant(), + const QVariant& arg3 = QVariant(), + const QVariant& arg4 = QVariant(), + const QVariant& arg5 = QVariant(), + const QVariant& arg6 = QVariant(), + const QVariant& arg7 = QVariant(), + const QVariant& arg8 = QVariant()); + void emitSignalReceived(const QString& interface, + const QString& signal, + const QList<QVariant>& args); + void emitCallReply(const QString& method, + const QList<QVariant>& args, + const QString& error = ""); + void synchronousDispatch(int timeout_ms); + +Q_SIGNALS: + void signalReceived(const QString& interface, + const QString& signal, + const QList<QVariant>& args); + void callReply(const QString& method, + const QList<QVariant>& args, + const QString& error); + +protected: + void setupDBus(); + +private: + DBusDispatcherPrivate *d_ptr; +}; + +} // Maemo namespace + +#endif diff --git a/src/3rdparty/libconninet/src/iapconf.cpp b/src/3rdparty/libconninet/src/iapconf.cpp new file mode 100644 index 0000000..2e77fa5 --- /dev/null +++ b/src/3rdparty/libconninet/src/iapconf.cpp @@ -0,0 +1,299 @@ +/* + libconninet - Internet Connectivity support library + + Copyright (C) 2009-2010 Nokia Corporation. All rights reserved. + + Contact: Aapo Makela <aapo.makela@nokia.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public License + version 2.1 as published by the Free Software Foundation. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + +#include <stdlib.h> +#include <string.h> +#include <conn_settings.h> + +#include "iapconf.h" + +#define QSTRING_TO_CONST_CSTR(str) \ + str.toUtf8().constData() + +namespace Maemo { + +class IAPConfPrivate { +public: + ConnSettings *settings; + + ConnSettingsValue *variantToValue(const QVariant &variant); + QVariant valueToVariant(ConnSettingsValue *value); +}; + +ConnSettingsValue *IAPConfPrivate::variantToValue(const QVariant &variant) +{ + // Convert variant to ConnSettingsValue + ConnSettingsValue *value = conn_settings_value_new(); + if (value == 0) { + qWarning("IAPConf: Unable to create new ConnSettingsValue"); + return 0; + } + + switch(variant.type()) { + + case QVariant::Invalid: + value->type = CONN_SETTINGS_VALUE_INVALID; + break; + + case QVariant::String: { + char *valueStr = strdup(QSTRING_TO_CONST_CSTR(variant.toString())); + value->type = CONN_SETTINGS_VALUE_STRING; + value->value.string_val = valueStr; + break; + } + + case QVariant::Int: + value->type = CONN_SETTINGS_VALUE_INT; + value->value.int_val = variant.toInt(); + break; + + case QMetaType::Float: + case QVariant::Double: + value->type = CONN_SETTINGS_VALUE_DOUBLE; + value->value.double_val = variant.toDouble(); + break; + + case QVariant::Bool: + value->type = CONN_SETTINGS_VALUE_BOOL; + value->value.bool_val = variant.toBool() ? 1 : 0; + break; + + case QVariant::ByteArray: { + QByteArray array = variant.toByteArray(); + value->type = CONN_SETTINGS_VALUE_BYTE_ARRAY; + value->value.byte_array.len = array.size(); + value->value.byte_array.val = (unsigned char *)malloc(array.size()); + memcpy(value->value.byte_array.val, array.constData(), array.size()); + break; + } + + case QVariant::List: { + QVariantList list = variant.toList(); + ConnSettingsValue **list_val = (ConnSettingsValue **)malloc( + (list.size() + 1) * sizeof(ConnSettingsValue *)); + + for (int idx = 0; idx < list.size(); idx++) { + list_val[idx] = variantToValue(list.at(idx)); + } + list_val[list.size()] = 0; + + value->type = CONN_SETTINGS_VALUE_LIST; + value->value.list_val = list_val; + break; + } + + default: + qWarning("IAPConf: Can not handle QVariant of type %d", + variant.type()); + conn_settings_value_destroy(value); + return 0; + } + + return value; +} + +QVariant IAPConfPrivate::valueToVariant(ConnSettingsValue *value) +{ + if (value == 0 || value->type == CONN_SETTINGS_VALUE_INVALID) { + return QVariant(); + } + + switch(value->type) { + + case CONN_SETTINGS_VALUE_BOOL: + return QVariant(value->value.bool_val ? true : false); + + case CONN_SETTINGS_VALUE_STRING: + return QVariant(QString(value->value.string_val)); + + case CONN_SETTINGS_VALUE_DOUBLE: + return QVariant(value->value.double_val); + + case CONN_SETTINGS_VALUE_INT: + return QVariant(value->value.int_val); + + case CONN_SETTINGS_VALUE_LIST: { + // At least with GConf backend connsettings returns byte array as list + // of ints, first check for that case + if (value->value.list_val && value->value.list_val[0]) { + bool canBeConvertedToByteArray = true; + for (int idx = 0; value->value.list_val[idx]; idx++) { + ConnSettingsValue *val = value->value.list_val[idx]; + if (val->type != CONN_SETTINGS_VALUE_INT + || val->value.int_val > 255 + || val->value.int_val < 0) { + canBeConvertedToByteArray = false; + break; + } + } + + if (canBeConvertedToByteArray) { + QByteArray array; + for (int idx = 0; value->value.list_val[idx]; idx++) { + array.append(value->value.list_val[idx]->value.int_val); + } + return array; + } + + // Create normal list + QVariantList list; + for (int idx = 0; value->value.list_val[idx]; idx++) { + list.append(valueToVariant(value->value.list_val[idx])); + } + return list; + } + } + + case CONN_SETTINGS_VALUE_BYTE_ARRAY: + return QByteArray::fromRawData((char *)value->value.byte_array.val, + value->value.byte_array.len); + + default: + return QVariant(); + } +} + +// Public class implementation + +IAPConf::IAPConf(const QString &iap_id) + : d_ptr(new IAPConfPrivate) +{ + d_ptr->settings = conn_settings_open(CONN_SETTINGS_CONNECTION, + QSTRING_TO_CONST_CSTR(iap_id)); + if (d_ptr->settings == 0) { + qWarning("IAPConf: Unable to open ConnSettings for %s", + QSTRING_TO_CONST_CSTR(iap_id)); + } +} + +IAPConf::~IAPConf() +{ + conn_settings_close(d_ptr->settings); + delete d_ptr; +} + +void IAPConf::setValue(const QString& key, const QVariant& value) +{ + // Invalid value means unsetting the given key + if (!value.isValid()) { + int err = conn_settings_unset(d_ptr->settings, + QSTRING_TO_CONST_CSTR(key)); + if (err != CONN_SETTINGS_E_NO_ERROR) { + qWarning("IAPConf: unable to unset key %s: %s", + QSTRING_TO_CONST_CSTR(key), + conn_settings_error_text((ConnSettingsError)err)); + } + return; + } + + // Convert value to ConnSettingsValue + ConnSettingsValue *val = d_ptr->variantToValue(value); + if (val == 0) return; + + // Set value and handle errors + int error = conn_settings_set(d_ptr->settings, + QSTRING_TO_CONST_CSTR(key), + val); + if (error != CONN_SETTINGS_E_NO_ERROR) { + qWarning("IAPConf: error in setting key %s: %s", + QSTRING_TO_CONST_CSTR(key), + conn_settings_error_text((ConnSettingsError)error)); + } + + // Destroy value + conn_settings_value_destroy(val); + return; +} + +void IAPConf::set(const QString& key1, const QVariant& value1, + const QString& key2, const QVariant& value2, + const QString& key3, const QVariant& value3, + const QString& key4, const QVariant& value4, + const QString& key5, const QVariant& value5, + const QString& key6, const QVariant& value6, + const QString& key7, const QVariant& value7, + const QString& key8, const QVariant& value8, + const QString& key9, const QVariant& value9, + const QString& key10, const QVariant& value10) +{ + if (!key1.isEmpty()) setValue(key1, value1); + if (!key2.isEmpty()) setValue(key2, value2); + if (!key3.isEmpty()) setValue(key3, value3); + if (!key4.isEmpty()) setValue(key4, value4); + if (!key5.isEmpty()) setValue(key5, value5); + if (!key6.isEmpty()) setValue(key6, value6); + if (!key7.isEmpty()) setValue(key7, value7); + if (!key8.isEmpty()) setValue(key8, value8); + if (!key9.isEmpty()) setValue(key9, value9); + if (!key10.isEmpty()) setValue(key10, value10); +} + +QVariant IAPConf::value(const QString& key) const +{ + ConnSettingsValue *val = conn_settings_get(d_ptr->settings, + QSTRING_TO_CONST_CSTR(key)); + + QVariant variant = d_ptr->valueToVariant(val); + conn_settings_value_destroy(val); + return variant; +} + +void IAPConf::clear(const char *default_path) +{ + Q_UNUSED(default_path); // default path is unused + + int error = conn_settings_remove(d_ptr->settings); + if (error != CONN_SETTINGS_E_NO_ERROR) { + qWarning("IAPConf: Error when removing IAP: %s", + conn_settings_error_text((ConnSettingsError)error)); + } +} + +void IAPConf::clearAll() +{ + ConnSettings *settings = conn_settings_open(CONN_SETTINGS_CONNECTION, + NULL); + conn_settings_remove(settings); + conn_settings_close(settings); +} + + +void IAPConf::getAll(QList<QString> &all_iaps, bool return_path) +{ + Q_UNUSED(return_path); // We don't use return path currently + + // Go through all available connections and add them to the list + char **ids = conn_settings_list_ids(CONN_SETTINGS_CONNECTION); + if (ids == 0) { + // No ids found - nothing to do + return; + } + + for (int idx = 0; ids[idx]; idx++) { + all_iaps.append(QString(ids[idx])); + free(ids[idx]); + } + free(ids); +} + + +} // namespace Maemo diff --git a/src/3rdparty/libconninet/src/iapconf.h b/src/3rdparty/libconninet/src/iapconf.h new file mode 100644 index 0000000..57c0856 --- /dev/null +++ b/src/3rdparty/libconninet/src/iapconf.h @@ -0,0 +1,84 @@ +/* + libconninet - Internet Connectivity support library + + Copyright (C) 2009 Nokia Corporation. All rights reserved. + + Contact: Aapo Makela <aapo.makela@nokia.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public License + version 2.1 as published by the Free Software Foundation. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + +#ifndef IAPCONF_H +#define IAPCONF_H + +#include <QString> +#include <QVariant> + +namespace Maemo { + +class IAPConfPrivate; +class IAPConf { +public: + IAPConf(const QString &iap_id); + virtual ~IAPConf(); + + /** + Convenience method for setting multiple IAP values with one call. + */ + void set(const QString& key1, const QVariant& value1, + const QString& key2 = "", const QVariant& value2 = QVariant(), + const QString& key3 = "", const QVariant& value3 = QVariant(), + const QString& key4 = "", const QVariant& value4 = QVariant(), + const QString& key5 = "", const QVariant& value5 = QVariant(), + const QString& key6 = "", const QVariant& value6 = QVariant(), + const QString& key7 = "", const QVariant& value7 = QVariant(), + const QString& key8 = "", const QVariant& value8 = QVariant(), + const QString& key9 = "", const QVariant& value9 = QVariant(), + const QString& key10 = "", const QVariant& value10 = QVariant()); + + /** + Set one IAP value. + */ + void setValue(const QString& key, const QVariant& value); + + /** + Get one IAP value. + */ + QVariant value(const QString& key) const; + + /** + Clear this IAP from GConf + */ + void clear(const char *default_path=0); + + /** + Clear all IAP specific information from GConf (including all IAPs). + DO NOT USE THIS FUNCTION IN ANYWHERE ELSE EXCEPT IN TEST CODE! + */ + void clearAll(); + + /** + Return all the IAPs found in the system. If return_path is true, + then do not strip the IAP path away. + */ + static void getAll(QList<QString> &all_iaps, bool return_path=false); + +private: + IAPConfPrivate *d_ptr; +}; + +} // namespace Maemo + +#endif diff --git a/src/3rdparty/libconninet/src/iapmonitor.cpp b/src/3rdparty/libconninet/src/iapmonitor.cpp new file mode 100644 index 0000000..c44cbc8 --- /dev/null +++ b/src/3rdparty/libconninet/src/iapmonitor.cpp @@ -0,0 +1,110 @@ +/* + libconninet - Internet Connectivity support library + + Copyright (C) 2009-2010 Nokia Corporation. All rights reserved. + + Contact: Jukka Rissanen <jukka.rissanen@nokia.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public License + version 2.1 as published by the Free Software Foundation. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + +#include <QStringList> + +#include <conn_settings.h> +#include "iapmonitor.h" + +namespace Maemo { + + +void conn_settings_notify_func (ConnSettingsType type, + const char *id, + const char *key, + ConnSettingsValue *value, + void *user_data); + +class IAPMonitorPrivate { +private: + IAPMonitor *monitor; + ConnSettings *settings; + +public: + + IAPMonitorPrivate(IAPMonitor *monitor) + : monitor(monitor) + { + settings = conn_settings_open(CONN_SETTINGS_CONNECTION, NULL); + conn_settings_add_notify( + settings, + (ConnSettingsNotifyFunc *)conn_settings_notify_func, + this); + } + + ~IAPMonitorPrivate() + { + conn_settings_del_notify(settings); + conn_settings_close(settings); + } + + void iapAdded(const QString &iap) + { + monitor->iapAdded(iap); + } + + void iapRemoved(const QString &iap) + { + monitor->iapRemoved(iap); + } +}; + +void conn_settings_notify_func (ConnSettingsType type, + const char *id, + const char *key, + ConnSettingsValue *value, + void *user_data) +{ + if (type != CONN_SETTINGS_CONNECTION) return; + IAPMonitorPrivate *priv = (IAPMonitorPrivate *)user_data; + + QString iapId(key); + iapId = iapId.split("/")[0]; + if (value != 0) { + priv->iapAdded(iapId); + } else if (iapId == QString(key)) { + // IAP is removed only when the directory gets removed + priv->iapRemoved(iapId); + } +} + +IAPMonitor::IAPMonitor() + : d_ptr(new IAPMonitorPrivate(this)) +{ +} + +IAPMonitor::~IAPMonitor() +{ + delete d_ptr; +} + +void IAPMonitor::iapAdded(const QString &id) +{ + // By default do nothing +} + +void IAPMonitor::iapRemoved(const QString &id) +{ + // By default do nothing +} + +} // namespace Maemo diff --git a/src/3rdparty/libconninet/src/iapmonitor.h b/src/3rdparty/libconninet/src/iapmonitor.h new file mode 100644 index 0000000..558f23e --- /dev/null +++ b/src/3rdparty/libconninet/src/iapmonitor.h @@ -0,0 +1,48 @@ +/* + libconninet - Internet Connectivity support library + + Copyright (C) 2009-2010 Nokia Corporation. All rights reserved. + + Contact: Jukka Rissanen <jukka.rissanen@nokia.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public License + version 2.1 as published by the Free Software Foundation. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + +#ifndef IAPMONITOR_H +#define IAPMONITOR_H + +#include <QString> + +namespace Maemo { + +class IAPMonitorPrivate; +class IAPMonitor { +public: + IAPMonitor(); + ~IAPMonitor(); + +protected: + virtual void iapAdded(const QString &id); + virtual void iapRemoved(const QString &id); + +private: + IAPMonitorPrivate *d_ptr; + Q_DECLARE_PRIVATE(IAPMonitor); +}; + +} // namespace Maemo + +#endif // IAPMONITOR_H + diff --git a/src/3rdparty/libconninet/src/maemo_icd.cpp b/src/3rdparty/libconninet/src/maemo_icd.cpp new file mode 100644 index 0000000..bc84fbc --- /dev/null +++ b/src/3rdparty/libconninet/src/maemo_icd.cpp @@ -0,0 +1,1277 @@ +/* + libconninet - Internet Connectivity support library + + Copyright (C) 2009 Nokia Corporation. All rights reserved. + + Contact: Jukka Rissanen <jukka.rissanen@nokia.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public License + version 2.1 as published by the Free Software Foundation. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + +#include <stdio.h> +#include "maemo_icd.h" +#include <QObject> +#include <QTimer> +#include <QCoreApplication> +#include <QEventLoop> +#include <QDebug> +#include <dbus/dbus.h> +#include <dbus/dbus-glib-lowlevel.h> + + +namespace Maemo { + +/* Reference counting singleton class that creates a single connection + * to icd so that icd reference counting works as expected. This is + * needed because DBusDispatcher uses private dbus connections + * which come and go and icd cannot use that information to + * determine whether application quit or not. So we create one + * persistent connection that is only teared down when application + * quits or calls disconnect() + */ +class IcdRefCounting +{ +public: + IcdRefCounting() : first_call(true) { } + void setup(enum icd_connection_flags flag); + void cleanup(); + +private: + bool first_call; + struct DBusConnection *connection; +}; + +Q_GLOBAL_STATIC(IcdRefCounting, icdRefCounting); + + +void IcdRefCounting::setup(enum icd_connection_flags flag) +{ + if (first_call) { + DBusMessage *msg = NULL; + + connection = dbus_bus_get_private(DBUS_BUS_SYSTEM, NULL); + dbus_connection_set_exit_on_disconnect(connection, FALSE); + dbus_connection_setup_with_g_main(connection, NULL); + + msg = dbus_message_new_method_call(ICD_DBUS_API_INTERFACE, + ICD_DBUS_API_PATH, + ICD_DBUS_API_INTERFACE, + ICD_DBUS_API_CONNECT_REQ); + if (msg == NULL) + goto out; + + if (!dbus_message_append_args(msg, + DBUS_TYPE_UINT32, &flag, + DBUS_TYPE_INVALID)) + goto out; + + if (!dbus_connection_send_with_reply(connection, msg, + NULL, 60*1000)) + goto out; + + first_call = false; + return; + + out: + dbus_connection_close(connection); + dbus_connection_unref(connection); + } +} + +void IcdRefCounting::cleanup() +{ + if (!first_call) { + dbus_connection_close(connection); + dbus_connection_unref(connection); + first_call = true; + } +} + + +class IcdPrivate +{ +public: + IcdPrivate(Icd *myfriend) + { + init(10000, IcdNewDbusInterface, myfriend); + } + + IcdPrivate(unsigned int timeout, Icd *myfriend) + { + init(timeout, IcdNewDbusInterface, myfriend); + } + + IcdPrivate(unsigned int timeout, IcdDbusInterfaceVer ver, Icd *myfriend) + { + /* Note that the old Icd interface is currently disabled and + * the new one is always used. + */ + init(timeout, IcdNewDbusInterface, myfriend); + } + + ~IcdPrivate() + { + QObject::disconnect(mDBus, + SIGNAL(signalReceived(const QString&, + const QString&, + const QList<QVariant>&)), + icd, + SLOT(icdSignalReceived(const QString&, + const QString&, + const QList<QVariant>&))); + + QObject::disconnect(mDBus, + SIGNAL(callReply(const QString&, + const QList<QVariant>&, + const QString&)), + icd, + SLOT(icdCallReply(const QString&, + const QList<QVariant>&, + const QString&))); + + delete mDBus; + mDBus = 0; + } + + /* Icd2 dbus API functions */ + QStringList scan(icd_scan_request_flags flags, + QStringList &network_types, + QList<IcdScanResult>& scan_results, + QString& error); + void scanCancel(); + bool connect(icd_connection_flags flags, IcdConnectResult& result); + bool connect(icd_connection_flags flags, QList<ConnectParams>& params, + IcdConnectResult& result); + bool connect(icd_connection_flags flags, QString& iap, QString& result); + void select(uint flags); + void disconnect(uint connect_flags, QString& service_type, + uint service_attrs, QString& service_id, + QString& network_type, uint network_attrs, + QByteArray& network_id); + void disconnect(uint connect_flags); + + uint state(QString& service_type, uint service_attrs, + QString& service_id, QString& network_type, + uint network_attrs, QByteArray& network_id, + IcdStateResult &state_result); + uint statistics(QString& service_type, uint service_attrs, + QString& service_id, QString& network_type, + uint network_attrs, QByteArray& network_id, + IcdStatisticsResult& stats_result); + uint addrinfo(QString& service_type, uint service_attrs, + QString& service_id, QString& network_type, + uint network_attrs, QByteArray& network_id, + IcdAddressInfoResult& addr_result); + + uint state(QList<IcdStateResult>& state_results); + uint state_non_blocking(QList<IcdStateResult>& state_results); + uint statistics(QList<IcdStatisticsResult>& stats_results); + uint addrinfo(QList<IcdAddressInfoResult>& addr_results); + uint addrinfo_non_blocking(QList<IcdAddressInfoResult>& addr_results); + + void signalReceived(const QString& interface, + const QString& signal, + const QList<QVariant>& args); + void callReply(const QString& method, + const QList<QVariant>& args, + const QString& error); + + QString error() { return mError; } + +public: + DBusDispatcher *mDBus; + QString mMethod; + QString mInterface; + QString mSignal; + QString mError; + QList<QVariant> mArgs; + QList<QVariant> receivedSignals; + unsigned int timeout; + IcdDbusInterfaceVer icd_dbus_version; + Icd *icd; + + void init(unsigned int dbus_timeout, IcdDbusInterfaceVer ver, + Icd *myfriend) + { + if (ver == IcdNewDbusInterface) { + mDBus = new DBusDispatcher(ICD_DBUS_API_INTERFACE, + ICD_DBUS_API_PATH, + ICD_DBUS_API_INTERFACE); + } else { + mDBus = new DBusDispatcher(ICD_DBUS_SERVICE, + ICD_DBUS_PATH, + ICD_DBUS_INTERFACE); + } + icd_dbus_version = ver; + + /* This connect has a side effect as it means that only one + * Icd object can exists in one time. This should be fixed! + */ + QObject::connect(mDBus, + SIGNAL(signalReceived(const QString&, + const QString&, + const QList<QVariant>&)), + myfriend, + SLOT(icdSignalReceived(const QString&, + const QString&, + const QList<QVariant>&))); + + QObject::connect(mDBus, + SIGNAL(callReply(const QString&, + const QList<QVariant>&, + const QString&)), + myfriend, + SLOT(icdCallReply(const QString&, + const QList<QVariant>&, + const QString&))); + + icd = myfriend; + timeout = dbus_timeout; + } + + void clearState() + { + mMethod.clear(); + mInterface.clear(); + mSignal.clear(); + mError.clear(); + mArgs.clear(); + receivedSignals.clear(); + } + + bool doConnect(IcdConnectResult& result); + bool doConnect(QString& result); + bool doState(); +}; + + +void IcdPrivate::signalReceived(const QString& interface, + const QString& signal, + const QList<QVariant>& args) +{ + // Signal handler, which simply records what has been signalled + mInterface = interface; + mSignal = signal; + mArgs = args; + + //qDebug() << "signal" << signal << "received:" << args; + receivedSignals << QVariant(interface) << QVariant(signal) << QVariant(args); +} + + +void IcdPrivate::callReply(const QString& method, + const QList<QVariant>& /*args*/, + const QString& error) +{ + mMethod = method; + mError = error; +} + + +static void get_scan_result(QList<QVariant>& args, + IcdScanResult& ret) +{ + int i=0; + + if (args.isEmpty()) + return; + + ret.status = args[i++].toUInt(); + ret.timestamp = args[i++].toUInt(); + ret.scan.service_type = args[i++].toString(); + ret.service_name = args[i++].toString(); + ret.scan.service_attrs = args[i++].toUInt(); + ret.scan.service_id = args[i++].toString(); + ret.service_priority = args[i++].toInt(); + ret.scan.network_type = args[i++].toString(); + ret.network_name = args[i++].toString(); + ret.scan.network_attrs = args[i++].toUInt(); + ret.scan.network_id = args[i++].toByteArray(); + ret.network_priority = args[i++].toInt(); + ret.signal_strength = args[i++].toInt(); + ret.station_id = args[i++].toString(); + ret.signal_dB = args[i++].toInt(); +} + + +static void get_connect_result(QList<QVariant>& args, + IcdConnectResult& ret) +{ + int i=0; + + if (args.isEmpty()) + return; + + ret.connect.service_type = args[i++].toString(); + ret.connect.service_attrs = args[i++].toInt(); + ret.connect.service_id = args[i++].toString(); + ret.connect.network_type = args[i++].toString(); + ret.connect.network_attrs = args[i++].toInt(); + ret.connect.network_id = args[i++].toByteArray(); + ret.status = args[i++].toInt(); +} + + +QStringList IcdPrivate::scan(icd_scan_request_flags flags, + QStringList &network_types, + QList<IcdScanResult>& scan_results, + QString& error) +{ + QStringList scanned_types; + QTimer timer; + QVariant reply; + QVariantList vl; + bool last_result = false; + IcdScanResult result; + int all_waited; + + clearState(); + reply = mDBus->call(ICD_DBUS_API_SCAN_REQ, (uint)flags); + if (reply.type() != QVariant::List) + return scanned_types; + vl = reply.toList(); + if (vl.isEmpty()) { + error = "Scan did not return anything."; + return scanned_types; + } + reply = vl.first(); + scanned_types = reply.toStringList(); + //qDebug() << "Scanning:" << scanned_types; + all_waited = scanned_types.size(); + + timer.setSingleShot(true); + timer.start(timeout); + + scan_results.clear(); + while (!last_result) { + while (timer.isActive() && mInterface.isEmpty() && mError.isEmpty()) { + QCoreApplication::processEvents(QEventLoop::AllEvents, 1000); + } + + if (!timer.isActive()) { + //qDebug() << "Timeout happened"; + break; + } + + if (mSignal != ICD_DBUS_API_SCAN_SIG) { + //qDebug() << "Received" << mSignal << "while waiting" << ICD_DBUS_API_SCAN_SIG << ", ignoring"; + mInterface.clear(); + continue; + } + + if (mError.isEmpty()) { + QString msgInterface = receivedSignals.takeFirst().toString(); + QString msgSignal = receivedSignals.takeFirst().toString(); + QList<QVariant> msgArgs = receivedSignals.takeFirst().toList(); + //qDebug() << "Signal" << msgSignal << "received."; + //qDebug() << "Params:" << msgArgs; + + while (!msgSignal.isEmpty()) { + get_scan_result(msgArgs, result); + +#if 0 + qDebug() << "Received: " << + "status =" << result.status << + ", timestamp =" << result.timestamp << + ", service_type =" << result.scan.service_type << + ", service_name =" << result.service_name << + ", service_attrs =" << result.scan.service_attrs << + ", service_id =" << result.scan.service_id << + ", service_priority =" << result.service_priority << + ", network_type =" << result.scan.network_type << + ", network_name =" << result.network_name << + ", network_attrs =" << result.scan.network_attrs << + ", network_id =" << "-" << + ", network_priority =" << result.network_priority << + ", signal_strength =" << result.signal_strength << + ", station_id =" << result.station_id << + ", signal_dB =" << result.signal_dB; +#endif + + if (result.status == ICD_SCAN_COMPLETE) { + //qDebug() << "waited =" << all_waited; + if (--all_waited == 0) { + last_result = true; + break; + } + } else + scan_results << result; + + if (receivedSignals.isEmpty()) + break; + + msgInterface = receivedSignals.takeFirst().toString(); + msgSignal = receivedSignals.takeFirst().toString(); + msgArgs = receivedSignals.takeFirst().toList(); + } + mInterface.clear(); + + } else { + qWarning() << "Error while scanning:" << mError; + break; + } + } + timer.stop(); + + error = mError; + return scanned_types; +} + + +void IcdPrivate::scanCancel() +{ + mDBus->call(ICD_DBUS_API_SCAN_CANCEL); +} + + +bool IcdPrivate::doConnect(IcdConnectResult& result) +{ + QTimer timer; + bool status = false; + + timer.setSingleShot(true); + timer.start(timeout); + + //qDebug() << "Waiting" << ICD_DBUS_API_CONNECT_SIG << "signal"; + + while (timer.isActive() && mInterface.isEmpty() && + mSignal != ICD_DBUS_API_CONNECT_SIG && + mError.isEmpty()) { + QCoreApplication::processEvents(QEventLoop::AllEvents, 1000); + } + + timer.stop(); + + if (mError.isEmpty()) { + if (!mArgs.isEmpty()) { + get_connect_result(mArgs, result); + status = true; + } else + status = false; + } else + status = false; + + return status; +} + + +bool IcdPrivate::connect(icd_connection_flags flags, IcdConnectResult& result) +{ + clearState(); + //mDBus->callAsynchronous(ICD_DBUS_API_CONNECT_REQ, (uint)flags); + mDBus->call(ICD_DBUS_API_CONNECT_REQ, (uint)flags); + icdRefCounting()->setup(flags); + return doConnect(result); +} + + +bool IcdPrivate::connect(icd_connection_flags flags, QList<ConnectParams>& params, + IcdConnectResult& result) +{ + QVariantList varlist; + QVariantList varlist2; + + foreach (ConnectParams param, params) { + QVariantList items; + + items.append(QVariant(param.connect.service_type)); + items.append(QVariant(param.connect.service_attrs)); + items.append(QVariant(param.connect.service_id)); + items.append(QVariant(param.connect.network_type)); + items.append(QVariant(param.connect.network_attrs)); + items.append(QVariant(param.connect.network_id)); + + varlist.append(items); + } + + varlist2.append(QVariant(varlist)); + + clearState(); + //mDBus->callAsynchronous(ICD_DBUS_API_CONNECT_REQ, (uint)flags, varlist2); + mDBus->call(ICD_DBUS_API_CONNECT_REQ, (uint)flags, varlist2); + icdRefCounting()->setup(flags); + return doConnect(result); +} + + +bool IcdPrivate::doConnect(QString& ret) +{ + QTimer timer; + bool status = false; + + timer.setSingleShot(true); + timer.start(timeout); + + while (timer.isActive() && mInterface.isEmpty() && + mError.isEmpty()) { + QCoreApplication::processEvents(QEventLoop::AllEvents, 1000); + } + + timer.stop(); + + if (mError.isEmpty()) { + if (!mArgs.isEmpty()) { + status = true; + //ret = mArgs[0]; // TODO correctly + } else + status = false; + } else + status = false; + + return status; +} + + +bool IcdPrivate::connect(icd_connection_flags flags, QString& iap, QString& result) +{ + clearState(); + //mDBus->callAsynchronous(ICD_CONNECT_REQ, iap, (uint)flags); + mDBus->call(ICD_CONNECT_REQ, iap, (uint)flags); + icdRefCounting()->setup(flags); + return doConnect(result); +} + + +void IcdPrivate::select(uint flags) +{ + mDBus->call(ICD_DBUS_API_SELECT_REQ, flags); +} + + +void IcdPrivate::disconnect(uint flags, QString& service_type, + uint service_attrs, QString& service_id, + QString& network_type, uint network_attrs, + QByteArray& network_id) +{ + clearState(); + mDBus->call(ICD_DBUS_API_DISCONNECT_REQ, flags, + service_type, service_attrs, service_id, + network_type, network_attrs, network_id); + icdRefCounting()->cleanup(); +} + + +void IcdPrivate::disconnect(uint flags) +{ + clearState(); + mDBus->call(ICD_DBUS_API_DISCONNECT_REQ, flags); + icdRefCounting()->cleanup(); +} + + +static void get_state_all_result(QList<QVariant>& args, + IcdStateResult& ret) +{ + int i=0; + + ret.params.service_type = args[i++].toString(); + ret.params.service_attrs = args[i++].toUInt(); + ret.params.service_id = args[i++].toString(); + ret.params.network_type = args[i++].toString(); + ret.params.network_attrs = args[i++].toUInt(); + ret.params.network_id = args[i++].toByteArray(); + ret.error = args[i++].toString(); + ret.state = args[i++].toInt(); +} + + +static void get_state_all_result2(QList<QVariant>& args, + IcdStateResult& ret) +{ + int i=0; + + ret.params.network_type = args[i++].toString(); + ret.state = args[i++].toInt(); + + // Initialize the other values so that the caller can + // notice we only returned partial status + ret.params.service_type = QString(); + ret.params.service_attrs = 0; + ret.params.service_id = QString(); + ret.params.network_attrs = 0; + ret.params.network_id = QByteArray(); + ret.error = QString(); +} + + +uint IcdPrivate::state(QString& service_type, uint service_attrs, + QString& service_id, QString& network_type, + uint network_attrs, QByteArray& network_id, + IcdStateResult& state_result) +{ + QTimer timer; + QVariant reply; + uint total_signals; + QVariantList vl; + + clearState(); + + reply = mDBus->call(ICD_DBUS_API_STATE_REQ, + service_type, service_attrs, service_id, + network_type, network_attrs, network_id); + if (reply.type() != QVariant::List) + return 0; + vl = reply.toList(); + if (vl.isEmpty()) + return 0; + reply = vl.first(); + total_signals = reply.toUInt(); + if (!total_signals) + return 0; + + timer.setSingleShot(true); + timer.start(timeout); + + mInterface.clear(); + while (timer.isActive() && mInterface.isEmpty()) { + QCoreApplication::processEvents(QEventLoop::AllEvents, 1000); + + if (mSignal != ICD_DBUS_API_STATE_SIG) { + mInterface.clear(); + continue; + } + } + + timer.stop(); + + if (mError.isEmpty()) { + if (!mArgs.isEmpty()) { + if (mArgs.size()>2) + get_state_all_result(mArgs, state_result); + else { + // We are not connected as we did not get the status we asked + return 0; + } + } + } else { + qWarning() << "Error:" << mError; + } + + // The returned value should be one because we asked for one state + return total_signals; +} + + +uint IcdPrivate::state_non_blocking(QList<IcdStateResult>& state_results) +{ + QTimer timer; + QVariant reply; + QVariantList vl; + uint signals_left, total_signals; + IcdStateResult result; + + clearState(); + reply = mDBus->call(ICD_DBUS_API_STATE_REQ); + if (reply.type() != QVariant::List) + return 0; + vl = reply.toList(); + if (vl.isEmpty()) + return 0; + reply = vl.first(); + signals_left = total_signals = reply.toUInt(); + if (!signals_left) + return 0; + + timer.setSingleShot(true); + timer.start(timeout); + state_results.clear(); + mError.clear(); + while (signals_left) { + mInterface.clear(); + while (timer.isActive() && mInterface.isEmpty()) { + QCoreApplication::processEvents(QEventLoop::AllEvents, 1000); + } + + if (!timer.isActive()) { + total_signals = 0; + break; + } + + if (mSignal != ICD_DBUS_API_STATE_SIG) { + continue; + } + + if (mError.isEmpty()) { + if (!mArgs.isEmpty()) { + if (mArgs.size()==2) + get_state_all_result2(mArgs, result); + else + get_state_all_result(mArgs, result); + state_results << result; + } + signals_left--; + } else { + qWarning() << "Error:" << mError; + break; + } + } + timer.stop(); + + return total_signals; +} + + +/* Special version of the state() call which does not call event loop. + * Needed in order to fix NB#175098 where Qt4.7 webkit crashes because event + * loop is run when webkit does not expect it. This function is called from + * bearer management API syncStateWithInterface() in QNetworkSession + * constructor. + */ +uint IcdPrivate::state(QList<IcdStateResult>& state_results) +{ + QTimer timer; + QVariant reply; + QVariantList vl; + uint signals_left, total_signals; + IcdStateResult result; + + clearState(); + reply = mDBus->call(ICD_DBUS_API_STATE_REQ); + if (reply.type() != QVariant::List) + return 0; + vl = reply.toList(); + if (vl.isEmpty()) + return 0; + reply = vl.first(); + signals_left = total_signals = reply.toUInt(); + if (!signals_left) + return 0; + + timer.setSingleShot(true); + timer.start(timeout); + state_results.clear(); + mError.clear(); + while (signals_left) { + mInterface.clear(); + while (timer.isActive() && mInterface.isEmpty()) { + mDBus->synchronousDispatch(1000); + } + + if (!timer.isActive()) { + total_signals = 0; + break; + } + + if (mSignal != ICD_DBUS_API_STATE_SIG) { + continue; + } + + if (mError.isEmpty()) { + if (!mArgs.isEmpty()) { + if (mArgs.size()==2) + get_state_all_result2(mArgs, result); + else + get_state_all_result(mArgs, result); + state_results << result; + } + signals_left--; + } else { + qWarning() << "Error:" << mError; + break; + } + } + timer.stop(); + + return total_signals; +} + + +static void get_statistics_all_result(QList<QVariant>& args, + IcdStatisticsResult& ret) +{ + int i=0; + + if (args.isEmpty()) + return; + + ret.params.service_type = args[i++].toString(); + ret.params.service_attrs = args[i++].toUInt(); + ret.params.service_id = args[i++].toString(); + ret.params.network_type = args[i++].toString(); + ret.params.network_attrs = args[i++].toUInt(); + ret.params.network_id = args[i++].toByteArray(); + ret.time_active = args[i++].toUInt(); + ret.signal_strength = (enum icd_nw_levels)args[i++].toUInt(); + ret.bytes_sent = args[i++].toUInt(); + ret.bytes_received = args[i++].toUInt(); +} + + +uint IcdPrivate::statistics(QList<IcdStatisticsResult>& stats_results) +{ + QTimer timer; + QVariant reply; + QVariantList vl; + uint signals_left, total_signals; + IcdStatisticsResult result; + + clearState(); + reply = mDBus->call(ICD_DBUS_API_STATISTICS_REQ); + if (reply.type() != QVariant::List) + return 0; + vl = reply.toList(); + if (vl.isEmpty()) + return 0; + reply = vl.first(); + if (reply.type() != QVariant::UInt) + return 0; + signals_left = total_signals = reply.toUInt(); + + if (!signals_left) + return 0; + + timer.setSingleShot(true); + timer.start(timeout); + stats_results.clear(); + while (signals_left) { + mInterface.clear(); + while (timer.isActive() && mInterface.isEmpty()) { + QCoreApplication::processEvents(QEventLoop::AllEvents, 1000); + } + + if (!timer.isActive()) { + total_signals = 0; + break; + } + + if (mSignal != ICD_DBUS_API_STATISTICS_SIG) { + continue; + } + + if (mError.isEmpty()) { + get_statistics_all_result(mArgs, result); + stats_results << result; + signals_left--; + } else { + qWarning() << "Error:" << mError; + break; + } + } + timer.stop(); + + return total_signals; +} + + +uint IcdPrivate::statistics(QString& service_type, uint service_attrs, + QString& service_id, QString& network_type, + uint network_attrs, QByteArray& network_id, + IcdStatisticsResult& stats_result) +{ + QTimer timer; + QVariant reply; + uint total_signals; + QVariantList vl; + + clearState(); + + reply = mDBus->call(ICD_DBUS_API_STATISTICS_REQ, + service_type, service_attrs, service_id, + network_type, network_attrs, network_id); + if (reply.type() != QVariant::List) + return 0; + vl = reply.toList(); + if (vl.isEmpty()) + return 0; + reply = vl.first(); + total_signals = reply.toUInt(); + if (!total_signals) + return 0; + + timer.setSingleShot(true); + timer.start(timeout); + + mInterface.clear(); + while (timer.isActive() && mInterface.isEmpty()) { + QCoreApplication::processEvents(QEventLoop::AllEvents, 1000); + + if (mSignal != ICD_DBUS_API_STATISTICS_SIG) { + mInterface.clear(); + continue; + } + } + + timer.stop(); + + if (mError.isEmpty()) { + get_statistics_all_result(mArgs, stats_result); + } else { + qWarning() << "Error:" << mError; + } + + // The returned value should be one because we asked for one statistics + return total_signals; +} + + +static void get_addrinfo_all_result(QList<QVariant>& args, + IcdAddressInfoResult& ret) +{ + int i=0; + + if (args.isEmpty()) + return; + + ret.params.service_type = args[i++].toString(); + ret.params.service_attrs = args[i++].toUInt(); + ret.params.service_id = args[i++].toString(); + ret.params.network_type = args[i++].toString(); + ret.params.network_attrs = args[i++].toUInt(); + ret.params.network_id = args[i++].toByteArray(); + + QVariantList vl = args[i].toList(); + QVariant reply = vl.first(); + QList<QVariant> lst = reply.toList(); + for (int k=0; k<lst.size()/6; k=k+6) { + IcdIPInformation ip_info; + ip_info.address = lst[k].toString(); + ip_info.netmask = lst[k++].toString(); + ip_info.default_gateway = lst[k++].toString(); + ip_info.dns1 = lst[k++].toString(); + ip_info.dns2 = lst[k++].toString(); + ip_info.dns3 = lst[k++].toString(); + + ret.ip_info << ip_info; + } +} + + +/* Special version of the addrinfo() call which does not call event loop. + * Needed in order to fix NB#175098 where Qt4.7 webkit crashes because event + * loop is run when webkit does not expect it. This function is called from + * bearer management API syncStateWithInterface() in QNetworkSession + * constructor. + */ +uint IcdPrivate::addrinfo(QList<IcdAddressInfoResult>& addr_results) +{ + QTimer timer; + QVariant reply; + QVariantList vl; + uint signals_left, total_signals; + IcdAddressInfoResult result; + + clearState(); + reply = mDBus->call(ICD_DBUS_API_ADDRINFO_REQ); + if (reply.type() != QVariant::List) + return 0; + vl = reply.toList(); + if (vl.isEmpty()) + return 0; + reply = vl.first(); + if (reply.type() != QVariant::UInt) + return 0; + signals_left = total_signals = reply.toUInt(); + if (!signals_left) + return 0; + + timer.setSingleShot(true); + timer.start(timeout); + addr_results.clear(); + while (signals_left) { + mInterface.clear(); + while (timer.isActive() && mInterface.isEmpty()) { + mDBus->synchronousDispatch(1000); + } + + if (!timer.isActive()) { + total_signals = 0; + break; + } + + if (mSignal != ICD_DBUS_API_ADDRINFO_SIG) { + continue; + } + + if (mError.isEmpty()) { + get_addrinfo_all_result(mArgs, result); + addr_results << result; + signals_left--; + } else { + qWarning() << "Error:" << mError; + break; + } + } + timer.stop(); + return total_signals; +} + +uint IcdPrivate::addrinfo_non_blocking(QList<IcdAddressInfoResult>& addr_results) +{ + QTimer timer; + QVariant reply; + QVariantList vl; + uint signals_left, total_signals; + IcdAddressInfoResult result; + + clearState(); + reply = mDBus->call(ICD_DBUS_API_ADDRINFO_REQ); + if (reply.type() != QVariant::List) + return 0; + vl = reply.toList(); + if (vl.isEmpty()) + return 0; + reply = vl.first(); + if (reply.type() != QVariant::UInt) + return 0; + signals_left = total_signals = reply.toUInt(); + if (!signals_left) + return 0; + + timer.setSingleShot(true); + timer.start(timeout); + addr_results.clear(); + while (signals_left) { + mInterface.clear(); + while (timer.isActive() && mInterface.isEmpty()) { + QCoreApplication::processEvents(QEventLoop::AllEvents, 1000); + } + + if (!timer.isActive()) { + total_signals = 0; + break; + } + + if (mSignal != ICD_DBUS_API_ADDRINFO_SIG) { + continue; + } + + if (mError.isEmpty()) { + get_addrinfo_all_result(mArgs, result); + addr_results << result; + signals_left--; + } else { + qWarning() << "Error:" << mError; + break; + } + } + timer.stop(); + return total_signals; +} + + +uint IcdPrivate::addrinfo(QString& service_type, uint service_attrs, + QString& service_id, QString& network_type, + uint network_attrs, QByteArray& network_id, + IcdAddressInfoResult& addr_result) +{ + QTimer timer; + QVariant reply; + uint total_signals; + QVariantList vl; + + clearState(); + + reply = mDBus->call(ICD_DBUS_API_ADDRINFO_REQ, + service_type, service_attrs, service_id, + network_type, network_attrs, network_id); + if (reply.type() != QVariant::List) + return 0; + vl = reply.toList(); + if (vl.isEmpty()) + return 0; + reply = vl.first(); + total_signals = reply.toUInt(); + + if (!total_signals) + return 0; + + timer.setSingleShot(true); + timer.start(timeout); + + mInterface.clear(); + while (timer.isActive() && mInterface.isEmpty()) { + QCoreApplication::processEvents(QEventLoop::AllEvents, 1000); + + if (mSignal != ICD_DBUS_API_ADDRINFO_SIG) { + mInterface.clear(); + continue; + } + } + + timer.stop(); + + if (mError.isEmpty()) { + get_addrinfo_all_result(mArgs, addr_result); + } else { + qWarning() << "Error:" << mError; + } + + // The returned value should be one because we asked for one addrinfo + return total_signals; +} + + +Icd::Icd(QObject *parent) + : QObject(parent), d(new IcdPrivate(this)) +{ +} + +Icd::Icd(unsigned int timeout, QObject *parent) + : QObject(parent), d(new IcdPrivate(timeout, this)) +{ +} + +Icd::Icd(unsigned int timeout, IcdDbusInterfaceVer ver, QObject *parent) + : QObject(parent), d(new IcdPrivate(timeout, ver, this)) +{ +} + +Icd::~Icd() +{ + delete d; +} + + +QStringList Icd::scan(icd_scan_request_flags flags, + QStringList &network_types, + QList<IcdScanResult>& scan_results, + QString& error) +{ + return d->scan(flags, network_types, scan_results, error); +} + + +void Icd::scanCancel() +{ + d->scanCancel(); +} + + +bool Icd::connect(icd_connection_flags flags, IcdConnectResult& result) +{ + return d->connect(flags, result); +} + + +bool Icd::connect(icd_connection_flags flags, QList<ConnectParams>& params, + IcdConnectResult& result) +{ + return d->connect(flags, params, result); +} + + +bool Icd::connect(icd_connection_flags flags, QString& iap, QString& result) +{ + return d->connect(flags, iap, result); +} + + +void Icd::select(uint flags) +{ + d->select(flags); +} + + +void Icd::disconnect(uint connect_flags, QString& service_type, + uint service_attrs, QString& service_id, + QString& network_type, uint network_attrs, + QByteArray& network_id) +{ + d->disconnect(connect_flags, service_type, + service_attrs, service_id, + network_type, network_attrs, + network_id); +} + + +void Icd::disconnect(uint connect_flags) +{ + d->disconnect(connect_flags); +} + + +uint Icd::state(QString& service_type, uint service_attrs, + QString& service_id, QString& network_type, + uint network_attrs, QByteArray& network_id, + IcdStateResult &state_result) +{ + return d->state(service_type, service_attrs, service_id, + network_type, network_attrs, network_id, + state_result); +} + + +uint Icd::statistics(QString& service_type, uint service_attrs, + QString& service_id, QString& network_type, + uint network_attrs, QByteArray& network_id, + IcdStatisticsResult& stats_result) +{ + return d->statistics(service_type, service_attrs, service_id, + network_type, network_attrs, network_id, + stats_result); +} + + +uint Icd::addrinfo(QString& service_type, uint service_attrs, + QString& service_id, QString& network_type, + uint network_attrs, QByteArray& network_id, + IcdAddressInfoResult& addr_result) +{ + return d->addrinfo(service_type, service_attrs, service_id, + network_type, network_attrs, network_id, + addr_result); +} + + +uint Icd::state(QList<IcdStateResult>& state_results) +{ + return d->state(state_results); +} + +uint Icd::state_non_blocking(QList<IcdStateResult>& state_results) +{ + return d->state_non_blocking(state_results); +} + +uint Icd::statistics(QList<IcdStatisticsResult>& stats_results) +{ + return d->statistics(stats_results); +} + + +uint Icd::addrinfo(QList<IcdAddressInfoResult>& addr_results) +{ + return d->addrinfo(addr_results); +} + +uint Icd::addrinfo_non_blocking(QList<IcdAddressInfoResult>& addr_results) +{ + return d->addrinfo_non_blocking(addr_results); +} + +void Icd::icdSignalReceived(const QString& interface, + const QString& signal, + const QList<QVariant>& args) +{ + d->signalReceived(interface, signal, args); +} + + +void Icd::icdCallReply(const QString& method, + const QList<QVariant>& args, + const QString& error) +{ + d->callReply(method, args, error); +} + + +QString Icd::error() +{ + return d->error(); +} + +} // Maemo namespace + + diff --git a/src/3rdparty/libconninet/src/maemo_icd.h b/src/3rdparty/libconninet/src/maemo_icd.h new file mode 100644 index 0000000..d7a8d5b --- /dev/null +++ b/src/3rdparty/libconninet/src/maemo_icd.h @@ -0,0 +1,182 @@ +/* + libconninet - Internet Connectivity support library + + Copyright (C) 2009 Nokia Corporation. All rights reserved. + + Contact: Jukka Rissanen <jukka.rissanen@nokia.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public License + version 2.1 as published by the Free Software Foundation. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + +#ifndef MAEMO_ICD_H +#define MAEMO_ICD_H + +#include <QObject> +#include <QStringList> +#include <QByteArray> +#include <QMetaType> +#include <QtDBus> +#include <QDBusArgument> + +#include <glib.h> +#include <icd/dbus_api.h> +#include <icd/osso-ic.h> +#include <icd/osso-ic-dbus.h> + +#include "dbusdispatcher.h" +#include <icd/network_api_defines.h> + +#define ICD_LONG_SCAN_TIMEOUT (30*1000) /* 30sec */ +#define ICD_SHORT_SCAN_TIMEOUT (10*1000) /* 10sec */ +#define ICD_SHORT_CONNECT_TIMEOUT (10*1000) /* 10sec */ +#define ICD_LONG_CONNECT_TIMEOUT (150*1000) /* 2.5min */ + +namespace Maemo { + +struct CommonParams { + QString service_type; + uint service_attrs; + QString service_id; + QString network_type; + uint network_attrs; + QByteArray network_id; +}; + +struct ConnectParams { + struct CommonParams connect; +}; + +struct IcdScanResult { + uint status; // see #icd_scan_status + uint timestamp; // when last seen + QString service_name; + uint service_priority; // within a service type + QString network_name; + uint network_priority; + struct CommonParams scan; + uint signal_strength; // quality, 0 (none) - 10 (good) + QString station_id; // e.g. MAC address or similar id + uint signal_dB; // use signal strength above unless you know what you are doing + + IcdScanResult() { + status = timestamp = scan.service_attrs = service_priority = + scan.network_attrs = network_priority = signal_strength = + signal_dB = 0; + } +}; + +struct IcdConnectResult { + struct CommonParams connect; + uint status; +}; + +struct IcdStateResult { + struct CommonParams params; + QString error; + uint state; +}; + +struct IcdStatisticsResult { + struct CommonParams params; + uint time_active; // in seconds + enum icd_nw_levels signal_strength; // see network_api_defines.h in icd2-dev package + uint bytes_sent; + uint bytes_received; +}; + +struct IcdIPInformation { + QString address; + QString netmask; + QString default_gateway; + QString dns1; + QString dns2; + QString dns3; +}; + +struct IcdAddressInfoResult { + struct CommonParams params; + QList<IcdIPInformation> ip_info; +}; + +enum IcdDbusInterfaceVer { + IcdOldDbusInterface = 0, // use the old OSSO-IC interface + IcdNewDbusInterface // use the new Icd2 interface (default) +}; + + +class IcdPrivate; +class Icd : public QObject +{ + Q_OBJECT + +public: + Icd(QObject *parent = 0); + Icd(unsigned int timeout, QObject *parent = 0); + Icd(unsigned int timeout, IcdDbusInterfaceVer ver, QObject *parent = 0); + ~Icd(); + QString error(); // returns last error string + + /* Icd2 dbus API functions */ + QStringList scan(icd_scan_request_flags flags, + QStringList &network_types, + QList<IcdScanResult>& scan_results, + QString& error); + void scanCancel(); + bool connect(icd_connection_flags flags, IcdConnectResult& result); + bool connect(icd_connection_flags flags, QList<ConnectParams>& params, + IcdConnectResult& result); + bool connect(icd_connection_flags flags, QString& iap, QString& result); + void select(uint flags); + void disconnect(uint connect_flags, QString& service_type, + uint service_attrs, QString& service_id, + QString& network_type, uint network_attrs, + QByteArray& network_id); + void disconnect(uint connect_flags); + + uint state(QString& service_type, uint service_attrs, + QString& service_id, QString& network_type, + uint network_attrs, QByteArray& network_id, + IcdStateResult &state_result); + uint statistics(QString& service_type, uint service_attrs, + QString& service_id, QString& network_type, + uint network_attrs, QByteArray& network_id, + IcdStatisticsResult& stats_result); + uint addrinfo(QString& service_type, uint service_attrs, + QString& service_id, QString& network_type, + uint network_attrs, QByteArray& network_id, + IcdAddressInfoResult& addr_result); + + uint state(QList<IcdStateResult>& state_results); + uint state_non_blocking(QList<IcdStateResult>& state_results); + uint statistics(QList<IcdStatisticsResult>& stats_results); + uint addrinfo(QList<IcdAddressInfoResult>& addr_results); + uint addrinfo_non_blocking(QList<IcdAddressInfoResult>& addr_results); + +private Q_SLOTS: + void icdSignalReceived(const QString& interface, + const QString& signal, + const QList<QVariant>& args); + void icdCallReply(const QString& method, + const QList<QVariant>& args, + const QString& error); + +private: + IcdPrivate *d; + friend class IcdPrivate; +}; + +} // Maemo namespace + +#endif diff --git a/src/3rdparty/libconninet/src/proxyconf.cpp b/src/3rdparty/libconninet/src/proxyconf.cpp new file mode 100644 index 0000000..5b27565 --- /dev/null +++ b/src/3rdparty/libconninet/src/proxyconf.cpp @@ -0,0 +1,315 @@ +/* + libconninet - Internet Connectivity support library + + Copyright (C) 2010 Nokia Corporation. All rights reserved. + + Contact: Jukka Rissanen <jukka.rissanen@nokia.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public License + version 2.1 as published by the Free Software Foundation. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + +#include <QDebug> +#include <QWriteLocker> +#include <QNetworkProxyFactory> +#include <QNetworkProxy> +#include <GConfItem> +#include <gconf/gconf-client.h> +#include "proxyconf.h" + +#define CONF_PROXY "/system/proxy" +#define HTTP_PROXY "/system/http_proxy" + + +namespace Maemo { + +class NetworkProxyFactory : QNetworkProxyFactory { +public: + NetworkProxyFactory() { } + QList<QNetworkProxy> queryProxy(const QNetworkProxyQuery &query = QNetworkProxyQuery()); +}; + + +QList<QNetworkProxy> NetworkProxyFactory::queryProxy(const QNetworkProxyQuery &query) +{ + ProxyConf proxy_conf; + + QList<QNetworkProxy> result = proxy_conf.flush(query); + if (result.isEmpty()) + result << QNetworkProxy::NoProxy; + + return result; +} + + +class ProxyConfPrivate { +private: + // proxy values from gconf + QString mode; + bool use_http_host; + QString autoconfig_url; + QString http_proxy; + quint16 http_port; + QList<QVariant> ignore_hosts; + QString secure_host; + quint16 secure_port; + QString ftp_host; + quint16 ftp_port; + QString socks_host; + quint16 socks_port; + QString rtsp_host; + quint16 rtsp_port; + + QVariant getValue(QString& name); + QVariant getHttpValue(QString& name); + QVariant getValue(const char *name); + QVariant getHttpValue(const char *name); + bool isHostExcluded(const QString &host); + +public: + QString prefix; + QString http_prefix; + + void readProxyData(); + QList<QNetworkProxy> flush(const QNetworkProxyQuery &query); +}; + + +QVariant ProxyConfPrivate::getValue(QString& name) +{ + GConfItem item(prefix + name); + return item.value(); +} + +QVariant ProxyConfPrivate::getHttpValue(QString& name) +{ + GConfItem item(http_prefix + name); + return item.value(); +} + + +QVariant ProxyConfPrivate::getValue(const char *name) +{ + QString n = QString(name); + return getValue(n); +} + +QVariant ProxyConfPrivate::getHttpValue(const char *name) +{ + QString n = QString(name); + return getHttpValue(n); +} + + +#define GET(var, type) \ + do { \ + var = getValue(#var).to##type (); \ + /*qDebug()<<"var="<<var;*/ \ + } while(0) + +#define GET2(var, name, type) \ + do { \ + var = getHttpValue(#name).to##type (); \ + /*qDebug()<<"var="<<var;*/ \ + } while(0) + + +void ProxyConfPrivate::readProxyData() +{ + /* Read the proxy settings from /system/proxy* */ + GET2(http_proxy, host, String); + GET2(http_port, port, Int); + GET2(ignore_hosts, ignore_hosts, List); + + GET(mode, String); + GET(autoconfig_url, String); + GET(secure_host, String); + GET(secure_port, Int); + GET(ftp_host, String); + GET(ftp_port, Int); + GET(socks_host, String); + GET(socks_port, Int); + GET(rtsp_host, String); + GET(rtsp_port, Int); + + if (http_proxy.isEmpty()) + use_http_host = false; + else + use_http_host = true; +} + + +bool ProxyConfPrivate::isHostExcluded(const QString &host) +{ + if (host.isEmpty()) + return true; + + if (ignore_hosts.isEmpty()) + return false; + + QHostAddress ipAddress; + bool isIpAddress = ipAddress.setAddress(host); + + foreach (QVariant h, ignore_hosts) { + QString entry = h.toString(); + if (isIpAddress && ipAddress.isInSubnet(QHostAddress::parseSubnet(entry))) { + return true; // excluded + } else { + // do wildcard matching + QRegExp rx(entry, Qt::CaseInsensitive, QRegExp::Wildcard); + if (rx.exactMatch(host)) + return true; + } + } + + // host was not excluded + return false; +} + + +QList<QNetworkProxy> ProxyConfPrivate::flush(const QNetworkProxyQuery &query) +{ + QList<QNetworkProxy> result; + +#if 0 + qDebug()<<"http_proxy" << http_proxy; + qDebug()<<"http_port" << http_port; + qDebug()<<"ignore_hosts" << ignore_hosts; + qDebug()<<"use_http_host" << use_http_host; + qDebug()<<"mode" << mode; + qDebug()<<"autoconfig_url" << autoconfig_url; + qDebug()<<"secure_host" << secure_host; + qDebug()<<"secure_port" << secure_port; + qDebug()<<"ftp_host" << ftp_host; + qDebug()<<"ftp_port" << ftp_port; + qDebug()<<"socks_host" << socks_host; + qDebug()<<"socks_port" << socks_port; + qDebug()<<"rtsp_host" << rtsp_host; + qDebug()<<"rtsp_port" << rtsp_port; +#endif + + if (isHostExcluded(query.peerHostName())) + return result; // no proxy for this host + + if (mode == "auto") { + // TODO: pac currently not supported, fix me + return result; + } + + if (mode == "manual") { + bool isHttps = false; + QString protocol = query.protocolTag().toLower(); + + // try the protocol-specific proxy + QNetworkProxy protocolSpecificProxy; + + if (protocol == QLatin1String("ftp")) { + if (!ftp_host.isEmpty()) { + protocolSpecificProxy.setType(QNetworkProxy::FtpCachingProxy); + protocolSpecificProxy.setHostName(ftp_host); + protocolSpecificProxy.setPort(ftp_port); + } + } else if (protocol == QLatin1String("http")) { + if (!http_proxy.isEmpty()) { + protocolSpecificProxy.setType(QNetworkProxy::HttpProxy); + protocolSpecificProxy.setHostName(http_proxy); + protocolSpecificProxy.setPort(http_port); + } + } else if (protocol == QLatin1String("https")) { + isHttps = true; + if (!secure_host.isEmpty()) { + protocolSpecificProxy.setType(QNetworkProxy::HttpProxy); + protocolSpecificProxy.setHostName(secure_host); + protocolSpecificProxy.setPort(secure_port); + } + } + + if (protocolSpecificProxy.type() != QNetworkProxy::DefaultProxy) + result << protocolSpecificProxy; + + + if (!socks_host.isEmpty()) { + QNetworkProxy proxy; + proxy.setType(QNetworkProxy::Socks5Proxy); + proxy.setHostName(socks_host); + proxy.setPort(socks_port); + result << proxy; + } + + + // Add the HTTPS proxy if present (and if we haven't added yet) + if (!isHttps) { + QNetworkProxy https; + if (!secure_host.isEmpty()) { + https.setType(QNetworkProxy::HttpProxy); + https.setHostName(secure_host); + https.setPort(secure_port); + } + + if (https.type() != QNetworkProxy::DefaultProxy && + https != protocolSpecificProxy) + result << https; + } + } + + return result; +} + + +ProxyConf::ProxyConf() + : d_ptr(new ProxyConfPrivate) +{ + g_type_init(); + d_ptr->prefix = CONF_PROXY "/"; + d_ptr->http_prefix = HTTP_PROXY "/"; +} + +ProxyConf::~ProxyConf() +{ + delete d_ptr; +} + + +QList<QNetworkProxy> ProxyConf::flush(const QNetworkProxyQuery &query) +{ + d_ptr->readProxyData(); + return d_ptr->flush(query); +} + + +static int refcount = 0; +static QReadWriteLock lock; + +void ProxyConf::update() +{ + QWriteLocker locker(&lock); + NetworkProxyFactory *factory = new NetworkProxyFactory(); + QNetworkProxyFactory::setApplicationProxyFactory((QNetworkProxyFactory*)factory); + refcount++; +} + + +void ProxyConf::clear(void) +{ + QWriteLocker locker(&lock); + refcount--; + if (refcount == 0) + QNetworkProxyFactory::setApplicationProxyFactory(NULL); + + if (refcount<0) + refcount = 0; +} + + +} // namespace Maemo diff --git a/src/3rdparty/libconninet/src/proxyconf.h b/src/3rdparty/libconninet/src/proxyconf.h new file mode 100644 index 0000000..7711c49 --- /dev/null +++ b/src/3rdparty/libconninet/src/proxyconf.h @@ -0,0 +1,53 @@ +/* + libconninet - Internet Connectivity support library + + Copyright (C) 2010 Nokia Corporation. All rights reserved. + + Contact: Jukka Rissanen <jukka.rissanen@nokia.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public License + version 2.1 as published by the Free Software Foundation. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + +#ifndef PROXYCONF_H +#define PROXYCONF_H + +#include <QString> +#include <QNetworkProxy> + +namespace Maemo { + +class ProxyConfPrivate; +class ProxyConf { +private: + ProxyConfPrivate *d_ptr; + +public: + ProxyConf(); + virtual ~ProxyConf(); + + QList<QNetworkProxy> flush(const QNetworkProxyQuery &query = QNetworkProxyQuery()); // read the proxies from db + + /* Note that for each update() call there should be corresponding + * clear() call because the ProxyConf class implements a reference + * counting mechanism. The factory is removed only when there is + * no one using the factory any more. + */ + static void update(void); // this builds QNetworkProxy factory + static void clear(void); // this removes QNetworkProxy factory +}; + +} // namespace Maemo + +#endif diff --git a/src/3rdparty/libconninet/tests/Makefile.am b/src/3rdparty/libconninet/tests/Makefile.am new file mode 100644 index 0000000..f6f41ea --- /dev/null +++ b/src/3rdparty/libconninet/tests/Makefile.am @@ -0,0 +1,39 @@ +DEFS = -DDBUS_API_SUBJECT_TO_CHANGE +INCLUDES = @GLIB_CFLAGS@ @DBUS_CFLAGS@ @CONNSETTINGS_CFLAGS@ @OSSO_IC_CFLAGS@ @ICD_DEV_CFLAGS@ \ + @QTCORE_CFLAGS@ @QTDBUS_CFLAGS@ @QTCORE_CFLAGS@ @QTNETWORK_CFLAGS@ @QTTEST_CFLAGS@ \ + -I$(top_srcdir) \ + -I$(top_srcdir)/src + +LIBS = @GLIB_LIBS@ @DBUS_LIBS@ @CONNSETTINGS_LIBS@ @OSSO_IC_LIBS@ @ICD_DEV_LIBS@ \ + @QTCORE_LIBS@ @QTDBUS_LIBS@ @QTCORE_LIBS@ @QTNETWORK_LIBS@ @QTTEST_LIBS@ \ + $(top_builddir)/src/libconninet.la + +AM_CFLAGS = $(CONCFLAGS) +AM_LDFLAGS = -static + +bin_PROGRAMS = test_dbusdispatcher test_iapconf test_maemo_icd test_iapmonitor test_proxyconf + +test_dbusdispatcher_SOURCES = ut_dbusdispatcher.cpp +ut_dbusdispatcher.o: ut_dbusdispatcher.moc + +test_iapconf_SOURCES = ut_iapconf.cpp +ut_iapconf.o: ut_iapconf.moc + +test_maemo_icd_SOURCES = ut_maemo_icd.cpp +ut_maemo_icd.o: ut_maemo_icd.moc + +test_iapmonitor_SOURCES = ut_iapmonitor.cpp +ut_iapmonitor.o: ut_iapmonitor.moc + +test_proxyconf_SOURCES = ut_proxyconf.cpp +ut_proxyconf.o: ut_proxyconf.moc + + +MAINTAINERCLEANFILES = Makefile.in + +# This rule lets GNU make create any *.moc from the equivalent *.cpp +%.moc: %.cpp + moc $< -o $@ + +# This line ensures that generated moc files are deleted when we make clean. +CLEANFILES = *.moc diff --git a/src/3rdparty/libconninet/tests/ut_dbusdispatcher.cpp b/src/3rdparty/libconninet/tests/ut_dbusdispatcher.cpp new file mode 100644 index 0000000..70deb3f --- /dev/null +++ b/src/3rdparty/libconninet/tests/ut_dbusdispatcher.cpp @@ -0,0 +1,191 @@ +/* * This file is part of conn-dui-settings-inet * + * + * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * + * Contact: Aapo Makela <aapo.makela@nokia.com> + * + * This software, including documentation, is protected by copyright + * controlled by Nokia Corporation. All rights are reserved. Copying, + * including reproducing, storing, adapting or translating, any or all of + * this material requires the prior written consent of Nokia Corporation. + * This material also contains confidential information which may not be + * disclosed to others without the prior written consent of Nokia. + */ + +#include <QtTest/QtTest> +#include <QCoreApplication> +#include <QEventLoop> +#include <QDebug> +#include <icd/dbus_api.h> + +#include <dbusdispatcher.h> + +class Ut_DBusDispatcher : public QObject +{ + Q_OBJECT + +private Q_SLOTS: + void init(); + void cleanup(); + void initTestCase(); + void cleanupTestCase(); + + void simpleSignalReceived(const QString& interface, + const QString& signal, + const QList<QVariant>& args); + void simpleCallReply(const QString& method, + const QList<QVariant>& args, + const QString& error); + void simpleCall(); + + void complexCallReply(const QString& method, + const QList<QVariant>& args, + const QString& error); + void complexCall(); + +private: + Maemo::DBusDispatcher *mSubject; + QProcess *icd_stub; + + QString mMethod; + QString mInterface; + QString mSignal; + QList<QVariant> mArgs; +}; + +void Ut_DBusDispatcher::init() +{ + mSubject = new Maemo::DBusDispatcher("com.nokia.icd2", "/com/nokia/icd2", + "com.nokia.icd2"); + + // Start icd2 stub + icd_stub = new QProcess(this); + icd_stub->start("/usr/bin/icd2_stub.py"); + QTest::qWait(1000); +} + +void Ut_DBusDispatcher::cleanup() +{ + // Terminate icd2 stub + icd_stub->terminate(); + icd_stub->waitForFinished(); + + delete mSubject; + mSubject = 0; +} + +void Ut_DBusDispatcher::initTestCase() +{ +} + +void Ut_DBusDispatcher::cleanupTestCase() +{ +} + +void Ut_DBusDispatcher::simpleSignalReceived(const QString& interface, + const QString& signal, + const QList<QVariant>& args) +{ + // Signal handler, which simply records what has been signalled + mInterface = interface; + mSignal = signal; + mArgs = args; +} + +void Ut_DBusDispatcher::simpleCallReply(const QString& method, + const QList<QVariant>& args, + const QString& error) +{ + mMethod = method; + + // Check that method matches and at least WLAN_INFRA is returned + QVERIFY(error.isEmpty()); + QVERIFY(args[0].toStringList().contains("WLAN_INFRA")); +} + +void Ut_DBusDispatcher::simpleCall() +{ + uint flags = 0; + QList<QVariant> reply; + int idx = 0; + QTimer timer; + + // Connect signals + connect(mSubject, SIGNAL(signalReceived(const QString&, + const QString&, + const QList<QVariant>&)), + this, SLOT(simpleSignalReceived(const QString&, + const QString&, + const QList<QVariant>&))); + connect(mSubject, SIGNAL(callReply(const QString&, + const QList<QVariant>&, + const QString&)), + this, SLOT(simpleCallReply(const QString&, + const QList<QVariant>&, + const QString&))); + + // Request scan and verify the call starts succesfully + QVERIFY(mSubject->callAsynchronous("scan_req", flags)); + + // Wait 1st scan signal for 10 secs + timer.setSingleShot(true); + timer.start(10000); + while (timer.isActive() && mInterface.isEmpty()) { + QCoreApplication::processEvents(QEventLoop::AllEvents, 1000); + idx++; + } + timer.stop(); + + // Sanity checks for the scan result + QVERIFY(mInterface == "com.nokia.icd2"); // interface is icd2 + QVERIFY(mMethod == "scan_req"); // method is scan_req + QVERIFY(mSignal == "scan_result_sig"); // signal is scan result + QVERIFY(mArgs[0] == QVariant(0) || + mArgs[0] == QVariant(4)); // First argument is status + // (0 == NEW, 4 == COMPLETED) + //QVERIFY(mArgs.contains(QVariant("WLAN_INFRA"))); // WLAN scan result +} + +void Ut_DBusDispatcher::complexCallReply(const QString& method, + const QList<QVariant>& args, + const QString& error) +{ + mMethod = method; + + // Check that method has not return arguments and error is not set + QVERIFY(error.isEmpty()); + QVERIFY(args.isEmpty()); +} + +void Ut_DBusDispatcher::complexCall() +{ + uint flags = ICD_CONNECTION_FLAG_UI_EVENT; + QList<QVariant> reply; + QVariantList networks; + QVariantList network1; + + network1 << "" << (uint)0 << "" << "WLAN_INFRA" << (uint)0x05000011 << QByteArray("osso@46@net"); + networks << QVariant(network1); + + // Connect signal + connect(mSubject, SIGNAL(callReply(const QString&, + const QList<QVariant>&, + const QString&)), + this, SLOT(complexCallReply(const QString&, + const QList<QVariant>&, + const QString&))); + + // Request connect and verify the call starts succesfully + QVERIFY(mSubject->callAsynchronous("connect_req", flags, networks)); + + QTest::qWait(1000); + + // Sanity checks for the scan result + QVERIFY(mInterface == "com.nokia.icd2"); // interface is icd2 + QVERIFY(mMethod == "connect_req"); // method connect_req +} + +QTEST_MAIN(Ut_DBusDispatcher) + +#include "ut_dbusdispatcher.moc" diff --git a/src/3rdparty/libconninet/tests/ut_iapconf.cpp b/src/3rdparty/libconninet/tests/ut_iapconf.cpp new file mode 100644 index 0000000..6a91d61 --- /dev/null +++ b/src/3rdparty/libconninet/tests/ut_iapconf.cpp @@ -0,0 +1,186 @@ +/* + libconninet - Internet Connectivity support library + + Copyright (C) 2009 Nokia Corporation. All rights reserved. + + Contact: Aapo Makela <aapo.makela@nokia.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public License + version 2.1 as published by the Free Software Foundation. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + + +#include <QtTest/QtTest> +#include <QDebug> + +#include <iapconf.h> + +class Ut_IAPConf : public QObject +{ + Q_OBJECT + +private Q_SLOTS: + void init(); + void cleanup(); + void initTestCase(); + void cleanupTestCase(); + + void setupIAP(); + void setupIAPContainingDot(); + void unsetIAPValueIsNotValid(); + void verifyAllIAPs(); + void allForEmptyConfReturnsEmptyList(); + void settingInvalidValueUnsetsKey(); + +private: + Maemo::IAPConf *mSubject; +}; + +void Ut_IAPConf::init() +{ + mSubject = new Maemo::IAPConf("test_iap"); +} + +void Ut_IAPConf::cleanup() +{ + // Clear made settings + mSubject->clear(); + + delete mSubject; + mSubject = 0; +} + +void Ut_IAPConf::initTestCase() +{ +} + +void Ut_IAPConf::cleanupTestCase() +{ +} + +void Ut_IAPConf::setupIAP() +{ + // Set bunch of values + mSubject->set("ipv4_type", "AUTO", + "wlan_wepkey1", "connt", + "wlan_wepdefkey", 1, + "wlan_ssid", QByteArray("CONNTEST-1")); + + // Set one value + mSubject->setValue("type", "WLAN_INFRA"); + + // Check all values that they were set correctly + QVERIFY(mSubject->value("ipv4_type").toString() == "AUTO"); + QVERIFY(mSubject->value("wlan_wepkey1").toString() == "connt"); + QVERIFY(mSubject->value("wlan_wepdefkey").toInt() == 1); + QVERIFY(mSubject->value("wlan_ssid").toByteArray() == QByteArray("CONNTEST-1")); + QVERIFY(mSubject->value("type").toString() == "WLAN_INFRA"); +} + +void Ut_IAPConf::setupIAPContainingDot() +{ + delete mSubject; + mSubject = new Maemo::IAPConf("test.iap"); + + // Set and check one value + mSubject->setValue("type", "DUMMY"); + QVERIFY(mSubject->value("type").toString() == "DUMMY"); +} + +void Ut_IAPConf::unsetIAPValueIsNotValid() +{ + QVariant invalidValue = mSubject->value("this_value_does_not_exist"); + QVERIFY(invalidValue.isValid() == false); +} + +void Ut_IAPConf::verifyAllIAPs() +{ + int count = 0, extras = 0; + QRegExp regexp("iap[1-3]"); + Maemo::IAPConf iap1("iap1"); + Maemo::IAPConf iap2("iap2"); + Maemo::IAPConf iap3("iap3"); + + iap1.clear(); + iap2.clear(); + iap3.clear(); + + iap1.setValue("name", "iap1"); + iap2.setValue("name", "iap2"); + iap3.setValue("name", "iap3"); + + count = extras = 0; + QList<QString> iaps; + Maemo::IAPConf::getAll(iaps, true); + foreach (QString iap_path, iaps) { + QString iap_id = iap_path.section('/', 5); /* This is the IAP id */ + if (!iap_id.contains(regexp)) { + extras++; + continue; + } + Maemo::IAPConf iap(iap_id); + QString name = iap.value("name").toString(); + QVERIFY(name == iap_id); + count++; + } + QCOMPARE(count, iaps.size()-extras); + + iap1.clear(); + iap2.clear(); + iap3.clear(); + + iap1.setValue("name", "iap1"); + iap2.setValue("name", "iap2"); + iap3.setValue("name", "iap3"); + + count = extras = 0; + Maemo::IAPConf::getAll(iaps); + foreach (QString iap_id, iaps) { + if (!iap_id.contains(regexp)) { + extras++; + continue; + } + Maemo::IAPConf iap(iap_id); + QString name = iap.value("name").toString(); + QVERIFY(name == iap_id); + count++; + } + QCOMPARE(count, iaps.size()-extras); +} + +void Ut_IAPConf::allForEmptyConfReturnsEmptyList() +{ + // Clear everything in configuration + mSubject->clearAll(); + + // Get all for a list and check that it is empty + QStringList iaps; + mSubject->getAll(iaps); + QVERIFY(iaps.isEmpty()); +} + +void Ut_IAPConf::settingInvalidValueUnsetsKey() +{ + // Setup some IAP + setupIAP(); + + // Set invalid value to unset "wlan_wepdefkey" key and verify that the + // value is unset + mSubject->setValue("wlan_wepdefkey", QVariant()); + QVERIFY(!mSubject->value("wlan_wepdefkey").isValid()); +} + +QTEST_MAIN(Ut_IAPConf) + +#include "ut_iapconf.moc" diff --git a/src/3rdparty/libconninet/tests/ut_iapmonitor.cpp b/src/3rdparty/libconninet/tests/ut_iapmonitor.cpp new file mode 100644 index 0000000..f14f623 --- /dev/null +++ b/src/3rdparty/libconninet/tests/ut_iapmonitor.cpp @@ -0,0 +1,118 @@ +/* + libconninet - Internet Connectivity support library + + Copyright (C) 2009-2010 Nokia Corporation. All rights reserved. + + Contact: Jukka Rissanen <jukka.rissanen@nokia.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public License + version 2.1 as published by the Free Software Foundation. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + + +#include <QtTest/QtTest> +#include <QDebug> + +#include <iapmonitor.h> +#include <iapconf.h> + +static const char *iap_id = "test_monitor_1"; + +class TestIAPMonitor : public Maemo::IAPMonitor +{ +public: + QString addedIap; + QString removedIap; + +protected: + virtual void iapAdded(const QString &id) + { + addedIap = id; + } + + virtual void iapRemoved(const QString &id) + { + removedIap = id; + } +}; + +class Ut_IAPMonitor : public QObject +{ + Q_OBJECT + +private Q_SLOTS: + void init(); + void cleanup(); + void initTestCase(); + void cleanupTestCase(); + + void check(); + +private: + TestIAPMonitor *mon; + Maemo::IAPConf *iap; +}; + +void Ut_IAPMonitor::init() +{ + mon = new TestIAPMonitor; +} + +void Ut_IAPMonitor::cleanup() +{ + delete mon; + mon = 0; +} + +void Ut_IAPMonitor::initTestCase() +{ +} + +void Ut_IAPMonitor::cleanupTestCase() +{ +} + +void Ut_IAPMonitor::check() +{ + QVERIFY(mon->addedIap.isEmpty()); + + iap = new Maemo::IAPConf(iap_id); + iap->set("ipv4_type", "AUTO", + "wlan_wepkey1", "connt", + "wlan_wepdefkey", 1, + "wlan_ssid", QByteArray(iap_id)); + + QCoreApplication::processEvents(QEventLoop::AllEvents, 1000); + QVERIFY(mon->addedIap == iap_id); + mon->addedIap.clear(); + + QVERIFY(mon->removedIap.isEmpty()); + + // Unset only one value and verify that IAP is not removed + iap->set("ipv4_type", QVariant()); + QCoreApplication::processEvents(QEventLoop::AllEvents, 1000); + QVERIFY(mon->removedIap.isEmpty()); + + // Clear the whole IAP and check that it is removed + iap->clear(); + delete iap; + + QCoreApplication::processEvents(QEventLoop::AllEvents, 1000); + + QVERIFY(mon->removedIap == iap_id); +} + +QTEST_MAIN(Ut_IAPMonitor) + +#include "ut_iapmonitor.moc" diff --git a/src/3rdparty/libconninet/tests/ut_maemo_icd.cpp b/src/3rdparty/libconninet/tests/ut_maemo_icd.cpp new file mode 100644 index 0000000..494829d --- /dev/null +++ b/src/3rdparty/libconninet/tests/ut_maemo_icd.cpp @@ -0,0 +1,274 @@ +/* + * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * + * Contact: Jukka Rissanen <jukka.rissanen@nokia.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * version 2.1 as published by the Free Software Foundation. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA + */ + + +// !!!! +// !!!! NOTE: THESE TEST DO NOT REALLY WORK YET BECAUSE OF MISSING +// !!!! FUNCTIONALITY IN ICD2 STUB. YOU HAVE BEEN WARNED. +// !!!! + + +#include <QtTest/QtTest> +#include <QCoreApplication> +#include <QEventLoop> +#include <QDebug> +#include <icd/dbus_api.h> + +#include "maemo_icd.h" + +class Ut_MaemoIcd : public QObject +{ + Q_OBJECT + +private Q_SLOTS: + void init(); + void cleanup(); + void initTestCase(); + void cleanupTestCase(); + + void scan_req(); + void scan_cancel_req(); + void connect_req_default(); + void state_req_all(); + void state_req(); + void statistics_req_all(); + void statistics_req(); + void addrinfo_req_all(); + void addrinfo_req(); + +private: + void disconnect_req_default(); // this is currently not run + void connect_req_specific(); // this is currently not run + QProcess *icd_stub; + bool connect_iap(Maemo::IcdConnectResult &connect_result, + QString &result, + QString &error, + QString iap=QString()); +}; + + +QString create_error_str(Maemo::Icd &icd) +{ + return icd.error(); +} + + +void Ut_MaemoIcd::init() +{ + icd_stub = new QProcess(this); + icd_stub->setStandardOutputFile("/tmp/ut_maemo_icd.log"); + icd_stub->start("/usr/bin/icd2_stub.py"); + QTest::qWait(1000); + + // Set the statistics + QProcess dbus_send; + dbus_send.start("dbus-send --type=method_call --system " + "--dest=com.nokia.icd2 /com/nokia/icd2 " + "com.nokia.icd2.testing.set_statistics " + "uint32:1024 uint32:256"); + dbus_send.waitForFinished(); + +} + +void Ut_MaemoIcd::cleanup() +{ + icd_stub->terminate(); + icd_stub->waitForFinished(); +} + +void Ut_MaemoIcd::initTestCase() +{ +} + +void Ut_MaemoIcd::cleanupTestCase() +{ +} + +void Ut_MaemoIcd::scan_req() +{ + QList<Maemo::IcdScanResult> scanned; + QStringList scannedNetworkTypes; + QStringList networkTypesToScan; + QString error; + Maemo::Icd icd(ICD_SHORT_SCAN_TIMEOUT); + + scannedNetworkTypes = icd.scan(ICD_SCAN_REQUEST_ACTIVE, + networkTypesToScan, + scanned, + error); + QVERIFY(error.isEmpty()); + QCOMPARE(scanned.size(), 3); + QVERIFY(scannedNetworkTypes[0] == "WLAN_INFRA"); + QVERIFY(scannedNetworkTypes[1] == "DUN_GSM_PS"); +} + +void Ut_MaemoIcd::scan_cancel_req() +{ + Maemo::Icd icd; + icd.scanCancel(); + // Not much to verify here +} + +bool Ut_MaemoIcd::connect_iap(Maemo::IcdConnectResult &connect_result, + QString &result, + QString &error, + QString iap) +{ + icd_connection_flags flags = ICD_CONNECTION_FLAG_USER_EVENT; + bool st; + Maemo::Icd icd(ICD_SHORT_CONNECT_TIMEOUT); + + if (iap.isEmpty()) { + qDebug() << "connecting to default IAP"; + st = icd.connect(flags, connect_result); + } else { + qDebug() << "connecting to" << iap; + st = icd.connect(flags, iap, result); + } + + error = create_error_str(icd); + return st; +} + +void Ut_MaemoIcd::connect_req_default() +{ + Maemo::IcdConnectResult connect_result; + QString result, error; + bool st; + st = connect_iap(connect_result, result, error); + QVERIFY2(st, error.toAscii().data()); + result = connect_result.connect.network_id.data(); + qDebug() << result; +} + + +void Ut_MaemoIcd::disconnect_req_default() +{ + icd_connection_flags flags = ICD_CONNECTION_FLAG_USER_EVENT; + bool st; + Maemo::Icd icd(ICD_SHORT_CONNECT_TIMEOUT); + icd.disconnect(flags); +} + + +void Ut_MaemoIcd::connect_req_specific() +{ + Maemo::IcdConnectResult connect_result; + QString result; + QString error; + bool st; + st = connect_iap(connect_result, result, error, "wpa2gx2.osso.net"); + QVERIFY2(st, error.toAscii().data()); + qDebug() << result; +} + + +void Ut_MaemoIcd::state_req_all() +{ + QList<Maemo::IcdStateResult> state_results; + Maemo::Icd icd; + int sig; + sig = icd.state(state_results); + QVERIFY2(sig==1, create_error_str(icd).toAscii().data()); +} + + +void Ut_MaemoIcd::state_req() +{ + Maemo::IcdStateResult state_result; + Maemo::Icd icd; + int sig; + QString service_type, service_id; + QString network_type("WLAN_INFRA"); + QByteArray network_id("wpa2gx2.osso.net"); + sig = icd.state(service_type, 0, service_id, + network_type, (uint)0x17a1, network_id, + state_result); + QVERIFY2(sig==1, create_error_str(icd).toAscii().data()); +} + + +void Ut_MaemoIcd::statistics_req_all() +{ + QList<Maemo::IcdStatisticsResult> stats_results; + Maemo::Icd icd; + int sig; + QString err; + sig = icd.statistics(stats_results); + err = create_error_str(icd); + if (!err.isEmpty()) + QVERIFY2(sig==1, err.toAscii().data()); + else + QCOMPARE(sig, 1); + + for(int i=0; i<sig; i++) { + QVERIFY(stats_results[i].bytes_received == 1024); + QVERIFY(stats_results[i].bytes_sent == 256); + } +} + + +// Can be uncommented when needed function is enabled in Icd class +void Ut_MaemoIcd::statistics_req() +{ + Maemo::IcdStatisticsResult stats_result; + Maemo::Icd icd; + int sig; + QString service_type, service_id; + QString network_type("WLAN_INFRA"); + QByteArray network_id("wpa2gx2.osso.net"); + sig = icd.statistics(service_type, 0, service_id, + network_type, (uint)0x17a1, network_id, + stats_result); + QVERIFY2(sig==1, create_error_str(icd).toAscii().data()); + QVERIFY(stats_result.bytes_received == 1024); + QVERIFY(stats_result.bytes_sent == 256); +} + + +void Ut_MaemoIcd::addrinfo_req_all() +{ + QList<Maemo::IcdAddressInfoResult> addr_results; + Maemo::Icd icd; + int sig; + sig = icd.addrinfo(addr_results); + QVERIFY2(sig==1, create_error_str(icd).toAscii().data()); +} + + +void Ut_MaemoIcd::addrinfo_req() +{ + Maemo::IcdAddressInfoResult addr_result; + Maemo::Icd icd; + int sig; + QString service_type, service_id; + QString network_type("WLAN_INFRA"); + QByteArray network_id("wpa2gx2.osso.net"); + sig = icd.addrinfo(service_type, 0, service_id, + network_type, (uint)0x17a1, network_id, + addr_result); + QVERIFY2(sig==1, create_error_str(icd).toAscii().data()); +} + + +QTEST_MAIN(Ut_MaemoIcd) + +#include "ut_maemo_icd.moc" diff --git a/src/3rdparty/libconninet/tests/ut_proxyconf.cpp b/src/3rdparty/libconninet/tests/ut_proxyconf.cpp new file mode 100644 index 0000000..1f407f0 --- /dev/null +++ b/src/3rdparty/libconninet/tests/ut_proxyconf.cpp @@ -0,0 +1,400 @@ +/* + libconninet - Internet Connectivity support library + + Copyright (C) 2010 Nokia Corporation. All rights reserved. + + Contact: Jukka Rissanen <jukka.rissanen@nokia.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public License + version 2.1 as published by the Free Software Foundation. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + + +#include <QtTest/QtTest> +#include <QDebug> +#include <QNetworkProxy> +#include <conn_settings.h> + +#include "../src/proxyconf.h" + +class Ut_ProxyConf : public QObject +{ + Q_OBJECT + +private Q_SLOTS: + void init(); + void cleanup(); + void initTestCase(); + void cleanupTestCase(); + + // tests without the factory + void proxy_ftp_no_factory_ok_auto(); + void proxy_ftp_no_factory_ok_manual(); + void proxy_http_no_factory_ok_manual(); + void proxy_https_no_factory_ok_manual(); + void proxy_socks_no_factory_ok_manual(); + void proxy_default_no_factory_ok_manual(); + + // tests using the factory + void proxy_ftp_factory_ok_auto(); + void proxy_ftp_factory_ok_manual(); + void proxy_http_factory_ok_manual(); + void proxy_https_factory_ok_manual(); + void proxy_socks_factory_ok_manual(); + void proxy_http_factory_ok_manual_clear(); + void proxy_default_factory_ok_manual(); + void proxy_http_factory_ok_manual_ignore_list(); + void proxy_default_factory_ok_manual_system(); + +private: + Maemo::ProxyConf *pc; +}; + + +void put(QString var, QString type, QString value) +{ + QProcess gconf; + if (value.isEmpty()) + gconf.start(QString("gconftool-2 -u /system/proxy/"+var)); + else + gconf.start(QString("gconftool-2 -s /system/proxy/"+var+" -t "+type+" "+value)); + gconf.waitForFinished(); +} + +void put_http(QString var, QString type, QString value) +{ + QProcess gconf; + if (value.isEmpty()) + gconf.start(QString("gconftool-2 -u /system/http_proxy/"+var)); + else + gconf.start(QString("gconftool-2 -s /system/http_proxy/"+var+" -t "+type+" "+value)); + gconf.waitForFinished(); +} + +void put_list(QString var, QString type, QList<QString> value) +{ + QProcess gconf; + QString values = "["; + foreach (QString str, value) + values = values + str + ","; + values.chop(1); + values = values + "]"; + + gconf.start(QString("gconftool-2 -s /system/http_proxy/"+var+" -t list --list-type="+type+" "+values)); + gconf.waitForFinished(); +} + + +void Ut_ProxyConf::init() +{ + put_http("host", "string", "my.proxy.com"); + put_http("port", "int", "8080"); + + QList<QString> list; + list.append("foo.bar.com"); + list.append("192.168.19.69"); + list.append("192.168.20.0/24"); + list.append("bar.foo.com"); + put_list("ignore_hosts", "string", list); + put_http("use_http_host", "boolean", "true"); + + put("mode", "string", "auto"); + put("autoconfig_url", "string", "http://foo.bar.com/autoconf"); + put("secure_host", "string", "secure_host.com"); + put("secure_port", "int", "112"); + + put("ftp_host", "string", "ftp.nuukia.com"); + put("ftp_port", "int", "2000"); + put("socks_host", "string", "socks.host.com"); + put("socks_port", "int", "10080"); + put("rtsp_host", "string", "rtsp.voice.com"); + put("rtsp_port", "int", "1554"); + + pc = new Maemo::ProxyConf(); +} + +void Ut_ProxyConf::cleanup() +{ + delete pc; + pc = 0; +} + +void Ut_ProxyConf::initTestCase() +{ +} + +void Ut_ProxyConf::cleanupTestCase() +{ +} + + +void Ut_ProxyConf::proxy_ftp_no_factory_ok_auto() +{ + QList<QNetworkProxy> nplist; + QNetworkProxyQuery query = QNetworkProxyQuery(QUrl("ftp://maps.google.com/")); + + nplist = pc->flush(query); + QVERIFY(nplist.length()==0); +} + + +void Ut_ProxyConf::proxy_ftp_no_factory_ok_manual() +{ + QList<QNetworkProxy> nplist; + QNetworkProxyQuery query = QNetworkProxyQuery(QUrl("ftp://maps.google.com/")); + + put("mode", "string", "manual"); + + nplist = pc->flush(query); + foreach (QNetworkProxy proxy, nplist) { + qDebug() << "proxy: " << proxy.hostName() << "port" << proxy.port(); + } + QVERIFY(nplist.length()==3); + QVERIFY(nplist.first().type() == QNetworkProxy::FtpCachingProxy); +} + + +void Ut_ProxyConf::proxy_http_no_factory_ok_manual() +{ + QList<QNetworkProxy> nplist; + QNetworkProxyQuery query = QNetworkProxyQuery(QUrl("http://maps.google.com/")); + + put("mode", "string", "manual"); + + nplist = pc->flush(query); + foreach (QNetworkProxy proxy, nplist) { + qDebug() << "proxy: " << proxy.hostName() << "port" << proxy.port(); + } + QVERIFY(nplist.length()==3); + QVERIFY(nplist.first().type() == QNetworkProxy::HttpProxy); +} + + +void Ut_ProxyConf::proxy_https_no_factory_ok_manual() +{ + QList<QNetworkProxy> nplist; + QNetworkProxyQuery query = QNetworkProxyQuery(QUrl("https://maps.google.com/")); + + put("mode", "string", "manual"); + + nplist = pc->flush(query); + foreach (QNetworkProxy proxy, nplist) { + qDebug() << "proxy: " << proxy.hostName() << "port" << proxy.port(); + } + QVERIFY(nplist.length()==2); + QVERIFY(nplist.first().type() == QNetworkProxy::HttpProxy); +} + + +void Ut_ProxyConf::proxy_socks_no_factory_ok_manual() +{ + QList<QNetworkProxy> nplist; + QNetworkProxyQuery query = QNetworkProxyQuery(QUrl("http://maps.google.com/")); + + put("mode", "string", "manual"); + put_http("host", "string", ""); + + nplist = pc->flush(query); + foreach (QNetworkProxy proxy, nplist) { + qDebug() << "proxy: " << proxy.hostName() << "port" << proxy.port(); + } + QVERIFY(nplist.length()==2); + QVERIFY(nplist.first().type() == QNetworkProxy::Socks5Proxy); +} + + +void Ut_ProxyConf::proxy_default_no_factory_ok_manual() +{ + QList<QNetworkProxy> nplist; + QNetworkProxyQuery query = QNetworkProxyQuery(QUrl("foobar://maps.google.com/")); + + put("mode", "string", "manual"); + put("socks_host", "string", ""); + put("secure_host", "string", ""); + + nplist = pc->flush(query); + foreach (QNetworkProxy proxy, nplist) { + qDebug() << "proxy: " << proxy.hostName() << "port" << proxy.port(); + } + QVERIFY(nplist.length()==0); +} + + +void Ut_ProxyConf::proxy_ftp_factory_ok_auto() +{ + QNetworkProxyQuery query = QNetworkProxyQuery(QUrl("ftp://maps.google.com/")); + Maemo::ProxyConf::update(); + QList<QNetworkProxy> listOfProxies = QNetworkProxyFactory::proxyForQuery(query); + QVERIFY(listOfProxies.length()==1); + QVERIFY(listOfProxies.first().type() == QNetworkProxy::NoProxy); + Maemo::ProxyConf::clear(); +} + + +void Ut_ProxyConf::proxy_ftp_factory_ok_manual() +{ + QNetworkProxyQuery query = QNetworkProxyQuery(QUrl("ftp://maps.google.com/")); + Maemo::ProxyConf::update(); + + put("mode", "string", "manual"); + + QList<QNetworkProxy> listOfProxies = QNetworkProxyFactory::proxyForQuery(query); + + foreach (QNetworkProxy proxy, listOfProxies) { + qDebug() << "proxy: " << proxy.hostName() << "port" << proxy.port(); + } + QVERIFY(listOfProxies.length()==3); + QVERIFY(listOfProxies.first().type() == QNetworkProxy::FtpCachingProxy); + Maemo::ProxyConf::clear(); +} + + +void Ut_ProxyConf::proxy_http_factory_ok_manual() +{ + QNetworkProxyQuery query = QNetworkProxyQuery(QUrl("http://maps.google.com/")); + Maemo::ProxyConf::update(); + + put("mode", "string", "manual"); + + QList<QNetworkProxy> listOfProxies = QNetworkProxyFactory::proxyForQuery(query); + + foreach (QNetworkProxy proxy, listOfProxies) { + qDebug() << "proxy: " << proxy.hostName() << "port" << proxy.port(); + } + QVERIFY(listOfProxies.length()==3); + QVERIFY(listOfProxies.first().type() == QNetworkProxy::HttpProxy); + Maemo::ProxyConf::clear(); +} + + +void Ut_ProxyConf::proxy_https_factory_ok_manual() +{ + QNetworkProxyQuery query = QNetworkProxyQuery(QUrl("https://maps.google.com/")); + Maemo::ProxyConf::update(); + + put("mode", "string", "manual"); + + QList<QNetworkProxy> listOfProxies = QNetworkProxyFactory::proxyForQuery(query); + + foreach (QNetworkProxy proxy, listOfProxies) { + qDebug() << "proxy: " << proxy.hostName() << "port" << proxy.port(); + } + QVERIFY(listOfProxies.length()==2); + QVERIFY(listOfProxies.first().type() == QNetworkProxy::HttpProxy); + Maemo::ProxyConf::clear(); +} + + +void Ut_ProxyConf::proxy_socks_factory_ok_manual() +{ + QNetworkProxyQuery query = QNetworkProxyQuery(QUrl("http://maps.google.com/")); + Maemo::ProxyConf::update(); + + put("mode", "string", "manual"); + put_http("host", "string", ""); + + QList<QNetworkProxy> listOfProxies = QNetworkProxyFactory::proxyForQuery(query); + + foreach (QNetworkProxy proxy, listOfProxies) { + qDebug() << "proxy: " << proxy.hostName() << "port" << proxy.port(); + } + QVERIFY(listOfProxies.length()==2); + QVERIFY(listOfProxies.first().type() == QNetworkProxy::Socks5Proxy); + Maemo::ProxyConf::clear(); +} + + +void Ut_ProxyConf::proxy_http_factory_ok_manual_clear() +{ + QNetworkProxyQuery query = QNetworkProxyQuery(QUrl("http://maps.google.com/")); + Maemo::ProxyConf::update(); + + put("mode", "string", "manual"); + put_http("host", "string", "192.168.1.1"); + + QList<QNetworkProxy> listOfProxies = QNetworkProxyFactory::proxyForQuery(query); + + foreach (QNetworkProxy proxy, listOfProxies) { + qDebug() << "proxy: " << proxy.hostName() << "port" << proxy.port(); + } + QVERIFY(listOfProxies.length()==3); + QVERIFY(listOfProxies.first().type() == QNetworkProxy::HttpProxy); + + Maemo::ProxyConf::clear(); + listOfProxies = QNetworkProxyFactory::proxyForQuery(query); + QVERIFY(listOfProxies.length()==1); + QVERIFY(listOfProxies.first().type() == QNetworkProxy::NoProxy); +} + + +void Ut_ProxyConf::proxy_default_factory_ok_manual() +{ + QNetworkProxyQuery query = QNetworkProxyQuery(QUrl("foobar://maps.google.com/")); + Maemo::ProxyConf::update(); + + put("mode", "string", "manual"); + put("socks_host", "string", ""); + put("secure_host", "string", ""); + + QList<QNetworkProxy> listOfProxies = QNetworkProxyFactory::proxyForQuery(query); + + QVERIFY(listOfProxies.length()==1); + QVERIFY(listOfProxies.first().type() == QNetworkProxy::NoProxy); + Maemo::ProxyConf::clear(); +} + + +void Ut_ProxyConf::proxy_http_factory_ok_manual_ignore_list() +{ + QNetworkProxyQuery query = QNetworkProxyQuery(QUrl("http://192.168.19.70/")); + Maemo::ProxyConf::update(); + + put("mode", "string", "manual"); + + QList<QNetworkProxy> listOfProxies = QNetworkProxyFactory::proxyForQuery(query); + + foreach (QNetworkProxy proxy, listOfProxies) { + qDebug() << "proxy: " << proxy.hostName() << "port" << proxy.port(); + } + QVERIFY(listOfProxies.length()==3); + QVERIFY(listOfProxies.first().type() == QNetworkProxy::HttpProxy); + + query = QNetworkProxyQuery(QUrl("http://192.168.20.10/")); + listOfProxies = QNetworkProxyFactory::proxyForQuery(query); + QVERIFY(listOfProxies.length()==1); + QVERIFY(listOfProxies.first().type() == QNetworkProxy::NoProxy); + Maemo::ProxyConf::clear(); +} + + +void Ut_ProxyConf::proxy_default_factory_ok_manual_system() +{ + QNetworkProxyQuery query = QNetworkProxyQuery(QUrl("http://maps.google.com/")); + Maemo::ProxyConf::update(); + + put("mode", "string", "manual"); + + QList<QNetworkProxy> listOfProxies = QNetworkProxyFactory::systemProxyForQuery(query); + + QVERIFY(listOfProxies.length()==1); + QVERIFY(listOfProxies.first().type() == QNetworkProxy::NoProxy); + Maemo::ProxyConf::clear(); +} + + + + +QTEST_MAIN(Ut_ProxyConf) + +#include "ut_proxyconf.moc" diff --git a/src/3rdparty/libgq.pri b/src/3rdparty/libgq.pri new file mode 100644 index 0000000..a89706a --- /dev/null +++ b/src/3rdparty/libgq.pri @@ -0,0 +1,9 @@ +INCLUDEPATH += $$PWD/libgq/gconf + +HEADERS += \ + $$PWD/libgq/gconf/gconfitem.h \ + $$PWD/libgq/gconf/GConfItem + +SOURCES += \ + $$PWD/libgq/gconf/gconfitem.cpp + diff --git a/src/3rdparty/libgq/.gitignore b/src/3rdparty/libgq/.gitignore new file mode 100644 index 0000000..70a4735 --- /dev/null +++ b/src/3rdparty/libgq/.gitignore @@ -0,0 +1,37 @@ +/Makefile.in +/aclocal.m4 +/autom4te.cache/ +/config.guess +/config.sub +/configure +/depcomp +/gconf/Makefile.in +/install-sh +/ltmain.sh +/missing +/Makefile +/config.log +/config.status +/gconf/.deps/ +/gconf/Makefile +/libtool +/confdefs.h +/gconf/.libs/ +/gconf/libgq-gconf.la +/gconf/gq-gconf.pc +/gconf/moc_gconfitem_h.cpp +/gconf/mocs.cpp +/gconf/test-gconf +/gconf/gconfitem_moc.cpp +/gconf/test-gconf_moc.cpp +/libgq-*.tar.gz +/debian/libgq-gconf-dev/ +/debian/libgq-gconf0/ +/debian/tmp/ +/debian/libgq-gconf0-dbg/ +/debian/libgq-gconf-doc/ +/debian/*.debhelper.log +/debian/*.substvars +/debian/files +/debian/*.debhelper +/gconf/html/ diff --git a/src/3rdparty/libgq/Makefile.am b/src/3rdparty/libgq/Makefile.am new file mode 100644 index 0000000..42b3ece --- /dev/null +++ b/src/3rdparty/libgq/Makefile.am @@ -0,0 +1,4 @@ +SUBDIRS = gconf + +dist-hook: + rm -rf `find $(distdir) -name '*_moc.cpp'` diff --git a/src/3rdparty/libgq/README b/src/3rdparty/libgq/README new file mode 100644 index 0000000..c37abba --- /dev/null +++ b/src/3rdparty/libgq/README @@ -0,0 +1,6 @@ +This is libgq, a set of small libraries with Q wrappers for G things. + +* GConf + +The libgq-gconf library contains the GConfItem class for accessing +GConf. diff --git a/src/3rdparty/libgq/autogen.sh b/src/3rdparty/libgq/autogen.sh new file mode 100755 index 0000000..0a4a034 --- /dev/null +++ b/src/3rdparty/libgq/autogen.sh @@ -0,0 +1,2 @@ +#! /bin/sh +autoreconf --install --force -v diff --git a/src/3rdparty/libgq/configure.ac b/src/3rdparty/libgq/configure.ac new file mode 100644 index 0000000..f4fc2be --- /dev/null +++ b/src/3rdparty/libgq/configure.ac @@ -0,0 +1,23 @@ +AC_INIT([libgq],[0.2],[marius.vollmer@nokia.com],[libgq]) +AC_CONFIG_SRCDIR([Makefile.am]) +AM_INIT_AUTOMAKE([-Wall -Werror tar-ustar foreign]) + +AC_PROG_CXX +AC_PROG_LIBTOOL + +PKG_CHECK_MODULES([QT], [QtCore]) +PKG_CHECK_MODULES([QTEST], [QtTest]) +PKG_CHECK_MODULES([GLIB], [glib-2.0]) +PKG_CHECK_MODULES([GCONF], [gconf-2.0]) + +MOC=`pkg-config QtCore --variable=moc_location` +RCC=`pkg-config QtCore --variable=exec_prefix`/bin/rcc + +AC_SUBST([MOC]) +AC_SUBST([RCC]) + +AC_CONFIG_FILES([Makefile + gconf/Makefile + gconf/gq-gconf.pc]) + +AC_OUTPUT diff --git a/src/3rdparty/libgq/debian/README.scratchbox b/src/3rdparty/libgq/debian/README.scratchbox new file mode 100644 index 0000000..23ba793 --- /dev/null +++ b/src/3rdparty/libgq/debian/README.scratchbox @@ -0,0 +1,28 @@ +This packages behaves a bit wierdly inside Scratchbox 1, by design. + +When building it with dpkg-buildpackage or equivalent, it will disable +all devkits and adjust PATH. This means that almost all build +dependencies will come from your installed packages, and not from +Scratchbox or the configured devkits. + +Since some of our packages do not work with Scratchboxes fakeroot +(because the latter is too old), you should use the targets fakeroot +instead. + +You can disable this behavior by setting SBOX_DONT_SANITIZE in the +environment. + +When this package is build in a certain buildbot, it will go further +and permantly change the Scratchbox target. This should not happen to +anyone but the buildbot, but there is a chance it will happen to you +by accident. + +The buildbot is recognized via the $USER environment variable. If it +matches "bifh[0-9]", the permanent changes will be done. + +The permanent changes mostly consist of running apt-get dist-upgrade +and making sure that the targets fakeroot is used. + +This weirdness is brought to you by: + + http://maemo.gitorious.org/maemo-af/maemoify-tools diff --git a/src/3rdparty/libgq/debian/changelog b/src/3rdparty/libgq/debian/changelog new file mode 100644 index 0000000..f624254 --- /dev/null +++ b/src/3rdparty/libgq/debian/changelog @@ -0,0 +1,31 @@ +libgq (0.4+0m6) unstable; urgency=low + + * This entry has been added by BIFH queue processor + version has been changed to 0.4+0m6 + + -- Marius Vollmer <marius.vollmer@nokia.com> Fri, 04 Jun 2010 18:28:43 +0300 + +libgq (0.4) unstable; urgency=low + + * Never release the GConf client, to avoid having to recreate it + immediately. Might fix NB#164690. + + -- Marius Vollmer <marius.vollmer@nokia.com> Fri, 04 Jun 2010 18:10:50 +0300 + +libgq (0.3) unstable; urgency=low + + * Added autotools to Build-Depends. + + -- Marius Vollmer <marius.vollmer@nokia.com> Tue, 23 Feb 2010 12:04:45 +0200 + +libgq (0.2) unstable; urgency=low + + * Build fixes. + + -- Marius Vollmer <marius.vollmer@nokia.com> Wed, 16 Dec 2009 15:56:05 +0200 + +libgq (0.1) unstable; urgency=low + + * Initial release. + + -- Marius Vollmer <marius.vollmer@nokia.com> Wed, 16 Dec 2009 15:54:46 +0200 diff --git a/src/3rdparty/libgq/debian/compat b/src/3rdparty/libgq/debian/compat new file mode 100644 index 0000000..7f8f011 --- /dev/null +++ b/src/3rdparty/libgq/debian/compat @@ -0,0 +1 @@ +7 diff --git a/src/3rdparty/libgq/debian/control b/src/3rdparty/libgq/debian/control new file mode 100644 index 0000000..3feaa46 --- /dev/null +++ b/src/3rdparty/libgq/debian/control @@ -0,0 +1,43 @@ +Source: libgq +Section: libs +Priority: extra +Maintainer: Marius Vollmer <marius.vollmer@nokia.com> +Origin: maemo +Build-Depends: debhelper (>= 7), libqt4-dev, doxygen, libgconf2-dev, libglib2.0-dev, autoconf, automake, libtool +Vcs-Browser: http://gitorious.org/maemo-af/libgq +Vcs-Git: git@gitorious.org:maemo-af/libgq.git + +Package: libgq-gconf0 +Architecture: any +Depends: ${shlibs:Depends} +Description: a Qt wrapper for GConf + This library contains the GConfItem class, for easy + access to GConf from Qt programs. + . + This package contains the shared run-time library. + +Package: libgq-gconf0-dbg +Architecture: any +Depends: libgq-gconf0 (= ${source:Version}) +Description: a Qt wrapper for GConf + This library contains the GConfItem class, for easy + access to GConf from Qt programs. + . + This package contains the debugging symbols. + +Package: libgq-gconf-dev +Architecture: any +Depends: libgq-gconf0 (= ${source:Version}), libqt4-dev, libgconf2-dev +Description: a Qt wrapper for GConf + This library contains the GConfItem class, for easy + access to GConf from Qt programs. + . + This package contains the development files. + +Package: libgq-gconf-doc +Architecture: all +Description: a Qt wrapper for GConf + This library contains the GConfItem class, for easy + access to GConf from Qt programs. + . + This package contains the documentation. diff --git a/src/3rdparty/libgq/debian/copyright b/src/3rdparty/libgq/debian/copyright new file mode 100644 index 0000000..45b04e6 --- /dev/null +++ b/src/3rdparty/libgq/debian/copyright @@ -0,0 +1,8 @@ +Copyright (c) 2009 Nokia Corporation. + +This program, is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License version +2.1 as published by the Free Software Foundation. + +The full text of the LGPL 2.1 can be found in +/usr/share/common-licenses. diff --git a/src/3rdparty/libgq/debian/fixup-scratchbox b/src/3rdparty/libgq/debian/fixup-scratchbox new file mode 100755 index 0000000..b39ad5f --- /dev/null +++ b/src/3rdparty/libgq/debian/fixup-scratchbox @@ -0,0 +1,79 @@ +#! /bin/sh + +# XXX - this needs to run under fakeroot... + +exec 3>&1 1>&2 + +real_dpkg_checkbuilddeps () { + SBOX_REDIRECT_IGNORE=/usr/bin/perl /usr/bin/perl /usr/bin/dpkg-checkbuilddeps "$@" +} + +finish () { + if ! real_dpkg_checkbuilddeps; then + echo "This package does not use any devkits." + echo "Please install all build dependencies as real packages." + echo >&3 FAIL + fi + exit 0 +} + +# The stamp file can not be in the source tree because then it would +# end up in the source package, which is not what we want. We put it +# into /var/tmp so that it gets deleted when a new rootstrap is +# extracted. + +STAMP=/var/tmp/SANITIZED.$(head debian/changelog | md5sum | cut -d' ' -f1) + +if [ -e $STAMP ]; then + exit 0; +fi + +# Only do permanent changes if this is BIFH + +echo "$USER" | grep -q 'bifh[0-9]' || finish + +# prevent bash from killing the system +rm -f /var/lib/bash/provide-sh + +# clean ~/.texmf-var to avoid trouble with stale things hiding there. +rm -rf ~/.texmf-var/ + +pfx="dpkg-checkbuilddeps: Unmet build dependencies:" +deps=`real_dpkg_checkbuilddeps 2>&1 | grep "^$pfx" | \ + sed -e "s/$pfx//" -e s'/([^)]*)//g' -e 's/|//'` +deps="$deps build-essential automake autoconf libtool ed gawk diff dpkg-dev" +for d in $deps; do + echo apt-get "$@" install $d + apt-get -o DPkg::Options::=--force-confold -q --force-yes --yes install $d +done +apt-get -o DPkg::Options::=--force-confold -q --force-yes --yes dist-upgrade + +# Make sure we get a fresh fakeroot installation + +# We can't seem to control the value of LD_PRELOAD well enough, so we +# just copy the good version of libfakeroot over the bad one that +# Scratchbox uses. This will result in a good version of libfakeroot +# talking to a bad version of faked, but that seems to work well +# enough. The protocol between the two is really simple and unlikely +# to change even when new syscalls are wrapped. And this is a +# desperate hack anyway, so it's OK if there is blood all over the +# floor from time to time. +# +# After we have overwritten libfakeroot, it no longer works with any +# host binaries, such as the ones in /scratchbox/compilers/bin or +# /scratchbox/tools/bin. Thus, we must avoid running those when +# fakerooted. +# +# We use "cp -l" here to avoid overwriting a library that is in use. +# +if [ "$(fakeroot -v)" = "fakeroot version 1.4.2" ]; then + apt-get -q --force-yes --yes --reinstall install fakeroot + cp -fl /usr/lib/libfakeroot/libfakeroot-sysv.so /usr/lib/libfakeroot-sysv/libfakeroot.so.0 + cp -fl /usr/lib/libfakeroot/libfakeroot-tcp.so /usr/lib/libfakeroot-tcp/libfakeroot.so.0 +else + echo "We have $(fakeroot -v), hurray!" +fi + +touch $STAMP + +finish diff --git a/src/3rdparty/libgq/debian/libgq-gconf-dev.install b/src/3rdparty/libgq/debian/libgq-gconf-dev.install new file mode 100644 index 0000000..b3d949f --- /dev/null +++ b/src/3rdparty/libgq/debian/libgq-gconf-dev.install @@ -0,0 +1,5 @@ +usr/include/gq/GConfItem +usr/include/gq/gconfitem.h +usr/lib/libgq-gconf.so +usr/lib/libgq-gconf.a +usr/lib/pkgconfig/gq-gconf.pc diff --git a/src/3rdparty/libgq/debian/libgq-gconf-doc.install b/src/3rdparty/libgq/debian/libgq-gconf-doc.install new file mode 100644 index 0000000..9007055 --- /dev/null +++ b/src/3rdparty/libgq/debian/libgq-gconf-doc.install @@ -0,0 +1 @@ +gconf/html usr/share/doc/libgq-gconf-doc/ diff --git a/src/3rdparty/libgq/debian/libgq-gconf0.install b/src/3rdparty/libgq/debian/libgq-gconf0.install new file mode 100644 index 0000000..4ca6283 --- /dev/null +++ b/src/3rdparty/libgq/debian/libgq-gconf0.install @@ -0,0 +1 @@ +usr/lib/libgq-gconf.so.* diff --git a/src/3rdparty/libgq/debian/maemo-sanitize b/src/3rdparty/libgq/debian/maemo-sanitize new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/3rdparty/libgq/debian/maemo-sanitize diff --git a/src/3rdparty/libgq/debian/rules b/src/3rdparty/libgq/debian/rules new file mode 100755 index 0000000..1f293b3 --- /dev/null +++ b/src/3rdparty/libgq/debian/rules @@ -0,0 +1,32 @@ +#! /usr/bin/make -f + +# Sanitize build environment when running inside Scratchbox 1 +ifneq (,$(wildcard /targets)) + ifeq (,$(SBOX_DONT_SANITIZE)) + export PATH:=/bin:/usr/bin + export MAKE:=make + ifeq (,$(FAKEROOTKEY)) + export SBOX_REDIRECT_TO_DIRS:=/scratchbox/compilers/bin + else + export SBOX_REDIRECT_TO_DIRS:= + endif + ifneq (,$(shell debian/fixup-scratchbox)) + $(error Error) + endif + endif +endif + +override_dh_auto_configure: + ./autogen.sh + dh_auto_configure + +override_dh_auto_build: + dh_auto_build + cd gconf && doxygen + +override_dh_strip: + dh_strip -plibgq-gconf0 --dbg-package=libgq-gconf0-dbg + dh_strip + +%: + dh $@ diff --git a/src/3rdparty/libgq/gconf/Doxyfile b/src/3rdparty/libgq/gconf/Doxyfile new file mode 100644 index 0000000..7f5c11a --- /dev/null +++ b/src/3rdparty/libgq/gconf/Doxyfile @@ -0,0 +1,1514 @@ +# Doxyfile 1.6.1 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project +# +# All text after a hash (#) is considered a comment and will be ignored +# The format is: +# TAG = value [value, ...] +# For lists items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (" ") + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# http://www.gnu.org/software/libiconv for the list of possible encodings. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded +# by quotes) that should identify the project. + +PROJECT_NAME = gq-gconf + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. +# This could be handy for archiving the generated documentation or +# if some version control system is used. + +PROJECT_NUMBER = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) +# base path where the generated documentation will be put. +# If a relative path is entered, it will be relative to the location +# where doxygen was started. If left blank the current directory will be used. + +OUTPUT_DIRECTORY = + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create +# 4096 sub-directories (in 2 levels) under the output directory of each output +# format and will distribute the generated files over these directories. +# Enabling this option can be useful when feeding doxygen a huge amount of +# source files, where putting all generated files in the same directory would +# otherwise cause performance problems for the file system. + +CREATE_SUBDIRS = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# The default language is English, other supported languages are: +# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, +# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, +# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English +# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, +# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, +# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will +# include brief member descriptions after the members that are listed in +# the file and class documentation (similar to JavaDoc). +# Set to NO to disable this. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend +# the brief description of a member or function before the detailed description. +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator +# that is used to form the text in various listings. Each string +# in this list, if found as the leading text of the brief description, will be +# stripped from the text and the result after processing the whole list, is +# used as the annotated text. Otherwise, the brief description is used as-is. +# If left blank, the following values are used ("$name" is automatically +# replaced with the name of the entity): "The $name class" "The $name widget" +# "The $name file" "is" "provides" "specifies" "contains" +# "represents" "a" "an" "the" + +ABBREVIATE_BRIEF = + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# Doxygen will generate a detailed section even if there is only a brief +# description. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full +# path before files name in the file list and in the header files. If set +# to NO the shortest path that makes the file name unique will be used. + +FULL_PATH_NAMES = YES + +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag +# can be used to strip a user-defined part of the path. Stripping is +# only done if one of the specified strings matches the left-hand part of +# the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the +# path to strip. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of +# the path mentioned in the documentation of a class, which tells +# the reader which header file to include in order to use a class. +# If left blank only the name of the header file containing the class +# definition is used. Otherwise one should specify the include paths that +# are normally passed to the compiler using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter +# (but less readable) file names. This can be useful is your file systems +# doesn't support long names like on DOS, Mac, or CD-ROM. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen +# will interpret the first line (until the first dot) of a JavaDoc-style +# comment as the brief description. If set to NO, the JavaDoc +# comments will behave just like regular Qt-style comments +# (thus requiring an explicit @brief command for a brief description.) + +JAVADOC_AUTOBRIEF = NO + +# If the QT_AUTOBRIEF tag is set to YES then Doxygen will +# interpret the first line (until the first dot) of a Qt-style +# comment as the brief description. If set to NO, the comments +# will behave just like regular Qt-style comments (thus requiring +# an explicit \brief command for a brief description.) + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen +# treat a multi-line C++ special comment block (i.e. a block of //! or /// +# comments) as a brief description. This used to be the default behaviour. +# The new default is to treat a multi-line C++ comment block as a detailed +# description. Set this tag to YES if you prefer the old behaviour instead. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented +# member inherits the documentation from any documented member that it +# re-implements. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce +# a new page for each member. If set to NO, the documentation of a member will +# be part of the file/class/namespace that contains it. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. +# Doxygen uses this value to replace tabs by spaces in code fragments. + +TAB_SIZE = 8 + +# This tag can be used to specify a number of aliases that acts +# as commands in the documentation. An alias has the form "name=value". +# For example adding "sideeffect=\par Side Effects:\n" will allow you to +# put the command \sideeffect (or @sideeffect) in the documentation, which +# will result in a user-defined paragraph with heading "Side Effects:". +# You can put \n's in the value part of an alias to insert newlines. + +ALIASES = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C +# sources only. Doxygen will then generate output that is more tailored for C. +# For instance, some of the names that are used will be different. The list +# of all members will be omitted, etc. + +OPTIMIZE_OUTPUT_FOR_C = NO + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java +# sources only. Doxygen will then generate output that is more tailored for +# Java. For instance, namespaces will be presented as packages, qualified +# scopes will look different, etc. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources only. Doxygen will then generate output that is more tailored for +# Fortran. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for +# VHDL. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it parses. +# With this tag you can assign which parser to use for a given extension. +# Doxygen has a built-in mapping, but you can override or extend it using this tag. +# The format is ext=language, where ext is a file extension, and language is one of +# the parsers supported by doxygen: IDL, Java, Javascript, C#, C, C++, D, PHP, +# Objective-C, Python, Fortran, VHDL, C, C++. For instance to make doxygen treat +# .inc files as Fortran files (default is PHP), and .f files as C (default is Fortran), +# use: inc=Fortran f=C. Note that for custom extensions you also need to set FILE_PATTERNS otherwise the files are not read by doxygen. + +EXTENSION_MAPPING = + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should +# set this tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. +# func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. +# Doxygen will parse them like normal C++ but will assume all classes use public +# instead of private inheritance when no explicit protection keyword is present. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate getter +# and setter methods for a property. Setting this option to YES (the default) +# will make doxygen to replace the get and set methods by a property in the +# documentation. This will only work if the methods are indeed getting or +# setting a simple type. If this is not the case, or you want to show the +# methods anyway, you should set this option to NO. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. + +DISTRIBUTE_GROUP_DOC = NO + +# Set the SUBGROUPING tag to YES (the default) to allow class member groups of +# the same type (for instance a group of public functions) to be put as a +# subgroup of that type (e.g. under the Public Functions section). Set it to +# NO to prevent subgrouping. Alternatively, this can be done per class using +# the \nosubgrouping command. + +SUBGROUPING = YES + +# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum +# is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically +# be useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. + +TYPEDEF_HIDES_STRUCT = NO + +# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to +# determine which symbols to keep in memory and which to flush to disk. +# When the cache is full, less often used symbols will be written to disk. +# For small to medium size projects (<1000 input files) the default value is +# probably good enough. For larger projects a too small cache size can cause +# doxygen to be busy swapping symbols to and from disk most of the time +# causing a significant performance penality. +# If the system has enough physical memory increasing the cache will improve the +# performance by keeping more symbols in memory. Note that the value works on +# a logarithmic scale so increasing the size by one will rougly double the +# memory usage. The cache size is given by this formula: +# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, +# corresponding to a cache size of 2^16 = 65536 symbols + +SYMBOL_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. +# Private class members and static file members will be hidden unless +# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES + +EXTRACT_ALL = NO + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class +# will be included in the documentation. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_STATIC tag is set to YES all static members of a file +# will be included in the documentation. + +EXTRACT_STATIC = NO + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) +# defined locally in source files will be included in the documentation. +# If set to NO only classes defined in header files are included. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. When set to YES local +# methods, which are defined in the implementation section but not in +# the interface are included in the documentation. +# If set to NO (the default) only methods in the interface are included. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base +# name of the file that contains the anonymous namespace. By default +# anonymous namespace are hidden. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all +# undocumented members of documented classes, files or namespaces. +# If set to NO (the default) these members will be included in the +# various overviews, but no documentation section is generated. +# This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. +# If set to NO (the default) these classes will be included in the various +# overviews. This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all +# friend (class|struct|union) declarations. +# If set to NO (the default) these declarations will be included in the +# documentation. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any +# documentation blocks found inside the body of a function. +# If set to NO (the default) these blocks will be appended to the +# function's detailed documentation block. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation +# that is typed after a \internal command is included. If the tag is set +# to NO (the default) then the documentation will be excluded. +# Set it to YES to include the internal documentation. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate +# file names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. + +CASE_SENSE_NAMES = YES + +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen +# will show members with their full class and namespace scopes in the +# documentation. If set to YES the scope will be hidden. + +HIDE_SCOPE_NAMES = NO + +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen +# will put a list of the files that are included by a file in the documentation +# of that file. + +SHOW_INCLUDE_FILES = YES + +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] +# is inserted in the documentation for inline members. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen +# will sort the (detailed) documentation of file and class members +# alphabetically by member name. If set to NO the members will appear in +# declaration order. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the +# brief documentation of file, namespace and class members alphabetically +# by member name. If set to NO (the default) the members will appear in +# declaration order. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the (brief and detailed) documentation of class members so that constructors and destructors are listed first. If set to NO (the default) the constructors will appear in the respective orders defined by SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the +# hierarchy of group names into alphabetical order. If set to NO (the default) +# the group names will appear in their defined order. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be +# sorted by fully-qualified names, including namespaces. If set to +# NO (the default), the class list will be sorted only by class name, +# not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the +# alphabetical list. + +SORT_BY_SCOPE_NAME = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or +# disable (NO) the todo list. This list is created by putting \todo +# commands in the documentation. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or +# disable (NO) the test list. This list is created by putting \test +# commands in the documentation. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or +# disable (NO) the bug list. This list is created by putting \bug +# commands in the documentation. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or +# disable (NO) the deprecated list. This list is created by putting +# \deprecated commands in the documentation. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional +# documentation sections, marked by \if sectionname ... \endif. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines +# the initial value of a variable or define consists of for it to appear in +# the documentation. If the initializer consists of more lines than specified +# here it will be hidden. Use a value of 0 to hide initializers completely. +# The appearance of the initializer of individual variables and defines in the +# documentation can be controlled using \showinitializer or \hideinitializer +# command in the documentation regardless of this setting. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated +# at the bottom of the documentation of classes and structs. If set to YES the +# list will mention the files that were used to generate the documentation. + +SHOW_USED_FILES = YES + +# If the sources in your project are distributed over multiple directories +# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy +# in the documentation. The default is NO. + +SHOW_DIRECTORIES = NO + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. +# This will remove the Files entry from the Quick Index and from the +# Folder Tree View (if specified). The default is YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the +# Namespaces page. +# This will remove the Namespaces entry from the Quick Index +# and from the Folder Tree View (if specified). The default is YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command <command> <input-file>, where <command> is the value of +# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file +# provided by doxygen. Whatever the program writes to standard output +# is used as the file version. See the manual for examples. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by +# doxygen. The layout file controls the global structure of the generated output files +# in an output format independent way. The create the layout file that represents +# doxygen's defaults, run doxygen with the -l option. You can optionally specify a +# file name after the option, if omitted DoxygenLayout.xml will be used as the name +# of the layout file. + +LAYOUT_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated +# by doxygen. Possible values are YES and NO. If left blank NO is used. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated by doxygen. Possible values are YES and NO. If left blank +# NO is used. + +WARNINGS = YES + +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will +# automatically be disabled. + +WARN_IF_UNDOCUMENTED = YES + +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some +# parameters in a documented function, or documenting parameters that +# don't exist or using markup commands wrongly. + +WARN_IF_DOC_ERROR = YES + +# This WARN_NO_PARAMDOC option can be abled to get warnings for +# functions that are documented, but have no documentation for their parameters +# or return value. If set to NO (the default) doxygen will only warn about +# wrong or incomplete parameter documentation, but not about the absence of +# documentation. + +WARN_NO_PARAMDOC = NO + +# The WARN_FORMAT tag determines the format of the warning messages that +# doxygen can produce. The string should contain the $file, $line, and $text +# tags, which will be replaced by the file and line number from which the +# warning originated and the warning text. Optionally the format may contain +# $version, which will be replaced by the version of the file (if it could +# be obtained via FILE_VERSION_FILTER) + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning +# and error messages should be written. If left blank the output is written +# to stderr. + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag can be used to specify the files and/or directories that contain +# documented source files. You may enter file names like "myfile.cpp" or +# directories like "/usr/src/myproject". Separate the files or directories +# with spaces. + +INPUT = gconfitem.h gconfitem.cpp + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is +# also the default input encoding. Doxygen uses libiconv (or the iconv built +# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for +# the list of possible encodings. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank the following patterns are tested: +# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx +# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 + +FILE_PATTERNS = + +# The RECURSIVE tag can be used to turn specify whether or not subdirectories +# should be searched for input files as well. Possible values are YES and NO. +# If left blank NO is used. + +RECURSIVE = NO + +# The EXCLUDE tag can be used to specify files and/or directories that should +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used select whether or not files or +# directories that are symbolic links (a Unix filesystem feature) are excluded +# from the input. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. Note that the wildcards are matched +# against the file with absolute path, so to exclude all test directories +# for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or +# directories that contain example code fragments that are included (see +# the \include command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank all files are included. + +EXAMPLE_PATTERNS = + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude +# commands irrespective of the value of the RECURSIVE tag. +# Possible values are YES and NO. If left blank NO is used. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or +# directories that contain image that are included in the documentation (see +# the \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command <filter> <input-file>, where <filter> +# is the value of the INPUT_FILTER tag, and <input-file> is the name of an +# input file. Doxygen will then use the output that the filter program writes +# to standard output. +# If FILTER_PATTERNS is specified, this tag will be +# ignored. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. +# Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. +# The filters are a list of the form: +# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further +# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER +# is applied to all files. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will be used to filter the input files when producing source +# files to browse (i.e. when SOURCE_BROWSER is set to YES). + +FILTER_SOURCE_FILES = NO + +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will +# be generated. Documented entities will be cross-referenced with these sources. +# Note: To get rid of all source code in the generated output, make sure also +# VERBATIM_HEADERS is set to NO. + +SOURCE_BROWSER = NO + +# Setting the INLINE_SOURCES tag to YES will include the body +# of functions and classes directly in the documentation. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct +# doxygen to hide any special comment blocks from generated source code +# fragments. Normal C and C++ comments will always remain visible. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES +# then for each documented function all documented +# functions referencing it will be listed. + +REFERENCED_BY_RELATION = NO + +# If the REFERENCES_RELATION tag is set to YES +# then for each documented function all documented entities +# called/used by that function will be listed. + +REFERENCES_RELATION = NO + +# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) +# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from +# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will +# link to the source code. +# Otherwise they will link to the documentation. + +REFERENCES_LINK_SOURCE = YES + +# If the USE_HTAGS tag is set to YES then the references to source code +# will point to the HTML generated by the htags(1) tool instead of doxygen +# built-in source browser. The htags tool is part of GNU's global source +# tagging system (see http://www.gnu.org/software/global/global.html). You +# will need version 4.8.6 or higher. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen +# will generate a verbatim copy of the header file for each class for +# which an include is specified. Set to NO to disable this. + +VERBATIM_HEADERS = YES + +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index +# of all compounds will be generated. Enable this if the project +# contains a lot of classes, structs, unions or interfaces. + +ALPHABETICAL_INDEX = NO + +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns +# in which this list will be split (can be a number in the range [1..20]) + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all +# classes will be put under the same header in the alphabetical index. +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that +# should be ignored while generating the index headers. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will +# generate HTML output. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `html' will be used as the default path. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank +# doxygen will generate files with .html extension. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a personal HTML header for +# each generated HTML page. If it is left blank doxygen will generate a +# standard header. + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a personal HTML footer for +# each generated HTML page. If it is left blank doxygen will generate a +# standard footer. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading +# style sheet that is used by each HTML page. It can be used to +# fine-tune the look of the HTML output. If the tag is left blank doxygen +# will generate a default style sheet. Note that doxygen will try to copy +# the style sheet file to the HTML output directory, so don't put your own +# stylesheet in the HTML output directory as well, or it will be erased! + +HTML_STYLESHEET = + +# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, +# files or namespaces will be aligned in HTML using tables. If set to +# NO a bullet list will be used. + +HTML_ALIGN_MEMBERS = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. For this to work a browser that supports +# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox +# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). + +HTML_DYNAMIC_SECTIONS = NO + +# If the GENERATE_DOCSET tag is set to YES, additional index files +# will be generated that can be used as input for Apple's Xcode 3 +# integrated development environment, introduced with OSX 10.5 (Leopard). +# To create a documentation set, doxygen will generate a Makefile in the +# HTML output directory. Running make will produce the docset in that +# directory and running "make install" will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find +# it at startup. +# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information. + +GENERATE_DOCSET = NO + +# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the +# feed. A documentation feed provides an umbrella under which multiple +# documentation sets from a single provider (such as a company or product suite) +# can be grouped. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that +# should uniquely identify the documentation set bundle. This should be a +# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen +# will append .docset to the name. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# If the GENERATE_HTMLHELP tag is set to YES, additional index files +# will be generated that can be used as input for tools like the +# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) +# of the generated HTML documentation. + +GENERATE_HTMLHELP = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can +# be used to specify the file name of the resulting .chm file. You +# can add a path in front of the file if the result should not be +# written to the html output directory. + +CHM_FILE = + +# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can +# be used to specify the location (absolute path including file name) of +# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run +# the HTML help compiler on the generated index.hhp. + +HHC_LOCATION = + +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag +# controls if a separate .chi index file is generated (YES) or that +# it should be included in the master .chm file (NO). + +GENERATE_CHI = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING +# is used to encode HtmlHelp index (hhk), content (hhc) and project file +# content. + +CHM_INDEX_ENCODING = + +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag +# controls whether a binary table of contents is generated (YES) or a +# normal table of contents (NO) in the .chm file. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members +# to the contents of the HTML help documentation and to the tree view. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER +# are set, an additional index file will be generated that can be used as input for +# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated +# HTML documentation. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can +# be used to specify the file name of the resulting .qch file. +# The path specified is relative to the HTML output folder. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#namespace + +QHP_NAMESPACE = + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#virtual-folders + +QHP_VIRTUAL_FOLDER = doc + +# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to add. +# For more information please see +# http://doc.trolltech.com/qthelpproject.html#custom-filters + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the custom filter to add.For more information please see +# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters">Qt Help Project / Custom Filters</a>. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this project's +# filter section matches. +# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes">Qt Help Project / Filter Attributes</a>. + +QHP_SECT_FILTER_ATTRS = + +# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can +# be used to specify the location of Qt's qhelpgenerator. +# If non-empty doxygen will try to run qhelpgenerator on the generated +# .qhp file. + +QHG_LOCATION = + +# The DISABLE_INDEX tag can be used to turn on/off the condensed index at +# top of each HTML page. The value NO (the default) enables the index and +# the value YES disables it. + +DISABLE_INDEX = NO + +# This tag can be used to set the number of enum values (range [1..20]) +# that doxygen will group on one line in the generated HTML documentation. + +ENUM_VALUES_PER_LINE = 4 + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. +# If the tag value is set to YES, a side panel will be generated +# containing a tree-like index structure (just like the one that +# is generated for HTML Help). For this to work a browser that supports +# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). +# Windows users are probably better off using the HTML help feature. + +GENERATE_TREEVIEW = NO + +# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, +# and Class Hierarchy pages using a tree view instead of an ordered list. + +USE_INLINE_TREES = NO + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be +# used to set the initial width (in pixels) of the frame in which the tree +# is shown. + +TREEVIEW_WIDTH = 250 + +# Use this tag to change the font size of Latex formulas included +# as images in the HTML documentation. The default is 10. Note that +# when you change the font size after a successful doxygen run you need +# to manually remove any form_*.png images from the HTML output directory +# to force them to be regenerated. + +FORMULA_FONTSIZE = 10 + +# When the SEARCHENGINE tag is enable doxygen will generate a search box for the HTML output. The underlying search engine uses javascript +# and DHTML and should work on any modern browser. Note that when using HTML help (GENERATE_HTMLHELP) or Qt help (GENERATE_QHP) +# there is already a search function so this one should typically +# be disabled. + +SEARCHENGINE = YES + +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will +# generate Latex output. + +GENERATE_LATEX = NO + +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `latex' will be used as the default path. + +LATEX_OUTPUT = latex + +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# invoked. If left blank `latex' will be used as the default command name. + +LATEX_CMD_NAME = latex + +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to +# generate index for LaTeX. If left blank `makeindex' will be used as the +# default command name. + +MAKEINDEX_CMD_NAME = makeindex + +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact +# LaTeX documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_LATEX = NO + +# The PAPER_TYPE tag can be used to set the paper type that is used +# by the printer. Possible values are: a4, a4wide, letter, legal and +# executive. If left blank a4wide will be used. + +PAPER_TYPE = a4wide + +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX +# packages that should be included in the LaTeX output. + +EXTRA_PACKAGES = + +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for +# the generated latex document. The header should contain everything until +# the first chapter. If it is left blank doxygen will generate a +# standard header. Notice: only use this tag if you know what you are doing! + +LATEX_HEADER = + +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated +# is prepared for conversion to pdf (using ps2pdf). The pdf file will +# contain links (just like the HTML output) instead of page references +# This makes the output suitable for online browsing using a pdf viewer. + +PDF_HYPERLINKS = YES + +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of +# plain latex in the generated Makefile. Set this option to YES to get a +# higher quality PDF documentation. + +USE_PDFLATEX = YES + +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. +# command to the generated LaTeX files. This will instruct LaTeX to keep +# running if errors occur, instead of asking the user for help. +# This option is also used when generating formulas in HTML. + +LATEX_BATCHMODE = NO + +# If LATEX_HIDE_INDICES is set to YES then doxygen will not +# include the index chapters (such as File Index, Compound Index, etc.) +# in the output. + +LATEX_HIDE_INDICES = NO + +# If LATEX_SOURCE_CODE is set to YES then doxygen will include source code with syntax highlighting in the LaTeX output. Note that which sources are shown also depends on other settings such as SOURCE_BROWSER. + +LATEX_SOURCE_CODE = NO + +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- + +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output +# The RTF output is optimized for Word 97 and may not look very pretty with +# other RTF readers or editors. + +GENERATE_RTF = NO + +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `rtf' will be used as the default path. + +RTF_OUTPUT = rtf + +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact +# RTF documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_RTF = NO + +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated +# will contain hyperlink fields. The RTF file will +# contain links (just like the HTML output) instead of page references. +# This makes the output suitable for online browsing using WORD or other +# programs which support those fields. +# Note: wordpad (write) and others do not support links. + +RTF_HYPERLINKS = NO + +# Load stylesheet definitions from file. Syntax is similar to doxygen's +# config file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. + +RTF_STYLESHEET_FILE = + +# Set optional variables used in the generation of an rtf document. +# Syntax is similar to doxygen's config file. + +RTF_EXTENSIONS_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- + +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will +# generate man pages + +GENERATE_MAN = NO + +# The MAN_OUTPUT tag is used to specify where the man pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `man' will be used as the default path. + +MAN_OUTPUT = man + +# The MAN_EXTENSION tag determines the extension that is added to +# the generated man pages (default is the subroutine's section .3) + +MAN_EXTENSION = .3 + +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, +# then it will generate one additional man file for each entity +# documented in the real man page(s). These additional files +# only source the real man page, but without them the man command +# would be unable to find the correct page. The default is NO. + +MAN_LINKS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- + +# If the GENERATE_XML tag is set to YES Doxygen will +# generate an XML file that captures the structure of +# the code including all documentation. + +GENERATE_XML = NO + +# The XML_OUTPUT tag is used to specify where the XML pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `xml' will be used as the default path. + +XML_OUTPUT = xml + +# The XML_SCHEMA tag can be used to specify an XML schema, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_SCHEMA = + +# The XML_DTD tag can be used to specify an XML DTD, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_DTD = + +# If the XML_PROGRAMLISTING tag is set to YES Doxygen will +# dump the program listings (including syntax highlighting +# and cross-referencing information) to the XML output. Note that +# enabling this will significantly increase the size of the XML output. + +XML_PROGRAMLISTING = YES + +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will +# generate an AutoGen Definitions (see autogen.sf.net) file +# that captures the structure of the code including all +# documentation. Note that this feature is still experimental +# and incomplete at the moment. + +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- + +# If the GENERATE_PERLMOD tag is set to YES Doxygen will +# generate a Perl module file that captures the structure of +# the code including all documentation. Note that this +# feature is still experimental and incomplete at the +# moment. + +GENERATE_PERLMOD = NO + +# If the PERLMOD_LATEX tag is set to YES Doxygen will generate +# the necessary Makefile rules, Perl scripts and LaTeX code to be able +# to generate PDF and DVI output from the Perl module output. + +PERLMOD_LATEX = NO + +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be +# nicely formatted so it can be parsed by a human reader. +# This is useful +# if you want to understand what is going on. +# On the other hand, if this +# tag is set to NO the size of the Perl module output will be much smaller +# and Perl will parse it just the same. + +PERLMOD_PRETTY = YES + +# The names of the make variables in the generated doxyrules.make file +# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. +# This is useful so different doxyrules.make files included by the same +# Makefile don't overwrite each other's variables. + +PERLMOD_MAKEVAR_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will +# evaluate all C-preprocessor directives found in the sources and include +# files. + +ENABLE_PREPROCESSING = YES + +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro +# names in the source code. If set to NO (the default) only conditional +# compilation will be performed. Macro expansion can be done in a controlled +# way by setting EXPAND_ONLY_PREDEF to YES. + +MACRO_EXPANSION = NO + +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES +# then the macro expansion is limited to the macros specified with the +# PREDEFINED and EXPAND_AS_DEFINED tags. + +EXPAND_ONLY_PREDEF = NO + +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files +# in the INCLUDE_PATH (see below) will be search if a #include is found. + +SEARCH_INCLUDES = YES + +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by +# the preprocessor. + +INCLUDE_PATH = + +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will +# be used. + +INCLUDE_FILE_PATTERNS = + +# The PREDEFINED tag can be used to specify one or more macro names that +# are defined before the preprocessor is started (similar to the -D option of +# gcc). The argument of the tag is a list of macros of the form: name +# or name=definition (no spaces). If the definition and the = are +# omitted =1 is assumed. To prevent a macro definition from being +# undefined via #undef or recursively expanded use the := operator +# instead of the = operator. + +PREDEFINED = + +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then +# this tag can be used to specify a list of macro names that should be expanded. +# The macro definition that is found in the sources will be used. +# Use the PREDEFINED tag if you want to use a different macro definition. + +EXPAND_AS_DEFINED = + +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then +# doxygen's preprocessor will remove all function-like macros that are alone +# on a line, have an all uppercase name, and do not end with a semicolon. Such +# function macros are typically used for boiler-plate code, and will confuse +# the parser if not removed. + +SKIP_FUNCTION_MACROS = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- + +# The TAGFILES option can be used to specify one or more tagfiles. +# Optionally an initial location of the external documentation +# can be added for each tagfile. The format of a tag file without +# this location is as follows: +# +# TAGFILES = file1 file2 ... +# Adding location for the tag files is done as follows: +# +# TAGFILES = file1=loc1 "file2 = loc2" ... +# where "loc1" and "loc2" can be relative or absolute paths or +# URLs. If a location is present for each tag, the installdox tool +# does not have to be run to correct the links. +# Note that each tag file must have a unique name +# (where the name does NOT include the path) +# If a tag file is not located in the directory in which doxygen +# is run, you must also specify the path to the tagfile here. + +TAGFILES = + +# When a file name is specified after GENERATE_TAGFILE, doxygen will create +# a tag file that is based on the input files it reads. + +GENERATE_TAGFILE = + +# If the ALLEXTERNALS tag is set to YES all external classes will be listed +# in the class index. If set to NO only the inherited external classes +# will be listed. + +ALLEXTERNALS = NO + +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will +# be listed. + +EXTERNAL_GROUPS = YES + +# The PERL_PATH should be the absolute path and name of the perl script +# interpreter (i.e. the result of `which perl'). + +PERL_PATH = /usr/bin/perl + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will +# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base +# or super classes. Setting the tag to NO turns the diagrams off. Note that +# this option is superseded by the HAVE_DOT option below. This is only a +# fallback. It is recommended to install and use dot, since it yields more +# powerful graphs. + +CLASS_DIAGRAMS = YES + +# You can define message sequence charts within doxygen comments using the \msc +# command. Doxygen will then run the mscgen tool (see +# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the +# documentation. The MSCGEN_PATH tag allows you to specify the directory where +# the mscgen tool resides. If left empty the tool is assumed to be found in the +# default search path. + +MSCGEN_PATH = + +# If set to YES, the inheritance and collaboration graphs will hide +# inheritance and usage relations if the target is undocumented +# or is not a class. + +HIDE_UNDOC_RELATIONS = YES + +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz, a graph visualization +# toolkit from AT&T and Lucent Bell Labs. The other options in this section +# have no effect if this option is set to NO (the default) + +HAVE_DOT = NO + +# By default doxygen will write a font called FreeSans.ttf to the output +# directory and reference it in all dot files that doxygen generates. This +# font does not include all possible unicode characters however, so when you need +# these (or just want a differently looking font) you can specify the font name +# using DOT_FONTNAME. You need need to make sure dot is able to find the font, +# which can be done by putting it in a standard location or by setting the +# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory +# containing the font. + +DOT_FONTNAME = FreeSans + +# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. +# The default size is 10pt. + +DOT_FONTSIZE = 10 + +# By default doxygen will tell dot to use the output directory to look for the +# FreeSans.ttf font (which doxygen will put there itself). If you specify a +# different font using DOT_FONTNAME you can set the path where dot +# can find it using this tag. + +DOT_FONTPATH = + +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect inheritance relations. Setting this tag to YES will force the +# the CLASS_DIAGRAMS tag to NO. + +CLASS_GRAPH = YES + +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect implementation dependencies (inheritance, containment, and +# class references variables) of the class with other documented classes. + +COLLABORATION_GRAPH = YES + +# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for groups, showing the direct groups dependencies + +GROUP_GRAPHS = YES + +# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# collaboration diagrams in a style similar to the OMG's Unified Modeling +# Language. + +UML_LOOK = NO + +# If set to YES, the inheritance and collaboration graphs will show the +# relations between templates and their instances. + +TEMPLATE_RELATIONS = NO + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT +# tags are set to YES then doxygen will generate a graph for each documented +# file showing the direct and indirect include dependencies of the file with +# other documented files. + +INCLUDE_GRAPH = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each +# documented header file showing the documented files that directly or +# indirectly include this file. + +INCLUDED_BY_GRAPH = YES + +# If the CALL_GRAPH and HAVE_DOT options are set to YES then +# doxygen will generate a call dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable call graphs +# for selected functions only using the \callgraph command. + +CALL_GRAPH = NO + +# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then +# doxygen will generate a caller dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable caller +# graphs for selected functions only using the \callergraph command. + +CALLER_GRAPH = NO + +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen +# will graphical hierarchy of all classes instead of a textual one. + +GRAPHICAL_HIERARCHY = YES + +# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES +# then doxygen will show the dependencies a directory has on other directories +# in a graphical way. The dependency relations are determined by the #include +# relations between the files in the directories. + +DIRECTORY_GRAPH = YES + +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images +# generated by dot. Possible values are png, jpg, or gif +# If left blank png will be used. + +DOT_IMAGE_FORMAT = png + +# The tag DOT_PATH can be used to specify the path where the dot tool can be +# found. If left blank, it is assumed the dot tool can be found in the path. + +DOT_PATH = + +# The DOTFILE_DIRS tag can be used to specify one or more directories that +# contain dot files that are included in the documentation (see the +# \dotfile command). + +DOTFILE_DIRS = + +# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of +# nodes that will be shown in the graph. If the number of nodes in a graph +# becomes larger than this value, doxygen will truncate the graph, which is +# visualized by representing a node as a red box. Note that doxygen if the +# number of direct children of the root node in a graph is already larger than +# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note +# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. + +DOT_GRAPH_MAX_NODES = 50 + +# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the +# graphs generated by dot. A depth value of 3 means that only nodes reachable +# from the root by following a path via at most 3 edges will be shown. Nodes +# that lay further from the root node will be omitted. Note that setting this +# option to 1 or 2 may greatly reduce the computation time needed for large +# code bases. Also note that the size of a graph can be further restricted by +# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. + +MAX_DOT_GRAPH_DEPTH = 0 + +# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent +# background. This is disabled by default, because dot on Windows does not +# seem to support this out of the box. Warning: Depending on the platform used, +# enabling this option may lead to badly anti-aliased labels on the edges of +# a graph (i.e. they become hard to read). + +DOT_TRANSPARENT = NO + +# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output +# files in one run (i.e. multiple -o and -T options on the command line). This +# makes dot run faster, but since only newer versions of dot (>1.8.10) +# support this, this feature is disabled by default. + +DOT_MULTI_TARGETS = YES + +# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will +# generate a legend page explaining the meaning of the various boxes and +# arrows in the dot generated graphs. + +GENERATE_LEGEND = YES + +# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will +# remove the intermediate dot files that are used to generate +# the various graphs. + +DOT_CLEANUP = YES diff --git a/src/3rdparty/libgq/gconf/GConfItem b/src/3rdparty/libgq/gconf/GConfItem new file mode 100644 index 0000000..0a58671 --- /dev/null +++ b/src/3rdparty/libgq/gconf/GConfItem @@ -0,0 +1 @@ +#include "gconfitem.h" diff --git a/src/3rdparty/libgq/gconf/Makefile.am b/src/3rdparty/libgq/gconf/Makefile.am new file mode 100644 index 0000000..353970d --- /dev/null +++ b/src/3rdparty/libgq/gconf/Makefile.am @@ -0,0 +1,37 @@ +AM_CXXFLAGS = $(QT_CFLAGS) $(GLIB_CFLAGS) $(GCONF_CFLAGS) +LIBS += $(QT_LIBS) $(GLIB_LIBS) $(GCONF_LIBS) + +lib_LTLIBRARIES = libgq-gconf.la + +libgq_gconf_la_SOURCES = GConfItem \ + gconfitem.h \ + gconfitem.cpp \ + gconfitem_moc.cpp + +gqincludedir=$(includedir)/gq +gqinclude_HEADERS = gconfitem.h GConfItem + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = gq-gconf.pc + +# Tests + +check_PROGRAMS = test-gconf + +test_gconf_SOURCES = test-gconf.h test-gconf.cpp test-gconf_moc.cpp +test_gconf_CFLAGS = $(QTEST_CFLAGS) +test_gconf_LDADD = libgq-gconf.la $(QTEST_LIBS) + +TESTS = run-test-gconf + +EXTRA_DIST = run-test-gconf + +# Moccing + +%_moc.cpp: %.h + $(MOC) -o "$@" "$<" + +clean-moc: + rm -f *_moc.cpp *_moc.lo + +clean-local: clean-moc diff --git a/src/3rdparty/libgq/gconf/gconfitem.cpp b/src/3rdparty/libgq/gconf/gconfitem.cpp new file mode 100644 index 0000000..d8c565a --- /dev/null +++ b/src/3rdparty/libgq/gconf/gconfitem.cpp @@ -0,0 +1,376 @@ +/* * This file is part of libgq * + * + * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * + * Contact: Marius Vollmer <marius.vollmer@nokia.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * version 2.1 as published by the Free Software Foundation. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA + * + */ + +#include <QString> +#include <QStringList> +#include <QByteArray> +#include <QVariant> +#include <QtDebug> + +#include "gconfitem.h" + +#include <glib.h> +#include <gconf/gconf-value.h> +#include <gconf/gconf-client.h> + +struct GConfItemPrivate { + QString key; + QVariant value; + guint notify_id; + + static void notify_trampoline(GConfClient*, guint, GConfEntry *, gpointer); +}; + +/* We get the default client and never release it, on purpose, to + avoid disconnecting from the GConf daemon when a program happens to + not have any GConfItems for short periods of time. + */ +static GConfClient * +get_gconf_client () +{ + static bool initialized = false; + static GConfClient *client; + + if (initialized) + return client; + + g_type_init (); + client = gconf_client_get_default(); + initialized = true; + + return client; +} + +/* Sometimes I like being too clever... + */ +#define withClient(c) for (GConfClient *c = get_gconf_client (); c; c = NULL) + +static QByteArray convertKey (QString key) +{ + if (key.startsWith('/')) + return key.toUtf8(); + else + { + qWarning() << "Using dot-separated key names with GConfItem is deprecated."; + qWarning() << "Please use" << '/' + key.replace('.', '/') << "instead of" << key; + return '/' + key.replace('.', '/').toUtf8(); + } +} + +static QString convertKey(const char *key) +{ + return QString::fromUtf8(key); +} + +static QVariant convertValue(GConfValue *src) +{ + if (!src) { + return QVariant(); + } else { + switch (src->type) { + case GCONF_VALUE_INVALID: + return QVariant(QVariant::Invalid); + case GCONF_VALUE_BOOL: + return QVariant((bool)gconf_value_get_bool(src)); + case GCONF_VALUE_INT: + return QVariant(gconf_value_get_int(src)); + case GCONF_VALUE_FLOAT: + return QVariant(gconf_value_get_float(src)); + case GCONF_VALUE_STRING: + return QVariant(QString::fromUtf8(gconf_value_get_string(src))); + case GCONF_VALUE_LIST: + switch (gconf_value_get_list_type(src)) { + case GCONF_VALUE_STRING: + { + QStringList result; + for (GSList *elts = gconf_value_get_list(src); elts; elts = elts->next) + result.append(QString::fromUtf8(gconf_value_get_string((GConfValue *)elts->data))); + return QVariant(result); + } + default: + { + QList<QVariant> result; + for (GSList *elts = gconf_value_get_list(src); elts; elts = elts->next) + result.append(convertValue((GConfValue *)elts->data)); + return QVariant(result); + } + } + case GCONF_VALUE_SCHEMA: + default: + return QVariant(); + } + } +} + +static GConfValue *convertString(const QString &str) +{ + GConfValue *v = gconf_value_new (GCONF_VALUE_STRING); + gconf_value_set_string (v, str.toUtf8().data()); + return v; +} + +static GConfValueType primitiveType (const QVariant &elt) +{ + switch(elt.type()) { + case QVariant::String: + return GCONF_VALUE_STRING; + case QVariant::Int: + return GCONF_VALUE_INT; + case QVariant::Double: + return GCONF_VALUE_FLOAT; + case QVariant::Bool: + return GCONF_VALUE_BOOL; + default: + return GCONF_VALUE_INVALID; + } +} + +static GConfValueType uniformType(const QList<QVariant> &list) +{ + GConfValueType result = GCONF_VALUE_INVALID; + + foreach (const QVariant &elt, list) { + GConfValueType elt_type = primitiveType (elt); + + if (elt_type == GCONF_VALUE_INVALID) + return GCONF_VALUE_INVALID; + + if (result == GCONF_VALUE_INVALID) + result = elt_type; + else if (result != elt_type) + return GCONF_VALUE_INVALID; + } + + if (result == GCONF_VALUE_INVALID) + return GCONF_VALUE_STRING; // empty list. + else + return result; +} + +static int convertValue(const QVariant &src, GConfValue **valp) +{ + GConfValue *v; + + switch(src.type()) { + case QVariant::Invalid: + v = NULL; + break; + case QVariant::Bool: + v = gconf_value_new (GCONF_VALUE_BOOL); + gconf_value_set_bool (v, src.toBool()); + break; + case QVariant::Int: + v = gconf_value_new (GCONF_VALUE_INT); + gconf_value_set_int (v, src.toInt()); + break; + case QVariant::Double: + v = gconf_value_new (GCONF_VALUE_FLOAT); + gconf_value_set_float (v, src.toDouble()); + break; + case QVariant::String: + v = convertString(src.toString()); + break; + case QVariant::StringList: + { + GSList *elts = NULL; + v = gconf_value_new(GCONF_VALUE_LIST); + gconf_value_set_list_type(v, GCONF_VALUE_STRING); + foreach (const QString &str, src.toStringList()) + elts = g_slist_prepend(elts, convertString(str)); + gconf_value_set_list_nocopy(v, g_slist_reverse(elts)); + break; + } + case QVariant::List: + { + GConfValueType elt_type = uniformType(src.toList()); + if (elt_type == GCONF_VALUE_INVALID) + v = NULL; + else + { + GSList *elts = NULL; + v = gconf_value_new(GCONF_VALUE_LIST); + gconf_value_set_list_type(v, elt_type); + foreach (const QVariant &elt, src.toList()) + { + GConfValue *val = NULL; + convertValue(elt, &val); // guaranteed to succeed. + elts = g_slist_prepend(elts, val); + } + gconf_value_set_list_nocopy(v, g_slist_reverse(elts)); + } + break; + } + default: + return 0; + } + + *valp = v; + return 1; +} + +void GConfItemPrivate::notify_trampoline (GConfClient*, + guint, + GConfEntry *, + gpointer data) +{ + GConfItem *item = (GConfItem *)data; + item->update_value (true); +} + +void GConfItem::update_value (bool emit_signal) +{ + QVariant new_value; + + withClient(client) { + GError *error = NULL; + QByteArray k = convertKey(priv->key); + GConfValue *v = gconf_client_get(client, k.data(), &error); + + if (error) { + qWarning() << error->message; + g_error_free (error); + new_value = priv->value; + } else { + new_value = convertValue(v); + if (v) + gconf_value_free(v); + } + } + + if (new_value != priv->value) { + priv->value = new_value; + if (emit_signal) + emit valueChanged(); + } +} + +QString GConfItem::key() const +{ + return priv->key; +} + +QVariant GConfItem::value() const +{ + return priv->value; +} + +QVariant GConfItem::value(const QVariant &def) const +{ + if (priv->value.isNull()) + return def; + else + return priv->value; +} + +void GConfItem::set(const QVariant &val) +{ + withClient(client) { + QByteArray k = convertKey(priv->key); + GConfValue *v; + if (convertValue(val, &v)) { + GError *error = NULL; + + if (v) { + gconf_client_set(client, k.data(), v, &error); + gconf_value_free(v); + } else { + gconf_client_unset(client, k.data(), &error); + } + + if (error) { + qWarning() << error->message; + g_error_free(error); + } else if (priv->value != val) { + priv->value = val; + emit valueChanged(); + } + + } else + qWarning() << "Can't store a" << val.typeName(); + } +} + +void GConfItem::unset() { + set(QVariant()); +} + +QList<QString> GConfItem::listDirs() const +{ + QList<QString> children; + + withClient(client) { + QByteArray k = convertKey(priv->key); + GSList *dirs = gconf_client_all_dirs(client, k.data(), NULL); + for (GSList *d = dirs; d; d = d->next) { + children.append(convertKey((char *)d->data)); + g_free (d->data); + } + g_slist_free (dirs); + } + + return children; +} + +QList<QString> GConfItem::listEntries() const +{ + QList<QString> children; + + withClient(client) { + QByteArray k = convertKey(priv->key); + GSList *entries = gconf_client_all_entries(client, k.data(), NULL); + for (GSList *e = entries; e; e = e->next) { + children.append(convertKey(((GConfEntry *)e->data)->key)); + gconf_entry_free ((GConfEntry *)e->data); + } + g_slist_free (entries); + } + + return children; +} + +GConfItem::GConfItem(const QString &key, QObject *parent) + : QObject (parent) +{ + priv = new GConfItemPrivate; + priv->key = key; + priv->notify_id = 0; + withClient(client) { + update_value (false); + QByteArray k = convertKey(priv->key); + gconf_client_add_dir (client, k.data(), GCONF_CLIENT_PRELOAD_ONELEVEL, NULL); + priv->notify_id = gconf_client_notify_add (client, k.data(), + GConfItemPrivate::notify_trampoline, this, + NULL, NULL); + } +} + +GConfItem::~GConfItem() +{ + withClient(client) { + QByteArray k = convertKey(priv->key); + if (priv->notify_id) + gconf_client_notify_remove (client, priv->notify_id); + gconf_client_remove_dir (client, k.data(), NULL); + } + delete priv; +} diff --git a/src/3rdparty/libgq/gconf/gconfitem.h b/src/3rdparty/libgq/gconf/gconfitem.h new file mode 100644 index 0000000..17ca04e --- /dev/null +++ b/src/3rdparty/libgq/gconf/gconfitem.h @@ -0,0 +1,147 @@ +/* * This file is part of libgq * + * + * Copyright (C) 2009 Nokia Corporation. + * + * Contact: Marius Vollmer <marius.vollmer@nokia.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * version 2.1 as published by the Free Software Foundation. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA + * + */ + +#ifndef GCONFITEM_H +#define GCONFITEM_H + +#include <QVariant> +#include <QStringList> +#include <QObject> + +/*! + + \brief GConfItem is a simple C++ wrapper for GConf. + + Creating a GConfItem instance gives you access to a single GConf + key. You can get and set its value, and connect to its + valueChanged() signal to be notified about changes. + + The value of a GConf key is returned to you as a QVariant, and you + pass in a QVariant when setting the value. GConfItem converts + between a QVariant and GConf values as needed, and according to the + following rules: + + - A QVariant of type QVariant::Invalid denotes an unset GConf key. + + - QVariant::Int, QVariant::Double, QVariant::Bool are converted to + and from the obvious equivalents. + + - QVariant::String is converted to/from a GConf string and always + uses the UTF-8 encoding. No other encoding is supported. + + - QVariant::StringList is converted to a list of UTF-8 strings. + + - QVariant::List (which denotes a QList<QVariant>) is converted + to/from a GConf list. All elements of such a list must have the + same type, and that type must be one of QVariant::Int, + QVariant::Double, QVariant::Bool, or QVariant::String. (A list of + strings is returned as a QVariant::StringList, however, when you + get it back.) + + - Any other QVariant or GConf value is essentially ignored. + + \warning GConfItem is as thread-safe as GConf. + +*/ + +class GConfItem : public QObject +{ + Q_OBJECT + + public: + /*! Initializes a GConfItem to access the GConf key denoted by + \a key. Key names should follow the normal GConf conventions + like "/myapp/settings/first". + + \param key The name of the key. + \param parent Parent object + */ + explicit GConfItem(const QString &key, QObject *parent = 0); + + /*! Finalizes a GConfItem. + */ + virtual ~GConfItem(); + + /*! Returns the key of this item, as given to the constructor. + */ + QString key() const; + + /*! Returns the current value of this item, as a QVariant. + */ + QVariant value() const; + + /*! Returns the current value of this item, as a QVariant. If + * there is no value for this item, return \a def instead. + */ + QVariant value(const QVariant &def) const; + + /*! Set the value of this item to \a val. If \a val can not be + represented in GConf or GConf refuses to accept it for other + reasons, the current value is not changed and nothing happens. + + When the new value is different from the old value, the + changedValue() signal is emitted on this GConfItem as part + of calling set(), but other GConfItem:s for the same key do + only receive a notification once the main loop runs. + + \param val The new value. + */ + void set(const QVariant &val); + + /*! Unset this item. This is equivalent to + + \code + item.set(QVariant(QVariant::Invalid)); + \endcode + */ + void unset(); + + /*! Return a list of the directories below this item. The + returned strings are absolute key names like + "/myapp/settings". + + A directory is a key that has children. The same key might + also have a value, but that is confusing and best avoided. + */ + QList<QString> listDirs() const; + + /*! Return a list of entries below this item. The returned + strings are absolute key names like "/myapp/settings/first". + + A entry is a key that has a value. The same key might also + have children, but that is confusing and is best avoided. + */ + QList<QString> listEntries() const; + + signals: + /*! Emitted when the value of this item has changed. + */ + void valueChanged(); + + private: + friend struct GConfItemPrivate; + struct GConfItemPrivate *priv; + + void update_value(bool emit_signal); +}; + +#endif // GCONFITEM_H diff --git a/src/3rdparty/libgq/gconf/gq-gconf.pc.in b/src/3rdparty/libgq/gconf/gq-gconf.pc.in new file mode 100644 index 0000000..bd76d65 --- /dev/null +++ b/src/3rdparty/libgq/gconf/gq-gconf.pc.in @@ -0,0 +1,11 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: gq-gconf +Description: Qt/GConf wrapper +Version: @VERSION@ +Requires: QtCore +Libs: -L${libdir} -lgq-gconf +Cflags: -I${includedir}/gq diff --git a/src/3rdparty/libgq/gconf/run-test-gconf b/src/3rdparty/libgq/gconf/run-test-gconf new file mode 100755 index 0000000..67f9090 --- /dev/null +++ b/src/3rdparty/libgq/gconf/run-test-gconf @@ -0,0 +1,49 @@ +#!/bin/sh + +# please make sure that the en_US.UTF-8 locale is available! +# - apt-get install locales +# - make sure /etc/locale.gen contains the line "en_US.UTF-8 UTF-8" +# - run /usr/sbin/locale-gen +LC_ALL=en_US.UTF-8 +export LC_ALL + +gconftool-2 -s -t bool /Test/Bool true +VALUE=$(gconftool-2 -g /Test/Bool) +if [ "$VALUE" != "true" ]; then + echo "GConf is not running, skipping all tests" + exit 77 +fi + +# Setup values expected by the external_values() test. + +gconftool-2 -s -t int /Test/Int 123 +gconftool-2 -s -t string /Test/String "Hello GConf" +gconftool-2 -s -t float /Test/Double 3.5 +gconftool-2 -s -t list --list-type string /Test/StringList "[Hello,GConf,ÄÖÜ]" +gconftool-2 -s -t list --list-type int /Test/IntList "[1,2,3,4]" +gconftool-2 -s -t list --list-type float /Test/DoubleList "[3.5,3.5,3.5]" +gconftool-2 -s -t list --list-type bool /Test/BoolList "[false,true,true,false]" +gconftool-2 -u /Test/UnsetBefore +gconftool-2 -s -t int /Test/UnsetAfter 100 +gconftool-2 -s -t int /Test/Dir/Entry 200 + +./test-gconf $* || exit 1 + +# Check what set_external() has left behind. + +compare() { + if [ "$1" != "$2" ]; then + echo "FAIL: '$1' != '$2'" + exit 1 + fi +} + +compare "`gconftool-2 -g /Test/Bool`" false +compare "`gconftool-2 -g /Test/Int`" 54321 +compare "`gconftool-2 -g /Test/String`" "Good bye GConf" +compare "`gconftool-2 -g /Test/Double`" -2.5 +compare "`gconftool-2 -g /Test/StringList`" "[Good,bye,GConf,äöü]" +compare "`gconftool-2 -g /Test/IntList`" "[5,4,3,2,1]" +compare "`gconftool-2 -g /Test/DoubleList`" "[-2.5,-2.5]" +compare "`gconftool-2 -g /Test/BoolList`" "[false,false,true,true]" +compare "`gconftool-2 -g /Test/UnsetAfter 2>&1`" 'No value set for `/Test/UnsetAfter'"'" diff --git a/src/3rdparty/libgq/gconf/test-gconf.cpp b/src/3rdparty/libgq/gconf/test-gconf.cpp new file mode 100644 index 0000000..52eb281 --- /dev/null +++ b/src/3rdparty/libgq/gconf/test-gconf.cpp @@ -0,0 +1,299 @@ +#include "test-gconf.h" + +#define MYLOGLEVEL 2 +void myMessageOutput(QtMsgType type, const char *msg) +{ + switch (type) { + case QtDebugMsg: + if (MYLOGLEVEL <= 0) + fprintf(stderr, "Debug: %s\n", msg); + break; + case QtWarningMsg: + if (MYLOGLEVEL <= 1) + fprintf(stderr, "Warning: %s\n", msg); + break; + case QtCriticalMsg: + if (MYLOGLEVEL <= 2) + fprintf(stderr, "Critical: %s\n", msg); + break; + case QtFatalMsg: + if (MYLOGLEVEL <= 3) + fprintf(stderr, "Fatal: %s\n", msg); + abort(); + } +} + +// +// Definition of testcases: Normal tests +// + +void GConfItemTests::timeout() +{ + timed_out = true; + timer.stop(); +} + +// Before all tests +void GConfItemTests::initTestCase() +{ + connect(&timer, SIGNAL(timeout()), + this, SLOT(timeout())); +} + +// After all tests +void GConfItemTests::cleanupTestCase() +{ +} + +// Before each test +void GConfItemTests::init() +{ + boolItem = new GConfItem("/Test/Bool"); + intItem = new GConfItem("/Test/Int"); + stringItem = new GConfItem("/Test/String"); + doubleItem = new GConfItem("/Test/Double"); + stringListItem = new GConfItem("/Test/StringList"); + intListItem = new GConfItem("/Test/IntList"); + doubleListItem = new GConfItem("/Test/DoubleList"); + boolListItem = new GConfItem("/Test/BoolList"); + unsetBeforeItem = new GConfItem("/Test/UnsetBefore"); + unsetAfterItem = new GConfItem("/Test/UnsetAfter"); + signalSpy = new SignalListener(); + QObject::connect(boolItem, SIGNAL(valueChanged()), signalSpy, SLOT(valueChanged())); + QObject::connect(intItem, SIGNAL(valueChanged()), signalSpy, SLOT(valueChanged())); + QObject::connect(stringItem, SIGNAL(valueChanged()), signalSpy, SLOT(valueChanged())); + QObject::connect(doubleItem, SIGNAL(valueChanged()), signalSpy, SLOT(valueChanged())); + QObject::connect(stringListItem, SIGNAL(valueChanged()), signalSpy, SLOT(valueChanged())); + QObject::connect(intListItem, SIGNAL(valueChanged()), signalSpy, SLOT(valueChanged())); + QObject::connect(doubleListItem, SIGNAL(valueChanged()), signalSpy, SLOT(valueChanged())); + QObject::connect(boolListItem, SIGNAL(valueChanged()), signalSpy, SLOT(valueChanged())); +} + +// After each test +void GConfItemTests::cleanup() +{ + QObject::disconnect(boolItem, SIGNAL(valueChanged()), signalSpy, SLOT(valueChanged())); + QObject::disconnect(intItem, SIGNAL(valueChanged()), signalSpy, SLOT(valueChanged())); + QObject::disconnect(stringItem, SIGNAL(valueChanged()), signalSpy, SLOT(valueChanged())); + QObject::disconnect(doubleItem, SIGNAL(valueChanged()), signalSpy, SLOT(valueChanged())); + QObject::disconnect(stringListItem, SIGNAL(valueChanged()), signalSpy, SLOT(valueChanged())); + QObject::disconnect(intListItem, SIGNAL(valueChanged()), signalSpy, SLOT(valueChanged())); + QObject::disconnect(doubleListItem, SIGNAL(valueChanged()), signalSpy, SLOT(valueChanged())); + QObject::disconnect(boolListItem, SIGNAL(valueChanged()), signalSpy, SLOT(valueChanged())); + delete signalSpy; + delete boolItem; + delete intItem; + delete stringItem; + delete doubleItem; + delete stringListItem; + delete intListItem; + delete doubleListItem; + delete boolListItem; + delete unsetBeforeItem; + delete unsetAfterItem; + + timer.stop(); +} + +void GConfItemTests::path() +{ + QCOMPARE(boolItem->key(), QString("/Test/Bool")); + QCOMPARE(intItem->key(), QString("/Test/Int")); + QCOMPARE(stringItem->key(), QString("/Test/String")); + QCOMPARE(doubleItem->key(), QString("/Test/Double")); + QCOMPARE(stringListItem->key(), QString("/Test/StringList")); + QCOMPARE(intListItem->key(), QString("/Test/IntList")); + QCOMPARE(doubleListItem->key(), QString("/Test/DoubleList")); + QCOMPARE(boolListItem->key(), QString("/Test/BoolList")); + QCOMPARE(unsetBeforeItem->key(), QString("/Test/UnsetBefore")); + QCOMPARE(unsetAfterItem->key(), QString("/Test/UnsetAfter")); +} + +void GConfItemTests::external_values() +{ + // These values are set before this program starts. + QCOMPARE(boolItem->value().toBool(), true); + QCOMPARE(intItem->value().toInt(), 123); + QCOMPARE(stringItem->value().toString(), QString("Hello GConf")); + QCOMPARE(doubleItem->value().toDouble(), 3.5); + QCOMPARE(stringListItem->value().toStringList(), QStringList() << "Hello" << "GConf" << QString::fromUtf8("ÄÖÜ")); + QCOMPARE(intListItem->value().toList(), QList<QVariant>() << 1 << 2 << 3 << 4); + QCOMPARE(doubleListItem->value().toList(), QList<QVariant>() << 3.5 << 3.5 << 3.5); + QCOMPARE(boolListItem->value().toList(), QList<QVariant>() << false << true << true << false); + QCOMPARE(unsetBeforeItem->value().isValid(), false); + QCOMPARE(unsetAfterItem->value().isValid(), true); +} + +void GConfItemTests::set_bool() +{ + signalSpy->numberOfCalls = 0; + + boolItem->set(false); + QCOMPARE(boolItem->value().toBool(), false); + boolItem->set(true); + QCOMPARE(boolItem->value().toBool(), true); + + QCOMPARE(signalSpy->numberOfCalls, 2); +} + +void GConfItemTests::set_int() +{ + signalSpy->numberOfCalls = 0; + + intItem->set(12); + QCOMPARE(intItem->value().toInt(), 12); + intItem->set(-5); + QCOMPARE(intItem->value().toInt(), -5); + + QCOMPARE(signalSpy->numberOfCalls, 2); +} + +void GConfItemTests::set_string() +{ + signalSpy->numberOfCalls = 0; + + stringItem->set("Hi"); + QCOMPARE(stringItem->value().toString(), QString("Hi")); + + QCOMPARE(signalSpy->numberOfCalls, 1); +} + +void GConfItemTests::set_unicode_string() +{ + signalSpy->numberOfCalls = 0; + + stringItem->set(QString::fromUtf8("Höäü")); + QCOMPARE(stringItem->value().toString(), QString::fromUtf8("Höäü")); + + QCOMPARE(signalSpy->numberOfCalls, 1); +} + +void GConfItemTests::set_double() +{ + signalSpy->numberOfCalls = 0; + + doubleItem->set(1.2345); + QCOMPARE(doubleItem->value().toDouble(), 1.2345); + + QCOMPARE(signalSpy->numberOfCalls, 1); +} + +void GConfItemTests::set_string_list() +{ + signalSpy->numberOfCalls = 0; + + stringListItem->set(QStringList() << "one" << "two" << "three"); + QCOMPARE(stringListItem->value().toStringList(), QStringList() << "one" << "two" << "three"); + + QCOMPARE(signalSpy->numberOfCalls, 1); +} + +void GConfItemTests::set_int_list() +{ + signalSpy->numberOfCalls = 0; + + intListItem->set(QList<QVariant>() << 10 << 11 << 12); + QCOMPARE(intListItem->value().toList(), QList<QVariant>() << 10 << 11 << 12); + + QCOMPARE(signalSpy->numberOfCalls, 1); +} + +void GConfItemTests::set_double_list() +{ + signalSpy->numberOfCalls = 0; + + doubleListItem->set(QList<QVariant>() << 1.1 << 2.2 << 3.3); + QCOMPARE(doubleListItem->value().toList(), QList<QVariant>() << 1.1 << 2.2 << 3.3); + + QCOMPARE(signalSpy->numberOfCalls, 1); +} + +void GConfItemTests::set_bool_list() +{ + signalSpy->numberOfCalls = 0; + + boolListItem->set(QList<QVariant>() << true << true << false); + QCOMPARE(boolListItem->value().toList(), QList<QVariant>() << true << true << false); + + QCOMPARE(signalSpy->numberOfCalls, 1); +} + +void GConfItemTests::unset () +{ + signalSpy->numberOfCalls = 0; + + boolItem->unset(); + QCOMPARE(boolItem->value().isValid(), false); + + QCOMPARE(signalSpy->numberOfCalls, 1); +} + +void GConfItemTests::list_dirs () +{ + GConfItem test("/Test"); + QStringList dirs = test.listDirs(); + + QVERIFY (!dirs.contains("/Test/Bool")); + QVERIFY (!dirs.contains("/Test/Int")); + QVERIFY (!dirs.contains("/Test/String")); + QVERIFY (!dirs.contains("/Test/Double")); + QVERIFY (!dirs.contains("/Test/StringList")); + QVERIFY (!dirs.contains("/Test/IntList")); + QVERIFY (!dirs.contains("/Test/DoubleList")); + QVERIFY (!dirs.contains("/Test/BoolList")); + QVERIFY (!dirs.contains("/Test/UnsetBefore")); + QVERIFY (!dirs.contains("/Test/UnsetAfter")); + QVERIFY (dirs.contains("/Test/Dir")); +} + +void GConfItemTests::list_entries () +{ + GConfItem test("/Test"); + QStringList entries = test.listEntries(); + + QVERIFY (!entries.contains("/Test/Bool")); // has been unset above + QVERIFY (entries.contains("/Test/Int")); + QVERIFY (entries.contains("/Test/String")); + QVERIFY (entries.contains("/Test/Double")); + QVERIFY (entries.contains("/Test/StringList")); + QVERIFY (entries.contains("/Test/IntList")); + QVERIFY (entries.contains("/Test/DoubleList")); + QVERIFY (entries.contains("/Test/BoolList")); + QVERIFY (!entries.contains("/Test/UnsetBefore")); + QVERIFY (entries.contains("/Test/UnsetAfter")); + QVERIFY (!entries.contains("/Test/Dir")); +} + +void GConfItemTests::get_default () +{ + intItem->unset(); + QCOMPARE(intItem->value(123).toInt(), 123); + intItem->set(234); + QCOMPARE(intItem->value(123).toInt(), 234); +} + +void GConfItemTests::propagate () +{ + GConfItem secondIntItem("/Test/Int"); + secondIntItem.set(3000); + QVERIFY_TIMEOUT(2000, intItem->value() == secondIntItem.value()); + QCOMPARE(signalSpy->numberOfCalls, 2); +} + +void GConfItemTests::set_external() +{ + // This must be the last test case. The values that are set here + // are checked after this program exits. + + boolItem->set(false); + intItem->set(54321); + stringItem->set("Good bye GConf"); + doubleItem->set(-2.5); + stringListItem->set(QStringList() << "Good" << "bye" << "GConf" << QString::fromUtf8("äöü")); + intListItem->set(QList<QVariant>() << 5 << 4 << 3 << 2 << 1); + doubleListItem->set(QList<QVariant>() << -2.5 << -2.5); + boolListItem->set(QList<QVariant>() << false << false << true << true); + unsetAfterItem->set(QVariant()); +} + +QTEST_MAIN(GConfItemTests); diff --git a/src/3rdparty/libgq/gconf/test-gconf.h b/src/3rdparty/libgq/gconf/test-gconf.h new file mode 100644 index 0000000..36eaecc --- /dev/null +++ b/src/3rdparty/libgq/gconf/test-gconf.h @@ -0,0 +1,86 @@ +#include <QObject> +#include <QtTest/QtTest> +#include <QDebug> + +#include "GConfItem" + +// Helper class for listening to signals +class SignalListener : public QObject +{ + Q_OBJECT +public: + int numberOfCalls; + SignalListener() : numberOfCalls(0) { + } + +public slots: + void valueChanged() + { + numberOfCalls++; + } +}; + +// Tests for the public API +class GConfItemTests : public QObject +{ + Q_OBJECT + + // Stored pointers etc. +private: + GConfItem *boolItem; + GConfItem *intItem; + GConfItem *stringItem; + GConfItem *doubleItem; + GConfItem *stringListItem; + GConfItem *intListItem; + GConfItem *doubleListItem; + GConfItem *boolListItem; + GConfItem *unsetBeforeItem; + GConfItem *unsetAfterItem; + + SignalListener *signalSpy; + + QTimer timer; + bool timed_out; + + // Tests +private slots: + // Init and cleanup helper functions + void initTestCase(); + void cleanupTestCase(); + void init(); + void cleanup(); + void timeout (); + + // Public API + void path(); + void external_values(); + void set_bool(); + void set_int(); + void set_string(); + void set_unicode_string(); + void set_double(); + void set_string_list(); + void set_int_list(); + void set_double_list(); + void set_bool_list(); + void unset(); + void get_default(); + void list_dirs(); + void list_entries(); + void propagate(); + void set_external(); +}; + +// Useful if you need to process some events until a condition becomes +// true. + +#define QVERIFY_TIMEOUT(msecs, expr) \ + do { \ + timed_out = false; \ + timer.start(msecs); \ + while (!timed_out && !(expr)) { \ + QCoreApplication::processEvents(QEventLoop::WaitForMoreEvents); \ + } \ + QVERIFY((expr)); \ + } while(0) diff --git a/src/3rdparty/phonon/CMakeLists.txt b/src/3rdparty/phonon/CMakeLists.txt index ef7d6f5..fd6368c 100644 --- a/src/3rdparty/phonon/CMakeLists.txt +++ b/src/3rdparty/phonon/CMakeLists.txt @@ -94,7 +94,7 @@ if (CMAKE_COMPILER_IS_GNUCXX) set( __KDE_HAVE_GCC_VISIBILITY ${__KDE_HAVE_GCC_VISIBILITY} CACHE BOOL "GCC support for hidden visibility") # get the gcc version - exec_program(${CMAKE_C_COMPILER} ARGS --version OUTPUT_VARIABLE _gcc_version_info) + exec_program(${CMAKE_C_COMPILER} ARGS ${CMAKE_C_COMPILER_ARG1} --version OUTPUT_VARIABLE _gcc_version_info) string (REGEX MATCH "[345]\\.[0-9]\\.[0-9]" _gcc_version "${_gcc_version_info}") # gcc on mac just reports: "gcc (GCC) 3.3 20030304 ..." without the patch level, handle this here: @@ -152,8 +152,8 @@ set(CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE ON) set(CMAKE_COLOR_MAKEFILE ON) set(PHONON_LIB_MAJOR_VERSION "4") -set(PHONON_LIB_MINOR_VERSION "3") -set(PHONON_LIB_PATCH_VERSION "80") +set(PHONON_LIB_MINOR_VERSION "4") +set(PHONON_LIB_PATCH_VERSION "0") set(PHONON_LIB_VERSION "${PHONON_LIB_MAJOR_VERSION}.4.0") set(PHONON_LIB_SOVERSION ${PHONON_LIB_MAJOR_VERSION}) diff --git a/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp b/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp index be2a568..3702560 100644 --- a/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp +++ b/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp @@ -16,6 +16,7 @@ along with this library. If not, see <http://www.gnu.org/licenses/>. */ +#include <QResource> #include <QUrl> #include "abstractmediaplayer.h" @@ -216,9 +217,10 @@ void MMF::AbstractMediaPlayer::doSetTickInterval(qint32 interval) TRACE_EXIT_0(); } -void MMF::AbstractMediaPlayer::open(const MediaSource &source, RFile& file) +void MMF::AbstractMediaPlayer::open() { - TRACE_CONTEXT(AbstractMediaPlayer::setFileSource, EAudioApi); + TRACE_CONTEXT(AbstractMediaPlayer::open, EAudioApi); + const MediaSource source = m_parent->source(); TRACE_ENTRY("state %d source.type %d", privateState(), source.type()); close(); @@ -229,7 +231,9 @@ void MMF::AbstractMediaPlayer::open(const MediaSource &source, RFile& file) switch (source.type()) { case MediaSource::LocalFile: { - symbianErr = openFile(file); + RFile *const file = m_parent->file(); + Q_ASSERT(file); + symbianErr = openFile(*file); if (KErrNone != symbianErr) errorMessage = tr("Error opening file"); break; @@ -237,9 +241,10 @@ void MMF::AbstractMediaPlayer::open(const MediaSource &source, RFile& file) case MediaSource::Url: { const QUrl url(source.url()); - if (url.scheme() == QLatin1String("file")) { - symbianErr = openFile(file); + RFile *const file = m_parent->file(); + Q_ASSERT(file); + symbianErr = openFile(*file); if (KErrNone != symbianErr) errorMessage = tr("Error opening file"); } else { @@ -251,6 +256,19 @@ void MMF::AbstractMediaPlayer::open(const MediaSource &source, RFile& file) break; } + case MediaSource::Stream: { + QResource *const resource = m_parent->resource(); + if (resource) { + m_buffer.Set(resource->data(), resource->size()); + symbianErr = openDescriptor(m_buffer); + if (KErrNone != symbianErr) + errorMessage = tr("Error opening resource"); + } else { + errorMessage = tr("Error opening source: resource not opened"); + } + break; + } + // Other source types are handled in MediaObject::createPlayer // Protection against adding new media types and forgetting to update this switch diff --git a/src/3rdparty/phonon/mmf/abstractmediaplayer.h b/src/3rdparty/phonon/mmf/abstractmediaplayer.h index 7d28caf..e795ecb 100644 --- a/src/3rdparty/phonon/mmf/abstractmediaplayer.h +++ b/src/3rdparty/phonon/mmf/abstractmediaplayer.h @@ -47,7 +47,7 @@ protected: AbstractMediaPlayer(MediaObject *parent, const AbstractPlayer *player); public: - virtual void open(const Phonon::MediaSource&, RFile&); + virtual void open(); // MediaObjectInterface virtual void play(); @@ -70,6 +70,7 @@ protected: virtual int setDeviceVolume(int mmfVolume) = 0; virtual int openFile(RFile& file) = 0; virtual int openUrl(const QString& url) = 0; + virtual int openDescriptor(const TDesC8 &des) = 0; virtual int bufferStatus() const = 0; void updateMetaData(); @@ -123,6 +124,9 @@ private: bool m_prefinishMarkSent; bool m_aboutToFinishSent; + // Used for playback of resource files + TPtrC8 m_buffer; + QMultiMap<QString, QString> m_metaData; }; diff --git a/src/3rdparty/phonon/mmf/abstractplayer.h b/src/3rdparty/phonon/mmf/abstractplayer.h index 30d5243..dd98c7c 100644 --- a/src/3rdparty/phonon/mmf/abstractplayer.h +++ b/src/3rdparty/phonon/mmf/abstractplayer.h @@ -26,8 +26,6 @@ along with this library. If not, see <http://www.gnu.org/licenses/>. #include "abstractvideooutput.h" -class RFile; - QT_BEGIN_NAMESPACE namespace Phonon @@ -54,7 +52,7 @@ class AbstractPlayer : public QObject public: AbstractPlayer(const AbstractPlayer *player); - virtual void open(const Phonon::MediaSource&, RFile&) = 0; + virtual void open() = 0; virtual void close() = 0; // MediaObjectInterface (implemented) diff --git a/src/3rdparty/phonon/mmf/abstractvideoplayer.cpp b/src/3rdparty/phonon/mmf/abstractvideoplayer.cpp index 9ea4d18..fb20bea 100644 --- a/src/3rdparty/phonon/mmf/abstractvideoplayer.cpp +++ b/src/3rdparty/phonon/mmf/abstractvideoplayer.cpp @@ -144,6 +144,12 @@ int MMF::AbstractVideoPlayer::openUrl(const QString &url) return err; } +int MMF::AbstractVideoPlayer::openDescriptor(const TDesC8 &des) +{ + TRAPD(err, m_player->OpenDesL(des)); + return err; +} + int MMF::AbstractVideoPlayer::bufferStatus() const { int result = 0; diff --git a/src/3rdparty/phonon/mmf/abstractvideoplayer.h b/src/3rdparty/phonon/mmf/abstractvideoplayer.h index d854793..3ff3c75 100644 --- a/src/3rdparty/phonon/mmf/abstractvideoplayer.h +++ b/src/3rdparty/phonon/mmf/abstractvideoplayer.h @@ -66,6 +66,7 @@ public: virtual int setDeviceVolume(int mmfVolume); virtual int openFile(RFile &file); virtual int openUrl(const QString &url); + virtual int openDescriptor(const TDesC8 &des); virtual int bufferStatus() const; virtual void close(); diff --git a/src/3rdparty/phonon/mmf/audioplayer.cpp b/src/3rdparty/phonon/mmf/audioplayer.cpp index f49e898..7c8b9bd 100644 --- a/src/3rdparty/phonon/mmf/audioplayer.cpp +++ b/src/3rdparty/phonon/mmf/audioplayer.cpp @@ -137,6 +137,12 @@ int MMF::AudioPlayer::openUrl(const QString& /*url*/) return 0; } +int MMF::AudioPlayer::openDescriptor(const TDesC8 &des) +{ + TRAPD(err, m_player->OpenDesL(des)); + return err; +} + int MMF::AudioPlayer::bufferStatus() const { int result = 0; diff --git a/src/3rdparty/phonon/mmf/audioplayer.h b/src/3rdparty/phonon/mmf/audioplayer.h index 0eb8bb7..e43cadd 100644 --- a/src/3rdparty/phonon/mmf/audioplayer.h +++ b/src/3rdparty/phonon/mmf/audioplayer.h @@ -67,6 +67,7 @@ typedef CMdaAudioPlayerUtility NativePlayer; virtual int setDeviceVolume(int mmfVolume); virtual int openFile(RFile& file); virtual int openUrl(const QString& url); + virtual int openDescriptor(const TDesC8 &des); virtual int bufferStatus() const; virtual void close(); diff --git a/src/3rdparty/phonon/mmf/dummyplayer.cpp b/src/3rdparty/phonon/mmf/dummyplayer.cpp index d39ef76..ba75b02 100644 --- a/src/3rdparty/phonon/mmf/dummyplayer.cpp +++ b/src/3rdparty/phonon/mmf/dummyplayer.cpp @@ -92,7 +92,7 @@ qint64 MMF::DummyPlayer::totalTime() const return 0; } -void MMF::DummyPlayer::open(const Phonon::MediaSource &, RFile &) +void MMF::DummyPlayer::open() { } diff --git a/src/3rdparty/phonon/mmf/dummyplayer.h b/src/3rdparty/phonon/mmf/dummyplayer.h index 9d45696..5b00411 100644 --- a/src/3rdparty/phonon/mmf/dummyplayer.h +++ b/src/3rdparty/phonon/mmf/dummyplayer.h @@ -57,7 +57,7 @@ public: virtual qint64 totalTime() const; // AbstractPlayer - virtual void open(const Phonon::MediaSource&, RFile&); + virtual void open(); virtual void close(); virtual void doSetTickInterval(qint32 interval); }; diff --git a/src/3rdparty/phonon/mmf/mediaobject.cpp b/src/3rdparty/phonon/mmf/mediaobject.cpp index d264377..98326b8 100644 --- a/src/3rdparty/phonon/mmf/mediaobject.cpp +++ b/src/3rdparty/phonon/mmf/mediaobject.cpp @@ -34,6 +34,7 @@ along with this library. If not, see <http://www.gnu.org/licenses/>. #include "mediaobject.h" #include <QDir> +#include <QResource> #include <QUrl> QT_BEGIN_NAMESPACE @@ -52,6 +53,8 @@ using namespace Phonon::MMF; MMF::MediaObject::MediaObject(QObject *parent) : MMF::MediaNode::MediaNode(parent) , m_recognizerOpened(false) , m_nextSourceSet(false) + , m_file(0) + , m_resource(0) { m_player.reset(new DummyPlayer()); @@ -68,7 +71,12 @@ MMF::MediaObject::~MediaObject() TRACE_CONTEXT(MediaObject::~MediaObject, EAudioApi); TRACE_ENTRY_0(); - m_file.Close(); + delete m_resource; + + if (m_file) + m_file->Close(); + delete m_file; + m_fileServer.Close(); m_recognizer.Close(); @@ -122,12 +130,13 @@ MMF::MediaType MMF::MediaObject::fileMediaType const QHBufC fileNameSymbian(QDir::toNativeSeparators(fileName)); - m_file.Close(); - TInt err = m_file.Open(m_fileServer, *fileNameSymbian, EFileRead | EFileShareReadersOnly); + Q_ASSERT(!m_file); + m_file = new RFile; + TInt err = m_file->Open(m_fileServer, *fileNameSymbian, EFileRead | EFileShareReadersOnly); if (KErrNone == err) { TDataRecognitionResult recognizerResult; - err = m_recognizer.RecognizeData(m_file, recognizerResult); + err = m_recognizer.RecognizeData(*m_file, recognizerResult); if (KErrNone == err) { const TPtrC mimeType = recognizerResult.iDataType.Des(); result = Utils::mimeTypeToMediaType(mimeType); @@ -142,6 +151,23 @@ MMF::MediaType MMF::MediaObject::fileMediaType return result; } +MMF::MediaType MMF::MediaObject::bufferMediaType(const uchar *data, qint64 size) +{ + TRACE_CONTEXT(MediaObject::bufferMediaType, EAudioInternal); + MediaType result = MediaTypeUnknown; + if (openRecognizer()) { + TDataRecognitionResult recognizerResult; + const TPtrC8 des(data, size); + const TInt err = m_recognizer.RecognizeData(KNullDesC, des, recognizerResult); + if (KErrNone == err) { + const TPtrC mimeType = recognizerResult.iDataType.Des(); + result = Utils::mimeTypeToMediaType(mimeType); + } else { + TRACE("RApaLsSession::RecognizeData error %d", err); + } + } + return result; +} //----------------------------------------------------------------------------- // MediaObjectInterface @@ -228,9 +254,17 @@ void MMF::MediaObject::setSource(const MediaSource &source) void MMF::MediaObject::switchToSource(const MediaSource &source) { + if (m_file) + m_file->Close(); + delete m_file; + m_file = 0; + + delete m_resource; + m_resource = 0; + createPlayer(source); m_source = source; - m_player->open(m_source, m_file); + m_player->open(); emit currentSourceChanged(m_source); } @@ -272,10 +306,29 @@ void MMF::MediaObject::createPlayer(const MediaSource &source) case MediaSource::Invalid: case MediaSource::Disc: - case MediaSource::Stream: errorMessage = tr("Error opening source: type not supported"); break; + case MediaSource::Stream: + { + const QString fileName = source.url().toLocalFile(); + if (fileName.startsWith(QLatin1String(":/")) || fileName.startsWith(QLatin1String("qrc://"))) { + Q_ASSERT(!m_resource); + m_resource = new QResource(fileName); + if (m_resource->isValid()) { + if (m_resource->isCompressed()) + errorMessage = tr("Error opening source: resource is compressed"); + else + mediaType = bufferMediaType(m_resource->data(), m_resource->size()); + } else { + errorMessage = tr("Error opening source: resource not valid"); + } + } else { + errorMessage = tr("Error opening source: type not supported"); + } + } + break; + case MediaSource::Empty: TRACE_0("Empty media source"); break; @@ -374,6 +427,16 @@ void MMF::MediaObject::volumeChanged(qreal volume) m_player->volumeChanged(volume); } +RFile* MMF::MediaObject::file() const +{ + return m_file; +} + +QResource* MMF::MediaObject::resource() const +{ + return m_resource; +} + //----------------------------------------------------------------------------- // MediaNode //----------------------------------------------------------------------------- diff --git a/src/3rdparty/phonon/mmf/mediaobject.h b/src/3rdparty/phonon/mmf/mediaobject.h index f15eb21..5399e27 100644 --- a/src/3rdparty/phonon/mmf/mediaobject.h +++ b/src/3rdparty/phonon/mmf/mediaobject.h @@ -33,6 +33,8 @@ along with this library. If not, see <http://www.gnu.org/licenses/>. QT_BEGIN_NAMESPACE +class QResource; + namespace Phonon { namespace MMF @@ -87,6 +89,9 @@ public: void setVideoOutput(AbstractVideoOutput* videoOutput); + RFile* file() const; + QResource* resource() const; + public Q_SLOTS: void volumeChanged(qreal volume); void switchToNextSource(); @@ -117,6 +122,7 @@ private: // Audio / video media type recognition MediaType fileMediaType(const QString& fileName); + MediaType bufferMediaType(const uchar *data, qint64 size); // TODO: urlMediaType function static qint64 toMilliSeconds(const TTimeIntervalMicroSeconds &); @@ -132,9 +138,8 @@ private: MediaSource m_nextSource; bool m_nextSourceSet; - // Storing the file handle here to work around KErrInUse error - // from MMF player utility OpenFileL functions - RFile m_file; + RFile* m_file; + QResource* m_resource; QScopedPointer<AbstractPlayer> m_player; diff --git a/src/3rdparty/phonon/phonon/mediasource.cpp b/src/3rdparty/phonon/phonon/mediasource.cpp index 11d2428..d70b38b 100644 --- a/src/3rdparty/phonon/phonon/mediasource.cpp +++ b/src/3rdparty/phonon/phonon/mediasource.cpp @@ -58,6 +58,7 @@ MediaSource::MediaSource(const QString &filename) d->type = Stream; d->ioDevice = new QFile(filename); d->setStream(new IODeviceStream(d->ioDevice, d->ioDevice)); + d->url = QUrl::fromLocalFile(fileInfo.absoluteFilePath()); #else d->type = Invalid; #endif //QT_NO_PHONON_ABSTRACTMEDIASTREAM diff --git a/src/3rdparty/phonon/phonon/phononnamespace.h b/src/3rdparty/phonon/phonon/phononnamespace.h index ec42d51..eb899de 100644 --- a/src/3rdparty/phonon/phonon/phononnamespace.h +++ b/src/3rdparty/phonon/phonon/phononnamespace.h @@ -41,12 +41,12 @@ /** * PHONON_VERSION is (major << 16) + (minor << 8) + patch. */ -#define PHONON_VERSION PHONON_VERSION_CHECK(4, 3, 1) +#define PHONON_VERSION PHONON_VERSION_CHECK(4, 4, 0) /** * PHONON_VERSION_STR is "major.minor.patch". E.g. "4.2.1" */ -#define PHONON_VERSION_STR "4.3.1" +#define PHONON_VERSION_STR "4.4.0" QT_BEGIN_HEADER QT_BEGIN_NAMESPACE diff --git a/src/3rdparty/webkit/.tag b/src/3rdparty/webkit/.tag index 3cb818d..d31a2b4 100644 --- a/src/3rdparty/webkit/.tag +++ b/src/3rdparty/webkit/.tag @@ -1 +1 @@ -0be9ff9f2b1ec2b748885ac15299bc1c65aca590 +72b1c38579ca1fdb3f242e29cd16e5bfb4925813 diff --git a/src/3rdparty/webkit/JavaScriptCore/ChangeLog b/src/3rdparty/webkit/JavaScriptCore/ChangeLog index ea680ac..c09ad79 100644 --- a/src/3rdparty/webkit/JavaScriptCore/ChangeLog +++ b/src/3rdparty/webkit/JavaScriptCore/ChangeLog @@ -1,3 +1,76 @@ +2010-07-02 Peter Varga <pvarga@inf.u-szeged.hu> + + Reviewed by Oliver Hunt. + + The alternativeFrameLocation value is wrong in the emitDisjunction function in + case of PatternTerm::TypeParentheticalAssertion. This value needs to be + computed from term.frameLocation instead of term.inputPosition. This mistake caused glibc + memory corruption in some cases. + Layout test added for checking of TypeParentheticalAssertion case. + https://bugs.webkit.org/show_bug.cgi?id=41458 + + * yarr/RegexInterpreter.cpp: + (JSC::Yarr::ByteCompiler::emitDisjunction): + +2010-07-03 Yong Li <yoli@rim.com> + + Reviewed by Darin Adler. + + Make Arguments::MaxArguments clamping work for numbers >= 0x80000000 in + the interpreter as well as the JIT. + + https://bugs.webkit.org/show_bug.cgi?id=41351 + rdar://problem/8142141 + + * interpreter/Interpreter.cpp: + (JSC::Interpreter::privateExecute): Fix signed integer overflow problem + in op_load_varargs handling. 0xFFFFFFFF was read as -1. + +2010-07-04 Mark Rowe <mrowe@apple.com> + + Build fix after r62456. + + * interpreter/Interpreter.cpp: + (JSC::Interpreter::privateExecute): Be slightly more consistent in using uint32_t to prevent + warnings about comparisons between signed and unsigned types, and attempts to call an overload + of std::min that doesn't exist. + +2010-07-02 Oliver Hunt <oliver@apple.com> + + Reviewed by Gavin Barraclough. + + Clamp the number of arguments supported by function.apply + https://bugs.webkit.org/show_bug.cgi?id=41351 + <rdar://problem/8142141> + + Add clamping logic to function.apply similar to that + enforced by firefox. We have a smaller clamp than + firefox as our calling convention means that stack + usage is proportional to argument count -- the firefox + limit is larger than you could actually call. + + * interpreter/Interpreter.cpp: + (JSC::Interpreter::privateExecute): + * jit/JITStubs.cpp: + (JSC::DEFINE_STUB_FUNCTION): + * runtime/Arguments.h: + (JSC::Arguments::): + +2010-07-01 Oliver Hunt <oliver@apple.com> + + Reviewed by Geoff Garen. + + Improve reentrancy logic in polymorphic cache stubs + <https://bugs.webkit.org/show_bug.cgi?id=41482> + <rdar://problem/8094380> + + Make the polymorphic cache stubs handle reentrancy + better. + + * jit/JITStubs.cpp: + (JSC::DEFINE_STUB_FUNCTION): + (JSC::getPolymorphicAccessStructureListSlot): + 2009-10-30 Tor Arne Vestbø <tor.arne.vestbo@nokia.com> Reviewed by Kenneth Rohde Christiansen. diff --git a/src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.cpp b/src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.cpp index 2713fd4..73efc0d 100644 --- a/src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008, 2009 Apple Inc. All rights reserved. + * Copyright (C) 2008, 2009, 2010 Apple Inc. All rights reserved. * Copyright (C) 2008 Cameron Zwarich <cwzwarich@uwaterloo.ca> * * Redistribution and use in source and binary forms, with or without @@ -3454,9 +3454,10 @@ skip_id_custom_self: int argsOffset = vPC[2].u.operand; JSValue arguments = callFrame->r(argsOffset).jsValue(); - int32_t argCount = 0; + uint32_t argCount = 0; if (!arguments) { argCount = (uint32_t)(callFrame->argumentCount()) - 1; + argCount = min<uint32_t>(argCount, Arguments::MaxArguments); int32_t sizeDelta = argsOffset + argCount + RegisterFile::CallFrameHeaderSize; Register* newEnd = callFrame->registers() + sizeDelta; if (!registerFile->grow(newEnd) || ((newEnd - callFrame->registers()) != sizeDelta)) { @@ -3464,9 +3465,9 @@ skip_id_custom_self: goto vm_throw; } ASSERT(!callFrame->callee()->isHostFunction()); - int32_t expectedParams = callFrame->callee()->jsExecutable()->parameterCount(); - int32_t inplaceArgs = min(argCount, expectedParams); - int32_t i = 0; + uint32_t expectedParams = callFrame->callee()->jsExecutable()->parameterCount(); + uint32_t inplaceArgs = min(argCount, expectedParams); + uint32_t i = 0; Register* argStore = callFrame->registers() + argsOffset; // First step is to copy the "expected" parameters from their normal location relative to the callframe @@ -3483,6 +3484,7 @@ skip_id_custom_self: if (asObject(arguments)->classInfo() == &Arguments::info) { Arguments* args = asArguments(arguments); argCount = args->numProvidedArguments(callFrame); + argCount = min<uint32_t>(argCount, Arguments::MaxArguments); int32_t sizeDelta = argsOffset + argCount + RegisterFile::CallFrameHeaderSize; Register* newEnd = callFrame->registers() + sizeDelta; if (!registerFile->grow(newEnd) || ((newEnd - callFrame->registers()) != sizeDelta)) { @@ -3493,6 +3495,7 @@ skip_id_custom_self: } else if (isJSArray(&callFrame->globalData(), arguments)) { JSArray* array = asArray(arguments); argCount = array->length(); + argCount = min<uint32_t>(argCount, Arguments::MaxArguments); int32_t sizeDelta = argsOffset + argCount + RegisterFile::CallFrameHeaderSize; Register* newEnd = callFrame->registers() + sizeDelta; if (!registerFile->grow(newEnd) || ((newEnd - callFrame->registers()) != sizeDelta)) { @@ -3503,6 +3506,7 @@ skip_id_custom_self: } else if (asObject(arguments)->inherits(&JSArray::info)) { JSObject* argObject = asObject(arguments); argCount = argObject->get(callFrame, callFrame->propertyNames().length).toUInt32(callFrame); + argCount = min<uint32_t>(argCount, Arguments::MaxArguments); int32_t sizeDelta = argsOffset + argCount + RegisterFile::CallFrameHeaderSize; Register* newEnd = callFrame->registers() + sizeDelta; if (!registerFile->grow(newEnd) || ((newEnd - callFrame->registers()) != sizeDelta)) { @@ -3510,7 +3514,7 @@ skip_id_custom_self: goto vm_throw; } Register* argsBuffer = callFrame->registers() + argsOffset; - for (int32_t i = 0; i < argCount; ++i) { + for (uint32_t i = 0; i < argCount; ++i) { argsBuffer[i] = asObject(arguments)->get(callFrame, i); CHECK_FOR_EXCEPTION(); } diff --git a/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.cpp b/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.cpp index daa945c..e5fcdc4 100644 --- a/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.cpp @@ -1330,17 +1330,18 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_get_by_id_self_fail) if (stubInfo->accessType == access_get_by_id_self) { ASSERT(!stubInfo->stubRoutine); polymorphicStructureList = new PolymorphicAccessStructureList(CodeLocationLabel(), stubInfo->u.getByIdSelf.baseObjectStructure); - stubInfo->initGetByIdSelfList(polymorphicStructureList, 2); + stubInfo->initGetByIdSelfList(polymorphicStructureList, 1); } else { polymorphicStructureList = stubInfo->u.getByIdSelfList.structureList; listIndex = stubInfo->u.getByIdSelfList.listSize; - stubInfo->u.getByIdSelfList.listSize++; } + if (listIndex < POLYMORPHIC_LIST_CACHE_SIZE) { + stubInfo->u.getByIdSelfList.listSize++; + JIT::compileGetByIdSelfList(callFrame->scopeChain()->globalData, codeBlock, stubInfo, polymorphicStructureList, listIndex, asCell(baseValue)->structure(), ident, slot, slot.cachedOffset()); - JIT::compileGetByIdSelfList(callFrame->scopeChain()->globalData, codeBlock, stubInfo, polymorphicStructureList, listIndex, asCell(baseValue)->structure(), ident, slot, slot.cachedOffset()); - - if (listIndex == (POLYMORPHIC_LIST_CACHE_SIZE - 1)) - ctiPatchCallByReturnAddress(codeBlock, STUB_RETURN_ADDRESS, FunctionPtr(cti_op_get_by_id_generic)); + if (listIndex == (POLYMORPHIC_LIST_CACHE_SIZE - 1)) + ctiPatchCallByReturnAddress(codeBlock, STUB_RETURN_ADDRESS, FunctionPtr(cti_op_get_by_id_generic)); + } } else ctiPatchCallByReturnAddress(callFrame->codeBlock(), STUB_RETURN_ADDRESS, FunctionPtr(cti_op_get_by_id_generic)); return JSValue::encode(result); @@ -1365,13 +1366,14 @@ static PolymorphicAccessStructureList* getPolymorphicAccessStructureListSlot(Str case access_get_by_id_proto_list: prototypeStructureList = stubInfo->u.getByIdProtoList.structureList; listIndex = stubInfo->u.getByIdProtoList.listSize; - stubInfo->u.getByIdProtoList.listSize++; + if (listIndex < POLYMORPHIC_LIST_CACHE_SIZE) + stubInfo->u.getByIdProtoList.listSize++; break; default: ASSERT_NOT_REACHED(); } - ASSERT(listIndex < POLYMORPHIC_LIST_CACHE_SIZE); + ASSERT(listIndex <= POLYMORPHIC_LIST_CACHE_SIZE); return prototypeStructureList; } @@ -1446,21 +1448,24 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_get_by_id_proto_list) int listIndex; PolymorphicAccessStructureList* prototypeStructureList = getPolymorphicAccessStructureListSlot(stubInfo, listIndex); + if (listIndex < POLYMORPHIC_LIST_CACHE_SIZE) { + JIT::compileGetByIdProtoList(callFrame->scopeChain()->globalData, callFrame, codeBlock, stubInfo, prototypeStructureList, listIndex, structure, slotBaseObject->structure(), propertyName, slot, offset); - JIT::compileGetByIdProtoList(callFrame->scopeChain()->globalData, callFrame, codeBlock, stubInfo, prototypeStructureList, listIndex, structure, slotBaseObject->structure(), propertyName, slot, offset); - - if (listIndex == (POLYMORPHIC_LIST_CACHE_SIZE - 1)) - ctiPatchCallByReturnAddress(codeBlock, STUB_RETURN_ADDRESS, FunctionPtr(cti_op_get_by_id_proto_list_full)); + if (listIndex == (POLYMORPHIC_LIST_CACHE_SIZE - 1)) + ctiPatchCallByReturnAddress(codeBlock, STUB_RETURN_ADDRESS, FunctionPtr(cti_op_get_by_id_proto_list_full)); + } } else if (size_t count = normalizePrototypeChain(callFrame, baseValue, slot.slotBase(), propertyName, offset)) { ASSERT(!asCell(baseValue)->structure()->isDictionary()); int listIndex; PolymorphicAccessStructureList* prototypeStructureList = getPolymorphicAccessStructureListSlot(stubInfo, listIndex); + + if (listIndex < POLYMORPHIC_LIST_CACHE_SIZE) { + StructureChain* protoChain = structure->prototypeChain(callFrame); + JIT::compileGetByIdChainList(callFrame->scopeChain()->globalData, callFrame, codeBlock, stubInfo, prototypeStructureList, listIndex, structure, protoChain, count, propertyName, slot, offset); - StructureChain* protoChain = structure->prototypeChain(callFrame); - JIT::compileGetByIdChainList(callFrame->scopeChain()->globalData, callFrame, codeBlock, stubInfo, prototypeStructureList, listIndex, structure, protoChain, count, propertyName, slot, offset); - - if (listIndex == (POLYMORPHIC_LIST_CACHE_SIZE - 1)) - ctiPatchCallByReturnAddress(codeBlock, STUB_RETURN_ADDRESS, FunctionPtr(cti_op_get_by_id_proto_list_full)); + if (listIndex == (POLYMORPHIC_LIST_CACHE_SIZE - 1)) + ctiPatchCallByReturnAddress(codeBlock, STUB_RETURN_ADDRESS, FunctionPtr(cti_op_get_by_id_proto_list_full)); + } } else ctiPatchCallByReturnAddress(codeBlock, STUB_RETURN_ADDRESS, FunctionPtr(cti_op_get_by_id_proto_fail)); @@ -2129,6 +2134,7 @@ DEFINE_STUB_FUNCTION(int, op_load_varargs) if (!arguments) { int providedParams = callFrame->registers()[RegisterFile::ArgumentCount].i() - 1; argCount = providedParams; + argCount = min(argCount, static_cast<uint32_t>(Arguments::MaxArguments)); int32_t sizeDelta = argsOffset + argCount + RegisterFile::CallFrameHeaderSize; Register* newEnd = callFrame->registers() + sizeDelta; if (!registerFile->grow(newEnd) || ((newEnd - callFrame->registers()) != sizeDelta)) { @@ -2164,6 +2170,7 @@ DEFINE_STUB_FUNCTION(int, op_load_varargs) if (asObject(arguments)->classInfo() == &Arguments::info) { Arguments* argsObject = asArguments(arguments); argCount = argsObject->numProvidedArguments(callFrame); + argCount = min(argCount, static_cast<uint32_t>(Arguments::MaxArguments)); int32_t sizeDelta = argsOffset + argCount + RegisterFile::CallFrameHeaderSize; Register* newEnd = callFrame->registers() + sizeDelta; if (!registerFile->grow(newEnd) || ((newEnd - callFrame->registers()) != sizeDelta)) { @@ -2174,6 +2181,7 @@ DEFINE_STUB_FUNCTION(int, op_load_varargs) } else if (isJSArray(&callFrame->globalData(), arguments)) { JSArray* array = asArray(arguments); argCount = array->length(); + argCount = min(argCount, static_cast<uint32_t>(Arguments::MaxArguments)); int32_t sizeDelta = argsOffset + argCount + RegisterFile::CallFrameHeaderSize; Register* newEnd = callFrame->registers() + sizeDelta; if (!registerFile->grow(newEnd) || ((newEnd - callFrame->registers()) != sizeDelta)) { @@ -2184,6 +2192,7 @@ DEFINE_STUB_FUNCTION(int, op_load_varargs) } else if (asObject(arguments)->inherits(&JSArray::info)) { JSObject* argObject = asObject(arguments); argCount = argObject->get(callFrame, callFrame->propertyNames().length).toUInt32(callFrame); + argCount = min(argCount, static_cast<uint32_t>(Arguments::MaxArguments)); int32_t sizeDelta = argsOffset + argCount + RegisterFile::CallFrameHeaderSize; Register* newEnd = callFrame->registers() + sizeDelta; if (!registerFile->grow(newEnd) || ((newEnd - callFrame->registers()) != sizeDelta)) { diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/Arguments.h b/src/3rdparty/webkit/JavaScriptCore/runtime/Arguments.h index 9797e08..cca3cf2 100644 --- a/src/3rdparty/webkit/JavaScriptCore/runtime/Arguments.h +++ b/src/3rdparty/webkit/JavaScriptCore/runtime/Arguments.h @@ -55,6 +55,10 @@ namespace JSC { class Arguments : public JSObject { public: + // Use an enum because otherwise gcc insists on doing a memory + // read. + enum { MaxArguments = 0x10000 }; + enum NoParametersType { NoParameters }; Arguments(CallFrame*); diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/JSArray.cpp b/src/3rdparty/webkit/JavaScriptCore/runtime/JSArray.cpp index d3ef44c..ae9e038 100644 --- a/src/3rdparty/webkit/JavaScriptCore/runtime/JSArray.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/runtime/JSArray.cpp @@ -948,10 +948,10 @@ void JSArray::fillArgList(ExecState* exec, MarkedArgumentBuffer& args) void JSArray::copyToRegisters(ExecState* exec, Register* buffer, uint32_t maxSize) { - ASSERT(m_storage->m_length == maxSize); + ASSERT(m_storage->m_length >= maxSize); UNUSED_PARAM(maxSize); JSValue* vector = m_storage->m_vector; - unsigned vectorEnd = min(m_storage->m_length, m_vectorLength); + unsigned vectorEnd = min(maxSize, m_vectorLength); unsigned i = 0; for (; i < vectorEnd; ++i) { JSValue& v = vector[i]; @@ -960,7 +960,7 @@ void JSArray::copyToRegisters(ExecState* exec, Register* buffer, uint32_t maxSiz buffer[i] = v; } - for (; i < m_storage->m_length; ++i) + for (; i < maxSize; ++i) buffer[i] = get(exec, i); } diff --git a/src/3rdparty/webkit/JavaScriptCore/yarr/RegexInterpreter.cpp b/src/3rdparty/webkit/JavaScriptCore/yarr/RegexInterpreter.cpp index c2cb1c2..647b20a 100644 --- a/src/3rdparty/webkit/JavaScriptCore/yarr/RegexInterpreter.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/yarr/RegexInterpreter.cpp @@ -1554,7 +1554,7 @@ public: } case PatternTerm::TypeParentheticalAssertion: { - unsigned alternativeFrameLocation = term.inputPosition + RegexStackSpaceForBackTrackInfoParentheticalAssertion; + unsigned alternativeFrameLocation = term.frameLocation + RegexStackSpaceForBackTrackInfoParentheticalAssertion; atomParentheticalAssertionBegin(term.parentheses.subpatternId, term.invertOrCapture, term.frameLocation, alternativeFrameLocation); emitDisjunction(term.parentheses.disjunction, currentCountAlreadyChecked, 0); diff --git a/src/3rdparty/webkit/VERSION b/src/3rdparty/webkit/VERSION index f12f6b5..62aa8ce 100644 --- a/src/3rdparty/webkit/VERSION +++ b/src/3rdparty/webkit/VERSION @@ -4,4 +4,4 @@ This is a snapshot of the Qt port of WebKit from and has the sha1 checksum - 0be9ff9f2b1ec2b748885ac15299bc1c65aca590 + 72b1c38579ca1fdb3f242e29cd16e5bfb4925813 diff --git a/src/3rdparty/webkit/WebCore/ChangeLog b/src/3rdparty/webkit/WebCore/ChangeLog index f7f2803..98d4d51 100644 --- a/src/3rdparty/webkit/WebCore/ChangeLog +++ b/src/3rdparty/webkit/WebCore/ChangeLog @@ -1,3 +1,216 @@ +2010-08-10 Tor Arne Vestbø <tor.arne.vestbo@nokia.com> + + Reviewed by Simon Hausmann. + + Make sure NPAPI plugins get an initial setNPWindow on Mac + + https://bugs.webkit.org/show_bug.cgi?id=43782 + + * plugins/mac/PluginViewMac.mm: + +2010-06-14 Andreas Kling <andreas.kling@nokia.com> + + Reviewed by Tor Arne Vestbø. + + [Qt] Stack overflow when converting navigator object to QVariant + https://bugs.webkit.org/show_bug.cgi?id=40572 + + Protect against infinite recursion in JSValue->QVariant conversion. + This fixes a crash when trying to convert MimeType objects (they + recurse infinitely and on-the-fly via the enabledPlugin property.) + + * bridge/qt/qt_runtime.cpp: + (JSC::Bindings::convertValueToQVariant): + +2010-03-30 Kent Tamura <tkent@chromium.org> + + Reviewed by Brady Eidson. + + REGRESSION (r56439) - Crash when a renderer for a file upload control + with a selected file is recreated + https://bugs.webkit.org/show_bug.cgi?id=36723 + + RenderFileUploadControl::chooseIconForFiles was called before + m_fileChooser was initialized. + + * platform/FileChooser.cpp: + (WebCore::FileChooser::FileChooser): Introduce m_isInitializing flag to + avoid FileChooserClient::repaint() call. + (WebCore::FileChooser::loadIcon): + (WebCore::FileChooser::iconLoaded): + * platform/FileChooser.h: Add a FielChooser parameter to + FileChooserClient::chooseIconForFiles(). + * rendering/RenderFileUploadControl.cpp: + (WebCore::RenderFileUploadControl::chooseIconForFiles): + (WebCore::RenderFileUploadControl::paintObject): Add an assertion. + * rendering/RenderFileUploadControl.h: + +2010-07-06 Nikolas Zimmermann <nzimmermann@rim.com> + + Reviewed by Dirk Schulze. + + <use> on <font-face> causes crashes, if SVGUseElement gets detached + https://bugs.webkit.org/show_bug.cgi?id=41621 + + Do not call removeFromMappedElementSheet() from the SVGFontFaceElement destructor, + as that can potentially cause the element to be reattached while destructing. + + In order to fix the crash in the testcase, the order of calling the base-class detach + method in SVGUseElement and the instance/shadow tree destruction has to be reversed, + matching the order in removedFromDocument(). + + Test: svg/custom/use-font-face-crash.svg + + * svg/SVGFontFaceElement.cpp: + (WebCore::SVGFontFaceElement::~SVGFontFaceElement): Remove removeFromMappedElementSheet() call. + * svg/SVGUseElement.cpp: + (WebCore::SVGUseElement::detach): Reverse order of calling base-class detach method and instance/shadow tree destruction. + +2010-07-06 Nikolas Zimmermann <nzimmermann@rim.com> + + Reviewed by Darin Adler. + + <use> on <font-face> causes crashes, if SVGUseElement gets detached + https://bugs.webkit.org/show_bug.cgi?id=41621 + + Do not call removeFromMappedElementSheet() from the destructor, as the call to document()->updateStyleSelector() that can potentially + cause the element to be reattached while destructing. It's not needed at all, because removedFromDocument() is called before destruction, + which already calls removeFromMappedElementSheet() - at this point it's still safe to update the style selector. + + The crash is reproducable when using <use> on <font-face>. + + Test: svg/custom/use-font-face-crash.svg + + * svg/SVGFontFaceElement.cpp: + (WebCore::SVGFontFaceElement::~SVGFontFaceElement): + +2010-07-05 Nikolas Zimmermann <nzimmermann@rim.com> + + Reviewed by Darin Adler. + + Memory corruption with SVG <use> element + https://bugs.webkit.org/show_bug.cgi?id=40994 + + Fix race condition in svgAttributeChanged. Never call svgAttributeChanged() from attributeChanged() + when we're synchronizing SVG attributes. It leads to either unnecessary extra work being done or + crashes. Especially together with <polyline>/<polygon> which always synchronize the SVGAnimatedPoints + datastructure with the points attribute, no matter if there are changes are not. This should be + furhter optimized, but this fix is sane and fixes the root of the evil races. + + Test: svg/custom/use-property-synchronization-crash.svg + + * svg/SVGElement.cpp: + (WebCore::SVGElement::attributeChanged): + +2010-06-11 Abhishek Arya <inferno@chromium.org> + + Reviewed by David Hyatt. + + Don't process floats if parent node is not a RenderBlock. + https://bugs.webkit.org/show_bug.cgi?id=40033 + + Test: svg/text/clear-floats-crash.svg + + * rendering/RenderBlock.cpp: + (WebCore::RenderBlock::clearFloats): + +2010-06-23 Nikolas Zimmermann <nzimmermann@rim.com> + + Reviewed by Eric Seidel. + + Reproducible crash in com.apple.WebCore 0x01ed3784 WebCore::RenderLineBoxList::appendLineBox(WebCore::InlineFlowBox*) + 36 + https://bugs.webkit.org/show_bug.cgi?id=40953 + + REGRESSION (r58209-58231): Memory corruption with invalid SVG + https://bugs.webkit.org/show_bug.cgi?id=40173 + + Fix several crashes, all related to <foreignObject> and/or invalid SVG documents. + - Only allow <svg> nodes, as direct children of a <foreignObject>, not any other "partial" SVG content. + - Assure to create RenderSVGRoot objects for <svg> nodes in <foreignObject>, treat them as "outermost SVG elements". + - Never allow any partial SVG content to appear in any document. Only <svg> elements are allowed. + + Tests: svg/custom/bug45331.svg + svg/foreignObject/disallowed-svg-nodes-as-direct-children.svg + svg/foreignObject/no-crash-with-svg-content-in-html-document.svg + svg/foreignObject/svg-document-as-direct-child.svg + svg/foreignObject/svg-document-in-html-document.svg + svg/foreignObject/text-tref-02-b.svg + + * dom/Element.cpp: Added childShouldCreateRenderer, with ENABLE(SVG) guards. + (WebCore::Element::childShouldCreateRenderer): Only create a renderer for a SVG child, if we're a SVG element, or if the child is a <svg> element. + * dom/Element.h: Added childShouldCreateRenderer, with ENABLE(SVG) guards. + * svg/SVGForeignObjectElement.cpp: + (WebCore::SVGForeignObjectElement::childShouldCreateRenderer): Disallow arbitary SVG content, only <svg> elements are allowed as direct children of a <foreignObject> + * svg/SVGSVGElement.cpp: + (WebCore::SVGSVGElement::isOutermostSVG): Be sure to create RenderSVGRoot objects for <svg> elements inside <foreignObject> + +2010-06-10 Abhishek Arya <inferno@chromium.org> + + Reviewed by Dave Hyatt. + + Do not render CSS Styles :first-letter and :first-line in a SVG text element context. + https://bugs.webkit.org/show_bug.cgi?id=40031 + + Test: svg/text/text-style-invalid.svg + + * rendering/RenderSVGText.cpp: + (WebCore::RenderSVGText::firstLineBlock): + (WebCore::RenderSVGText::updateFirstLetter): + * rendering/RenderSVGText.h: + +2010-07-01 Justin Schuh <jschuh@chromium.org> + + Reviewed by Dan Bernstein. + + Prevent crash on counter destruction + https://bugs.webkit.org/show_bug.cgi?id=40032 + + Added counter destruction to RenderWidget::destroy() + + Test: fast/css/counters/destroy-counter-crash.html + + * rendering/RenderWidget.cpp: + (WebCore::RenderWidget::destroy): + +2010-06-29 Dan Bernstein <mitz@apple.com> + + Reviewed by Darin Adler. + + <rdar://problem/7975842> Certain text is repeated after using splitText() + + Tests: fast/text/setData-dirty-lines.html + fast/text/splitText-dirty-lines.html + + * dom/CharacterData.cpp: + (WebCore::CharacterData::setData): Call RenderText::setTextWithOffset() rather than + setText(), because only the former correctly dirties line boxes. + * dom/Text.cpp: + (WebCore::Text::splitText): Ditto. + +2010-06-25 Dan Bernstein <mitz@apple.com> + + Reviewed by Sam Weinig. + + <rdar://problem/8000667> Certain text is repeated before and after a line break + + Test: fast/text/bidi-explicit-embedding-past-end.html + + * platform/text/BidiResolver.h: + (WebCore::::createBidiRunsForLine): Committing explicit embedding past the end of the range + creates BidiRuns up to the end of the range, so at that point, we can stop iterating. + +2010-06-10 Tony Chang <tony@chromium.org> + + Reviewed by Kent Tamura. + + crash when focus is changed while trying to focus next element + https://bugs.webkit.org/show_bug.cgi?id=40407 + + Test: fast/events/focus-change-crash.html + + * dom/Element.cpp: + (WebCore::Element::focus): + 2010-07-01 Andreas Kling <andreas.kling@nokia.com> Reviewed by Tor Arne Vestbø. diff --git a/src/3rdparty/webkit/WebCore/bridge/qt/qt_runtime.cpp b/src/3rdparty/webkit/WebCore/bridge/qt/qt_runtime.cpp index 44c41c4..7f5d37d 100644 --- a/src/3rdparty/webkit/WebCore/bridge/qt/qt_runtime.cpp +++ b/src/3rdparty/webkit/WebCore/bridge/qt/qt_runtime.cpp @@ -162,9 +162,11 @@ static JSRealType valueRealType(ExecState* exec, JSValue val) return String; // I don't know. } -QVariant convertValueToQVariant(ExecState* exec, JSValue value, QMetaType::Type hint, int *distance, HashSet<JSObject*>* visitedObjects) +QVariant convertValueToQVariant(ExecState* exec, JSValue value, QMetaType::Type hint, int *distance, HashSet<JSObject*>* visitedObjects, int recursionLimit) { - if (!value) + --recursionLimit; + + if (!value || !recursionLimit) return QVariant(); JSObject* object = 0; @@ -344,7 +346,7 @@ QVariant convertValueToQVariant(ExecState* exec, JSValue value, QMetaType::Type while(it != properties.end()) { if (object->propertyIsEnumerable(exec, *it)) { JSValue val = object->get(exec, *it); - QVariant v = convertValueToQVariant(exec, val, QMetaType::Void, &objdist, visitedObjects); + QVariant v = convertValueToQVariant(exec, val, QMetaType::Void, &objdist, visitedObjects, recursionLimit); if (objdist >= 0) { UString ustring = (*it).ustring(); QString id = QString((const QChar*)ustring.rep()->characters(), ustring.size()); @@ -368,7 +370,7 @@ QVariant convertValueToQVariant(ExecState* exec, JSValue value, QMetaType::Type qConvDebug() << "converting a " << len << " length Array"; for (int i = 0; i < len; ++i) { JSValue val = rtarray->getConcreteArray()->valueAt(exec, i); - result.append(convertValueToQVariant(exec, val, QMetaType::Void, &objdist, visitedObjects)); + result.append(convertValueToQVariant(exec, val, QMetaType::Void, &objdist, visitedObjects, recursionLimit)); if (objdist == -1) { qConvDebug() << "Failed converting element at index " << i; break; // Failed converting a list entry, so fail the array @@ -387,7 +389,7 @@ QVariant convertValueToQVariant(ExecState* exec, JSValue value, QMetaType::Type qConvDebug() << "converting a " << len << " length Array"; for (int i = 0; i < len; ++i) { JSValue val = array->get(exec, i); - result.append(convertValueToQVariant(exec, val, QMetaType::Void, &objdist, visitedObjects)); + result.append(convertValueToQVariant(exec, val, QMetaType::Void, &objdist, visitedObjects, recursionLimit)); if (objdist == -1) { qConvDebug() << "Failed converting element at index " << i; break; // Failed converting a list entry, so fail the array @@ -401,7 +403,7 @@ QVariant convertValueToQVariant(ExecState* exec, JSValue value, QMetaType::Type // Make a single length array int objdist; qConvDebug() << "making a single length variantlist"; - QVariant var = convertValueToQVariant(exec, value, QMetaType::Void, &objdist, visitedObjects); + QVariant var = convertValueToQVariant(exec, value, QMetaType::Void, &objdist, visitedObjects, recursionLimit); if (objdist != -1) { QVariantList result; result << var; @@ -645,7 +647,7 @@ QVariant convertValueToQVariant(ExecState* exec, JSValue value, QMetaType::Type for (int i = 0; i < len; ++i) { JSValue val = rtarray->getConcreteArray()->valueAt(exec, i); int itemdist = -1; - QVariant item = convertValueToQVariant(exec, val, QMetaType::QObjectStar, &itemdist, visitedObjects); + QVariant item = convertValueToQVariant(exec, val, QMetaType::QObjectStar, &itemdist, visitedObjects, recursionLimit); if (itemdist >= 0) result.append(item.value<QObject*>()); else @@ -664,7 +666,7 @@ QVariant convertValueToQVariant(ExecState* exec, JSValue value, QMetaType::Type for (int i = 0; i < len; ++i) { JSValue val = array->get(exec, i); int itemdist = -1; - QVariant item = convertValueToQVariant(exec, val, QMetaType::QObjectStar, &itemdist, visitedObjects); + QVariant item = convertValueToQVariant(exec, val, QMetaType::QObjectStar, &itemdist, visitedObjects, recursionLimit); if (itemdist >= 0) result.append(item.value<QObject*>()); else @@ -679,7 +681,7 @@ QVariant convertValueToQVariant(ExecState* exec, JSValue value, QMetaType::Type // Make a single length array QObjectList result; int itemdist = -1; - QVariant item = convertValueToQVariant(exec, value, QMetaType::QObjectStar, &itemdist, visitedObjects); + QVariant item = convertValueToQVariant(exec, value, QMetaType::QObjectStar, &itemdist, visitedObjects, recursionLimit); if (itemdist >= 0) { result.append(item.value<QObject*>()); dist = 10; @@ -696,7 +698,7 @@ QVariant convertValueToQVariant(ExecState* exec, JSValue value, QMetaType::Type for (int i = 0; i < len; ++i) { JSValue val = rtarray->getConcreteArray()->valueAt(exec, i); int itemdist = -1; - QVariant item = convertValueToQVariant(exec, val, QMetaType::Int, &itemdist, visitedObjects); + QVariant item = convertValueToQVariant(exec, val, QMetaType::Int, &itemdist, visitedObjects, recursionLimit); if (itemdist >= 0) result.append(item.value<int>()); else @@ -715,7 +717,7 @@ QVariant convertValueToQVariant(ExecState* exec, JSValue value, QMetaType::Type for (int i = 0; i < len; ++i) { JSValue val = array->get(exec, i); int itemdist = -1; - QVariant item = convertValueToQVariant(exec, val, QMetaType::Int, &itemdist, visitedObjects); + QVariant item = convertValueToQVariant(exec, val, QMetaType::Int, &itemdist, visitedObjects, recursionLimit); if (itemdist >= 0) result.append(item.value<int>()); else @@ -730,7 +732,7 @@ QVariant convertValueToQVariant(ExecState* exec, JSValue value, QMetaType::Type // Make a single length array QList<int> result; int itemdist = -1; - QVariant item = convertValueToQVariant(exec, value, QMetaType::Int, &itemdist, visitedObjects); + QVariant item = convertValueToQVariant(exec, value, QMetaType::Int, &itemdist, visitedObjects, recursionLimit); if (itemdist >= 0) { result.append(item.value<int>()); dist = 10; @@ -757,7 +759,7 @@ QVariant convertValueToQVariant(ExecState* exec, JSValue value, QMetaType::Type } // And then recurse with the autodetect flag - ret = convertValueToQVariant(exec, value, QMetaType::Void, distance, visitedObjects); + ret = convertValueToQVariant(exec, value, QMetaType::Void, distance, visitedObjects, recursionLimit); dist = 10; } break; @@ -777,8 +779,9 @@ QVariant convertValueToQVariant(ExecState* exec, JSValue value, QMetaType::Type QVariant convertValueToQVariant(ExecState* exec, JSValue value, QMetaType::Type hint, int *distance) { + const int recursionLimit = 200; HashSet<JSObject*> visitedObjects; - return convertValueToQVariant(exec, value, hint, distance, &visitedObjects); + return convertValueToQVariant(exec, value, hint, distance, &visitedObjects, recursionLimit); } JSValue convertQVariantToValue(ExecState* exec, PassRefPtr<RootObject> root, const QVariant& variant) diff --git a/src/3rdparty/webkit/WebCore/dom/CharacterData.cpp b/src/3rdparty/webkit/WebCore/dom/CharacterData.cpp index 3c3dc37..cb12184 100644 --- a/src/3rdparty/webkit/WebCore/dom/CharacterData.cpp +++ b/src/3rdparty/webkit/WebCore/dom/CharacterData.cpp @@ -46,15 +46,15 @@ void CharacterData::setData(const String& data, ExceptionCode&) int oldLength = length(); RefPtr<StringImpl> oldStr = m_data; m_data = dataImpl; - + if ((!renderer() || !rendererIsNeeded(renderer()->style())) && attached()) { detach(); attach(); } else if (renderer()) - toRenderText(renderer())->setText(m_data); - + toRenderText(renderer())->setTextWithOffset(m_data, 0, oldLength); + dispatchModifiedEvent(oldStr.get()); - + document()->textRemoved(this, 0, oldLength); } diff --git a/src/3rdparty/webkit/WebCore/dom/Element.cpp b/src/3rdparty/webkit/WebCore/dom/Element.cpp index a02bb4c..4c93020 100644 --- a/src/3rdparty/webkit/WebCore/dom/Element.cpp +++ b/src/3rdparty/webkit/WebCore/dom/Element.cpp @@ -1311,8 +1311,12 @@ void Element::focus(bool restorePreviousSelection) return; } - if (Page* page = doc->page()) + RefPtr<Node> protect; + if (Page* page = doc->page()) { + // Focus and change event handlers can cause us to lose our last ref. + protect = this; page->focusController()->setFocusedNode(this, doc->frame()); + } // Setting the focused node above might have invalidated the layout due to scripts. doc->updateLayoutIgnorePendingStylesheets(); @@ -1535,4 +1539,15 @@ const QualifiedName& Element::rareIDAttributeName() const return rareData()->m_idAttributeName; } +#if ENABLE(SVG) +bool Element::childShouldCreateRenderer(Node* child) const +{ + // Only create renderers for SVG elements whose parents are SVG elements, or for proper <svg xmlns="svgNS"> subdocuments. + if (child->isSVGElement()) + return child->hasTagName(SVGNames::svgTag) || isSVGElement(); + + return Node::childShouldCreateRenderer(child); +} +#endif + } // namespace WebCore diff --git a/src/3rdparty/webkit/WebCore/dom/Element.h b/src/3rdparty/webkit/WebCore/dom/Element.h index 348ed1c..36c4f1b 100644 --- a/src/3rdparty/webkit/WebCore/dom/Element.h +++ b/src/3rdparty/webkit/WebCore/dom/Element.h @@ -270,6 +270,10 @@ public: virtual void dispatchFormControlChangeEvent() { } +#if ENABLE(SVG) + virtual bool childShouldCreateRenderer(Node*) const; +#endif + protected: Element(const QualifiedName&, Document*, ConstructionType); diff --git a/src/3rdparty/webkit/WebCore/dom/Text.cpp b/src/3rdparty/webkit/WebCore/dom/Text.cpp index 1ce074a..229fa88 100644 --- a/src/3rdparty/webkit/WebCore/dom/Text.cpp +++ b/src/3rdparty/webkit/WebCore/dom/Text.cpp @@ -77,7 +77,7 @@ PassRefPtr<Text> Text::splitText(unsigned offset, ExceptionCode& ec) document()->textNodeSplit(this); if (renderer()) - toRenderText(renderer())->setText(dataImpl()); + toRenderText(renderer())->setTextWithOffset(dataImpl(), 0, oldStr->length()); return newText.release(); } diff --git a/src/3rdparty/webkit/WebCore/platform/FileChooser.cpp b/src/3rdparty/webkit/WebCore/platform/FileChooser.cpp index dd4fc0d..90dd567 100644 --- a/src/3rdparty/webkit/WebCore/platform/FileChooser.cpp +++ b/src/3rdparty/webkit/WebCore/platform/FileChooser.cpp @@ -39,9 +39,11 @@ FileChooserClient::~FileChooserClient() inline FileChooser::FileChooser(FileChooserClient* client, const Vector<String>& initialFilenames) : m_client(client) + , m_isInitializing(true) { m_filenames = initialFilenames; loadIcon(); + m_isInitializing = false; } PassRefPtr<FileChooser> FileChooser::create(FileChooserClient* client, const Vector<String>& initialFilenames) @@ -79,13 +81,13 @@ void FileChooser::chooseFiles(const Vector<String>& filenames) void FileChooser::loadIcon() { if (m_filenames.size() && m_client) - m_client->chooseIconForFiles(m_filenames); + m_client->chooseIconForFiles(this, m_filenames); } void FileChooser::iconLoaded(PassRefPtr<Icon> icon) { m_icon = icon; - if (m_icon && m_client) + if (!m_isInitializing && m_icon && m_client) m_client->repaint(); } diff --git a/src/3rdparty/webkit/WebCore/platform/FileChooser.h b/src/3rdparty/webkit/WebCore/platform/FileChooser.h index 4028d41..e93b9ac 100644 --- a/src/3rdparty/webkit/WebCore/platform/FileChooser.h +++ b/src/3rdparty/webkit/WebCore/platform/FileChooser.h @@ -35,6 +35,7 @@ namespace WebCore { +class FileChooser; class Font; class Icon; @@ -44,7 +45,7 @@ public: virtual void repaint() = 0; virtual bool allowsMultipleFiles() = 0; virtual String acceptTypes() = 0; - virtual void chooseIconForFiles(const Vector<String>&) = 0; + virtual void chooseIconForFiles(FileChooser*, const Vector<String>&) = 0; virtual ~FileChooserClient(); }; @@ -79,6 +80,7 @@ private: FileChooserClient* m_client; Vector<String> m_filenames; RefPtr<Icon> m_icon; + bool m_isInitializing; }; } // namespace WebCore diff --git a/src/3rdparty/webkit/WebCore/platform/text/BidiResolver.h b/src/3rdparty/webkit/WebCore/platform/text/BidiResolver.h index 286cdcd..a99fd01 100644 --- a/src/3rdparty/webkit/WebCore/platform/text/BidiResolver.h +++ b/src/3rdparty/webkit/WebCore/platform/text/BidiResolver.h @@ -806,35 +806,33 @@ void BidiResolver<Iterator, Run>::createBidiRunsForLine(const Iterator& end, boo break; } - if (pastEnd) { - if (eor == current) { - if (!reachedEndOfLine) { - eor = endOfLine; - switch (m_status.eor) { - case LeftToRight: - case RightToLeft: - case ArabicNumber: - m_direction = m_status.eor; - break; - case EuropeanNumber: - m_direction = m_status.lastStrong == LeftToRight ? LeftToRight : EuropeanNumber; - break; - default: - ASSERT(false); - } - appendRun(); + if (pastEnd && eor == current) { + if (!reachedEndOfLine) { + eor = endOfLine; + switch (m_status.eor) { + case LeftToRight: + case RightToLeft: + case ArabicNumber: + m_direction = m_status.eor; + break; + case EuropeanNumber: + m_direction = m_status.lastStrong == LeftToRight ? LeftToRight : EuropeanNumber; + break; + default: + ASSERT(false); } - current = end; - m_status = stateAtEnd.m_status; - sor = stateAtEnd.sor; - eor = stateAtEnd.eor; - last = stateAtEnd.last; - reachedEndOfLine = stateAtEnd.reachedEndOfLine; - lastBeforeET = stateAtEnd.lastBeforeET; - emptyRun = stateAtEnd.emptyRun; - m_direction = OtherNeutral; - break; + appendRun(); } + current = end; + m_status = stateAtEnd.m_status; + sor = stateAtEnd.sor; + eor = stateAtEnd.eor; + last = stateAtEnd.last; + reachedEndOfLine = stateAtEnd.reachedEndOfLine; + lastBeforeET = stateAtEnd.lastBeforeET; + emptyRun = stateAtEnd.emptyRun; + m_direction = OtherNeutral; + break; } // set m_status.last as needed. @@ -887,8 +885,21 @@ void BidiResolver<Iterator, Run>::createBidiRunsForLine(const Iterator& end, boo } increment(); - if (!m_currentExplicitEmbeddingSequence.isEmpty()) + if (!m_currentExplicitEmbeddingSequence.isEmpty()) { commitExplicitEmbedding(); + if (pastEnd) { + current = end; + m_status = stateAtEnd.m_status; + sor = stateAtEnd.sor; + eor = stateAtEnd.eor; + last = stateAtEnd.last; + reachedEndOfLine = stateAtEnd.reachedEndOfLine; + lastBeforeET = stateAtEnd.lastBeforeET; + emptyRun = stateAtEnd.emptyRun; + m_direction = OtherNeutral; + break; + } + } if (emptyRun && (dirCurrent == RightToLeftEmbedding || dirCurrent == LeftToRightEmbedding diff --git a/src/3rdparty/webkit/WebCore/plugins/mac/PluginViewMac.mm b/src/3rdparty/webkit/WebCore/plugins/mac/PluginViewMac.mm index 57d74ab..c8781a8 100644 --- a/src/3rdparty/webkit/WebCore/plugins/mac/PluginViewMac.mm +++ b/src/3rdparty/webkit/WebCore/plugins/mac/PluginViewMac.mm @@ -227,7 +227,10 @@ bool PluginView::platformStart() #endif } - show(); + updatePluginWidget(); + + if (!m_plugin->quirks().contains(PluginQuirkDeferFirstSetWindowCall)) + setNPWindowIfNeeded(); // TODO: Implement null timer throttling depending on plugin activation m_nullEventTimer.set(new Timer<PluginView>(this, &PluginView::nullEventTimerFired)); diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderBlock.cpp b/src/3rdparty/webkit/WebCore/rendering/RenderBlock.cpp index 798663e..e7fa753 100644 --- a/src/3rdparty/webkit/WebCore/rendering/RenderBlock.cpp +++ b/src/3rdparty/webkit/WebCore/rendering/RenderBlock.cpp @@ -2981,6 +2981,12 @@ void RenderBlock::clearFloats() m_floatingObjects->clear(); } + // We should not process floats if the parent node is not a RenderBlock. Otherwise, we will add + // floats in an invalid context. This will cause a crash arising from a bad cast on the parent. + // See <rdar://problem/8049753>, where float property is applied on a text node in a SVG. + if (!parent() || !parent()->isRenderBlock()) + return; + // Attempt to locate a previous sibling with overhanging floats. We skip any elements that are // out of flow (like floating/positioned elements), and we also skip over any objects that may have shifted // to avoid floats. diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderFileUploadControl.cpp b/src/3rdparty/webkit/WebCore/rendering/RenderFileUploadControl.cpp index 14d126d..6a5c1e0 100644 --- a/src/3rdparty/webkit/WebCore/rendering/RenderFileUploadControl.cpp +++ b/src/3rdparty/webkit/WebCore/rendering/RenderFileUploadControl.cpp @@ -114,10 +114,10 @@ String RenderFileUploadControl::acceptTypes() return static_cast<HTMLInputElement*>(node())->accept(); } -void RenderFileUploadControl::chooseIconForFiles(const Vector<String>& filenames) +void RenderFileUploadControl::chooseIconForFiles(FileChooser* chooser, const Vector<String>& filenames) { if (Chrome* chromePointer = chrome()) - chromePointer->chooseIconForFiles(filenames, m_fileChooser); + chromePointer->chooseIconForFiles(filenames, chooser); } void RenderFileUploadControl::click() @@ -195,6 +195,7 @@ void RenderFileUploadControl::paintObject(PaintInfo& paintInfo, int tx, int ty) { if (style()->visibility() != VISIBLE) return; + ASSERT(m_fileChooser); // Push a clip. if (paintInfo.phase == PaintPhaseForeground || paintInfo.phase == PaintPhaseChildBlockBackgrounds) { diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderFileUploadControl.h b/src/3rdparty/webkit/WebCore/rendering/RenderFileUploadControl.h index a5f3367..25d2639 100644 --- a/src/3rdparty/webkit/WebCore/rendering/RenderFileUploadControl.h +++ b/src/3rdparty/webkit/WebCore/rendering/RenderFileUploadControl.h @@ -63,7 +63,7 @@ private: void repaint() { RenderBlock::repaint(); } bool allowsMultipleFiles(); String acceptTypes(); - void chooseIconForFiles(const Vector<String>&); + void chooseIconForFiles(FileChooser*, const Vector<String>&); Chrome* chrome() const; int maxFilenameWidth() const; diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderSVGText.cpp b/src/3rdparty/webkit/WebCore/rendering/RenderSVGText.cpp index 76b8b86..de902e0 100644 --- a/src/3rdparty/webkit/WebCore/rendering/RenderSVGText.cpp +++ b/src/3rdparty/webkit/WebCore/rendering/RenderSVGText.cpp @@ -225,6 +225,19 @@ FloatRect RenderSVGText::repaintRectInLocalCoordinates() const return repaintRect; } +// Fix for <rdar://problem/8048875>. We should not render :first-line CSS Style +// in a SVG text element context. +RenderBlock* RenderSVGText::firstLineBlock() const +{ + return 0; +} + +// Fix for <rdar://problem/8048875>. We should not render :first-letter CSS Style +// in a SVG text element context. +void RenderSVGText::updateFirstLetter() +{ +} + } #endif // ENABLE(SVG) diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderSVGText.h b/src/3rdparty/webkit/WebCore/rendering/RenderSVGText.h index ab4b09b..f09e396 100644 --- a/src/3rdparty/webkit/WebCore/rendering/RenderSVGText.h +++ b/src/3rdparty/webkit/WebCore/rendering/RenderSVGText.h @@ -72,6 +72,9 @@ private: virtual RootInlineBox* createRootInlineBox(); + virtual RenderBlock* firstLineBlock() const; + virtual void updateFirstLetter(); + AffineTransform m_localTransform; }; diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderWidget.cpp b/src/3rdparty/webkit/WebCore/rendering/RenderWidget.cpp index 561bead..251a65d 100644 --- a/src/3rdparty/webkit/WebCore/rendering/RenderWidget.cpp +++ b/src/3rdparty/webkit/WebCore/rendering/RenderWidget.cpp @@ -27,6 +27,7 @@ #include "AnimationController.h" #include "GraphicsContext.h" #include "HitTestResult.h" +#include "RenderCounter.h" #include "RenderView.h" #include "RenderWidgetProtector.h" @@ -114,6 +115,9 @@ void RenderWidget::destroy() if (RenderView* v = view()) v->removeWidget(this); + if (m_hasCounterNodeMap) + RenderCounter::destroyCounterNodes(this); + if (AXObjectCache::accessibilityEnabled()) { document()->axObjectCache()->childrenChanged(this->parent()); document()->axObjectCache()->remove(this); diff --git a/src/3rdparty/webkit/WebCore/svg/SVGElement.cpp b/src/3rdparty/webkit/WebCore/svg/SVGElement.cpp index 41bbba4..974bf2a 100644 --- a/src/3rdparty/webkit/WebCore/svg/SVGElement.cpp +++ b/src/3rdparty/webkit/WebCore/svg/SVGElement.cpp @@ -304,6 +304,15 @@ void SVGElement::attributeChanged(Attribute* attr, bool preserveDecls) return; StyledElement::attributeChanged(attr, preserveDecls); + + // When an animated SVG property changes through SVG DOM, svgAttributeChanged() is called, not attributeChanged(). + // Next time someone tries to access the XML attributes, the synchronization code starts. During that synchronization + // SVGAnimatedPropertySynchronizer may call NamedNodeMap::removeAttribute(), which in turn calls attributeChanged(). + // At this point we're not allowed to call svgAttributeChanged() again - it may lead to extra work being done, or crashes + // see bug https://bugs.webkit.org/show_bug.cgi?id=40994. + if (m_synchronizingSVGAttributes) + return; + svgAttributeChanged(attr->name()); } diff --git a/src/3rdparty/webkit/WebCore/svg/SVGFontFaceElement.cpp b/src/3rdparty/webkit/WebCore/svg/SVGFontFaceElement.cpp index 25b3aea..de646c6 100644 --- a/src/3rdparty/webkit/WebCore/svg/SVGFontFaceElement.cpp +++ b/src/3rdparty/webkit/WebCore/svg/SVGFontFaceElement.cpp @@ -59,7 +59,6 @@ SVGFontFaceElement::SVGFontFaceElement(const QualifiedName& tagName, Document* d SVGFontFaceElement::~SVGFontFaceElement() { - removeFromMappedElementSheet(); } static int cssPropertyIdForSVGAttributeName(const QualifiedName& attrName) diff --git a/src/3rdparty/webkit/WebCore/svg/SVGForeignObjectElement.cpp b/src/3rdparty/webkit/WebCore/svg/SVGForeignObjectElement.cpp index d28e2a4..e7b5389 100644 --- a/src/3rdparty/webkit/WebCore/svg/SVGForeignObjectElement.cpp +++ b/src/3rdparty/webkit/WebCore/svg/SVGForeignObjectElement.cpp @@ -125,6 +125,10 @@ RenderObject* SVGForeignObjectElement::createRenderer(RenderArena* arena, Render bool SVGForeignObjectElement::childShouldCreateRenderer(Node* child) const { + // Disallow arbitary SVG content. Only allow proper <svg xmlns="svgNS"> subdocuments. + if (child->isSVGElement()) + return child->hasTagName(SVGNames::svgTag); + // Skip over SVG rules which disallow non-SVG kids return StyledElement::childShouldCreateRenderer(child); } diff --git a/src/3rdparty/webkit/WebCore/svg/SVGSVGElement.cpp b/src/3rdparty/webkit/WebCore/svg/SVGSVGElement.cpp index 4c06008..5237715 100644 --- a/src/3rdparty/webkit/WebCore/svg/SVGSVGElement.cpp +++ b/src/3rdparty/webkit/WebCore/svg/SVGSVGElement.cpp @@ -538,6 +538,10 @@ bool SVGSVGElement::isOutermostSVG() const if (!parentNode()) return true; + // We act like an outermost SVG element, if we're a direct child of a <foreignObject> element. + if (parentNode()->hasTagName(SVGNames::foreignObjectTag)) + return true; + // This is true whenever this is the outermost SVG, even if there are HTML elements outside it return !parentNode()->isSVGElement(); } diff --git a/src/3rdparty/webkit/WebCore/svg/SVGUseElement.cpp b/src/3rdparty/webkit/WebCore/svg/SVGUseElement.cpp index 45bab6a..57d56e1 100644 --- a/src/3rdparty/webkit/WebCore/svg/SVGUseElement.cpp +++ b/src/3rdparty/webkit/WebCore/svg/SVGUseElement.cpp @@ -572,8 +572,8 @@ void SVGUseElement::attach() void SVGUseElement::detach() { - SVGStyledTransformableElement::detach(); m_targetElementInstance = 0; + SVGStyledTransformableElement::detach(); } static bool isDirectReference(Node* n) diff --git a/src/3rdparty/webkit/WebKit/qt/ChangeLog b/src/3rdparty/webkit/WebKit/qt/ChangeLog index b2bff0c..5083ba5 100644 --- a/src/3rdparty/webkit/WebKit/qt/ChangeLog +++ b/src/3rdparty/webkit/WebKit/qt/ChangeLog @@ -1,3 +1,36 @@ +2010-08-05 David Leong <david.leong@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Input mode states are not reset after entering a password field + https://bugs.webkit.org/show_bug.cgi?id=43530 + + Input mode hints are not reset if clicking on password <input> elements then + clicking on <textarea> elements + + * WebCoreSupport/EditorClientQt.cpp: + (WebCore::EditorClientQt::setInputMethodState): + * tests/qwebview/resources/input_types.html: + * tests/qwebview/tst_qwebview.cpp: + (tst_QWebView::focusInputTypes): + + +2010-07-27 Simon Hausmann <simon.hausmann@nokia.com> + + Reviewed by Tor Arne Vestbø. + + [Qt] Incorrect input method hints + https://bugs.webkit.org/show_bug.cgi?id=43037 + + Properly set or reset all input method hints when + activating input fields. + + * WebCoreSupport/EditorClientQt.cpp: + (WebCore::EditorClientQt::setInputMethodState): + * tests/qwebview/tst_qwebview.cpp: + (tst_QWebView::focusInputTypes): Extended unit test to verify that we + reset hints. + 2009-10-30 Tor Arne Vestbø <tor.arne.vestbo@nokia.com> Reviewed by Kenneth Rohde Christiansen. diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/EditorClientQt.cpp b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/EditorClientQt.cpp index 1cebef7..87e047e 100644 --- a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/EditorClientQt.cpp +++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/EditorClientQt.cpp @@ -599,6 +599,13 @@ void EditorClientQt::setInputMethodState(bool active) QWebPageClient* webPageClient = m_page->d->client; if (webPageClient) { #if QT_VERSION >= 0x040600 + // Make sure to reset input method hint + webPageClient->setInputMethodHint(Qt::ImhDialableCharactersOnly, false); + webPageClient->setInputMethodHint(Qt::ImhDigitsOnly, false); + webPageClient->setInputMethodHint(Qt::ImhEmailCharactersOnly, false); + webPageClient->setInputMethodHint(Qt::ImhUrlCharactersOnly, false); + webPageClient->setInputMethodHint(Qt::ImhHiddenText, false); + HTMLInputElement* inputElement = 0; Frame* frame = m_page->d->page->focusController()->focusedOrMainFrame(); if (frame && frame->document() && frame->document()->focusedNode()) @@ -606,20 +613,18 @@ void EditorClientQt::setInputMethodState(bool active) inputElement = static_cast<HTMLInputElement*>(frame->document()->focusedNode()); if (inputElement) { - if (!active) { - // Setting the Qt::WA_InputMethodEnabled attribute true and Qt::ImhHiddenText flag - // for password fields. The Qt platform is responsible for determining which widget - // will receive input method events for password fields. - active = inputElement->isPasswordField(); - webPageClient->setInputMethodHint(Qt::ImhHiddenText, active); - } else { - // Set input method hints for "number", "tel", "email", and "url" input elements. - webPageClient->setInputMethodHint(Qt::ImhDialableCharactersOnly, inputElement->isTelephoneField()); - webPageClient->setInputMethodHint(Qt::ImhDigitsOnly, inputElement->isNumberField()); - webPageClient->setInputMethodHint(Qt::ImhEmailCharactersOnly, inputElement->isEmailField()); - webPageClient->setInputMethodHint(Qt::ImhUrlCharactersOnly, inputElement->isUrlField()); - webPageClient->setInputMethodHint(Qt::ImhHiddenText, inputElement->isPasswordField()); - } + // Set input method hints for "number", "tel", "email", "url" and "password" input elements. + webPageClient->setInputMethodHint(Qt::ImhDialableCharactersOnly, inputElement->isTelephoneField()); + webPageClient->setInputMethodHint(Qt::ImhDigitsOnly, inputElement->isNumberField()); + webPageClient->setInputMethodHint(Qt::ImhEmailCharactersOnly, inputElement->isEmailField()); + webPageClient->setInputMethodHint(Qt::ImhUrlCharactersOnly, inputElement->isUrlField()); + // Setting the Qt::WA_InputMethodEnabled attribute true and Qt::ImhHiddenText flag + // for password fields. The Qt platform is responsible for determining which widget + // will receive input method events for password fields. + bool isPasswordField = inputElement->isPasswordField(); + webPageClient->setInputMethodHint(Qt::ImhHiddenText, isPasswordField); + if (isPasswordField) + active = true; } #if defined(Q_WS_MAEMO_5) || defined(Q_OS_SYMBIAN) diff --git a/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdoc b/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdoc index d3f5502..0335d46 100644 --- a/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdoc +++ b/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdoc @@ -1,6 +1,6 @@ /*! \module QtWebKit - \title QtWebKit Module + \title WebKit in Qt \contentspage All Qt Modules \previouspage QtSvg \nextpage QtXml diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebview/resources/input_types.html b/src/3rdparty/webkit/WebKit/qt/tests/qwebview/resources/input_types.html index 18ab314..2e893af 100644 --- a/src/3rdparty/webkit/WebKit/qt/tests/qwebview/resources/input_types.html +++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebview/resources/input_types.html @@ -4,5 +4,6 @@ <input type='tel' style='position: absolute; left: 10px; top: 100px; height: 50px; width: 100px;'/><br> <input type='number' style='position: absolute; left: 10px; top: 150px; height: 50px; width: 100px;'/><br> <input type='email' style='position: absolute; left: 10px; top: 200px; height: 50px; width: 100px;'/><br> -<input type='url' style='position: absolute; left: 10px; top: 250px; height: 50px; width: 100px;'/><br>" -</body></html>
\ No newline at end of file +<input type='url' style='position: absolute; left: 10px; top: 250px; height: 50px; width: 100px;'/><br> +<textarea style='position: absolute; left: 10px; top: 310px; height: 50px; width: 100px;' rows="2" cols="20">blah blah blah blah</textarea><br> +</body></html> diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebview/tst_qwebview.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qwebview/tst_qwebview.cpp index 835ad82..bd19578 100644 --- a/src/3rdparty/webkit/WebKit/qt/tests/qwebview/tst_qwebview.cpp +++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebview/tst_qwebview.cpp @@ -264,26 +264,58 @@ void tst_QWebView::focusInputTypes() #else QVERIFY(webView->inputMethodHints() == Qt::ImhNone); #endif + QVERIFY(webView->testAttribute(Qt::WA_InputMethodEnabled)); // 'password' field webView->fireMouseClick(QPoint(20, 60)); - QVERIFY(webView->inputMethodHints() & Qt::ImhHiddenText); + QVERIFY(webView->inputMethodHints() == Qt::ImhHiddenText); + QVERIFY(webView->testAttribute(Qt::WA_InputMethodEnabled)); // 'tel' field webView->fireMouseClick(QPoint(20, 110)); - QVERIFY(webView->inputMethodHints() & Qt::ImhDialableCharactersOnly); + QVERIFY(webView->inputMethodHints() == Qt::ImhDialableCharactersOnly); + QVERIFY(webView->testAttribute(Qt::WA_InputMethodEnabled)); // 'number' field webView->fireMouseClick(QPoint(20, 160)); - QVERIFY(webView->inputMethodHints() & Qt::ImhDigitsOnly); + QVERIFY(webView->inputMethodHints() == Qt::ImhDigitsOnly); + QVERIFY(webView->testAttribute(Qt::WA_InputMethodEnabled)); // 'email' field webView->fireMouseClick(QPoint(20, 210)); - QVERIFY(webView->inputMethodHints() & Qt::ImhEmailCharactersOnly); + QVERIFY(webView->inputMethodHints() == Qt::ImhEmailCharactersOnly); + QVERIFY(webView->testAttribute(Qt::WA_InputMethodEnabled)); // 'url' field webView->fireMouseClick(QPoint(20, 260)); - QVERIFY(webView->inputMethodHints() & Qt::ImhUrlCharactersOnly); + QVERIFY(webView->inputMethodHints() == Qt::ImhUrlCharactersOnly); + QVERIFY(webView->testAttribute(Qt::WA_InputMethodEnabled)); + + // 'password' field + webView->fireMouseClick(QPoint(20, 60)); + QVERIFY(webView->inputMethodHints() == Qt::ImhHiddenText); + QVERIFY(webView->testAttribute(Qt::WA_InputMethodEnabled)); + + // 'text' type + webView->fireMouseClick(QPoint(20, 10)); +#if defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) || defined(Q_OS_SYMBIAN) + QVERIFY(webView->inputMethodHints() & Qt::ImhNoAutoUppercase); + QVERIFY(webView->inputMethodHints() & Qt::ImhNoPredictiveText); +#else + QVERIFY(webView->inputMethodHints() == Qt::ImhNone); +#endif + QVERIFY(webView->testAttribute(Qt::WA_InputMethodEnabled)); + + // 'password' field + webView->fireMouseClick(QPoint(20, 60)); + QVERIFY(webView->inputMethodHints() == Qt::ImhHiddenText); + QVERIFY(webView->testAttribute(Qt::WA_InputMethodEnabled)); + + qWarning("clicking on text area"); + // 'text area' field + webView->fireMouseClick(QPoint(20, 320)); + QVERIFY(webView->inputMethodHints() == Qt::ImhNone); + QVERIFY(webView->testAttribute(Qt::WA_InputMethodEnabled)); delete webView; diff --git a/src/corelib/concurrent/qtconcurrentexception.cpp b/src/corelib/concurrent/qtconcurrentexception.cpp index e7f4674..fad04a6 100644 --- a/src/corelib/concurrent/qtconcurrentexception.cpp +++ b/src/corelib/concurrent/qtconcurrentexception.cpp @@ -66,7 +66,7 @@ QT_BEGIN_NAMESPACE the Qt Concurrent functions will throw a QtConcurrent::UnhandledException in the receiver thread. - When using QFuture, transferred exceptions willl be thrown when calling the following functions: + When using QFuture, transferred exceptions will be thrown when calling the following functions: \list \o QFuture::waitForFinished() \o QFuture::result() diff --git a/src/corelib/concurrent/qtconcurrentfilter.cpp b/src/corelib/concurrent/qtconcurrentfilter.cpp index 36febe7..29c3edb 100644 --- a/src/corelib/concurrent/qtconcurrentfilter.cpp +++ b/src/corelib/concurrent/qtconcurrentfilter.cpp @@ -117,7 +117,7 @@ function, and should merge the \e{intermediate} into the \e{result} variable. QtConcurrent::filteredReduced() guarantees that only one thread will call reduce at a time, so using a mutex to lock the result variable - is not neccesary. The QtConcurrent::ReduceOptions enum provides a way to + is not necessary. The QtConcurrent::ReduceOptions enum provides a way to control the order in which the reduction is done. \section1 Additional API Features diff --git a/src/corelib/concurrent/qtconcurrentmap.cpp b/src/corelib/concurrent/qtconcurrentmap.cpp index e74d69c..4303ff6 100644 --- a/src/corelib/concurrent/qtconcurrentmap.cpp +++ b/src/corelib/concurrent/qtconcurrentmap.cpp @@ -161,7 +161,7 @@ function, and should merge the \e{intermediate} into the \e{result} variable. QtConcurrent::mappedReduced() guarantees that only one thread will call reduce at a time, so using a mutex to lock the result variable - is not neccesary. The QtConcurrent::ReduceOptions enum provides a way to + is not necessary. The QtConcurrent::ReduceOptions enum provides a way to control the order in which the reduction is done. If QtConcurrent::UnorderedReduce is used (the default), the order is undefined, while QtConcurrent::OrderedReduce ensures that the reduction diff --git a/src/corelib/concurrent/qtconcurrentresultstore.cpp b/src/corelib/concurrent/qtconcurrentresultstore.cpp index ad4b2cf..65f3afa 100644 --- a/src/corelib/concurrent/qtconcurrentresultstore.cpp +++ b/src/corelib/concurrent/qtconcurrentresultstore.cpp @@ -236,7 +236,7 @@ int ResultStoreBase::count() const return resultCount; } -// returns the insert index, calling this funciton with +// returns the insert index, calling this function with // index equal to -1 returns the next available index. int ResultStoreBase::updateInsertIndex(int index, int _count) { diff --git a/src/corelib/corelib.pro b/src/corelib/corelib.pro index bbf445f..728bdf9 100644 --- a/src/corelib/corelib.pro +++ b/src/corelib/corelib.pro @@ -53,39 +53,9 @@ symbian: { DEPLOYMENT = partial_upgrade $$DEPLOYMENT } -mmx { - DEFINES += QT_HAVE_MMX -} -3dnow { - DEFINES += QT_HAVE_3DNOW -} -sse { - DEFINES += QT_HAVE_SSE - DEFINES += QT_HAVE_MMXEXT -} -sse2 { - DEFINES += QT_HAVE_SSE2 -} -sse3 { - DEFINES += QT_HAVE_SSE3 -} -ssse3 { - DEFINES += QT_HAVE_SSSE3 -} -sse4_1 { - DEFINES += QT_HAVE_SSE4_1 -} -sse4_2 { - DEFINES += QT_HAVE_SSE4_2 -} -avx { - DEFINES += QT_HAVE_AVX -} -iwmmxt { - DEFINES += QT_HAVE_IWMMXT -} neon { DEFINES += QT_HAVE_NEON QMAKE_CXXFLAGS *= -mfpu=neon } + diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index c956b85..af35316 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -1877,9 +1877,9 @@ QSysInfo::SymbianVersion QSysInfo::symbianVersion() case SV_S60_5_0: return SV_9_4; case SV_S60_5_1: - return SV_9_4; + return SV_SF_2; case SV_S60_5_2: - return SV_9_4; + return SV_SF_3; default: return SV_Unknown; } @@ -2374,7 +2374,7 @@ void qDebug(const char *msg, ...) This syntax inserts a space between each item, and appends a newline at the end. - To supress the output at runtime, install your own message handler + To suppress the output at runtime, install your own message handler with qInstallMsgHandler(). \sa qDebug(), qCritical(), qFatal(), qInstallMsgHandler(), @@ -2410,7 +2410,7 @@ void qWarning(const char *msg, ...) A space is inserted between the items, and a newline is appended at the end. - To supress the output at runtime, install your own message handler + To suppress the output at runtime, install your own message handler with qInstallMsgHandler(). \sa qDebug(), qWarning(), qFatal(), qInstallMsgHandler(), @@ -2475,7 +2475,7 @@ void qErrnoWarning(int code, const char *msg, ...) Example: \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 30 - To supress the output at runtime, install your own message handler + To suppress the output at runtime, install your own message handler with qInstallMsgHandler(). \sa qDebug(), qCritical(), qWarning(), qInstallMsgHandler(), @@ -2914,8 +2914,9 @@ int qrand() \relates <QtGlobal> You can use this macro to specify information about a custom type - \a Type. With accurate type information, Qt's \l{generic - containers} can choose appropriate storage methods and algorithms. + \a Type. With accurate type information, Qt's \l{Container Classes} + {generic containers} can choose appropriate storage methods and + algorithms. \a Flags can be one of the following: diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 909fe9d..0e0eecd 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -962,9 +962,11 @@ redefine to built-in booleans to make autotests work properly */ # undef QT_DEPRECATED_VARIABLE # undef QT_DEPRECATED_CONSTRUCTOR #elif defined(QT_DEPRECATED_WARNINGS) +# ifdef QT3_SUPPORT /* enable Qt3 support warnings as well */ -# undef QT3_SUPPORT_WARNINGS -# define QT3_SUPPORT_WARNINGS +# undef QT3_SUPPORT_WARNINGS +# define QT3_SUPPORT_WARNINGS +# endif # undef QT_DEPRECATED # define QT_DEPRECATED Q_DECL_DEPRECATED # undef QT_DEPRECATED_VARIABLE diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp index 3515777..ea7e2e4 100644 --- a/src/corelib/global/qlibraryinfo.cpp +++ b/src/corelib/global/qlibraryinfo.cpp @@ -476,7 +476,7 @@ QLibraryInfo::location(LibraryLocation loc) \value PrefixPath The default prefix for all paths. \value DocumentationPath The location for documentation upon install. \value HeadersPath The location for all headers. - \value LibrariesPath The location of installed librarires. + \value LibrariesPath The location of installed libraries. \value BinariesPath The location of installed Qt binaries (tools and applications). \value PluginsPath The location of installed Qt plugins. \value ImportsPath The location of installed QML extensions to import. diff --git a/src/corelib/io/qfileinfo.cpp b/src/corelib/io/qfileinfo.cpp index 37591c5..61f7180 100644 --- a/src/corelib/io/qfileinfo.cpp +++ b/src/corelib/io/qfileinfo.cpp @@ -797,12 +797,12 @@ QString QFileInfo::suffix() const \bold{Note:} The QDir returned always corresponds to the object's parent directory, even if the QFileInfo represents a directory. - For each of the follwing, dir() returns a QDir for + For each of the following, dir() returns a QDir for \c{"~/examples/191697"}. \snippet doc/src/snippets/fileinfo/main.cpp 0 - For each of the follwing, dir() returns a QDir for + For each of the following, dir() returns a QDir for \c{"."}. \snippet doc/src/snippets/fileinfo/main.cpp 1 diff --git a/src/corelib/io/qfilesystemwatcher_kqueue.cpp b/src/corelib/io/qfilesystemwatcher_kqueue.cpp index 99c165e..378ad20 100644 --- a/src/corelib/io/qfilesystemwatcher_kqueue.cpp +++ b/src/corelib/io/qfilesystemwatcher_kqueue.cpp @@ -295,12 +295,12 @@ void QKqueueFileSystemWatcherEngine::run() path = idToPath.value(id); if (path.isEmpty()) { DEBUG() << "QKqueueFileSystemWatcherEngine: received a kevent for a file we're not watching"; - continue; + goto process_next_event; } } if (kev.filter != EVFILT_VNODE) { DEBUG() << "QKqueueFileSystemWatcherEngine: received a kevent with the wrong filter"; - continue; + goto process_next_event; } if ((kev.fflags & (NOTE_DELETE | NOTE_REVOKE | NOTE_RENAME)) != 0) { @@ -337,6 +337,7 @@ void QKqueueFileSystemWatcherEngine::run() } // are there any more? +process_next_event: r = kevent(kqfd, 0, 0, &kev, 1, &ZeroTimeout); } while (r > 0); } diff --git a/src/corelib/io/qfsfileengine_win.cpp b/src/corelib/io/qfsfileengine_win.cpp index c80f9f1..84120b4 100644 --- a/src/corelib/io/qfsfileengine_win.cpp +++ b/src/corelib/io/qfsfileengine_win.cpp @@ -1984,6 +1984,10 @@ uchar *QFSFileEnginePrivate::map(qint64 offset, qint64 size, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + // Since this is a special case, we check if the return value was NULL and if so + // we change it to INVALID_HANDLE_VALUE to follow the logic inside this function. + if(0 == handle) + handle = INVALID_HANDLE_VALUE; #endif if (handle == INVALID_HANDLE_VALUE) { diff --git a/src/corelib/io/qtextstream.cpp b/src/corelib/io/qtextstream.cpp index b1c403f..eab0662 100644 --- a/src/corelib/io/qtextstream.cpp +++ b/src/corelib/io/qtextstream.cpp @@ -1991,7 +1991,7 @@ bool QTextStreamPrivate::getReal(double *f) return true; buf[i] = '\0'; - // backward-compatibility. Old implmentation supported +nan/-nan + // backward-compatibility. Old implementation supported +nan/-nan // for some reason. QLocale only checks for lower-case // nan/+inf/-inf, so here we also check for uppercase and mixed // case versions. diff --git a/src/corelib/kernel/qbasictimer.cpp b/src/corelib/kernel/qbasictimer.cpp index d176170..d595ac1 100644 --- a/src/corelib/kernel/qbasictimer.cpp +++ b/src/corelib/kernel/qbasictimer.cpp @@ -54,7 +54,8 @@ QT_BEGIN_NAMESPACE This is a fast, lightweight, and low-level class used by Qt internally. We recommend using the higher-level QTimer class rather than this class if you want to use timers in your - applications. + applications. Note that this timer is a repeating timer that + will send subsequent timer events unless the stop() function is called. To use this class, create a QBasicTimer, and call its start() function with a timeout interval and with a pointer to a QObject @@ -88,8 +89,8 @@ QT_BEGIN_NAMESPACE /*! \fn bool QBasicTimer::isActive() const - Returns true if the timer is running, has not yet timed - out, and has not been stopped; otherwise returns false. + Returns true if the timer is running and has not been stopped; otherwise + returns false. \sa start() stop() */ diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index aaa5878..ad645e3 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -2332,6 +2332,7 @@ void QCoreApplication::setLibraryPaths(const QStringList &paths) if (!coreappdata()->app_libpaths) coreappdata()->app_libpaths = new QStringList; *(coreappdata()->app_libpaths) = paths; + locker.unlock(); QFactoryLoader::refreshAll(); } @@ -2365,6 +2366,7 @@ void QCoreApplication::addLibraryPath(const QString &path) if (!canonicalPath.isEmpty() && !coreappdata()->app_libpaths->contains(canonicalPath)) { coreappdata()->app_libpaths->prepend(canonicalPath); + locker.unlock(); QFactoryLoader::refreshAll(); } } diff --git a/src/corelib/kernel/qeventdispatcher_symbian.cpp b/src/corelib/kernel/qeventdispatcher_symbian.cpp index 2a52044..1bad8ed 100644 --- a/src/corelib/kernel/qeventdispatcher_symbian.cpp +++ b/src/corelib/kernel/qeventdispatcher_symbian.cpp @@ -423,7 +423,7 @@ void QSelectThread::run() // ones that return -1 in select // after loop update notifiers for all of them - // as we dont have "exception" notifier type + // as we don't have "exception" notifier type // we should force monitoring fd_set of this // type as well diff --git a/src/corelib/kernel/qeventdispatcher_unix.cpp b/src/corelib/kernel/qeventdispatcher_unix.cpp index f7d45ac..9dadd82 100644 --- a/src/corelib/kernel/qeventdispatcher_unix.cpp +++ b/src/corelib/kernel/qeventdispatcher_unix.cpp @@ -331,7 +331,7 @@ QTimerInfoList::QTimerInfoList() } #endif - firstTimerInfo = currentTimerInfo = 0; + firstTimerInfo = 0; } timeval QTimerInfoList::updateCurrentTime() @@ -445,7 +445,7 @@ bool QTimerInfoList::timerWait(timeval &tm) // Find first waiting timer not already active QTimerInfo *t = 0; for (QTimerInfoList::const_iterator it = constBegin(); it != constEnd(); ++it) { - if (!(*it)->inTimerEvent) { + if (!(*it)->activateRef) { t = *it; break; } @@ -474,7 +474,7 @@ void QTimerInfoList::registerTimer(int timerId, int interval, QObject *object) t->interval.tv_usec = (interval % 1000) * 1000; t->timeout = updateCurrentTime() + t->interval; t->obj = object; - t->inTimerEvent = false; + t->activateRef = 0; timerInsert(t); } @@ -489,8 +489,8 @@ bool QTimerInfoList::unregisterTimer(int timerId) removeAt(i); if (t == firstTimerInfo) firstTimerInfo = 0; - if (t == currentTimerInfo) - currentTimerInfo = 0; + if (t->activateRef) + *(t->activateRef) = 0; // release the timer id if (!QObjectPrivate::get(t->obj)->inThreadChangeEvent) @@ -515,8 +515,8 @@ bool QTimerInfoList::unregisterTimers(QObject *object) removeAt(i); if (t == firstTimerInfo) firstTimerInfo = 0; - if (t == currentTimerInfo) - currentTimerInfo = 0; + if (t->activateRef) + *(t->activateRef) = 0; // release the timer id if (!QObjectPrivate::get(t->obj)->inThreadChangeEvent) @@ -552,10 +552,7 @@ int QTimerInfoList::activateTimers() bool firstTime = true; timeval currentTime; int n_act = 0, maxCount = count(); - - QTimerInfo *saveFirstTimerInfo = firstTimerInfo; - QTimerInfo *saveCurrentTimerInfo = currentTimerInfo; - firstTimerInfo = currentTimerInfo = 0; + firstTimerInfo = 0; while (maxCount--) { currentTime = updateCurrentTime(); @@ -567,7 +564,7 @@ int QTimerInfoList::activateTimers() if (isEmpty()) break; - currentTimerInfo = first(); + QTimerInfo *currentTimerInfo = first(); if (currentTime < currentTimerInfo->timeout) break; // no timer has expired @@ -594,21 +591,19 @@ int QTimerInfoList::activateTimers() if (currentTimerInfo->interval.tv_usec > 0 || currentTimerInfo->interval.tv_sec > 0) n_act++; - if (!currentTimerInfo->inTimerEvent) { + if (!currentTimerInfo->activateRef) { // send event, but don't allow it to recurse - currentTimerInfo->inTimerEvent = true; + currentTimerInfo->activateRef = ¤tTimerInfo; QTimerEvent e(currentTimerInfo->id); QCoreApplication::sendEvent(currentTimerInfo->obj, &e); if (currentTimerInfo) - currentTimerInfo->inTimerEvent = false; + currentTimerInfo->activateRef = 0; } } - firstTimerInfo = saveFirstTimerInfo; - currentTimerInfo = saveCurrentTimerInfo; - + firstTimerInfo = 0; return n_act; } diff --git a/src/corelib/kernel/qeventdispatcher_unix_p.h b/src/corelib/kernel/qeventdispatcher_unix_p.h index cbe58de..060a163 100644 --- a/src/corelib/kernel/qeventdispatcher_unix_p.h +++ b/src/corelib/kernel/qeventdispatcher_unix_p.h @@ -77,7 +77,7 @@ struct QTimerInfo { timeval interval; // - timer interval timeval timeout; // - when to sent event QObject *obj; // - object to receive event - bool inTimerEvent; + QTimerInfo **activateRef; // - ref from activateTimers }; class QTimerInfoList : public QList<QTimerInfo*> @@ -92,7 +92,7 @@ class QTimerInfoList : public QList<QTimerInfo*> #endif // state variables used by activateTimers() - QTimerInfo *firstTimerInfo, *currentTimerInfo; + QTimerInfo *firstTimerInfo; public: QTimerInfoList(); diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp index 2ccd0a5..a70772f 100644 --- a/src/corelib/kernel/qmetaobject.cpp +++ b/src/corelib/kernel/qmetaobject.cpp @@ -1009,8 +1009,11 @@ QByteArray QMetaObject::normalizedSignature(const char *method) int argdepth = 0; int templdepth = 0; while (*d) { - if (argdepth == 1) + if (argdepth == 1) { d = qNormalizeType(d, templdepth, result); + if (!*d) //most likely an invalid signature. + break; + } if (*d == '(') ++argdepth; if (*d == ')') diff --git a/src/corelib/kernel/qmetatype.cpp b/src/corelib/kernel/qmetatype.cpp index 6ebaaa3..fef02cf 100644 --- a/src/corelib/kernel/qmetatype.cpp +++ b/src/corelib/kernel/qmetatype.cpp @@ -1415,7 +1415,7 @@ void QMetaType::destroy(int type, void *data) \snippet doc/src/snippets/code/src_corelib_kernel_qmetatype.cpp 4 - This function is usefull to register typedefs so they can be used + This function is useful to register typedefs so they can be used by QMetaProperty, or in QueuedConnections \snippet doc/src/snippets/code/src_corelib_kernel_qmetatype.cpp 9 diff --git a/src/corelib/thread/qmutexpool.cpp b/src/corelib/thread/qmutexpool.cpp index d9abdc5..59211fb 100644 --- a/src/corelib/thread/qmutexpool.cpp +++ b/src/corelib/thread/qmutexpool.cpp @@ -46,7 +46,7 @@ QT_BEGIN_NAMESPACE -// qt_global_mutexpool is here for backwards compatability only, +// qt_global_mutexpool is here for backwards compatibility only, // use QMutexpool::instance() in new clode. Q_CORE_EXPORT QMutexPool *qt_global_mutexpool = 0; Q_GLOBAL_STATIC_WITH_ARGS(QMutexPool, globalMutexPool, (QMutex::Recursive)) diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp index a5cb16a..8d38e4c 100644 --- a/src/corelib/tools/qbytearray.cpp +++ b/src/corelib/tools/qbytearray.cpp @@ -1809,7 +1809,7 @@ QByteArray &QByteArray::replace(int pos, int len, const QByteArray &after) Replaces \a len bytes from index position \a pos with the zero terminated string \a after. - Notice: this can change the lenght of the byte array. + Notice: this can change the length of the byte array. */ QByteArray &QByteArray::replace(int pos, int len, const char *after) { diff --git a/src/corelib/tools/qbytearraymatcher.h b/src/corelib/tools/qbytearraymatcher.h index 8e7bc21..d3db4e9 100644 --- a/src/corelib/tools/qbytearraymatcher.h +++ b/src/corelib/tools/qbytearraymatcher.h @@ -78,7 +78,7 @@ private: QByteArrayMatcherPrivate *d; QByteArray q_pattern; #ifdef Q_CC_RVCT -// explicitely allow anonymous unions for RVCT to prevent compiler warnings +// explicitly allow anonymous unions for RVCT to prevent compiler warnings # pragma push # pragma anon_unions #endif diff --git a/src/corelib/tools/qeasingcurve.cpp b/src/corelib/tools/qeasingcurve.cpp index 1734b03..ee791e0 100644 --- a/src/corelib/tools/qeasingcurve.cpp +++ b/src/corelib/tools/qeasingcurve.cpp @@ -91,6 +91,16 @@ animation.setDuration(1000); animation.setEasingCurve(QEasingCurve::InOutQuad); \endcode + + The ability to set an amplitude, overshoot, or period depends on the QEasingCurve type. Amplitude access + is available to curves that behave as springs such as elastic and bounce curves. Changing the amplitude changes + the height of the curve. Period access is only available to elastic curves and setting a higher period slows + the rate of bounce. Only curves that have "boomerang" behaviors such as the InBack, OutBack, InOutBack, and OutInBack + have overshoot settings. These curves will interpolate beyond the end points and return to the end point, + acting similar to a boomerang. + + The \l{Easing Curves Example} contains samples of QEasingCurve types and lets you change the curve settings. + */ /*! @@ -140,15 +150,15 @@ accelerating from zero velocity. \value OutQuart \inlineimage qeasingcurve-outquart.png \br - Easing curve for a cubic (t^4) function: + Easing curve for a quartic (t^4) function: decelerating to zero velocity. \value InOutQuart \inlineimage qeasingcurve-inoutquart.png \br - Easing curve for a cubic (t^4) function: + Easing curve for a quartic (t^4) function: acceleration until halfway, then deceleration. \value OutInQuart \inlineimage qeasingcurve-outinquart.png \br - Easing curve for a cubic (t^4) function: + Easing curve for a quartic (t^4) function: deceleration until halfway, then acceleration. \value InQuint \inlineimage qeasingcurve-inquint.png \br @@ -156,15 +166,15 @@ in: accelerating from zero velocity. \value OutQuint \inlineimage qeasingcurve-outquint.png \br - Easing curve for a cubic (t^5) function: + Easing curve for a quintic (t^5) function: decelerating to zero velocity. \value InOutQuint \inlineimage qeasingcurve-inoutquint.png \br - Easing curve for a cubic (t^5) function: + Easing curve for a quintic (t^5) function: acceleration until halfway, then deceleration. \value OutInQuint \inlineimage qeasingcurve-outinquint.png \br - Easing curve for a cubic (t^5) function: + Easing curve for a quintic (t^5) function: deceleration until halfway, then acceleration. \value InSine \inlineimage qeasingcurve-insine.png \br diff --git a/src/corelib/tools/qpair.qdoc b/src/corelib/tools/qpair.qdoc index e60243f..d49c09e 100644 --- a/src/corelib/tools/qpair.qdoc +++ b/src/corelib/tools/qpair.qdoc @@ -35,7 +35,7 @@ pair type is not available. It stores one value of type T1 and one value of type T2. It can be used as a return value for a function that needs to return two values, or as the value type of - a \l{generic container}. + a \l{Container classes}{generic container}. Here's an example of a QPair that stores one QString and one \c double value: @@ -53,7 +53,7 @@ requirements; these requirements are documented on a per-function basis. - \sa {Generic Containers} + \sa {Container Classes} */ /*! \typedef QPair::first_type diff --git a/src/corelib/tools/qsharedpointer.cpp b/src/corelib/tools/qsharedpointer.cpp index bad2897..8f9559a 100644 --- a/src/corelib/tools/qsharedpointer.cpp +++ b/src/corelib/tools/qsharedpointer.cpp @@ -67,8 +67,8 @@ QSharedPointer and QWeakPointer are thread-safe and operate atomically on the pointer value. Different threads can also access - the same QSharedPointer or QWeakPointer object at the same time - without need for locking mechanisms. + the QSharedPointer or QWeakPointer pointing to the same object at + the same time without need for locking mechanisms. It should be noted that, while the pointer value can be accessed in this manner, QSharedPointer and QWeakPointer provide no @@ -482,7 +482,7 @@ becomes managed by this QSharedPointer and must not be passed to another QSharedPointer object or deleted outside this object. - The \a deleter paramter specifies the custom deleter for this + The \a deleter parameter specifies the custom deleter for this object. The custom deleter is called when the strong reference count drops to 0 instead of the operator delete(). This is useful, for instance, for calling deleteLater() in a QObject instead: diff --git a/src/corelib/tools/qsimd_p.h b/src/corelib/tools/qsimd_p.h index 5ff0f97..a3148fb 100644 --- a/src/corelib/tools/qsimd_p.h +++ b/src/corelib/tools/qsimd_p.h @@ -150,7 +150,9 @@ enum CPUFeatures { Q_CORE_EXPORT uint qDetectCPUFeatures(); -Q_CORE_EXPORT uint qDetectCPUFeatures(); + +#define ALIGNMENT_PROLOGUE_16BYTES(ptr, i, length) \ + for (; i < static_cast<int>(qMin(static_cast<quintptr>(length), ((4 - ((reinterpret_cast<quintptr>(ptr) >> 2) & 0x3)) & 0x3))); ++i) QT_END_NAMESPACE diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index 3371b36..7bc9ca1 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -6666,8 +6666,9 @@ QString QString::arg(qlonglong a, int fieldWidth, int base, const QChar &fillCha QString locale_arg; if (d.locale_occurrences > 0) { QLocale locale; - locale_arg = locale.d()->longLongToString(a, -1, base, fieldWidth, - flags | QLocalePrivate::ThousandsGroup); + if (!locale.numberOptions() & QLocale::OmitGroupSeparator) + flags |= QLocalePrivate::ThousandsGroup; + locale_arg = locale.d()->longLongToString(a, -1, base, fieldWidth, flags); } return replaceArgEscapes(*this, d, fieldWidth, arg, locale_arg, fillChar); @@ -6709,8 +6710,9 @@ QString QString::arg(qulonglong a, int fieldWidth, int base, const QChar &fillCh QString locale_arg; if (d.locale_occurrences > 0) { QLocale locale; - locale_arg = locale.d()->unsLongLongToString(a, -1, base, fieldWidth, - flags | QLocalePrivate::ThousandsGroup); + if (!locale.numberOptions() & QLocale::OmitGroupSeparator) + flags |= QLocalePrivate::ThousandsGroup; + locale_arg = locale.d()->unsLongLongToString(a, -1, base, fieldWidth, flags); } return replaceArgEscapes(*this, d, fieldWidth, arg, locale_arg, fillChar); @@ -6843,7 +6845,8 @@ QString QString::arg(double a, int fieldWidth, char fmt, int prec, const QChar & if (d.locale_occurrences > 0) { QLocale locale; - flags |= QLocalePrivate::ThousandsGroup; + if (!locale.numberOptions() & QLocale::OmitGroupSeparator) + flags |= QLocalePrivate::ThousandsGroup; locale_arg = locale.d()->doubleToString(a, prec, form, fieldWidth, flags); } diff --git a/src/corelib/tools/qstringmatcher.h b/src/corelib/tools/qstringmatcher.h index 1aafcb8..451aeb6 100644 --- a/src/corelib/tools/qstringmatcher.h +++ b/src/corelib/tools/qstringmatcher.h @@ -78,7 +78,7 @@ private: QString q_pattern; Qt::CaseSensitivity q_cs; #ifdef Q_CC_RVCT -// explicitely allow anonymous unions for RVCT to prevent compiler warnings +// explicitly allow anonymous unions for RVCT to prevent compiler warnings # pragma push # pragma anon_unions #endif diff --git a/src/corelib/tools/qtextboundaryfinder.cpp b/src/corelib/tools/qtextboundaryfinder.cpp index bcddcb2..0428782 100644 --- a/src/corelib/tools/qtextboundaryfinder.cpp +++ b/src/corelib/tools/qtextboundaryfinder.cpp @@ -244,7 +244,7 @@ QTextBoundaryFinder::QTextBoundaryFinder(BoundaryType type, const QString &strin data required, it will use this instead of allocating its own buffer. \warning QTextBoundaryFinder does not create a copy of \a chars. It is the - application programmer's responsability to ensure the array is allocated for + application programmer's responsibility to ensure the array is allocated for as long as the QTextBoundaryFinder object stays alive. The same applies to \a buffer. */ diff --git a/src/corelib/xml/qxmlstream.cpp b/src/corelib/xml/qxmlstream.cpp index 853f311..91c3a19 100644 --- a/src/corelib/xml/qxmlstream.cpp +++ b/src/corelib/xml/qxmlstream.cpp @@ -1523,7 +1523,7 @@ ushort QXmlStreamReaderPrivate::getChar_helper() decoder = codec->makeDecoder(); } - decoder->toUnicode(&readBuffer, rawReadBuffer.data(), nbytesread); + decoder->toUnicode(&readBuffer, rawReadBuffer.constData(), nbytesread); if(lockEncoding && decoder->hasFailure()) { raiseWellFormedError(QXmlStream::tr("Encountered incorrectly encoded content.")); diff --git a/src/dbus/qdbusargument.cpp b/src/dbus/qdbusargument.cpp index fbbc6a2..0bde085 100644 --- a/src/dbus/qdbusargument.cpp +++ b/src/dbus/qdbusargument.cpp @@ -825,7 +825,7 @@ void QDBusArgument::endStructure() \snippet doc/src/snippets/code/src_qdbus_qdbusargument.cpp 6 If the type you want to marshall is a QList, QVector or any of the - Qt's \l {Generic Containers} that take one template parameter, + Qt's \l {Container Classes} that take one template parameter, you need not declare an \c{operator<<} function for it, since QtDBus provides generic templates to do the job of marshalling the data. The same applies for STL's sequence containers, such @@ -952,7 +952,7 @@ void QDBusArgument::endStructure() const \snippet doc/src/snippets/code/src_qdbus_qdbusargument.cpp 9 If the type you want to demarshall is a QList, QVector or any of the - Qt's \l {Generic Containers} that take one template parameter, you + Qt's \l {Container Classes} that take one template parameter, you need not declare an \c{operator>>} function for it, since QtDBus provides generic templates to do the job of demarshalling the data. The same applies for STL's sequence containers, such as \c {std::list}, diff --git a/src/dbus/qdbusconnection.cpp b/src/dbus/qdbusconnection.cpp index 6f86856..bf771a8 100644 --- a/src/dbus/qdbusconnection.cpp +++ b/src/dbus/qdbusconnection.cpp @@ -173,6 +173,9 @@ void QDBusConnectionManager::setConnection(const QString &name, QDBusConnectionP The connection is then torn down using the disconnectFromBus() function. + Once disconnected, calling connectToBus() will not reestablish a + connection, you must create a new QDBusConnection instance. + As a convenience for the two most common connection types, the sessionBus() and systemBus() functions return open connections to the session server daemon and the system server daemon, @@ -209,6 +212,7 @@ void QDBusConnectionManager::setConnection(const QString &name, QDBusConnectionP \value ExportScriptableSlots export this object's scriptable slots \value ExportScriptableSignals export this object's scriptable signals \value ExportScriptableProperties export this object's scriptable properties + \value ExportScriptableInvokables export this object's scriptable invokables \value ExportScriptableContents shorthand form for ExportScriptableSlots | ExportScriptableSignals | ExportScriptableProperties @@ -216,6 +220,7 @@ void QDBusConnectionManager::setConnection(const QString &name, QDBusConnectionP \value ExportNonScriptableSlots export this object's non-scriptable slots \value ExportNonScriptableSignals export this object's non-scriptable signals \value ExportNonScriptableProperties export this object's non-scriptable properties + \value ExportNonScriptableInvokables export this object's non-scriptable invokables \value ExportNonScriptableContents shorthand form for ExportNonScriptableSlots | ExportNonScriptableSignals | ExportNonScriptableProperties @@ -223,8 +228,8 @@ void QDBusConnectionManager::setConnection(const QString &name, QDBusConnectionP \value ExportAllSlots export all of this object's slots \value ExportAllSignals export all of this object's signals \value ExportAllProperties export all of this object's properties + \value ExportAllInvokables export all of this object's invokables \value ExportAllContents export all of this object's contents - \value ExportChildObjects export this object's child objects \sa registerObject(), QDBusAbstractAdaptor, {usingadaptors.html}{Using adaptors} @@ -853,10 +858,6 @@ QDBusConnectionInterface *QDBusConnection::interface() const /*! Returns true if this QDBusConnection object is connected. - - If it isn't connected, calling connectToBus() on the same - connection name will not make be connected. You need to call the - QDBusConnection constructor again. */ bool QDBusConnection::isConnected() const { @@ -916,7 +917,7 @@ QString QDBusConnection::name() const /*! Attempts to register the \a serviceName on the D-Bus server and - returns true if the registration succeded. The registration will + returns true if the registration succeeded. The registration will fail if the name is already registered by another application. \sa unregisterService(), QDBusConnectionInterface::registerService() diff --git a/src/dbus/qdbusserver.cpp b/src/dbus/qdbusserver.cpp index 2377795..6a4553c 100644 --- a/src/dbus/qdbusserver.cpp +++ b/src/dbus/qdbusserver.cpp @@ -100,7 +100,7 @@ QDBusError QDBusServer::lastError() const } /*! - Returns the address this server is assosiated with. + Returns the address this server is associated with. */ QString QDBusServer::address() const { diff --git a/src/declarative/debugger/qpacketprotocol.cpp b/src/declarative/debugger/qpacketprotocol.cpp index 6241922..c2f7709 100644 --- a/src/declarative/debugger/qpacketprotocol.cpp +++ b/src/declarative/debugger/qpacketprotocol.cpp @@ -125,7 +125,7 @@ public: QObject::connect(this, SIGNAL(invalidPacket()), parent, SIGNAL(invalidPacket())); QObject::connect(dev, SIGNAL(readyRead()), - this, SLOT(readyToRead())); + this, SLOT(readyToRead()), Qt::QueuedConnection); QObject::connect(dev, SIGNAL(aboutToClose()), this, SLOT(aboutToClose())); QObject::connect(dev, SIGNAL(bytesWritten(qint64)), @@ -422,7 +422,7 @@ QPacket::~QPacket() /*! Creates a copy of \a other. The initial stream positions are shared, but the - two packets are otherwise independant. + two packets are otherwise independent. */ QPacket::QPacket(const QPacket & other) : QDataStream(), b(other.b), buf(0) diff --git a/src/declarative/graphicsitems/qdeclarativeflickable.cpp b/src/declarative/graphicsitems/qdeclarativeflickable.cpp index 03ba740..61b4dcd 100644 --- a/src/declarative/graphicsitems/qdeclarativeflickable.cpp +++ b/src/declarative/graphicsitems/qdeclarativeflickable.cpp @@ -681,12 +681,15 @@ void QDeclarativeFlickablePrivate::handleMouseMoveEvent(QGraphicsSceneMouseEvent if (newY < maxY && maxY - minY <= 0) newY = maxY + (newY - maxY) / 2; if (boundsBehavior == QDeclarativeFlickable::StopAtBounds && (newY > minY || newY < maxY)) { - if (newY > minY) - newY = minY; - else if (newY < maxY) + rejectY = true; + if (newY < maxY) { newY = maxY; - else - rejectY = true; + rejectY = false; + } + if (newY > minY) { + newY = minY; + rejectY = false; + } } if (!rejectY && stealMouse) { vData.move.setValue(qRound(newY)); @@ -708,12 +711,15 @@ void QDeclarativeFlickablePrivate::handleMouseMoveEvent(QGraphicsSceneMouseEvent if (newX < maxX && maxX - minX <= 0) newX = maxX + (newX - maxX) / 2; if (boundsBehavior == QDeclarativeFlickable::StopAtBounds && (newX > minX || newX < maxX)) { - if (newX > minX) - newX = minX; - else if (newX < maxX) + rejectX = true; + if (newX < maxX) { newX = maxX; - else - rejectX = true; + rejectX = false; + } + if (newX > minX) { + newX = minX; + rejectX = false; + } } if (!rejectX && stealMouse) { hData.move.setValue(qRound(newX)); @@ -1466,21 +1472,23 @@ void QDeclarativeFlickable::movementEnding() if (!d->flickingHorizontally) emit flickEnded(); } - if (d->movingHorizontally) { - d->movingHorizontally = false; - d->hMoved = false; - emit movingChanged(); - emit movingHorizontallyChanged(); - if (!d->movingVertically) - emit movementEnded(); - } - if (d->movingVertically) { - d->movingVertically = false; - d->vMoved = false; - emit movingChanged(); - emit movingVerticallyChanged(); - if (!d->movingHorizontally) - emit movementEnded(); + if (!d->pressed && !d->stealMouse) { + if (d->movingHorizontally) { + d->movingHorizontally = false; + d->hMoved = false; + emit movingChanged(); + emit movingHorizontallyChanged(); + if (!d->movingVertically) + emit movementEnded(); + } + if (d->movingVertically) { + d->movingVertically = false; + d->vMoved = false; + emit movingChanged(); + emit movingVerticallyChanged(); + if (!d->movingHorizontally) + emit movementEnded(); + } } d->hData.smoothVelocity.setValue(0); d->vData.smoothVelocity.setValue(0); diff --git a/src/declarative/graphicsitems/qdeclarativeflipable.cpp b/src/declarative/graphicsitems/qdeclarativeflipable.cpp index 8c9d2dd..b266273 100644 --- a/src/declarative/graphicsitems/qdeclarativeflipable.cpp +++ b/src/declarative/graphicsitems/qdeclarativeflipable.cpp @@ -83,10 +83,16 @@ public: \image flipable.gif - The \l Rotation element is used to specify the angle and axis of the flip, - and the \l State defines the changes in angle which produce the flipping - effect. Finally, the \l Transition creates the animation that changes the - angle over one second. + The \l Rotation element is used to specify the angle and axis of the flip. + When \c flipped is \c true, the item changes to the "back" state, where + the angle is changed to 180 degrees to produce the flipping effect. + Finally, the \l Transition creates the animation that changes the + angle over one second: when the item changes between its "back" and + default states, the NumberAnimation animates the angle between + its old and new values. + + See the \l {QML States} and \l {QML Animation} documentation for more + details on state changes and how animations work within transitions. \sa {declarative/ui-components/flipable}{Flipable example} */ diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp index 89b3958..68a4c64 100644 --- a/src/declarative/graphicsitems/qdeclarativegridview.cpp +++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp @@ -1085,13 +1085,15 @@ void QDeclarativeGridViewPrivate::flick(AxisData &data, qreal minExtent, qreal m \c portrait data directly. An improved grid view is shown below. The delegate is visually improved and is moved - into a separate \c contactDelegate component. Also, the currently selected item is highlighted - with a blue \l Rectangle using the \l highlight property, and \c focus is set to \c true - to enable keyboard navigation for the grid view. + into a separate \c contactDelegate component. \snippet doc/src/snippets/declarative/gridview/gridview.qml classdocs advanced \image gridview-highlight.png + The currently selected item is highlighted with a blue \l Rectangle using the \l highlight property, + and \c focus is set to \c true to enable keyboard navigation for the grid view. + The grid view itself is a focus scope (see \l{qmlfocus#Acquiring Focus and Focus Scopes}{the focus documentation page} for more details). + Delegates are instantiated as needed and may be destroyed at any time. State should \e never be stored in a delegate. @@ -1276,6 +1278,11 @@ void QDeclarativeGridView::setDelegate(QDeclarativeComponent *delegate) if (QDeclarativeVisualDataModel *dataModel = qobject_cast<QDeclarativeVisualDataModel*>(d->model)) { dataModel->setDelegate(delegate); if (isComponentComplete()) { + for (int i = 0; i < d->visibleItems.count(); ++i) + d->releaseItem(d->visibleItems.at(i)); + d->visibleItems.clear(); + d->releaseItem(d->currentItem); + d->currentItem = 0; refill(); d->moveReason = QDeclarativeGridViewPrivate::SetIndex; d->updateCurrent(d->currentIndex); diff --git a/src/declarative/graphicsitems/qdeclarativeitem.cpp b/src/declarative/graphicsitems/qdeclarativeitem.cpp index 83f9b20..cc7c673 100644 --- a/src/declarative/graphicsitems/qdeclarativeitem.cpp +++ b/src/declarative/graphicsitems/qdeclarativeitem.cpp @@ -423,7 +423,7 @@ void QDeclarativeItemKeyFilter::componentComplete() \brief The KeyNavigation attached property supports key navigation by arrow keys. It is common in key-based UIs to use arrow keys to navigate - between focussed items. The KeyNavigation property provides a + between focused items. The KeyNavigation property provides a convenient way of specifying which item will gain focus when an arrow key is pressed. The following example provides key navigation for a 2x2 grid of items. @@ -511,8 +511,10 @@ QDeclarativeItem *QDeclarativeKeyNavigationAttached::left() const void QDeclarativeKeyNavigationAttached::setLeft(QDeclarativeItem *i) { Q_D(QDeclarativeKeyNavigationAttached); + if (d->left == i) + return; d->left = i; - emit changed(); + emit leftChanged(); } QDeclarativeItem *QDeclarativeKeyNavigationAttached::right() const @@ -524,8 +526,10 @@ QDeclarativeItem *QDeclarativeKeyNavigationAttached::right() const void QDeclarativeKeyNavigationAttached::setRight(QDeclarativeItem *i) { Q_D(QDeclarativeKeyNavigationAttached); + if (d->right == i) + return; d->right = i; - emit changed(); + emit rightChanged(); } QDeclarativeItem *QDeclarativeKeyNavigationAttached::up() const @@ -537,8 +541,10 @@ QDeclarativeItem *QDeclarativeKeyNavigationAttached::up() const void QDeclarativeKeyNavigationAttached::setUp(QDeclarativeItem *i) { Q_D(QDeclarativeKeyNavigationAttached); + if (d->up == i) + return; d->up = i; - emit changed(); + emit upChanged(); } QDeclarativeItem *QDeclarativeKeyNavigationAttached::down() const @@ -550,8 +556,10 @@ QDeclarativeItem *QDeclarativeKeyNavigationAttached::down() const void QDeclarativeKeyNavigationAttached::setDown(QDeclarativeItem *i) { Q_D(QDeclarativeKeyNavigationAttached); + if (d->down == i) + return; d->down = i; - emit changed(); + emit downChanged(); } QDeclarativeItem *QDeclarativeKeyNavigationAttached::tab() const @@ -563,8 +571,10 @@ QDeclarativeItem *QDeclarativeKeyNavigationAttached::tab() const void QDeclarativeKeyNavigationAttached::setTab(QDeclarativeItem *i) { Q_D(QDeclarativeKeyNavigationAttached); + if (d->tab == i) + return; d->tab = i; - emit changed(); + emit tabChanged(); } QDeclarativeItem *QDeclarativeKeyNavigationAttached::backtab() const @@ -576,8 +586,10 @@ QDeclarativeItem *QDeclarativeKeyNavigationAttached::backtab() const void QDeclarativeKeyNavigationAttached::setBacktab(QDeclarativeItem *i) { Q_D(QDeclarativeKeyNavigationAttached); + if (d->backtab == i) + return; d->backtab = i; - emit changed(); + emit backtabChanged(); } /*! @@ -1420,11 +1432,6 @@ QDeclarativeKeysAttached *QDeclarativeKeysAttached::qmlAttachedProperties(QObjec */ /*! - \fn void QDeclarativeItem::childrenChanged() - \internal -*/ - -/*! \fn void QDeclarativeItem::focusChanged(bool) \internal */ @@ -2399,18 +2406,7 @@ void QDeclarativeItemPrivate::focusChanged(bool flag) Q_Q(QDeclarativeItem); if (!(flags & QGraphicsItem::ItemIsFocusScope) && parent) emit q->activeFocusChanged(flag); //see also QDeclarativeItemPrivate::subFocusItemChange() - - bool inScope = false; - QGraphicsItem *p = parent; - while (p) { - if (p->flags() & QGraphicsItem::ItemIsFocusScope) { - inScope = true; - break; - } - p = p->parentItem(); - } - if (!inScope) - emit q->focusChanged(flag); + emit q->focusChanged(flag); } /*! \internal */ @@ -2458,7 +2454,7 @@ QDeclarativeListProperty<QDeclarativeState> QDeclarativeItemPrivate::states() } \endqml - \sa {state-transitions}{Transitions} + \sa {qdeclarativeanimation.html#transitions}{QML Transitions} */ @@ -2482,7 +2478,7 @@ QDeclarativeListProperty<QDeclarativeTransition> QDeclarativeItemPrivate::transi Item { filter: [ Blur { ... }, - Relection { ... } + Reflection { ... } ... ] } @@ -2504,7 +2500,9 @@ QDeclarativeListProperty<QDeclarativeTransition> QDeclarativeItemPrivate::transi This property holds whether clipping is enabled. if clipping is enabled, an item will clip its own painting, as well - as the painting of its children, to its bounding rectangle. + as the painting of its children, to its bounding rectangle. If you set + clipping during an item's paint operation, remember to re-set it to + prevent clipping the rest of your scene. Non-rectangular clipping regions are not supported for performance reasons. */ @@ -2728,12 +2726,12 @@ QVariant QDeclarativeItem::itemChange(GraphicsItemChange change, } break; case ItemChildAddedChange: - if (d->_contents) + if (d->_contents && d->componentComplete) d->_contents->childAdded(qobject_cast<QDeclarativeItem*>( value.value<QGraphicsItem*>())); break; case ItemChildRemovedChange: - if (d->_contents) + if (d->_contents && d->componentComplete) d->_contents->childRemoved(qobject_cast<QDeclarativeItem*>( value.value<QGraphicsItem*>())); break; @@ -2843,6 +2841,41 @@ void QDeclarativeItem::setSmooth(bool smooth) } /*! + \property QDeclarativeItem::anchors + \internal +*/ + +/*! + \property QDeclarativeItem::left + \internal +*/ + +/*! + \property QDeclarativeItem::right + \internal +*/ + +/*! + \property QDeclarativeItem::horizontalCenter + \internal +*/ + +/*! + \property QDeclarativeItem::top + \internal +*/ + +/*! + \property QDeclarativeItem::bottom + \internal +*/ + +/*! + \property QDeclarativeItem::verticalCenter + \internal +*/ + +/*! \property QDeclarativeItem::focus \internal */ @@ -2863,6 +2896,41 @@ void QDeclarativeItem::setSmooth(bool smooth) */ /*! + \property QDeclarativeItem::baseline + \internal +*/ + +/*! + \property QDeclarativeItem::data + \internal +*/ + +/*! + \property QDeclarativeItem::resources + \internal +*/ + +/*! + \property QDeclarativeItem::state + \internal +*/ + +/*! + \property QDeclarativeItem::states + \internal +*/ + +/*! + \property QDeclarativeItem::transformOriginPoint + \internal +*/ + +/*! + \property QDeclarativeItem::transitions + \internal +*/ + +/*! \internal Return the width of the item */ @@ -3130,8 +3198,7 @@ bool QDeclarativeItem::hasActiveFocus() const { Q_D(const QDeclarativeItem); return focusItem() == this || - (d->flags & QGraphicsItem::ItemIsFocusScope && focusItem() != 0) || - (!parentItem() && focusItem() != 0); + (d->flags & QGraphicsItem::ItemIsFocusScope && focusItem() != 0); } /*! @@ -3151,10 +3218,8 @@ bool QDeclarativeItem::hasActiveFocus() const } \endqml - For the purposes of this property, the top level item in the scene - is assumed to act like a focus scope, and to always have active focus - when the scene has focus. On a practical level, that means the following - QML will give active focus to \c input on startup. + For the purposes of this property, the scene as a whole is assumed to act like a focus scope. + On a practical level, that means the following QML will give active focus to \c input on startup. \qml Rectangle { @@ -3180,7 +3245,7 @@ bool QDeclarativeItem::hasFocus() const p = p->parentItem(); } - return hasActiveFocus() ? true : (!QGraphicsItem::parentItem() ? true : false); + return hasActiveFocus(); } /*! \internal */ diff --git a/src/declarative/graphicsitems/qdeclarativeitem_p.h b/src/declarative/graphicsitems/qdeclarativeitem_p.h index 8c3e084..fffb4f7 100644 --- a/src/declarative/graphicsitems/qdeclarativeitem_p.h +++ b/src/declarative/graphicsitems/qdeclarativeitem_p.h @@ -363,12 +363,12 @@ class QDeclarativeKeyNavigationAttached : public QObject, public QDeclarativeIte Q_OBJECT Q_DECLARE_PRIVATE(QDeclarativeKeyNavigationAttached) - Q_PROPERTY(QDeclarativeItem *left READ left WRITE setLeft NOTIFY changed) - Q_PROPERTY(QDeclarativeItem *right READ right WRITE setRight NOTIFY changed) - Q_PROPERTY(QDeclarativeItem *up READ up WRITE setUp NOTIFY changed) - Q_PROPERTY(QDeclarativeItem *down READ down WRITE setDown NOTIFY changed) - Q_PROPERTY(QDeclarativeItem *tab READ tab WRITE setTab NOTIFY changed) - Q_PROPERTY(QDeclarativeItem *backtab READ backtab WRITE setBacktab NOTIFY changed) + Q_PROPERTY(QDeclarativeItem *left READ left WRITE setLeft NOTIFY leftChanged) + Q_PROPERTY(QDeclarativeItem *right READ right WRITE setRight NOTIFY rightChanged) + Q_PROPERTY(QDeclarativeItem *up READ up WRITE setUp NOTIFY upChanged) + Q_PROPERTY(QDeclarativeItem *down READ down WRITE setDown NOTIFY downChanged) + Q_PROPERTY(QDeclarativeItem *tab READ tab WRITE setTab NOTIFY tabChanged) + Q_PROPERTY(QDeclarativeItem *backtab READ backtab WRITE setBacktab NOTIFY backtabChanged) Q_PROPERTY(Priority priority READ priority WRITE setPriority NOTIFY priorityChanged) Q_ENUMS(Priority) @@ -396,7 +396,12 @@ public: static QDeclarativeKeyNavigationAttached *qmlAttachedProperties(QObject *); Q_SIGNALS: - void changed(); + void leftChanged(); + void rightChanged(); + void upChanged(); + void downChanged(); + void tabChanged(); + void backtabChanged(); void priorityChanged(); private: diff --git a/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp b/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp index 5d623dc..783eff1 100644 --- a/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp +++ b/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp @@ -142,7 +142,9 @@ void QDeclarativeItemModule::defineModule() qmlRegisterType<QGraphicsScale>("Qt",4,7,"Scale"); qmlRegisterType<QDeclarativeText>("Qt",4,7,"Text"); qmlRegisterType<QDeclarativeTextEdit>("Qt",4,7,"TextEdit"); +#ifndef QT_NO_LINEEDIT qmlRegisterType<QDeclarativeTextInput>("Qt",4,7,"TextInput"); +#endif qmlRegisterType<QDeclarativeViewSection>("Qt",4,7,"ViewSection"); qmlRegisterType<QDeclarativeVisualDataModel>("Qt",4,7,"VisualDataModel"); qmlRegisterType<QDeclarativeVisualItemModel>("Qt",4,7,"VisualItemModel"); diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp index 8b616ce..e1dd1c0 100644 --- a/src/declarative/graphicsitems/qdeclarativelistview.cpp +++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp @@ -60,7 +60,7 @@ void QDeclarativeViewSection::setProperty(const QString &property) { if (property != m_property) { m_property = property; - emit changed(); + emit propertyChanged(); } } @@ -68,7 +68,7 @@ void QDeclarativeViewSection::setCriteria(QDeclarativeViewSection::SectionCriter { if (criteria != m_criteria) { m_criteria = criteria; - emit changed(); + emit criteriaChanged(); } } @@ -575,9 +575,11 @@ FxListItem *QDeclarativeListViewPrivate::createItem(int modelIndex) listItem->attached->m_prevSection = item->attached->section(); else listItem->attached->m_prevSection = sectionAt(modelIndex-1); + } + if (modelIndex < model->count()-1) { if (FxListItem *item = visibleItem(modelIndex+1)) listItem->attached->m_nextSection = item->attached->section(); - else if (modelIndex < model->count()-1) + else listItem->attached->m_nextSection = sectionAt(modelIndex+1); } } @@ -1019,7 +1021,7 @@ void QDeclarativeListViewPrivate::updateCurrent(int modelIndex) if (oldCurrentItem && (!currentItem || oldCurrentItem->item != currentItem->item)) oldCurrentItem->attached->setIsCurrentItem(false); if (currentItem) { - if (modelIndex == visibleIndex - 1) { + if (modelIndex == visibleIndex - 1 && visibleItems.count()) { // We can calculate exact postion in this case currentItem->setPosition(visibleItems.first()->position() - currentItem->size() - spacing); } else { @@ -1385,14 +1387,16 @@ void QDeclarativeListViewPrivate::flick(AxisData &data, qreal minExtent, qreal m the delegate is able to access the model's \c name and \c number data directly. An improved list view is shown below. The delegate is visually improved and is moved - into a separate \c contactDelegate component. Also, the currently selected item is highlighted - with a blue \l Rectangle using the \l highlight property, and \c focus is set to \c true - to enable keyboard navigation for the list view. + into a separate \c contactDelegate component. \snippet doc/src/snippets/declarative/listview/listview.qml classdocs advanced \image listview-highlight.png - In a GridView, delegates are instantiated as needed and may be destroyed at any time. + The currently selected item is highlighted with a blue \l Rectangle using the \l highlight property, + and \c focus is set to \c true to enable keyboard navigation for the list view. + The list view itself is a focus scope (see \l{qmlfocus#Acquiring Focus and Focus Scopes}{the focus documentation page} for more details). + + Delegates are instantiated as needed and may be destroyed at any time. State should \e never be stored in a delegate. \note Views do not enable \e clip automatically. If the view @@ -1616,6 +1620,8 @@ void QDeclarativeListView::setDelegate(QDeclarativeComponent *delegate) for (int i = 0; i < d->visibleItems.count(); ++i) d->releaseItem(d->visibleItems.at(i)); d->visibleItems.clear(); + d->releaseItem(d->currentItem); + d->currentItem = 0; refill(); d->moveReason = QDeclarativeListViewPrivate::SetIndex; d->updateCurrent(d->currentIndex); diff --git a/src/declarative/graphicsitems/qdeclarativelistview_p.h b/src/declarative/graphicsitems/qdeclarativelistview_p.h index 9941040..b264861 100644 --- a/src/declarative/graphicsitems/qdeclarativelistview_p.h +++ b/src/declarative/graphicsitems/qdeclarativelistview_p.h @@ -53,8 +53,8 @@ QT_MODULE(Declarative) class Q_AUTOTEST_EXPORT QDeclarativeViewSection : public QObject { Q_OBJECT - Q_PROPERTY(QString property READ property WRITE setProperty NOTIFY changed) - Q_PROPERTY(SectionCriteria criteria READ criteria WRITE setCriteria NOTIFY changed) + Q_PROPERTY(QString property READ property WRITE setProperty NOTIFY propertyChanged) + Q_PROPERTY(SectionCriteria criteria READ criteria WRITE setCriteria NOTIFY criteriaChanged) Q_PROPERTY(QDeclarativeComponent *delegate READ delegate WRITE setDelegate NOTIFY delegateChanged) Q_ENUMS(SectionCriteria) public: @@ -73,7 +73,8 @@ public: QString sectionString(const QString &value); Q_SIGNALS: - void changed(); + void propertyChanged(); + void criteriaChanged(); void delegateChanged(); private: diff --git a/src/declarative/graphicsitems/qdeclarativeloader.cpp b/src/declarative/graphicsitems/qdeclarativeloader.cpp index cc7f8e5..d28181e 100644 --- a/src/declarative/graphicsitems/qdeclarativeloader.cpp +++ b/src/declarative/graphicsitems/qdeclarativeloader.cpp @@ -159,6 +159,9 @@ void QDeclarativeLoaderPrivate::initResize() unloads "Page1.qml" and frees resources consumed by it. + Note that Loader is a focus scope. Its \c focus property must be set to \c true for any of its children + to get the \e {active focus} (see \l{qmlfocus#Acquiring Focus and Focus Scopes}{the focus documentation page} for more details). + \sa {dynamic-object-creation}{Dynamic Object Creation} */ diff --git a/src/declarative/graphicsitems/qdeclarativepath.cpp b/src/declarative/graphicsitems/qdeclarativepath.cpp index 80196a1..c48011d3 100644 --- a/src/declarative/graphicsitems/qdeclarativepath.cpp +++ b/src/declarative/graphicsitems/qdeclarativepath.cpp @@ -474,6 +474,7 @@ void QDeclarativeCurve::setX(qreal x) { if (_x != x) { _x = x; + emit xChanged(); emit changed(); } } @@ -487,6 +488,7 @@ void QDeclarativeCurve::setY(qreal y) { if (_y != y) { _y = y; + emit yChanged(); emit changed(); } } @@ -576,6 +578,7 @@ void QDeclarativePathAttribute::setValue(qreal value) { if (_value != value) { _value = value; + emit valueChanged(); emit changed(); } } @@ -678,6 +681,7 @@ void QDeclarativePathQuad::setControlX(qreal x) { if (_controlX != x) { _controlX = x; + emit controlXChanged(); emit changed(); } } @@ -695,6 +699,7 @@ void QDeclarativePathQuad::setControlY(qreal y) { if (_controlY != y) { _controlY = y; + emit controlYChanged(); emit changed(); } } @@ -761,6 +766,7 @@ void QDeclarativePathCubic::setControl1X(qreal x) { if (_control1X != x) { _control1X = x; + emit control1XChanged(); emit changed(); } } @@ -774,6 +780,7 @@ void QDeclarativePathCubic::setControl1Y(qreal y) { if (_control1Y != y) { _control1Y = y; + emit control1YChanged(); emit changed(); } } @@ -793,6 +800,7 @@ void QDeclarativePathCubic::setControl2X(qreal x) { if (_control2X != x) { _control2X = x; + emit control2XChanged(); emit changed(); } } @@ -806,6 +814,7 @@ void QDeclarativePathCubic::setControl2Y(qreal y) { if (_control2Y != y) { _control2Y = y; + emit control2YChanged(); emit changed(); } } diff --git a/src/declarative/graphicsitems/qdeclarativepath_p.h b/src/declarative/graphicsitems/qdeclarativepath_p.h index 001bcdf..5ab5cfd 100644 --- a/src/declarative/graphicsitems/qdeclarativepath_p.h +++ b/src/declarative/graphicsitems/qdeclarativepath_p.h @@ -68,7 +68,7 @@ class Q_AUTOTEST_EXPORT QDeclarativePathAttribute : public QDeclarativePathEleme Q_OBJECT Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged) - Q_PROPERTY(qreal value READ value WRITE setValue NOTIFY changed) + Q_PROPERTY(qreal value READ value WRITE setValue NOTIFY valueChanged) public: QDeclarativePathAttribute(QObject *parent=0) : QDeclarativePathElement(parent), _value(0) {} @@ -81,6 +81,7 @@ public: Q_SIGNALS: void nameChanged(); + void valueChanged(); private: QString _name; @@ -91,8 +92,8 @@ class Q_AUTOTEST_EXPORT QDeclarativeCurve : public QDeclarativePathElement { Q_OBJECT - Q_PROPERTY(qreal x READ x WRITE setX NOTIFY changed) - Q_PROPERTY(qreal y READ y WRITE setY NOTIFY changed) + Q_PROPERTY(qreal x READ x WRITE setX NOTIFY xChanged) + Q_PROPERTY(qreal y READ y WRITE setY NOTIFY yChanged) public: QDeclarativeCurve(QObject *parent=0) : QDeclarativePathElement(parent), _x(0), _y(0) {} @@ -104,6 +105,10 @@ public: virtual void addToPath(QPainterPath &) {} +Q_SIGNALS: + void xChanged(); + void yChanged(); + private: qreal _x; qreal _y; @@ -122,8 +127,8 @@ class Q_AUTOTEST_EXPORT QDeclarativePathQuad : public QDeclarativeCurve { Q_OBJECT - Q_PROPERTY(qreal controlX READ controlX WRITE setControlX NOTIFY changed) - Q_PROPERTY(qreal controlY READ controlY WRITE setControlY NOTIFY changed) + Q_PROPERTY(qreal controlX READ controlX WRITE setControlX NOTIFY controlXChanged) + Q_PROPERTY(qreal controlY READ controlY WRITE setControlY NOTIFY controlYChanged) public: QDeclarativePathQuad(QObject *parent=0) : QDeclarativeCurve(parent), _controlX(0), _controlY(0) {} @@ -135,6 +140,10 @@ public: void addToPath(QPainterPath &path); +Q_SIGNALS: + void controlXChanged(); + void controlYChanged(); + private: qreal _controlX; qreal _controlY; @@ -144,10 +153,10 @@ class Q_AUTOTEST_EXPORT QDeclarativePathCubic : public QDeclarativeCurve { Q_OBJECT - Q_PROPERTY(qreal control1X READ control1X WRITE setControl1X NOTIFY changed) - Q_PROPERTY(qreal control1Y READ control1Y WRITE setControl1Y NOTIFY changed) - Q_PROPERTY(qreal control2X READ control2X WRITE setControl2X NOTIFY changed) - Q_PROPERTY(qreal control2Y READ control2Y WRITE setControl2Y NOTIFY changed) + Q_PROPERTY(qreal control1X READ control1X WRITE setControl1X NOTIFY control1XChanged) + Q_PROPERTY(qreal control1Y READ control1Y WRITE setControl1Y NOTIFY control1YChanged) + Q_PROPERTY(qreal control2X READ control2X WRITE setControl2X NOTIFY control2XChanged) + Q_PROPERTY(qreal control2Y READ control2Y WRITE setControl2Y NOTIFY control2YChanged) public: QDeclarativePathCubic(QObject *parent=0) : QDeclarativeCurve(parent), _control1X(0), _control1Y(0), _control2X(0), _control2Y(0) {} @@ -165,11 +174,17 @@ public: void addToPath(QPainterPath &path); +Q_SIGNALS: + void control1XChanged(); + void control1YChanged(); + void control2XChanged(); + void control2YChanged(); + private: - int _control1X; - int _control1Y; - int _control2X; - int _control2Y; + qreal _control1X; + qreal _control1Y; + qreal _control2X; + qreal _control2Y; }; class Q_AUTOTEST_EXPORT QDeclarativePathPercent : public QDeclarativePathElement diff --git a/src/declarative/graphicsitems/qdeclarativepathview.cpp b/src/declarative/graphicsitems/qdeclarativepathview.cpp index acf9827..380c6ad 100644 --- a/src/declarative/graphicsitems/qdeclarativepathview.cpp +++ b/src/declarative/graphicsitems/qdeclarativepathview.cpp @@ -90,6 +90,26 @@ void QDeclarativePathViewAttached::setValue(const QByteArray &name, const QVaria m_metaobject->setValue(name, val); } + +void QDeclarativePathViewPrivate::init() +{ + Q_Q(QDeclarativePathView); + offset = 0; + q->setAcceptedMouseButtons(Qt::LeftButton); + q->setFlag(QGraphicsItem::ItemIsFocusScope); + q->setFiltersChildEvents(true); + q->connect(&tl, SIGNAL(updated()), q, SLOT(ticked())); + lastPosTime.invalidate(); + static int timelineCompletedIdx = -1; + static int movementEndingIdx = -1; + if (timelineCompletedIdx == -1) { + timelineCompletedIdx = QDeclarativeTimeLine::staticMetaObject.indexOfSignal("completed()"); + movementEndingIdx = QDeclarativePathView::staticMetaObject.indexOfSlot("movementEnding()"); + } + QMetaObject::connect(&tl, timelineCompletedIdx, + q, movementEndingIdx, Qt::DirectConnection); +} + QDeclarativeItem *QDeclarativePathViewPrivate::getItem(int modelIndex) { Q_Q(QDeclarativePathView); @@ -314,7 +334,7 @@ void QDeclarativePathViewPrivate::regenerate() and XmlListModel, or custom model classes defined in C++ that inherit from QAbstractListModel. - A ListView has a \l model, which defines the data to be displayed, and + The view has a \l model, which defines the data to be displayed, and a \l delegate, which defines how the data should be displayed. The \l delegate is instantiated for each item on the \l path. The items may be flicked to move them along the path. @@ -333,6 +353,9 @@ void QDeclarativePathViewPrivate::regenerate() opacity of the items as they rotate. This additional code can be seen in the PathAttribute documentation.) + The \c focus can be set to \c true to enable keyboard navigation. + The path view itself is a focus scope (see \l{qmlfocus#Acquiring Focus and Focus Scopes}{the focus documentation page} for more details). + Delegates are instantiated as needed and may be destroyed at any time. State should \e never be stored in a delegate. @@ -341,7 +364,7 @@ void QDeclarativePathViewPrivate::regenerate() to set \e {clip: true} in order to have the out of view items clipped nicely. - \sa Path + \sa Path, {declarative/modelviews/pathview}{PathView example} */ QDeclarativePathView::QDeclarativePathView(QDeclarativeItem *parent) @@ -403,7 +426,7 @@ QDeclarativePathView::~QDeclarativePathView() The model provides a set of data that is used to create the items for the view. For large or dynamic datasets the model is usually provided by a C++ model object. - Models can also be created directly in XML, using the ListModel element. + Models can also be created directly in QML, using the ListModel element. \sa {qmlmodels}{Data Models} */ @@ -627,8 +650,8 @@ void QDeclarativePathViewPrivate::setOffset(qreal o) so as to stay with the current item. The below example demonstrates how to make a simple highlight. Note the use - of the PathView.onPath property to ensure that the highlight is hidden - when flicked off of the path. + of the \l{PathView::onPath}{PathView.onPath} attached property to ensure that + the highlight is hidden when flicked away from the path. \code Component { @@ -848,6 +871,61 @@ void QDeclarativePathView::setInteractive(bool interactive) } /*! + \qmlproperty bool PathView::moving + + This property holds whether the view is currently moving + due to the user either dragging or flicking the view. +*/ +bool QDeclarativePathView::isMoving() const +{ + Q_D(const QDeclarativePathView); + return d->moving; +} + +/*! + \qmlproperty bool PathView::flicking + + This property holds whether the view is currently moving + due to the user flicking the view. +*/ +bool QDeclarativePathView::isFlicking() const +{ + Q_D(const QDeclarativePathView); + return d->flicking; +} + +/*! + \qmlsignal PathView::onMovementStarted() + + This handler is called when the view begins moving due to user + interaction. +*/ + +/*! + \qmlsignal PathView::onMovementEnded() + + This handler is called when the view stops moving due to user + interaction. If a flick was generated, this handler will + be triggered once the flick stops. If a flick was not + generated, the handler will be triggered when the + user stops dragging - i.e. a mouse or touch release. +*/ + +/*! + \qmlsignal PathView::onFlickStarted() + + This handler is called when the view is flicked. A flick + starts from the point that the mouse or touch is released, + while still in motion. +*/ + +/*! + \qmlsignal PathView::onFlickEnded() + + This handler is called when the view stops moving due to a flick. +*/ + +/*! \qmlproperty Component PathView::delegate The delegate provides a template defining each item instantiated by the view. @@ -964,7 +1042,11 @@ void QDeclarativePathView::mousePressEvent(QGraphicsSceneMouseEvent *event) return; } - d->stealMouse = false; + if (d->tl.isActive() && d->flicking) + d->stealMouse = true; // If we've been flicked then steal the click. + else + d->stealMouse = false; + d->lastElapsed = 0; d->lastDist = 0; QDeclarativeItemPrivate::start(d->lastPosTime); @@ -979,7 +1061,7 @@ void QDeclarativePathView::mouseMoveEvent(QGraphicsSceneMouseEvent *event) if (!d->stealMouse) { QPointF delta = event->pos() - d->startPoint; - if (qAbs(delta.x()) > QApplication::startDragDistance() && qAbs(delta.y()) > QApplication::startDragDistance()) + if (qAbs(delta.x()) > QApplication::startDragDistance() || qAbs(delta.y()) > QApplication::startDragDistance()) d->stealMouse = true; } @@ -1000,6 +1082,11 @@ void QDeclarativePathView::mouseMoveEvent(QGraphicsSceneMouseEvent *event) d->lastDist = diff; d->startPc = newPc; } + if (!d->moving) { + d->moving = true; + emit movingChanged(); + emit movementStarted(); + } } } @@ -1039,12 +1126,19 @@ void QDeclarativePathView::mouseReleaseEvent(QGraphicsSceneMouseEvent *) d->moveOffset.setValue(d->offset); d->tl.accel(d->moveOffset, velocity, accel, dist); d->tl.callback(QDeclarativeTimeLineCallback(&d->moveOffset, d->fixOffsetCallback, d)); + if (!d->flicking) { + d->flicking = true; + emit flickingChanged(); + emit flickStarted(); + } } else { d->fixOffset(); } d->lastPosTime.invalidate(); ungrabMouse(); + if (!d->tl.isActive()) + movementEnding(); } bool QDeclarativePathView::sendMouseEvent(QGraphicsSceneMouseEvent *event) @@ -1372,6 +1466,21 @@ void QDeclarativePathView::ticked() d->updateCurrent(); } +void QDeclarativePathView::movementEnding() +{ + Q_D(QDeclarativePathView); + if (d->flicking) { + d->flicking = false; + emit flickingChanged(); + emit flickEnded(); + } + if (d->moving && !d->stealMouse) { + d->moving = false; + emit movingChanged(); + emit movementEnded(); + } +} + // find the item closest to the snap position int QDeclarativePathViewPrivate::calcCurrentIndex() { diff --git a/src/declarative/graphicsitems/qdeclarativepathview_p.h b/src/declarative/graphicsitems/qdeclarativepathview_p.h index d2980c6..035a64b 100644 --- a/src/declarative/graphicsitems/qdeclarativepathview_p.h +++ b/src/declarative/graphicsitems/qdeclarativepathview_p.h @@ -74,6 +74,9 @@ class Q_AUTOTEST_EXPORT QDeclarativePathView : public QDeclarativeItem Q_PROPERTY(qreal flickDeceleration READ flickDeceleration WRITE setFlickDeceleration NOTIFY flickDecelerationChanged) Q_PROPERTY(bool interactive READ isInteractive WRITE setInteractive NOTIFY interactiveChanged) + Q_PROPERTY(bool moving READ isMoving NOTIFY movingChanged) + Q_PROPERTY(bool flicking READ isFlicking NOTIFY flickingChanged) + Q_PROPERTY(int count READ count NOTIFY countChanged) Q_PROPERTY(QDeclarativeComponent *delegate READ delegate WRITE setDelegate NOTIFY delegateChanged) Q_PROPERTY(int pathItemCount READ pathItemCount WRITE setPathItemCount NOTIFY pathItemCountChanged) @@ -122,6 +125,9 @@ public: bool isInteractive() const; void setInteractive(bool); + bool isMoving() const; + bool isFlicking() const; + int count() const; QDeclarativeComponent *delegate() const; @@ -151,9 +157,15 @@ Q_SIGNALS: void pathItemCountChanged(); void flickDecelerationChanged(); void interactiveChanged(); + void movingChanged(); + void flickingChanged(); void highlightChanged(); void highlightItemChanged(); void highlightMoveDurationChanged(); + void movementStarted(); + void movementEnded(); + void flickStarted(); + void flickEnded(); protected: void mousePressEvent(QGraphicsSceneMouseEvent *event); @@ -167,6 +179,7 @@ protected: private Q_SLOTS: void refill(); void ticked(); + void movementEnding(); void itemsInserted(int index, int count); void itemsRemoved(int index, int count); void itemsMoved(int,int,int); diff --git a/src/declarative/graphicsitems/qdeclarativepathview_p_p.h b/src/declarative/graphicsitems/qdeclarativepathview_p_p.h index a0d2610..9abec2e 100644 --- a/src/declarative/graphicsitems/qdeclarativepathview_p_p.h +++ b/src/declarative/graphicsitems/qdeclarativepathview_p_p.h @@ -78,6 +78,7 @@ public: , lastElapsed(0), mappedRange(1.0) , stealMouse(false), ownModel(false), interactive(true), haveHighlightRange(true) , autoHighlight(true), highlightUp(false), layoutScheduled(false) + , moving(false), flicking(false) , dragMargin(0), deceleration(100) , moveOffset(this, &QDeclarativePathViewPrivate::setOffset) , firstIndex(-1), pathItems(-1), requestedIndex(-1) @@ -90,15 +91,7 @@ public: { } - void init() { - Q_Q(QDeclarativePathView); - offset = 0; - q->setAcceptedMouseButtons(Qt::LeftButton); - q->setFlag(QGraphicsItem::ItemIsFocusScope); - q->setFiltersChildEvents(true); - q->connect(&tl, SIGNAL(updated()), q, SLOT(ticked())); - lastPosTime.invalidate(); - } + void init(); void itemGeometryChanged(QDeclarativeItem *item, const QRectF &newGeometry, const QRectF &oldGeometry) { if ((newGeometry.size() != oldGeometry.size()) @@ -155,6 +148,8 @@ public: bool autoHighlight : 1; bool highlightUp : 1; bool layoutScheduled : 1; + bool moving : 1; + bool flicking : 1; QElapsedTimer lastPosTime; QPointF lastPos; qreal dragMargin; diff --git a/src/declarative/graphicsitems/qdeclarativerepeater.cpp b/src/declarative/graphicsitems/qdeclarativerepeater.cpp index 2b268fb..68e7e9a 100644 --- a/src/declarative/graphicsitems/qdeclarativerepeater.cpp +++ b/src/declarative/graphicsitems/qdeclarativerepeater.cpp @@ -133,13 +133,13 @@ QDeclarativeRepeaterPrivate::~QDeclarativeRepeaterPrivate() create items as they are required. Also, note that Repeater is \l {Item}-based, and can only repeat \l {Item}-derived objects. - For example, it cannot be used to repeat QtObjects: + For example, it cannot be used to repeat QObjects: \badcode Item { - //XXX does not work! Can't repeat QtObject as it doesn't derive from Item. + //XXX does not work! Can't repeat QObject as it doesn't derive from Item. Repeater { model: 10 - QtObject {} + QObject {} } } \endcode diff --git a/src/declarative/graphicsitems/qdeclarativetextinput.cpp b/src/declarative/graphicsitems/qdeclarativetextinput.cpp index 34f5897..90f5a70 100644 --- a/src/declarative/graphicsitems/qdeclarativetextinput.cpp +++ b/src/declarative/graphicsitems/qdeclarativetextinput.cpp @@ -51,6 +51,8 @@ #include <QFontMetrics> #include <QPainter> +#ifndef QT_NO_LINEEDIT + QT_BEGIN_NAMESPACE /*! @@ -1537,3 +1539,5 @@ void QDeclarativeTextInput::updateSize(bool needsRedraw) QT_END_NAMESPACE +#endif // QT_NO_LINEEDIT + diff --git a/src/declarative/graphicsitems/qdeclarativetextinput_p.h b/src/declarative/graphicsitems/qdeclarativetextinput_p.h index ba3f5b1..06f77e5 100644 --- a/src/declarative/graphicsitems/qdeclarativetextinput_p.h +++ b/src/declarative/graphicsitems/qdeclarativetextinput_p.h @@ -48,6 +48,8 @@ #include <QGraphicsSceneMouseEvent> #include <QIntValidator> +#ifndef QT_NO_LINEEDIT + QT_BEGIN_HEADER QT_BEGIN_NAMESPACE @@ -263,4 +265,6 @@ QML_DECLARE_TYPE(QRegExpValidator) QT_END_HEADER +#endif // QT_NO_LINEEDIT + #endif // QDECLARATIVETEXTINPUT_H diff --git a/src/declarative/graphicsitems/qdeclarativetextinput_p_p.h b/src/declarative/graphicsitems/qdeclarativetextinput_p_p.h index 4ac5134..5ad6a3b 100644 --- a/src/declarative/graphicsitems/qdeclarativetextinput_p_p.h +++ b/src/declarative/graphicsitems/qdeclarativetextinput_p_p.h @@ -62,6 +62,8 @@ // // We mean it. +#ifndef QT_NO_LINEEDIT + QT_BEGIN_NAMESPACE class QDeclarativeTextInputPrivate : public QDeclarativePaintedItemPrivate @@ -132,5 +134,7 @@ public: QT_END_NAMESPACE +#endif // QT_NO_LINEEDIT + #endif diff --git a/src/declarative/graphicsitems/qdeclarativetranslate.cpp b/src/declarative/graphicsitems/qdeclarativetranslate.cpp index 16a1127..0bae0cd 100644 --- a/src/declarative/graphicsitems/qdeclarativetranslate.cpp +++ b/src/declarative/graphicsitems/qdeclarativetranslate.cpp @@ -90,7 +90,7 @@ void QDeclarativeTranslate::setX(qreal x) return; d->x = x; update(); - emit positionChanged(); + emit xChanged(); } /*! @@ -113,7 +113,7 @@ void QDeclarativeTranslate::setY(qreal y) return; d->y = y; update(); - emit positionChanged(); + emit yChanged(); } /*! @@ -125,12 +125,4 @@ void QDeclarativeTranslate::applyTo(QMatrix4x4 *matrix) const matrix->translate(d->x, d->y, 0); } -/*! - \fn QDeclarativeTranslate::positionChanged() - - QDeclarativeTranslate emits this signal when its position changes. - - \sa QDeclarativeTranslate::x, QDeclarativeTranslate::y -*/ - QT_END_NAMESPACE diff --git a/src/declarative/graphicsitems/qdeclarativetranslate_p.h b/src/declarative/graphicsitems/qdeclarativetranslate_p.h index 0207dce..b871518 100644 --- a/src/declarative/graphicsitems/qdeclarativetranslate_p.h +++ b/src/declarative/graphicsitems/qdeclarativetranslate_p.h @@ -56,8 +56,8 @@ class Q_AUTOTEST_EXPORT QDeclarativeTranslate : public QGraphicsTransform { Q_OBJECT - Q_PROPERTY(qreal x READ x WRITE setX NOTIFY positionChanged) - Q_PROPERTY(qreal y READ y WRITE setY NOTIFY positionChanged) + Q_PROPERTY(qreal x READ x WRITE setX NOTIFY xChanged) + Q_PROPERTY(qreal y READ y WRITE setY NOTIFY yChanged) public: QDeclarativeTranslate(QObject *parent = 0); @@ -72,7 +72,8 @@ public: void applyTo(QMatrix4x4 *matrix) const; Q_SIGNALS: - void positionChanged(); + void xChanged(); + void yChanged(); private: Q_DECLARE_PRIVATE(QDeclarativeTranslate) diff --git a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp index 7952b97..a489b5a 100644 --- a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp +++ b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp @@ -78,7 +78,7 @@ public: static void children_append(QDeclarativeListProperty<QDeclarativeItem> *prop, QDeclarativeItem *item) { QDeclarative_setParent_noEvent(item, prop->object); - static_cast<QDeclarativeVisualItemModelPrivate *>(prop->data)->children.append(item); + static_cast<QDeclarativeVisualItemModelPrivate *>(prop->data)->children.append(Item(item)); static_cast<QDeclarativeVisualItemModelPrivate *>(prop->data)->itemAppended(); static_cast<QDeclarativeVisualItemModelPrivate *>(prop->data)->emitChildrenChanged(); } @@ -88,12 +88,12 @@ public: } static QDeclarativeItem *children_at(QDeclarativeListProperty<QDeclarativeItem> *prop, int index) { - return static_cast<QDeclarativeVisualItemModelPrivate *>(prop->data)->children.at(index); + return static_cast<QDeclarativeVisualItemModelPrivate *>(prop->data)->children.at(index).item; } void itemAppended() { Q_Q(QDeclarativeVisualItemModel); - QDeclarativeVisualItemModelAttached *attached = QDeclarativeVisualItemModelAttached::properties(children.last()); + QDeclarativeVisualItemModelAttached *attached = QDeclarativeVisualItemModelAttached::properties(children.last().item); attached->setIndex(children.count()-1); emit q->itemsInserted(children.count()-1, 1); emit q->countChanged(); @@ -104,7 +104,25 @@ public: emit q->childrenChanged(); } - QList<QDeclarativeItem *> children; + int indexOf(QDeclarativeItem *item) const { + for (int i = 0; i < children.count(); ++i) + if (children.at(i).item == item) + return i; + return -1; + } + + class Item { + public: + Item(QDeclarativeItem *i) : item(i), ref(0) {} + + void addRef() { ++ref; } + bool deref() { return --ref == 0; } + + QDeclarativeItem *item; + int ref; + }; + + QList<Item> children; }; @@ -182,14 +200,22 @@ bool QDeclarativeVisualItemModel::isValid() const QDeclarativeItem *QDeclarativeVisualItemModel::item(int index, bool) { Q_D(QDeclarativeVisualItemModel); - return d->children.at(index); + QDeclarativeVisualItemModelPrivate::Item &item = d->children[index]; + item.addRef(); + return item.item; } QDeclarativeVisualModel::ReleaseFlags QDeclarativeVisualItemModel::release(QDeclarativeItem *item) { - if (item->scene()) - item->scene()->removeItem(item); - QDeclarative_setParent_noEvent(item, this); + Q_D(QDeclarativeVisualItemModel); + int idx = d->indexOf(item); + if (idx >= 0) { + if (d->children[idx].deref()) { + if (item->scene()) + item->scene()->removeItem(item); + QDeclarative_setParent_noEvent(item, this); + } + } return 0; } @@ -208,7 +234,7 @@ QString QDeclarativeVisualItemModel::stringValue(int index, const QString &name) Q_D(QDeclarativeVisualItemModel); if (index < 0 || index >= d->children.count()) return QString(); - return QDeclarativeEngine::contextForObject(d->children.at(index))->contextProperty(name).toString(); + return QDeclarativeEngine::contextForObject(d->children.at(index).item)->contextProperty(name).toString(); } QVariant QDeclarativeVisualItemModel::evaluate(int index, const QString &expression, QObject *objectContext) @@ -218,7 +244,7 @@ QVariant QDeclarativeVisualItemModel::evaluate(int index, const QString &express return QVariant(); QDeclarativeContext *ccontext = qmlContext(this); QDeclarativeContext *ctxt = new QDeclarativeContext(ccontext); - ctxt->setContextObject(d->children.at(index)); + ctxt->setContextObject(d->children.at(index).item); QDeclarativeExpression e(ctxt, objectContext, expression); QVariant value = e.evaluate(); delete ctxt; @@ -228,7 +254,7 @@ QVariant QDeclarativeVisualItemModel::evaluate(int index, const QString &express int QDeclarativeVisualItemModel::indexOf(QDeclarativeItem *item, QObject *) const { Q_D(const QDeclarativeVisualItemModel); - return d->children.indexOf(item); + return d->indexOf(item); } QDeclarativeVisualItemModelAttached *QDeclarativeVisualItemModel::qmlAttachedProperties(QObject *obj) @@ -418,6 +444,9 @@ public: int propForRole(int) const; void setValue(int, const QVariant &); + bool hasValue(int id) const { + return m_meta->hasValue(id); + } void ensureProperties(); @@ -496,7 +525,7 @@ QVariant QDeclarativeVisualDataModelDataMetaObject::initialValue(int propId) QVariant value = model->m_listModelInterface->data(data->m_index, *it); return value; } else if (model->m_roles.count() == 1 && propName == "modelData") { - //for compatability with other lists, assign modelData if there is only a single role + //for compatibility with other lists, assign modelData if there is only a single role QVariant value = model->m_listModelInterface->data(data->m_index, model->m_roles.first()); return value; } @@ -1190,11 +1219,13 @@ void QDeclarativeVisualDataModel::_q_itemsChanged(int index, int count, int role = roles.at(roleIdx); int propId = data->propForRole(role); if (propId != -1) { - if (d->m_listModelInterface) { - data->setValue(propId, d->m_listModelInterface->data(idx, QList<int>() << role).value(role)); - } else if (d->m_abstractItemModel) { - QModelIndex index = d->m_abstractItemModel->index(idx, 0, d->m_root); - data->setValue(propId, d->m_abstractItemModel->data(index, role)); + if (data->hasValue(propId)) { + if (d->m_listModelInterface) { + data->setValue(propId, d->m_listModelInterface->data(idx, QList<int>() << role).value(role)); + } else if (d->m_abstractItemModel) { + QModelIndex index = d->m_abstractItemModel->index(idx, 0, d->m_root); + data->setValue(propId, d->m_abstractItemModel->data(index, role)); + } } } else { QString roleName; diff --git a/src/declarative/qml/qdeclarativecompiledbindings.cpp b/src/declarative/qml/qdeclarativecompiledbindings.cpp index 507e47b..723da94 100644 --- a/src/declarative/qml/qdeclarativecompiledbindings.cpp +++ b/src/declarative/qml/qdeclarativecompiledbindings.cpp @@ -1628,7 +1628,7 @@ void QDeclarativeBindingCompiler::dump(const QByteArray &programData) /*! Clear the state associated with attempting to compile a specific binding. -This does not clear the global "commited binding" states. +This does not clear the global "committed binding" states. */ void QDeclarativeBindingCompilerPrivate::resetInstanceState() { diff --git a/src/declarative/qml/qdeclarativecompiler.cpp b/src/declarative/qml/qdeclarativecompiler.cpp index febcdef..2b4a4a5 100644 --- a/src/declarative/qml/qdeclarativecompiler.cpp +++ b/src/declarative/qml/qdeclarativecompiler.cpp @@ -1070,6 +1070,7 @@ void QDeclarativeCompiler::genObjectBody(QDeclarativeParser::Object *obj) store.storeSignal.value = output->indexForString(v->value.asScript().trimmed()); store.storeSignal.context = ctxt.stack; + store.storeSignal.name = output->indexForByteArray(prop->name); output->bytecode << store; } @@ -2214,10 +2215,11 @@ bool QDeclarativeCompiler::checkDynamicMeta(QDeclarativeParser::Object *obj) if (propNames.contains(prop.name)) COMPILE_EXCEPTION(&prop, tr("Duplicate property name")); - if (QString::fromUtf8(prop.name).at(0).isUpper()) + QString propName = QString::fromUtf8(prop.name); + if (propName.at(0).isUpper()) COMPILE_EXCEPTION(&prop, tr("Property names cannot begin with an upper case letter")); - if (QDeclarativeEnginePrivate::get(engine)->globalClass->illegalNames().contains(prop.name)) + if (QDeclarativeEnginePrivate::get(engine)->globalClass->illegalNames().contains(propName)) COMPILE_EXCEPTION(&prop, tr("Illegal property name")); propNames.insert(prop.name); @@ -2227,9 +2229,10 @@ bool QDeclarativeCompiler::checkDynamicMeta(QDeclarativeParser::Object *obj) QByteArray name = obj->dynamicSignals.at(ii).name; if (methodNames.contains(name)) COMPILE_EXCEPTION(obj, tr("Duplicate signal name")); - if (QString::fromUtf8(name).at(0).isUpper()) + QString nameStr = QString::fromUtf8(name); + if (nameStr.at(0).isUpper()) COMPILE_EXCEPTION(obj, tr("Signal names cannot begin with an upper case letter")); - if (QDeclarativeEnginePrivate::get(engine)->globalClass->illegalNames().contains(name)) + if (QDeclarativeEnginePrivate::get(engine)->globalClass->illegalNames().contains(nameStr)) COMPILE_EXCEPTION(obj, tr("Illegal signal name")); methodNames.insert(name); } @@ -2237,9 +2240,10 @@ bool QDeclarativeCompiler::checkDynamicMeta(QDeclarativeParser::Object *obj) QByteArray name = obj->dynamicSlots.at(ii).name; if (methodNames.contains(name)) COMPILE_EXCEPTION(obj, tr("Duplicate method name")); - if (QString::fromUtf8(name).at(0).isUpper()) + QString nameStr = QString::fromUtf8(name); + if (nameStr.at(0).isUpper()) COMPILE_EXCEPTION(obj, tr("Method names cannot begin with an upper case letter")); - if (QDeclarativeEnginePrivate::get(engine)->globalClass->illegalNames().contains(name)) + if (QDeclarativeEnginePrivate::get(engine)->globalClass->illegalNames().contains(nameStr)) COMPILE_EXCEPTION(obj, tr("Illegal method name")); methodNames.insert(name); } @@ -2765,6 +2769,7 @@ bool QDeclarativeCompiler::completeComponentBuild() bool isSharable = sharableTest.isSharable(expression); QDeclarativeRewrite::RewriteBinding rewriteBinding; + rewriteBinding.setName('$'+binding.property->name); expression = rewriteBinding(expression); quint32 length = expression.length(); diff --git a/src/declarative/qml/qdeclarativecomponent.cpp b/src/declarative/qml/qdeclarativecomponent.cpp index 7bc6184..5f4a063 100644 --- a/src/declarative/qml/qdeclarativecomponent.cpp +++ b/src/declarative/qml/qdeclarativecomponent.cpp @@ -115,26 +115,10 @@ class QByteArray; a small component within a QML file, or for defining a component that logically belongs with other QML components within a file. - For example, here is a component that is used by multiple \l Loader objects: + For example, here is a component that is used by multiple \l Loader objects. + It contains a top level \l Rectangle item: - \qml - Item { - width: 100; height: 100 - - Component { - id: redSquare - - Rectangle { - color: "red" - width: 10 - height: 10 - } - } - - Loader { sourceComponent: redSquare } - Loader { sourceComponent: redSquare; x: 20 } - } - \endqml + \snippet doc/src/snippets/declarative/component.qml 0 Notice that while a \l Rectangle by itself would be automatically rendered and displayed, this is not the case for the above rectangle @@ -143,12 +127,16 @@ class QByteArray; file, and is not loaded until requested (in this case, by the two \l Loader objects). + A Component cannot contain anything other + than an \c id and a single top level item. While the \c id is optional, + the top level item is not; you cannot define an empty component. + The Component element is commonly used to provide graphical components for views. For example, the ListView::delegate property requires a Component to specify how each list item is to be displayed. - Component objects can also be dynamically generated using - \l{Qt::createComponent()}{Qt.createComponent()}. + Component objects can also be dynamically created using + \l{QML:Qt::createComponent()}{Qt.createComponent()}. */ /*! @@ -204,7 +192,7 @@ class QByteArray; \value Null This QDeclarativeComponent has no data. Call loadUrl() or setData() to add QML content. \value Ready This QDeclarativeComponent is ready and create() may be called. \value Loading This QDeclarativeComponent is loading network data. - \value Error An error has occured. Call errors() to retrieve a list of \{QDeclarativeError}{errors}. + \value Error An error has occurred. Call errors() to retrieve a list of \{QDeclarativeError}{errors}. */ void QDeclarativeComponentPrivate::typeDataReady() @@ -530,7 +518,7 @@ void QDeclarativeComponent::loadUrl(const QUrl &url) } /*! - Return the list of errors that occured during the last compile or create + Return the list of errors that occurred during the last compile or create operation. An empty list is returned if isError() is not set. */ QList<QDeclarativeError> QDeclarativeComponent::errors() const @@ -609,6 +597,9 @@ QDeclarativeComponent::QDeclarativeComponent(QDeclarativeComponentPrivate &dd, Q the \a parent value. Note that if the returned object is to be displayed, you must provide a valid \a parent value or set the returned object's \l{Item::parent}{parent} property, or else the object will not be visible. + + Dynamically created instances can be deleted with the \c destroy() method. + See \l {Dynamic Object Management} for more information. */ /*! diff --git a/src/declarative/qml/qdeclarativecontext.cpp b/src/declarative/qml/qdeclarativecontext.cpp index 3d25291..a58dc6c 100644 --- a/src/declarative/qml/qdeclarativecontext.cpp +++ b/src/declarative/qml/qdeclarativecontext.cpp @@ -80,10 +80,12 @@ QDeclarativeContextPrivate::QDeclarativeContextPrivate() \code QDeclarativeEngine engine; + QStringListModel modelData; QDeclarativeContext *context = new QDeclarativeContext(engine.rootContext()); - context->setContextProperty("myModel", modelData); + context->setContextProperty("myModel", &modelData); - QDeclarativeComponent component(&engine, "ListView { model=myModel }"); + QDeclarativeComponent component(&engine); + component.setData("import Qt 4.7\nListView { model: myModel }", QUrl()); component.create(context); \endcode @@ -104,12 +106,13 @@ QDeclarativeContextPrivate::QDeclarativeContextPrivate() ... }; - MyDataSet *myDataSet = new MyDataSet; + MyDataSet myDataSet; QDeclarativeEngine engine; QDeclarativeContext *context = new QDeclarativeContext(engine.rootContext()); - context->setContextObject(myDataSet); + context->setContextObject(&myDataSet); - QDeclarativeComponent component(&engine, "ListView { model=myModel }"); + QDeclarativeComponent component(&engine); + component.setData("import Qt 4.7\nListView { model: myModel }", QUrl()); component.create(context); \endcode diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp index a5b5fcc..3fe89a5 100644 --- a/src/declarative/qml/qdeclarativeengine.cpp +++ b/src/declarative/qml/qdeclarativeengine.cpp @@ -184,11 +184,12 @@ void QDeclarativeEnginePrivate::defineModule() } /*! -\keyword QmlGlobalQtObject -\qmlclass Qt QDeclarativeEnginePrivate +\qmlclass QML:Qt QDeclarativeEnginePrivate \brief The QML global Qt object provides useful enums and functions from Qt. -The \c Qt object provides useful enums and functions from Qt, for use in all QML files. +\keyword QmlGlobalQtObject + +\brief The \c Qt object provides useful enums and functions from Qt, for use in all QML files. The \c Qt object is not a QML element; it cannot be instantiated. It is a global object with enums and functions. To use it, call the members of the global \c Qt object directly. @@ -206,10 +207,9 @@ Text { \section1 Enums -The Qt object contains all enums in the Qt namespace. For example, you can -access the \c AlignLeft member of the \c Qt::AlignmentFlag enum with \c Qt.AlignLeft. +The Qt object contains enums that declared into Qt's Meta-Object System. For example, you can access +the \c Leftbutton member of the \c Qt::MouseButton enum with \c Qt.LeftButton. -For a full list of enums, see the \l{Qt Namespace} documentation. \section1 Types The Qt object also contains helper functions for creating objects of specific @@ -301,7 +301,9 @@ QDeclarativeScriptEngine::QDeclarativeScriptEngine(QDeclarativeEnginePrivate *pr + QDir::separator() + QLatin1String("OfflineStorage"); #endif +#ifndef QT_NO_XMLSTREAMREADER qt_add_qmlxmlhttprequest(this); +#endif qt_add_qmlsqldatabase(this); // XXX A Multimedia "Qt.Sound" class also needs to be made available, // XXX but we don't want a dependency in that cirection. @@ -1104,29 +1106,20 @@ QString QDeclarativeEnginePrivate::urlToLocalFileOrQrc(const QUrl& url) \qmlmethod object Qt::createComponent(url) Returns a \l Component object created using the QML file at the specified \a url, -or \c null if there was an error in creating the component. +or \c null if an empty string was given. + +The returned component's \l Component::status property indicates whether the +component was successfully created. If the status is \c Component.Error, +see \l Component::errorString() for an error description. Call \l {Component::createObject()}{Component.createObject()} on the returned component to create an object instance of the component. -Here is an example. Notice it checks whether the component \l{Component::status}{status} is -\c Component.Ready before calling \l {Component::createObject()}{createObject()} -in case the QML file is loaded over a network and thus is not ready immediately. - -\snippet doc/src/snippets/declarative/componentCreation.js vars -\codeline -\snippet doc/src/snippets/declarative/componentCreation.js func -\snippet doc/src/snippets/declarative/componentCreation.js remote -\snippet doc/src/snippets/declarative/componentCreation.js func-end -\codeline -\snippet doc/src/snippets/declarative/componentCreation.js finishCreation +For example: -If you are certain the QML file to be loaded is a local file, you could omit the \c finishCreation() -function and call \l {Component::createObject()}{createObject()} immediately: +\snippet doc/src/snippets/declarative/createComponent-simple.qml 0 -\snippet doc/src/snippets/declarative/componentCreation.js func -\snippet doc/src/snippets/declarative/componentCreation.js local -\snippet doc/src/snippets/declarative/componentCreation.js func-end +See \l {Dynamic Object Management} for more information on using this function. To create a QML object from an arbitrary string of QML (instead of a file), use \l{QML:Qt::createQmlObject()}{Qt.createQmlObject()}. @@ -1177,6 +1170,8 @@ Each object in this array has the members \c lineNumber, \c columnNumber, \c fil Note that this function returns immediately, and therefore may not work if the \a qml string loads new components (that is, external QML files that have not yet been loaded). If this is the case, consider using \l{QML:Qt::createComponent()}{Qt.createComponent()} instead. + +See \l {Dynamic Object Management} for more information on using this function. */ QScriptValue QDeclarativeEnginePrivate::createQmlObject(QScriptContext *ctxt, QScriptEngine *engine) diff --git a/src/declarative/qml/qdeclarativeerror.cpp b/src/declarative/qml/qdeclarativeerror.cpp index 8717f56..0ab5cd9 100644 --- a/src/declarative/qml/qdeclarativeerror.cpp +++ b/src/declarative/qml/qdeclarativeerror.cpp @@ -250,7 +250,9 @@ QDebug operator<<(QDebug debug, const QDeclarativeError &error) if (f.open(QIODevice::ReadOnly)) { QByteArray data = f.readAll(); QTextStream stream(data, QIODevice::ReadOnly); +#ifndef QT_NO_TEXTCODEC stream.setCodec("UTF-8"); +#endif const QString code = stream.readAll(); const QStringList lines = code.split(QLatin1Char('\n')); diff --git a/src/declarative/qml/qdeclarativeexpression.cpp b/src/declarative/qml/qdeclarativeexpression.cpp index 9935e38..6fc4df0 100644 --- a/src/declarative/qml/qdeclarativeexpression.cpp +++ b/src/declarative/qml/qdeclarativeexpression.cpp @@ -143,16 +143,12 @@ void QDeclarativeExpressionPrivate::init(QDeclarativeContextData *ctxt, void *ex } else { -#if !defined(Q_OS_SYMBIAN) //XXX Why doesn't this work? if (!dd->cachedPrograms.at(progIdx)) { dd->cachedPrograms[progIdx] = new QScriptProgram(expression, url, line); } expressionFunction = evalInObjectScope(ctxt, me, *dd->cachedPrograms.at(progIdx), &expressionContext); -#else - expressionFunction = evalInObjectScope(ctxt, me, expression, &expressionContext); -#endif expressionFunctionMode = ExplicitContext; expressionFunctionValid = true; @@ -604,6 +600,7 @@ QScriptValue QDeclarativeExpressionPrivate::scriptValue(QObject *secondaryScope, scriptContext->pushScope(ep->globalClass->staticGlobalObject()); QDeclarativeRewrite::RewriteBinding rewriteBinding; + rewriteBinding.setName(name); bool ok = true; const QString code = rewriteBinding(expression, &ok); if (ok) diff --git a/src/declarative/qml/qdeclarativeexpression_p.h b/src/declarative/qml/qdeclarativeexpression_p.h index b629e20..1700335 100644 --- a/src/declarative/qml/qdeclarativeexpression_p.h +++ b/src/declarative/qml/qdeclarativeexpression_p.h @@ -194,6 +194,7 @@ public: QString url; // This is a QString for a reason. QUrls are slooooooow... int line; + QByteArray name; //function name, hint for the debugger }; QDeclarativeQtScriptExpression::DeleteWatcher::DeleteWatcher(QDeclarativeQtScriptExpression *data) diff --git a/src/declarative/qml/qdeclarativeextensionplugin.cpp b/src/declarative/qml/qdeclarativeextensionplugin.cpp index 448fde2..9b5eb61 100644 --- a/src/declarative/qml/qdeclarativeextensionplugin.cpp +++ b/src/declarative/qml/qdeclarativeextensionplugin.cpp @@ -60,7 +60,7 @@ QT_BEGIN_NAMESPACE \o Subclass QDeclarativeExtensionPlugin, implement registerTypes() method to register types using qmlRegisterType(), and export the class using the Q_EXPORT_PLUGIN2() macro \o Write an appropriate project file for the plugin - \o Create a \l{The qmldir file}{qmldir file} to describe the plugin + \o Create a \l{Writing a qmldir file}{qmldir file} to describe the plugin \endlist QML extension plugins can be used to provide either application-specific or @@ -79,7 +79,7 @@ QT_BEGIN_NAMESPACE \dots To make this class available as a QML type, create a plugin that registers - this type using qmlRegisterType(). For this example the plugin + this type with a specific \l {QML Modules}{module} using qmlRegisterType(). For this example the plugin module will be named \c com.nokia.TimeExample (as defined in the project file further below). @@ -104,7 +104,7 @@ QT_BEGIN_NAMESPACE ... \endcode - Finally, a \l{The qmldir file}{qmldir file} is required in the \c com/nokia/TimeExample directory + Finally, a \l{Writing a qmldir file}{qmldir file} is required in the \c com/nokia/TimeExample directory that describes the plugin. This directory includes a \c Clock.qml file that should be bundled with the plugin, so it needs to be specified in the \c qmldir file: diff --git a/src/declarative/qml/qdeclarativeimageprovider.cpp b/src/declarative/qml/qdeclarativeimageprovider.cpp index 241df87..ea68327 100644 --- a/src/declarative/qml/qdeclarativeimageprovider.cpp +++ b/src/declarative/qml/qdeclarativeimageprovider.cpp @@ -59,13 +59,13 @@ public: \list \o Loaded using QPixmaps rather than actual image files - \o Loaded asynchronously in a separate thread, if imageType() is \l ImageType::Image + \o Loaded asynchronously in a separate thread, if imageType() is \l{QDeclarativeImageProvider::ImageType}{ImageType::Image} \endlist To specify that an image should be loaded by an image provider, use the \bold {"image:"} scheme for the URL source of the image, followed by the identifiers of the image provider and the requested image. For example: - + \qml Image { source: "image://myimageprovider/image.png" } \endqml @@ -83,7 +83,7 @@ public: and "red", respectively: \snippet examples/declarative/cppextensions/imageprovider/imageprovider-example.qml 0 - + When these images are loaded by QML, it looks for a matching image provider and calls its requestImage() or requestPixmap() method (depending on its imageType()) to load the image. The method is called with the \c id @@ -112,7 +112,7 @@ public: } \endcode - Now the images can be succesfully loaded in QML: + Now the images can be successfully loaded in QML: \image imageprovider.png @@ -136,7 +136,7 @@ public: main thread. In this case, if \l {Image::}{asynchronous} is set to \c true, the value is ignored and the image is loaded synchronously. - + \sa QDeclarativeEngine::addImageProvider() */ diff --git a/src/declarative/qml/qdeclarativeinfo.cpp b/src/declarative/qml/qdeclarativeinfo.cpp index c980a2a..c6560dd 100644 --- a/src/declarative/qml/qdeclarativeinfo.cpp +++ b/src/declarative/qml/qdeclarativeinfo.cpp @@ -53,6 +53,7 @@ QT_BEGIN_NAMESPACE /*! \fn QDeclarativeInfo qmlInfo(const QObject *object) + \relates QDeclarativeEngine \brief Prints warnings messages that include the file and line number for QML types. diff --git a/src/declarative/qml/qdeclarativeinstruction.cpp b/src/declarative/qml/qdeclarativeinstruction.cpp index 0f7b09d..1767d2f 100644 --- a/src/declarative/qml/qdeclarativeinstruction.cpp +++ b/src/declarative/qml/qdeclarativeinstruction.cpp @@ -218,7 +218,7 @@ void QDeclarativeCompiledData::dump(QDeclarativeInstruction *instr, int idx) qWarning().nospace() << idx << "\t\t" << line << "\t" << "DEFER" << "\t\t\t" << instr->defer.deferCount; break; default: - qWarning().nospace() << idx << "\t\t" << line << "\t" << "XXX UNKOWN INSTRUCTION" << "\t" << instr->type; + qWarning().nospace() << idx << "\t\t" << line << "\t" << "XXX UNKNOWN INSTRUCTION" << "\t" << instr->type; break; } #endif // QT_NO_DEBUG_STREAM diff --git a/src/declarative/qml/qdeclarativeinstruction_p.h b/src/declarative/qml/qdeclarativeinstruction_p.h index d1a0a0a..f0b032c 100644 --- a/src/declarative/qml/qdeclarativeinstruction_p.h +++ b/src/declarative/qml/qdeclarativeinstruction_p.h @@ -292,7 +292,8 @@ public: struct StoreSignalInstruction { int signalIndex; int value; - int context; + short context; + int name; }; struct AssignSignalObjectInstruction { int signal; diff --git a/src/declarative/qml/qdeclarativelist.h b/src/declarative/qml/qdeclarativelist.h index 399b2a1..c10bc11 100644 --- a/src/declarative/qml/qdeclarativelist.h +++ b/src/declarative/qml/qdeclarativelist.h @@ -98,16 +98,16 @@ public: private: static void qlist_append(QDeclarativeListProperty *p, T *v) { - ((QList<T *> *)p->data)->append(v); + reinterpret_cast<QList<T *> *>(p->data)->append(v); } static int qlist_count(QDeclarativeListProperty *p) { - return ((QList<T *> *)p->data)->count(); + return reinterpret_cast<QList<T *> *>(p->data)->count(); } static T *qlist_at(QDeclarativeListProperty *p, int idx) { - return ((QList<T *> *)p->data)->at(idx); + return reinterpret_cast<QList<T *> *>(p->data)->at(idx); } static void qlist_clear(QDeclarativeListProperty *p) { - return ((QList<T *> *)p->data)->clear(); + return reinterpret_cast<QList<T *> *>(p->data)->clear(); } }; #endif diff --git a/src/declarative/qml/qdeclarativeprivate.h b/src/declarative/qml/qdeclarativeprivate.h index b2d7451..d45ddbc 100644 --- a/src/declarative/qml/qdeclarativeprivate.h +++ b/src/declarative/qml/qdeclarativeprivate.h @@ -105,7 +105,7 @@ namespace QDeclarativePrivate template<class From, class To> struct StaticCastSelectorClass<From, To, sizeof(int)> { - static inline int cast() { return (int)((intptr_t)static_cast<To *>((From *)0x10000000)) - 0x10000000; } + static inline int cast() { return int(reinterpret_cast<intptr_t>(static_cast<To *>(reinterpret_cast<From *>(0x10000000)))) - 0x10000000; } }; template<class From, class To> @@ -119,7 +119,7 @@ namespace QDeclarativePrivate static inline int cast() { - return StaticCastSelectorClass<From, To, sizeof(check((From *)0))>::cast(); + return StaticCastSelectorClass<From, To, sizeof(check(reinterpret_cast<From *>(0)))>::cast(); } }; @@ -132,6 +132,7 @@ namespace QDeclarativePrivate template <typename T, bool hasMember> class has_attachedPropertiesMethod { + public: typedef int yes_type; typedef char no_type; @@ -139,7 +140,6 @@ namespace QDeclarativePrivate static yes_type check(ReturnType *(*)(QObject *)); static no_type check(...); - public: static bool const value = sizeof(check(&T::qmlAttachedProperties)) == sizeof(yes_type); }; diff --git a/src/declarative/qml/qdeclarativeproperty.cpp b/src/declarative/qml/qdeclarativeproperty.cpp index 071dd07..515c4d6 100644 --- a/src/declarative/qml/qdeclarativeproperty.cpp +++ b/src/declarative/qml/qdeclarativeproperty.cpp @@ -640,7 +640,7 @@ QDeclarativePropertyPrivate::binding(const QDeclarativeProperty &that) is assumed by the caller. \a flags is passed through to the binding and is used for the initial update (when - the binding sets the intial value, it will use these flags for the write). + the binding sets the initial value, it will use these flags for the write). */ QDeclarativeAbstractBinding * QDeclarativePropertyPrivate::setBinding(const QDeclarativeProperty &that, diff --git a/src/declarative/qml/qdeclarativerewrite.cpp b/src/declarative/qml/qdeclarativerewrite.cpp index 3d40e77..bc9a114 100644 --- a/src/declarative/qml/qdeclarativerewrite.cpp +++ b/src/declarative/qml/qdeclarativerewrite.cpp @@ -102,7 +102,7 @@ QString RewriteBinding::rewrite(QString code, unsigned position, unsigned startOfStatement = node->firstSourceLocation().begin() - _position; unsigned endOfStatement = node->lastSourceLocation().end() - _position; - _writer->replace(startOfStatement, 0, QLatin1String("(function() { ")); + _writer->replace(startOfStatement, 0, QLatin1String("(function ") + QString::fromUtf8(_name) + QLatin1String("() { ")); _writer->replace(endOfStatement, 0, QLatin1String(" })")); if (rewriteDump()) { diff --git a/src/declarative/qml/qdeclarativerewrite_p.h b/src/declarative/qml/qdeclarativerewrite_p.h index 33b168c..6f3c46e 100644 --- a/src/declarative/qml/qdeclarativerewrite_p.h +++ b/src/declarative/qml/qdeclarativerewrite_p.h @@ -78,10 +78,14 @@ class RewriteBinding: protected AST::Visitor { unsigned _position; TextWriter *_writer; + QByteArray _name; public: QString operator()(const QString &code, bool *ok = 0); + //name of the function: used for the debugger + void setName(const QByteArray &name) { _name = name; } + protected: using AST::Visitor::visit; diff --git a/src/declarative/qml/qdeclarativescriptparser.cpp b/src/declarative/qml/qdeclarativescriptparser.cpp index 4d98ca8..0657f49 100644 --- a/src/declarative/qml/qdeclarativescriptparser.cpp +++ b/src/declarative/qml/qdeclarativescriptparser.cpp @@ -760,7 +760,7 @@ bool ProcessAST::visit(AST::UiArrayBinding *node) prop->listValueRange.offset = node->lbracketToken.offset; prop->listValueRange.length = node->rbracketToken.offset + node->rbracketToken.length - node->lbracketToken.offset; - // Store the positions of the comma token too, again for the DOM to be able to retreive it. + // Store the positions of the comma token too, again for the DOM to be able to retrieve it. prop->listCommaPositions = collectCommas(node->members); while (propertyCount--) @@ -831,7 +831,9 @@ bool QDeclarativeScriptParser::parse(const QByteArray &qmldata, const QUrl &url) _scriptFile = fileName; QTextStream stream(qmldata, QIODevice::ReadOnly); +#ifndef QT_NO_TEXTCODEC stream.setCodec("UTF-8"); +#endif const QString code = stream.readAll(); data = new QDeclarativeScriptParserJsASTData(fileName); diff --git a/src/declarative/qml/qdeclarativevme.cpp b/src/declarative/qml/qdeclarativevme.cpp index 3247f85..4e41c22 100644 --- a/src/declarative/qml/qdeclarativevme.cpp +++ b/src/declarative/qml/qdeclarativevme.cpp @@ -621,14 +621,15 @@ QObject *QDeclarativeVME::run(QDeclarativeVMEStack<QObject *> &stack, case QDeclarativeInstruction::StoreSignal: { QObject *target = stack.top(); - QObject *context = stack.at(stack.count() - 1 - instr.assignBinding.context); - + QObject *context = stack.at(stack.count() - 1 - instr.storeSignal.context); + QMetaMethod signal = target->metaObject()->method(instr.storeSignal.signalIndex); QDeclarativeBoundSignal *bs = new QDeclarativeBoundSignal(target, signal, target); QDeclarativeExpression *expr = new QDeclarativeExpression(ctxt, context, primitives.at(instr.storeSignal.value)); expr->setSourceLocation(comp->name, instr.line); + static_cast<QDeclarativeExpressionPrivate *>(QObjectPrivate::get(expr))->name = datas.at(instr.storeSignal.name); bs->setExpression(expr); } break; diff --git a/src/declarative/qml/qdeclarativexmlhttprequest.cpp b/src/declarative/qml/qdeclarativexmlhttprequest.cpp index ff3b13b..8c97e29 100644 --- a/src/declarative/qml/qdeclarativexmlhttprequest.cpp +++ b/src/declarative/qml/qdeclarativexmlhttprequest.cpp @@ -58,6 +58,8 @@ #include <QtCore/qstack.h> #include <QtCore/qdebug.h> +#ifndef QT_NO_XMLSTREAMREADER + // From DOM-Level-3-Core spec // http://www.w3.org/TR/DOM-Level-3-Core/core.html #define INDEX_SIZE_ERR 1 @@ -1304,10 +1306,11 @@ QString QDeclarativeXMLHttpRequest::responseBody() const { QXmlStreamReader reader(m_responseEntityBody); reader.readNext(); +#ifndef QT_NO_TEXTCODEC QTextCodec *codec = QTextCodec::codecForName(reader.documentEncoding().toString().toUtf8()); if (codec) return codec->toUnicode(m_responseEntityBody); - +#endif return QString::fromUtf8(m_responseEntityBody); } @@ -1662,4 +1665,6 @@ void qt_add_qmlxmlhttprequest(QScriptEngine *engine) QT_END_NAMESPACE +#endif // QT_NO_XMLSTREAMREADER + #include <qdeclarativexmlhttprequest.moc> diff --git a/src/declarative/qml/qdeclarativexmlhttprequest_p.h b/src/declarative/qml/qdeclarativexmlhttprequest_p.h index 068cd0f..f340c1c 100644 --- a/src/declarative/qml/qdeclarativexmlhttprequest_p.h +++ b/src/declarative/qml/qdeclarativexmlhttprequest_p.h @@ -56,6 +56,8 @@ #include <QtCore/qglobal.h> +#ifndef QT_NO_XMLSTREAMREADER + QT_BEGIN_NAMESPACE class QScriptEngine; @@ -63,5 +65,7 @@ void qt_add_qmlxmlhttprequest(QScriptEngine *engine); QT_END_NAMESPACE +#endif // QT_NO_XMLSTREAMREADER + #endif // QDECLARATIVEXMLHTTPREQUEST_P_H diff --git a/src/declarative/util/qdeclarativeanimation.cpp b/src/declarative/util/qdeclarativeanimation.cpp index 9806957..a747706 100644 --- a/src/declarative/util/qdeclarativeanimation.cpp +++ b/src/declarative/util/qdeclarativeanimation.cpp @@ -645,12 +645,13 @@ QAbstractAnimation *QDeclarativePauseAnimation::qtAnimation() Like any other animation element, a ColorAnimation can be applied in a number of ways, including transitions, behaviors and property value - sources. The \l PropertyAnimation documentation shows a variety of methods + sources. The \l {QML Animation} documentation shows a variety of methods for creating animations. - When used in a transition, ColorAnimation will by default animate - all properties of type color that have changed. If a \l{PropertyAnimation::}{property} - or \l{PropertyAnimation::}{properties} are explicitly set for the animation, + For convenience, when a ColorAnimation is used in a \l Transition, it will + animate any \c color properties that have been modified during the state + change. If a \l{PropertyAnimation::}{property} or + \l{PropertyAnimation::}{properties} are explicitly set for the animation, then those are used instead. \sa {QML Animation}, {declarative/animation/basics}{Animation basics example} @@ -939,7 +940,7 @@ void QDeclarativePropertyAction::setTarget(QObject *o) if (d->target == o) return; d->target = o; - emit targetChanged(d->target, d->propertyName); + emit targetChanged(); } QString QDeclarativePropertyAction::property() const @@ -954,7 +955,7 @@ void QDeclarativePropertyAction::setProperty(const QString &n) if (d->propertyName == n) return; d->propertyName = n; - emit targetChanged(d->target, d->propertyName); + emit propertyChanged(); } /*! @@ -1143,7 +1144,7 @@ void QDeclarativePropertyAction::transition(QDeclarativeStateActions &actions, Like any other animation element, a NumberAnimation can be applied in a number of ways, including transitions, behaviors and property value - sources. The \l PropertyAnimation documentation shows a variety of methods + sources. The \l {QML Animation} documentation shows a variety of methods for creating animations. Note that NumberAnimation may not animate smoothly if there are irregular @@ -1244,6 +1245,11 @@ void QDeclarativeNumberAnimation::setTo(qreal t) Vector3dAnimation is a specialized PropertyAnimation that defines an animation to be applied when a Vector3d value changes. + Like any other animation element, a Vector3dAnimation can be applied in a + number of ways, including transitions, behaviors and property value + sources. The \l {QML Animation} documentation shows a variety of methods + for creating animations. + \sa {QML Animation}, {declarative/animation/basics}{Animation basics example} */ @@ -1323,7 +1329,7 @@ void QDeclarativeVector3dAnimation::setTo(QVector3D t) \snippet doc/src/snippets/declarative/rotationanimation.qml 0 - Notice the RotationAnimation did not need to set a \l {RotationAnimation::}{target} + Notice the RotationAnimation did not need to set a \l target value. As a convenience, when used in a transition, RotationAnimation will rotate all properties named "rotation" or "angle". You can override this by providing your own properties via \l {PropertyAnimation::properties}{properties} or @@ -1331,7 +1337,7 @@ void QDeclarativeVector3dAnimation::setTo(QVector3D t) Like any other animation element, a RotationAnimation can be applied in a number of ways, including transitions, behaviors and property value - sources. The \l PropertyAnimation documentation shows a variety of methods + sources. The \l {QML Animation} documentation shows a variety of methods for creating animations. \sa {QML Animation}, {declarative/animation/basics}{Animation basics example} @@ -1554,7 +1560,7 @@ QDeclarativeListProperty<QDeclarativeAbstractAnimation> QDeclarativeAnimationGro Like any other animation element, a SequentialAnimation can be applied in a number of ways, including transitions, behaviors and property value - sources. The \l PropertyAnimation documentation shows a variety of methods + sources. The \l {QML Animation} documentation shows a variety of methods for creating animations. \note Once an animation has been grouped into a SequentialAnimation or @@ -1623,7 +1629,7 @@ void QDeclarativeSequentialAnimation::transition(QDeclarativeStateActions &actio Like any other animation element, a ParallelAnimation can be applied in a number of ways, including transitions, behaviors and property value - sources. The \l PropertyAnimation documentation shows a variety of methods + sources. The \l {QML Animation} documentation shows a variety of methods for creating animations. \note Once an animation has been grouped into a SequentialAnimation or @@ -1937,15 +1943,15 @@ void QDeclarativePropertyAnimation::setTo(const QVariant &t) \o \inlineimage qeasingcurve-inquart.png \row \o \c Easing.OutQuart - \o Easing curve for a cubic (t^4) function: decelerating from zero velocity. + \o Easing curve for a quartic (t^4) function: decelerating from zero velocity. \o \inlineimage qeasingcurve-outquart.png \row \o \c Easing.InOutQuart - \o Easing curve for a cubic (t^4) function: acceleration until halfway, then deceleration. + \o Easing curve for a quartic (t^4) function: acceleration until halfway, then deceleration. \o \inlineimage qeasingcurve-inoutquart.png \row \o \c Easing.OutInQuart - \o Easing curve for a cubic (t^4) function: deceleration until halfway, then acceleration. + \o Easing curve for a quartic (t^4) function: deceleration until halfway, then acceleration. \o \inlineimage qeasingcurve-outinquart.png \row \o \c Easing.InQuint @@ -1953,15 +1959,15 @@ void QDeclarativePropertyAnimation::setTo(const QVariant &t) \o \inlineimage qeasingcurve-inquint.png \row \o \c Easing.OutQuint - \o Easing curve for a cubic (t^5) function: decelerating from zero velocity. + \o Easing curve for a quintic (t^5) function: decelerating from zero velocity. \o \inlineimage qeasingcurve-outquint.png \row \o \c Easing.InOutQuint - \o Easing curve for a cubic (t^5) function: acceleration until halfway, then deceleration. + \o Easing curve for a quintic (t^5) function: acceleration until halfway, then deceleration. \o \inlineimage qeasingcurve-inoutquint.png \row \o \c Easing.OutInQuint - \o Easing curve for a cubic (t^5) function: deceleration until halfway, then acceleration. + \o Easing curve for a quintic (t^5) function: deceleration until halfway, then acceleration. \o \inlineimage qeasingcurve-outinquint.png \row \o \c Easing.InSine @@ -2104,7 +2110,7 @@ void QDeclarativePropertyAnimation::setTarget(QObject *o) if (d->target == o) return; d->target = o; - emit targetChanged(d->target, d->propertyName); + emit targetChanged(); } QString QDeclarativePropertyAnimation::property() const @@ -2119,7 +2125,7 @@ void QDeclarativePropertyAnimation::setProperty(const QString &n) if (d->propertyName == n) return; d->propertyName = n; - emit targetChanged(d->target, d->propertyName); + emit propertyChanged(); } QString QDeclarativePropertyAnimation::properties() const @@ -2396,8 +2402,7 @@ void QDeclarativePropertyAnimation::transition(QDeclarativeStateActions &actions \inherits Animation \brief The ParentAnimation element animates changes in parent values. - ParentAnimation defines an animation to applied when a ParentChange - occurs. This allows parent changes to be smoothly animated. + ParentAnimation is used to animate a parent change for an \l Item. For example, the following ParentChange changes \c blueRect to become a child of \c redRect when it is clicked. The inclusion of the @@ -2415,10 +2420,16 @@ void QDeclarativePropertyAnimation::transition(QDeclarativeStateActions &actions to animate the parent change via another item that does not have clipping enabled. Such an item can be set using the \l via property. - By default, when used in a transition, ParentAnimation animates all parent - changes. This can be overriden by setting a specific target item using the + For convenience, when a ParentAnimation is used in a \l Transition, it will + animate any ParentChange that has occurred during the state change. + This can be overridden by setting a specific target item using the \l target property. + Like any other animation element, a ParentAnimation can be applied in a + number of ways, including transitions, behaviors and property value + sources. The \l {QML Animation} documentation shows a variety of methods + for creating animations. + \sa {QML Animation}, {declarative/animation/basics}{Animation basics example} */ @@ -2750,14 +2761,23 @@ QAbstractAnimation *QDeclarativeParentAnimation::qtAnimation() \inherits Animation \brief The AnchorAnimation element animates changes in anchor values. - AnchorAnimation is used to animate an AnchorChange. It will anchor all - anchor changes specified in a \l State. + AnchorAnimation is used to animate an anchor change. In the following snippet we animate the addition of a right anchor to a \l Rectangle: \snippet doc/src/snippets/declarative/anchoranimation.qml 0 - \sa AnchorChanges + For convenience, when an AnchorAnimation is used in a \l Transition, it will + animate any AnchorChanges that have occurred during the state change. + This can be overridden by setting a specific target item using the + \l target property. + + Like any other animation element, an AnchorAnimation can be applied in a + number of ways, including transitions, behaviors and property value + sources. The \l {QML Animation} documentation shows a variety of methods + for creating animations. + + \sa {QML Animation}, AnchorChanges */ QDeclarativeAnchorAnimation::QDeclarativeAnchorAnimation(QObject *parent) diff --git a/src/declarative/util/qdeclarativeanimation_p.h b/src/declarative/util/qdeclarativeanimation_p.h index 28b0a6f..a1bb64f 100644 --- a/src/declarative/util/qdeclarativeanimation_p.h +++ b/src/declarative/util/qdeclarativeanimation_p.h @@ -197,7 +197,7 @@ class QDeclarativePropertyAction : public QDeclarativeAbstractAnimation Q_DECLARE_PRIVATE(QDeclarativePropertyAction) Q_PROPERTY(QObject *target READ target WRITE setTarget NOTIFY targetChanged) - Q_PROPERTY(QString property READ property WRITE setProperty NOTIFY targetChanged) + Q_PROPERTY(QString property READ property WRITE setProperty NOTIFY propertyChanged) Q_PROPERTY(QString properties READ properties WRITE setProperties NOTIFY propertiesChanged) Q_PROPERTY(QDeclarativeListProperty<QObject> targets READ targets) Q_PROPERTY(QDeclarativeListProperty<QObject> exclude READ exclude) @@ -225,7 +225,8 @@ public: Q_SIGNALS: void valueChanged(const QVariant &); void propertiesChanged(const QString &); - void targetChanged(QObject *, const QString &); + void targetChanged(); + void propertyChanged(); protected: virtual void transition(QDeclarativeStateActions &actions, @@ -246,7 +247,7 @@ class Q_AUTOTEST_EXPORT QDeclarativePropertyAnimation : public QDeclarativeAbstr Q_PROPERTY(QVariant to READ to WRITE setTo NOTIFY toChanged) Q_PROPERTY(QEasingCurve easing READ easing WRITE setEasing NOTIFY easingChanged) Q_PROPERTY(QObject *target READ target WRITE setTarget NOTIFY targetChanged) - Q_PROPERTY(QString property READ property WRITE setProperty NOTIFY targetChanged) + Q_PROPERTY(QString property READ property WRITE setProperty NOTIFY propertyChanged) Q_PROPERTY(QString properties READ properties WRITE setProperties NOTIFY propertiesChanged) Q_PROPERTY(QDeclarativeListProperty<QObject> targets READ targets) Q_PROPERTY(QDeclarativeListProperty<QObject> exclude READ exclude) @@ -292,7 +293,8 @@ Q_SIGNALS: void toChanged(QVariant); void easingChanged(const QEasingCurve &); void propertiesChanged(const QString &); - void targetChanged(QObject *, const QString &); + void targetChanged(); + void propertyChanged(); }; class Q_AUTOTEST_EXPORT QDeclarativeColorAnimation : public QDeclarativePropertyAnimation diff --git a/src/declarative/util/qdeclarativebehavior.cpp b/src/declarative/util/qdeclarativebehavior.cpp index fadb2ae..1e7f81a 100644 --- a/src/declarative/util/qdeclarativebehavior.cpp +++ b/src/declarative/util/qdeclarativebehavior.cpp @@ -84,12 +84,15 @@ public: \snippet doc/src/snippets/declarative/behavior.qml 0 - To run multiple animations within a Behavior, use ParallelAnimation or + Note that a property cannot have more than one assigned Behavior. To provide + multiple animations within a Behavior, use ParallelAnimation or SequentialAnimation. - Note that a property cannot have more than one assigned Behavior. + If a \l{QML States}{state change} has a \l Transition that matches the same property as a + Behavior, the \l Transition animation overrides the Behavior for that + state change. - \sa {Property Behaviors}, {declarative/animation/behaviors}{Behavior example}, QtDeclarative + \sa {QML Animation}, {declarative/animation/behaviors}{Behavior example}, QtDeclarative */ diff --git a/src/declarative/util/qdeclarativelistmodel.cpp b/src/declarative/util/qdeclarativelistmodel.cpp index 6b969e3..3a6a5b0 100644 --- a/src/declarative/util/qdeclarativelistmodel.cpp +++ b/src/declarative/util/qdeclarativelistmodel.cpp @@ -108,9 +108,9 @@ QDeclarativeListModelParser::ListInstruction *QDeclarativeListModelParser::ListM \snippet doc/src/snippets/declarative/listmodel-modify.qml delegate - When creating content dynamically, note that the set of available properties cannot be changed - except by first clearing the model. Whatever properties are first added to the model are then the - only permitted properties in the model until it is cleared. + Note that when creating content dynamically the set of available properties cannot be changed + once set. Whatever properties are first added to the model are the + only permitted properties in the model. \section2 Using threaded list models with WorkerScript @@ -283,8 +283,7 @@ int QDeclarativeListModel::count() const /*! \qmlmethod ListModel::clear() - Deletes all content from the model. The properties are cleared such that - different properties may be set on subsequent additions. + Deletes all content from the model. \sa append() remove() */ @@ -945,13 +944,14 @@ bool FlatListModel::addValue(const QScriptValue &value, QHash<int, QVariant> *ro } NestedListModel::NestedListModel(QDeclarativeListModel *base) - : _root(0), m_listModel(base), _rolesOk(false) + : _root(0), m_ownsRoot(false), m_listModel(base), _rolesOk(false) { } NestedListModel::~NestedListModel() { - delete _root; + if (m_ownsRoot) + delete _root; } QVariant NestedListModel::valueForNode(ModelNode *node, bool *hasNested) const @@ -1051,8 +1051,8 @@ void NestedListModel::clear() _rolesOk = false; roleStrings.clear(); - delete _root; - _root = 0; + if (_root) + _root->clear(); } void NestedListModel::remove(int index) @@ -1067,8 +1067,10 @@ void NestedListModel::remove(int index) bool NestedListModel::insert(int index, const QScriptValue& valuemap) { - if (!_root) + if (!_root) { _root = new ModelNode; + m_ownsRoot = true; + } ModelNode *mn = new ModelNode; mn->setObjectValue(valuemap); @@ -1099,8 +1101,10 @@ void NestedListModel::move(int from, int to, int n) bool NestedListModel::append(const QScriptValue& valuemap) { - if (!_root) + if (!_root) { _root = new ModelNode; + m_ownsRoot = true; + } ModelNode *mn = new ModelNode; mn->setObjectValue(valuemap); _root->values << QVariant::fromValue(mn); @@ -1205,16 +1209,22 @@ ModelNode::ModelNode() ModelNode::~ModelNode() { - qDeleteAll(properties.values()); + clear(); + if (modelCache) { modelCache->m_nested->_root = 0/* ==this */; delete modelCache; modelCache = 0; } + if (objectCache) { delete objectCache; objectCache = 0; } +} +void ModelNode::clear() +{ ModelNode *node; for (int ii = 0; ii < values.count(); ++ii) { node = qvariant_cast<ModelNode *>(values.at(ii)); if (node) { delete node; node = 0; } } + values.clear(); - if (modelCache) { modelCache->m_nested->_root = 0/* ==this */; delete modelCache; modelCache = 0; } - if (objectCache) { delete objectCache; objectCache = 0; } + qDeleteAll(properties.values()); + properties.clear(); } void ModelNode::setObjectValue(const QScriptValue& valuemap) { diff --git a/src/declarative/util/qdeclarativelistmodel_p_p.h b/src/declarative/util/qdeclarativelistmodel_p_p.h index 532eefa..8231414 100644 --- a/src/declarative/util/qdeclarativelistmodel_p_p.h +++ b/src/declarative/util/qdeclarativelistmodel_p_p.h @@ -130,6 +130,7 @@ public: void checkRoles() const; ModelNode *_root; + bool m_ownsRoot; QDeclarativeListModel *m_listModel; private: @@ -157,6 +158,8 @@ struct ModelNode QList<QVariant> values; QHash<QString, ModelNode *> properties; + void clear(); + QDeclarativeListModel *model(const NestedListModel *model) { if (!modelCache) { modelCache = new QDeclarativeListModel; diff --git a/src/declarative/util/qdeclarativeopenmetaobject.cpp b/src/declarative/util/qdeclarativeopenmetaobject.cpp index ba5d534..40485bd 100644 --- a/src/declarative/util/qdeclarativeopenmetaobject.cpp +++ b/src/declarative/util/qdeclarativeopenmetaobject.cpp @@ -161,6 +161,12 @@ public: prop.second = true; } + inline bool hasData(int idx) const { + if (idx >= data.count()) + return false; + return data[idx].second; + } + bool autoCreate; QDeclarativeOpenMetaObject *q; QAbstractDynamicMetaObject *parent; @@ -295,6 +301,12 @@ void QDeclarativeOpenMetaObject::setValue(const QByteArray &name, const QVariant activate(d->object, id + d->type->d->signalOffset, 0); } +// returns true if this value has been initialized by a call to either value() or setValue() +bool QDeclarativeOpenMetaObject::hasValue(int id) const +{ + return d->hasData(id); +} + void QDeclarativeOpenMetaObject::setCached(bool c) { if (c == d->cacheProperties || !d->type->d->engine) diff --git a/src/declarative/util/qdeclarativeopenmetaobject_p.h b/src/declarative/util/qdeclarativeopenmetaobject_p.h index 9bb4c34..c18fa3d 100644 --- a/src/declarative/util/qdeclarativeopenmetaobject_p.h +++ b/src/declarative/util/qdeclarativeopenmetaobject_p.h @@ -91,6 +91,7 @@ public: void setValue(int, const QVariant &); QVariant &operator[](const QByteArray &); QVariant &operator[](int); + bool hasValue(int) const; int count() const; QByteArray name(int) const; diff --git a/src/declarative/util/qdeclarativepixmapcache.cpp b/src/declarative/util/qdeclarativepixmapcache.cpp index a83cac8..de2de21 100644 --- a/src/declarative/util/qdeclarativepixmapcache.cpp +++ b/src/declarative/util/qdeclarativepixmapcache.cpp @@ -70,6 +70,16 @@ QT_BEGIN_NAMESPACE +// The cache limit describes the maximum "junk" in the cache. +// These are the same defaults as QPixmapCache +#if defined(Q_OS_SYMBIAN) +static int cache_limit = 1024 * 1024; // 1048 KB cache limit for symbian +#elif defined(Q_WS_QWS) || defined(Q_WS_WINCE) +static int cache_limit = 2048 * 1024; // 2048 KB cache limit for embedded +#else +static int cache_limit = 10240 * 1024; // 10 MB cache limit for desktop +#endif + class QDeclarativePixmapReader; class QDeclarativePixmapData; class QDeclarativePixmapReply : public QObject @@ -515,6 +525,7 @@ void QDeclarativePixmapReader::cancel(QDeclarativePixmapReply *reply) mutex.lock(); if (reply->loading) { cancelled.append(reply); + reply->data = 0; // XXX if (threadObject) threadObject->processJobs(); } else { @@ -580,6 +591,8 @@ public: QHash<QDeclarativePixmapKey, QDeclarativePixmapData *> m_cache; private: + void shrinkCache(int remove); + QDeclarativePixmapData *m_unreferencedPixmaps; QDeclarativePixmapData *m_lastUnreferencedPixmap; @@ -613,7 +626,9 @@ void QDeclarativePixmapStore::unreferencePixmap(QDeclarativePixmapData *data) m_unreferencedCost += data->cost(); - if (m_timerId == -1) + shrinkCache(-1); // Shrink the cache incase it has become larger than cache_limit + + if (m_timerId == -1 && m_unreferencedPixmaps) m_timerId = startTimer(CACHE_EXPIRE_TIME * 1000); } @@ -636,11 +651,9 @@ void QDeclarativePixmapStore::referencePixmap(QDeclarativePixmapData *data) m_unreferencedCost -= data->cost(); } -void QDeclarativePixmapStore::timerEvent(QTimerEvent *) +void QDeclarativePixmapStore::shrinkCache(int remove) { - int removalCost = m_unreferencedCost / CACHE_REMOVAL_FRACTION; - - while (removalCost > 0 && m_lastUnreferencedPixmap) { + while ((remove > 0 || m_unreferencedCost > cache_limit) && m_lastUnreferencedPixmap) { QDeclarativePixmapData *data = m_lastUnreferencedPixmap; Q_ASSERT(data->nextUnreferenced == 0); @@ -649,10 +662,17 @@ void QDeclarativePixmapStore::timerEvent(QTimerEvent *) data->prevUnreferencedPtr = 0; data->prevUnreferenced = 0; - removalCost -= data->cost(); + remove -= data->cost(); data->removeFromCache(); delete data; } +} + +void QDeclarativePixmapStore::timerEvent(QTimerEvent *) +{ + int removalCost = m_unreferencedCost / CACHE_REMOVAL_FRACTION; + + shrinkCache(removalCost); if (m_unreferencedPixmaps == 0) { killTimer(m_timerId); @@ -702,7 +722,7 @@ bool QDeclarativePixmapReply::event(QEvent *event) int QDeclarativePixmapData::cost() const { - return pixmap.width() * pixmap.height() * pixmap.depth(); + return (pixmap.width() * pixmap.height() * pixmap.depth()) / 8; } void QDeclarativePixmapData::addref() @@ -719,7 +739,6 @@ void QDeclarativePixmapData::release() if (refCount == 0) { if (reply) { - reply->data = 0; reply->reader->cancel(reply); reply = 0; } diff --git a/src/declarative/util/qdeclarativepropertymap.cpp b/src/declarative/util/qdeclarativepropertymap.cpp index 919727f..6b43040 100644 --- a/src/declarative/util/qdeclarativepropertymap.cpp +++ b/src/declarative/util/qdeclarativepropertymap.cpp @@ -104,22 +104,25 @@ void QDeclarativePropertyMapMetaObject::propertyCreated(int, QMetaPropertyBuilde The following example shows how you might declare data in C++ and then access it in QML. - Setup in C++: + In the C++ file: \code - //create our data + // create our data QDeclarativePropertyMap ownerData; ownerData.insert("name", QVariant(QString("John Smith"))); ownerData.insert("phone", QVariant(QString("555-5555"))); - //expose it to the UI layer - QDeclarativeContext *ctxt = view->rootContext(); - ctxt->setProperty("owner", &data); + // expose it to the UI layer + QDeclarativeView view; + QDeclarativeContext *ctxt = view.rootContext(); + ctxt->setContextProperty("owner", &ownerData); + + view.setSource(QUrl::fromLocalFile("main.qml")); + view.show(); \endcode - Then, in QML: + Then, in \c main.qml: \code - Text { text: owner.name } - Text { text: owner.phone } + Text { text: owner.name + " " + owner.phone } \endcode The binding is dynamic - whenever a key's value is updated, anything bound to that diff --git a/src/declarative/util/qdeclarativesmoothedanimation.cpp b/src/declarative/util/qdeclarativesmoothedanimation.cpp index 11c3d4b..30e1491 100644 --- a/src/declarative/util/qdeclarativesmoothedanimation.cpp +++ b/src/declarative/util/qdeclarativesmoothedanimation.cpp @@ -287,7 +287,7 @@ void QSmoothedAnimation::init() Like any other animation element, a SmoothedAnimation can be applied in a number of ways, including transitions, behaviors and property value - sources. The \l PropertyAnimation documentation shows a variety of methods + sources. The \l {QML Animation} documentation shows a variety of methods for creating animations. \sa SpringAnimation, NumberAnimation, {QML Animation}, {declarative/animation/basics}{Animation basics example} @@ -375,7 +375,7 @@ void QDeclarativeSmoothedAnimation::transition(QDeclarativeStateActions &actions \list \o SmoothedAnimation.Eased (default) - the animation will smoothly decelerate, and then reverse direction - \o SmoothedAnimation.Immediate - the animation will immediately begin accelerating in the reverse direction, begining with a velocity of 0 + \o SmoothedAnimation.Immediate - the animation will immediately begin accelerating in the reverse direction, beginning with a velocity of 0 \o SmoothedAnimation.Sync - the property is immediately set to the target value \endlist */ diff --git a/src/declarative/util/qdeclarativespringanimation.cpp b/src/declarative/util/qdeclarativespringanimation.cpp index 8ce4832..6f4ac51 100644 --- a/src/declarative/util/qdeclarativespringanimation.cpp +++ b/src/declarative/util/qdeclarativespringanimation.cpp @@ -54,36 +54,32 @@ QT_BEGIN_NAMESPACE - -class QDeclarativeSpringAnimationPrivate : public QDeclarativeAbstractAnimationPrivate +class QDeclarativeSpringAnimationPrivate : public QDeclarativePropertyAnimationPrivate { Q_DECLARE_PUBLIC(QDeclarativeSpringAnimation) public: - QDeclarativeSpringAnimationPrivate() - : currentValue(0), to(0), from(0), maxVelocity(0), lastTime(0) - , mass(1.0), spring(0.), damping(0.), velocity(0), epsilon(0.01) - , modulus(0.0), useMass(false), haveModulus(false), enabled(true) - , fromDefined(false), toDefined(false) - , mode(Track), clock(this) {} - - qreal currentValue; - qreal to; - qreal from; + + + struct SpringAnimation { + SpringAnimation() + : currentValue(0), to(0), velocity(0){} + qreal currentValue; + qreal to; + qreal velocity; + }; + QHash<QDeclarativeProperty, SpringAnimation> activeAnimations; + qreal maxVelocity; qreal velocityms; int lastTime; qreal mass; qreal spring; qreal damping; - qreal velocity; qreal epsilon; qreal modulus; bool useMass : 1; bool haveModulus : 1; - bool enabled : 1; - bool fromDefined : 1; - bool toDefined : 1; enum Mode { Track, @@ -92,38 +88,68 @@ public: }; Mode mode; - void tick(int); + QDeclarativeSpringAnimationPrivate() + : maxVelocity(0), velocityms(0), lastTime(0) + , mass(1.0), spring(0.), damping(0.), epsilon(0.01) + , modulus(0.0), useMass(false), haveModulus(false) + , mode(Track), clock(0) + { } + + void tick(int time); + bool animate(const QDeclarativeProperty &property, SpringAnimation &animation, int elapsed); void updateMode(); - QTickAnimationProxy<QDeclarativeSpringAnimationPrivate, &QDeclarativeSpringAnimationPrivate::tick> clock; + typedef QTickAnimationProxy<QDeclarativeSpringAnimationPrivate, &QDeclarativeSpringAnimationPrivate::tick> Clock; + Clock *clock; }; void QDeclarativeSpringAnimationPrivate::tick(int time) { if (mode == Track) { - clock.stop(); + clock->stop(); return; } - int elapsed = time - lastTime; if (!elapsed) return; - qreal srcVal = to; + + if (mode == Spring) { + if (elapsed < 16) // capped at 62fps. + return; + int count = elapsed / 16; + lastTime = time - (elapsed - count * 16); + } else { + lastTime = time; + } + + QMutableHashIterator<QDeclarativeProperty, SpringAnimation> it(activeAnimations); + while (it.hasNext()) { + it.next(); + if (animate(it.key(), it.value(), elapsed)) + it.remove(); + } + + if (activeAnimations.isEmpty()) + clock->stop(); +} + +bool QDeclarativeSpringAnimationPrivate::animate(const QDeclarativeProperty &property, SpringAnimation &animation, int elapsed) +{ + + qreal srcVal = animation.to; bool stop = false; if (haveModulus) { - currentValue = fmod(currentValue, modulus); + animation.currentValue = fmod(animation.currentValue, modulus); srcVal = fmod(srcVal, modulus); } if (mode == Spring) { - if (elapsed < 16) // capped at 62fps. - return; // Real men solve the spring DEs using RK4. // We'll do something much simpler which gives a result that looks fine. int count = elapsed / 16; for (int i = 0; i < count; ++i) { - qreal diff = srcVal - currentValue; + qreal diff = srcVal - animation.currentValue; if (haveModulus && qAbs(diff) > modulus / 2) { if (diff < 0) diff += modulus; @@ -131,32 +157,31 @@ void QDeclarativeSpringAnimationPrivate::tick(int time) diff -= modulus; } if (useMass) - velocity = velocity + (spring * diff - damping * velocity) / mass; + animation.velocity = animation.velocity + (spring * diff - damping * animation.velocity) / mass; else - velocity = velocity + spring * diff - damping * velocity; + animation.velocity = animation.velocity + spring * diff - damping * animation.velocity; if (maxVelocity > 0.) { // limit velocity - if (velocity > maxVelocity) - velocity = maxVelocity; - else if (velocity < -maxVelocity) - velocity = -maxVelocity; + if (animation.velocity > maxVelocity) + animation.velocity = maxVelocity; + else if (animation.velocity < -maxVelocity) + animation.velocity = -maxVelocity; } - currentValue += velocity * 16.0 / 1000.0; + animation.currentValue += animation.velocity * 16.0 / 1000.0; if (haveModulus) { - currentValue = fmod(currentValue, modulus); - if (currentValue < 0.0) - currentValue += modulus; + animation.currentValue = fmod(animation.currentValue, modulus); + if (animation.currentValue < 0.0) + animation.currentValue += modulus; } } - if (qAbs(velocity) < epsilon && qAbs(srcVal - currentValue) < epsilon) { - velocity = 0.0; - currentValue = srcVal; + if (qAbs(animation.velocity) < epsilon && qAbs(srcVal - animation.currentValue) < epsilon) { + animation.velocity = 0.0; + animation.currentValue = srcVal; stop = true; } - lastTime = time - (elapsed - count * 16); } else { qreal moveBy = elapsed * velocityms; - qreal diff = srcVal - currentValue; + qreal diff = srcVal - animation.currentValue; if (haveModulus && qAbs(diff) > modulus / 2) { if (diff < 0) diff += modulus; @@ -164,33 +189,31 @@ void QDeclarativeSpringAnimationPrivate::tick(int time) diff -= modulus; } if (diff > 0) { - currentValue += moveBy; + animation.currentValue += moveBy; if (haveModulus) - currentValue = fmod(currentValue, modulus); - if (currentValue > to) { - currentValue = to; + animation.currentValue = fmod(animation.currentValue, modulus); + if (animation.currentValue > animation.to) { + animation.currentValue = animation.to; stop = true; } } else { - currentValue -= moveBy; - if (haveModulus && currentValue < 0.0) - currentValue = fmod(currentValue, modulus) + modulus; - if (currentValue < to) { - currentValue = to; + animation.currentValue -= moveBy; + if (haveModulus && animation.currentValue < 0.0) + animation.currentValue = fmod(animation.currentValue, modulus) + modulus; + if (animation.currentValue < animation.to) { + animation.currentValue = animation.to; stop = true; } } - lastTime = time; } - qreal old_to = to; + qreal old_to = animation.to; - QDeclarativePropertyPrivate::write(defaultProperty, currentValue, + QDeclarativePropertyPrivate::write(property, animation.currentValue, QDeclarativePropertyPrivate::BypassInterceptor | QDeclarativePropertyPrivate::DontRemoveBinding); - if (stop && old_to == to) // do not stop if we got restarted - clock.stop(); + return (stop && old_to == animation.to); // do not stop if we got restarted } void QDeclarativeSpringAnimationPrivate::updateMode() @@ -205,6 +228,7 @@ void QDeclarativeSpringAnimationPrivate::updateMode() /*! \qmlclass SpringAnimation QDeclarativeSpringAnimation + \inherits Animation \since 4.7 \brief The SpringAnimation element allows a property to track a value in a spring-like motion. @@ -223,86 +247,23 @@ void QDeclarativeSpringAnimationPrivate::updateMode() Like any other animation element, a SpringAnimation can be applied in a number of ways, including transitions, behaviors and property value - sources. The \l PropertyAnimation documentation shows a variety of methods + sources. The \l {QML Animation} documentation shows a variety of methods for creating animations. \sa SmoothedAnimation, {QML Animation}, {declarative/animation/basics}{Animation basics example}, {declarative/toys/clocks}{Clocks example} */ QDeclarativeSpringAnimation::QDeclarativeSpringAnimation(QObject *parent) -: QDeclarativeAbstractAnimation(*(new QDeclarativeSpringAnimationPrivate),parent) -{ -} - -QDeclarativeSpringAnimation::~QDeclarativeSpringAnimation() -{ -} - -void QDeclarativeSpringAnimation::setTarget(const QDeclarativeProperty &property) +: QDeclarativeNumberAnimation(*(new QDeclarativeSpringAnimationPrivate),parent) { Q_D(QDeclarativeSpringAnimation); - d->defaultProperty = property; - d->currentValue = property.read().toReal(); - if (!d->avoidPropertyValueSourceStart) { - setRunning(true); - } -} - -qreal QDeclarativeSpringAnimation::to() const -{ - Q_D(const QDeclarativeSpringAnimation); - return d->toDefined ? d->to : 0; -} - -/*! - \qmlproperty real SpringAnimation::to - - This property holds the value at which the animation will end. - - If not set, the animation will continue until it reaches the - value that is being tracked. -*/ - -void QDeclarativeSpringAnimation::setTo(qreal value) -{ - Q_D(QDeclarativeSpringAnimation); - if (d->to == value) - return; - - d->to = value; - d->toDefined = true; - d->lastTime = 0; - emit toChanged(value); + d->clock = new QDeclarativeSpringAnimationPrivate::Clock(d, this); } -qreal QDeclarativeSpringAnimation::from() const -{ - Q_D(const QDeclarativeSpringAnimation); - return d->fromDefined ? d->from : 0; -} - -/*! - \qmlproperty real SpringAnimation::from - - This property holds the value from which the animation will begin. - - If not set, the animation will start whenever the tracked value has - changed, regardless of its value. -*/ - -void QDeclarativeSpringAnimation::setFrom(qreal value) +QDeclarativeSpringAnimation::~QDeclarativeSpringAnimation() { - Q_D(QDeclarativeSpringAnimation); - if (d->from == value) - return; - - d->currentValue = d->from = value; - d->fromDefined = true; - d->lastTime = 0; - emit fromChanged(value); } - /*! \qmlproperty real SpringAnimation::velocity @@ -452,17 +413,25 @@ void QDeclarativeSpringAnimation::transition(QDeclarativeStateActions &actions, Q_D(QDeclarativeSpringAnimation); Q_UNUSED(direction); - if (d->clock.state() != QAbstractAnimation::Running) + if (d->clock->state() != QAbstractAnimation::Running) { d->lastTime = 0; + } - if (!actions.isEmpty()) { - for (int i = 0; i < actions.size(); ++i) { - if (!d->toDefined) - d->to = actions.at(i).toValue.toReal(); - if (!d->fromDefined) - d->currentValue = actions.at(i).fromValue.toReal(); - if (d->mode != QDeclarativeSpringAnimationPrivate::Track) - modified << d->defaultProperty; + QDeclarativeNumberAnimation::transition(actions, modified, direction); + + if (!d->actions) + return; + + if (!d->actions->isEmpty()) { + for (int i = 0; i < d->actions->size(); ++i) { + const QDeclarativeProperty &property = d->actions->at(i).property; + QDeclarativeSpringAnimationPrivate::SpringAnimation &animation + = d->activeAnimations[property]; + animation.to = d->actions->at(i).toValue.toReal(); + if (d->fromIsDefined) + animation.currentValue = d->actions->at(i).fromValue.toReal(); + else + animation.currentValue = property.read().toReal(); } } } @@ -471,7 +440,7 @@ void QDeclarativeSpringAnimation::transition(QDeclarativeStateActions &actions, QAbstractAnimation *QDeclarativeSpringAnimation::qtAnimation() { Q_D(QDeclarativeSpringAnimation); - return &d->clock; + return d->clock; } QT_END_NAMESPACE diff --git a/src/declarative/util/qdeclarativespringanimation_p.h b/src/declarative/util/qdeclarativespringanimation_p.h index 6f574ef..ee276ec 100644 --- a/src/declarative/util/qdeclarativespringanimation_p.h +++ b/src/declarative/util/qdeclarativespringanimation_p.h @@ -54,14 +54,12 @@ QT_BEGIN_NAMESPACE QT_MODULE(Declarative) class QDeclarativeSpringAnimationPrivate; -class Q_AUTOTEST_EXPORT QDeclarativeSpringAnimation : public QDeclarativeAbstractAnimation +class Q_AUTOTEST_EXPORT QDeclarativeSpringAnimation : public QDeclarativeNumberAnimation { Q_OBJECT Q_DECLARE_PRIVATE(QDeclarativeSpringAnimation) Q_INTERFACES(QDeclarativePropertyValueSource) - Q_PROPERTY(qreal to READ to WRITE setTo NOTIFY toChanged) - Q_PROPERTY(qreal from READ from WRITE setFrom NOTIFY fromChanged) Q_PROPERTY(qreal velocity READ velocity WRITE setVelocity) Q_PROPERTY(qreal spring READ spring WRITE setSpring) Q_PROPERTY(qreal damping READ damping WRITE setDamping) @@ -73,14 +71,6 @@ public: QDeclarativeSpringAnimation(QObject *parent=0); ~QDeclarativeSpringAnimation(); - virtual void setTarget(const QDeclarativeProperty &); - - qreal to() const; - void setTo(qreal value); - - qreal from() const; - void setFrom(qreal value); - qreal velocity() const; void setVelocity(qreal velocity); @@ -99,9 +89,6 @@ public: qreal modulus() const; void setModulus(qreal modulus); - bool enabled() const; - void setEnabled(bool enabled); - virtual void transition(QDeclarativeStateActions &actions, QDeclarativeProperties &modified, TransitionDirection direction); @@ -110,8 +97,6 @@ protected: virtual QAbstractAnimation *qtAnimation(); Q_SIGNALS: - void toChanged(qreal); - void fromChanged(qreal); void modulusChanged(); void massChanged(); void syncChanged(); diff --git a/src/declarative/util/qdeclarativestate.cpp b/src/declarative/util/qdeclarativestate.cpp index 9f4cc39..028bacb 100644 --- a/src/declarative/util/qdeclarativestate.cpp +++ b/src/declarative/util/qdeclarativestate.cpp @@ -154,13 +154,14 @@ QDeclarativeStateOperation::QDeclarativeStateOperation(QObjectPrivate &dd, QObje Notice the default state is referred to using an empty string (""). - States are commonly used together with \l {state-transitions}{Transitions} to provide + States are commonly used together with \l {Transitions} to provide animations when state changes occur. \note Setting the state of an object from within another state of the same object is not allowed. - \sa {declarative/animation/states}{states example}, {qmlstates}{States}, {state-transitions}{Transitions}, QtDeclarative + \sa {declarative/animation/states}{states example}, {qmlstates}{States}, + {qdeclarativeanimation.html#transitions}{QML Transitions}, QtDeclarative */ /*! @@ -229,20 +230,7 @@ bool QDeclarativeState::isWhenKnown() const be applied. For example, the following \l Rectangle changes in and out of the "hidden" state when the \l MouseArea is pressed: - \qml - Rectangle { - id: myRect - width: 100; height: 100 - color: "red" - - MouseArea { id: mouseArea; anchors.fill: parent } - - states: State { - name: "hidden"; when: mouseArea.pressed - PropertyChanges { target: myRect; opacity: 0 } - } - } - \endqml + \snippet doc/src/snippets/declarative/state-when.qml 0 If multiple states in a group have \c when clauses that evaluate to \c true at the same time, the first matching state will be applied. For example, in the following snippet @@ -358,8 +346,10 @@ QDeclarativeStatePrivate::generateActionList(QDeclarativeStateGroup *group) cons if (!extends.isEmpty()) { QList<QDeclarativeState *> states = group->states(); for (int ii = 0; ii < states.count(); ++ii) - if (states.at(ii)->name() == extends) + if (states.at(ii)->name() == extends) { + qmlExecuteDeferred(states.at(ii)); applyList = static_cast<QDeclarativeStatePrivate*>(states.at(ii)->d_func())->generateActionList(group); + } } foreach(QDeclarativeStateOperation *op, operations) diff --git a/src/declarative/util/qdeclarativestategroup.cpp b/src/declarative/util/qdeclarativestategroup.cpp index 67cd12e..1c1e964 100644 --- a/src/declarative/util/qdeclarativestategroup.cpp +++ b/src/declarative/util/qdeclarativestategroup.cpp @@ -112,7 +112,7 @@ public: } \endqml - \sa {qmlstate}{States} {state-transitions}{Transitions}, {QtDeclarative} + \sa {qmlstate}{States} {Transitions}, {QtDeclarative} */ QDeclarativeStateGroup::QDeclarativeStateGroup(QObject *parent) @@ -204,7 +204,7 @@ void QDeclarativeStateGroupPrivate::clear_states(QDeclarativeListProperty<QDecla } \endqml - \sa {state-transitions}{Transitions} + \sa {Transitions} */ QDeclarativeListProperty<QDeclarativeTransition> QDeclarativeStateGroup::transitionsProperty() { diff --git a/src/declarative/util/qdeclarativetimeline.cpp b/src/declarative/util/qdeclarativetimeline.cpp index 0258b3c..378c539 100644 --- a/src/declarative/util/qdeclarativetimeline.cpp +++ b/src/declarative/util/qdeclarativetimeline.cpp @@ -524,7 +524,7 @@ int QDeclarativeTimeLine::duration() const Following operations on \a timeLineValue in this timeline will be scheduled after all the currently scheduled actions on \a syncTo are complete. In - psuedo-code this is equivalent to: + pseudo-code this is equivalent to: \code QDeclarativeTimeLine::pause(timeLineValue, min(0, length_of(syncTo) - length_of(timeLineValue))) \endcode @@ -549,7 +549,7 @@ void QDeclarativeTimeLine::sync(QDeclarativeTimeLineValue &timeLineValue, QDecla Synchronize the end point of \a timeLineValue to the endpoint of the longest action cursrently scheduled in the timeline. - In psuedo-code, this is equivalent to: + In pseudo-code, this is equivalent to: \code QDeclarativeTimeLine::pause(timeLineValue, length_of(timeline) - length_of(timeLineValue)) \endcode diff --git a/src/declarative/util/qdeclarativetransition.cpp b/src/declarative/util/qdeclarativetransition.cpp index 582191b..aa1426c 100644 --- a/src/declarative/util/qdeclarativetransition.cpp +++ b/src/declarative/util/qdeclarativetransition.cpp @@ -60,12 +60,25 @@ QT_BEGIN_NAMESPACE For example, the following \l Rectangle has two states: the default state, and an added "moved" state. In the "moved state, the rectangle's position changes - to (50, 50). The added \l Transition specifies that when the rectangle + to (50, 50). The added Transition specifies that when the rectangle changes between the default and the "moved" state, any changes to the \c x and \c y properties should be animated, using an \c Easing.InOutQuad. - + \snippet doc/src/snippets/declarative/transition.qml 0 + Notice the example does not require \l{PropertyAnimation::}{to} and + \l{PropertyAnimation::}{from} values for the NumberAnimation. As a convenience, + these properties are automatically set to the values of \c x and \c y before + and after the state change; the \c from values are provided by + the current values of \c x and \c y, and the \c to values are provided by + the PropertyChanges object. If you wish, you can provide \l{PropertyAnimation::}{to} and + \l{PropertyAnimation::}{from} values anyway to override the default values. + + By default, a Transition's animations are applied for any state change in the + parent item. The Transition \l {Transition::}{from} and \l {Transition::}{to} + values can be set to restrict the animations to only be applied when changing + from one particular state to another. + To define multiple transitions, specify \l Item::transitions as a list: \qml @@ -78,7 +91,11 @@ QT_BEGIN_NAMESPACE } \endqml - \sa {declarative/animation/states}{states example}, {qmlstates}{States}, {state-transitions}{Transitions}, {QtDeclarative} + If a state change has a Transition that matches the same property as a + \l Behavior, the Transition animation overrides the \l Behavior for that + state change. + + \sa {QML Animation}, {declarative/animation/states}{states example}, {qmlstates}{States}, {QtDeclarative} */ /*! diff --git a/src/declarative/util/qdeclarativeview.cpp b/src/declarative/util/qdeclarativeview.cpp index 7546a50..8f06858 100644 --- a/src/declarative/util/qdeclarativeview.cpp +++ b/src/declarative/util/qdeclarativeview.cpp @@ -365,7 +365,7 @@ QDeclarativeContext* QDeclarativeView::rootContext() const \value Null This QDeclarativeView has no source set. \value Ready This QDeclarativeView has loaded and created the QML component. \value Loading This QDeclarativeView is loading network data. - \value Error An error has occured. Call errorDescription() to retrieve a description. + \value Error An error has occurred. Call errorDescription() to retrieve a description. */ /*! \enum QDeclarativeView::ResizeMode @@ -391,7 +391,7 @@ QDeclarativeView::Status QDeclarativeView::status() const } /*! - Return the list of errors that occured during the last compile or create + Return the list of errors that occurred during the last compile or create operation. An empty list is returned if isError() is not set. */ QList<QDeclarativeError> QDeclarativeView::errors() const diff --git a/src/declarative/util/qdeclarativexmllistmodel.cpp b/src/declarative/util/qdeclarativexmllistmodel.cpp index 05f751d..ece3d3a 100644 --- a/src/declarative/util/qdeclarativexmllistmodel.cpp +++ b/src/declarative/util/qdeclarativexmllistmodel.cpp @@ -560,7 +560,7 @@ void QDeclarativeXmlListModelPrivate::clear_role(QDeclarativeListProperty<QDecla ListView { width: 180; height: 300 model: xmlModel - delegate: Text { text: title + " (" + pubDate + ")" } + delegate: Text { text: title + ": " + pubDate } } \endqml @@ -855,6 +855,12 @@ qreal QDeclarativeXmlListModel::progress() const return d->progress; } +/*! + \qmlmethod void XmlListModel::errorString() + + Returns a string description of the last error that occurred + if \l status is XmlListModel::Error. +*/ QString QDeclarativeXmlListModel::errorString() const { Q_D(const QDeclarativeXmlListModel); diff --git a/src/declarative/util/qlistmodelinterface.cpp b/src/declarative/util/qlistmodelinterface.cpp index 98d6a5b..acf4dd6 100644 --- a/src/declarative/util/qlistmodelinterface.cpp +++ b/src/declarative/util/qlistmodelinterface.cpp @@ -71,7 +71,7 @@ QT_BEGIN_NAMESPACE */ /*! \fn QHash<int,QVariant> QListModelInterface::data(int index, const QList<int>& roles) const - Returns the data at the given \a index for the specifed \a roles. + Returns the data at the given \a index for the specified \a roles. */ /*! \fn bool QListModelInterface::setData(int index, const QHash<int,QVariant>& values) diff --git a/src/gui/dialogs/qfiledialog_mac.mm b/src/gui/dialogs/qfiledialog_mac.mm index f1afaa9..64fc0ee 100644 --- a/src/gui/dialogs/qfiledialog_mac.mm +++ b/src/gui/dialogs/qfiledialog_mac.mm @@ -782,9 +782,11 @@ void QFileDialogPrivate::qt_mac_filedialog_event_proc(const NavEventCallbackMess const QtMacFilterName &fn = fileDialogPrivate->filterInfo.filters.at( fileDialogPrivate->filterInfo.currentSelection); QStringList reg = fn.regexp.split(QLatin1String(";"), QString::SkipEmptyParts); - QString r = reg.first(); - r = r.right(r.length()-1); // Strip the * - base += r; //"." + QString::number(s->menuType); + if (reg.count()) { + QString r = reg.first(); + r = r.right(r.length()-1); // Strip the * + base += r; //"." + QString::number(s->menuType); + } NavDialogSetSaveFileName(p->context, QCFString::toCFStringRef(base)); } #ifdef DEBUG_FILEDIALOG_FILTERS diff --git a/src/gui/dialogs/qfontdialog_mac.mm b/src/gui/dialogs/qfontdialog_mac.mm index bb8ef3f..9c63dfa 100644 --- a/src/gui/dialogs/qfontdialog_mac.mm +++ b/src/gui/dialogs/qfontdialog_mac.mm @@ -131,6 +131,7 @@ const int StyleMask = NSTitledWindowMask | NSClosableWindowMask | NSResizableWin - (QFont)qtFont; - (void)finishOffWithCode:(NSInteger)result; - (void)cleanUpAfterMyself; +- (void)setSubwindowStacking; @end static QFont qfontForCocoaFont(NSFont *cocoaFont, const QFont &resolveFont) @@ -187,6 +188,12 @@ static QFont qfontForCocoaFont(NSFont *cocoaFont, const QFont &resolveFont) [cancelButton setTarget:self]; } + mQtFont = new QFont(); + return self; +} + +- (void)setSubwindowStacking +{ #ifdef QT_MAC_USE_COCOA // Stack the native dialog in front of its parent, if any: QFontDialog *q = mPriv->fontDialog(); @@ -199,9 +206,6 @@ static QFont qfontForCocoaFont(NSFont *cocoaFont, const QFont &resolveFont) } } #endif - - mQtFont = new QFont(); - return self; } - (void)dealloc @@ -610,6 +614,7 @@ void QFontDialogPrivate::createNSFontPanelDelegate() [ourPanel setFrame:frameRect display:NO]; [ourPanel center]; } + [del setSubwindowStacking]; NSString *title = @"Select font"; [ourPanel setTitle:title]; } diff --git a/src/gui/embedded/qkbdlinuxinput_qws.cpp b/src/gui/embedded/qkbdlinuxinput_qws.cpp index 6c91a08..f53c444 100644 --- a/src/gui/embedded/qkbdlinuxinput_qws.cpp +++ b/src/gui/embedded/qkbdlinuxinput_qws.cpp @@ -138,7 +138,7 @@ QWSLinuxInputKbPrivate::QWSLinuxInputKbPrivate(QWSLinuxInputKeyboardHandler *h, // record the original mode so we can restore it again in the destructor. ::ioctl(m_tty_fd, KDGKBMODE, &m_orig_kbmode); - // setting this tranlation mode is even needed in INPUT mode to prevent + // setting this translation mode is even needed in INPUT mode to prevent // the shell from also interpreting codes, if the process has a tty // attached: e.g. Ctrl+C wouldn't copy, but kill the application. ::ioctl(m_tty_fd, KDSKBMODE, K_MEDIUMRAW); diff --git a/src/gui/embedded/qkbdqnx_qws.cpp b/src/gui/embedded/qkbdqnx_qws.cpp index fbc683e..72d1cb5 100644 --- a/src/gui/embedded/qkbdqnx_qws.cpp +++ b/src/gui/embedded/qkbdqnx_qws.cpp @@ -150,7 +150,7 @@ void QWSQnxKeyboardHandler::socketActivated() // figure out whether it's a press bool isPress = packet.data.key_cap & KEY_DOWN; - // figure out wheter the key is still pressed and the key event is repeated + // figure out whether the key is still pressed and the key event is repeated bool isRepeat = packet.data.key_cap & KEY_REPEAT; Qt::Key key = Qt::Key_unknown; diff --git a/src/gui/graphicsview/qgraphicsgridlayout.cpp b/src/gui/graphicsview/qgraphicsgridlayout.cpp index 8a3f17a..4104834 100644 --- a/src/gui/graphicsview/qgraphicsgridlayout.cpp +++ b/src/gui/graphicsview/qgraphicsgridlayout.cpp @@ -653,7 +653,8 @@ QSizeF QGraphicsGridLayout::sizeHint(Qt::SizeHint which, const QSizeF &constrain Q_D(const QGraphicsGridLayout); qreal left, top, right, bottom; getContentsMargins(&left, &top, &right, &bottom); - return d->engine.sizeHint(d->styleInfo(), which , constraint) + QSizeF(left + right, top + bottom); + const QSizeF extraMargins(left + right, top + bottom); + return d->engine.sizeHint(d->styleInfo(), which , constraint - extraMargins) + extraMargins; } diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index da69bee..fdc512e 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -3259,8 +3259,12 @@ void QGraphicsItemPrivate::setFocusHelper(Qt::FocusReason focusReason, bool clim QGraphicsItem *p = parent; while (p) { if (p->flags() & QGraphicsItem::ItemIsFocusScope) { + QGraphicsItem *oldFocusScopeItem = p->d_ptr->focusScopeItem; p->d_ptr->focusScopeItem = q_ptr; if (!p->focusItem() && !focusFromShow) { + if (oldFocusScopeItem) + oldFocusScopeItem->d_ptr->focusScopeItemChange(false); + focusScopeItemChange(true); // If you call setFocus on a child of a focus scope that // doesn't currently have a focus item, then stop. return; @@ -3931,7 +3935,7 @@ void QGraphicsItem::setScale(qreal factor) Returns a list of graphics transforms that currently apply to this item. QGraphicsTransform is for applying and controlling a chain of individual - transformation operations on an item. It's particularily useful in + transformation operations on an item. It's particularly useful in animations, where each transform operation needs to be interpolated independently, or differently. @@ -3958,7 +3962,7 @@ QList<QGraphicsTransform *> QGraphicsItem::transformations() const an item, you can call setTransform(). QGraphicsTransform is for applying and controlling a chain of individual - transformation operations on an item. It's particularily useful in + transformation operations on an item. It's particularly useful in animations, where each transform operation needs to be interpolated independently, or differently. @@ -5152,7 +5156,7 @@ QPainterPath QGraphicsItem::opaqueArea() const The bounding region describes a coarse outline of the item's visual contents. Although it's expensive to calculate, it's also more precise than boundingRect(), and it can help to avoid unnecessary repainting when - an item is updated. This is particularily efficient for thin items (e.g., + an item is updated. This is particularly efficient for thin items (e.g., lines or simple polygons). You can tune the granularity for the bounding region by calling setBoundingRegionGranularity(). The default granularity is 0; in which the item's bounding region is the same as its bounding @@ -5595,6 +5599,7 @@ void QGraphicsItemPrivate::subFocusItemChange() */ void QGraphicsItemPrivate::focusScopeItemChange(bool isSubFocusItem) { + Q_UNUSED(isSubFocusItem); } /*! @@ -7753,6 +7758,21 @@ void QGraphicsItemPrivate::resetHeight() } /*! + \property QGraphicsObject::children + \internal +*/ + +/*! + \property QGraphicsObject::width + \internal +*/ + +/*! + \property QGraphicsObject::height + \internal +*/ + +/*! \property QGraphicsObject::parent \brief the parent of the item @@ -7965,6 +7985,24 @@ void QGraphicsItemPrivate::resetHeight() */ /*! + \property QGraphicsObject::children + \since 4.7 + \internal +*/ + +/*! + \property QGraphicsObject::width + \since 4.7 + \internal +*/ + +/*! + \property QGraphicsObject::height + \since 4.7 + \internal +*/ + +/*! \class QAbstractGraphicsShapeItem \brief The QAbstractGraphicsShapeItem class provides a common base for all path items. diff --git a/src/gui/graphicsview/qgraphicslayoutitem.cpp b/src/gui/graphicsview/qgraphicslayoutitem.cpp index f4d77f0..bfe734a 100644 --- a/src/gui/graphicsview/qgraphicslayoutitem.cpp +++ b/src/gui/graphicsview/qgraphicslayoutitem.cpp @@ -48,6 +48,7 @@ #include "qgraphicslayoutitem.h" #include "qgraphicslayoutitem_p.h" #include "qwidget.h" +#include "qgraphicswidget.h" #include <QtDebug> @@ -139,9 +140,11 @@ QSizeF *QGraphicsLayoutItemPrivate::effectiveSizeHints(const QSizeF &constraint) if (!sizeHintCacheDirty && cachedConstraint == constraint) return cachedSizeHints; + const bool hasConstraint = constraint.width() >= 0 || constraint.height() >= 0; + for (int i = 0; i < Qt::NSizeHints; ++i) { cachedSizeHints[i] = constraint; - if (userSizeHints) + if (userSizeHints && !hasConstraint) combineSize(cachedSizeHints[i], userSizeHints[i]); } @@ -259,6 +262,52 @@ void QGraphicsLayoutItemPrivate::setSizeComponent( q->updateGeometry(); } + +bool QGraphicsLayoutItemPrivate::hasHeightForWidth() const +{ + Q_Q(const QGraphicsLayoutItem); + if (isLayout) { + const QGraphicsLayout *l = static_cast<const QGraphicsLayout *>(q); + for (int i = l->count() - 1; i >= 0; --i) { + if (QGraphicsLayoutItemPrivate::get(l->itemAt(i))->hasHeightForWidth()) + return true; + } + } else if (QGraphicsItem *item = q->graphicsItem()) { + if (item->isWidget()) { + QGraphicsWidget *w = static_cast<QGraphicsWidget *>(item); + if (w->layout()) { + return QGraphicsLayoutItemPrivate::get(w->layout())->hasHeightForWidth(); + } + } + } + return q->sizePolicy().hasHeightForWidth(); +} + +bool QGraphicsLayoutItemPrivate::hasWidthForHeight() const +{ + // enable this code when we add QSizePolicy::hasWidthForHeight() (For 4.8) +#if 1 + return false; +#else + Q_Q(const QGraphicsLayoutItem); + if (isLayout) { + const QGraphicsLayout *l = static_cast<const QGraphicsLayout *>(q); + for (int i = l->count() - 1; i >= 0; --i) { + if (QGraphicsLayoutItemPrivate::get(l->itemAt(i))->hasWidthForHeight()) + return true; + } + } else if (QGraphicsItem *item = q->graphicsItem()) { + if (item->isWidget()) { + QGraphicsWidget *w = static_cast<QGraphicsWidget *>(item); + if (w->layout()) { + return QGraphicsLayoutItemPrivate::get(w->layout())->hasWidthForHeight(); + } + } + } + return q->sizePolicy().hasWidthForHeight(); +#endif +} + /*! \class QGraphicsLayoutItem \brief The QGraphicsLayoutItem class can be inherited to allow your custom diff --git a/src/gui/graphicsview/qgraphicslayoutitem_p.h b/src/gui/graphicsview/qgraphicslayoutitem_p.h index 15cc7a5..b752e03 100644 --- a/src/gui/graphicsview/qgraphicslayoutitem_p.h +++ b/src/gui/graphicsview/qgraphicslayoutitem_p.h @@ -65,6 +65,9 @@ class Q_AUTOTEST_EXPORT QGraphicsLayoutItemPrivate public: virtual ~QGraphicsLayoutItemPrivate(); QGraphicsLayoutItemPrivate(QGraphicsLayoutItem *parent, bool isLayout); + static QGraphicsLayoutItemPrivate *get(QGraphicsLayoutItem *q) { return q->d_func();} + static const QGraphicsLayoutItemPrivate *get(const QGraphicsLayoutItem *q) { return q->d_func();} + void init(); QSizeF *effectiveSizeHints(const QSizeF &constraint) const; QGraphicsItem *parentItem() const; @@ -73,6 +76,9 @@ public: enum SizeComponent { Width, Height }; void setSizeComponent(Qt::SizeHint which, SizeComponent component, qreal value); + bool hasHeightForWidth() const; + bool hasWidthForHeight() const; + QSizePolicy sizePolicy; QGraphicsLayoutItem *parent; diff --git a/src/gui/graphicsview/qgraphicslinearlayout.cpp b/src/gui/graphicsview/qgraphicslinearlayout.cpp index 37408ef..1588364 100644 --- a/src/gui/graphicsview/qgraphicslinearlayout.cpp +++ b/src/gui/graphicsview/qgraphicslinearlayout.cpp @@ -528,7 +528,8 @@ QSizeF QGraphicsLinearLayout::sizeHint(Qt::SizeHint which, const QSizeF &constra Q_D(const QGraphicsLinearLayout); qreal left, top, right, bottom; getContentsMargins(&left, &top, &right, &bottom); - return d->engine.sizeHint(d->styleInfo(), which , constraint) + QSizeF(left + right, top + bottom); + const QSizeF extraMargins(left + right, top + bottom); + return d->engine.sizeHint(d->styleInfo(), which , constraint - extraMargins) + extraMargins; } /*! diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index 654f60f..6d1bb44 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -831,6 +831,11 @@ void QGraphicsScenePrivate::setFocusItemHelper(QGraphicsItem *item, #endif //QT_NO_IM } + // This handles the case that the item has been removed from the + // scene in response to the FocusOut event. + if (item && item->scene() != q) + item = 0; + if (item) focusItem = item; updateInputMethodSensitivityInViews(); diff --git a/src/gui/graphicsview/qgraphicstransform.cpp b/src/gui/graphicsview/qgraphicstransform.cpp index 4ab6975..bd3f2ef 100644 --- a/src/gui/graphicsview/qgraphicstransform.cpp +++ b/src/gui/graphicsview/qgraphicstransform.cpp @@ -267,6 +267,7 @@ void QGraphicsScale::setXScale(qreal scale) return; d->xScale = scale; update(); + emit xScaleChanged(); emit scaleChanged(); } @@ -293,6 +294,7 @@ void QGraphicsScale::setYScale(qreal scale) return; d->yScale = scale; update(); + emit yScaleChanged(); emit scaleChanged(); } @@ -319,6 +321,7 @@ void QGraphicsScale::setZScale(qreal scale) return; d->zScale = scale; update(); + emit zScaleChanged(); emit scaleChanged(); } @@ -342,6 +345,24 @@ void QGraphicsScale::applyTo(QMatrix4x4 *matrix) const */ /*! + \fn QGraphicsScale::xScaleChanged() + + QGraphicsScale emits this signal when its xScale changes. +*/ + +/*! + \fn QGraphicsScale::yScaleChanged() + + QGraphicsScale emits this signal when its yScale changes. +*/ + +/*! + \fn QGraphicsScale::zScaleChanged() + + QGraphicsScale emits this signal when its zScale changes. +*/ + +/*! \fn QGraphicsScale::scaleChanged() This signal is emitted whenever the xScale, yScale, or zScale @@ -562,6 +583,27 @@ void QGraphicsRotation::applyTo(QMatrix4x4 *matrix) const \sa QGraphicsRotation::axis */ +/*! + \fn QGraphicsScale::xScaleChanged() + \since 4.7 + + This signal is emitted whenever the \l xScale property changes. +*/ + +/*! + \fn QGraphicsScale::yScaleChanged() + \since 4.7 + + This signal is emitted whenever the \l yScale property changes. +*/ + +/*! + \fn QGraphicsScale::zScaleChanged() + \since 4.7 + + This signal is emitted whenever the \l zScale property changes. +*/ + #include "moc_qgraphicstransform.cpp" QT_END_NAMESPACE diff --git a/src/gui/graphicsview/qgraphicstransform.h b/src/gui/graphicsview/qgraphicstransform.h index 58b201a..d8c9654 100644 --- a/src/gui/graphicsview/qgraphicstransform.h +++ b/src/gui/graphicsview/qgraphicstransform.h @@ -85,9 +85,9 @@ class Q_GUI_EXPORT QGraphicsScale : public QGraphicsTransform Q_OBJECT Q_PROPERTY(QVector3D origin READ origin WRITE setOrigin NOTIFY originChanged) - Q_PROPERTY(qreal xScale READ xScale WRITE setXScale NOTIFY scaleChanged) - Q_PROPERTY(qreal yScale READ yScale WRITE setYScale NOTIFY scaleChanged) - Q_PROPERTY(qreal zScale READ zScale WRITE setZScale NOTIFY scaleChanged) + Q_PROPERTY(qreal xScale READ xScale WRITE setXScale NOTIFY xScaleChanged) + Q_PROPERTY(qreal yScale READ yScale WRITE setYScale NOTIFY yScaleChanged) + Q_PROPERTY(qreal zScale READ zScale WRITE setZScale NOTIFY zScaleChanged) public: QGraphicsScale(QObject *parent = 0); ~QGraphicsScale(); @@ -108,6 +108,9 @@ public: Q_SIGNALS: void originChanged(); + void xScaleChanged(); + void yScaleChanged(); + void zScaleChanged(); void scaleChanged(); private: diff --git a/src/gui/graphicsview/qgraphicswidget.cpp b/src/gui/graphicsview/qgraphicswidget.cpp index c486c45..0fabd18 100644 --- a/src/gui/graphicsview/qgraphicswidget.cpp +++ b/src/gui/graphicsview/qgraphicswidget.cpp @@ -385,12 +385,12 @@ void QGraphicsWidget::setGeometry(const QRectF &rect) if (wd->inSetPos) { //set the new pos d->geom.moveTopLeft(pos()); + emit geometryChanged(); return; } } QSizeF oldSize = size(); QGraphicsLayoutItem::setGeometry(newGeom); - emit geometryChanged(); // Send resize event bool resized = newGeom.size() != oldSize; if (resized) { @@ -403,6 +403,7 @@ void QGraphicsWidget::setGeometry(const QRectF &rect) emit heightChanged(); QApplication::sendEvent(this, &re); } + emit geometryChanged(); } /*! diff --git a/src/gui/graphicsview/qgridlayoutengine.cpp b/src/gui/graphicsview/qgridlayoutengine.cpp index 8b65282..98e6781 100644 --- a/src/gui/graphicsview/qgridlayoutengine.cpp +++ b/src/gui/graphicsview/qgridlayoutengine.cpp @@ -250,6 +250,7 @@ void QGridLayoutRowData::calculateGeometries(int start, int end, qreal targetSiz sumAvailable = targetSize - totalBox.q_preferredSize; if (sumAvailable > 0.0) { + qreal sumCurrentAvailable = sumAvailable; bool somethingHasAMaximumSize = false; qreal sumPreferredSizes = 0.0; @@ -308,12 +309,12 @@ void QGridLayoutRowData::calculateGeometries(int start, int end, qreal targetSiz qreal ultimateFactor = (stretch * ultimateSumPreferredSizes / sumStretches) - (box.q_preferredSize); - qreal transitionalFactor = sumAvailable + qreal transitionalFactor = sumCurrentAvailable * (ultimatePreferredSize - box.q_preferredSize) / (ultimateSumPreferredSizes - sumPreferredSizes); - qreal alpha = qMin(sumAvailable, + qreal alpha = qMin(sumCurrentAvailable, ultimateSumPreferredSizes - sumPreferredSizes); qreal beta = ultimateSumPreferredSizes - sumPreferredSizes; @@ -321,7 +322,7 @@ void QGridLayoutRowData::calculateGeometries(int start, int end, qreal targetSiz + ((beta - alpha) * transitionalFactor)) / beta; } sumFactors += factors[i]; - if (desired < sumAvailable) + if (desired < sumCurrentAvailable) somethingHasAMaximumSize = true; newSizes[i] = -1.0; @@ -337,12 +338,12 @@ void QGridLayoutRowData::calculateGeometries(int start, int end, qreal targetSiz continue; const QGridLayoutBox &box = boxes.at(start + i); - qreal avail = sumAvailable * factors[i] / sumFactors; + qreal avail = sumCurrentAvailable * factors[i] / sumFactors; if (sizes[i] + avail >= box.q_maximumSize) { newSizes[i] = box.q_maximumSize; - sumAvailable -= box.q_maximumSize - sizes[i]; + sumCurrentAvailable -= box.q_maximumSize - sizes[i]; sumFactors -= factors[i]; - keepGoing = (sumAvailable > 0.0); + keepGoing = (sumCurrentAvailable > 0.0); if (!keepGoing) break; } @@ -352,7 +353,7 @@ void QGridLayoutRowData::calculateGeometries(int start, int end, qreal targetSiz for (int i = 0; i < n; ++i) { if (newSizes[i] < 0.0) { qreal delta = (sumFactors == 0.0) ? 0.0 - : sumAvailable * factors[i] / sumFactors; + : sumCurrentAvailable * factors[i] / sumFactors; newSizes[i] = sizes[i] + delta; } } @@ -545,6 +546,24 @@ QSizePolicy::Policy QGridLayoutItem::sizePolicy(Qt::Orientation orientation) con : sizePolicy.verticalPolicy(); } +/* + returns true if the size policy returns true for either hasHeightForWidth() + or hasWidthForHeight() + */ +bool QGridLayoutItem::hasDynamicConstraint() const +{ + return QGraphicsLayoutItemPrivate::get(q_layoutItem)->hasHeightForWidth() + || QGraphicsLayoutItemPrivate::get(q_layoutItem)->hasWidthForHeight(); +} + +Qt::Orientation QGridLayoutItem::dynamicConstraintOrientation() const +{ + if (QGraphicsLayoutItemPrivate::get(q_layoutItem)->hasHeightForWidth()) + return Qt::Vertical; + else //if (QGraphicsLayoutItemPrivate::get(q_layoutItem)->hasWidthForHeight()) + return Qt::Horizontal; +} + QSizePolicy::ControlTypes QGridLayoutItem::controlTypes(LayoutSide /* side */) const { return q_layoutItem->sizePolicy().controlType(); @@ -613,7 +632,14 @@ QRectF QGridLayoutItem::geometryWithin(qreal x, qreal y, qreal width, qreal heig qreal cellWidth = width; qreal cellHeight = height; - QSizeF size = effectiveMaxSize().boundedTo(QSizeF(cellWidth, cellHeight)); + QSize constraint; + if (hasDynamicConstraint()) { + if (dynamicConstraintOrientation() == Qt::Vertical) + constraint.setWidth(cellWidth); + else + constraint.setHeight(cellHeight); + } + QSizeF size = effectiveMaxSize(constraint).boundedTo(QSizeF(cellWidth, cellHeight)); width = size.width(); height = size.height(); @@ -675,13 +701,13 @@ void QGridLayoutItem::insertOrRemoveRows(int row, int delta, Qt::Orientation ori Note that effectiveSizeHint does not take sizePolicy into consideration, (since it only evaluates the hints, as the name implies) */ -QSizeF QGridLayoutItem::effectiveMaxSize() const +QSizeF QGridLayoutItem::effectiveMaxSize(const QSizeF &constraint) const { - QSizeF size; + QSizeF size = constraint; bool vGrow = (sizePolicy(Qt::Vertical) & QSizePolicy::GrowFlag) == QSizePolicy::GrowFlag; bool hGrow = (sizePolicy(Qt::Horizontal) & QSizePolicy::GrowFlag) == QSizePolicy::GrowFlag; if (!vGrow || !hGrow) { - QSizeF pref = layoutItem()->effectiveSizeHint(Qt::PreferredSize); + QSizeF pref = layoutItem()->effectiveSizeHint(Qt::PreferredSize, constraint); if (!vGrow) size.setHeight(pref.height()); if (!hGrow) @@ -689,7 +715,7 @@ QSizeF QGridLayoutItem::effectiveMaxSize() const } if (!size.isValid()) { - QSizeF maxSize = layoutItem()->effectiveSizeHint(Qt::MaximumSize); + QSizeF maxSize = layoutItem()->effectiveSizeHint(Qt::MaximumSize, constraint); if (size.width() == -1) size.setWidth(maxSize.width()); if (size.height() == -1) @@ -1019,6 +1045,7 @@ void QGridLayoutEngine::invalidate() q_cachedEffectiveLastRows[Ver] = -1; q_cachedDataForStyleInfo.invalidate(); q_cachedSize = QSizeF(); + q_cachedConstraintOrientation = UnknownConstraint; } static void visualRect(QRectF *geom, Qt::LayoutDirection dir, const QRectF &contentsRect) @@ -1083,10 +1110,13 @@ QRectF QGridLayoutEngine::cellRect(const QLayoutStyleInfo &styleInfo, } QSizeF QGridLayoutEngine::sizeHint(const QLayoutStyleInfo &styleInfo, Qt::SizeHint which, - const QSizeF & /* constraint */) const + const QSizeF &constraint) const { ensureColumnAndRowData(styleInfo); + if (hasDynamicConstraint()) + return dynamicallyConstrainedSizeHint(which, constraint); + switch (which) { case Qt::MinimumSize: return QSizeF(q_totalBoxes[Hor].q_minimumSize, q_totalBoxes[Ver].q_minimumSize); @@ -1384,7 +1414,11 @@ void QGridLayoutEngine::fillRowData(QGridLayoutRowData *rowData, const QLayoutSt box = &multiCell.q_box; multiCell.q_stretch = itemStretch; } - box->combine(item->box(orientation)); + // Items with constraints are not included in the orientation that + // they are constrained (since it depends on the hfw/constraint function). + // They must be combined at a later stage. + if (!item->hasDynamicConstraint() || orientation != item->dynamicConstraintOrientation()) + box->combine(item->box(orientation)); if (effectiveRowSpan == 1) { QSizePolicy::ControlTypes controls = item->controlTypes(top); @@ -1541,6 +1575,138 @@ void QGridLayoutEngine::ensureColumnAndRowData(const QLayoutStyleInfo &styleInfo q_cachedDataForStyleInfo = styleInfo; } +QSizeF QGridLayoutEngine::dynamicallyConstrainedSizeHint(Qt::SizeHint which, + const QSizeF &constraint) const +{ + Q_ASSERT(hasDynamicConstraint()); + if (constraint.width() < 0 && constraint.height() < 0) { + // Process the hfw / wfh items that we did not process in fillRowData() + const Qt::Orientation constraintOrient = constraintOrientation(); + + QGridLayoutRowData rowData = constraintOrient == Qt::Vertical ? q_rowData : q_columnData; + for (int i = q_items.count() - 1; i >= 0; --i) { + QGridLayoutItem *item = q_items.at(i); + if (item->hasDynamicConstraint()) { + QGridLayoutBox box = item->box(constraintOrient); + QGridLayoutBox &rowBox = rowData.boxes[item->firstRow(constraintOrient)]; + rowBox.combine(box); + } + } + + QGridLayoutBox totalBoxes[2]; + if (constraintOrient == Qt::Vertical) { + totalBoxes[Hor] = q_columnData.totalBox(0, columnCount()); + totalBoxes[Ver] = rowData.totalBox(0, rowCount()); + } else { + totalBoxes[Hor] = rowData.totalBox(0, columnCount()); + totalBoxes[Ver] = q_rowData.totalBox(0, rowCount()); + } + return QSizeF(totalBoxes[Hor].q_sizes(which), totalBoxes[Ver].q_sizes(which)); + } + + + Q_ASSERT(constraint.width() >= 0 || constraint.height() >= 0); + q_xx.resize(columnCount()); + q_yy.resize(rowCount()); + q_widths.resize(columnCount()); + q_heights.resize(rowCount()); + q_descents.resize(rowCount()); + + + const Qt::Orientation orientation = constraintOrientation(); + QGridLayoutRowData *colData; + QGridLayoutRowData constrainedRowData; + QGridLayoutBox *totalBox; + qreal *sizes; + qreal *pos; + qreal *descents; + qreal targetSize; + qreal cCount; + qreal rCount; + + if (orientation == Qt::Vertical) { + // height for width + colData = &q_columnData; + totalBox = &q_totalBoxes[Hor]; + sizes = q_widths.data(); + pos = q_xx.data(); + descents = 0; + targetSize = constraint.width(); + cCount = columnCount(); + rCount = rowCount(); + constrainedRowData = q_rowData; + } else { + // width for height + colData = &q_rowData; + totalBox = &q_totalBoxes[Ver]; + sizes = q_heights.data(); + pos = q_yy.data(); + descents = q_descents.data(); + targetSize = constraint.height(); + cCount = rowCount(); + rCount = columnCount(); + constrainedRowData = q_columnData; + } + colData->calculateGeometries(0, cCount, targetSize, pos, sizes, descents, *totalBox); + for (int i = q_items.count() - 1; i >= 0; --i) { + QGridLayoutItem *item = q_items.at(i); + + if (item->hasDynamicConstraint()) { + const qreal size = sizes[item->firstColumn(orientation)]; + QGridLayoutBox box = item->box(orientation, size); + QGridLayoutBox &rowBox = constrainedRowData.boxes[item->firstRow(orientation)]; + rowBox.combine(box); + } + } + const qreal newSize = constrainedRowData.totalBox(0, rCount).q_sizes(which); + + return (orientation == Qt::Vertical) ? QSizeF(targetSize, newSize) : QSizeF(newSize, targetSize); +} + + +/** + returns false if the layout has contradicting constraints (i.e. some items with a horizontal + constraint and other items with a vertical constraint) + */ +bool QGridLayoutEngine::ensureDynamicConstraint() const +{ + if (q_cachedConstraintOrientation == UnknownConstraint) { + for (int i = q_items.count() - 1; i >= 0; --i) { + QGridLayoutItem *item = q_items.at(i); + if (item->hasDynamicConstraint()) { + Qt::Orientation itemConstraintOrientation = item->dynamicConstraintOrientation(); + if (q_cachedConstraintOrientation == UnknownConstraint) { + q_cachedConstraintOrientation = itemConstraintOrientation; + } else if (q_cachedConstraintOrientation != itemConstraintOrientation) { + q_cachedConstraintOrientation = UnfeasibleConstraint; + qWarning("QGridLayoutEngine: Unfeasible, cannot mix horizontal and" + " vertical constraint in the same layout"); + return false; + } + } + } + if (q_cachedConstraintOrientation == UnknownConstraint) + q_cachedConstraintOrientation = NoConstraint; + } + return true; +} + +bool QGridLayoutEngine::hasDynamicConstraint() const +{ + if (!ensureDynamicConstraint()) + return false; + return q_cachedConstraintOrientation != NoConstraint; +} + +/* + * return value is only valid if hasConstraint() returns true + */ +Qt::Orientation QGridLayoutEngine::constraintOrientation() const +{ + (void)ensureDynamicConstraint(); + return (Qt::Orientation)q_cachedConstraintOrientation; +} + void QGridLayoutEngine::ensureGeometries(const QLayoutStyleInfo &styleInfo, const QSizeF &size) const { @@ -1553,10 +1719,74 @@ void QGridLayoutEngine::ensureGeometries(const QLayoutStyleInfo &styleInfo, q_widths.resize(columnCount()); q_heights.resize(rowCount()); q_descents.resize(rowCount()); - q_columnData.calculateGeometries(0, columnCount(), size.width(), q_xx.data(), q_widths.data(), - 0, q_totalBoxes[Hor]); - q_rowData.calculateGeometries(0, rowCount(), size.height(), q_yy.data(), q_heights.data(), - q_descents.data(), q_totalBoxes[Ver]); + + + Qt::Orientation orientation = Qt::Vertical; + if (hasDynamicConstraint()) + orientation = constraintOrientation(); + + /* + In order to do hfw we need to first distribute the columns, then the rows. + In order to do wfh we need to first distribute the rows, then the columns. + + If there is no constraint, the order of distributing the rows or columns first is irrelevant. + We choose horizontal just to keep the same behaviour as before (however, there shouldn't + be any behaviour difference). + */ + + QGridLayoutRowData *colData; + QGridLayoutRowData rowData; + qreal *widths; + qreal *heights; + qreal *xx; + qreal *yy; + qreal *xdescents = 0; + qreal *ydescents = 0; + qreal cCount; + qreal rCount; + QSizeF oSize = size; + if (orientation == Qt::Vertical) { + // height for width + colData = &q_columnData; + rowData = q_rowData; + widths = q_widths.data(); + heights = q_heights.data(); + xx = q_xx.data(); + yy = q_yy.data(); + cCount = columnCount(); + rCount = rowCount(); + ydescents = q_descents.data(); + } else { + // width for height + colData = &q_rowData; + rowData = q_columnData; + widths = q_heights.data(); + heights = q_widths.data(); + xx = q_yy.data(); + yy = q_xx.data(); + cCount = rowCount(); + rCount = columnCount(); + xdescents = q_descents.data(); + oSize.transpose(); + } + + colData->calculateGeometries(0, cCount, oSize.width(), xx, widths, + xdescents, q_totalBoxes[orientation == Qt::Horizontal]); + for (int i = q_items.count() - 1; i >= 0; --i) { + QGridLayoutItem *item = q_items.at(i); + const int col = item->firstColumn(orientation); + const int row = item->firstRow(orientation); + if (item->hasDynamicConstraint()) { + const qreal sz = widths[col]; + QGridLayoutBox box = item->box(orientation, sz); + rowData.boxes[row].combine(box); + } + } + + QGridLayoutBox &totalBox = q_totalBoxes[orientation == Qt::Vertical]; + totalBox = rowData.totalBox(0, rCount); + rowData.calculateGeometries(0, rCount, oSize.height(), yy, heights, + ydescents, totalBox); q_cachedSize = size; } diff --git a/src/gui/graphicsview/qgridlayoutengine_p.h b/src/gui/graphicsview/qgridlayoutengine_p.h index a4ef21d..55451d7 100644 --- a/src/gui/graphicsview/qgridlayoutengine_p.h +++ b/src/gui/graphicsview/qgridlayoutengine_p.h @@ -91,6 +91,14 @@ enum LayoutSide { Bottom }; +enum { + NoConstraint, + HorizontalConstraint, + VerticalConstraint, + UnknownConstraint, // need to update cache + UnfeasibleConstraint // not feasible, it be has some items with Vertical and others with Horizontal constraints +}; + template <typename T> class QLayoutParameter { @@ -270,6 +278,10 @@ public: inline void setAlignment(Qt::Alignment alignment) { q_alignment = alignment; } QSizePolicy::Policy sizePolicy(Qt::Orientation orientation) const; + + bool hasDynamicConstraint() const; + Qt::Orientation dynamicConstraintOrientation() const; + QSizePolicy::ControlTypes controlTypes(LayoutSide side) const; QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const; QGridLayoutBox box(Qt::Orientation orientation, qreal constraint = -1.0) const; @@ -280,7 +292,7 @@ public: void setGeometry(const QRectF &rect); void transpose(); void insertOrRemoveRows(int row, int delta, Qt::Orientation orientation = Qt::Vertical); - QSizeF effectiveMaxSize() const; + QSizeF effectiveMaxSize(const QSizeF &constraint) const; #ifdef QT_DEBUG void dump(int indent = 0) const; @@ -373,6 +385,14 @@ public: int column, int rowSpan, int columnSpan) const; QSizeF sizeHint(const QLayoutStyleInfo &styleInfo, Qt::SizeHint which, const QSizeF &constraint) const; + + // heightForWidth / widthForHeight support + QSizeF dynamicallyConstrainedSizeHint(Qt::SizeHint which, const QSizeF &constraint) const; + bool ensureDynamicConstraint() const; + bool hasDynamicConstraint() const; + Qt::Orientation constraintOrientation() const; + + QSizePolicy::ControlTypes controlTypes(LayoutSide side) const; void transpose(); void setVisualDirection(Qt::LayoutDirection direction); @@ -406,6 +426,7 @@ private: // Lazily computed from the above user input mutable int q_cachedEffectiveFirstRows[NOrientations]; mutable int q_cachedEffectiveLastRows[NOrientations]; + mutable quint8 q_cachedConstraintOrientation : 2; // Layout item input mutable QLayoutStyleInfo q_cachedDataForStyleInfo; diff --git a/src/gui/gui.pro b/src/gui/gui.pro index 1b43ef2..3943e26 100644 --- a/src/gui/gui.pro +++ b/src/gui/gui.pro @@ -77,20 +77,28 @@ symbian { DEPLOYMENT = partial_upgrade $$DEPLOYMENT } +neon:*-g++* { + DEFINES += QT_HAVE_NEON + QMAKE_CXXFLAGS *= -mfpu=neon + HEADERS += $$NEON_HEADERS + SOURCES += $$NEON_SOURCES + + DRAWHELPER_NEON_ASM_FILES = $$NEON_ASM + + neon_compiler.commands = $$QMAKE_CXX -c + neon_compiler.commands += $(CXXFLAGS) $(INCPATH) ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT} + neon_compiler.dependency_type = TYPE_C + neon_compiler.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)} + neon_compiler.input = DRAWHELPER_NEON_ASM_FILES + neon_compiler.variable_out = OBJECTS + neon_compiler.name = compiling[neon] ${QMAKE_FILE_IN} + silent:neon_compiler.commands = @echo compiling[neon] ${QMAKE_FILE_IN} && $$neon_compiler.commands + QMAKE_EXTRA_COMPILERS += neon_compiler +} + contains(QMAKE_MAC_XARCH, no) { DEFINES += QT_NO_MAC_XARCH } else { - mmx:DEFINES += QT_HAVE_MMX - 3dnow:DEFINES += QT_HAVE_3DNOW - sse:DEFINES += QT_HAVE_SSE QT_HAVE_MMXEXT - sse2:DEFINES += QT_HAVE_SSE2 - sse3:DEFINES += QT_HAVE_SSE3 - ssse3:DEFINES += QT_HAVE_SSSE3 - sse4_1:DEFINES += QT_HAVE_SSE4_1 - sse4_2:DEFINES += QT_HAVE_SSE4_2 - avx:DEFINES += QT_HAVE_AVX - iwmmxt:DEFINES += QT_HAVE_IWMMXT - win32-g++*|!win32:!*-icc* { mmx { mmx_compiler.commands = $$QMAKE_CXX -c -Winline diff --git a/src/gui/image/image.pri b/src/gui/image/image.pri index b20a04f..f89706c 100644 --- a/src/gui/image/image.pri +++ b/src/gui/image/image.pri @@ -94,5 +94,6 @@ contains(QT_CONFIG, tiff):include($$PWD/qtiffhandler.pri) contains(QT_CONFIG, gif):include($$PWD/qgifhandler.pri) # SIMD +NEON_SOURCES += image/qimage_neon.cpp SSE2_SOURCES += image/qimage_sse2.cpp SSSE3_SOURCES += image/qimage_ssse3.cpp diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index 0e7ced83..300e04b 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -3851,6 +3851,14 @@ void qInitImageConversions() converter_map[QImage::Format_RGB888][QImage::Format_ARGB32_Premultiplied] = convert_RGB888_to_RGB32_ssse3; } #endif +#ifdef QT_HAVE_NEON + if (features & NEON) { + extern void convert_RGB888_to_RGB32_neon(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags); + converter_map[QImage::Format_RGB888][QImage::Format_RGB32] = convert_RGB888_to_RGB32_neon; + converter_map[QImage::Format_RGB888][QImage::Format_ARGB32] = convert_RGB888_to_RGB32_neon; + converter_map[QImage::Format_RGB888][QImage::Format_ARGB32_Premultiplied] = convert_RGB888_to_RGB32_neon; + } +#endif } /*! @@ -4911,7 +4919,7 @@ QImage QImage::rgbSwapped() const QIMAGE_SANITYCHECK_MEMORY(res); for (int i = 0; i < d->height; i++) { uint *q = (uint*)res.scanLine(i); - uint *p = (uint*)scanLine(i); + uint *p = (uint*)constScanLine(i); uint *end = p + d->width; while (p < end) { *q = ((*p << 16) & 0xff0000) | ((*p >> 16) & 0xff) | (*p & 0xff00ff00); @@ -4925,7 +4933,7 @@ QImage QImage::rgbSwapped() const QIMAGE_SANITYCHECK_MEMORY(res); for (int i = 0; i < d->height; i++) { ushort *q = (ushort*)res.scanLine(i); - const ushort *p = (const ushort*)scanLine(i); + const ushort *p = (const ushort*)constScanLine(i); const ushort *end = p + d->width; while (p < end) { *q = ((*p << 11) & 0xf800) | ((*p >> 11) & 0x1f) | (*p & 0x07e0); @@ -4938,12 +4946,15 @@ QImage QImage::rgbSwapped() const res = QImage(d->width, d->height, d->format); QIMAGE_SANITYCHECK_MEMORY(res); for (int i = 0; i < d->height; i++) { - quint8 *p = (quint8*)scanLine(i); + const quint8 *p = constScanLine(i); + quint8 *q = res.scanLine(i); const quint8 *end = p + d->width * sizeof(qargb8565); while (p < end) { - quint16 *q = reinterpret_cast<quint16*>(p + 1); - *q = ((*q << 11) & 0xf800) | ((*q >> 11) & 0x1f) | (*q & 0x07e0); + q[0] = p[0]; + q[1] = (p[1] & 0xe0) | (p[2] >> 3); + q[2] = (p[2] & 0x07) | (p[1] << 3); p += sizeof(qargb8565); + q += sizeof(qargb8565); } } break; @@ -4952,7 +4963,7 @@ QImage QImage::rgbSwapped() const QIMAGE_SANITYCHECK_MEMORY(res); for (int i = 0; i < d->height; i++) { qrgb666 *q = reinterpret_cast<qrgb666*>(res.scanLine(i)); - const qrgb666 *p = reinterpret_cast<const qrgb666*>(scanLine(i)); + const qrgb666 *p = reinterpret_cast<const qrgb666*>(constScanLine(i)); const qrgb666 *end = p + d->width; while (p < end) { const QRgb rgb = quint32(*p++); @@ -4964,12 +4975,15 @@ QImage QImage::rgbSwapped() const res = QImage(d->width, d->height, d->format); QIMAGE_SANITYCHECK_MEMORY(res); for (int i = 0; i < d->height; i++) { - qargb6666 *q = reinterpret_cast<qargb6666*>(res.scanLine(i)); - const qargb6666 *p = reinterpret_cast<const qargb6666*>(scanLine(i)); - const qargb6666 *end = p + d->width; + const quint8 *p = constScanLine(i); + const quint8 *end = p + d->width * sizeof(qargb6666); + quint8 *q = res.scanLine(i); while (p < end) { - const QRgb rgb = quint32(*p++); - *q++ = qRgba(qBlue(rgb), qGreen(rgb), qRed(rgb), qAlpha(rgb)); + q[0] = (p[1] >> 4) | ((p[2] & 0x3) << 4) | (p[0] & 0xc0); + q[1] = (p[1] & 0xf) | (p[0] << 4); + q[2] = (p[2] & 0xfc) | ((p[0] >> 4) & 0x3); + p += sizeof(qargb6666); + q += sizeof(qargb6666); } } break; @@ -4977,11 +4991,11 @@ QImage QImage::rgbSwapped() const res = QImage(d->width, d->height, d->format); QIMAGE_SANITYCHECK_MEMORY(res); for (int i = 0; i < d->height; i++) { - ushort *q = (ushort*)res.scanLine(i); - const ushort *p = (const ushort*)scanLine(i); - const ushort *end = p + d->width; + quint16 *q = (quint16*)res.scanLine(i); + const quint16 *p = (const quint16*)constScanLine(i); + const quint16 *end = p + d->width; while (p < end) { - *q = ((*p << 10) & 0x7800) | ((*p >> 10) & 0x1f) | (*p & 0x83e0); + *q = ((*p << 10) & 0x7c00) | ((*p >> 10) & 0x1f) | (*p & 0x3e0); p++; q++; } @@ -4991,12 +5005,15 @@ QImage QImage::rgbSwapped() const res = QImage(d->width, d->height, d->format); QIMAGE_SANITYCHECK_MEMORY(res); for (int i = 0; i < d->height; i++) { - quint8 *p = (quint8*)scanLine(i); + const quint8 *p = constScanLine(i); + quint8 *q = res.scanLine(i); const quint8 *end = p + d->width * sizeof(qargb8555); while (p < end) { - quint16 *q = reinterpret_cast<quint16*>(p + 1); - *q = ((*q << 10) & 0x7800) | ((*q >> 10) & 0x1f) | (*q & 0x83e0); + q[0] = p[0]; + q[1] = (p[1] & 0xe0) | (p[2] >> 2); + q[2] = (p[2] & 0x03) | ((p[1] << 2) & 0x7f); p += sizeof(qargb8555); + q += sizeof(qargb8555); } } break; @@ -5004,8 +5021,8 @@ QImage QImage::rgbSwapped() const res = QImage(d->width, d->height, d->format); QIMAGE_SANITYCHECK_MEMORY(res); for (int i = 0; i < d->height; i++) { - quint8 *q = reinterpret_cast<quint8*>(res.scanLine(i)); - const quint8 *p = reinterpret_cast<const quint8*>(scanLine(i)); + quint8 *q = res.scanLine(i); + const quint8 *p = constScanLine(i); const quint8 *end = p + d->width * sizeof(qrgb888); while (p < end) { q[0] = p[2]; @@ -5017,32 +5034,17 @@ QImage QImage::rgbSwapped() const } break; case Format_RGB444: - res = QImage(d->width, d->height, d->format); - QIMAGE_SANITYCHECK_MEMORY(res); - for (int i = 0; i < d->height; i++) { - quint8 *q = reinterpret_cast<quint8*>(res.scanLine(i)); - const quint8 *p = reinterpret_cast<const quint8*>(scanLine(i)); - const quint8 *end = p + d->width * sizeof(qrgb444); - while (p < end) { - q[0] = (p[0] & 0xf0) | ((p[1] & 0x0f) << 8); - q[1] = ((p[0] & 0x0f) >> 8) | (p[1] & 0xf0); - q += sizeof(qrgb444); - p += sizeof(qrgb444); - } - } - break; case Format_ARGB4444_Premultiplied: res = QImage(d->width, d->height, d->format); QIMAGE_SANITYCHECK_MEMORY(res); for (int i = 0; i < d->height; i++) { - quint8 *q = reinterpret_cast<quint8*>(res.scanLine(i)); - const quint8 *p = reinterpret_cast<const quint8*>(scanLine(i)); - const quint8 *end = p + d->width * sizeof(qargb4444); + quint16 *q = reinterpret_cast<quint16*>(res.scanLine(i)); + const quint16 *p = reinterpret_cast<const quint16*>(constScanLine(i)); + const quint16 *end = p + d->width; while (p < end) { - q[0] = (p[0] & 0xf0) | ((p[1] & 0x0f) << 8); - q[1] = ((p[0] & 0x0f) >> 8) | (p[1] & 0xf0); - q += sizeof(qargb4444); - p += sizeof(qargb4444); + *q = (*p & 0xf0f0) | ((*p & 0x0f) << 8) | ((*p & 0xf00) >> 8); + p++; + q++; } } break; diff --git a/src/gui/image/qimage_neon.cpp b/src/gui/image/qimage_neon.cpp new file mode 100644 index 0000000..15bf472 --- /dev/null +++ b/src/gui/image/qimage_neon.cpp @@ -0,0 +1,114 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <qimage.h> +#include <private/qimage_p.h> +#include <private/qsimd_p.h> + +#ifdef QT_HAVE_NEON + +QT_BEGIN_NAMESPACE + +Q_GUI_EXPORT void QT_FASTCALL qt_convert_rgb888_to_rgb32_neon(quint32 *dst, const uchar *src, int len) +{ + if (!len) + return; + + const quint32 *const end = dst + len; + + // align dst on 64 bits + const int offsetToAlignOn8Bytes = (reinterpret_cast<quintptr>(dst) >> 2) & 0x1; + for (int i = 0; i < offsetToAlignOn8Bytes; ++i) { + *dst++ = qRgb(src[0], src[1], src[2]); + src += 3; + } + + if ((len - offsetToAlignOn8Bytes) >= 8) { + const quint32 *const simdEnd = end - 7; + register uint8x8_t fullVector asm ("d3") = vdup_n_u8(0xff); + do { +#if Q_BYTE_ORDER == Q_BIG_ENDIAN + asm volatile ( + "vld3.8 { d4, d5, d6 }, [%[SRC]] !\n\t" + "vst4.8 { d3, d4, d5, d6 }, [%[DST],:64] !\n\t" + : [DST]"+r" (dst), [SRC]"+r" (src) + : "w"(fullVector) + : "memory", "d4", "d5", "d6" + ); +#else + asm volatile ( + "vld3.8 { d0, d1, d2 }, [%[SRC]] !\n\t" + "vswp d0, d2\n\t" + "vst4.8 { d0, d1, d2, d3 }, [%[DST],:64] !\n\t" + : [DST]"+r" (dst), [SRC]"+r" (src) + : "w"(fullVector) + : "memory", "d0", "d1", "d2" + ); +#endif + } while (dst < simdEnd); + } + + while (dst != end) { + *dst++ = qRgb(src[0], src[1], src[2]); + src += 3; + } +} + +void convert_RGB888_to_RGB32_neon(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags) +{ + Q_ASSERT(src->format == QImage::Format_RGB888); + Q_ASSERT(dest->format == QImage::Format_RGB32 || dest->format == QImage::Format_ARGB32 || dest->format == QImage::Format_ARGB32_Premultiplied); + Q_ASSERT(src->width == dest->width); + Q_ASSERT(src->height == dest->height); + + const uchar *src_data = (uchar *) src->data; + quint32 *dest_data = (quint32 *) dest->data; + + for (int i = 0; i < src->height; ++i) { + qt_convert_rgb888_to_rgb32_neon(dest_data, src_data, src->width); + src_data += src->bytes_per_line; + dest_data = (quint32 *)((uchar*)dest_data + dest->bytes_per_line); + } +} + +QT_END_NAMESPACE + +#endif // QT_HAVE_NEON diff --git a/src/gui/image/qimage_ssse3.cpp b/src/gui/image/qimage_ssse3.cpp index 1c664f2..9aed011 100644 --- a/src/gui/image/qimage_ssse3.cpp +++ b/src/gui/image/qimage_ssse3.cpp @@ -45,13 +45,12 @@ #ifdef QT_HAVE_SSSE3 -#include <stdio.h> QT_BEGIN_NAMESPACE // Convert a scanline of RGB888 (src) to RGB32 (dst) // src must be at least len * 3 bytes // dst must be at least len * 4 bytes -inline void convert_rgb888_to_rgb32_ssse3(quint32 *dst, const uchar *src, int len) +Q_GUI_EXPORT void QT_FASTCALL qt_convert_rgb888_to_rgb32_ssse3(quint32 *dst, const uchar *src, int len) { quint32 *const end = dst + len; @@ -139,7 +138,7 @@ void convert_RGB888_to_RGB32_ssse3(QImageData *dest, const QImageData *src, Qt:: quint32 *dest_data = (quint32 *) dest->data; for (int i = 0; i < src->height; ++i) { - convert_rgb888_to_rgb32_ssse3(dest_data, src_data, src->width); + qt_convert_rgb888_to_rgb32_ssse3(dest_data, src_data, src->width); src_data += src->bytes_per_line; dest_data = (quint32 *)((uchar*)dest_data + dest->bytes_per_line); } diff --git a/src/gui/image/qjpeghandler.cpp b/src/gui/image/qjpeghandler.cpp index 972dd65..eda5efb 100644 --- a/src/gui/image/qjpeghandler.cpp +++ b/src/gui/image/qjpeghandler.cpp @@ -45,6 +45,7 @@ #include <qvariant.h> #include <qvector.h> #include <qbuffer.h> +#include <private/qsimd_p.h> #include <stdio.h> // jpeglib needs this to be pre-included #include <setjmp.h> @@ -75,6 +76,19 @@ extern "C" { QT_BEGIN_NAMESPACE +void QT_FASTCALL convert_rgb888_to_rgb32_C(quint32 *dst, const uchar *src, int len) +{ + // Expand 24->32 bpp. + for (int i = 0; i < len; ++i) { + *dst++ = qRgb(src[0], src[1], src[2]); + src += 3; + } +} + +typedef void (QT_FASTCALL *Rgb888ToRgb32Converter)(quint32 *dst, const uchar *src, int len); + +static Rgb888ToRgb32Converter rgb888ToRgb32ConverterPtr = convert_rgb888_to_rgb32_C; + struct my_error_mgr : public jpeg_error_mgr { jmp_buf setjmp_buffer; }; @@ -393,13 +407,9 @@ static bool read_jpeg_image(QImage *outImage, continue; // Haven't reached the starting line yet. if (info->output_components == 3) { - // Expand 24->32 bpp. uchar *in = rows[0] + clip.x() * 3; QRgb *out = (QRgb*)outImage->scanLine(y); - for (int i = 0; i < clip.width(); ++i) { - *out++ = qRgb(in[0], in[1], in[2]); - in += 3; - } + rgb888ToRgb32ConverterPtr(out, in, clip.width()); } else if (info->out_color_space == JCS_CMYK) { // Convert CMYK->RGB. uchar *in = rows[0] + clip.x() * 4; @@ -793,6 +803,22 @@ bool QJpegHandlerPrivate::read(QImage *image) QJpegHandler::QJpegHandler() : d(new QJpegHandlerPrivate(this)) { + const uint features = qDetectCPUFeatures(); + Q_UNUSED(features); +#if defined(QT_HAVE_NEON) + // from qimage_neon.cpp + Q_GUI_EXPORT void QT_FASTCALL qt_convert_rgb888_to_rgb32_neon(quint32 *dst, const uchar *src, int len); + + if (features & NEON) + rgb888ToRgb32ConverterPtr = qt_convert_rgb888_to_rgb32_neon; +#endif // QT_HAVE_NEON +#if defined(QT_HAVE_SSSE3) + // from qimage_ssse3.cpp + Q_GUI_EXPORT void QT_FASTCALL qt_convert_rgb888_to_rgb32_ssse3(quint32 *dst, const uchar *src, int len); + + if (features & SSSE3) + rgb888ToRgb32ConverterPtr = qt_convert_rgb888_to_rgb32_ssse3; +#endif // QT_HAVE_SSSE3 } QJpegHandler::~QJpegHandler() diff --git a/src/gui/image/qpnghandler.cpp b/src/gui/image/qpnghandler.cpp index 2cf8222..dc54313 100644 --- a/src/gui/image/qpnghandler.cpp +++ b/src/gui/image/qpnghandler.cpp @@ -389,7 +389,7 @@ bool Q_INTERNAL_WIN_NO_THROW QPngHandlerPrivate::readPngHeader() while (num_text--) { QString key, value; -#if defined(PNG_iTXt_SUPPORTED) +#if defined(PNG_iTXt_SUPPORTED) && !defined(QT_NO_TEXTCODEC) if (text_ptr->lang) { QTextCodec *codec = QTextCodec::codecForName(text_ptr->lang); if (codec) { diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp index 394d374..c4d60a5 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp +++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp @@ -364,10 +364,10 @@ void QCoeFepInputContext::applyHints(Qt::InputMethodHints hints) commitTemporaryPreeditString(); - bool numbersOnly = hints & ImhDigitsOnly || hints & ImhFormattedNumbersOnly - || hints & ImhDialableCharactersOnly; - bool noOnlys = !(numbersOnly || hints & ImhUppercaseOnly - || hints & ImhLowercaseOnly); + const bool anynumbermodes = hints & (ImhDigitsOnly | ImhFormattedNumbersOnly | ImhDialableCharactersOnly); + const bool anytextmodes = hints & (ImhUppercaseOnly | ImhLowercaseOnly | ImhEmailCharactersOnly | ImhUrlCharactersOnly); + const bool numbersOnly = anynumbermodes && !anytextmodes; + const bool noOnlys = !(hints & ImhExclusiveInputMask); TInt flags; Qt::InputMethodHints oldHints = hints; @@ -379,8 +379,7 @@ void QCoeFepInputContext::applyHints(Qt::InputMethodHints hints) } if (!noOnlys) { // Make sure that the preference is within the permitted set. - if (hints & ImhPreferNumbers && !(hints & ImhDigitsOnly || hints & ImhFormattedNumbersOnly - || hints & ImhDialableCharactersOnly)) { + if (hints & ImhPreferNumbers && !anynumbermodes) { hints &= ~ImhPreferNumbers; } else if (hints & ImhPreferUppercase && !(hints & ImhUppercaseOnly)) { hints &= ~ImhPreferUppercase; @@ -393,8 +392,7 @@ void QCoeFepInputContext::applyHints(Qt::InputMethodHints hints) hints |= ImhPreferLowercase; } else if (hints & ImhUppercaseOnly) { hints |= ImhPreferUppercase; - } else if (hints & ImhDigitsOnly || hints & ImhFormattedNumbersOnly - || hints & ImhDialableCharactersOnly) { + } else if (numbersOnly) { hints |= ImhPreferNumbers; } } @@ -408,13 +406,21 @@ void QCoeFepInputContext::applyHints(Qt::InputMethodHints hints) m_fepState->SetCurrentInputMode(EAknEditorTextInputMode); } flags = 0; - if (numbersOnly) { + if (noOnlys || (anynumbermodes && anytextmodes)) { + flags = EAknEditorAllInputModes; + } + else if (anynumbermodes) { flags |= EAknEditorNumericInputMode; + if (QSysInfo::s60Version() > QSysInfo::SV_S60_5_0 + && ((hints & ImhFormattedNumbersOnly) || (hints & ImhDialableCharactersOnly))) { + //workaround - the * key does not launch the symbols menu, making it impossible to use these modes unless text mode is enabled. + flags |= EAknEditorTextInputMode; + } } - if (hints & ImhUppercaseOnly || hints & ImhLowercaseOnly) { + else if (anytextmodes) { flags |= EAknEditorTextInputMode; } - if (flags == 0) { + else { flags = EAknEditorAllInputModes; } m_fepState->SetPermittedInputModes(flags); @@ -461,24 +467,33 @@ void QCoeFepInputContext::applyHints(Qt::InputMethodHints hints) if (hints & ImhNoPredictiveText || hints & ImhHiddenText) { flags |= EAknEditorFlagNoT9; } + // if alphanumeric input, or if multiple incompatible number modes are selected; + // then make all symbols available in numeric mode too. + if (!numbersOnly || ((hints & ImhFormattedNumbersOnly) && (hints & ImhDialableCharactersOnly))) + flags |= EAknEditorFlagUseSCTNumericCharmap; m_fepState->SetFlags(flags); ReportAknEdStateEvent(MAknEdStateObserver::EAknEdwinStateFlagsUpdate); - if (hints & ImhFormattedNumbersOnly) { + if (hints & ImhDialableCharactersOnly) { + // This is first, because if (ImhDialableCharactersOnly | ImhFormattedNumbersOnly) + // is specified, this one is more natural (# key enters a #) + flags = EAknEditorStandardNumberModeKeymap; + } else if (hints & ImhFormattedNumbersOnly) { + // # key enters decimal point flags = EAknEditorCalculatorNumberModeKeymap; } else if (hints & ImhDigitsOnly) { + // This is last, because it is most restrictive (# key is inactive) flags = EAknEditorPlainNumberModeKeymap; } else { - // ImhDialableCharactersOnly is the fallback as well, so we don't need to check for - // that flag. flags = EAknEditorStandardNumberModeKeymap; } m_fepState->SetNumericKeymap(static_cast<TAknEditorNumericKeymap>(flags)); - if (hints & ImhEmailCharactersOnly) { - m_fepState->SetSpecialCharacterTableResourceId(R_AVKON_EMAIL_ADDR_SPECIAL_CHARACTER_TABLE_DIALOG); - } else if (hints & ImhUrlCharactersOnly) { + if (hints & ImhUrlCharactersOnly) { + // URL characters is everything except space, so a superset of the other restrictions m_fepState->SetSpecialCharacterTableResourceId(R_AVKON_URL_SPECIAL_CHARACTER_TABLE_DIALOG); + } else if (hints & ImhEmailCharactersOnly) { + m_fepState->SetSpecialCharacterTableResourceId(R_AVKON_EMAIL_ADDR_SPECIAL_CHARACTER_TABLE_DIALOG); } else { m_fepState->SetSpecialCharacterTableResourceId(R_AVKON_SPECIAL_CHARACTER_TABLE_DIALOG); } diff --git a/src/gui/inputmethod/qinputcontextfactory.cpp b/src/gui/inputmethod/qinputcontextfactory.cpp index ec8d8e2..865c1b2 100644 --- a/src/gui/inputmethod/qinputcontextfactory.cpp +++ b/src/gui/inputmethod/qinputcontextfactory.cpp @@ -73,7 +73,7 @@ #endif #ifdef Q_WS_S60 #include "qcoefepinputcontext_p.h" -#include "akninputlanguageinfo.h" +#include "AknInputLanguageInfo.h" #endif #include "private/qfactoryloader_p.h" diff --git a/src/gui/itemviews/qlistview.cpp b/src/gui/itemviews/qlistview.cpp index 5e70a6a..ce1f0e5 100644 --- a/src/gui/itemviews/qlistview.cpp +++ b/src/gui/itemviews/qlistview.cpp @@ -2855,7 +2855,10 @@ QPoint QIconModeViewBase::initDynamicLayout(const QListViewLayoutInfo &info) y = info.bounds.y() + info.spacing; items.reserve(rowCount() - hiddenCount()); } else { - const QListViewItem item = items.at(info.first - 1); + int idx = info.first - 1; + while (idx > 0 && !items.at(idx).isValid()) + --idx; + const QListViewItem &item = items.at(idx); x = item.x; y = item.y; if (info.flow == QListView::LeftToRight) @@ -2986,6 +2989,8 @@ void QIconModeViewBase::doDynamicLayout(const QListViewLayoutInfo &info) else contentsSize.rwidth() += info.spacing; } + if (rect.size().isEmpty()) + return; // resize tree int insertFrom = info.first; if (done || info.first == 0) { diff --git a/src/gui/itemviews/qsortfilterproxymodel.cpp b/src/gui/itemviews/qsortfilterproxymodel.cpp index f9b6b94..953a7f1 100644 --- a/src/gui/itemviews/qsortfilterproxymodel.cpp +++ b/src/gui/itemviews/qsortfilterproxymodel.cpp @@ -774,7 +774,7 @@ void QSortFilterProxyModelPrivate::source_items_inserted( if (model->rowCount(source_parent) == delta_item_count) { // Items were inserted where there were none before. // If it was new rows make sure to create mappings for columns so that a - // valid mapping can be retreived later and vice-versa. + // valid mapping can be retrieved later and vice-versa. QVector<int> &orthogonal_proxy_to_source = (orient == Qt::Horizontal) ? m->source_rows : m->source_columns; QVector<int> &orthogonal_source_to_proxy = (orient == Qt::Horizontal) ? m->proxy_rows : m->proxy_columns; diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index cdcdfe2..028e3aa 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -472,7 +472,7 @@ int qt_antialiasing_threshold = -1; static int drag_time = 500; #ifdef Q_OS_SYMBIAN // The screens are a bit too small to for your thumb when using only 4 pixels drag distance. -static int drag_distance = 8; +static int drag_distance = 12; #else static int drag_distance = 4; #endif @@ -2538,6 +2538,13 @@ void QApplication::setActiveWindow(QWidget* act) sendSpontaneousEvent(w, &activationChange); } +#ifdef QT_MAC_USE_COCOA + // In case the user clicked on a child window, we need to + // reestablish the stacking order of the window so + // it pops in front of other child windows in cocoa: + qt_cocoaStackChildWindowOnTopOfOtherChildren(window); +#endif + for(int i = 0; i < toBeDeactivated.size(); ++i) { QWidget *w = toBeDeactivated.at(i); sendSpontaneousEvent(w, &windowDeactivate); diff --git a/src/gui/kernel/qapplication.h b/src/gui/kernel/qapplication.h index 404059e..a790c69 100644 --- a/src/gui/kernel/qapplication.h +++ b/src/gui/kernel/qapplication.h @@ -412,6 +412,9 @@ private: #if defined(QT_RX71_MULTITOUCH) Q_PRIVATE_SLOT(d_func(), void _q_readRX71MultiTouchEvents()) #endif +#if defined(Q_OS_SYMBIAN) + Q_PRIVATE_SLOT(d_func(), void _q_aboutToQuit()) +#endif }; QT_END_NAMESPACE diff --git a/src/gui/kernel/qapplication_p.h b/src/gui/kernel/qapplication_p.h index 97ceea9..5f200c0 100644 --- a/src/gui/kernel/qapplication_p.h +++ b/src/gui/kernel/qapplication_p.h @@ -517,6 +517,7 @@ public: int symbianHandleCommand(const QSymbianEvent *symbianEvent); int symbianResourceChange(const QSymbianEvent *symbianEvent); + void _q_aboutToQuit(); #endif #if defined(Q_WS_WIN) || defined(Q_WS_X11) || defined (Q_WS_QWS) || defined(Q_WS_MAC) void sendSyntheticEnterLeave(QWidget *widget); @@ -601,7 +602,7 @@ private: #endif #ifdef Q_OS_SYMBIAN - static QHash<TInt, TUint> scanCodeCache; + QHash<TInt, TUint> scanCodeCache; #endif static QApplicationPrivate *self; diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index c51329a..4ed00f8 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -87,6 +87,10 @@ #include <hal.h> #include <hal_data.h> +#ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS +#include <graphics/wstfxconst.h> +#endif + QT_BEGIN_NAMESPACE // Goom Events through Window Server @@ -112,6 +116,25 @@ QS60Data* qGlobalS60Data() return qt_s60Data(); } +#ifdef Q_WS_S60 +void QS60Data::setStatusPaneAndButtonGroupVisibility(bool statusPaneVisible, bool buttonGroupVisible) +{ + bool buttonGroupVisibilityChanged = false; + if (CEikButtonGroupContainer *const b = buttonGroupContainer()) { + buttonGroupVisibilityChanged = (b->IsVisible() != buttonGroupVisible); + b->MakeVisible(buttonGroupVisible); + } + bool statusPaneVisibilityChanged = false; + if (CEikStatusPane *const s = statusPane()) { + statusPaneVisibilityChanged = (s->IsVisible() != statusPaneVisible); + s->MakeVisible(statusPaneVisible); + } + if (buttonGroupVisibilityChanged && !statusPaneVisibilityChanged) + // Ensure that control rectangle is updated + static_cast<QSymbianControl *>(QApplication::activeWindow()->winId())->handleClientAreaChange(); +} +#endif + bool qt_nograb() // application no-grab option { #if defined(QT_DEBUG) @@ -207,8 +230,6 @@ void QS60Beep::MatoPlayComplete(TInt aError) } -QHash<TInt, TUint> QApplicationPrivate::scanCodeCache; - static Qt::KeyboardModifiers mapToQtModifiers(TUint s60Modifiers) { Qt::KeyboardModifiers result = Qt::NoModifier; @@ -355,7 +376,7 @@ void QSymbianControl::ConstructL(bool isWindowOwning, bool desktop) { if (!desktop) { - if (isWindowOwning or !qwidget->parentWidget()) + if (isWindowOwning || !qwidget->parentWidget()) CreateWindowL(S60->windowGroup()); else /** @@ -378,6 +399,34 @@ void QSymbianControl::ConstructL(bool isWindowOwning, bool desktop) DrawableWindow()->SetPointerGrab(ETrue); } + +#ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS + if (OwnsWindow()) { + TTfxWindowPurpose windowPurpose(ETfxPurposeNone); + switch (qwidget->windowType()) { + case Qt::Dialog: + windowPurpose = ETfxPurposeDialogWindow; + break; + case Qt::Popup: + windowPurpose = ETfxPurposePopupWindow; + break; + case Qt::Tool: + windowPurpose = ETfxPurposeToolWindow; + break; + case Qt::ToolTip: + windowPurpose = ETfxPurposeToolTipWindow; + break; + case Qt::SplashScreen: + windowPurpose = ETfxPurposeSplashScreenWindow; + break; + default: + windowPurpose = (isWindowOwning || !qwidget->parentWidget()) + ? ETfxPurposeWindow : ETfxPurposeChildWindow; + break; + } + Window().SetPurpose(windowPurpose); + } +#endif } QSymbianControl::~QSymbianControl() @@ -625,251 +674,302 @@ TKeyResponse QSymbianControl::OfferKeyEventL(const TKeyEvent& keyEvent, TEventCo TKeyResponse QSymbianControl::OfferKeyEvent(const TKeyEvent& keyEvent, TEventCode type) { - switch (type) { - //case EEventKeyDown: // <-- Intentionally left out. See below. - case EEventKeyUp: - case EEventKey: - { + /* + S60 has a confusing way of delivering key events. There are three types of + events: EEventKey, EEventKeyDown and EEventKeyUp. When a key is pressed, + EEventKeyDown is first generated, followed by EEventKey. Then, when the key is + released, EEventKeyUp is generated. + However, it is possible that only the EEventKey is generated alone, typically + in relation to virtual keyboards. In that case we need to take care to + generate both press and release events in Qt, since applications expect that. + We do this by having three states for each used scan code, depending on the + events received. See the switch below for what happens in each state + transition. + */ + + if (type != EEventKeyDown) + if (handleVirtualMouse(keyEvent, type) == EKeyWasConsumed) + return EKeyWasConsumed; + + TKeyResponse ret = EKeyWasNotConsumed; +#define GET_RETURN(x) (ret = ((x) == EKeyWasConsumed) ? EKeyWasConsumed : ret) + + // This top level switch corresponds to the states, and the inner switches + // correspond to the transitions. + QS60Data::ScanCodeState &scanCodeState = S60->scanCodeStates[keyEvent.iScanCode]; + switch (scanCodeState) { + case QS60Data::Unpressed: + switch (type) { + case EEventKeyDown: + scanCodeState = QS60Data::KeyDown; + break; + case EEventKey: + GET_RETURN(sendSymbianKeyEvent(keyEvent, QEvent::KeyPress)); + GET_RETURN(sendSymbianKeyEvent(keyEvent, QEvent::KeyRelease)); + break; + case EEventKeyUp: + // No action. + break; + } + break; + case QS60Data::KeyDown: + switch (type) { + case EEventKeyDown: + // This should never happen, just stay in this state to be safe. + break; + case EEventKey: + GET_RETURN(sendSymbianKeyEvent(keyEvent, QEvent::KeyPress)); + scanCodeState = QS60Data::KeyDownAndKey; + break; + case EEventKeyUp: + scanCodeState = QS60Data::Unpressed; + break; + } + break; + case QS60Data::KeyDownAndKey: + switch (type) { + case EEventKeyDown: + // This should never happen, just stay in this state to be safe. + break; + case EEventKey: + GET_RETURN(sendSymbianKeyEvent(keyEvent, QEvent::KeyRelease)); + GET_RETURN(sendSymbianKeyEvent(keyEvent, QEvent::KeyPress)); + break; + case EEventKeyUp: + GET_RETURN(sendSymbianKeyEvent(keyEvent, QEvent::KeyRelease)); + scanCodeState = QS60Data::Unpressed; + break; + } + break; + } + return ret; + +#undef GET_RETURN +} + +TKeyResponse QSymbianControl::sendSymbianKeyEvent(const TKeyEvent &keyEvent, QEvent::Type type) +{ + // Because S60 does not generate keysyms for EKeyEventDown and EKeyEventUp + // events, we need to cache the keysyms from the EKeyEvent events. This is what + // resolveS60ScanCode does. + TUint s60Keysym = QApplicationPrivate::resolveS60ScanCode(keyEvent.iScanCode, + keyEvent.iCode); + int keyCode; + if (s60Keysym == EKeyNull){ //some key events have 0 in iCode, for them iScanCode should be used + keyCode = qt_keymapper_private()->mapS60ScanCodesToQt(keyEvent.iScanCode); + } else if (s60Keysym >= 0x20 && s60Keysym < ENonCharacterKeyBase) { + // Normal characters keys. + keyCode = s60Keysym; + } else { + // Special S60 keys. + keyCode = qt_keymapper_private()->mapS60KeyToQt(s60Keysym); + } + + Qt::KeyboardModifiers mods = mapToQtModifiers(keyEvent.iModifiers); + QKeyEventEx qKeyEvent(type, keyCode, mods, qt_keymapper_private()->translateKeyEvent(keyCode, mods), + (keyEvent.iRepeats != 0), 1, keyEvent.iScanCode, s60Keysym, keyEvent.iModifiers); + QWidget *widget; + widget = QWidget::keyboardGrabber(); + if (!widget) { + if (QApplicationPrivate::popupWidgets != 0) { + widget = QApplication::activePopupWidget()->focusWidget(); + if (!widget) { + widget = QApplication::activePopupWidget(); + } + } else { + widget = QApplicationPrivate::focus_widget; + if (!widget) { + widget = qwidget; + } + } + } + + QEventDispatcherS60 *dispatcher; + // It is theoretically possible for someone to install a different event dispatcher. + if ((dispatcher = qobject_cast<QEventDispatcherS60 *>(widget->d_func()->threadData->eventDispatcher)) != 0) { + if (dispatcher->excludeUserInputEvents()) { + dispatcher->saveInputEvent(this, widget, new QKeyEventEx(qKeyEvent)); + return EKeyWasConsumed; + } + } + return sendKeyEvent(widget, &qKeyEvent); +} + +TKeyResponse QSymbianControl::handleVirtualMouse(const TKeyEvent& keyEvent,TEventCode type) +{ #ifndef QT_NO_CURSOR - if (S60->mouseInteractionEnabled && S60->virtualMouseRequired) { - //translate keys to pointer - if ((keyEvent.iScanCode >= EStdKeyLeftArrow && keyEvent.iScanCode <= EStdKeyDownArrow) || + if (S60->mouseInteractionEnabled && S60->virtualMouseRequired) { + //translate keys to pointer + if ((keyEvent.iScanCode >= EStdKeyLeftArrow && keyEvent.iScanCode <= EStdKeyDownArrow) || (keyEvent.iScanCode >= EStdKeyDevice10 && keyEvent.iScanCode <= EStdKeyDevice13) || keyEvent.iScanCode == EStdKeyDevice3) { - QPoint pos = QCursor::pos(); - TPointerEvent fakeEvent; - fakeEvent.iType = (TPointerEvent::TType)(-1); - fakeEvent.iModifiers = keyEvent.iModifiers; - TInt x = pos.x(); - TInt y = pos.y(); - if (type == EEventKeyUp) { - S60->virtualMouseAccelTimeout.start(); - switch (keyEvent.iScanCode) { - case EStdKeyLeftArrow: - S60->virtualMousePressedKeys &= ~QS60Data::Left; - break; - case EStdKeyRightArrow: - S60->virtualMousePressedKeys &= ~QS60Data::Right; - break; - case EStdKeyUpArrow: - S60->virtualMousePressedKeys &= ~QS60Data::Up; - break; - case EStdKeyDownArrow: - S60->virtualMousePressedKeys &= ~QS60Data::Down; - break; - // diagonal keys (named aliases don't exist in 3.1 SDK) - case EStdKeyDevice10: - S60->virtualMousePressedKeys &= ~QS60Data::LeftUp; - break; - case EStdKeyDevice11: - S60->virtualMousePressedKeys &= ~QS60Data::RightUp; - break; - case EStdKeyDevice12: - S60->virtualMousePressedKeys &= ~QS60Data::RightDown; - break; - case EStdKeyDevice13: - S60->virtualMousePressedKeys &= ~QS60Data::LeftDown; - break; - case EStdKeyDevice3: //select - if (S60->virtualMousePressedKeys & QS60Data::Select) - fakeEvent.iType = TPointerEvent::EButton1Up; - S60->virtualMousePressedKeys &= ~QS60Data::Select; - break; - } + QPoint pos = QCursor::pos(); + TPointerEvent fakeEvent; + fakeEvent.iType = (TPointerEvent::TType)(-1); + fakeEvent.iModifiers = keyEvent.iModifiers; + TInt x = pos.x(); + TInt y = pos.y(); + if (type == EEventKeyUp) { + S60->virtualMouseAccelTimeout.start(); + switch (keyEvent.iScanCode) { + case EStdKeyLeftArrow: + S60->virtualMousePressedKeys &= ~QS60Data::Left; + break; + case EStdKeyRightArrow: + S60->virtualMousePressedKeys &= ~QS60Data::Right; + break; + case EStdKeyUpArrow: + S60->virtualMousePressedKeys &= ~QS60Data::Up; + break; + case EStdKeyDownArrow: + S60->virtualMousePressedKeys &= ~QS60Data::Down; + break; + // diagonal keys (named aliases don't exist in 3.1 SDK) + case EStdKeyDevice10: + S60->virtualMousePressedKeys &= ~QS60Data::LeftUp; + break; + case EStdKeyDevice11: + S60->virtualMousePressedKeys &= ~QS60Data::RightUp; + break; + case EStdKeyDevice12: + S60->virtualMousePressedKeys &= ~QS60Data::RightDown; + break; + case EStdKeyDevice13: + S60->virtualMousePressedKeys &= ~QS60Data::LeftDown; + break; + case EStdKeyDevice3: //select + if (S60->virtualMousePressedKeys & QS60Data::Select) + fakeEvent.iType = TPointerEvent::EButton1Up; + S60->virtualMousePressedKeys &= ~QS60Data::Select; + break; } - else if (type == EEventKey) { - int dx = 0; - int dy = 0; - if (keyEvent.iScanCode != EStdKeyDevice3) { - m_doubleClickTimer.invalidate(); - //reset mouse accelleration after a short time with no moves - const int maxTimeBetweenKeyEventsMs = 500; - if (S60->virtualMouseAccelTimeout.isValid() && + } + else if (type == EEventKey) { + int dx = 0; + int dy = 0; + if (keyEvent.iScanCode != EStdKeyDevice3) { + m_doubleClickTimer.invalidate(); + //reset mouse accelleration after a short time with no moves + const int maxTimeBetweenKeyEventsMs = 500; + if (S60->virtualMouseAccelTimeout.isValid() && S60->virtualMouseAccelTimeout.hasExpired(maxTimeBetweenKeyEventsMs)) { - S60->virtualMouseAccelDX = 0; - S60->virtualMouseAccelDY = 0; - } - S60->virtualMouseAccelTimeout.invalidate(); + S60->virtualMouseAccelDX = 0; + S60->virtualMouseAccelDY = 0; } - switch (keyEvent.iScanCode) { - case EStdKeyLeftArrow: - S60->virtualMousePressedKeys |= QS60Data::Left; - dx = -1; - fakeEvent.iType = TPointerEvent::EMove; - break; - case EStdKeyRightArrow: - S60->virtualMousePressedKeys |= QS60Data::Right; - dx = 1; - fakeEvent.iType = TPointerEvent::EMove; - break; - case EStdKeyUpArrow: - S60->virtualMousePressedKeys |= QS60Data::Up; - dy = -1; - fakeEvent.iType = TPointerEvent::EMove; - break; - case EStdKeyDownArrow: - S60->virtualMousePressedKeys |= QS60Data::Down; - dy = 1; - fakeEvent.iType = TPointerEvent::EMove; - break; - case EStdKeyDevice10: - S60->virtualMousePressedKeys |= QS60Data::LeftUp; - dx = -1; - dy = -1; - fakeEvent.iType = TPointerEvent::EMove; - break; - case EStdKeyDevice11: - S60->virtualMousePressedKeys |= QS60Data::RightUp; - dx = 1; - dy = -1; - fakeEvent.iType = TPointerEvent::EMove; - break; - case EStdKeyDevice12: - S60->virtualMousePressedKeys |= QS60Data::RightDown; - dx = 1; - dy = 1; - fakeEvent.iType = TPointerEvent::EMove; - break; - case EStdKeyDevice13: - S60->virtualMousePressedKeys |= QS60Data::LeftDown; - dx = -1; - dy = 1; - fakeEvent.iType = TPointerEvent::EMove; - break; - case EStdKeyDevice3: - // Platform bug. If you start pressing several keys simultaneously (for - // example for drag'n'drop), Symbian starts producing spurious up and - // down messages for some keys. Therefore, make sure we have a clean slate - // of pressed keys before starting a new button press. - if (S60->virtualMousePressedKeys & QS60Data::Select) { - return EKeyWasConsumed; - } else { - S60->virtualMousePressedKeys |= QS60Data::Select; - fakeEvent.iType = TPointerEvent::EButton1Down; - if (m_doubleClickTimer.isValid() + S60->virtualMouseAccelTimeout.invalidate(); + } + switch (keyEvent.iScanCode) { + case EStdKeyLeftArrow: + S60->virtualMousePressedKeys |= QS60Data::Left; + dx = -1; + fakeEvent.iType = TPointerEvent::EMove; + break; + case EStdKeyRightArrow: + S60->virtualMousePressedKeys |= QS60Data::Right; + dx = 1; + fakeEvent.iType = TPointerEvent::EMove; + break; + case EStdKeyUpArrow: + S60->virtualMousePressedKeys |= QS60Data::Up; + dy = -1; + fakeEvent.iType = TPointerEvent::EMove; + break; + case EStdKeyDownArrow: + S60->virtualMousePressedKeys |= QS60Data::Down; + dy = 1; + fakeEvent.iType = TPointerEvent::EMove; + break; + case EStdKeyDevice10: + S60->virtualMousePressedKeys |= QS60Data::LeftUp; + dx = -1; + dy = -1; + fakeEvent.iType = TPointerEvent::EMove; + break; + case EStdKeyDevice11: + S60->virtualMousePressedKeys |= QS60Data::RightUp; + dx = 1; + dy = -1; + fakeEvent.iType = TPointerEvent::EMove; + break; + case EStdKeyDevice12: + S60->virtualMousePressedKeys |= QS60Data::RightDown; + dx = 1; + dy = 1; + fakeEvent.iType = TPointerEvent::EMove; + break; + case EStdKeyDevice13: + S60->virtualMousePressedKeys |= QS60Data::LeftDown; + dx = -1; + dy = 1; + fakeEvent.iType = TPointerEvent::EMove; + break; + case EStdKeyDevice3: + // Platform bug. If you start pressing several keys simultaneously (for + // example for drag'n'drop), Symbian starts producing spurious up and + // down messages for some keys. Therefore, make sure we have a clean slate + // of pressed keys before starting a new button press. + if (S60->virtualMousePressedKeys & QS60Data::Select) { + return EKeyWasConsumed; + } else { + S60->virtualMousePressedKeys |= QS60Data::Select; + fakeEvent.iType = TPointerEvent::EButton1Down; + if (m_doubleClickTimer.isValid() && !m_doubleClickTimer.hasExpired(QApplication::doubleClickInterval())) { - fakeEvent.iModifiers |= EModifierDoubleClick; - m_doubleClickTimer.invalidate(); - } else { - m_doubleClickTimer.start(); - } + fakeEvent.iModifiers |= EModifierDoubleClick; + m_doubleClickTimer.invalidate(); + } else { + m_doubleClickTimer.start(); } - break; } - if (dx) { - int cdx = S60->virtualMouseAccelDX; - //reset accel on change of sign, else double accel - if (dx * cdx <= 0) - cdx = dx; - else - cdx *= 4; - //cap accelleration - if (dx * cdx > S60->virtualMouseMaxAccel) - cdx = dx * S60->virtualMouseMaxAccel; - //move mouse position - x += cdx; - S60->virtualMouseAccelDX = cdx; - } - - if (dy) { - int cdy = S60->virtualMouseAccelDY; - if (dy * cdy <= 0) - cdy = dy; - else - cdy *= 4; - if (dy * cdy > S60->virtualMouseMaxAccel) - cdy = dy * S60->virtualMouseMaxAccel; - y += cdy; - S60->virtualMouseAccelDY = cdy; - } - } - //clip to screen size (window server allows a sprite hotspot to be outside the screen) - if (x < 0) - x = 0; - else if (x >= S60->screenWidthInPixels) - x = S60->screenWidthInPixels - 1; - if (y < 0) - y = 0; - else if (y >= S60->screenHeightInPixels) - y = S60->screenHeightInPixels - 1; - TPoint epos(x, y); - TPoint cpos = epos - PositionRelativeToScreen(); - fakeEvent.iPosition = cpos; - fakeEvent.iParentPosition = epos; - if(fakeEvent.iType != -1) - HandlePointerEvent(fakeEvent); - return EKeyWasConsumed; - } - } -#endif - // S60 has a confusing way of delivering key events. There are three types of - // events: EKeyEvent, EKeyEventDown and EKeyEventUp. When a key is pressed, the - // two first events are generated. When releasing the key, the last one is - // generated. - // Because S60 does not generate keysyms for EKeyEventDown and EKeyEventUp events, - // we need to do some special tricks to map it to the Qt way. First, we completely - // discard EKeyEventDown events, since they are redundant. Second, since - // EKeyEventUp does not give us a keysym, we need to cache the keysyms from - // the EKeyEvent events. This is what resolveS60ScanCode does. - - - // ### hackish way to send Qt application to background when pressing right softkey - /* - if( keyEvent.iScanCode == EStdKeyDevice1 ) { - S60->window_group->SetOrdinalPosition(-1); - qApp->setActiveWindow(0); - return EKeyWasNotConsumed; - } - */ - - TUint s60Keysym = QApplicationPrivate::resolveS60ScanCode(keyEvent.iScanCode, - keyEvent.iCode); - int keyCode; - if (s60Keysym == EKeyNull){ //some key events have 0 in iCode, for them iScanCode should be used - keyCode = qt_keymapper_private()->mapS60ScanCodesToQt(keyEvent.iScanCode); - } else if (s60Keysym >= 0x20 && s60Keysym < ENonCharacterKeyBase) { - // Normal characters keys. - keyCode = s60Keysym; - } else { - // Special S60 keys. - keyCode = qt_keymapper_private()->mapS60KeyToQt(s60Keysym); - } - - Qt::KeyboardModifiers mods = mapToQtModifiers(keyEvent.iModifiers); - QKeyEventEx qKeyEvent(type == EEventKeyUp ? QEvent::KeyRelease : QEvent::KeyPress, keyCode, - mods, qt_keymapper_private()->translateKeyEvent(keyCode, mods), - (keyEvent.iRepeats != 0), 1, keyEvent.iScanCode, s60Keysym, keyEvent.iModifiers); -// WId wid = reinterpret_cast<RWindowGroup *>(keyEvent.Handle())->Child(); -// if (!wid) -// Could happen if window isn't shown yet. -// return EKeyWasNotConsumed; - QWidget *widget; - widget = QWidget::keyboardGrabber(); - if (!widget) { - if (QApplicationPrivate::popupWidgets != 0) { - widget = QApplication::activePopupWidget()->focusWidget(); - if (!widget) { - widget = QApplication::activePopupWidget(); + break; } - } else { - widget = QApplicationPrivate::focus_widget; - if (!widget) { - widget = qwidget; + if (dx) { + int cdx = S60->virtualMouseAccelDX; + //reset accel on change of sign, else double accel + if (dx * cdx <= 0) + cdx = dx; + else + cdx *= 4; + //cap accelleration + if (dx * cdx > S60->virtualMouseMaxAccel) + cdx = dx * S60->virtualMouseMaxAccel; + //move mouse position + x += cdx; + S60->virtualMouseAccelDX = cdx; } - } - } - QEventDispatcherS60 *dispatcher; - // It is theoretically possible for someone to install a different event dispatcher. - if ((dispatcher = qobject_cast<QEventDispatcherS60 *>(widget->d_func()->threadData->eventDispatcher)) != 0) { - if (dispatcher->excludeUserInputEvents()) { - dispatcher->saveInputEvent(this, widget, new QKeyEventEx(qKeyEvent)); - return EKeyWasConsumed; + if (dy) { + int cdy = S60->virtualMouseAccelDY; + if (dy * cdy <= 0) + cdy = dy; + else + cdy *= 4; + if (dy * cdy > S60->virtualMouseMaxAccel) + cdy = dy * S60->virtualMouseMaxAccel; + y += cdy; + S60->virtualMouseAccelDY = cdy; + } } + //clip to screen size (window server allows a sprite hotspot to be outside the screen) + if (x < 0) + x = 0; + else if (x >= S60->screenWidthInPixels) + x = S60->screenWidthInPixels - 1; + if (y < 0) + y = 0; + else if (y >= S60->screenHeightInPixels) + y = S60->screenHeightInPixels - 1; + TPoint epos(x, y); + TPoint cpos = epos - PositionRelativeToScreen(); + fakeEvent.iPosition = cpos; + fakeEvent.iParentPosition = epos; + if(fakeEvent.iType != -1) + HandlePointerEvent(fakeEvent); + return EKeyWasConsumed; } - return sendKeyEvent(widget, &qKeyEvent); - } } +#endif + return EKeyWasNotConsumed; } @@ -967,7 +1067,7 @@ void QSymbianControl::Draw(const TRect& controlRect) const if (QApplicationPrivate::runtime_graphics_system) { QRuntimeWindowSurface *rtSurface = static_cast<QRuntimeWindowSurface*>(qwidget->windowSurface()); - s60Surface = static_cast<QS60WindowSurface *>(rtSurface->m_windowSurface); + s60Surface = static_cast<QS60WindowSurface *>(rtSurface->m_windowSurface.data()); } else #endif s60Surface = static_cast<QS60WindowSurface *>(qwidget->windowSurface()); @@ -987,7 +1087,8 @@ void QSymbianControl::Draw(const TRect& controlRect) const break; case QWExtra::ZeroFill: - if (Window().DisplayMode() == EColor16MA) { + if (Window().DisplayMode() == EColor16MA + || Window().DisplayMode() == Q_SYMBIAN_ECOLOR16MAP) { gc.SetBrushStyle(CGraphicsContext::ESolidBrush); gc.SetDrawMode(CGraphicsContext::EDrawModeWriteAlpha); gc.SetBrushColor(TRgb::Color16MA(0)); @@ -1100,17 +1201,12 @@ void QSymbianControl::FocusChanged(TDrawNow /* aDrawNow */) qwidget->d_func()->setWindowTitle_sys(qwidget->windowTitle()); #ifdef Q_WS_S60 // If widget is fullscreen/minimized, hide status pane and button container otherwise show them. - CEikStatusPane *statusPane = S60->statusPane(); - CEikButtonGroupContainer *buttonGroup = S60->buttonGroupContainer(); - TBool visible = !(qwidget->windowState() & (Qt::WindowFullScreen | Qt::WindowMinimized)); - if (statusPane) - statusPane->MakeVisible(visible); - if (buttonGroup) { - // Visibility - const TBool isFullscreen = qwidget->windowState() & Qt::WindowFullScreen; - const TBool cbaVisibilityHint = qwidget->windowFlags() & Qt::WindowSoftkeysVisibleHint; - buttonGroup->MakeVisible(visible || (isFullscreen && cbaVisibilityHint)); - } + const bool visible = !(qwidget->windowState() & (Qt::WindowFullScreen | Qt::WindowMinimized)); + const bool statusPaneVisibility = visible; + const bool isFullscreen = qwidget->windowState() & Qt::WindowFullScreen; + const bool cbaVisibilityHint = qwidget->windowFlags() & Qt::WindowSoftkeysVisibleHint; + const bool buttonGroupVisibility = (visible || (isFullscreen && cbaVisibilityHint)); + S60->setStatusPaneAndButtonGroupVisibility(statusPaneVisibility, buttonGroupVisibility); #endif } else if (QApplication::activeWindow() == qwidget->window()) { if (CCoeEnv::Static()->AppUi()->IsDisplayingMenuOrDialog() || S60->menuBeingConstructed) { @@ -1265,7 +1361,7 @@ void qt_init(QApplicationPrivate * /* priv */, int) // framework destruction. TTrapHandler *origTrapHandler = User::TrapHandler(); - // The S60 framework has not been initalized. We need to do it. + // The S60 framework has not been initialized. We need to do it. TApaApplicationFactory factory(S60->s60ApplicationFactory ? S60->s60ApplicationFactory : newS60Application); CApaCommandLine* commandLine = 0; @@ -1420,6 +1516,10 @@ void qt_init(QApplicationPrivate * /* priv */, int) systemFont.setFamily(systemFont.defaultFamily()); QApplicationPrivate::setSystemFont(systemFont); +#ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS + QObject::connect(qApp, SIGNAL(aboutToQuit()), qApp, SLOT(_q_aboutToQuit())); +#endif + /* ### Commented out for now as parameter handling not needed in SOS(yet). Code below will break testlib with -o flag int argc = priv->argc; @@ -1443,7 +1543,7 @@ void qt_init(QApplicationPrivate * /* priv */, int) */ // Register WId with the metatype system. This is to enable - // QWidgetPrivate::create_sys to used delayed slot invokation in order + // QWidgetPrivate::create_sys to used delayed slot invocation in order // to destroy WId objects during reparenting. qRegisterMetaType<WId>("WId"); } @@ -1509,6 +1609,9 @@ bool QApplicationPrivate::modalState() void QApplicationPrivate::enterModal_sys(QWidget *widget) { +#ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS + S60->wsSession().SendEffectCommand(ETfxCmdAppModalModeEnter); +#endif if (widget) { static_cast<QSymbianControl *>(widget->effectiveWinId())->FadeBehindPopup(ETrue); // Modal partial screen dialogs (like queries) capture pointer events. @@ -1524,6 +1627,9 @@ void QApplicationPrivate::enterModal_sys(QWidget *widget) void QApplicationPrivate::leaveModal_sys(QWidget *widget) { +#ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS + S60->wsSession().SendEffectCommand(ETfxCmdAppModalModeExit); +#endif if (widget) { static_cast<QSymbianControl *>(widget->effectiveWinId())->FadeBehindPopup(EFalse); // ### FixMe: Add specialized behaviour for fullscreen modal dialogs @@ -1820,6 +1926,9 @@ int QApplicationPrivate::symbianProcessWsEvent(const QSymbianEvent *symbianEvent break; QRefCountedWidgetBackingStore &backingStore = window->d_func()->maybeTopData()->backingStore; if (visChangedEvent->iFlags & TWsVisibilityChangedEvent::ENotVisible) { +#ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS + S60->wsSession().SendEffectCommand(ETfxCmdDeallocateLayer); +#endif // Decrement backing store reference count backingStore.deref(); // In order to ensure that any resources used by the window surface @@ -1830,6 +1939,9 @@ int QApplicationPrivate::symbianProcessWsEvent(const QSymbianEvent *symbianEvent // Increment backing store reference count backingStore.ref(); } else { +#ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS + S60->wsSession().SendEffectCommand(ETfxCmdRestoreLayer); +#endif // Create backing store with an initial reference count of 1 backingStore.create(window); backingStore.ref(); @@ -1890,13 +2002,6 @@ int QApplicationPrivate::symbianProcessWsEvent(const QSymbianEvent *symbianEvent if (switchToSwRendering) { QRuntimeGraphicsSystem *gs = static_cast<QRuntimeGraphicsSystem*>(QApplicationPrivate::graphics_system); - - uint memoryUsage = gs->memoryUsage(); - uint memoryForFullscreen = ( S60->screenDepth / 8 ) - * S60->screenWidthInPixels - * S60->screenHeightInPixels; - - S60->memoryLimitForHwRendering = memoryUsage - memoryForFullscreen; gs->setGraphicsSystem(QLatin1String("raster")); } } @@ -1912,8 +2017,7 @@ int QApplicationPrivate::symbianProcessWsEvent(const QSymbianEvent *symbianEvent if(QApplicationPrivate::runtime_graphics_system) { QRuntimeGraphicsSystem *gs = static_cast<QRuntimeGraphicsSystem*>(QApplicationPrivate::graphics_system); - gs->setGraphicsSystem(QLatin1String("openvg"), S60->memoryLimitForHwRendering); - S60->memoryLimitForHwRendering = 0; + gs->setGraphicsSystem(QLatin1String("openvg")); } #endif break; @@ -2082,13 +2186,18 @@ void QApplication::setEffectEnabled(Qt::UIEffect /* effect */, bool /* enable */ TUint QApplicationPrivate::resolveS60ScanCode(TInt scanCode, TUint keysym) { + if (!scanCode) + return keysym; + + QApplicationPrivate *d = QApplicationPrivate::instance(); + if (keysym) { // If keysym is specified, cache it. - scanCodeCache.insert(scanCode, keysym); + d->scanCodeCache.insert(scanCode, keysym); return keysym; } else { // If not, retrieve the cached version. - return scanCodeCache[scanCode]; + return d->scanCodeCache[scanCode]; } } @@ -2208,6 +2317,14 @@ void QApplication::restoreOverrideCursor() #endif // QT_NO_CURSOR +void QApplicationPrivate::_q_aboutToQuit() +{ +#ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS + // Send the shutdown tfx command + S60->wsSession().SendEffectCommand(ETfxCmdAppShutDown); +#endif +} + QS60ThreadLocalData::QS60ThreadLocalData() { CCoeEnv *env = CCoeEnv::Static(); diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp index 628a041..11db75b 100644 --- a/src/gui/kernel/qapplication_win.cpp +++ b/src/gui/kernel/qapplication_win.cpp @@ -714,8 +714,10 @@ static void qt_set_windows_updateScrollBar(QWidget *widget) if (QWidget *w = static_cast<QWidget *>(o)) qt_set_windows_updateScrollBar(w); } +#ifndef QT_NO_SCROLLBAR if (qobject_cast<QScrollBar*>(widget)) widget->updateGeometry(); +#endif } @@ -1506,6 +1508,7 @@ extern "C" LRESULT QT_WIN_CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wPa switch (message) { #ifndef Q_WS_WINCE +#ifndef QT_NO_SESSIONMANAGER case WM_QUERYENDSESSION: { if (sm_smActive) // bogus message from windows RETURN(true); @@ -1538,6 +1541,7 @@ extern "C" LRESULT QT_WIN_CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wPa RETURN(0); } +#endif case WM_DISPLAYCHANGE: if (QApplication::type() == QApplication::Tty) break; @@ -2243,6 +2247,7 @@ extern "C" LRESULT QT_WIN_CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wPa } break; +#ifndef QT_NO_CONTEXTMENU case WM_CONTEXTMENU: { // it's not VK_APPS or Shift+F10, but a click in the NC area @@ -2271,6 +2276,7 @@ extern "C" LRESULT QT_WIN_CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wPa } break; #endif +#endif case WM_IME_STARTCOMPOSITION: case WM_IME_ENDCOMPOSITION: diff --git a/src/gui/kernel/qcocoawindowdelegate_mac.mm b/src/gui/kernel/qcocoawindowdelegate_mac.mm index 2b9cf85..ffba6c2 100644 --- a/src/gui/kernel/qcocoawindowdelegate_mac.mm +++ b/src/gui/kernel/qcocoawindowdelegate_mac.mm @@ -394,5 +394,25 @@ static void cleanupCocoaWindowDelegate() } return NO; } + +- (void)syncContentViewFrame: (NSNotification *)notification +{ + NSView *cView = [notification object]; + if (cView) { + NSWindow *window = [cView window]; + QWidget *qwidget = m_windowHash->value(window); + if (qwidget) { + QWidgetData *widgetData = qt_qwidget_data(qwidget); + NSRect rect = [cView frame]; + const QSize newSize(rect.size.width, rect.size.height); + const QSize &oldSize = widgetData->crect.size(); + if (newSize != oldSize) { + [self syncSizeForWidget:qwidget toSize:newSize fromSize:oldSize]; + } + } + + } +} + @end #endif// QT_MAC_USE_COCOA diff --git a/src/gui/kernel/qcocoawindowdelegate_mac_p.h b/src/gui/kernel/qcocoawindowdelegate_mac_p.h index de9c946..2ca9b13 100644 --- a/src/gui/kernel/qcocoawindowdelegate_mac_p.h +++ b/src/gui/kernel/qcocoawindowdelegate_mac_p.h @@ -105,5 +105,6 @@ QT_FORWARD_DECLARE_CLASS(QWidgetData) - (NSSize)closestAcceptableSizeForWidget:(QWidget *)qwidget window:(NSWindow *)window withNewSize:(NSSize)proposedSize; - (QWidget *)qt_qwidgetForWindow:(NSWindow *)window; +- (void)syncContentViewFrame: (NSNotification *)notification; @end #endif diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp index fc2c995..d2b2098 100644 --- a/src/gui/kernel/qevent.cpp +++ b/src/gui/kernel/qevent.cpp @@ -4281,6 +4281,11 @@ QTouchEvent::TouchPoint &QTouchEvent::TouchPoint::operator=(const QTouchEvent::T QGestureEvent::accept() for each of them, or an event filter consumes the event. + \section1 Further Reading + + For an overview of gesture handling in Qt and information on using gestures + in your applications, see the \l{Gestures Programming} document. + \sa QGesture, QGestureRecognizer, QWidget::grabGesture(), QGraphicsObject::grabGesture() */ diff --git a/src/gui/kernel/qgesture.cpp b/src/gui/kernel/qgesture.cpp index 4a4452a..13274c4 100644 --- a/src/gui/kernel/qgesture.cpp +++ b/src/gui/kernel/qgesture.cpp @@ -59,6 +59,9 @@ QT_BEGIN_NAMESPACE the QGestureRecognizer object that is registered with the application; see QGestureRecognizer::registerRecognizer(). + For an overview of gesture handling in Qt and information on using gestures + in your applications, see the \l{Gestures Programming} document. + \section1 Gesture Properties The class has a list of properties that can be queried by the user to get @@ -219,7 +222,10 @@ QGesture::GestureCancelPolicy QGesture::gestureCancelPolicy() const \image pangesture.png - \sa {Gestures Programming}, QPinchGesture, QSwipeGesture + For an overview of gesture handling in Qt and information on using gestures + in your applications, see the \l{Gestures Programming} document. + + \sa QPinchGesture, QSwipeGesture */ /*! @@ -314,6 +320,9 @@ void QPanGesture::setAcceleration(qreal value) them closer together or further apart to change the scale factor, zoom, or level of detail of the user interface. + For an overview of gesture handling in Qt and information on using gestures + in your applications, see the \l{Gestures Programming} document. + \image pinchgesture.png Instead of repeatedly applying the same pinching gesture, the user may @@ -322,7 +331,7 @@ void QPanGesture::setAcceleration(qreal value) will continue to be delivered to the target object, containing an instance of QPinchGesture in the Qt::GestureUpdated state. - \sa {Gestures Programming}, QPanGesture, QSwipeGesture + \sa QPanGesture, QSwipeGesture */ /*! @@ -572,7 +581,10 @@ void QPinchGesture::setRotationAngle(qreal value) \image swipegesture.png - \sa {Gestures Programming}, QPanGesture, QPinchGesture + For an overview of gesture handling in Qt and information on using gestures + in your applications, see the \l{Gestures Programming} document. + + \sa QPanGesture, QPinchGesture */ /*! @@ -667,7 +679,10 @@ void QSwipeGesture::setSwipeAngle(qreal value) \brief The QTapGesture class describes a tap gesture made by the user. \ingroup gestures - \sa {Gestures Programming}, QPanGesture, QPinchGesture + For an overview of gesture handling in Qt and information on using gestures + in your applications, see the \l{Gestures Programming} document. + + \sa QPanGesture, QPinchGesture */ /*! @@ -700,7 +715,10 @@ void QTapGesture::setPosition(const QPointF &value) gesture made by the user. \ingroup gestures - \sa {Gestures Programming}, QPanGesture, QPinchGesture + For an overview of gesture handling in Qt and information on using gestures + in your applications, see the \l{Gestures Programming} document. + + \sa QPanGesture, QPinchGesture */ /*! diff --git a/src/gui/kernel/qgesturerecognizer.cpp b/src/gui/kernel/qgesturerecognizer.cpp index 3e23bbf..e0e7784 100644 --- a/src/gui/kernel/qgesturerecognizer.cpp +++ b/src/gui/kernel/qgesturerecognizer.cpp @@ -62,6 +62,9 @@ QT_BEGIN_NAMESPACE need to use this class directly. Instances will be created behind the scenes by the framework. + For an overview of gesture handling in Qt and information on using gestures + in your applications, see the \l{Gestures Programming} document. + \section1 Recognizing Gestures The process of recognizing gestures involves filtering input events sent to specific diff --git a/src/gui/kernel/qpalette.cpp b/src/gui/kernel/qpalette.cpp index 38ec806..55d5727 100644 --- a/src/gui/kernel/qpalette.cpp +++ b/src/gui/kernel/qpalette.cpp @@ -872,7 +872,7 @@ void QPalette::detach() \note The current ColorGroup is not taken into account when comparing palettes - \sa operator== + \sa operator==() */ /*! @@ -882,7 +882,7 @@ void QPalette::detach() \note The current ColorGroup is not taken into account when comparing palettes - \sa operator!= + \sa operator!=() */ bool QPalette::operator==(const QPalette &p) const { diff --git a/src/gui/kernel/qt_cocoa_helpers_mac.mm b/src/gui/kernel/qt_cocoa_helpers_mac.mm index 2eee434..88ff1e6 100644 --- a/src/gui/kernel/qt_cocoa_helpers_mac.mm +++ b/src/gui/kernel/qt_cocoa_helpers_mac.mm @@ -722,9 +722,11 @@ bool qt_dispatchKeyEvent(void * /*NSEvent * */ keyEvent, QWidget *widgetToGetEve unsigned int info = 0; if ([event type] == NSKeyDown) { NSString *characters = [event characters]; - unichar value = [characters characterAtIndex:0]; - qt_keymapper_private()->updateKeyMap(0, key_event, (void *)&value); - info = value; + if ([characters length]) { + unichar value = [characters characterAtIndex:0]; + qt_keymapper_private()->updateKeyMap(0, key_event, (void *)&value); + info = value; + } } // Redirect keys to alien widgets. @@ -1542,6 +1544,22 @@ void macSyncDrawingOnFirstInvocation(void * /*OSWindowRef */window) [theWindow display]; } } + +void qt_cocoaStackChildWindowOnTopOfOtherChildren(QWidget *childWidget) +{ + if (!childWidget) + return; + + QWidget *parent = childWidget->parentWidget(); + if (childWidget->isWindow() && parent) { + if ([[qt_mac_window_for(parent) childWindows] containsObject:qt_mac_window_for(childWidget)]) { + QWidgetPrivate *d = qt_widget_private(childWidget); + d->setSubWindowStacking(false); + d->setSubWindowStacking(true); + } + } +} + #endif // QT_MAC_USE_COCOA QT_END_NAMESPACE diff --git a/src/gui/kernel/qt_cocoa_helpers_mac_p.h b/src/gui/kernel/qt_cocoa_helpers_mac_p.h index 57d2c90..5c23392 100644 --- a/src/gui/kernel/qt_cocoa_helpers_mac_p.h +++ b/src/gui/kernel/qt_cocoa_helpers_mac_p.h @@ -148,6 +148,7 @@ void qt_cocoaChangeOverrideCursor(const QCursor &cursor); // These methods exists only for supporting unified mode. void macDrawRectOnTop(void * /*OSWindowRef */ window); void macSyncDrawingOnFirstInvocation(void * /*OSWindowRef */window); +void qt_cocoaStackChildWindowOnTopOfOtherChildren(QWidget *widget); #endif void qt_mac_menu_collapseSeparators(void * /*NSMenu */ menu, bool collapse); bool qt_dispatchKeyEvent(void * /*NSEvent * */ keyEvent, QWidget *widgetToGetEvent); diff --git a/src/gui/kernel/qt_s60_p.h b/src/gui/kernel/qt_s60_p.h index d8ef67d..a18ea07 100644 --- a/src/gui/kernel/qt_s60_p.h +++ b/src/gui/kernel/qt_s60_p.h @@ -141,8 +141,15 @@ public: int supportsPremultipliedAlpha : 1; int avkonComponentsSupportTransparency : 1; int menuBeingConstructed : 1; - int memoryLimitForHwRendering; QApplication::QS60MainApplicationFactory s60ApplicationFactory; // typedef'ed pointer type + + enum ScanCodeState { + Unpressed, + KeyDown, + KeyDownAndKey + }; + QHash<TInt, ScanCodeState> scanCodeStates; + static inline void updateScreenSize(); inline RWsSession& wsSession(); static inline RWindowGroup& windowGroup(); @@ -155,6 +162,7 @@ public: static inline CAknTitlePane* titlePane(); static inline CAknContextPane* contextPane(); static inline CEikButtonGroupContainer* buttonGroupContainer(); + static void setStatusPaneAndButtonGroupVisibility(bool statusPaneVisible, bool buttonGroupVisible); #endif #ifdef Q_OS_SYMBIAN @@ -223,7 +231,9 @@ protected: private: void HandlePointerEvent(const TPointerEvent& aPointerEvent); TKeyResponse OfferKeyEvent(const TKeyEvent& aKeyEvent,TEventCode aType); + TKeyResponse sendSymbianKeyEvent(const TKeyEvent &keyEvent, QEvent::Type type); TKeyResponse sendKeyEvent(QWidget *widget, QKeyEvent *keyEvent); + TKeyResponse handleVirtualMouse(const TKeyEvent& keyEvent,TEventCode type); bool sendMouseEvent(QWidget *widget, QMouseEvent *mEvent); void sendMouseEvent( QWidget *receiver, @@ -236,6 +246,8 @@ private: #ifdef QT_SYMBIAN_SUPPORTS_ADVANCED_POINTER void translateAdvancedPointerEvent(const TAdvancedPointerEvent *event); #endif + +public: void handleClientAreaChange(); private: @@ -278,7 +290,6 @@ inline QS60Data::QS60Data() supportsPremultipliedAlpha(0), avkonComponentsSupportTransparency(0), menuBeingConstructed(0), - memoryLimitForHwRendering(0), s60ApplicationFactory(0) #ifdef Q_OS_SYMBIAN ,s60InstalledTrapHandler(0) diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp index 2818d88..56349ad 100644 --- a/src/gui/kernel/qwidget_s60.cpp +++ b/src/gui/kernel/qwidget_s60.cpp @@ -1113,15 +1113,10 @@ void QWidget::setWindowState(Qt::WindowStates newstate) // The window decoration visibility has to be changed before doing actual window state // change since in that order the availableGeometry will return directly the right size and // we will avoid unnecessarty redraws - CEikStatusPane *statusPane = S60->statusPane(); - CEikButtonGroupContainer *buttonGroup = S60->buttonGroupContainer(); - TBool visible = !(newstate & (Qt::WindowFullScreen | Qt::WindowMinimized)); - if (statusPane) - statusPane->MakeVisible(visible); - if (buttonGroup) { - // Visibility - buttonGroup->MakeVisible(visible || (isFullscreen && cbaRequested)); - } + const bool visible = !(newstate & (Qt::WindowFullScreen | Qt::WindowMinimized)); + const bool statusPaneVisibility = visible; + const bool buttonGroupVisibility = (visible || (isFullscreen && cbaRequested)); + S60->setStatusPaneAndButtonGroupVisibility(statusPaneVisibility, buttonGroupVisibility); #endif // Q_WS_S60 // Ensure the initial size is valid, since we store it as normalGeometry below. @@ -1133,8 +1128,10 @@ void QWidget::setWindowState(Qt::WindowStates newstate) const bool cbaVisibilityHint = windowFlags() & Qt::WindowSoftkeysVisibleHint; if (newstate & Qt::WindowFullScreen && !cbaVisibilityHint) { + setAttribute(Qt::WA_OutsideWSRange, false); window->SetExtentToWholeScreen(); } else if (newstate & Qt::WindowMaximized || ((newstate & Qt::WindowFullScreen) && cbaVisibilityHint)) { + setAttribute(Qt::WA_OutsideWSRange, false); TRect maxExtent = qt_QRect2TRect(qApp->desktop()->availableGeometry(this)); window->SetExtent(maxExtent.iTl, maxExtent.Size()); } else { @@ -1143,7 +1140,7 @@ void QWidget::setWindowState(Qt::WindowStates newstate) // accurate because it did not consider the status pane. This means that when returning // normal mode after showing the status pane, the geometry would overlap so we should // move it if it never had an explicit position. - if (!wasMoved && statusPane && visible) { + if (!wasMoved && S60->statusPane() && visible) { TPoint tl = static_cast<CEikAppUi*>(S60->appUi())->ClientRect().iTl; normalGeometry.setTopLeft(QPoint(tl.iX, tl.iY)); } diff --git a/src/gui/kernel/qwidget_win.cpp b/src/gui/kernel/qwidget_win.cpp index 91521a8..05d9a5f 100644 --- a/src/gui/kernel/qwidget_win.cpp +++ b/src/gui/kernel/qwidget_win.cpp @@ -166,7 +166,7 @@ static void qt_tablet_init() qt_tablet_widget = new QWidget(0); qt_tablet_widget->createWinId(); qt_tablet_widget->setObjectName(QLatin1String("Qt internal tablet widget")); - // We dont need this internal widget to appear in QApplication::topLevelWidgets() + // We don't need this internal widget to appear in QApplication::topLevelWidgets() if (QWidgetPrivate::allWidgets) QWidgetPrivate::allWidgets->remove(qt_tablet_widget); LOGCONTEXT lcMine; @@ -1547,7 +1547,7 @@ bool QWidgetPrivate::shouldShowMaximizeButton() { if (data.window_flags & Qt::MSWindowsFixedSizeDialogHint) return false; - // if the user explicitely asked for the maximize button, we try to add + // if the user explicitly asked for the maximize button, we try to add // it even if the window has fixed size. if (data.window_flags & Qt::CustomizeWindowHint && data.window_flags & Qt::WindowMaximizeButtonHint) diff --git a/src/gui/painting/painting.pri b/src/gui/painting/painting.pri index 4023f65..dfa4a48 100644 --- a/src/gui/painting/painting.pri +++ b/src/gui/painting/painting.pri @@ -246,23 +246,8 @@ symbian { QMAKE_CXXFLAGS.ARMCC *= -O3 } -neon:*-g++* { - DEFINES += QT_HAVE_NEON - HEADERS += painting/qdrawhelper_neon_p.h - SOURCES += painting/qdrawhelper_neon.cpp - QMAKE_CXXFLAGS *= -mfpu=neon - - DRAWHELPER_NEON_ASM_FILES = ../3rdparty/pixman/pixman-arm-neon-asm.S painting/qdrawhelper_neon_asm.S - - neon_compiler.commands = $$QMAKE_CXX -c - neon_compiler.commands += $(CXXFLAGS) $(INCPATH) ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT} - neon_compiler.dependency_type = TYPE_C - neon_compiler.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)} - neon_compiler.input = DRAWHELPER_NEON_ASM_FILES - neon_compiler.variable_out = OBJECTS - neon_compiler.name = compiling[neon] ${QMAKE_FILE_IN} - silent:neon_compiler.commands = @echo compiling[neon] ${QMAKE_FILE_IN} && $$neon_compiler.commands - QMAKE_EXTRA_COMPILERS += neon_compiler -} +NEON_SOURCES += painting/qdrawhelper_neon.cpp +NEON_HEADERS += painting/qdrawhelper_neon_p.h +NEON_ASM += ../3rdparty/pixman/pixman-arm-neon-asm.S painting/qdrawhelper_neon_asm.S include($$PWD/../../3rdparty/zlib_dependency.pri) diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp index f5641a4..eb92d3f 100644 --- a/src/gui/painting/qdrawhelper.cpp +++ b/src/gui/painting/qdrawhelper.cpp @@ -7938,8 +7938,10 @@ void qInitDrawhelperAsm() uint const_alpha); extern void QT_FASTCALL comp_func_solid_SourceOver_sse2(uint *destPixels, int length, uint color, uint const_alpha); extern void QT_FASTCALL comp_func_Plus_sse2(uint *dst, const uint *src, int length, uint const_alpha); + extern void QT_FASTCALL comp_func_Source_sse2(uint *dst, const uint *src, int length, uint const_alpha); functionForModeAsm[0] = comp_func_SourceOver_sse2; + functionForModeAsm[QPainter::CompositionMode_Source] = comp_func_Source_sse2; functionForModeAsm[QPainter::CompositionMode_Plus] = comp_func_Plus_sse2; functionForModeSolidAsm[0] = comp_func_solid_SourceOver_sse2; diff --git a/src/gui/painting/qdrawhelper_p.h b/src/gui/painting/qdrawhelper_p.h index 1a87127..d04c70d 100644 --- a/src/gui/painting/qdrawhelper_p.h +++ b/src/gui/painting/qdrawhelper_p.h @@ -314,18 +314,61 @@ struct QSpanData void adjustSpanMethods(); }; +#if defined(Q_CC_RVCT) +# pragma push +# pragma arm +#endif +Q_STATIC_INLINE_FUNCTION uint INTERPOLATE_PIXEL_255(uint x, uint a, uint y, uint b) { + uint t = (x & 0xff00ff) * a + (y & 0xff00ff) * b; + t = (t + ((t >> 8) & 0xff00ff) + 0x800080) >> 8; + t &= 0xff00ff; -Q_STATIC_INLINE_FUNCTION uint BYTE_MUL_RGB16(uint x, uint a) { - a += 1; - uint t = (((x & 0x07e0)*a) >> 8) & 0x07e0; - t |= (((x & 0xf81f)*(a>>2)) >> 6) & 0xf81f; - return t; + x = ((x >> 8) & 0xff00ff) * a + ((y >> 8) & 0xff00ff) * b; + x = (x + ((x >> 8) & 0xff00ff) + 0x800080); + x &= 0xff00ff00; + x |= t; + return x; } +#if defined(Q_CC_RVCT) +# pragma pop +#endif -Q_STATIC_INLINE_FUNCTION uint BYTE_MUL_RGB16_32(uint x, uint a) { - uint t = (((x & 0xf81f07e0) >> 5)*a) & 0xf81f07e0; - t |= (((x & 0x07e0f81f)*a) >> 5) & 0x07e0f81f; - return t; +#if QT_POINTER_SIZE == 8 // 64-bit versions + +Q_STATIC_INLINE_FUNCTION uint INTERPOLATE_PIXEL_256(uint x, uint a, uint y, uint b) { + quint64 t = (((quint64(x)) | ((quint64(x)) << 24)) & 0x00ff00ff00ff00ff) * a; + t += (((quint64(y)) | ((quint64(y)) << 24)) & 0x00ff00ff00ff00ff) * b; + t >>= 8; + t &= 0x00ff00ff00ff00ff; + return (uint(t)) | (uint(t >> 24)); +} + +Q_STATIC_INLINE_FUNCTION uint BYTE_MUL(uint x, uint a) { + quint64 t = (((quint64(x)) | ((quint64(x)) << 24)) & 0x00ff00ff00ff00ff) * a; + t = (t + ((t >> 8) & 0xff00ff00ff00ff) + 0x80008000800080) >> 8; + t &= 0x00ff00ff00ff00ff; + return (uint(t)) | (uint(t >> 24)); +} + +Q_STATIC_INLINE_FUNCTION uint PREMUL(uint x) { + uint a = x >> 24; + quint64 t = (((quint64(x)) | ((quint64(x)) << 24)) & 0x00ff00ff00ff00ff) * a; + t = (t + ((t >> 8) & 0xff00ff00ff00ff) + 0x80008000800080) >> 8; + t &= 0x000000ff00ff00ff; + return (uint(t)) | (uint(t >> 24)) | (a << 24); +} + +#else // 32-bit versions + +Q_STATIC_INLINE_FUNCTION uint INTERPOLATE_PIXEL_256(uint x, uint a, uint y, uint b) { + uint t = (x & 0xff00ff) * a + (y & 0xff00ff) * b; + t >>= 8; + t &= 0xff00ff; + + x = ((x >> 8) & 0xff00ff) * a + ((y >> 8) & 0xff00ff) * b; + x &= 0xff00ff00; + x |= t; + return x; } #if defined(Q_CC_RVCT) @@ -359,6 +402,21 @@ Q_STATIC_INLINE_FUNCTION uint PREMUL(uint x) { x |= t | (a << 24); return x; } +#endif + + +Q_STATIC_INLINE_FUNCTION uint BYTE_MUL_RGB16(uint x, uint a) { + a += 1; + uint t = (((x & 0x07e0)*a) >> 8) & 0x07e0; + t |= (((x & 0xf81f)*(a>>2)) >> 6) & 0xf81f; + return t; +} + +Q_STATIC_INLINE_FUNCTION uint BYTE_MUL_RGB16_32(uint x, uint a) { + uint t = (((x & 0xf81f07e0) >> 5)*a) & 0xf81f07e0; + t |= (((x & 0x07e0f81f)*a) >> 5) & 0x07e0f81f; + return t; +} #define INV_PREMUL(p) \ (qAlpha(p) == 0 ? 0 : \ @@ -1847,70 +1905,6 @@ inline int qBlue565(quint16 rgb) { return (b << 3) | (b >> 2); } -#if 1 -Q_STATIC_INLINE_FUNCTION uint INTERPOLATE_PIXEL_256(uint x, uint a, uint y, uint b) { - uint t = (x & 0xff00ff) * a + (y & 0xff00ff) * b; - t >>= 8; - t &= 0xff00ff; - - x = ((x >> 8) & 0xff00ff) * a + ((y >> 8) & 0xff00ff) * b; - x &= 0xff00ff00; - x |= t; - return x; -} - -#if defined(Q_CC_RVCT) -# pragma push -# pragma arm -#endif -Q_STATIC_INLINE_FUNCTION uint INTERPOLATE_PIXEL_255(uint x, uint a, uint y, uint b) { - uint t = (x & 0xff00ff) * a + (y & 0xff00ff) * b; - t = (t + ((t >> 8) & 0xff00ff) + 0x800080) >> 8; - t &= 0xff00ff; - - x = ((x >> 8) & 0xff00ff) * a + ((y >> 8) & 0xff00ff) * b; - x = (x + ((x >> 8) & 0xff00ff) + 0x800080); - x &= 0xff00ff00; - x |= t; - return x; -} -#if defined(Q_CC_RVCT) -# pragma pop -#endif -#else -// possible implementation for 64 bit -Q_STATIC_INLINE_FUNCTION uint INTERPOLATE_PIXEL_256(uint x, uint a, uint y, uint b) { - ulong t = (((ulong(x)) | ((ulong(x)) << 24)) & 0x00ff00ff00ff00ff) * a; - t += (((ulong(y)) | ((ulong(y)) << 24)) & 0x00ff00ff00ff00ff) * b; - t >>= 8; - t &= 0x00ff00ff00ff00ff; - return (uint(t)) | (uint(t >> 24)); -} - -Q_STATIC_INLINE_FUNCTION uint INTERPOLATE_PIXEL_255(uint x, uint a, uint y, uint b) { - ulong t = (((ulong(x)) | ((ulong(x)) << 24)) & 0x00ff00ff00ff00ff) * a; - t += (((ulong(y)) | ((ulong(y)) << 24)) & 0x00ff00ff00ff00ff) * b; - t = (t + ((t >> 8) & 0xff00ff00ff00ff) + 0x80008000800080); - t &= 0x00ff00ff00ff00ff; - return (uint(t)) | (uint(t >> 24)); -} - -Q_STATIC_INLINE_FUNCTION uint BYTE_MUL(uint x, uint a) { - ulong t = (((ulong(x)) | ((ulong(x)) << 24)) & 0x00ff00ff00ff00ff) * a; - t = (t + ((t >> 8) & 0xff00ff00ff00ff) + 0x80008000800080); - t &= 0x00ff00ff00ff00ff; - return (uint(t)) | (uint(t >> 24)); -} - -Q_STATIC_INLINE_FUNCTION uint PREMUL(uint x) { - uint a = x >> 24; - ulong t = (((ulong(x)) | ((ulong(x)) << 24)) & 0x00ff00ff00ff00ff) * a; - t = (t + ((t >> 8) & 0xff00ff00ff00ff) + 0x80008000800080); - t &= 0x00ff00ff00ff00ff; - return (uint(t)) | (uint(t >> 24)) | 0xff000000; -} -#endif - const uint qt_bayer_matrix[16][16] = { { 0x1, 0xc0, 0x30, 0xf0, 0xc, 0xcc, 0x3c, 0xfc, 0x3, 0xc3, 0x33, 0xf3, 0xf, 0xcf, 0x3f, 0xff}, diff --git a/src/gui/painting/qdrawhelper_sse2.cpp b/src/gui/painting/qdrawhelper_sse2.cpp index e090ae5..22c0384 100644 --- a/src/gui/painting/qdrawhelper_sse2.cpp +++ b/src/gui/painting/qdrawhelper_sse2.cpp @@ -112,9 +112,7 @@ void qt_blend_rgb32_on_rgb32_sse2(uchar *destPixels, int dbpl, int x = 0; // First, align dest to 16 bytes: - const int offsetToAlignOn16Bytes = (4 - ((reinterpret_cast<quintptr>(dst) >> 2) & 0x3)) & 0x3; - const int prologLength = qMin(w, offsetToAlignOn16Bytes); - for (; x < prologLength; ++x) { + ALIGNMENT_PROLOGUE_16BYTES(dst, x, w) { quint32 s = src[x]; s = BYTE_MUL(s, const_alpha); dst[x] = INTERPOLATE_PIXEL_255(src[x], const_alpha, dst[x], one_minus_const_alpha); @@ -182,12 +180,10 @@ inline int comp_func_Plus_one_pixel(uint d, const uint s) void QT_FASTCALL comp_func_Plus_sse2(uint *dst, const uint *src, int length, uint const_alpha) { int x = 0; - const int offsetToAlignOn16Bytes = (4 - ((reinterpret_cast<quintptr>(dst) >> 2) & 0x3)) & 0x3; - const int prologLength = qMin(length, offsetToAlignOn16Bytes); if (const_alpha == 255) { // 1) Prologue: align destination on 16 bytes - for (; x < prologLength; ++x) + ALIGNMENT_PROLOGUE_16BYTES(dst, x, length) dst[x] = comp_func_Plus_one_pixel(dst[x], src[x]); // 2) composition with SSE2 @@ -208,7 +204,7 @@ void QT_FASTCALL comp_func_Plus_sse2(uint *dst, const uint *src, int length, uin const __m128i oneMinusConstAlpha = _mm_set1_epi16(one_minus_const_alpha); // 1) Prologue: align destination on 16 bytes - for (; x < prologLength; ++x) + ALIGNMENT_PROLOGUE_16BYTES(dst, x, length) dst[x] = comp_func_Plus_one_pixel_const_alpha(dst[x], src[x], const_alpha, one_minus_const_alpha); const __m128i half = _mm_set1_epi16(0x80); @@ -229,6 +225,37 @@ void QT_FASTCALL comp_func_Plus_sse2(uint *dst, const uint *src, int length, uin } } +void QT_FASTCALL comp_func_Source_sse2(uint *dst, const uint *src, int length, uint const_alpha) +{ + if (const_alpha == 255) { + ::memcpy(dst, src, length * sizeof(uint)); + } else { + const int ialpha = 255 - const_alpha; + + int x = 0; + + // 1) prologue, align on 16 bytes + ALIGNMENT_PROLOGUE_16BYTES(dst, x, length) + dst[x] = INTERPOLATE_PIXEL_255(src[x], const_alpha, dst[x], ialpha); + + // 2) interpolate pixels with SSE2 + const __m128i half = _mm_set1_epi16(0x80); + const __m128i colorMask = _mm_set1_epi32(0x00ff00ff); + const __m128i constAlphaVector = _mm_set1_epi16(const_alpha); + const __m128i oneMinusConstAlpha = _mm_set1_epi16(ialpha); + for (; x < length - 3; x += 4) { + const __m128i srcVector = _mm_loadu_si128((__m128i *)&src[x]); + __m128i dstVector = _mm_load_si128((__m128i *)&dst[x]); + INTERPOLATE_PIXEL_255_SSE2(dstVector, srcVector, dstVector, constAlphaVector, oneMinusConstAlpha, colorMask, half) + _mm_store_si128((__m128i *)&dst[x], dstVector); + } + + // 3) Epilogue + for (; x < length; ++x) + dst[x] = INTERPOLATE_PIXEL_255(src[x], const_alpha, dst[x], ialpha); + } +} + void qt_memfill32_sse2(quint32 *dest, quint32 value, int count) { if (count < 7) { diff --git a/src/gui/painting/qdrawingprimitive_sse2_p.h b/src/gui/painting/qdrawingprimitive_sse2_p.h index 18355c2..d8f6bf5 100644 --- a/src/gui/painting/qdrawingprimitive_sse2_p.h +++ b/src/gui/painting/qdrawingprimitive_sse2_p.h @@ -143,9 +143,7 @@ QT_BEGIN_NAMESPACE int x = 0; \ \ /* First, get dst aligned. */ \ - const int offsetToAlignOn16Bytes = (4 - ((reinterpret_cast<quintptr>(dst) >> 2) & 0x3)) & 0x3;\ - const int prologLength = qMin(length, offsetToAlignOn16Bytes);\ - for (; x < prologLength; ++x) { \ + ALIGNMENT_PROLOGUE_16BYTES(dst, x, length) { \ uint s = src[x]; \ if (s >= 0xff000000) \ dst[x] = s; \ @@ -202,9 +200,7 @@ QT_BEGIN_NAMESPACE { \ int x = 0; \ \ - const int offsetToAlignOn16Bytes = (4 - ((reinterpret_cast<quintptr>(dst) >> 2) & 0x3)) & 0x3;\ - const int prologLength = qMin(length, offsetToAlignOn16Bytes);\ - for (; x < prologLength; ++x) { \ + ALIGNMENT_PROLOGUE_16BYTES(dst, x, length) { \ quint32 s = src[x]; \ if (s != 0) { \ s = BYTE_MUL(s, const_alpha); \ diff --git a/src/gui/painting/qgraphicssystem_runtime.cpp b/src/gui/painting/qgraphicssystem_runtime.cpp index 3438137..2828e9d 100644 --- a/src/gui/painting/qgraphicssystem_runtime.cpp +++ b/src/gui/painting/qgraphicssystem_runtime.cpp @@ -53,10 +53,8 @@ QT_BEGIN_NAMESPACE static int qt_pixmap_serial = 0; #define READBACK(f) \ - m_graphicsSystem->decreaseMemoryUsage(memoryUsage()); \ f \ - readBackInfo(); \ - m_graphicsSystem->increaseMemoryUsage(memoryUsage()); \ + readBackInfo(); class QDeferredGraphicsSystemChange : public QObject @@ -252,16 +250,8 @@ QPixmapData* QRuntimePixmapData::runtimeData() const return m_data; } -uint QRuntimePixmapData::memoryUsage() const -{ - if(is_null || d == 0) - return 0; - return w * h * (d / 8); -} - - QRuntimeWindowSurface::QRuntimeWindowSurface(const QRuntimeGraphicsSystem *gs, QWidget *window) - : QWindowSurface(window), m_windowSurface(0), m_pendingWindowSurface(0), m_graphicsSystem(gs) + : QWindowSurface(window), m_graphicsSystem(gs) { } @@ -269,7 +259,6 @@ QRuntimeWindowSurface::QRuntimeWindowSurface(const QRuntimeGraphicsSystem *gs, Q QRuntimeWindowSurface::~QRuntimeWindowSurface() { m_graphicsSystem->removeWindowSurface(this); - delete m_windowSurface; } QPaintDevice *QRuntimeWindowSurface::paintDevice() @@ -288,16 +277,13 @@ void QRuntimeWindowSurface::flush(QWidget *widget, const QRegion ®ion, #ifdef QT_DEBUG qDebug() << "QRuntimeWindowSurface::flush() - destroy pending window surface"; #endif - delete m_pendingWindowSurface; - m_pendingWindowSurface = 0; + m_pendingWindowSurface.reset(); } } void QRuntimeWindowSurface::setGeometry(const QRect &rect) { - m_graphicsSystem->decreaseMemoryUsage(memoryUsage()); m_windowSurface->setGeometry(rect); - m_graphicsSystem->increaseMemoryUsage(memoryUsage()); } bool QRuntimeWindowSurface::scroll(const QRegion &area, int dx, int dy) @@ -330,27 +316,21 @@ QPoint QRuntimeWindowSurface::offset(const QWidget *widget) const return m_windowSurface->offset(widget); } -uint QRuntimeWindowSurface::memoryUsage() const -{ - QPaintDevice *pdev = m_windowSurface->paintDevice(); - if (pdev && pdev->depth() != 0) - return pdev->width() * pdev->height() * (pdev->depth()/8); - - return 0; -} - QRuntimeGraphicsSystem::QRuntimeGraphicsSystem() - : m_memoryUsage(0), m_windowSurfaceDestroyPolicy(DestroyImmediately), - m_graphicsSystem(0), m_graphicsSystemChangeMemoryLimit(0) + : m_windowSurfaceDestroyPolicy(DestroyImmediately), + m_graphicsSystem(0) { QApplicationPrivate::graphics_system_name = QLatin1String("runtime"); QApplicationPrivate::runtime_graphics_system = true; +#ifdef QT_DEFAULT_RUNTIME_SYSTEM + m_graphicsSystemName = QLatin1String(QT_DEFAULT_RUNTIME_SYSTEM); + if (m_graphicsSystemName.isNull()) +#endif + m_graphicsSystemName = QLatin1String("raster"); + #ifdef Q_OS_SYMBIAN - m_graphicsSystemName = QLatin1String("openvg"); m_windowSurfaceDestroyPolicy = DestroyAfterFirstFlush; -#else - m_graphicsSystemName = QLatin1String("raster"); #endif m_graphicsSystem = QGraphicsSystemFactory::create(m_graphicsSystemName); @@ -373,51 +353,30 @@ QWindowSurface *QRuntimeGraphicsSystem::createWindowSurface(QWidget *widget) con { Q_ASSERT(m_graphicsSystem); QRuntimeWindowSurface *rtSurface = new QRuntimeWindowSurface(this, widget); - rtSurface->m_windowSurface = m_graphicsSystem->createWindowSurface(widget); + rtSurface->m_windowSurface.reset(m_graphicsSystem->createWindowSurface(widget)); widget->setWindowSurface(rtSurface); m_windowSurfaces << rtSurface; - increaseMemoryUsage(rtSurface->memoryUsage()); return rtSurface; } -/*! - Sets graphics system when resource memory consumption is under /a memoryUsageLimit. -*/ -void QRuntimeGraphicsSystem::setGraphicsSystem(const QString &name, uint memoryUsageLimit) -{ -#ifdef QT_DEBUG - qDebug() << "QRuntimeGraphicsSystem::setGraphicsSystem( "<< name <<", " << memoryUsageLimit << ")"; - qDebug() << " current approximated graphics system memory usage " << memoryUsage() << " bytes"; -#endif - if (memoryUsage() >= memoryUsageLimit) { - m_graphicsSystemChangeMemoryLimit = memoryUsageLimit; - m_pendingGraphicsSystemName = name; - } else { - setGraphicsSystem(name); - } -} - void QRuntimeGraphicsSystem::setGraphicsSystem(const QString &name) { if (m_graphicsSystemName == name) return; #ifdef QT_DEBUG qDebug() << "QRuntimeGraphicsSystem::setGraphicsSystem( " << name << " )"; - qDebug() << " current approximated graphics system memory usage "<< memoryUsage() << " bytes"; #endif - delete m_graphicsSystem; + QGraphicsSystem *oldSystem = m_graphicsSystem; m_graphicsSystem = QGraphicsSystemFactory::create(name); m_graphicsSystemName = name; Q_ASSERT(m_graphicsSystem); - m_graphicsSystemChangeMemoryLimit = 0; m_pendingGraphicsSystemName = QString(); for (int i = 0; i < m_pixmapDatas.size(); ++i) { QRuntimePixmapData *proxy = m_pixmapDatas.at(i); QPixmapData *newData = m_graphicsSystem->createPixmapData(proxy->m_data); - // ### TODO Optimize. Openvg and s60raster graphics systems could switch internal ARGB32_PRE QImage buffers. newData->fromImage(proxy->m_data->toImage(), Qt::NoOpaqueDetection); delete proxy->m_data; proxy->m_data = newData; @@ -428,58 +387,26 @@ void QRuntimeGraphicsSystem::setGraphicsSystem(const QString &name) QRuntimeWindowSurface *proxy = m_windowSurfaces.at(i); QWidget *widget = proxy->m_windowSurface->window(); - if(m_windowSurfaceDestroyPolicy == DestroyImmediately) { - delete proxy->m_windowSurface; - proxy->m_pendingWindowSurface = 0; - } else { - proxy->m_pendingWindowSurface = proxy->m_windowSurface; - } + if(m_windowSurfaceDestroyPolicy == DestroyAfterFirstFlush) + proxy->m_pendingWindowSurface.reset(proxy->m_windowSurface.take()); - proxy->m_windowSurface = m_graphicsSystem->createWindowSurface(widget); + proxy->m_windowSurface.reset(m_graphicsSystem->createWindowSurface(widget)); qt_widget_private(widget)->invalidateBuffer(widget->rect()); } + + delete oldSystem; } void QRuntimeGraphicsSystem::removePixmapData(QRuntimePixmapData *pixmapData) const { int index = m_pixmapDatas.lastIndexOf(pixmapData); m_pixmapDatas.removeAt(index); - decreaseMemoryUsage(pixmapData->memoryUsage(), true); } void QRuntimeGraphicsSystem::removeWindowSurface(QRuntimeWindowSurface *windowSurface) const { int index = m_windowSurfaces.lastIndexOf(windowSurface); m_windowSurfaces.removeAt(index); - decreaseMemoryUsage(windowSurface->memoryUsage(), true); -} - -void QRuntimeGraphicsSystem::increaseMemoryUsage(uint amount) const -{ - m_memoryUsage += amount; - - if (m_graphicsSystemChangeMemoryLimit && - m_memoryUsage < m_graphicsSystemChangeMemoryLimit) { - - QRuntimeGraphicsSystem *gs = const_cast<QRuntimeGraphicsSystem*>(this); - QDeferredGraphicsSystemChange *deferredChange = - new QDeferredGraphicsSystemChange(gs, m_pendingGraphicsSystemName); - deferredChange->launch(); - } -} - -void QRuntimeGraphicsSystem::decreaseMemoryUsage(uint amount, bool persistent) const -{ - m_memoryUsage -= amount; - - if (persistent && m_graphicsSystemChangeMemoryLimit && - m_memoryUsage < m_graphicsSystemChangeMemoryLimit) { - - QRuntimeGraphicsSystem *gs = const_cast<QRuntimeGraphicsSystem*>(this); - QDeferredGraphicsSystemChange *deferredChange = - new QDeferredGraphicsSystemChange(gs, m_pendingGraphicsSystemName); - deferredChange->launch(); - } } #include "qgraphicssystem_runtime.moc" diff --git a/src/gui/painting/qgraphicssystem_runtime_p.h b/src/gui/painting/qgraphicssystem_runtime_p.h index 7aab89c..0232241 100644 --- a/src/gui/painting/qgraphicssystem_runtime_p.h +++ b/src/gui/painting/qgraphicssystem_runtime_p.h @@ -104,8 +104,6 @@ public: virtual QPixmapData *runtimeData() const; - virtual uint memoryUsage() const; - private: const QRuntimeGraphicsSystem *m_graphicsSystem; @@ -131,10 +129,8 @@ public: virtual QPoint offset(const QWidget *widget) const; - virtual uint memoryUsage() const; - - QWindowSurface *m_windowSurface; - QWindowSurface *m_pendingWindowSurface; + QScopedPointer<QWindowSurface> m_windowSurface; + QScopedPointer<QWindowSurface> m_pendingWindowSurface; private: const QRuntimeGraphicsSystem *m_graphicsSystem; @@ -159,7 +155,6 @@ public: void removePixmapData(QRuntimePixmapData *pixmapData) const; void removeWindowSurface(QRuntimeWindowSurface *windowSurface) const; - void setGraphicsSystem(const QString &name, uint memoryUsageLimit); void setGraphicsSystem(const QString &name); QString graphicsSystemName() const { return m_graphicsSystemName; } @@ -170,22 +165,14 @@ public: int windowSurfaceDestroyPolicy() const { return m_windowSurfaceDestroyPolicy; } - uint memoryUsage() const { return m_memoryUsage; } - -private: - - void increaseMemoryUsage(uint amount) const; - void decreaseMemoryUsage(uint amount, bool persistent = false) const; private: - mutable uint m_memoryUsage; int m_windowSurfaceDestroyPolicy; QGraphicsSystem *m_graphicsSystem; mutable QList<QRuntimePixmapData *> m_pixmapDatas; mutable QList<QRuntimeWindowSurface *> m_windowSurfaces; QString m_graphicsSystemName; - uint m_graphicsSystemChangeMemoryLimit; QString m_pendingGraphicsSystemName; friend class QRuntimePixmapData; diff --git a/src/gui/painting/qpaintengine_x11.cpp b/src/gui/painting/qpaintengine_x11.cpp index 910b2df..e521e01 100644 --- a/src/gui/painting/qpaintengine_x11.cpp +++ b/src/gui/painting/qpaintengine_x11.cpp @@ -696,11 +696,10 @@ void QX11PaintEngine::drawLines(const QLine *lines, int lineCount) linef = d->matrix.map(QLineF(lines[i])); } if (clipLine(&linef, d->polygonClipper.boundingRect())) { - int x1 = qRound(linef.x1() + aliasedCoordinateDelta); - int y1 = qRound(linef.y1() + aliasedCoordinateDelta); - int x2 = qRound(linef.x2() + aliasedCoordinateDelta); - int y2 = qRound(linef.y2() + aliasedCoordinateDelta); - + int x1 = qFloor(linef.x1() + aliasedCoordinateDelta); + int y1 = qFloor(linef.y1() + aliasedCoordinateDelta); + int x2 = qFloor(linef.x2() + aliasedCoordinateDelta); + int y2 = qFloor(linef.y2() + aliasedCoordinateDelta); XDrawLine(d->dpy, d->hd, d->gc, x1, y1, x2, y2); } } @@ -730,11 +729,10 @@ void QX11PaintEngine::drawLines(const QLineF *lines, int lineCount) for (int i = 0; i < lineCount; ++i) { QLineF linef = d->matrix.map(lines[i]); if (clipLine(&linef, d->polygonClipper.boundingRect())) { - int x1 = qRound(linef.x1() + aliasedCoordinateDelta); - int y1 = qRound(linef.y1() + aliasedCoordinateDelta); - int x2 = qRound(linef.x2() + aliasedCoordinateDelta); - int y2 = qRound(linef.y2() + aliasedCoordinateDelta); - + int x1 = qFloor(linef.x1() + aliasedCoordinateDelta); + int y1 = qFloor(linef.y1() + aliasedCoordinateDelta); + int x2 = qFloor(linef.x2() + aliasedCoordinateDelta); + int y2 = qFloor(linef.y2() + aliasedCoordinateDelta); XDrawLine(d->dpy, d->hd, d->gc, x1, y1, x2, y2); } } @@ -1690,8 +1688,8 @@ void QX11PaintEnginePrivate::strokePolygon_dev(const QPointF *polygonPoints, int if (clippedCount > 0) { QVarLengthArray<XPoint> xpoints(clippedCount); for (int i = 0; i < clippedCount; ++i) { - xpoints[i].x = qRound(clippedPoints[i].x + aliasedCoordinateDelta); - xpoints[i].y = qRound(clippedPoints[i].y + aliasedCoordinateDelta); + xpoints[i].x = qFloor(clippedPoints[i].x + aliasedCoordinateDelta); + xpoints[i].y = qFloor(clippedPoints[i].y + aliasedCoordinateDelta); } uint numberPoints = qMin(clippedCount, xlibMaxLinePoints); XPoint *pts = xpoints.data(); diff --git a/src/gui/painting/qpaintengineex.cpp b/src/gui/painting/qpaintengineex.cpp index e0746fb..881bd6e 100644 --- a/src/gui/painting/qpaintengineex.cpp +++ b/src/gui/painting/qpaintengineex.cpp @@ -831,7 +831,7 @@ void QPaintEngineEx::drawEllipse(const QRectF &r) int point_count = 0; x.points[0] = qt_curves_for_arc(r, 0, -360, x.points + 1, &point_count); - QVectorPath vp((qreal *) pts, 13, qpaintengineex_ellipse_types, QVectorPath::EllipseHint); + QVectorPath vp((qreal *) pts, point_count, qpaintengineex_ellipse_types, QVectorPath::EllipseHint); draw(vp); } diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index c4de7f0..314f349 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -88,14 +88,19 @@ bool qt_show_painter_debug_output = true; extern QPixmap qt_pixmapForBrush(int style, bool invert); -static void drawTextItemDecoration(QPainter *painter, const QPointF &pos, QFontEngine *fe, - QTextCharFormat::UnderlineStyle underlineStyle, - QTextItemInt::RenderFlags flags, qreal width, - const QTextCharFormat &charFormat); void qt_format_text(const QFont &font, const QRectF &_r, int tf, const QTextOption *option, const QString& str, QRectF *brect, int tabstops, int* tabarray, int tabarraylen, QPainter *painter); +static void drawTextItemDecoration(QPainter *painter, const QPointF &pos, const QFontEngine *fe, + QTextCharFormat::UnderlineStyle underlineStyle, + QTextItem::RenderFlags flags, qreal width, + const QTextCharFormat &charFormat); +// Helper function to calculate left most position, width and flags for decoration drawing +static void drawDecorationForGlyphs(QPainter *painter, const glyph_t *glyphArray, + const QFixedPoint *positions, int glyphCount, + QFontEngine *fontEngine, const QFont &font, + const QTextCharFormat &charFormat); static inline QGradient::CoordinateMode coordinateMode(const QBrush &brush) { @@ -6051,6 +6056,10 @@ void QPainter::drawStaticText(const QPointF &topLeftPosition, const QStaticText currentColor = item->color; } d->extended->drawStaticTextItem(item); + + drawDecorationForGlyphs(this, item->glyphs, item->glyphPositions, + item->numGlyphs, item->fontEngine, staticText_d->font, + QTextCharFormat()); } if (currentColor != oldPen.color()) setPen(oldPen); @@ -6418,9 +6427,9 @@ static QPixmap generateWavyPixmap(qreal maxRadius, const QPen &pen) return pixmap; } -static void drawTextItemDecoration(QPainter *painter, const QPointF &pos, QFontEngine *fe, +static void drawTextItemDecoration(QPainter *painter, const QPointF &pos, const QFontEngine *fe, QTextCharFormat::UnderlineStyle underlineStyle, - QTextItemInt::RenderFlags flags, qreal width, + QTextItem::RenderFlags flags, qreal width, const QTextCharFormat &charFormat) { if (underlineStyle == QTextCharFormat::NoUnderline @@ -6494,6 +6503,50 @@ static void drawTextItemDecoration(QPainter *painter, const QPointF &pos, QFontE painter->setBrush(oldBrush); } +static void drawDecorationForGlyphs(QPainter *painter, const glyph_t *glyphArray, + const QFixedPoint *positions, int glyphCount, + QFontEngine *fontEngine, const QFont &font, + const QTextCharFormat &charFormat) +{ + if (!(font.underline() || font.strikeOut() || font.overline())) + return; + + QFixed leftMost; + QFixed rightMost; + QFixed baseLine; + for (int i=0; i<glyphCount; ++i) { + glyph_metrics_t gm = fontEngine->boundingBox(glyphArray[i]); + if (i == 0 || leftMost > positions[i].x) + leftMost = positions[i].x; + + // We don't support glyphs that do not share a common baseline. If this turns out to + // be a relevant use case, then we need to find clusters of glyphs that share a baseline + // and do a drawTextItemDecorations call per cluster. + if (i == 0 || baseLine < positions[i].y) + baseLine = positions[i].y; + + // We use the advance rather than the actual bounds to match the algorithm in drawText() + if (i == 0 || rightMost < positions[i].x + gm.xoff) + rightMost = positions[i].x + gm.xoff; + } + + QFixed width = rightMost - leftMost; + QTextItem::RenderFlags flags = 0; + + if (font.underline()) + flags |= QTextItem::Underline; + if (font.overline()) + flags |= QTextItem::Overline; + if (font.strikeOut()) + flags |= QTextItem::StrikeOut; + + drawTextItemDecoration(painter, QPointF(leftMost.toReal(), baseLine.toReal()), + fontEngine, + font.underline() ? QTextCharFormat::SingleUnderline + : QTextCharFormat::NoUnderline, flags, + width.toReal(), charFormat); +} + void QPainter::drawTextItem(const QPointF &p, const QTextItem &_ti) { #ifdef QT_DEBUG_DRAW diff --git a/src/gui/painting/qwindowsurface_s60.cpp b/src/gui/painting/qwindowsurface_s60.cpp index 477bd93..8bac1f5 100644 --- a/src/gui/painting/qwindowsurface_s60.cpp +++ b/src/gui/painting/qwindowsurface_s60.cpp @@ -67,10 +67,14 @@ QS60WindowSurface::QS60WindowSurface(QWidget* widget) TDisplayMode mode = S60->screenDevice()->DisplayMode(); bool isOpaque = qt_widget_private(widget)->isOpaque; - if (mode == EColor16MA && isOpaque) - mode = EColor16MU; // Faster since 16MU -> 16MA is typically accelerated - else if (mode == EColor16MU && !isOpaque) - mode = EColor16MA; // Try for transparency anyway + if (isOpaque) { + mode = EColor16MU; + } else { + if (QSysInfo::symbianVersion() >= QSysInfo::SV_SF_3) + mode = Q_SYMBIAN_ECOLOR16MAP; // Symbian^3 WServ has support for ARGB32_PRE + else + mode = EColor16MA; // Symbian prior to Symbian^3 sw accelerates EColor16MA + } // We create empty CFbsBitmap here -> it will be resized in setGeometry CFbsBitmap *bitmap = q_check_ptr(new CFbsBitmap); // CBase derived object needs check on new diff --git a/src/gui/s60framework/qs60mainapplication.cpp b/src/gui/s60framework/qs60mainapplication.cpp index 0f9367e..5d4c54e 100644 --- a/src/gui/s60framework/qs60mainapplication.cpp +++ b/src/gui/s60framework/qs60mainapplication.cpp @@ -136,16 +136,25 @@ TFileName QS60MainApplication::ResourceFileName() const return KNullDesC(); } +/*! + \internal +*/ void QS60MainApplication::PreDocConstructL() { QS60MainApplicationBase::PreDocConstructL(); } +/*! + \internal +*/ CDictionaryStore *QS60MainApplication::OpenIniFileLC(RFs &aFs) const { return QS60MainApplicationBase::OpenIniFileLC(aFs); } +/*! + \internal +*/ void QS60MainApplication::NewAppServerL(CApaAppServer *&aAppServer) { QS60MainApplicationBase::NewAppServerL(aAppServer); diff --git a/src/gui/s60framework/qs60mainappui.cpp b/src/gui/s60framework/qs60mainappui.cpp index 40c2d03..ea9dbb3 100644 --- a/src/gui/s60framework/qs60mainappui.cpp +++ b/src/gui/s60framework/qs60mainappui.cpp @@ -281,76 +281,121 @@ void QS60MainAppUi::RestoreMenuL(CCoeControl *menuWindow, TInt resourceId, TMenu } } +/*! + \internal +*/ void QS60MainAppUi::Exit() { QS60MainAppUiBase::Exit(); } +/*! + \internal +*/ void QS60MainAppUi::SetFadedL(TBool aFaded) { QS60MainAppUiBase::SetFadedL(aFaded); } +/*! + \internal +*/ TRect QS60MainAppUi::ApplicationRect() const { return QS60MainAppUiBase::ApplicationRect(); } +/*! + \internal +*/ void QS60MainAppUi::HandleScreenDeviceChangedL() { QS60MainAppUiBase::HandleScreenDeviceChangedL(); } +/*! + \internal +*/ void QS60MainAppUi::HandleApplicationSpecificEventL(TInt aType, const TWsEvent &aEvent) { QS60MainAppUiBase::HandleApplicationSpecificEventL(aType, aEvent); } +/*! + \internal +*/ TTypeUid::Ptr QS60MainAppUi::MopSupplyObject(TTypeUid aId) { return QS60MainAppUiBase::MopSupplyObject(aId); } +/*! + \internal +*/ void QS60MainAppUi::ProcessCommandL(TInt aCommand) { QS60MainAppUiBase::ProcessCommandL(aCommand); } +/*! + \internal +*/ TErrorHandlerResponse QS60MainAppUi::HandleError (TInt aError, const SExtendedError &aExtErr, TDes &aErrorText, TDes &aContextText) { return QS60MainAppUiBase::HandleError(aError, aExtErr, aErrorText, aContextText); } +/*! + \internal +*/ void QS60MainAppUi::HandleViewDeactivation(const TVwsViewId &aViewIdToBeDeactivated, const TVwsViewId &aNewlyActivatedViewId) { QS60MainAppUiBase::HandleViewDeactivation(aViewIdToBeDeactivated, aNewlyActivatedViewId); } +/*! + \internal +*/ void QS60MainAppUi::PrepareToExit() { QS60MainAppUiBase::PrepareToExit(); } +/*! + \internal +*/ void QS60MainAppUi::HandleTouchPaneSizeChange() { QS60MainAppUiBase::HandleTouchPaneSizeChange(); } +/*! + \internal +*/ void QS60MainAppUi::HandleSystemEventL(const TWsEvent &aEvent) { QS60MainAppUiBase::HandleSystemEventL(aEvent); } +/*! + \internal +*/ void QS60MainAppUi::Reserved_MtsmPosition() { QS60MainAppUiBase::Reserved_MtsmPosition(); } +/*! + \internal +*/ void QS60MainAppUi::Reserved_MtsmObject() { QS60MainAppUiBase::Reserved_MtsmObject(); } +/*! + \internal +*/ void QS60MainAppUi::HandleForegroundEventL(TBool aForeground) { QS60MainAppUiBase::HandleForegroundEventL(aForeground); diff --git a/src/gui/s60framework/qs60maindocument.cpp b/src/gui/s60framework/qs60maindocument.cpp index ed33a41..26e2d00 100644 --- a/src/gui/s60framework/qs60maindocument.cpp +++ b/src/gui/s60framework/qs60maindocument.cpp @@ -105,11 +105,17 @@ CEikAppUi *QS60MainDocument::CreateAppUiL() return (static_cast <CEikAppUi*>(new(ELeave)QS60MainAppUi)); } +/*! + \internal + */ CFileStore *QS60MainDocument::OpenFileL(TBool aDoOpen, const TDesC &aFilename, RFs &aFs) { return QS60MainDocumentBase::OpenFileL(aDoOpen, aFilename, aFs); } +/*! + \internal + */ void QS60MainDocument::OpenFileL(CFileStore *&aFileStore, RFile &aFile) { QS60MainDocumentBase::OpenFileL(aFileStore, aFile); diff --git a/src/gui/s60framework/qs60maindocument.h b/src/gui/s60framework/qs60maindocument.h index 2f0564f..fc32d8b 100644 --- a/src/gui/s60framework/qs60maindocument.h +++ b/src/gui/s60framework/qs60maindocument.h @@ -47,7 +47,7 @@ #ifdef Q_OS_SYMBIAN #ifdef Q_WS_S60 -#include <akndoc.h> +#include <AknDoc.h> typedef CAknDocument QS60MainDocumentBase; #else #include <eikdoc.h> diff --git a/src/gui/styles/qmacstyle_mac.h b/src/gui/styles/qmacstyle_mac.h index bcebb1d..d5fcdae 100644 --- a/src/gui/styles/qmacstyle_mac.h +++ b/src/gui/styles/qmacstyle_mac.h @@ -60,6 +60,8 @@ class QPalette; #define Q_GUI_EXPORT_STYLE_MAC Q_GUI_EXPORT #endif +class QPushButton; +class QStyleOptionButton; class QMacStylePrivate; class Q_GUI_EXPORT_STYLE_MAC QMacStyle : public QWindowsStyle { @@ -133,6 +135,8 @@ private: Q_DISABLE_COPY(QMacStyle) QMacStylePrivate *d; + + friend bool qt_mac_buttonIsRenderedFlat(const QPushButton *pushButton, const QStyleOptionButton *option); }; #endif // Q_WS_MAC diff --git a/src/gui/styles/qmacstyle_mac.mm b/src/gui/styles/qmacstyle_mac.mm index bdcf5d6..556e0f3 100644 --- a/src/gui/styles/qmacstyle_mac.mm +++ b/src/gui/styles/qmacstyle_mac.mm @@ -1059,6 +1059,16 @@ void QMacStylePrivate::initHIThemePushButton(const QStyleOptionButton *btn, } } +bool qt_mac_buttonIsRenderedFlat(const QPushButton *pushButton, const QStyleOptionButton *option) +{ + QMacStyle *macStyle = qobject_cast<QMacStyle *>(pushButton->style()); + if (!macStyle) + return false; + HIThemeButtonDrawInfo bdi; + macStyle->d->initHIThemePushButton(option, pushButton, kThemeStateActive, &bdi); + return bdi.kind == kThemeBevelButton; +} + /** Creates a HIThemeButtonDrawInfo structure that specifies the correct button kind and other details to use for drawing the given combobox. Which button @@ -1430,6 +1440,9 @@ QMacStylePrivate::QMacStylePrivate(QMacStyle *style) bool QMacStylePrivate::animatable(QMacStylePrivate::Animates as, const QWidget *w) const { + if (!w) + return false; + if (as == AquaPushButton) { QPushButton *pb = const_cast<QPushButton *>(static_cast<const QPushButton *>(w)); if (w->window()->isActiveWindow() && pb && !mouseDown) { diff --git a/src/gui/styles/qmacstyle_mac_p.h b/src/gui/styles/qmacstyle_mac_p.h index 5a0ba4c..f9b9d30 100644 --- a/src/gui/styles/qmacstyle_mac_p.h +++ b/src/gui/styles/qmacstyle_mac_p.h @@ -150,6 +150,8 @@ enum QAquaWidgetSize { QAquaSizeLarge = 0, QAquaSizeSmall = 1, QAquaSizeMini = 2 return sizes[controlSize]; \ } while (0) +bool qt_mac_buttonIsRenderedFlat(const QPushButton *pushButton, const QStyleOptionButton *option); + class QMacStylePrivate : public QObject { Q_OBJECT diff --git a/src/gui/styles/qs60style_s60.cpp b/src/gui/styles/qs60style_s60.cpp index 2527662..f44b85e 100644 --- a/src/gui/styles/qs60style_s60.cpp +++ b/src/gui/styles/qs60style_s60.cpp @@ -58,12 +58,12 @@ #include <AknsSkinInstance.h> #include <AknsBasicBackgroundControlContext.h> #include <avkon.mbg> -#include <aknfontaccess.h> -#include <aknlayoutfont.h> +#include <AknFontAccess.h> +#include <AknLayoutFont.h> #include <AknUtils.h> #include <aknnavi.h> #include <gulicon.h> -#include <aknbitmapanimation.h> +#include <AknBitmapAnimation.h> #if !defined(QT_NO_STYLE_S60) || defined(QT_PLUGIN) diff --git a/src/gui/styles/qstyle.cpp b/src/gui/styles/qstyle.cpp index 687e587..0a75492 100644 --- a/src/gui/styles/qstyle.cpp +++ b/src/gui/styles/qstyle.cpp @@ -325,7 +325,7 @@ static int unpackControlTypes(QSizePolicy::ControlTypes controls, QSizePolicy::C control over size of header items and row and column sizes. \sa QStyleOption, QStylePainter, {Styles Example}, - {Styles & Style Aware Widgets}, QStyledItemDelegate + {Styles and Style Aware Widgets}, QStyledItemDelegate */ /*! diff --git a/src/gui/styles/qstylesheetstyle.cpp b/src/gui/styles/qstylesheetstyle.cpp index 272fb26..7351a7d 100644 --- a/src/gui/styles/qstylesheetstyle.cpp +++ b/src/gui/styles/qstylesheetstyle.cpp @@ -4094,7 +4094,7 @@ void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, Q if (pe1 != PseudoElement_None) { QRenderRule subRule = renderRule(w, opt, pe1); if (subRule.bg != 0 || subRule.hasDrawable()) { - //We test subRule.bg dirrectly because hasBackground() would return false for background:none. + //We test subRule.bg directly because hasBackground() would return false for background:none. //But we still don't want the default drawning in that case (example for QScrollBar::add-page) (task 198926) subRule.drawRule(p, opt->rect); } else if (fallback) { @@ -4283,6 +4283,13 @@ void QStyleSheetStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *op } break; + case PE_FrameMenu: + if (rule.hasDrawable()) { + // Drawn by PE_PanelMenu + return; + } + break; + case PE_PanelMenuBar: if (rule.hasDrawable()) { // Drawn by PE_Widget diff --git a/src/gui/text/qfontengine_mac.mm b/src/gui/text/qfontengine_mac.mm index f6b8758..f898fb8 100644 --- a/src/gui/text/qfontengine_mac.mm +++ b/src/gui/text/qfontengine_mac.mm @@ -349,11 +349,32 @@ bool QCoreTextFontEngineMulti::stringToCMap(const QChar *str, int len, QGlyphLay int *nglyphs, QTextEngine::ShaperFlags flags) const { *nglyphs = len; + QCFType<CFStringRef> cfstring; + QVarLengthArray<CGGlyph> cgGlyphs(len); CTFontGetGlyphsForCharacters(ctfont, (const UniChar*)str, cgGlyphs.data(), len); - for (int i = 0; i < len; ++i) - glyphs->glyphs[i] = cgGlyphs[i]; + for (int i = 0; i < len; ++i) { + if (cgGlyphs[i]) { + glyphs->glyphs[i] = cgGlyphs[i]; + } else { + if (!cfstring) + cfstring = CFStringCreateWithCharactersNoCopy(0, reinterpret_cast<const UniChar *>(str), len, kCFAllocatorNull); + QCFType<CTFontRef> substituteFont = CTFontCreateForString(ctfont, cfstring, CFRangeMake(i, 1)); + CGGlyph substituteGlyph = 0; + CTFontGetGlyphsForCharacters(substituteFont, (const UniChar*)str + i, &substituteGlyph, 1); + if (substituteGlyph) { + const uint fontIndex = (fontIndexForFont(substituteFont) << 24); + glyphs->glyphs[i] = substituteGlyph | fontIndex; + if (!(flags & QTextEngine::GlyphIndicesOnly)) { + CGSize advance; + CTFontGetAdvancesForGlyphs(substituteFont, kCTFontHorizontalOrientation, &substituteGlyph, &advance, 1); + glyphs->advances_x[i] = QFixed::fromReal(advance.width); + glyphs->advances_y[i] = QFixed::fromReal(advance.height); + } + } + } + } if (flags & QTextEngine::GlyphIndicesOnly) return true; @@ -362,9 +383,14 @@ bool QCoreTextFontEngineMulti::stringToCMap(const QChar *str, int len, QGlyphLay CTFontGetAdvancesForGlyphs(ctfont, kCTFontHorizontalOrientation, cgGlyphs.data(), advances.data(), len); for (int i = 0; i < len; ++i) { + if (glyphs->glyphs[i] & 0xff000000) + continue; glyphs->advances_x[i] = QFixed::fromReal(advances[i].width); glyphs->advances_y[i] = QFixed::fromReal(advances[i].height); - if (fontDef.styleStrategy & QFont::ForceIntegerMetrics) { + } + + if (fontDef.styleStrategy & QFont::ForceIntegerMetrics) { + for (int i = 0; i < len; ++i) { glyphs->advances_x[i] = glyphs->advances_x[i].round(); glyphs->advances_y[i] = glyphs->advances_y[i].round(); } diff --git a/src/gui/text/qfontengine_s60.cpp b/src/gui/text/qfontengine_s60.cpp index 74ef646..52a1fe7 100644 --- a/src/gui/text/qfontengine_s60.cpp +++ b/src/gui/text/qfontengine_s60.cpp @@ -374,7 +374,10 @@ glyph_metrics_t QFontEngineS60::boundingBox(glyph_t glyph) QFixed QFontEngineS60::ascent() const { - return m_originalFont->FontMaxAscent(); + // Workaround for QTBUG-8013 + // Stroke based fonts may return an incorrect FontMaxAscent of 0. + const QFixed ascent = m_originalFont->FontMaxAscent(); + return (ascent > 0) ? ascent : QFixed::fromReal(m_originalFontSizeInPixels) - descent(); } QFixed QFontEngineS60::descent() const diff --git a/src/gui/text/qstatictext.cpp b/src/gui/text/qstatictext.cpp index f6daed8..21c2e02 100644 --- a/src/gui/text/qstatictext.cpp +++ b/src/gui/text/qstatictext.cpp @@ -109,10 +109,18 @@ QT_BEGIN_NAMESPACE QPainter::drawStaticText() and can change from call to call with a minimal impact on performance. - QStaticText will attempt to guess the format of the input text using Qt::mightBeRichText(). - To force QStaticText to display its contents as either plain text or rich text, use the - function QStaticText::setTextFormat() and pass in, respectively, Qt::PlainText and - Qt::RichText. + For extra convenience, it is possible to apply formatting to the text using the HTML subset + supported by QTextDocument. QStaticText will attempt to guess the format of the input text using + Qt::mightBeRichText(), and interpret it as rich text if this function returns true. To force + QStaticText to display its contents as either plain text or rich text, use the function + QStaticText::setTextFormat() and pass in, respectively, Qt::PlainText and Qt::RichText. + + QStaticText can only represent text, so only HTML tags which alter the layout or appearance of + the text will be respected. Adding an image to the input HTML, for instance, will cause the + image to be included as part of the layout, affecting the positions of the text glyphs, but it + will not be displayed. The result will be an empty area the size of the image in the output. + Similarly, using tables will cause the text to be laid out in table format, but the borders + will not be drawn. If it's the first time the static text is drawn, or if the static text, or the painter's font has been altered since the last time it was drawn, the text's layout has to be @@ -472,7 +480,12 @@ namespace { memcpy(charsDestination, ti.chars, sizeof(QChar) * currentItem.numChars); m_items.append(currentItem); - } + } + + virtual void drawPolygon(const QPointF *, int , PolygonDrawMode ) + { + /* intentionally empty */ + } virtual bool begin(QPaintDevice *) { return true; } virtual bool end() { return true; } diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp index e365c8d..4135831 100644 --- a/src/gui/text/qtextengine.cpp +++ b/src/gui/text/qtextengine.cpp @@ -923,6 +923,13 @@ void QTextEngine::shapeText(int item) const si.width += glyphs.advances_x[i]; } +static inline bool hasCaseChange(const QScriptItem &si) +{ + return si.analysis.flags == QScriptAnalysis::SmallCaps || + si.analysis.flags == QScriptAnalysis::Uppercase || + si.analysis.flags == QScriptAnalysis::Lowercase; +} + #if defined(Q_WS_WINCE) //TODO // set the glyph attributes heuristically. Assumes a 1 to 1 relationship between chars and glyphs // and no reordering. @@ -1050,14 +1057,15 @@ void QTextEngine::shapeTextWithCE(int item) const if (option.useDesignMetrics()) flags |= DesignMetrics; - attributes(); // pre-initialize char attributes + // pre-initialize char attributes + if (! attributes()) + return; const int len = length(item); int num_glyphs = length(item); const QChar *str = layoutData->string.unicode() + si.position; ushort upperCased[256]; - if (si.analysis.flags == QScriptAnalysis::SmallCaps || si.analysis.flags == QScriptAnalysis::Uppercase - || si.analysis.flags == QScriptAnalysis::Lowercase) { + if (hasCaseChange(si)) { ushort *uc = upperCased; if (len > 256) uc = new ushort[len]; @@ -1071,7 +1079,14 @@ void QTextEngine::shapeTextWithCE(int item) const } while (true) { - ensureSpace(num_glyphs); + if (! ensureSpace(num_glyphs)) { + // If str is converted to uppercase/lowercase form with a new buffer, + // we need to delete that buffer before return for error + const ushort *uc = reinterpret_cast<const ushort *>(str); + if (hasCaseChange(si) && uc != upperCased) + delete [] uc; + return; + } num_glyphs = layoutData->glyphLayout.numGlyphs - layoutData->used; QGlyphLayout g = availableGlyphs(&si); @@ -1092,9 +1107,7 @@ void QTextEngine::shapeTextWithCE(int item) const layoutData->used += si.num_glyphs; const ushort *uc = reinterpret_cast<const ushort *>(str); - if ((si.analysis.flags == QScriptAnalysis::SmallCaps || si.analysis.flags == QScriptAnalysis::Uppercase - || si.analysis.flags == QScriptAnalysis::Lowercase) - && uc != upperCased) + if (hasCaseChange(si) && uc != upperCased) delete [] uc; } #endif @@ -1133,8 +1146,7 @@ void QTextEngine::shapeTextWithHarfbuzz(int item) const entire_shaper_item.item.bidiLevel = si.analysis.bidiLevel; HB_UChar16 upperCased[256]; // XXX what about making this 4096, so we don't have to extend it ever. - if (si.analysis.flags == QScriptAnalysis::SmallCaps || si.analysis.flags == QScriptAnalysis::Uppercase - || si.analysis.flags == QScriptAnalysis::Lowercase) { + if (hasCaseChange(si)) { HB_UChar16 *uc = upperCased; if (entire_shaper_item.item.length > 256) uc = new HB_UChar16[entire_shaper_item.item.length]; @@ -1156,17 +1168,24 @@ void QTextEngine::shapeTextWithHarfbuzz(int item) const entire_shaper_item.shaperFlags |= HB_ShaperFlag_UseDesignMetrics; entire_shaper_item.num_glyphs = qMax(layoutData->glyphLayout.numGlyphs - layoutData->used, int(entire_shaper_item.item.length)); - ensureSpace(entire_shaper_item.num_glyphs); + if (! ensureSpace(entire_shaper_item.num_glyphs)) { + if (hasCaseChange(si)) + delete [] const_cast<HB_UChar16 *>(entire_shaper_item.string); + return; + } QGlyphLayout initialGlyphs = availableGlyphs(&si).mid(0, entire_shaper_item.num_glyphs); if (!stringToGlyphs(&entire_shaper_item, &initialGlyphs, font)) { - ensureSpace(entire_shaper_item.num_glyphs); + if (! ensureSpace(entire_shaper_item.num_glyphs)) { + if (hasCaseChange(si)) + delete [] const_cast<HB_UChar16 *>(entire_shaper_item.string); + return; + } initialGlyphs = availableGlyphs(&si).mid(0, entire_shaper_item.num_glyphs); if (!stringToGlyphs(&entire_shaper_item, &initialGlyphs, font)) { // ############ if this happens there's a bug in the fontengine - if ((si.analysis.flags == QScriptAnalysis::SmallCaps || si.analysis.flags == QScriptAnalysis::Uppercase - || si.analysis.flags == QScriptAnalysis::Lowercase) && entire_shaper_item.string != upperCased) + if (hasCaseChange(si) && entire_shaper_item.string != upperCased) delete [] const_cast<HB_UChar16 *>(entire_shaper_item.string); return; } @@ -1231,7 +1250,11 @@ void QTextEngine::shapeTextWithHarfbuzz(int item) const remaining_glyphs -= shaper_item.initialGlyphCount; do { - ensureSpace(glyph_pos + shaper_item.num_glyphs + remaining_glyphs); + if (! ensureSpace(glyph_pos + shaper_item.num_glyphs + remaining_glyphs)) { + if (hasCaseChange(si)) + delete [] const_cast<HB_UChar16 *>(entire_shaper_item.string); + return; + } const QGlyphLayout g = availableGlyphs(&si).mid(glyph_pos); moveGlyphData(g.mid(shaper_item.num_glyphs), g.mid(shaper_item.initialGlyphCount), remaining_glyphs); @@ -1271,8 +1294,7 @@ void QTextEngine::shapeTextWithHarfbuzz(int item) const layoutData->used += si.num_glyphs; - if ((si.analysis.flags == QScriptAnalysis::SmallCaps || si.analysis.flags == QScriptAnalysis::Uppercase) - && entire_shaper_item.string != upperCased) + if (hasCaseChange(si) && entire_shaper_item.string != upperCased) delete [] const_cast<HB_UChar16 *>(entire_shaper_item.string); } @@ -1317,7 +1339,8 @@ const HB_CharAttributes *QTextEngine::attributes() const return (HB_CharAttributes *) layoutData->memory; itemize(); - ensureSpace(layoutData->string.length()); + if (! ensureSpace(layoutData->string.length())) + return NULL; QVarLengthArray<HB_ScriptItem> hbScriptItems(layoutData->items.size()); @@ -1896,7 +1919,10 @@ void QTextEngine::justify(const QScriptLine &line) // don't include trailing white spaces when doing justification int line_length = line.length; - const HB_CharAttributes *a = attributes()+line.from; + const HB_CharAttributes *a = attributes(); + if (! a) + return; + a += line.from; while (line_length && a[line_length-1].whiteSpace) --line_length; // subtract one char more, as we can't justfy after the last character @@ -2077,7 +2103,7 @@ QTextEngine::LayoutData::LayoutData() memory_on_stack = false; used = 0; hasBidi = false; - inLayout = false; + layoutState = LayoutEmpty; haveCharAttributes = false; logClustersPtr = 0; available_glyphs = 0; @@ -2111,7 +2137,7 @@ QTextEngine::LayoutData::LayoutData(const QString &str, void **stack_memory, int } used = 0; hasBidi = false; - inLayout = false; + layoutState = LayoutEmpty; haveCharAttributes = false; } @@ -2122,12 +2148,12 @@ QTextEngine::LayoutData::~LayoutData() memory = 0; } -void QTextEngine::LayoutData::reallocate(int totalGlyphs) +bool QTextEngine::LayoutData::reallocate(int totalGlyphs) { Q_ASSERT(totalGlyphs >= glyphLayout.numGlyphs); if (memory_on_stack && available_glyphs >= totalGlyphs) { glyphLayout.grow(glyphLayout.data(), totalGlyphs); - return; + return true; } int space_charAttributes = sizeof(HB_CharAttributes)*string.length()/sizeof(void*) + 1; @@ -2135,7 +2161,14 @@ void QTextEngine::LayoutData::reallocate(int totalGlyphs) int space_glyphs = QGlyphLayout::spaceNeededForGlyphLayout(totalGlyphs)/sizeof(void*) + 2; int newAllocated = space_charAttributes + space_glyphs + space_logClusters; - Q_ASSERT(newAllocated >= allocated); + // These values can be negative if the length of string/glyphs causes overflow, + // we can't layout such a long string all at once, so return false here to + // indicate there is a failure + if (space_charAttributes < 0 || space_logClusters < 0 || space_glyphs < 0 || newAllocated < allocated) { + layoutState = LayoutFailed; + return false; + } + void **newMem = memory; newMem = (void **)::realloc(memory_on_stack ? 0 : memory, newAllocated*sizeof(void *)); Q_CHECK_PTR(newMem); @@ -2156,6 +2189,7 @@ void QTextEngine::LayoutData::reallocate(int totalGlyphs) glyphLayout.grow(reinterpret_cast<char *>(m), totalGlyphs); allocated = newAllocated; + return true; } // grow to the new size, copying the existing data to the new layout @@ -2187,7 +2221,7 @@ void QTextEngine::freeMemory() } else { layoutData->used = 0; layoutData->hasBidi = false; - layoutData->inLayout = false; + layoutData->layoutState = LayoutEmpty; layoutData->haveCharAttributes = false; } for (int i = 0; i < lines.size(); ++i) { @@ -2341,6 +2375,8 @@ QString QTextEngine::elidedText(Qt::TextElideMode mode, const QFixed &width, int if (flags & Qt::TextShowMnemonic) { itemize(); HB_CharAttributes *attributes = const_cast<HB_CharAttributes *>(this->attributes()); + if (!attributes) + return QString(); for (int i = 0; i < layoutData->items.size(); ++i) { QScriptItem &si = layoutData->items[i]; if (!si.num_glyphs) @@ -2417,6 +2453,8 @@ QString QTextEngine::elidedText(Qt::TextElideMode mode, const QFixed &width, int return QString(); const HB_CharAttributes *attributes = this->attributes(); + if (!attributes) + return QString(); if (mode == Qt::ElideRight) { QFixed currentWidth; diff --git a/src/gui/text/qtextengine_p.h b/src/gui/text/qtextengine_p.h index 805d242..b5faf20 100644 --- a/src/gui/text/qtextengine_p.h +++ b/src/gui/text/qtextengine_p.h @@ -416,6 +416,11 @@ class QTextFormatCollection; class Q_GUI_EXPORT QTextEngine { public: + enum LayoutState { + LayoutEmpty, + InLayout, + LayoutFailed, + }; struct LayoutData { LayoutData(const QString &str, void **stack_memory, int mem_size); LayoutData(); @@ -428,11 +433,11 @@ public: QGlyphLayout glyphLayout; mutable int used; uint hasBidi : 1; - uint inLayout : 1; + uint layoutState : 2; uint memory_on_stack : 1; uint haveCharAttributes : 1; QString string; - void reallocate(int totalGlyphs); + bool reallocate(int totalGlyphs); }; QTextEngine(LayoutData *data); @@ -520,9 +525,10 @@ public: return layoutData->glyphLayout.mid(si->glyph_data_offset, si->num_glyphs); } - inline void ensureSpace(int nGlyphs) const { + inline bool ensureSpace(int nGlyphs) const { if (layoutData->glyphLayout.numGlyphs - layoutData->used < nGlyphs) - layoutData->reallocate((((layoutData->used + nGlyphs)*3/2 + 15) >> 4) << 4); + return layoutData->reallocate((((layoutData->used + nGlyphs)*3/2 + 15) >> 4) << 4); + return true; } void freeMemory(); diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp index 9d27343..3f83aee 100644 --- a/src/gui/text/qtextlayout.cpp +++ b/src/gui/text/qtextlayout.cpp @@ -76,6 +76,8 @@ static inline QFixed leadingSpaceWidth(QTextEngine *eng, const QScriptLine &line int pos = line.length; const HB_CharAttributes *attributes = eng->attributes(); + if (!attributes) + return QFixed(); while (pos > 0 && attributes[line.from + pos - 1].whiteSpace) --pos; return eng->width(line.from + pos, line.length - pos); @@ -612,7 +614,7 @@ bool QTextLayout::cacheEnabled() const void QTextLayout::beginLayout() { #ifndef QT_NO_DEBUG - if (d->layoutData && d->layoutData->inLayout) { + if (d->layoutData && d->layoutData->layoutState == QTextEngine::InLayout) { qWarning("QTextLayout::beginLayout: Called while already doing layout"); return; } @@ -620,7 +622,7 @@ void QTextLayout::beginLayout() d->invalidate(); d->clearLineData(); d->itemize(); - d->layoutData->inLayout = true; + d->layoutData->layoutState = QTextEngine::InLayout; } /*! @@ -631,7 +633,7 @@ void QTextLayout::beginLayout() void QTextLayout::endLayout() { #ifndef QT_NO_DEBUG - if (!d->layoutData || !d->layoutData->inLayout) { + if (!d->layoutData || d->layoutData->layoutState == QTextEngine::LayoutEmpty) { qWarning("QTextLayout::endLayout: Called without beginLayout()"); return; } @@ -640,7 +642,7 @@ void QTextLayout::endLayout() if (l && d->lines.at(l-1).length < 0) { QTextLine(l-1, d).setNumColumns(INT_MAX); } - d->layoutData->inLayout = false; + d->layoutData->layoutState = QTextEngine::LayoutEmpty; if (!d->cacheGlyphs) d->freeMemory(); } @@ -768,11 +770,14 @@ bool QTextLayout::isValidCursorPosition(int pos) const QTextLine QTextLayout::createLine() { #ifndef QT_NO_DEBUG - if (!d->layoutData || !d->layoutData->inLayout) { + if (!d->layoutData || d->layoutData->layoutState == QTextEngine::LayoutEmpty) { qWarning("QTextLayout::createLine: Called without layouting"); return QTextLine(); } #endif + if (d->layoutData->layoutState == QTextEngine::LayoutFailed) + return QTextLine(); + int l = d->lines.size(); if (l && d->lines.at(l-1).length < 0) { QTextLine(l-1, d).setNumColumns(INT_MAX); @@ -1776,14 +1781,18 @@ namespace { return glyphs.glyphs[logClusters[currentPosition - 1]]; } + inline void adjustRightBearing(glyph_t glyph) + { + qreal rb; + fontEngine->getGlyphBearings(glyph, 0, &rb); + rightBearing = qMin(QFixed(), QFixed::fromReal(rb)); + } + inline void adjustRightBearing() { if (currentPosition <= 0) return; - - qreal rb; - fontEngine->getGlyphBearings(currentGlyph(), 0, &rb); - rightBearing = qMin(QFixed(), QFixed::fromReal(rb)); + adjustRightBearing(currentGlyph()); } inline void resetRightBearing() @@ -1884,6 +1893,8 @@ void QTextLine::layout_helper(int maxGlyphs) Qt::Alignment alignment = eng->option.alignment(); const HB_CharAttributes *attributes = eng->attributes(); + if (!attributes) + return; lbh.currentPosition = line.from; int end = 0; lbh.logClusters = eng->layoutData->logClustersPtr; @@ -1897,6 +1908,8 @@ void QTextLine::layout_helper(int maxGlyphs) if (!current.num_glyphs) { eng->shape(item); attributes = eng->attributes(); + if (!attributes) + return; lbh.logClusters = eng->layoutData->logClustersPtr; } lbh.currentPosition = qMax(line.from, current.position); @@ -1975,6 +1988,9 @@ void QTextLine::layout_helper(int maxGlyphs) } else { lbh.whiteSpaceOrObject = false; bool sb_or_ws = false; + glyph_t previousGlyph = 0; + if (lbh.currentPosition > 0 && lbh.logClusters[lbh.currentPosition - 1] <lbh.glyphs.numGlyphs) + previousGlyph = lbh.currentGlyph(); // needed to calculate right bearing later do { addNextCluster(lbh.currentPosition, end, lbh.tmpData, lbh.glyphCount, current, lbh.logClusters, lbh.glyphs); @@ -2018,9 +2034,17 @@ void QTextLine::layout_helper(int maxGlyphs) // We ignore the right bearing if the minimum negative bearing is too little to // expand the text beyond the edge. if (sb_or_ws|breakany) { + QFixed rightBearing = lbh.rightBearing; // store previous right bearing +#if !defined(Q_WS_MAC) if (lbh.calculateNewWidth(line) - lbh.minimumRightBearing > line.width) +#endif lbh.adjustRightBearing(); if (lbh.checkFullOtherwiseExtend(line)) { + // we are too wide, fix right bearing + if (rightBearing <= 0) + lbh.rightBearing = rightBearing; // take from cache + else if (previousGlyph > 0) + lbh.adjustRightBearing(previousGlyph); if (!breakany) { line.textWidth += lbh.softHyphenWidth; } diff --git a/src/gui/util/qdesktopservices_x11.cpp b/src/gui/util/qdesktopservices_x11.cpp index fe7f9a6..75e7209 100644 --- a/src/gui/util/qdesktopservices_x11.cpp +++ b/src/gui/util/qdesktopservices_x11.cpp @@ -71,10 +71,12 @@ static bool openDocument(const QUrl &url) if (launch(url, QLatin1String("xdg-open"))) return true; - if (X11->desktopEnvironment == DE_GNOME && launch(url, QLatin1String("gnome-open"))) { + // Use the X11->desktopEnvironment value if X11 is non-NULL, + // otherwise just attempt to launch command regardless of the desktop environment + if ((!X11 || (X11 && X11->desktopEnvironment == DE_GNOME)) && launch(url, QLatin1String("gnome-open"))) { return true; } else { - if (X11->desktopEnvironment == DE_KDE && launch(url, QLatin1String("kfmclient exec"))) + if ((!X11 || (X11 && X11->desktopEnvironment == DE_KDE)) && launch(url, QLatin1String("kfmclient exec"))) return true; } @@ -104,10 +106,12 @@ static bool launchWebBrowser(const QUrl &url) if (launch(url, QString::fromLocal8Bit(getenv("BROWSER")))) return true; - if (X11->desktopEnvironment == DE_GNOME && launch(url, QLatin1String("gnome-open"))) { + // Use the X11->desktopEnvironment value if X11 is non-NULL, + // otherwise just attempt to launch command regardless of the desktop environment + if ((!X11 || (X11 && X11->desktopEnvironment == DE_GNOME)) && launch(url, QLatin1String("gnome-open"))) { return true; } else { - if (X11->desktopEnvironment == DE_KDE && launch(url, QLatin1String("kfmclient openURL"))) + if ((!X11 || (X11 && X11->desktopEnvironment == DE_KDE)) && launch(url, QLatin1String("kfmclient openURL"))) return true; } diff --git a/src/gui/widgets/qcombobox.cpp b/src/gui/widgets/qcombobox.cpp index bb2da9a..487d244 100644 --- a/src/gui/widgets/qcombobox.cpp +++ b/src/gui/widgets/qcombobox.cpp @@ -911,7 +911,7 @@ QComboBox::QComboBox(bool rw, QWidget *parent, const char *name) interaction. The highlighted() signal is emitted when the user highlights an item in the combobox popup list. All three signals exist in two versions, one with a QString argument and one with an - \c int argument. If the user selectes or highlights a pixmap, only + \c int argument. If the user selects or highlights a pixmap, only the \c int signals are emitted. Whenever the text of an editable combobox is changed the editTextChanged() signal is emitted. diff --git a/src/gui/widgets/qcommandlinkbutton.cpp b/src/gui/widgets/qcommandlinkbutton.cpp index d3b5869..a6f5f7d 100644 --- a/src/gui/widgets/qcommandlinkbutton.cpp +++ b/src/gui/widgets/qcommandlinkbutton.cpp @@ -349,7 +349,7 @@ void QCommandLinkButton::paintEvent(QPaintEvent *) QStyleOptionButton option; initStyleOption(&option); - //Enable command link appearence on Vista + //Enable command link appearance on Vista option.features |= QStyleOptionButton::CommandLinkButton; option.text = QString(); option.icon = QIcon(); //we draw this ourselves diff --git a/src/gui/widgets/qdatetimeedit.cpp b/src/gui/widgets/qdatetimeedit.cpp index e272ce4..3bc6412 100644 --- a/src/gui/widgets/qdatetimeedit.cpp +++ b/src/gui/widgets/qdatetimeedit.cpp @@ -754,6 +754,7 @@ QCalendarWidget *QDateTimeEdit::calendarWidget() const Sets the given \a calendarWidget as the widget to be used for the calendar pop-up. The editor does not automatically take ownership of the calendar widget. + \note calendarPopup must be set to true before setting the calendar widget. \sa calendarPopup */ void QDateTimeEdit::setCalendarWidget(QCalendarWidget *calendarWidget) diff --git a/src/gui/widgets/qmainwindowlayout.cpp b/src/gui/widgets/qmainwindowlayout.cpp index 593e391..62ee398 100644 --- a/src/gui/widgets/qmainwindowlayout.cpp +++ b/src/gui/widgets/qmainwindowlayout.cpp @@ -943,7 +943,7 @@ void QMainWindowLayout::toggleToolBarsVisible() #ifdef Q_WS_MAC if (layoutState.mainWindow->unifiedTitleAndToolBarOnMac()) { // If we hit this case, someone has pressed the "toolbar button" which will - // toggle the unified toolbar visiblity, because that's what the user wants. + // toggle the unified toolbar visibility, because that's what the user wants. // We might be in a situation where someone has hidden all the toolbars // beforehand (maybe in construction), but now they've hit this button and // and are expecting the items to show. What do we do? diff --git a/src/gui/widgets/qmainwindowlayout_mac.mm b/src/gui/widgets/qmainwindowlayout_mac.mm index b8cef93..1bfc746 100644 --- a/src/gui/widgets/qmainwindowlayout_mac.mm +++ b/src/gui/widgets/qmainwindowlayout_mac.mm @@ -48,6 +48,7 @@ #include <Carbon/Carbon.h> #else #include <private/qcocoatoolbardelegate_mac_p.h> +#import <private/qcocoawindowdelegate_mac_p.h> #endif QT_BEGIN_NAMESPACE @@ -337,6 +338,17 @@ void QMainWindowLayout::updateHIToolBarStatus() #endif layoutState.mainWindow->setUpdatesEnabled(false); // reduces a little bit of flicker, not all though +#if defined(QT_MAC_USE_COCOA) + QMacCocoaAutoReleasePool pool; + NSView *cView = [qt_mac_window_for(layoutState.mainWindow) contentView]; + if (useMacToolbar) { + [cView setPostsFrameChangedNotifications:YES]; + [[NSNotificationCenter defaultCenter] addObserver: [QT_MANGLE_NAMESPACE(QCocoaWindowDelegate) sharedDelegate] + selector: @selector(syncContentViewFrame:) + name: NSViewFrameDidChangeNotification + object: cView]; + } +#endif if (!useMacToolbar) { macWindowToolbarShow(layoutState.mainWindow, false); // Move everything out of the HIToolbar into the main toolbar. @@ -356,6 +368,14 @@ void QMainWindowLayout::updateHIToolBarStatus() } syncUnifiedToolbarVisibility(); } +#if defined(QT_MAC_USE_COCOA) + if (!useMacToolbar) { + [cView setPostsFrameChangedNotifications:NO]; + [[NSNotificationCenter defaultCenter] removeObserver: [QT_MANGLE_NAMESPACE(QCocoaWindowDelegate) sharedDelegate] + name: NSViewFrameDidChangeNotification + object: cView]; + } +#endif layoutState.mainWindow->setUpdatesEnabled(true); } diff --git a/src/gui/widgets/qmenu.cpp b/src/gui/widgets/qmenu.cpp index 469c7d4..245657a 100644 --- a/src/gui/widgets/qmenu.cpp +++ b/src/gui/widgets/qmenu.cpp @@ -262,7 +262,7 @@ void QMenuPrivate::updateActionRects() const const int deskFw = style->pixelMetric(QStyle::PM_MenuDesktopFrameWidth, &opt, q); const int tearoffHeight = tearoff ? style->pixelMetric(QStyle::PM_MenuTearoffHeight, &opt, q) : 0; - //for compatability now - will have to refactor this away.. + //for compatibility now - will have to refactor this away tabWidth = 0; maxIconWidth = 0; hasCheckableItems = false; @@ -1154,7 +1154,7 @@ void QMenuPrivate::_q_actionHovered() bool QMenuPrivate::hasMouseMoved(const QPoint &globalPos) { - //determines if the mouse has moved (ie its intial position has + //determines if the mouse has moved (ie its initial position has //changed by more than QApplication::startDragDistance() //or if there were at least 6 mouse motions) return motions > 6 || diff --git a/src/gui/widgets/qmenubar.cpp b/src/gui/widgets/qmenubar.cpp index e8e80b7..df16f7f 100644 --- a/src/gui/widgets/qmenubar.cpp +++ b/src/gui/widgets/qmenubar.cpp @@ -102,7 +102,7 @@ void QMenuBarExtension::paintEvent(QPaintEvent *) QStylePainter p(this); QStyleOptionToolButton opt; initStyleOption(&opt); - // We do not need to draw both extention arrows + // We do not need to draw both extension arrows opt.features &= ~QStyleOptionToolButton::HasMenu; p.drawComplexControl(QStyle::CC_ToolButton, opt); } diff --git a/src/gui/widgets/qprintpreviewwidget.cpp b/src/gui/widgets/qprintpreviewwidget.cpp index 45b15ef..ea311d3 100644 --- a/src/gui/widgets/qprintpreviewwidget.cpp +++ b/src/gui/widgets/qprintpreviewwidget.cpp @@ -469,7 +469,7 @@ void QPrintPreviewWidgetPrivate::setZoomFactor(qreal _zoomFactor) \o Create the QPrintPreviewWidget Construct the QPrintPreviewWidget either by passing in an - exisiting QPrinter object, or have QPrintPreviewWidget create a + existing QPrinter object, or have QPrintPreviewWidget create a default constructed QPrinter object for you. \o Connect the paintRequested() signal to a slot. diff --git a/src/gui/widgets/qpushbutton.cpp b/src/gui/widgets/qpushbutton.cpp index 8a18ed0..237c266 100644 --- a/src/gui/widgets/qpushbutton.cpp +++ b/src/gui/widgets/qpushbutton.cpp @@ -687,11 +687,11 @@ bool QPushButton::event(QEvent *e) /*! \reimp */ bool QPushButton::hitButton(const QPoint &pos) const { - // This is only required if we are using the native style, so check that first. - QMacStyle *macStyle = qobject_cast<QMacStyle *>(style()); - // If this is a flat button we just bail out. - if(isFlat() || (0 == macStyle)) + QStyleOptionButton opt; + initStyleOption(&opt); + if (qt_mac_buttonIsRenderedFlat(this, &opt)) return QAbstractButton::hitButton(pos); + // Now that we know we are using the native style, let's proceed. Q_D(const QPushButton); QPushButtonPrivate *nonConst = const_cast<QPushButtonPrivate *>(d); diff --git a/src/gui/widgets/qtoolbarextension.cpp b/src/gui/widgets/qtoolbarextension.cpp index 032c6f0..574a775 100644 --- a/src/gui/widgets/qtoolbarextension.cpp +++ b/src/gui/widgets/qtoolbarextension.cpp @@ -75,7 +75,7 @@ void QToolBarExtension::paintEvent(QPaintEvent *) QStylePainter p(this); QStyleOptionToolButton opt; initStyleOption(&opt); - // We do not need to draw both extention arrows + // We do not need to draw both extension arrows opt.features &= ~QStyleOptionToolButton::HasMenu; p.drawComplexControl(QStyle::CC_ToolButton, opt); } diff --git a/src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp b/src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp index f663dd2..633b309 100644 --- a/src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp +++ b/src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp @@ -431,21 +431,24 @@ QList<QByteArray> QAudioDeviceInfoInternal::availableDevices(QAudio::Mode mode) while (*n != NULL) { name = snd_device_name_get_hint(*n, "NAME"); - descr = snd_device_name_get_hint(*n, "DESC"); - io = snd_device_name_get_hint(*n, "IOID"); - if((name != NULL) && (descr != NULL) && ((io == NULL) || (io == filter))) { - QString deviceName = QLatin1String(name); - QString deviceDescription = QLatin1String(descr); - allDevices.append(deviceName.toLocal8Bit().constData()); - if(deviceDescription.contains(QLatin1String("Default Audio Device"))) - devices.append(deviceName.toLocal8Bit().constData()); - } - if(name != NULL) + if (name != 0 && qstrcmp(name, "null") != 0) { + descr = snd_device_name_get_hint(*n, "DESC"); + io = snd_device_name_get_hint(*n, "IOID"); + + if ((descr != NULL) && ((io == NULL) || (io == filter))) { + QString deviceName = QLatin1String(name); + QString deviceDescription = QLatin1String(descr); + allDevices.append(deviceName.toLocal8Bit().constData()); + if (deviceDescription.contains(QLatin1String("Default Audio Device"))) + devices.append(deviceName.toLocal8Bit().constData()); + } + free(name); - if(descr != NULL) - free(descr); - if(io != NULL) - free(io); + if (descr != NULL) + free(descr); + if (io != NULL) + free(io); + } ++n; } snd_device_name_free_hint(hints); diff --git a/src/multimedia/video/qvideosurfaceformat.cpp b/src/multimedia/video/qvideosurfaceformat.cpp index 6cdf7c0..3ec40e8 100644 --- a/src/multimedia/video/qvideosurfaceformat.cpp +++ b/src/multimedia/video/qvideosurfaceformat.cpp @@ -252,7 +252,7 @@ QVideoSurfaceFormat::~QVideoSurfaceFormat() bool QVideoSurfaceFormat::isValid() const { - return d->pixelFormat == QVideoFrame::Format_Invalid && d->frameSize.isValid(); + return d->pixelFormat != QVideoFrame::Format_Invalid && d->frameSize.isValid(); } /*! diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp index 9e2b85e..ae4d257 100644 --- a/src/network/access/qhttpnetworkconnection.cpp +++ b/src/network/access/qhttpnetworkconnection.cpp @@ -653,6 +653,8 @@ void QHttpNetworkConnectionPrivate::removeReply(QHttpNetworkReply *reply) // is the reply associated the currently processing of this channel? if (channels[i].reply == reply) { channels[i].reply = 0; + channels[i].request = QHttpNetworkRequest(); + channels[i].resendCurrent = false; if (!reply->isFinished() && !channels[i].alreadyPipelinedRequests.isEmpty()) { // the reply had to be prematurely removed, e.g. it was not finished diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp index 71a4de3..cfd4f17 100644 --- a/src/network/access/qhttpnetworkconnectionchannel.cpp +++ b/src/network/access/qhttpnetworkconnectionchannel.cpp @@ -625,8 +625,10 @@ void QHttpNetworkConnectionChannel::allDone() // finished request. // Note that this may trigger a segfault at some other point. But then we can fix the underlying // problem. - if (!resendCurrent) + if (!resendCurrent) { + request = QHttpNetworkRequest(); reply = 0; + } // move next from pipeline to current request if (!alreadyPipelinedRequests.isEmpty()) { diff --git a/src/network/access/qnetworkrequest.cpp b/src/network/access/qnetworkrequest.cpp index f4284b8..09ec4c2 100644 --- a/src/network/access/qnetworkrequest.cpp +++ b/src/network/access/qnetworkrequest.cpp @@ -105,7 +105,8 @@ QT_BEGIN_NAMESPACE /*! \enum QNetworkRequest::Attribute - + \since 4.7 + Attribute codes for the QNetworkRequest and QNetworkReply. Attributes are extra meta-data that are used to control the @@ -174,21 +175,21 @@ QT_BEGIN_NAMESPACE When using this flag with sequential upload data, the ContentLengthHeader header must be set. - \value HttpPipeliningAllowedAttribute + \value HttpPipeliningAllowedAttribute Requests only, type: QVariant::Bool (default: false) Indicates whether the QNetworkAccessManager code is allowed to use HTTP pipelining with this request. - \value HttpPipeliningWasUsedAttribute + \value HttpPipeliningWasUsedAttribute Replies only, type: QVariant::Bool Indicates whether the HTTP pipelining was used for receiving this reply. \value CustomVerbAttribute Requests only, type: QVariant::ByteArray - Holds the value for the custom HTTP verb to send (destined for usage - of other verbs than GET, POST, PUT and DELETE). This verb is set - when calling QNetworkAccessManager::sendCustomRequest(). + Holds the value for the custom HTTP verb to send (destined for usage + of other verbs than GET, POST, PUT and DELETE). This verb is set + when calling QNetworkAccessManager::sendCustomRequest(). \value CookieLoadControlAttribute Requests only, type: QVariant::Int (default: QNetworkRequest::Automatic) @@ -198,45 +199,42 @@ QT_BEGIN_NAMESPACE XMLHttpRequest where withCredentials has not been set explicitly to true by the Javascript that created the request. - See http://www.w3.org/TR/XMLHttpRequest2/#credentials-flag for more information. + See \l{http://www.w3.org/TR/XMLHttpRequest2/#credentials-flag}{here} for more information. + + (This value was introduced in 4.7.) - \since 4.7 - \value CookieSaveControlAttribute + \value CookieSaveControlAttribute Requests only, type: QVariant::Int (default: QNetworkRequest::Automatic) Indicates whether to save 'Cookie' headers received from the server in reply to the request. - This attribute is set to false by QtWebKit when creating a cross-origin XMLHttpRequest where withCredentials has not been set explicitly to true by the Javascript that created the request. - See http://www.w3.org/TR/XMLHttpRequest2/#credentials-flag for more information. + See \l{http://www.w3.org/TR/XMLHttpRequest2/#credentials-flag} {here} for more information. - \since 4.7 + (This value was introduced in 4.7.) - \value AuthenticationReuseAttribute + \value AuthenticationReuseAttribute Requests only, type: QVariant::Int (default: QNetworkRequest::Automatic) Indicates whether to use cached authorization credentials in the request, if available. If this is set to QNetworkRequest::Manual and the authentication mechanism is 'Basic' or 'Digest', Qt will not send an an 'Authorization' HTTP header with any cached credentials it may have for the request's URL. - This attribute is set to QNetworkRequest::Manual by QtWebKit when creating a cross-origin XMLHttpRequest where withCredentials has not been set explicitly to true by the Javascript that created the request. - See http://www.w3.org/TR/XMLHttpRequest2/#credentials-flag for more information. + See \l{http://www.w3.org/TR/XMLHttpRequest2/#credentials-flag} {here} for more information. - \since 4.7 + (This value was introduced in 4.7.) \omitvalue MaximumDownloadBufferSizeAttribute - \since 4.7 - \internal + (This value was introduced in 4.7.) \omitvalue DownloadBufferAttribute - \since 4.7 - \internal + (This value was introduced in 4.7.) \value User Special type. Additional information can be passed in diff --git a/src/network/bearer/qnetworkconfigmanager_p.cpp b/src/network/bearer/qnetworkconfigmanager_p.cpp index 5d4274f..c4f7c00 100644 --- a/src/network/bearer/qnetworkconfigmanager_p.cpp +++ b/src/network/bearer/qnetworkconfigmanager_p.cpp @@ -150,25 +150,29 @@ QNetworkConfiguration QNetworkConfigurationManagerPrivate::defaultConfiguration( end = engine->accessPointConfigurations.end(); it != end; ++it) { QNetworkConfigurationPrivatePointer ptr = it.value(); - const QString bearerName = ptr->bearerName(); QMutexLocker configLocker(&ptr->mutex); + QNetworkConfiguration::BearerType bearerType = ptr->bearerType; if ((ptr->state & QNetworkConfiguration::Discovered) == QNetworkConfiguration::Discovered) { if (!defaultConfiguration) { defaultConfiguration = ptr; } else { + QMutexLocker defaultConfigLocker(&defaultConfiguration->mutex); + if (defaultConfiguration->state == ptr->state) { - if (defaultConfiguration->bearerName() == QLatin1String("Ethernet")) { + switch (defaultConfiguration->bearerType) { + case QNetworkConfiguration::BearerEthernet: // do nothing - } else if (defaultConfiguration->bearerName() == QLatin1String("WLAN")) { - // ethernet beats wlan - if (bearerName == QLatin1String("Ethernet")) - defaultConfiguration = ptr; - } else { - // ethernet and wlan beats other - if (bearerName == QLatin1String("Ethernet") || - bearerName == QLatin1String("WLAN")) { + break; + case QNetworkConfiguration::BearerWLAN: + // Ethernet beats WLAN + defaultConfiguration = ptr; + break; + default: + // Ethernet and WLAN beats other + if (bearerType == QNetworkConfiguration::BearerEthernet || + bearerType == QNetworkConfiguration::BearerWLAN) { defaultConfiguration = ptr; } } diff --git a/src/network/bearer/qnetworkconfiguration.cpp b/src/network/bearer/qnetworkconfiguration.cpp index d7fceba..60851ac 100644 --- a/src/network/bearer/qnetworkconfiguration.cpp +++ b/src/network/bearer/qnetworkconfiguration.cpp @@ -183,6 +183,23 @@ QT_BEGIN_NAMESPACE */ /*! + \enum QNetworkConfiguration::BearerType + + Specifies the type of bearer used by a configuration. + + \value BearerUnknown The type of bearer is unknown or unspecified. The bearerTypeName() + function may return additional information. + \value BearerEthernet The configuration is for an Ethernet interfaces. + \value BearerWLAN The configuration is for a Wireless LAN interface. + \value Bearer2G The configuration is for a CSD, GPRS, HSCSD, EDGE or cdmaOne interface. + \value BearerCDMA2000 The configuration is for CDMA interface. + \value BearerWCDMA The configuration is for W-CDMA/UMTS interface. + \value BearerHSPA The configuration is for High Speed Packet Access (HSPA) interface. + \value BearerBluetooth The configuration is for a Bluetooth interface. + \value BearerWiMAX The configuration is for a WiMAX interface. +*/ + +/*! Constructs an invalid configuration object. \sa isValid() @@ -383,53 +400,120 @@ QList<QNetworkConfiguration> QNetworkConfiguration::children() const } /*! - Returns the type of bearer. The string is not translated and - therefore can not be shown to the user. The subsequent table presents the currently known - bearer types: + \fn QString QNetworkConfiguration::bearerName() const + \deprecated + + This function is deprecated. It is equivalent to calling bearerTypeName(), however + bearerType() should be used in preference. +*/ +QString QNetworkConfiguration::bearerName() const +{ + // This function cannot be inline as it would break Qt Mobility. + // Qt Mobility uses the Qt header as well and since the Mobility Bearer library + // does not provide bearerTypeName() we cannot use an inline function. + return bearerTypeName(); +} + +/*! + Returns the type of bearer used by this network configuration. + + If the bearer type is \l {QNetworkConfiguration::BearerUnknown}{unknown} the bearerTypeName() + function can be used to retrieve a textural type name for the bearer. + + An invalid network configuration always returns the BearerUnknown value. +*/ +QNetworkConfiguration::BearerType QNetworkConfiguration::bearerType() const +{ + if (!isValid()) + return BearerUnknown; + + QMutexLocker locker(&d->mutex); + + return d->bearerType; +} + +/*! + Returns the type of bearer used by this network configuration as a string. + + The string is not translated and therefore can not be shown to the user. The subsequent table + shows the fixed mappings between BearerType and the bearer type name for known types. If the + BearerType is unknown this function may return additional information if it is available; + otherwise an empty string will be returned. \table - \header + \header + \o BearerType \o Value - \o Description \row - \o Unknown - \o The session is based on an unknown or unspecified bearer type. + \o BearerUnknown + \o + \o The session is based on an unknown or unspecified bearer type. The value of the + string returned describes the bearer type. \row + \o BearerEthernet \o Ethernet - \o The session is based on Ethernet. \row + \o BearerWLAN \o WLAN - \o The session is based on Wireless LAN. \row + \o Bearer2G \o 2G - \o The session uses CSD, GPRS, HSCSD, EDGE or cdmaOne. - \row + \row + \o BearerCDMA2000 \o CDMA2000 - \o The session uses CDMA. \row + \o BearerWCDMA \o WCDMA - \o The session uses W-CDMA/UMTS. \row + \o BearerHSPA \o HSPA - \o The session uses High Speed Packet Access. \row + \o BearerBluetooth \o Bluetooth - \o The session uses Bluetooth. \row + \o BearerWiMAX \o WiMAX - \o The session uses WiMAX. \endtable - This function returns an empty string if this is an invalid configuration, - a network configuration of type \l QNetworkConfiguration::ServiceNetwork or + This function returns an empty string if this is an invalid configuration, a network + configuration of type \l QNetworkConfiguration::ServiceNetwork or \l QNetworkConfiguration::UserChoice. + + \sa bearerType() */ -QString QNetworkConfiguration::bearerName() const +QString QNetworkConfiguration::bearerTypeName() const { if (!isValid()) return QString(); - return d->bearerName(); + QMutexLocker locker(&d->mutex); + + if (d->type == QNetworkConfiguration::ServiceNetwork || + d->type == QNetworkConfiguration::UserChoice) + return QString(); + + switch (d->bearerType) { + case BearerUnknown: + return d->bearerTypeName(); + case BearerEthernet: + return QLatin1String("Ethernet"); + case BearerWLAN: + return QLatin1String("WLAN"); + case Bearer2G: + return QLatin1String("2G"); + case BearerCDMA2000: + return QLatin1String("CDMA2000"); + case BearerWCDMA: + return QLatin1String("WCDMA"); + case BearerHSPA: + return QLatin1String("HSPA"); + case BearerBluetooth: + return QLatin1String("Bluetooth"); + case BearerWiMAX: + return QLatin1String("WiMAX"); + } + + return QLatin1String("Unknown"); } QT_END_NAMESPACE diff --git a/src/network/bearer/qnetworkconfiguration.h b/src/network/bearer/qnetworkconfiguration.h index dce39eb..18b92a9 100644 --- a/src/network/bearer/qnetworkconfiguration.h +++ b/src/network/bearer/qnetworkconfiguration.h @@ -103,10 +103,29 @@ public: Q_DECLARE_FLAGS(StateFlags, StateFlag) + enum BearerType { + BearerUnknown, + BearerEthernet, + BearerWLAN, + Bearer2G, + BearerCDMA2000, + BearerWCDMA, + BearerHSPA, + BearerBluetooth, + BearerWiMAX + }; + StateFlags state() const; Type type() const; Purpose purpose() const; - QString bearerName() const; + + // Required to maintain source compatibility with Qt Mobility. +#ifdef QT_DEPRECATED + QT_DEPRECATED QString bearerName() const; +#endif + BearerType bearerType() const; + QString bearerTypeName() const; + QString identifier() const; bool isRoamingAvailable() const; QList<QNetworkConfiguration> children() const; diff --git a/src/network/bearer/qnetworkconfiguration_p.h b/src/network/bearer/qnetworkconfiguration_p.h index 966dfb2..2b0bbf6 100644 --- a/src/network/bearer/qnetworkconfiguration_p.h +++ b/src/network/bearer/qnetworkconfiguration_p.h @@ -68,6 +68,7 @@ public: QNetworkConfigurationPrivate () : mutex(QMutex::Recursive), type(QNetworkConfiguration::Invalid), purpose(QNetworkConfiguration::UnknownPurpose), + bearerType(QNetworkConfiguration::BearerUnknown), isValid(false), roamingSupported(false) { } @@ -78,24 +79,22 @@ public: serviceNetworkMembers.clear(); } - virtual QString bearerName() const + virtual QString bearerTypeName() const { - QMutexLocker locker(&mutex); - - return bearer; + return QLatin1String("Unknown"); } QMap<unsigned int, QNetworkConfigurationPrivatePointer> serviceNetworkMembers; mutable QMutex mutex; - QString bearer; QString name; QString id; QNetworkConfiguration::StateFlags state; QNetworkConfiguration::Type type; QNetworkConfiguration::Purpose purpose; + QNetworkConfiguration::BearerType bearerType; bool isValid; bool roamingSupported; diff --git a/src/network/kernel/qhostinfo.cpp b/src/network/kernel/qhostinfo.cpp index 985caf4..7908182 100644 --- a/src/network/kernel/qhostinfo.cpp +++ b/src/network/kernel/qhostinfo.cpp @@ -627,7 +627,7 @@ void QHostInfoLookupManager::lookupFinished(QHostInfoRunnable *r) work(); } -// This function returns immediatly when we had a result in the cache, else it will later emit a signal +// This function returns immediately when we had a result in the cache, else it will later emit a signal QHostInfo qt_qhostinfo_lookup(const QString &name, QObject *receiver, const char *member, bool *valid, int *id) { *valid = false; diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp index 171fbb6..086292f 100644 --- a/src/network/socket/qabstractsocket.cpp +++ b/src/network/socket/qabstractsocket.cpp @@ -1369,7 +1369,7 @@ void QAbstractSocket::connectToHostImplementation(const QString &hostName, quint #endif } else { if (d->threadData->eventDispatcher) { - // this internal API for QHostInfo either immediatly gives us the desired + // this internal API for QHostInfo either immediately gives us the desired // QHostInfo from cache or later calls the _q_startConnecting slot. bool immediateResultValid = false; QHostInfo hostInfo = qt_qhostinfo_lookup(hostName, diff --git a/src/network/socket/qlocalsocket_win.cpp b/src/network/socket/qlocalsocket_win.cpp index 4907f2c..1e0bced 100644 --- a/src/network/socket/qlocalsocket_win.cpp +++ b/src/network/socket/qlocalsocket_win.cpp @@ -306,7 +306,7 @@ void QLocalSocketPrivate::startAsyncRead() /*! \internal Sets the correct size of the read buffer after a read operation. - Returns false, if an error occured or the connection dropped. + Returns false, if an error occurred or the connection dropped. */ bool QLocalSocketPrivate::completeAsyncRead() { diff --git a/src/network/socket/qnativesocketengine_unix.cpp b/src/network/socket/qnativesocketengine_unix.cpp index f91ce5f..fe28863 100644 --- a/src/network/socket/qnativesocketengine_unix.cpp +++ b/src/network/socket/qnativesocketengine_unix.cpp @@ -562,7 +562,7 @@ int QNativeSocketEnginePrivate::nativeAccept() #else int acceptedDescriptor = qt_safe_accept(socketDescriptor, 0, 0); #endif - //check if we have vaild descriptor at all + //check if we have valid descriptor at all if(acceptedDescriptor > 0) { // Ensure that the socket is closed on exec*() ::fcntl(acceptedDescriptor, F_SETFD, FD_CLOEXEC); diff --git a/src/network/ssl/qsslsocket.cpp b/src/network/ssl/qsslsocket.cpp index f73068e..91265f3 100644 --- a/src/network/ssl/qsslsocket.cpp +++ b/src/network/ssl/qsslsocket.cpp @@ -210,7 +210,7 @@ valid. On failure, QSslSocket will emit the QSslSocket::sslErrors() signal. This mode is the default for clients. - \value AutoVerifyPeer QSslSocket will automaticaly use QueryPeer for + \value AutoVerifyPeer QSslSocket will automatically use QueryPeer for server sockets and VerifyPeer for client sockets. \sa QSslSocket::peerVerifyMode() diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp index b4d030c..94b1568 100644 --- a/src/network/ssl/qsslsocket_openssl.cpp +++ b/src/network/ssl/qsslsocket_openssl.cpp @@ -750,7 +750,7 @@ QList<QSslCertificate> QSslSocketPrivate::systemCaCertificates() ptrCertCloseStore(hSystemStore, 0); } } -#elif defined(Q_OS_UNIX) +#elif defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN) systemCerts.append(QSslCertificate::fromPath(QLatin1String("/var/ssl/certs/*.pem"), QSsl::Pem, QRegExp::Wildcard)); // AIX systemCerts.append(QSslCertificate::fromPath(QLatin1String("/usr/local/ssl/certs/*.pem"), QSsl::Pem, QRegExp::Wildcard)); // Solaris systemCerts.append(QSslCertificate::fromPath(QLatin1String("/opt/openssl/certs/*.pem"), QSsl::Pem, QRegExp::Wildcard)); // HP-UX @@ -1288,6 +1288,11 @@ bool QSslSocketBackendPrivate::isMatchingHostname(const QString &cn, const QStri if (hostname.midRef(hostname.indexOf(QLatin1Char('.'))) != cn.midRef(firstCnDot)) return false; + // Check if the hostname is an IP address, if so then wildcards are not allowed + QHostAddress addr(hostname); + if (!addr.isNull()) + return false; + // Ok, I guess this was a wildcard CN and the hostname matches. return true; } diff --git a/src/network/ssl/qsslsocket_openssl_symbols.cpp b/src/network/ssl/qsslsocket_openssl_symbols.cpp index 09ecd4d..d1225c1 100644 --- a/src/network/ssl/qsslsocket_openssl_symbols.cpp +++ b/src/network/ssl/qsslsocket_openssl_symbols.cpp @@ -761,74 +761,95 @@ bool q_resolveOpenSslSymbols() //============================================================================== QDateTime q_getTimeFromASN1(const ASN1_TIME *aTime) { - char lBuffer[24]; - char *pBuffer = lBuffer; - size_t lTimeLength = aTime->length; char *pString = (char *) aTime->data; if (aTime->type == V_ASN1_UTCTIME) { + + char lBuffer[24]; + char *pBuffer = lBuffer; + if ((lTimeLength < 11) || (lTimeLength > 17)) return QDateTime(); memcpy(pBuffer, pString, 10); pBuffer += 10; pString += 10; - } else { - if (lTimeLength < 13) - return QDateTime(); - - memcpy(pBuffer, pString, 12); - pBuffer += 12; - pString += 12; - } - if ((*pString == 'Z') || (*pString == '-') || (*pString == '+')) { - *pBuffer++ = '0'; - *pBuffer++ = '0'; - } else { - *pBuffer++ = *pString++; - *pBuffer++ = *pString++; - // Skip any fractional seconds... - if (*pString == '.') { - pString++; - while ((*pString >= '0') && (*pString <= '9')) + if ((*pString == 'Z') || (*pString == '-') || (*pString == '+')) { + *pBuffer++ = '0'; + *pBuffer++ = '0'; + } else { + *pBuffer++ = *pString++; + *pBuffer++ = *pString++; + // Skip any fractional seconds... + if (*pString == '.') { pString++; + while ((*pString >= '0') && (*pString <= '9')) + pString++; + } } - } - *pBuffer++ = 'Z'; - *pBuffer++ = '\0'; + *pBuffer++ = 'Z'; + *pBuffer++ = '\0'; - time_t lSecondsFromUCT; - if (*pString == 'Z') { - lSecondsFromUCT = 0; - } else { - if ((*pString != '+') && (*pString != '-')) - return QDateTime(); + time_t lSecondsFromUCT; + if (*pString == 'Z') { + lSecondsFromUCT = 0; + } else { + if ((*pString != '+') && (*pString != '-')) + return QDateTime(); + + lSecondsFromUCT = ((pString[1] - '0') * 10 + (pString[2] - '0')) * 60; + lSecondsFromUCT += (pString[3] - '0') * 10 + (pString[4] - '0'); + lSecondsFromUCT *= 60; + if (*pString == '-') + lSecondsFromUCT = -lSecondsFromUCT; + } + + tm lTime; + lTime.tm_sec = ((lBuffer[10] - '0') * 10) + (lBuffer[11] - '0'); + lTime.tm_min = ((lBuffer[8] - '0') * 10) + (lBuffer[9] - '0'); + lTime.tm_hour = ((lBuffer[6] - '0') * 10) + (lBuffer[7] - '0'); + lTime.tm_mday = ((lBuffer[4] - '0') * 10) + (lBuffer[5] - '0'); + lTime.tm_mon = (((lBuffer[2] - '0') * 10) + (lBuffer[3] - '0')) - 1; + lTime.tm_year = ((lBuffer[0] - '0') * 10) + (lBuffer[1] - '0'); + if (lTime.tm_year < 50) + lTime.tm_year += 100; // RFC 2459 + + QDate resDate(lTime.tm_year + 1900, lTime.tm_mon + 1, lTime.tm_mday); + QTime resTime(lTime.tm_hour, lTime.tm_min, lTime.tm_sec); + + QDateTime result(resDate, resTime, Qt::UTC); + result = result.addSecs(lSecondsFromUCT); + return result; + + } else if (aTime->type == V_ASN1_GENERALIZEDTIME) { - lSecondsFromUCT = ((pString[1] - '0') * 10 + (pString[2] - '0')) * 60; - lSecondsFromUCT += (pString[3] - '0') * 10 + (pString[4] - '0'); - lSecondsFromUCT *= 60; - if (*pString == '-') - lSecondsFromUCT = -lSecondsFromUCT; + if (lTimeLength < 15) + return QDateTime(); // hopefully never triggered + + // generalized time is always YYYYMMDDHHMMSSZ (RFC 2459, section 4.1.2.5.2) + tm lTime; + lTime.tm_sec = ((pString[12] - '0') * 10) + (pString[13] - '0'); + lTime.tm_min = ((pString[10] - '0') * 10) + (pString[11] - '0'); + lTime.tm_hour = ((pString[8] - '0') * 10) + (pString[9] - '0'); + lTime.tm_mday = ((pString[6] - '0') * 10) + (pString[7] - '0'); + lTime.tm_mon = (((pString[4] - '0') * 10) + (pString[5] - '0')); + lTime.tm_year = ((pString[0] - '0') * 1000) + ((pString[1] - '0') * 100) + + ((pString[2] - '0') * 10) + (pString[3] - '0'); + + QDate resDate(lTime.tm_year, lTime.tm_mon, lTime.tm_mday); + QTime resTime(lTime.tm_hour, lTime.tm_min, lTime.tm_sec); + + QDateTime result(resDate, resTime, Qt::UTC); + return result; + + } else { + qWarning("unsupported date format detected"); + return QDateTime(); } - tm lTime; - lTime.tm_sec = ((lBuffer[10] - '0') * 10) + (lBuffer[11] - '0'); - lTime.tm_min = ((lBuffer[8] - '0') * 10) + (lBuffer[9] - '0'); - lTime.tm_hour = ((lBuffer[6] - '0') * 10) + (lBuffer[7] - '0'); - lTime.tm_mday = ((lBuffer[4] - '0') * 10) + (lBuffer[5] - '0'); - lTime.tm_mon = (((lBuffer[2] - '0') * 10) + (lBuffer[3] - '0')) - 1; - lTime.tm_year = ((lBuffer[0] - '0') * 10) + (lBuffer[1] - '0'); - if (lTime.tm_year < 50) - lTime.tm_year += 100; // RFC 2459 - - QDate resDate(lTime.tm_year + 1900, lTime.tm_mon + 1, lTime.tm_mday); - QTime resTime(lTime.tm_hour, lTime.tm_min, lTime.tm_sec); - QDateTime result(resDate, resTime, Qt::UTC); - result = result.addSecs(lSecondsFromUCT); - return result; } QT_END_NAMESPACE diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index 6068dcb..71d42a5 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -1994,7 +1994,7 @@ struct DDSFormat { option helps preserve this default behavior. \omitvalue CanFlipNativePixmapBindOption Used by x11 from pixmap to choose - wether or not it can bind the pixmap upside down or not. + whether or not it can bind the pixmap upside down or not. \omitvalue MemoryManagedBindOption Used by paint engines to indicate that the pixmap should be memory managed along side with diff --git a/src/opengl/qgl_egl.cpp b/src/opengl/qgl_egl.cpp index 3763926..a154325 100644 --- a/src/opengl/qgl_egl.cpp +++ b/src/opengl/qgl_egl.cpp @@ -240,6 +240,7 @@ void QGLContextPrivate::destroyEglSurfaceForDevice() if (QGLWidget *wgl = qobject_cast<QGLWidget *>(w)) { if (wgl->d_func()->eglSurfaceWindowId != wgl->winId()) { qWarning("WARNING: Potential EGL surface leak! Not destroying surface."); + eglSurface = EGL_NO_SURFACE; return; } } diff --git a/src/opengl/qgl_mac.mm b/src/opengl/qgl_mac.mm index 4d7532e..66fe7d3 100644 --- a/src/opengl/qgl_mac.mm +++ b/src/opengl/qgl_mac.mm @@ -804,17 +804,22 @@ void QGLContext::generateFontDisplayLists(const QFont & /* fnt */, int /* listBa static CFBundleRef qt_getOpenGLBundle() { CFBundleRef bundle = 0; + CFStringRef urlString = QCFString::toCFStringRef(QLatin1String("/System/Library/Frameworks/OpenGL.framework")); QCFType<CFURLRef> url = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, - QCFString::toCFStringRef(QLatin1String("/System/Library/Frameworks/OpenGL.framework")), kCFURLPOSIXPathStyle, false); + urlString, kCFURLPOSIXPathStyle, false); if (url) bundle = CFBundleCreate(kCFAllocatorDefault, url); + CFRelease(urlString); return bundle; } void *QGLContext::getProcAddress(const QString &proc) const { - return CFBundleGetFunctionPointerForName(QCFType<CFBundleRef>(qt_getOpenGLBundle()), - QCFString(proc)); + CFStringRef procName = QCFString(proc).toCFStringRef(proc); + void *result = CFBundleGetFunctionPointerForName(QCFType<CFBundleRef>(qt_getOpenGLBundle()), + procName); + CFRelease(procName); + return result; } #ifndef QT_MAC_USE_COCOA /***************************************************************************** diff --git a/src/opengl/qglextensions.cpp b/src/opengl/qglextensions.cpp index 8e2bbd4..6aec8ae 100644 --- a/src/opengl/qglextensions.cpp +++ b/src/opengl/qglextensions.cpp @@ -255,6 +255,10 @@ bool qt_resolve_glsl_extensions(QGLContext *ctx) glFramebufferTextureLayerEXT = (_glFramebufferTextureLayerEXT) ctx->getProcAddress(QLatin1String("glFramebufferTextureLayerEXT")); glFramebufferTextureFaceEXT = (_glFramebufferTextureFaceEXT) ctx->getProcAddress(QLatin1String("glFramebufferTextureFaceEXT")); + // Must at least have the FragmentShader extension to continue. + if (!(QGLExtensions::glExtensions() & QGLExtensions::FragmentShader)) + return false; + glCreateShader = (_glCreateShader) ctx->getProcAddress(QLatin1String("glCreateShader")); if (glCreateShader) { glShaderSource = (_glShaderSource) ctx->getProcAddress(QLatin1String("glShaderSource")); diff --git a/src/opengl/qglframebufferobject.cpp b/src/opengl/qglframebufferobject.cpp index fe60e83..876e97a 100644 --- a/src/opengl/qglframebufferobject.cpp +++ b/src/opengl/qglframebufferobject.cpp @@ -445,11 +445,11 @@ void QGLFramebufferObjectPrivate::init(QGLFramebufferObject *q, const QSize &sz, GLint maxSamples; glGetIntegerv(GL_MAX_SAMPLES_EXT, &maxSamples); - samples = qBound(1, int(samples), int(maxSamples)); + samples = qBound(0, int(samples), int(maxSamples)); glGenRenderbuffers(1, &color_buffer); glBindRenderbuffer(GL_RENDERBUFFER_EXT, color_buffer); - if (glRenderbufferStorageMultisampleEXT) { + if (glRenderbufferStorageMultisampleEXT && samples > 0) { glRenderbufferStorageMultisampleEXT(GL_RENDERBUFFER_EXT, samples, internal_format, size.width(), size.height()); } else { diff --git a/src/opengl/qglshaderprogram.cpp b/src/opengl/qglshaderprogram.cpp index c7689b8..74382b0 100644 --- a/src/opengl/qglshaderprogram.cpp +++ b/src/opengl/qglshaderprogram.cpp @@ -2121,7 +2121,7 @@ void QGLShaderProgram::setUniformValue(int location, const QSize& size) Q_D(QGLShaderProgram); Q_UNUSED(d); if (location != -1) { - GLfloat values[4] = {GLfloat(size.width()), GLfloat(size.width())}; + GLfloat values[4] = {GLfloat(size.width()), GLfloat(size.height())}; glUniform2fv(location, 1, values); } } diff --git a/src/opengl/qwindowsurface_gl.cpp b/src/opengl/qwindowsurface_gl.cpp index 6b82ed3..b86fb78 100644 --- a/src/opengl/qwindowsurface_gl.cpp +++ b/src/opengl/qwindowsurface_gl.cpp @@ -199,6 +199,7 @@ public: return widget; } + // destroys the share widget and prevents recreation void cleanup() { QGLWidget *w = widget; cleanedUp = true; @@ -206,6 +207,20 @@ public: delete w; } + // destroys the share widget, but allows it to be recreated later on + void destroy() { + if (cleanedUp) + return; + + QGLWidget *w = widget; + + // prevent potential recursions + cleanedUp = true; + widget = 0; + delete w; + cleanedUp = false; + } + static bool cleanedUp; private: @@ -233,6 +248,10 @@ QGLWidget* qt_gl_share_widget() return _qt_gl_share_widget()->shareWidget(); } +void qt_destroy_gl_share_widget() +{ + _qt_gl_share_widget()->destroy(); +} struct QGLWindowSurfacePrivate { diff --git a/src/opengl/qwindowsurface_gl_p.h b/src/opengl/qwindowsurface_gl_p.h index 5e670fe..ffc2e86 100644 --- a/src/opengl/qwindowsurface_gl_p.h +++ b/src/opengl/qwindowsurface_gl_p.h @@ -67,6 +67,7 @@ class QWidget; struct QGLWindowSurfacePrivate; Q_OPENGL_EXPORT QGLWidget* qt_gl_share_widget(); +Q_OPENGL_EXPORT void qt_destroy_gl_share_widget(); class QGLWindowSurfaceGLPaintDevice : public QGLPaintDevice { diff --git a/src/openvg/qpaintengine_vg.cpp b/src/openvg/qpaintengine_vg.cpp index 1d633ed..75e5a60 100644 --- a/src/openvg/qpaintengine_vg.cpp +++ b/src/openvg/qpaintengine_vg.cpp @@ -77,6 +77,9 @@ QT_BEGIN_NAMESPACE #if !defined(QVG_NO_DRAW_GLYPHS) +// use the same rounding as in qrasterizer.cpp (6 bit fixed point) +static const qreal aliasedCoordinateDelta = 0.5 - 0.015625; + Q_DECL_IMPORT extern int qt_defaultDpiX(); Q_DECL_IMPORT extern int qt_defaultDpiY(); @@ -102,6 +105,7 @@ private: class QVGPaintEnginePrivate : public QPaintEngineExPrivate { + Q_DECLARE_PUBLIC(QVGPaintEngine) public: // Extra blending modes from VG_KHR_advanced_blending extension. // Use the QT_VG prefix to avoid conflicts with any definitions @@ -132,7 +136,7 @@ public: QT_VG_BLEND_XOR_KHR = 0x2026 }; - QVGPaintEnginePrivate(); + QVGPaintEnginePrivate(QVGPaintEngine *q_ptr); ~QVGPaintEnginePrivate(); void init(); @@ -153,6 +157,7 @@ public: void setBrushTransform(const QBrush& brush, VGMatrixMode mode); void setupColorRamp(const QGradient *grad, VGPaint paint); void setImageOptions(); + void systemStateChanged(); #if !defined(QVG_SCISSOR_CLIP) void ensureMask(QVGPaintEngine *engine, int width, int height); void modifyMask @@ -281,6 +286,9 @@ public: // Clear all lazily-set modes. void clearModes(); + +private: + QVGPaintEngine *q; }; inline void QVGPaintEnginePrivate::setImageMode(VGImageMode mode) @@ -332,7 +340,7 @@ void QVGPaintEnginePrivate::clearModes() imageQuality = (VGImageQuality)0; } -QVGPaintEnginePrivate::QVGPaintEnginePrivate() +QVGPaintEnginePrivate::QVGPaintEnginePrivate(QVGPaintEngine *q_ptr) : q(q_ptr) { init(); } @@ -1431,7 +1439,7 @@ QVGPainterState::~QVGPainterState() } QVGPaintEngine::QVGPaintEngine() - : QPaintEngineEx(*new QVGPaintEnginePrivate) + : QPaintEngineEx(*new QVGPaintEnginePrivate(this)) { } @@ -2974,6 +2982,11 @@ void QVGPaintEnginePrivate::setImageOptions() } } +void QVGPaintEnginePrivate::systemStateChanged() +{ + q->updateScissor(); +} + static void drawVGImage(QVGPaintEnginePrivate *d, const QRectF& r, VGImage vgImg, const QSize& imageSize, const QRectF& sr) @@ -3432,9 +3445,10 @@ void QVGPaintEngine::drawStaticTextItem(QStaticTextItem *textItem) // Set the transformation to use for drawing the current glyphs. QTransform glyphTransform(d->pathTransform); if (d->transform.type() <= QTransform::TxTranslate) { - // Prevent blurriness of unscaled, unrotated text by using integer coordinates. - // Using ceil(x-0.5) instead of qRound() or int-cast, behave like other paint engines. - glyphTransform.translate(ceil(p.x() - 0.5), ceil(p.y() - 0.5)); + // Prevent blurriness of unscaled, unrotated text by forcing integer coordinates. + glyphTransform.translate( + floor(p.x() + glyphTransform.dx() + aliasedCoordinateDelta) - glyphTransform.dx(), + floor(p.y() - glyphTransform.dy() + aliasedCoordinateDelta) + glyphTransform.dy()); } else { glyphTransform.translate(p.x(), p.y()); } diff --git a/src/plugins/bearer/connman/qconnmanengine.cpp b/src/plugins/bearer/connman/qconnmanengine.cpp index 8775623..3b5ae86 100644 --- a/src/plugins/bearer/connman/qconnmanengine.cpp +++ b/src/plugins/bearer/connman/qconnmanengine.cpp @@ -125,9 +125,10 @@ QList<QNetworkConfigurationPrivate *> QConnmanEngine::getConfigurations() config->type = cpPriv->type; config->roamingSupported = cpPriv->roamingSupported; config->purpose = cpPriv->purpose; - config->bearer = cpPriv->bearer; + config->bearerType = cpPriv->bearerType; fetchedConfigurations.append(config); + delete config; } return fetchedConfigurations; // return foundConfigurations; @@ -149,7 +150,6 @@ void QConnmanEngine::getNetworkListing() } - void QConnmanEngine::doRequestUpdate() { connmanManager->requestScan(""); @@ -169,30 +169,6 @@ bool QConnmanEngine::hasIdentifier(const QString &id) return accessPointConfigurations.contains(id); } -QString QConnmanEngine::bearerName(const QString &id) -{ - QMutexLocker locker(&mutex); - QConnmanServiceInterface serv(serviceFromId(id)); - QString connectionType = serv.getType(); - - if (connectionType == "ethernet") - return QLatin1String("Ethernet"); - else if (connectionType == "wifi") - return QLatin1String("WLAN"); - else if (connectionType == "cellular") { - QString mode = serv.getMode(); - if(mode == "gprs" || mode == "edge") { - return QLatin1String("2G"); - } else if(mode == "umts") { - return QLatin1String("WCDMA"); - } - } - else if (connectionType == "wimax") - return QLatin1String("WIMAX"); - - return QString(); -} - void QConnmanEngine::connectToId(const QString &id) { QMutexLocker locker(&mutex); @@ -336,6 +312,9 @@ QString QConnmanEngine::getServiceForNetwork(const QString &netPath) QMutexLocker locker(&mutex); QConnmanNetworkInterface network(netPath, this); foreach(QString service,connmanManager->getServices()) { + + QString devicePath = netPath.section("/",5,5); + QConnmanServiceInterface serv(service,this); if(serv.getName() == network.getName() && network.getSignalStrength() == serv.getSignalStrength()) { @@ -378,17 +357,6 @@ void QConnmanEngine::propertyChangedContext(const QString &path,const QString &i technologies.insert(listPath, tech); } } - - foreach(const QString old, oldtech.keys()) { - if(!newlist.contains(old)) { - QConnmanTechnologyInterface *tech = oldtech.value(old); - disconnect(tech,SIGNAL(propertyChangedContext(QString,QString,QDBusVariant)), - this,SLOT(technologyPropertyChangedContext(QString,QString,QDBusVariant))); - - technologies.remove(old); - getNetworkListing(); - } - } } } if(item == "State") { @@ -409,15 +377,21 @@ void QConnmanEngine::servicePropertyChangedContext(const QString &path,const QSt } } -void QConnmanEngine::networkPropertyChangedContext(const QString &/*path*/,const QString &/*item*/, const QDBusVariant &/*value*/) +void QConnmanEngine::networkPropertyChangedContext(const QString &path,const QString &item, const QDBusVariant &value) { QMutexLocker locker(&mutex); +// qDebug() << __FUNCTION__ << path << item << value.variant(); } void QConnmanEngine::devicePropertyChangedContext(const QString &devpath,const QString &item,const QDBusVariant &value) { +// qDebug() << __FUNCTION__ << devpath << item << value.variant(); QMutexLocker locker(&mutex); if(item == "Networks") { + + QConnmanNetworkInterface network(devpath, this); + + QDBusArgument arg = qvariant_cast<QDBusArgument>(value.variant()); QStringList remainingNetworks = qdbus_cast<QStringList>(arg); QString devicetype; @@ -455,6 +429,7 @@ void QConnmanEngine::devicePropertyChangedContext(const QString &devpath,const Q void QConnmanEngine::technologyPropertyChangedContext(const QString & path, const QString &item, const QDBusVariant &value) { +// qDebug() << __FUNCTION__ << path << item << value.variant(); if(item == "Devices") { QDBusArgument arg = qvariant_cast<QDBusArgument>(value.variant()); QStringList list = qdbus_cast<QStringList>(arg); @@ -476,6 +451,12 @@ void QConnmanEngine::technologyPropertyChangedContext(const QString & path, cons } if(value.variant().toString() == "offline") { deviceMap.remove(path); + QConnmanTechnologyInterface tech(path); + disconnect(&tech,SIGNAL(propertyChangedContext(QString,QString,QDBusVariant)), + this,SLOT(technologyPropertyChangedContext(QString,QString,QDBusVariant))); + + technologies.remove(path); + getNetworkListing(); } } } @@ -538,25 +519,25 @@ QNetworkConfiguration::StateFlags QConnmanEngine::getStateForService(const QStri return flag; } -QString QConnmanEngine::typeToBearer(const QString &type) +QNetworkConfiguration::BearerType QConnmanEngine::typeToBearer(const QString &type) { - QMutexLocker locker(&mutex); - if(type == "wifi") - return "WLAN"; - if(type == "ethernet") - return "Ethernet"; - if(type == "bluetooth") - return "Bluetooth"; - if(type == "cellular") { - return "Cellular"; + if (type == "wifi") + return QNetworkConfiguration::BearerWLAN; + if (type == "ethernet") + return QNetworkConfiguration::BearerEthernet; + if (type == "bluetooth") + return QNetworkConfiguration::BearerBluetooth; + if (type == "cellular") { + return QNetworkConfiguration::Bearer2G; // not handled: CDMA2000 HSPA } - if(type == "wimax") - return "WiMax"; + if (type == "wimax") + return QNetworkConfiguration::BearerWiMAX; + // if(type == "gps") // if(type == "vpn") - return "Unknown"; + return QNetworkConfiguration::BearerUnknown; } void QConnmanEngine::removeConfiguration(const QString &id) @@ -612,15 +593,35 @@ void QConnmanEngine::addServiceConfiguration(const QString &servicePath) QString networkName = serv->getName(); - if(serv->getType() == "Cellular") { + if(serv->getType() == "cellular") { networkName = serv->getAPN(); + if(networkName.isEmpty()) { + networkName = serv->getName(); + } } cpPriv->name = networkName; cpPriv->isValid = true; cpPriv->id = id; cpPriv->type = QNetworkConfiguration::InternetAccessPoint; - cpPriv->bearer = bearerName(id); + + + const QString connectionType = serv->getType(); + if (connectionType == "ethernet") { + cpPriv->bearerType = QNetworkConfiguration::BearerEthernet; + } else if (connectionType == "wifi") { + cpPriv->bearerType = QNetworkConfiguration::BearerWLAN; + } else if (connectionType == "cellular") { + const QString mode = serv->getMode(); + if (mode == "gprs" || mode == "edge") + cpPriv->bearerType = QNetworkConfiguration::Bearer2G; + else if (mode == "umts") + cpPriv->bearerType = QNetworkConfiguration::BearerWCDMA; + } else if (connectionType == "wimax") { + cpPriv->bearerType = QNetworkConfiguration::BearerWiMAX; + } else { + cpPriv->bearerType = QNetworkConfiguration::BearerUnknown; + } if(serv->getSecurity() == "none") { cpPriv->purpose = QNetworkConfiguration::PublicPurpose; @@ -650,6 +651,9 @@ void QConnmanEngine::addNetworkConfiguration(const QString &networkPath) { QMutexLocker locker(&mutex); + if(networkPath.isNull()) + return; + QConnmanNetworkInterface *network; network = new QConnmanNetworkInterface(networkPath, this); QString servicePath = getServiceForNetwork(networkPath); @@ -665,9 +669,10 @@ void QConnmanEngine::addNetworkConfiguration(const QString &networkPath) serv = new QConnmanServiceInterface(servicePath,this); connect(serv,SIGNAL(propertyChangedContext(QString,QString,QDBusVariant)), this,SLOT(servicePropertyChangedContext(QString,QString, QDBusVariant))); + } - if (!accessPointConfigurations.contains(id)) { + if (!id.isEmpty() && !accessPointConfigurations.contains(id)) { knownNetworks[device.getType()].append(networkPath); @@ -683,31 +688,38 @@ void QConnmanEngine::addNetworkConfiguration(const QString &networkPath) if(networkName.isEmpty()) networkName = "Hidden Network"; - QString bearerName; + + QNetworkConfiguration::BearerType bearerType; if(servicePath.isEmpty()) { QString devicePath = networkPath.section("/",0,5); + QConnmanDeviceInterface device(devicePath,this); - bearerName = typeToBearer(device.getType()); + bearerType = typeToBearer(device.getType()); } else { - bearerName = typeToBearer(serv->getType()); + bearerType = typeToBearer(serv->getType()); } - if(bearerName == "Cellular") { + if (bearerType == QNetworkConfiguration::Bearer2G) { QString mode = serv->getMode(); - if(mode == "gprs" || mode == "edge") { - bearerName = "2G"; - } else if(mode == "umts") { - bearerName = "WCDMA"; + if (mode == "gprs" || mode == "edge") { + bearerType = QNetworkConfiguration::Bearer2G; + } else if (mode == "umts") { + bearerType = QNetworkConfiguration::BearerWCDMA; + } + if(servicePath.isEmpty()) { + networkName = serv->getAPN(); + if(networkName.isEmpty()) { + networkName = serv->getName(); + } } - networkName = serv->getAPN(); } cpPriv->name = networkName; cpPriv->isValid = true; cpPriv->id = id; cpPriv->type = QNetworkConfiguration::InternetAccessPoint; - cpPriv->bearer = bearerName; + cpPriv->bearerType = bearerType; if(network->getWifiSecurity() == "none") { cpPriv->purpose = QNetworkConfiguration::PublicPurpose; @@ -729,7 +741,9 @@ void QConnmanEngine::addNetworkConfiguration(const QString &networkPath) emit configurationAdded(ptr); locker.relock(); emit updateCompleted(); - } + } /*else { + qDebug() << "Not added~~~~~~~~~~~"; + }*/ } bool QConnmanEngine::requiresPolling() const diff --git a/src/plugins/bearer/connman/qconnmanengine.h b/src/plugins/bearer/connman/qconnmanengine.h index 0f6dc1c..2ee6da5 100644 --- a/src/plugins/bearer/connman/qconnmanengine.h +++ b/src/plugins/bearer/connman/qconnmanengine.h @@ -80,8 +80,6 @@ public: virtual QString getInterfaceFromId(const QString &id); bool hasIdentifier(const QString &id); - virtual QString bearerName(const QString &id); - virtual void connectToId(const QString &id); virtual void disconnectFromId(const QString &id); @@ -125,7 +123,7 @@ private: QString networkFromId(const QString &id); QNetworkConfiguration::StateFlags getStateForService(const QString &service); - QString typeToBearer(const QString &type); + QNetworkConfiguration::BearerType typeToBearer(const QString &type); void removeConfiguration(const QString &servicePath); void addServiceConfiguration(const QString &servicePath); diff --git a/src/plugins/bearer/connman/qconnmanservice_linux.cpp b/src/plugins/bearer/connman/qconnmanservice_linux.cpp index da421bc..0ffada9 100644 --- a/src/plugins/bearer/connman/qconnmanservice_linux.cpp +++ b/src/plugins/bearer/connman/qconnmanservice_linux.cpp @@ -53,6 +53,8 @@ #include "qconnmanservice_linux_p.h" +#ifndef QT_NO_BEARERMANAGEMENT +#ifndef QT_NO_DBUS QT_BEGIN_NAMESPACE static QDBusConnection dbusConnection = QDBusConnection::systemBus(); @@ -129,8 +131,10 @@ QVariant QConnmanManagerInterface::getProperty(const QString &property) QVariantMap QConnmanManagerInterface::getProperties() { - QDBusReply<QVariantMap > reply = this->call(QLatin1String("GetProperties")); - return reply.value(); + if(this->isValid()) { + QDBusReply<QVariantMap > reply = this->call(QLatin1String("GetProperties")); + return reply.value(); + } else return QVariantMap(); } QString QConnmanManagerInterface::getState() @@ -551,8 +555,12 @@ void QConnmanServiceInterface::disconnectNotify(const char *signal) QVariantMap QConnmanServiceInterface::getProperties() { - QDBusReply<QVariantMap> reply = this->call(QLatin1String("GetProperties")); - return reply.value(); + if(this->isValid()) { + QDBusReply<QVariantMap> reply = this->call(QLatin1String("GetProperties")); + return reply.value(); + } + else + return QVariantMap(); } QVariant QConnmanServiceInterface::getProperty(const QString &property) @@ -725,6 +733,99 @@ QVariantMap QConnmanServiceInterface::getEthernet() return qdbus_cast<QVariantMap >(var); } +QString QConnmanServiceInterface::getMethod() +{ + QVariant var; + QVariantMap map = getEthernet(); + QMapIterator<QString,QVariant> it(map); + while(it.hasNext()) { + it.next(); + if(it.key() == "Method") { + return it.value().toString(); + } + } + return QString(); +} + +QString QConnmanServiceInterface::getInterface() +{ + QVariant var; + QVariantMap map = getEthernet(); + + QMapIterator<QString,QVariant> it(map); + while(it.hasNext()) { + it.next(); + if(it.key() == "Interface") { + return it.value().toString(); + } + } + + return QString(); +} + +QString QConnmanServiceInterface::getMacAddress() +{ + QVariant var; + QVariantMap map = getEthernet(); + + QMapIterator<QString,QVariant> it(map); + while(it.hasNext()) { + it.next(); + if(it.key() == "Address") { + return it.value().toString(); + } + } + return QString(); +} + +quint16 QConnmanServiceInterface::getMtu() +{ + quint16 mtu=0; + QVariant var; + QVariantMap map = getEthernet(); + + QMapIterator<QString,QVariant> it(map); + while(it.hasNext()) { + it.next(); + if(it.key() == "MTU") { + return it.value().toUInt(); + } + } + return mtu; +} + +quint16 QConnmanServiceInterface::getSpeed() +{ + quint16 speed=0; + QVariant var; + QVariantMap map = getEthernet(); + + QMapIterator<QString,QVariant> it(map); + while(it.hasNext()) { + it.next(); + if(it.key() == "Speed") { + return it.value().toUInt(); + } + } + return speed; +} + +QString QConnmanServiceInterface::getDuplex() +{ + QVariant var; + QVariantMap map = getEthernet(); + + QMapIterator<QString,QVariant> it(map); + while(it.hasNext()) { + it.next(); + if(it.key() == "Duplex") { + return it.value().toString(); + } + } + return QString(); +} + + bool QConnmanServiceInterface::isOfflineMode() { QVariant var = getProperty("OfflineMode"); @@ -1070,3 +1171,7 @@ void QConnmanDBusHelper::propertyChanged(const QString &item, const QDBusVariant ///////////////// QT_END_NAMESPACE + +#endif // QT_NO_DBUS +#endif // QT_NO_BEARERMANAGEMENT + diff --git a/src/plugins/bearer/connman/qconnmanservice_linux_p.h b/src/plugins/bearer/connman/qconnmanservice_linux_p.h index 35e3f3d..a2b1e73 100644 --- a/src/plugins/bearer/connman/qconnmanservice_linux_p.h +++ b/src/plugins/bearer/connman/qconnmanservice_linux_p.h @@ -65,6 +65,9 @@ #include <QtDBus/QDBusContext> #include <QMap> +#ifndef QT_NO_BEARERMANAGEMENT +#ifndef QT_NO_DBUS + #ifndef __CONNMAN_DBUS_H #define CONNMAN_SERVICE "org.moblin.connman" @@ -249,6 +252,13 @@ public: QVariantMap getProxy(); QVariantMap getEthernet(); + QString getMethod(); + QString getInterface(); + QString getMacAddress(); + quint16 getMtu(); + quint16 getSpeed(); + QString getDuplex(); + bool isOfflineMode(); QStringList getServices(); @@ -378,4 +388,7 @@ Q_SIGNALS: QT_END_NAMESPACE +#endif // QT_NO_DBUS +#endif // QT_NO_BEARERMANAGEMENT + #endif //QCONNMANSERVICE_H diff --git a/src/plugins/bearer/corewlan/qcorewlanengine.h b/src/plugins/bearer/corewlan/qcorewlanengine.h index 4d90648..56da66a 100644 --- a/src/plugins/bearer/corewlan/qcorewlanengine.h +++ b/src/plugins/bearer/corewlan/qcorewlanengine.h @@ -68,8 +68,6 @@ public: QString getInterfaceFromId(const QString &id); bool hasIdentifier(const QString &id); - QString bearerName(const QString &id); - void connectToId(const QString &id); void disconnectFromId(const QString &id); diff --git a/src/plugins/bearer/corewlan/qcorewlanengine.mm b/src/plugins/bearer/corewlan/qcorewlanengine.mm index 6ba9504..131f36d 100644 --- a/src/plugins/bearer/corewlan/qcorewlanengine.mm +++ b/src/plugins/bearer/corewlan/qcorewlanengine.mm @@ -264,7 +264,7 @@ QStringList QScanThread::foundNetwork(const QString &id, const QString &name, co ptr->id = id; ptr->state = state; ptr->type = QNetworkConfiguration::InternetAccessPoint; - ptr->bearer = QLatin1String("WLAN"); + ptr->bearerType = QNetworkConfiguration::BearerWLAN; ptr->purpose = purpose; fetchedConfigurations.append( ptr); @@ -789,8 +789,8 @@ void QCoreWlanEngine::networksChanged() changed = true; } - if (ptr->bearer != cpPriv->bearer) { - ptr->bearer = cpPriv->bearer; + if (ptr->bearerType != cpPriv->bearerType) { + ptr->bearerType = cpPriv->bearerType; changed = true; } diff --git a/src/plugins/bearer/generic/qgenericengine.cpp b/src/plugins/bearer/generic/qgenericengine.cpp index 652fe4a..fad3ae8 100644 --- a/src/plugins/bearer/generic/qgenericengine.cpp +++ b/src/plugins/bearer/generic/qgenericengine.cpp @@ -69,7 +69,7 @@ QT_BEGIN_NAMESPACE #ifndef QT_NO_NETWORKINTERFACE -static QString qGetInterfaceType(const QString &interface) +static QNetworkConfiguration::BearerType qGetInterfaceType(const QString &interface) { #ifdef Q_OS_WIN32 unsigned long oid; @@ -78,10 +78,10 @@ static QString qGetInterfaceType(const QString &interface) NDIS_MEDIUM medium; NDIS_PHYSICAL_MEDIUM physicalMedium; - HANDLE handle = CreateFile((TCHAR *)QString("\\\\.\\%1").arg(interface).utf16(), 0, + HANDLE handle = CreateFile((TCHAR *)QString::fromLatin1("\\\\.\\%1").arg(interface).utf16(), 0, FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0); if (handle == INVALID_HANDLE_VALUE) - return QLatin1String("Unknown"); + return QNetworkConfiguration::BearerUnknown; oid = OID_GEN_MEDIA_SUPPORTED; bytesWritten = 0; @@ -89,7 +89,7 @@ static QString qGetInterfaceType(const QString &interface) &medium, sizeof(medium), &bytesWritten, 0); if (!result) { CloseHandle(handle); - return QLatin1String("Unknown"); + return QNetworkConfiguration::BearerUnknown; } oid = OID_GEN_PHYSICAL_MEDIUM; @@ -100,9 +100,9 @@ static QString qGetInterfaceType(const QString &interface) CloseHandle(handle); if (medium == NdisMedium802_3) - return QLatin1String("Ethernet"); + return QNetworkConfiguration::BearerEthernet; else - return QLatin1String("Unknown"); + return QNetworkConfiguration::BearerUnknown; } CloseHandle(handle); @@ -110,16 +110,16 @@ static QString qGetInterfaceType(const QString &interface) if (medium == NdisMedium802_3) { switch (physicalMedium) { case NdisPhysicalMediumWirelessLan: - return QLatin1String("WLAN"); + return QNetworkConfiguration::BearerWLAN; case NdisPhysicalMediumBluetooth: - return QLatin1String("Bluetooth"); + return QNetworkConfiguration::BearerBluetooth; case NdisPhysicalMediumWiMax: - return QLatin1String("WiMAX"); + return QNetworkConfiguration::BearerWiMAX; default: #ifdef BEARER_MANAGEMENT_DEBUG qDebug() << "Physical Medium" << physicalMedium; #endif - return QLatin1String("Ethernet"); + return QNetworkConfiguration::BearerEthernet; } } @@ -135,12 +135,12 @@ static QString qGetInterfaceType(const QString &interface) close(sock); if (result >= 0 && request.ifr_hwaddr.sa_family == ARPHRD_ETHER) - return QLatin1String("Ethernet"); + return QNetworkConfiguration::BearerEthernet; #else Q_UNUSED(interface); #endif - return QLatin1String("Unknown"); + return QNetworkConfiguration::BearerUnknown; } #endif @@ -214,7 +214,7 @@ void QGenericEngine::doRequestUpdate() continue; // ignore WLAN interface handled in separate engine - if (qGetInterfaceType(interface.name()) == QLatin1String("WLAN")) + if (qGetInterfaceType(interface.name()) == QNetworkConfiguration::BearerWLAN) continue; uint identifier; @@ -277,7 +277,7 @@ void QGenericEngine::doRequestUpdate() ptr->id = id; ptr->state = state; ptr->type = QNetworkConfiguration::InternetAccessPoint; - ptr->bearer = qGetInterfaceType(interface.name()); + ptr->bearerType = qGetInterfaceType(interface.name()); accessPointConfigurations.insert(id, ptr); configurationInterface.insert(id, interface.name()); diff --git a/src/plugins/bearer/generic/qgenericengine.h b/src/plugins/bearer/generic/qgenericengine.h index cdbbc9d..021b35b 100644 --- a/src/plugins/bearer/generic/qgenericengine.h +++ b/src/plugins/bearer/generic/qgenericengine.h @@ -65,8 +65,6 @@ public: QString getInterfaceFromId(const QString &id); bool hasIdentifier(const QString &id); - QString bearerName(const QString &id); - void connectToId(const QString &id); void disconnectFromId(const QString &id); diff --git a/src/plugins/bearer/icd/icd.pro b/src/plugins/bearer/icd/icd.pro index c7337f5..b2c58e9 100644 --- a/src/plugins/bearer/icd/icd.pro +++ b/src/plugins/bearer/icd/icd.pro @@ -3,8 +3,8 @@ include(../../qpluginbase.pri) QT += network dbus -QMAKE_CXXFLAGS += $$QT_CFLAGS_ICD -LIBS += $$QT_LIBS_ICD +QMAKE_CXXFLAGS *= $$QT_CFLAGS_DBUS $$QT_CFLAGS_CONNSETTINGS +LIBS += $$QT_LIBS_CONNSETTINGS HEADERS += qicdengine.h \ qnetworksession_impl.h @@ -15,6 +15,9 @@ SOURCES += main.cpp \ #DEFINES += BEARER_MANAGEMENT_DEBUG +include(../../../3rdparty/libconninet.pri) +include(../../../3rdparty/libgq.pri) + QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/bearer target.path += $$[QT_INSTALL_PLUGINS]/bearer INSTALLS += target diff --git a/src/plugins/bearer/icd/qicdengine.cpp b/src/plugins/bearer/icd/qicdengine.cpp index 0083380..0900329 100644 --- a/src/plugins/bearer/icd/qicdengine.cpp +++ b/src/plugins/bearer/icd/qicdengine.cpp @@ -60,16 +60,11 @@ IcdNetworkConfigurationPrivate::~IcdNetworkConfigurationPrivate() { } -QString IcdNetworkConfigurationPrivate::bearerName() const +QString IcdNetworkConfigurationPrivate::bearerTypeName() const { - if (iap_type == QLatin1String("WLAN_INFRA") || - iap_type == QLatin1String("WLAN_ADHOC")) { - return QLatin1String("WLAN"); - } else if (iap_type == QLatin1String("GPRS")) { - return QLatin1String("HSPA"); - } else { - return iap_type; - } + QMutexLocker locker(&mutex); + + return iap_type; } /* The IapAddTimer is a helper class that makes sure we update @@ -222,7 +217,7 @@ void IapMonitor::iapRemoved(const QString &iap_id) } QIcdEngine::QIcdEngine(QObject *parent) -: QBearerEngine(parent), iapMonitor(new IapMonitor), m_dbusInterface(0), +: QBearerEngine(parent), iapMonitor(0), m_dbusInterface(0), firstUpdate(true), m_scanGoingOn(false) { } @@ -263,6 +258,7 @@ void QIcdEngine::initialize() startListeningStateSignalsForAllConnections(); /* Turn on IAP add/remove monitoring */ + iapMonitor = new IapMonitor; iapMonitor->setup(this); /* We create a default configuration which is a pseudo config */ @@ -400,6 +396,7 @@ void QIcdEngine::addConfiguration(QString& iap_id) ptr->mutex.lock(); ptr->id = iap_id; toIcdConfig(ptr)->iap_type = iap_type; + ptr->bearerType = bearerTypeFromIapType(iap_type); toIcdConfig(ptr)->network_attrs = getNetworkAttrs(true, iap_id, iap_type, QString()); toIcdConfig(ptr)->network_id = ssid; toIcdConfig(ptr)->service_id = saved_iap.value("service_id").toString(); @@ -424,6 +421,7 @@ void QIcdEngine::addConfiguration(QString& iap_id) cpPriv->isValid = true; cpPriv->id = iap_id; cpPriv->iap_type = iap_type; + cpPriv->bearerType = bearerTypeFromIapType(iap_type); cpPriv->network_attrs = getNetworkAttrs(true, iap_id, iap_type, QString()); cpPriv->service_id = saved_iap.value("service_id").toString(); cpPriv->service_type = saved_iap.value("service_type").toString(); @@ -480,6 +478,7 @@ void QIcdEngine::addConfiguration(QString& iap_id) ptr->isValid = true; if (toIcdConfig(ptr)->iap_type != iap_type) { toIcdConfig(ptr)->iap_type = iap_type; + ptr->bearerType = bearerTypeFromIapType(iap_type); update_needed = true; } if (iap_type.startsWith(QLatin1String("WLAN"))) { @@ -522,8 +521,6 @@ void QIcdEngine::addConfiguration(QString& iap_id) void QIcdEngine::doRequestUpdate(QList<Maemo::IcdScanResult> scanned) { - QMutexLocker locker(&mutex); - /* Contains all known iap_ids from storage */ QList<QString> knownConfigs = accessPointConfigurations.keys(); @@ -580,6 +577,7 @@ void QIcdEngine::doRequestUpdate(QList<Maemo::IcdScanResult> scanned) cpPriv->network_id = ssid; cpPriv->network_attrs = getNetworkAttrs(true, iap_id, iap_type, QString()); cpPriv->iap_type = iap_type; + cpPriv->bearerType = bearerTypeFromIapType(iap_type); cpPriv->service_id = saved_ap.value("service_id").toString(); cpPriv->service_type = saved_ap.value("service_type").toString(); cpPriv->type = QNetworkConfiguration::InternetAccessPoint; @@ -588,9 +586,9 @@ void QIcdEngine::doRequestUpdate(QList<Maemo::IcdScanResult> scanned) QNetworkConfigurationPrivatePointer ptr(cpPriv); accessPointConfigurations.insert(iap_id, ptr); - locker.unlock(); + mutex.unlock(); emit configurationAdded(ptr); - locker.relock(); + mutex.lock(); #ifdef BEARER_MANAGEMENT_DEBUG qDebug("IAP: %s, name: %s, ssid: %s, added to known list", @@ -643,9 +641,9 @@ void QIcdEngine::doRequestUpdate(QList<Maemo::IcdScanResult> scanned) ptr->mutex.unlock(); if (changed) { - locker.unlock(); + mutex.unlock(); emit configurationChanged(ptr); - locker.relock(); + mutex.lock(); } if (!ap.scan.network_type.startsWith(QLatin1String("WLAN"))) @@ -688,6 +686,7 @@ rescan_list: cpPriv->id = scanned_ssid.data(); // Note: id is now ssid, it should be set to IAP id if the IAP is saved cpPriv->network_id = scanned_ssid; cpPriv->iap_type = ap.scan.network_type; + cpPriv->bearerType = bearerTypeFromIapType(cpPriv->iap_type); cpPriv->network_attrs = ap.scan.network_attrs; cpPriv->service_id = ap.scan.service_id; cpPriv->service_type = ap.scan.service_type; @@ -703,9 +702,9 @@ rescan_list: QNetworkConfigurationPrivatePointer ptr(cpPriv); accessPointConfigurations.insert(ptr->id, ptr); - locker.unlock(); + mutex.unlock(); emit configurationAdded(ptr); - locker.relock(); + mutex.lock(); } else { knownConfigs.removeOne(scanned_ssid); } @@ -733,9 +732,9 @@ rescan_list: ptr->state = QNetworkConfiguration::Defined; configLocker.unlock(); - locker.unlock(); + mutex.unlock(); emit configurationChanged(ptr); - locker.relock(); + mutex.lock(); } } } @@ -744,9 +743,9 @@ rescan_list: foreach (const QString &oldIface, knownConfigs) { QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.take(oldIface); if (ptr) { - locker.unlock(); + mutex.unlock(); emit configurationRemoved(ptr); - locker.relock(); + mutex.lock(); //if we would have SNAP support we would have to remove the references //from existing ServiceNetworks to the removed access point configuration } @@ -762,9 +761,9 @@ rescan_list: } if (!firstUpdate) { - locker.unlock(); + mutex.unlock(); emit updateCompleted(); - locker.relock(); + mutex.lock(); } if (firstUpdate) @@ -781,8 +780,6 @@ QNetworkConfigurationPrivatePointer QIcdEngine::defaultConfiguration() void QIcdEngine::startListeningStateSignalsForAllConnections() { - QMutexLocker locker(&mutex); - // Start listening ICD_DBUS_API_STATE_SIG signals m_dbusInterface->connection().connect(ICD_DBUS_API_INTERFACE, ICD_DBUS_API_PATH, @@ -906,8 +903,6 @@ void QIcdEngine::requestUpdate() void QIcdEngine::cancelAsyncConfigurationUpdate() { - QMutexLocker locker(&mutex); - if (!m_scanGoingOn) { return; } @@ -947,7 +942,9 @@ void QIcdEngine::asyncUpdateConfigurationsSlot(QDBusMessage msg) if (icd_scan_status == ICD_SCAN_COMPLETE) { m_typesToBeScanned.removeOne(arguments[6].toString()); if (!m_typesToBeScanned.count()) { + locker.unlock(); finishAsyncConfigurationUpdate(); + locker.relock(); } } else { Maemo::IcdScanResult scanResult; @@ -977,7 +974,8 @@ void QIcdEngine::cleanup() m_scanTimer.stop(); m_dbusInterface->call(ICD_DBUS_API_SCAN_CANCEL); } - iapMonitor->cleanup(); + if (iapMonitor) + iapMonitor->cleanup(); } bool QIcdEngine::hasIdentifier(const QString &id) diff --git a/src/plugins/bearer/icd/qicdengine.h b/src/plugins/bearer/icd/qicdengine.h index 1b291eb..a768d84 100644 --- a/src/plugins/bearer/icd/qicdengine.h +++ b/src/plugins/bearer/icd/qicdengine.h @@ -54,13 +54,25 @@ class QNetworkConfigurationPrivate; class IapMonitor; class QDBusInterface; +inline QNetworkConfiguration::BearerType bearerTypeFromIapType(const QString &iapType) +{ + if (iapType == QLatin1String("WLAN_INFRA") || + iapType == QLatin1String("WLAN_ADHOC")) { + return QNetworkConfiguration::BearerWLAN; + } else if (iapType == QLatin1String("GPRS")) { + return QNetworkConfiguration::BearerHSPA; + } else { + return QNetworkConfiguration::BearerUnknown; + } +} + class IcdNetworkConfigurationPrivate : public QNetworkConfigurationPrivate { public: IcdNetworkConfigurationPrivate(); ~IcdNetworkConfigurationPrivate(); - QString bearerName() const; + virtual QString bearerTypeName() const; // In Maemo the id field (defined in QNetworkConfigurationPrivate) // is the IAP id (which typically is UUID) @@ -114,13 +126,13 @@ public: QMutexLocker locker(&mutex); accessPointConfigurations.insert(ptr->id, ptr); + + locker.unlock(); emit configurationAdded(ptr); } inline void changedSessionConfiguration(QNetworkConfigurationPrivatePointer ptr) { - QMutexLocker locker(&mutex); - emit configurationChanged(ptr); } @@ -132,14 +144,14 @@ Q_SIGNALS: void iapStateChanged(const QString& iapid, uint icd_connection_state); private Q_SLOTS: - void doRequestUpdate(QList<Maemo::IcdScanResult> scanned = QList<Maemo::IcdScanResult>()); - void cancelAsyncConfigurationUpdate(); void finishAsyncConfigurationUpdate(); void asyncUpdateConfigurationsSlot(QDBusMessage msg); void connectionStateSignalsSlot(QDBusMessage msg); private: void startListeningStateSignalsForAllConnections(); + void doRequestUpdate(QList<Maemo::IcdScanResult> scanned = QList<Maemo::IcdScanResult>()); + void cancelAsyncConfigurationUpdate(); private: IapMonitor *iapMonitor; diff --git a/src/plugins/bearer/icd/qnetworksession_impl.cpp b/src/plugins/bearer/icd/qnetworksession_impl.cpp index e8e5183..2583b28 100644 --- a/src/plugins/bearer/icd/qnetworksession_impl.cpp +++ b/src/plugins/bearer/icd/qnetworksession_impl.cpp @@ -318,6 +318,7 @@ QNetworkConfiguration& QNetworkSessionPrivateImpl::copyConfig(QNetworkConfigurat cpPriv->purpose = fromPriv->purpose; cpPriv->network_id = fromPriv->network_id; cpPriv->iap_type = fromPriv->iap_type; + cpPriv->bearerType = fromPriv->bearerType; cpPriv->network_attrs = fromPriv->network_attrs; cpPriv->service_type = fromPriv->service_type; cpPriv->service_id = fromPriv->service_id; @@ -443,6 +444,7 @@ void QNetworkSessionPrivateImpl::syncStateWithInterface() ptr->id = toIcdConfig(ptr)->network_id; toIcdConfig(ptr)->network_attrs = state_results.first().params.network_attrs; toIcdConfig(ptr)->iap_type = state_results.first().params.network_type; + ptr->bearerType = bearerTypeFromIapType(toIcdConfig(ptr)->iap_type); toIcdConfig(ptr)->service_type = state_results.first().params.service_type; toIcdConfig(ptr)->service_id = state_results.first().params.service_id; toIcdConfig(ptr)->service_attrs = state_results.first().params.service_attrs; @@ -819,6 +821,7 @@ void QNetworkSessionPrivateImpl::stateChange(const QDBusMessage& rep) icdConfig->name = name; icdConfig->iap_type = rep.arguments().at(3).toString(); // connect_result.connect.network_type; + icdConfig->bearerType = bearerTypeFromIapType(icdConfig->iap_type); icdConfig->isValid = true; icdConfig->state = QNetworkConfiguration::Active; icdConfig->type = QNetworkConfiguration::InternetAccessPoint; diff --git a/src/plugins/bearer/nativewifi/qnativewifiengine.cpp b/src/plugins/bearer/nativewifi/qnativewifiengine.cpp index 1a55402..ba8297e 100644 --- a/src/plugins/bearer/nativewifi/qnativewifiengine.cpp +++ b/src/plugins/bearer/nativewifi/qnativewifiengine.cpp @@ -206,7 +206,7 @@ void QNativeWifiEngine::scanComplete() ptr->id = id; ptr->state = state; ptr->type = QNetworkConfiguration::InternetAccessPoint; - ptr->bearer = QLatin1String("WLAN"); + ptr->bearerType = QNetworkConfiguration::BearerWLAN; accessPointConfigurations.insert(id, ptr); @@ -350,11 +350,6 @@ bool QNativeWifiEngine::hasIdentifier(const QString &id) return false; } -/*QString QNativeWifiEngine::bearerName(const QString &) -{ - return QLatin1String("WLAN"); -}*/ - void QNativeWifiEngine::connectToId(const QString &id) { QMutexLocker locker(&mutex); diff --git a/src/plugins/bearer/nativewifi/qnativewifiengine.h b/src/plugins/bearer/nativewifi/qnativewifiengine.h index 0e9576b..dccf2e2 100644 --- a/src/plugins/bearer/nativewifi/qnativewifiengine.h +++ b/src/plugins/bearer/nativewifi/qnativewifiengine.h @@ -75,8 +75,6 @@ public: QString getInterfaceFromId(const QString &id); bool hasIdentifier(const QString &id); - //QString bearerName(const QString &id); - void connectToId(const QString &id); void disconnectFromId(const QString &id); diff --git a/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp b/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp index 3ebc356..29445ce 100644 --- a/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp +++ b/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp @@ -104,14 +104,23 @@ void QNetworkManagerEngine::initialize() QMutexLocker locker(&mutex); // Get current list of access points. - foreach (const QDBusObjectPath &devicePath, interface->getDevices()) + foreach (const QDBusObjectPath &devicePath, interface->getDevices()) { + locker.unlock(); deviceAdded(devicePath); + locker.relock(); + } // Get connections. - foreach (const QDBusObjectPath &settingsPath, systemSettings->listConnections()) + foreach (const QDBusObjectPath &settingsPath, systemSettings->listConnections()) { + locker.unlock(); newConnection(settingsPath, systemSettings); - foreach (const QDBusObjectPath &settingsPath, userSettings->listConnections()) + locker.relock(); + } + foreach (const QDBusObjectPath &settingsPath, userSettings->listConnections()) { + locker.unlock(); newConnection(settingsPath, userSettings); + locker.relock(); + } // Get active connections. foreach (const QDBusObjectPath &acPath, interface->activeConnections()) { @@ -132,11 +141,6 @@ bool QNetworkManagerEngine::networkManagerAvailable() const return interface->isValid(); } -void QNetworkManagerEngine::doRequestUpdate() -{ - emit updateCompleted(); -} - QString QNetworkManagerEngine::getInterfaceFromId(const QString &id) { QMutexLocker locker(&mutex); @@ -181,30 +185,6 @@ bool QNetworkManagerEngine::hasIdentifier(const QString &id) return false; } -QString QNetworkManagerEngine::bearerName(const QString &id) -{ - QMutexLocker locker(&mutex); - - QNetworkManagerSettingsConnection *connection = connectionFromId(id); - - if (!connection) - return QString(); - - QNmSettingsMap map = connection->getSettings(); - const QString connectionType = map.value("connection").value("type").toString(); - - if (connectionType == "802-3-ethernet") - return QLatin1String("Ethernet"); - else if (connectionType == "802-11-wireless") - return QLatin1String("WLAN"); - else if (connectionType == "gsm") - return QLatin1String("2G"); - else if (connectionType == "cdma") - return QLatin1String("CDMA2000"); - else - return QString(); -} - void QNetworkManagerEngine::connectToId(const QString &id) { QMutexLocker locker(&mutex); @@ -257,9 +237,7 @@ void QNetworkManagerEngine::disconnectFromId(const QString &id) void QNetworkManagerEngine::requestUpdate() { - QMutexLocker locker(&mutex); - - QTimer::singleShot(0, this, SLOT(doRequestUpdate())); + QMetaObject::invokeMethod(this, "updateCompleted", Qt::QueuedConnection); } void QNetworkManagerEngine::interfacePropertiesChanged(const QString &path, @@ -385,13 +363,10 @@ void QNetworkManagerEngine::devicePropertiesChanged(const QString &path, void QNetworkManagerEngine::deviceAdded(const QDBusObjectPath &path) { - QMutexLocker locker(&mutex); - QNetworkManagerInterfaceDevice device(path.path()); if (device.deviceType() == DEVICE_TYPE_802_11_WIRELESS) { QNetworkManagerInterfaceDeviceWireless *wirelessDevice = new QNetworkManagerInterfaceDeviceWireless(device.connectionInterface()->path()); - wirelessDevices.insert(path.path(), wirelessDevice); wirelessDevice->setConnections(); connect(wirelessDevice, SIGNAL(accessPointAdded(QString,QDBusObjectPath)), @@ -403,6 +378,10 @@ void QNetworkManagerEngine::deviceAdded(const QDBusObjectPath &path) foreach (const QDBusObjectPath &apPath, wirelessDevice->getAccessPoints()) newAccessPoint(QString(), apPath); + + mutex.lock(); + wirelessDevices.insert(path.path(), wirelessDevice); + mutex.unlock(); } } @@ -611,7 +590,7 @@ void QNetworkManagerEngine::newAccessPoint(const QString &path, const QDBusObjec ptr->purpose = QNetworkConfiguration::PublicPurpose; } ptr->state = QNetworkConfiguration::Undefined; - ptr->bearer = QLatin1String("WLAN"); + ptr->bearerType = QNetworkConfiguration::BearerWLAN; accessPointConfigurations.insert(ptr->id, ptr); @@ -709,8 +688,6 @@ QNetworkConfigurationPrivate *QNetworkManagerEngine::parseConnection(const QStri const QString &settingsPath, const QNmSettingsMap &map) { - QMutexLocker locker(&mutex); - QNetworkConfigurationPrivate *cpPriv = new QNetworkConfigurationPrivate; cpPriv->name = map.value("connection").value("id").toString(); cpPriv->isValid = true; @@ -724,7 +701,7 @@ QNetworkConfigurationPrivate *QNetworkManagerEngine::parseConnection(const QStri const QString connectionType = map.value("connection").value("type").toString(); if (connectionType == QLatin1String("802-3-ethernet")) { - cpPriv->bearer = QLatin1String("Ethernet"); + cpPriv->bearerType = QNetworkConfiguration::BearerEthernet; cpPriv->purpose = QNetworkConfiguration::PublicPurpose; foreach (const QDBusObjectPath &devicePath, interface->getDevices()) { @@ -739,7 +716,7 @@ QNetworkConfigurationPrivate *QNetworkManagerEngine::parseConnection(const QStri } } } else if (connectionType == QLatin1String("802-11-wireless")) { - cpPriv->bearer = QLatin1String("WLAN"); + cpPriv->bearerType = QNetworkConfiguration::BearerWLAN; const QString connectionSsid = map.value("802-11-wireless").value("ssid").toString(); const QString connectionSecurity = map.value("802-11-wireless").value("security").toString(); @@ -759,17 +736,17 @@ QNetworkConfigurationPrivate *QNetworkManagerEngine::parseConnection(const QStri QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.take(accessPointId); - locker.unlock(); + mutex.unlock(); emit configurationRemoved(ptr); - locker.relock(); + mutex.lock(); } break; } } } else if (connectionType == "gsm") { - cpPriv->bearer = QLatin1String("2G"); + cpPriv->bearerType = QNetworkConfiguration::Bearer2G; } else if (connectionType == "cdma") { - cpPriv->bearer = QLatin1String("CDMA2000"); + cpPriv->bearerType = QNetworkConfiguration::BearerCDMA2000; } return cpPriv; @@ -777,8 +754,6 @@ QNetworkConfigurationPrivate *QNetworkManagerEngine::parseConnection(const QStri QNetworkManagerSettingsConnection *QNetworkManagerEngine::connectionFromId(const QString &id) const { - QMutexLocker locker(&mutex); - for (int i = 0; i < connections.count(); ++i) { QNetworkManagerSettingsConnection *connection = connections.at(i); const QString service = connection->connectionInterface()->service(); diff --git a/src/plugins/bearer/networkmanager/qnetworkmanagerengine.h b/src/plugins/bearer/networkmanager/qnetworkmanagerengine.h index 8e95a2c..78ebb0a 100644 --- a/src/plugins/bearer/networkmanager/qnetworkmanagerengine.h +++ b/src/plugins/bearer/networkmanager/qnetworkmanagerengine.h @@ -78,8 +78,6 @@ public: QString getInterfaceFromId(const QString &id); bool hasIdentifier(const QString &id); - QString bearerName(const QString &id); - void connectToId(const QString &id); void disconnectFromId(const QString &id); @@ -118,8 +116,6 @@ private Q_SLOTS: void removeAccessPoint(const QString &path, const QDBusObjectPath &objectPath); void updateAccessPoint(const QMap<QString, QVariant> &map); - void doRequestUpdate(); - private: QNetworkConfigurationPrivate *parseConnection(const QString &service, const QString &settingsPath, diff --git a/src/plugins/bearer/networkmanager/qnetworkmanagerservice.cpp b/src/plugins/bearer/networkmanager/qnetworkmanagerservice.cpp index 31a9aa1..f47c97c 100644 --- a/src/plugins/bearer/networkmanager/qnetworkmanagerservice.cpp +++ b/src/plugins/bearer/networkmanager/qnetworkmanagerservice.cpp @@ -718,146 +718,80 @@ QNmSettingsMap QNetworkManagerSettingsConnection::getSettings() NMDeviceType QNetworkManagerSettingsConnection::getType() { - QNmSettingsMap::const_iterator i = d->settingsMap.find(QLatin1String("connection")); - while (i != d->settingsMap.end() && i.key() == QLatin1String("connection")) { - QMap<QString,QVariant> innerMap = i.value(); - QMap<QString,QVariant>::const_iterator ii = innerMap.find(QLatin1String("type")); - while (ii != innerMap.end() && ii.key() == QLatin1String("type")) { - QString devType = ii.value().toString(); - if (devType == QLatin1String("802-3-ethernet")) { - return DEVICE_TYPE_802_3_ETHERNET; - } - if (devType == QLatin1String("802-11-wireless")) { - return DEVICE_TYPE_802_11_WIRELESS; - } - ii++; - } - i++; - } - return DEVICE_TYPE_UNKNOWN; + const QString devType = + d->settingsMap.value(QLatin1String("connection")).value(QLatin1String("type")).toString(); + + if (devType == QLatin1String("802-3-ethernet")) + return DEVICE_TYPE_802_3_ETHERNET; + else if (devType == QLatin1String("802-11-wireless")) + return DEVICE_TYPE_802_11_WIRELESS; + else + return DEVICE_TYPE_UNKNOWN; } bool QNetworkManagerSettingsConnection::isAutoConnect() { - QNmSettingsMap::const_iterator i = d->settingsMap.find(QLatin1String("connection")); - while (i != d->settingsMap.end() && i.key() == QLatin1String("connection")) { - QMap<QString,QVariant> innerMap = i.value(); - QMap<QString,QVariant>::const_iterator ii = innerMap.find(QLatin1String("autoconnect")); - while (ii != innerMap.end() && ii.key() == QLatin1String("autoconnect")) { - return ii.value().toBool(); - ii++; - } - i++; - } - return true; //default networkmanager is autoconnect + const QVariant autoConnect = + d->settingsMap.value(QLatin1String("connection")).value(QLatin1String("autoconnect")); + + // NetworkManager default is to auto connect + if (!autoConnect.isValid()) + return true; + + return autoConnect.toBool(); } quint64 QNetworkManagerSettingsConnection::getTimestamp() { - QNmSettingsMap::const_iterator i = d->settingsMap.find(QLatin1String("connection")); - while (i != d->settingsMap.end() && i.key() == QLatin1String("connection")) { - QMap<QString,QVariant> innerMap = i.value(); - QMap<QString,QVariant>::const_iterator ii = innerMap.find(QLatin1String("timestamp")); - while (ii != innerMap.end() && ii.key() == QLatin1String("timestamp")) { - return ii.value().toUInt(); - ii++; - } - i++; - } - return 0; + qDebug() << d->settingsMap.value(QLatin1String("connection")); + + return d->settingsMap.value(QLatin1String("connection")) + .value(QLatin1String("timestamp")).toUInt(); } QString QNetworkManagerSettingsConnection::getId() { - QNmSettingsMap::const_iterator i = d->settingsMap.find(QLatin1String("connection")); - while (i != d->settingsMap.end() && i.key() == QLatin1String("connection")) { - QMap<QString,QVariant> innerMap = i.value(); - QMap<QString,QVariant>::const_iterator ii = innerMap.find(QLatin1String("id")); - while (ii != innerMap.end() && ii.key() == QLatin1String("id")) { - return ii.value().toString(); - ii++; - } - i++; - } - return QString(); + return d->settingsMap.value(QLatin1String("connection")).value(QLatin1String("id")).toString(); } QString QNetworkManagerSettingsConnection::getUuid() { - QNmSettingsMap::const_iterator i = d->settingsMap.find(QLatin1String("connection")); - while (i != d->settingsMap.end() && i.key() == QLatin1String("connection")) { - QMap<QString,QVariant> innerMap = i.value(); - QMap<QString,QVariant>::const_iterator ii = innerMap.find(QLatin1String("uuid")); - while (ii != innerMap.end() && ii.key() == QLatin1String("uuid")) { - return ii.value().toString(); - ii++; - } - i++; - } + const QString id = d->settingsMap.value(QLatin1String("connection")) + .value(QLatin1String("uuid")).toString(); + // is no uuid, return the connection path - return d->connectionInterface->path(); + return id.isEmpty() ? d->connectionInterface->path() : id; } QString QNetworkManagerSettingsConnection::getSsid() { - QNmSettingsMap::const_iterator i = d->settingsMap.find(QLatin1String("802-11-wireless")); - while (i != d->settingsMap.end() && i.key() == QLatin1String("802-11-wireless")) { - QMap<QString,QVariant> innerMap = i.value(); - QMap<QString,QVariant>::const_iterator ii = innerMap.find(QLatin1String("ssid")); - while (ii != innerMap.end() && ii.key() == QLatin1String("ssid")) { - return ii.value().toString(); - ii++; - } - i++; - } - return QString(); + return d->settingsMap.value(QLatin1String("802-11-wireless")) + .value(QLatin1String("ssid")).toString(); } QString QNetworkManagerSettingsConnection::getMacAddress() { - if(getType() == DEVICE_TYPE_802_3_ETHERNET) { - QNmSettingsMap::const_iterator i = d->settingsMap.find(QLatin1String("802-3-ethernet")); - while (i != d->settingsMap.end() && i.key() == QLatin1String("802-3-ethernet")) { - QMap<QString,QVariant> innerMap = i.value(); - QMap<QString,QVariant>::const_iterator ii = innerMap.find(QLatin1String("mac-address")); - while (ii != innerMap.end() && ii.key() == QLatin1String("mac-address")) { - return ii.value().toString(); - ii++; - } - i++; - } - } + NMDeviceType type = getType(); - else if(getType() == DEVICE_TYPE_802_11_WIRELESS) { - QNmSettingsMap::const_iterator i = d->settingsMap.find(QLatin1String("802-11-wireless")); - while (i != d->settingsMap.end() && i.key() == QLatin1String("802-11-wireless")) { - QMap<QString,QVariant> innerMap = i.value(); - QMap<QString,QVariant>::const_iterator ii = innerMap.find(QLatin1String("mac-address")); - while (ii != innerMap.end() && ii.key() == QLatin1String("mac-address")) { - return ii.value().toString(); - ii++; - } - i++; - } + if (type == DEVICE_TYPE_802_3_ETHERNET) { + return d->settingsMap.value(QLatin1String("802-3-ethernet")) + .value(QLatin1String("mac-address")).toString(); + } else if (type == DEVICE_TYPE_802_11_WIRELESS) { + return d->settingsMap.value(QLatin1String("802-11-wireless")) + .value(QLatin1String("mac-address")).toString(); + } else { + return QString(); } - return QString(); -} - -QStringList QNetworkManagerSettingsConnection::getSeenBssids() -{ - if(getType() == DEVICE_TYPE_802_11_WIRELESS) { - QNmSettingsMap::const_iterator i = d->settingsMap.find(QLatin1String("802-11-wireless")); - while (i != d->settingsMap.end() && i.key() == QLatin1String("802-11-wireless")) { - QMap<QString,QVariant> innerMap = i.value(); - QMap<QString,QVariant>::const_iterator ii = innerMap.find(QLatin1String("seen-bssids")); - while (ii != innerMap.end() && ii.key() == QLatin1String("seen-bssids")) { - return ii.value().toStringList(); - ii++; - } - i++; - } +} + +QStringList QNetworkManagerSettingsConnection::getSeenBssids() +{ + if (getType() == DEVICE_TYPE_802_11_WIRELESS) { + return d->settingsMap.value(QLatin1String("802-11-wireless")) + .value(QLatin1String("seen-bssids")).toStringList(); + } else { + return QStringList(); } - return QStringList(); } class QNetworkManagerConnectionActivePrivate diff --git a/src/plugins/bearer/nla/qnlaengine.cpp b/src/plugins/bearer/nla/qnlaengine.cpp index 9ab9924..fd50099 100644 --- a/src/plugins/bearer/nla/qnlaengine.cpp +++ b/src/plugins/bearer/nla/qnlaengine.cpp @@ -119,7 +119,7 @@ static void printBlob(NLA_BLOB *blob) } #endif -static QString qGetInterfaceType(const QString &interface) +static QNetworkConfiguration::BearerType qGetInterfaceType(const QString &interface) { #ifdef Q_OS_WINCE Q_UNUSED(interface) @@ -130,10 +130,10 @@ static QString qGetInterfaceType(const QString &interface) NDIS_MEDIUM medium; NDIS_PHYSICAL_MEDIUM physicalMedium; - HANDLE handle = CreateFile((TCHAR *)QString(QLatin1String("\\\\.\\%1")).arg(interface).utf16(), - 0, FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0); + HANDLE handle = CreateFile((TCHAR *)QString::fromLatin1("\\\\.\\%1").arg(interface).utf16(), 0, + FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0); if (handle == INVALID_HANDLE_VALUE) - return QLatin1String("Unknown"); + return QNetworkConfiguration::BearerUnknown; oid = OID_GEN_MEDIA_SUPPORTED; bytesWritten = 0; @@ -141,7 +141,7 @@ static QString qGetInterfaceType(const QString &interface) &medium, sizeof(medium), &bytesWritten, 0); if (!result) { CloseHandle(handle); - return QLatin1String("Unknown"); + return QNetworkConfiguration::BearerUnknown; } oid = OID_GEN_PHYSICAL_MEDIUM; @@ -152,9 +152,9 @@ static QString qGetInterfaceType(const QString &interface) CloseHandle(handle); if (medium == NdisMedium802_3) - return QLatin1String("Ethernet"); + return QNetworkConfiguration::BearerEthernet; else - return QLatin1String("Unknown"); + return QNetworkConfiguration::BearerUnknown; } CloseHandle(handle); @@ -162,16 +162,16 @@ static QString qGetInterfaceType(const QString &interface) if (medium == NdisMedium802_3) { switch (physicalMedium) { case NdisPhysicalMediumWirelessLan: - return QLatin1String("WLAN"); + return QNetworkConfiguration::BearerWLAN; case NdisPhysicalMediumBluetooth: - return QLatin1String("Bluetooth"); + return QNetworkConfiguration::BearerBluetooth; case NdisPhysicalMediumWiMax: - return QLatin1String("WiMAX"); + return QNetworkConfiguration::BearerWiMAX; default: #ifdef BEARER_MANAGEMENT_DEBUG qDebug() << "Physical Medium" << physicalMedium; #endif - return QLatin1String("Ethernet"); + return QNetworkConfiguration::BearerEthernet; } } @@ -181,7 +181,7 @@ static QString qGetInterfaceType(const QString &interface) #endif - return QLatin1String("Unknown"); + return QNetworkConfiguration::BearerUnknown; } class QNlaThread : public QThread @@ -374,10 +374,9 @@ DWORD QNlaThread::parseBlob(NLA_BLOB *blob, QNetworkConfigurationPrivate *cpPriv #endif break; case NLA_CONNECTIVITY: - if (blob->data.connectivity.internet == NLA_INTERNET_YES) - cpPriv->internet = true; - else - cpPriv->internet = false; +#ifdef BEARER_MANAGEMENT_DEBUG + qDebug("%s: unhandled header type NLA_CONNECTIVITY", __FUNCTION__); +#endif break; case NLA_ICS: #ifdef BEARER_MANAGEMENT_DEBUG @@ -438,8 +437,10 @@ QNetworkConfigurationPrivate *QNlaThread::parseQuerySet(const WSAQUERYSET *query } while (offset != 0 && offset < querySet->lpBlob->cbSize); } - if (QNlaEngine *engine = qobject_cast<QNlaEngine *>(parent())) - cpPriv->bearer = engine->bearerName(cpPriv->id); + if (QNlaEngine *engine = qobject_cast<QNlaEngine *>(parent())) { + const QString interface = engine->getInterfaceFromId(cpPriv->id); + cpPriv->bearerType = qGetInterfaceType(interface); + } return cpPriv; } @@ -586,16 +587,6 @@ bool QNlaEngine::hasIdentifier(const QString &id) return configurationInterface.contains(id.toUInt()); } -QString QNlaEngine::bearerName(const QString &id) -{ - QString interface = getInterfaceFromId(id); - - if (interface.isEmpty()) - return QString(); - - return qGetInterfaceType(interface); -} - void QNlaEngine::connectToId(const QString &id) { emit connectionError(id, OperationNotSupported); diff --git a/src/plugins/bearer/nla/qnlaengine.h b/src/plugins/bearer/nla/qnlaengine.h index 1d49464..69f54c9 100644 --- a/src/plugins/bearer/nla/qnlaengine.h +++ b/src/plugins/bearer/nla/qnlaengine.h @@ -85,8 +85,6 @@ public: QString getInterfaceFromId(const QString &id); bool hasIdentifier(const QString &id); - QString bearerName(const QString &id); - void connectToId(const QString &id); void disconnectFromId(const QString &id); diff --git a/src/plugins/bearer/symbian/3_1/3_1.pro b/src/plugins/bearer/symbian/3_1/3_1.pro index 2d721a8..b7c6aef 100644 --- a/src/plugins/bearer/symbian/3_1/3_1.pro +++ b/src/plugins/bearer/symbian/3_1/3_1.pro @@ -1,5 +1,9 @@ include(../symbian.pri) -LIBS += -lapengine +is_using_gnupoc { + LIBS += -lapengine +} else { + LIBS += -lAPEngine +} TARGET = $${TARGET}_3_1 TARGET.UID3 = 0x2002131C diff --git a/src/plugins/bearer/symbian/symbian.pri b/src/plugins/bearer/symbian/symbian.pri index afe84dc..9b3f50c 100644 --- a/src/plugins/bearer/symbian/symbian.pri +++ b/src/plugins/bearer/symbian/symbian.pri @@ -14,8 +14,6 @@ INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE symbian-abld:INCLUDEPATH += $$QT_BUILD_TREE/include/QtNetwork/private LIBS += -lcommdb \ - -lapsettingshandlerui \ - -lconnmon \ -lcentralrepository \ -lesock \ -linsock \ @@ -23,6 +21,14 @@ LIBS += -lcommdb \ -lefsrv \ -lnetmeta +is_using_gnupoc { + LIBS += -lconnmon \ + -lapsettingshandlerui +} else { + LIBS += -lConnMon \ + -lApSettingsHandlerUI +} + QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/bearer target.path += $$[QT_INSTALL_PLUGINS]/bearer INSTALLS += target diff --git a/src/plugins/bearer/symbian/symbian_3/symbian_3.pro b/src/plugins/bearer/symbian/symbian_3/symbian_3.pro index ff0f11c..fd66198 100644 --- a/src/plugins/bearer/symbian/symbian_3/symbian_3.pro +++ b/src/plugins/bearer/symbian/symbian_3/symbian_3.pro @@ -12,7 +12,11 @@ symbian { } } else { # Fall back to 3_1 implementation on platforms that do not have cmmanager - LIBS += -lapengine + is_using_gnupoc { + LIBS += -lapengine + } else { + LIBS += -lAPEngine + } } } diff --git a/src/plugins/bearer/symbian/symbianengine.cpp b/src/plugins/bearer/symbian/symbianengine.cpp index 4bd6d2f..9593461 100644 --- a/src/plugins/bearer/symbian/symbianengine.cpp +++ b/src/plugins/bearer/symbian/symbianengine.cpp @@ -63,9 +63,9 @@ #include <cmpluginpacketdatadef.h> #include <cmplugindialcommondefs.h> #else - #include <apaccesspointitem.h> - #include <apdatahandler.h> - #include <aputils.h> + #include <ApAccessPointItem.h> + #include <ApDataHandler.h> + #include <ApUtils.h> #endif #ifndef QT_NO_BEARERMANAGEMENT @@ -75,7 +75,7 @@ QT_BEGIN_NAMESPACE static const int KUserChoiceIAPId = 0; SymbianNetworkConfigurationPrivate::SymbianNetworkConfigurationPrivate() -: bearer(BearerUnknown), numericId(0), connectionId(0) +: numericId(0), connectionId(0) { } @@ -83,32 +83,6 @@ SymbianNetworkConfigurationPrivate::~SymbianNetworkConfigurationPrivate() { } -QString SymbianNetworkConfigurationPrivate::bearerName() const -{ - QMutexLocker locker(&mutex); - - switch (bearer) { - case BearerEthernet: - return QLatin1String("Ethernet"); - case BearerWLAN: - return QLatin1String("WLAN"); - case Bearer2G: - return QLatin1String("2G"); - case BearerCDMA2000: - return QLatin1String("CDMA2000"); - case BearerWCDMA: - return QLatin1String("WCDMA"); - case BearerHSPA: - return QLatin1String("HSPA"); - case BearerBluetooth: - return QLatin1String("Bluetooth"); - case BearerWiMAX: - return QLatin1String("WiMAX"); - default: - return QString(); - } -} - SymbianEngine::SymbianEngine(QObject *parent) : QBearerEngine(parent), CActive(CActive::EPriorityHigh), iFirstUpdate(true), iInitOk(true), iUpdatePending(false) @@ -146,7 +120,7 @@ void SymbianEngine::initialize() SymbianNetworkConfigurationPrivate *cpPriv = new SymbianNetworkConfigurationPrivate; cpPriv->name = "UserChoice"; - cpPriv->bearer = SymbianNetworkConfigurationPrivate::BearerUnknown; + cpPriv->bearerType = QNetworkConfiguration::BearerUnknown; cpPriv->state = QNetworkConfiguration::Discovered; cpPriv->isValid = true; cpPriv->id = QString::number(qHash(KUserChoiceIAPId)); @@ -517,25 +491,25 @@ SymbianNetworkConfigurationPrivate *SymbianEngine::configFromConnectionMethodL( TUint32 bearerId = connectionMethod.GetIntAttributeL(CMManager::ECmCommsDBBearerType); switch (bearerId) { case KCommDbBearerCSD: - cpPriv->bearer = SymbianNetworkConfigurationPrivate::Bearer2G; + cpPriv->bearerType = QNetworkConfiguration::Bearer2G; break; case KCommDbBearerWcdma: - cpPriv->bearer = SymbianNetworkConfigurationPrivate::BearerWCDMA; + cpPriv->bearerType = QNetworkConfiguration::BearerWCDMA; break; case KCommDbBearerLAN: - cpPriv->bearer = SymbianNetworkConfigurationPrivate::BearerEthernet; + cpPriv->bearerType = QNetworkConfiguration::BearerEthernet; break; case KCommDbBearerVirtual: - cpPriv->bearer = SymbianNetworkConfigurationPrivate::BearerUnknown; + cpPriv->bearerType = QNetworkConfiguration::BearerUnknown; break; case KCommDbBearerPAN: - cpPriv->bearer = SymbianNetworkConfigurationPrivate::BearerUnknown; + cpPriv->bearerType = QNetworkConfiguration::BearerUnknown; break; case KCommDbBearerWLAN: - cpPriv->bearer = SymbianNetworkConfigurationPrivate::BearerWLAN; + cpPriv->bearerType = QNetworkConfiguration::BearerWLAN; break; default: - cpPriv->bearer = SymbianNetworkConfigurationPrivate::BearerUnknown; + cpPriv->bearerType = QNetworkConfiguration::BearerUnknown; break; } @@ -619,28 +593,28 @@ void SymbianEngine::readNetworkConfigurationValuesFromCommsDbL( apNetworkConfiguration->roamingSupported = false; switch (pAPItem->BearerTypeL()) { case EApBearerTypeCSD: - apNetworkConfiguration->bearer = SymbianNetworkConfigurationPrivate::Bearer2G; + apNetworkConfiguration->bearerType = QNetworkConfiguration::Bearer2G; break; case EApBearerTypeGPRS: - apNetworkConfiguration->bearer = SymbianNetworkConfigurationPrivate::Bearer2G; + apNetworkConfiguration->bearerType = QNetworkConfiguration::Bearer2G; break; case EApBearerTypeHSCSD: - apNetworkConfiguration->bearer = SymbianNetworkConfigurationPrivate::BearerHSPA; + apNetworkConfiguration->bearerType = QNetworkConfiguration::BearerHSPA; break; case EApBearerTypeCDMA: - apNetworkConfiguration->bearer = SymbianNetworkConfigurationPrivate::BearerCDMA2000; + apNetworkConfiguration->bearerType = QNetworkConfiguration::BearerCDMA2000; break; case EApBearerTypeWLAN: - apNetworkConfiguration->bearer = SymbianNetworkConfigurationPrivate::BearerWLAN; + apNetworkConfiguration->bearerType = QNetworkConfiguration::BearerWLAN; break; case EApBearerTypeLAN: - apNetworkConfiguration->bearer = SymbianNetworkConfigurationPrivate::BearerEthernet; + apNetworkConfiguration->bearerType = QNetworkConfiguration::BearerEthernet; break; case EApBearerTypeLANModem: - apNetworkConfiguration->bearer = SymbianNetworkConfigurationPrivate::BearerEthernet; + apNetworkConfiguration->bearerType = QNetworkConfiguration::BearerEthernet; break; default: - apNetworkConfiguration->bearer = SymbianNetworkConfigurationPrivate::BearerUnknown; + apNetworkConfiguration->bearerType = QNetworkConfiguration::BearerUnknown; break; } @@ -870,38 +844,38 @@ void SymbianEngine::updateMobileBearerToConfigs(TConnMonBearerInfo bearerInfo) SymbianNetworkConfigurationPrivate *p = toSymbianConfig(ptr); - if (p->bearer >= SymbianNetworkConfigurationPrivate::Bearer2G && - p->bearer <= SymbianNetworkConfigurationPrivate::BearerHSPA) { + if (p->bearerType >= QNetworkConfiguration::Bearer2G && + p->bearerType <= QNetworkConfiguration::BearerHSPA) { switch (bearerInfo) { case EBearerInfoCSD: - p->bearer = SymbianNetworkConfigurationPrivate::Bearer2G; + p->bearerType = QNetworkConfiguration::Bearer2G; break; case EBearerInfoWCDMA: - p->bearer = SymbianNetworkConfigurationPrivate::BearerWCDMA; + p->bearerType = QNetworkConfiguration::BearerWCDMA; break; case EBearerInfoCDMA2000: - p->bearer = SymbianNetworkConfigurationPrivate::BearerCDMA2000; + p->bearerType = QNetworkConfiguration::BearerCDMA2000; break; case EBearerInfoGPRS: - p->bearer = SymbianNetworkConfigurationPrivate::Bearer2G; + p->bearerType = QNetworkConfiguration::Bearer2G; break; case EBearerInfoHSCSD: - p->bearer = SymbianNetworkConfigurationPrivate::Bearer2G; + p->bearerType = QNetworkConfiguration::Bearer2G; break; case EBearerInfoEdgeGPRS: - p->bearer = SymbianNetworkConfigurationPrivate::Bearer2G; + p->bearerType = QNetworkConfiguration::Bearer2G; break; case EBearerInfoWcdmaCSD: - p->bearer = SymbianNetworkConfigurationPrivate::BearerWCDMA; + p->bearerType = QNetworkConfiguration::BearerWCDMA; break; case EBearerInfoHSDPA: - p->bearer = SymbianNetworkConfigurationPrivate::BearerHSPA; + p->bearerType = QNetworkConfiguration::BearerHSPA; break; case EBearerInfoHSUPA: - p->bearer = SymbianNetworkConfigurationPrivate::BearerHSPA; + p->bearerType = QNetworkConfiguration::BearerHSPA; break; case EBearerInfoHSxPA: - p->bearer = SymbianNetworkConfigurationPrivate::BearerHSPA; + p->bearerType = QNetworkConfiguration::BearerHSPA; break; } } diff --git a/src/plugins/bearer/symbian/symbianengine.h b/src/plugins/bearer/symbian/symbianengine.h index ecd858d..1fe6395 100644 --- a/src/plugins/bearer/symbian/symbianengine.h +++ b/src/plugins/bearer/symbian/symbianengine.h @@ -73,23 +73,9 @@ class AccessPointsAvailabilityScanner; class SymbianNetworkConfigurationPrivate : public QNetworkConfigurationPrivate { public: - enum Bearer { - BearerEthernet, - BearerWLAN, - Bearer2G, - BearerCDMA2000, - BearerWCDMA, - BearerHSPA, - BearerBluetooth, - BearerWiMAX, - BearerUnknown = -1 - }; - SymbianNetworkConfigurationPrivate(); ~SymbianNetworkConfigurationPrivate(); - QString bearerName() const; - inline TUint32 numericIdentifier() const { QMutexLocker locker(&mutex); @@ -110,8 +96,6 @@ public: QString mappingName; - Bearer bearer; - // So called IAP id from the platform. Remains constant as long as the // platform is aware of the configuration ie. it is stored in the databases // --> does not depend on whether connections are currently open or not. diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp index e4a0135..d5f0d42 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp @@ -167,7 +167,6 @@ struct CachedImage static QCache<qint64, CachedImage> imageCache(4*1024*1024); // 4 MB #endif -#if defined QT_DIRECTFB_WARN_ON_RASTERFALLBACKS || defined QT_DIRECTFB_DISABLE_RASTERFALLBACKS || defined QT_DEBUG #define VOID_ARG() static_cast<bool>(false) enum PaintOperation { DRAW_RECTS = 0x0001, DRAW_LINES = 0x0002, DRAW_IMAGE = 0x0004, @@ -178,88 +177,81 @@ enum PaintOperation { DRAW_STATICTEXT = 0x8000, ALL = 0xffff }; -#ifdef QT_DEBUG -static void initRasterFallbacksMasks(int *warningMask, int *disableMask) -{ - struct { - const char *name; - PaintOperation operation; - } const operations[] = { - { "DRAW_RECTS", DRAW_RECTS }, - { "DRAW_LINES", DRAW_LINES }, - { "DRAW_IMAGE", DRAW_IMAGE }, - { "DRAW_PIXMAP", DRAW_PIXMAP }, - { "DRAW_TILED_PIXMAP", DRAW_TILED_PIXMAP }, - { "STROKE_PATH", STROKE_PATH }, - { "DRAW_PATH", DRAW_PATH }, - { "DRAW_POINTS", DRAW_POINTS }, - { "DRAW_ELLIPSE", DRAW_ELLIPSE }, - { "DRAW_POLYGON", DRAW_POLYGON }, - { "DRAW_TEXT", DRAW_TEXT }, - { "FILL_PATH", FILL_PATH }, - { "FILL_RECT", FILL_RECT }, - { "DRAW_COLORSPANS", DRAW_COLORSPANS }, - { "DRAW_ROUNDED_RECT", DRAW_ROUNDED_RECT }, - { "ALL", ALL }, - { 0, ALL } - }; - - QStringList warning = QString::fromLatin1(qgetenv("QT_DIRECTFB_WARN_ON_RASTERFALLBACKS")).toUpper().split(QLatin1Char('|'), - QString::SkipEmptyParts); - QStringList disable = QString::fromLatin1(qgetenv("QT_DIRECTFB_DISABLE_RASTERFALLBACKS")).toUpper().split(QLatin1Char('|'), - QString::SkipEmptyParts); - *warningMask = 0; - *disableMask = 0; - if (!warning.isEmpty() || !disable.isEmpty()) { - for (int i=0; operations[i].name; ++i) { - const QString name = QString::fromLatin1(operations[i].name); - int idx = warning.indexOf(name); - if (idx != -1) { - *warningMask |= operations[i].operation; - warning.erase(warning.begin() + idx); - } - idx = disable.indexOf(name); - if (idx != -1) { - *disableMask |= operations[i].operation; - disable.erase(disable.begin() + idx); - } - } - } - if (!warning.isEmpty()) { - qWarning("QDirectFBPaintEngine QT_DIRECTFB_WARN_ON_RASTERFALLBACKS Unknown operation(s): %s", - qPrintable(warning.join(QLatin1String("|")))); - } - if (!disable.isEmpty()) { - qWarning("QDirectFBPaintEngine QT_DIRECTFB_DISABLE_RASTERFALLBACKS Unknown operation(s): %s", - qPrintable(disable.join(QLatin1String("|")))); - } - -} -#endif - -static inline int rasterFallbacksMask(bool warn) +enum { RasterWarn = 1, RasterDisable = 2 }; +static inline uint rasterFallbacksMask(PaintOperation op) { + uint ret = 0; #ifdef QT_DIRECTFB_WARN_ON_RASTERFALLBACKS - if (warn) - return QT_DIRECTFB_WARN_ON_RASTERFALLBACKS; + if (op & QT_DIRECTFB_WARN_ON_RASTERFALLBACKS) + ret |= RasterWarn; #endif #ifdef QT_DIRECTFB_DISABLE_RASTERFALLBACKS - if (!warn) - return QT_DIRECTFB_DISABLE_RASTERFALLBACKS; + if (op & QT_DIRECTFB_DISABLE_RASTERFALLBACKS) + ret |= RasterDisable; #endif -#ifndef QT_DEBUG - return 0; -#else - static int warnMask = -1; + static int warningMask = -1; static int disableMask = -1; - if (warnMask == -1) - initRasterFallbacksMasks(&warnMask, &disableMask); - return warn ? warnMask : disableMask; -#endif + if (warningMask < 0) { + struct { + const char *name; + PaintOperation operation; + } const operations[] = { + { "DRAW_RECTS", DRAW_RECTS }, + { "DRAW_LINES", DRAW_LINES }, + { "DRAW_IMAGE", DRAW_IMAGE }, + { "DRAW_PIXMAP", DRAW_PIXMAP }, + { "DRAW_TILED_PIXMAP", DRAW_TILED_PIXMAP }, + { "STROKE_PATH", STROKE_PATH }, + { "DRAW_PATH", DRAW_PATH }, + { "DRAW_POINTS", DRAW_POINTS }, + { "DRAW_ELLIPSE", DRAW_ELLIPSE }, + { "DRAW_POLYGON", DRAW_POLYGON }, + { "DRAW_TEXT", DRAW_TEXT }, + { "FILL_PATH", FILL_PATH }, + { "FILL_RECT", FILL_RECT }, + { "DRAW_COLORSPANS", DRAW_COLORSPANS }, + { "DRAW_ROUNDED_RECT", DRAW_ROUNDED_RECT }, + { "ALL", ALL }, + { 0, ALL } + }; + + QStringList warning = QString::fromLatin1(qgetenv("QT_DIRECTFB_WARN_ON_RASTERFALLBACKS")).toUpper().split(QLatin1Char('|'), + QString::SkipEmptyParts); + QStringList disable = QString::fromLatin1(qgetenv("QT_DIRECTFB_DISABLE_RASTERFALLBACKS")).toUpper().split(QLatin1Char('|'), + QString::SkipEmptyParts); + warningMask = 0; + disableMask = 0; + if (!warning.isEmpty() || !disable.isEmpty()) { + for (int i=0; operations[i].name; ++i) { + const QString name = QString::fromLatin1(operations[i].name); + int idx = warning.indexOf(name); + if (idx != -1) { + warningMask |= operations[i].operation; + warning.erase(warning.begin() + idx); + } + idx = disable.indexOf(name); + if (idx != -1) { + disableMask |= operations[i].operation; + disable.erase(disable.begin() + idx); + } + } + } + if (!warning.isEmpty()) { + qWarning("QDirectFBPaintEngine QT_DIRECTFB_WARN_ON_RASTERFALLBACKS Unknown operation(s): %s", + qPrintable(warning.join(QLatin1String("|")))); + } + if (!disable.isEmpty()) { + qWarning("QDirectFBPaintEngine QT_DIRECTFB_DISABLE_RASTERFALLBACKS Unknown operation(s): %s", + qPrintable(disable.join(QLatin1String("|")))); + } + } + if (op & warningMask) + ret |= RasterWarn; + if (op & disableMask) + ret |= RasterDisable; + return ret; } -#endif -#if defined QT_DIRECTFB_WARN_ON_RASTERFALLBACKS || defined QT_DEBUG template <typename device, typename T1, typename T2, typename T3> static void rasterFallbackWarn(const char *msg, const char *func, const device *dev, uint transformationType, bool simplePen, @@ -267,16 +259,14 @@ static void rasterFallbackWarn(const char *msg, const char *func, const device * const char *nameOne, const T1 &one, const char *nameTwo, const T2 &two, const char *nameThree, const T3 &three); -#endif -#if defined QT_DEBUG || (defined QT_DIRECTFB_WARN_ON_RASTERFALLBACKS && defined QT_DIRECTFB_DISABLE_RASTERFALLBACKS) #define RASTERFALLBACK(op, one, two, three) \ { \ - const bool disable = op & rasterFallbacksMask(false); \ - if (op & rasterFallbacksMask(true)) \ - rasterFallbackWarn(disable \ - ? "Disabled raster engine operation" \ - : "Falling back to raster engine for", \ + static const uint rasterFallbacks = rasterFallbacksMask(op); \ + switch (rasterFallbacks) { \ + case 0: break; \ + case RasterWarn: \ + rasterFallbackWarn("Falling back to raster engine for", \ __FUNCTION__, \ state()->painter->device(), \ d_func()->transformationType, \ @@ -284,26 +274,20 @@ static void rasterFallbackWarn(const char *msg, const char *func, const device * d_func()->clipType, \ d_func()->compositionModeStatus, \ #one, one, #two, two, #three, three); \ - if (disable) \ + break; \ + case RasterDisable|RasterWarn: \ + rasterFallbackWarn("Disabled raster engine operation", \ + __FUNCTION__, \ + state()->painter->device(), \ + d_func()->transformationType, \ + d_func()->simplePen, \ + d_func()->clipType, \ + d_func()->compositionModeStatus, \ + #one, one, #two, two, #three, three); \ + case RasterDisable: \ return; \ + } \ } -#elif defined QT_DIRECTFB_DISABLE_RASTERFALLBACKS -#define RASTERFALLBACK(op, one, two, three) \ - if (op & rasterFallbacksMask(false)) \ - return; -#elif defined QT_DIRECTFB_WARN_ON_RASTERFALLBACKS -#define RASTERFALLBACK(op, one, two, three) \ - if (op & rasterFallbacksMask(true)) \ - rasterFallbackWarn("Falling back to raster engine for", \ - __FUNCTION__, state()->painter->device(), \ - d_func()->transformationType, \ - d_func()->simplePen, \ - d_func()->clipType, \ - d_func()->compositionModeStatus, \ - #one, one, #two, two, #three, three); -#else -#define RASTERFALLBACK(op, one, two, three) -#endif template <class T> static inline void drawLines(const T *lines, int n, const QTransform &transform, IDirectFBSurface *surface); @@ -1362,7 +1346,6 @@ static inline void drawRects(const T *rects, int n, const QTransform &transform, } } -#if defined QT_DIRECTFB_WARN_ON_RASTERFALLBACKS || defined QT_DEBUG template <typename T> inline const T *ptr(const T &t) { return &t; } template <> inline const bool* ptr<bool>(const bool &) { return 0; } template <typename device, typename T1, typename T2, typename T3> @@ -1403,8 +1386,6 @@ static void rasterFallbackWarn(const char *msg, const char *func, const device * qWarning("%s", qPrintable(out)); } -#endif // QT_DIRECTFB_WARN_ON_RASTERFALLBACKS - QT_END_NAMESPACE #endif // QT_NO_QWS_DIRECTFB diff --git a/src/qbase.pri b/src/qbase.pri index e08ca8a..aa7d745 100644 --- a/src/qbase.pri +++ b/src/qbase.pri @@ -160,13 +160,25 @@ DEFINES *= QT_USE_FAST_OPERATOR_PLUS QT_USE_FAST_CONCATENATION TARGET = $$qtLibraryTarget($$TARGET$$QT_LIBINFIX) #do this towards the end +qtPrepareTool(QMAKE_LUPDATE, lupdate) +qtPrepareTool(QMAKE_LRELEASE, lrelease) + moc_dir.name = moc_location moc_dir.variable = QMAKE_MOC uic_dir.name = uic_location uic_dir.variable = QMAKE_UIC -QMAKE_PKGCONFIG_VARIABLES += moc_dir uic_dir +rcc_dir.name = rcc_location +rcc_dir.variable = QMAKE_RCC + +lupdate_dir.name = lupdate_location +lupdate_dir.variable = QMAKE_LUPDATE + +lrelease_dir.name = lrelease_location +lrelease_dir.variable = QMAKE_LRELEASE + +QMAKE_PKGCONFIG_VARIABLES += moc_dir uic_dir rcc_dir lupdate_dir lrelease_dir include(qt_targets.pri) diff --git a/src/qt3support/widgets/q3gridview.cpp b/src/qt3support/widgets/q3gridview.cpp index 343b49f..b270a38 100644 --- a/src/qt3support/widgets/q3gridview.cpp +++ b/src/qt3support/widgets/q3gridview.cpp @@ -84,7 +84,7 @@ using namespace Qt; size in a potentially scrollable canvas. If you need rows and columns with different sizes, use a Q3Table instead. If you need a simple list of items, use a Q3ListBox. If you need to present - hierachical data use a Q3ListView, and if you need random objects + hierarichal data use a Q3ListView, and if you need random objects at random positions, consider using either a Q3IconView or a Q3Canvas. */ diff --git a/src/s60installs/bwins/QtCoreu.def b/src/s60installs/bwins/QtCoreu.def index 94be1bb..1a79f63 100644 --- a/src/s60installs/bwins/QtCoreu.def +++ b/src/s60installs/bwins/QtCoreu.def @@ -3122,7 +3122,7 @@ EXPORTS ?reset@QIODevice@@UAE_NXZ @ 3121 NONAME ; bool QIODevice::reset(void) ?reset@QMetaProperty@@QBE_NPAVQObject@@@Z @ 3122 NONAME ; bool QMetaProperty::reset(class QObject *) const ?reset@QTextStream@@QAEXXZ @ 3123 NONAME ; void QTextStream::reset(void) - ?resetCurrentSender@QObjectPrivate@@SAXPAVQObject@@PAUSender@1@1@Z @ 3124 NONAME ABSENT ; void QObjectPrivate::resetCurrentSender(class QObject *, struct QObjectPrivate::Sender *, struct QObjectPrivate::Sender *) + ?resetCurrentSender@QObjectPrivate@@SAXPAVQObject@@PAUSender@1@1@Z @ 3124 NONAME ; void QObjectPrivate::resetCurrentSender(class QObject *, struct QObjectPrivate::Sender *, struct QObjectPrivate::Sender *) ?resetDeleteWatch@QObjectPrivate@@SAXPAV1@PAHH@Z @ 3125 NONAME ; void QObjectPrivate::resetDeleteWatch(class QObjectPrivate *, int *, int) ?resetStatus@QDataStream@@QAEXXZ @ 3126 NONAME ; void QDataStream::resetStatus(void) ?resetStatus@QTextStream@@QAEXXZ @ 3127 NONAME ; void QTextStream::resetStatus(void) @@ -3281,7 +3281,7 @@ EXPORTS ?setCoords@QRectF@@QAEXMMMM@Z @ 3280 NONAME ; void QRectF::setCoords(float, float, float, float) ?setCurrent@QDir@@SA_NABVQString@@@Z @ 3281 NONAME ; bool QDir::setCurrent(class QString const &) ?setCurrentPath@QFSFileEngine@@SA_NABVQString@@@Z @ 3282 NONAME ; bool QFSFileEngine::setCurrentPath(class QString const &) - ?setCurrentSender@QObjectPrivate@@SAPAUSender@1@PAVQObject@@PAU21@@Z @ 3283 NONAME ABSENT ; struct QObjectPrivate::Sender * QObjectPrivate::setCurrentSender(class QObject *, struct QObjectPrivate::Sender *) + ?setCurrentSender@QObjectPrivate@@SAPAUSender@1@PAVQObject@@PAU21@@Z @ 3283 NONAME ; struct QObjectPrivate::Sender * QObjectPrivate::setCurrentSender(class QObject *, struct QObjectPrivate::Sender *) ?setCurrentTime@QAbstractAnimation@@QAEXH@Z @ 3284 NONAME ; void QAbstractAnimation::setCurrentTime(int) ?setCurrentTime@QTimeLine@@QAEXH@Z @ 3285 NONAME ; void QTimeLine::setCurrentTime(int) ?setCurveShape@QTimeLine@@QAEXW4CurveShape@1@@Z @ 3286 NONAME ; void QTimeLine::setCurveShape(enum QTimeLine::CurveShape) @@ -4417,71 +4417,69 @@ EXPORTS ?QBasicAtomicInt_testAndSetRelease@@YA_NPCHHH@Z @ 4416 NONAME ; bool QBasicAtomicInt_testAndSetRelease(int volatile *, int, int) ?QBasicAtomicInt_fetchAndStoreAcquire@@YAHPCHH@Z @ 4417 NONAME ; int QBasicAtomicInt_fetchAndStoreAcquire(int volatile *, int) ?QBasicAtomicInt_fetchAndAddAcquire@@YAHPCHH@Z @ 4418 NONAME ; int QBasicAtomicInt_fetchAndAddAcquire(int volatile *, int) - ??0QString@@QAE@PBVQChar@@@Z @ 4419 NONAME ; QString::QString(class QChar const *) - ??0QTextDecoder@@QAE@PBVQTextCodec@@V?$QFlags@W4ConversionFlag@QTextCodec@@@@@Z @ 4420 NONAME ; QTextDecoder::QTextDecoder(class QTextCodec const *, class QFlags<enum QTextCodec::ConversionFlag>) - ??0QTextEncoder@@QAE@PBVQTextCodec@@V?$QFlags@W4ConversionFlag@QTextCodec@@@@@Z @ 4421 NONAME ; QTextEncoder::QTextEncoder(class QTextCodec const *, class QFlags<enum QTextCodec::ConversionFlag>) - ??0QVariant@@QAE@ABVQEasingCurve@@@Z @ 4422 NONAME ; QVariant::QVariant(class QEasingCurve const &) - ??5@YAAAVQDataStream@@AAV0@AAVQEasingCurve@@@Z @ 4423 NONAME ; class QDataStream & operator>>(class QDataStream &, class QEasingCurve &) - ??6@YAAAVQDataStream@@AAV0@ABVQEasingCurve@@@Z @ 4424 NONAME ; class QDataStream & operator<<(class QDataStream &, class QEasingCurve const &) - ??8QElapsedTimer@@QBE_NABV0@@Z @ 4425 NONAME ; bool QElapsedTimer::operator==(class QElapsedTimer const &) const - ??9QElapsedTimer@@QBE_NABV0@@Z @ 4426 NONAME ; bool QElapsedTimer::operator!=(class QElapsedTimer const &) const - ??M@YA_NABVQElapsedTimer@@0@Z @ 4427 NONAME ; bool operator<(class QElapsedTimer const &, class QElapsedTimer const &) - ?append@QListData@@QAEPAPAXH@Z @ 4428 NONAME ; void * * QListData::append(int) - ?clearHistory@QStateMachinePrivate@@QAEXXZ @ 4429 NONAME ; void QStateMachinePrivate::clearHistory(void) - ?clockType@QElapsedTimer@@SA?AW4ClockType@1@XZ @ 4430 NONAME ; enum QElapsedTimer::ClockType QElapsedTimer::clockType(void) - ?currentDateTimeUtc@QDateTime@@SA?AV1@XZ @ 4431 NONAME ; class QDateTime QDateTime::currentDateTimeUtc(void) - ?currentMSecsSinceEpoch@QDateTime@@SA_JXZ @ 4432 NONAME ; long long QDateTime::currentMSecsSinceEpoch(void) - ?detach@QListData@@QAEPAUData@1@H@Z @ 4433 NONAME ; struct QListData::Data * QListData::detach(int) - ?detach_grow@QListData@@QAEPAUData@1@PAHH@Z @ 4434 NONAME ; struct QListData::Data * QListData::detach_grow(int *, int) - ?elapsed@QElapsedTimer@@QBE_JXZ @ 4435 NONAME ; long long QElapsedTimer::elapsed(void) const - ?fromMSecsSinceEpoch@QDateTime@@SA?AV1@_J@Z @ 4436 NONAME ; class QDateTime QDateTime::fromMSecsSinceEpoch(long long) - ?hasExpired@QElapsedTimer@@QBE_N_J@Z @ 4437 NONAME ; bool QElapsedTimer::hasExpired(long long) const - ?invalidate@QElapsedTimer@@QAEXXZ @ 4438 NONAME ; void QElapsedTimer::invalidate(void) - ?isMonotonic@QElapsedTimer@@SA_NXZ @ 4439 NONAME ; bool QElapsedTimer::isMonotonic(void) - ?isSharedWith@QByteArray@@QBE_NABV1@@Z @ 4440 NONAME ; bool QByteArray::isSharedWith(class QByteArray const &) const - ?isSharedWith@QString@@QBE_NABV1@@Z @ 4441 NONAME ; bool QString::isSharedWith(class QString const &) const - ?isValid@QElapsedTimer@@QBE_NXZ @ 4442 NONAME ; bool QElapsedTimer::isValid(void) const - ?makeDecoder@QTextCodec@@QBEPAVQTextDecoder@@V?$QFlags@W4ConversionFlag@QTextCodec@@@@@Z @ 4443 NONAME ; class QTextDecoder * QTextCodec::makeDecoder(class QFlags<enum QTextCodec::ConversionFlag>) const - ?makeEncoder@QTextCodec@@QBEPAVQTextEncoder@@V?$QFlags@W4ConversionFlag@QTextCodec@@@@@Z @ 4444 NONAME ; class QTextEncoder * QTextCodec::makeEncoder(class QFlags<enum QTextCodec::ConversionFlag>) const - ?msecsSinceReference@QElapsedTimer@@QBE_JXZ @ 4445 NONAME ; long long QElapsedTimer::msecsSinceReference(void) const - ?msecsTo@QElapsedTimer@@QBE_JABV1@@Z @ 4446 NONAME ; long long QElapsedTimer::msecsTo(class QElapsedTimer const &) const - ?qDecodeDataUrl@@YA?AU?$QPair@VQString@@VQByteArray@@@@ABVQUrl@@@Z @ 4447 NONAME ; struct QPair<class QString, class QByteArray> qDecodeDataUrl(class QUrl const &) - ?qDetectCPUFeatures@@YAIXZ @ 4448 NONAME ; unsigned int qDetectCPUFeatures(void) + ?validCodecs@QTextCodec@@CA_NXZ @ 4419 NONAME ; bool QTextCodec::validCodecs(void) + ?clearHistory@QStateMachinePrivate@@QAEXXZ @ 4420 NONAME ; void QStateMachinePrivate::clearHistory(void) + ?nativeArguments@QProcess@@QBE?AVQString@@XZ @ 4421 NONAME ; class QString QProcess::nativeArguments(void) const + ?detach@QListData@@QAEPAUData@1@H@Z @ 4422 NONAME ; struct QListData::Data * QListData::detach(int) + ?trUtf8@QEventDispatcherSymbian@@SA?AVQString@@PBD0H@Z @ 4423 NONAME ; class QString QEventDispatcherSymbian::trUtf8(char const *, char const *, int) + ?destroyed@QAbstractDeclarativeData@@2P6AXPAV1@PAVQObject@@@ZA @ 4424 NONAME ; void (*QAbstractDeclarativeData::destroyed)(class QAbstractDeclarativeData *, class QObject *) + ??M@YA_NABVQElapsedTimer@@0@Z @ 4425 NONAME ; bool operator<(class QElapsedTimer const &, class QElapsedTimer const &) + ?clockType@QElapsedTimer@@SA?AW4ClockType@1@XZ @ 4426 NONAME ; enum QElapsedTimer::ClockType QElapsedTimer::clockType(void) + ?isHighSurrogate@QChar@@SA_NI@Z @ 4427 NONAME ; bool QChar::isHighSurrogate(unsigned int) + ?start@QElapsedTimer@@QAEXXZ @ 4428 NONAME ; void QElapsedTimer::start(void) + ??0QVariant@@QAE@ABVQEasingCurve@@@Z @ 4429 NONAME ; QVariant::QVariant(class QEasingCurve const &) + ?isValid@QElapsedTimer@@QBE_NXZ @ 4430 NONAME ; bool QElapsedTimer::isValid(void) const + ?qt_metacast@QEventDispatcherSymbian@@UAEPAXPBD@Z @ 4431 NONAME ; void * QEventDispatcherSymbian::qt_metacast(char const *) + ?toMSecsSinceEpoch@QDateTime@@QBE_JXZ @ 4432 NONAME ; long long QDateTime::toMSecsSinceEpoch(void) const + ?hasExpired@QElapsedTimer@@QBE_N_J@Z @ 4433 NONAME ; bool QElapsedTimer::hasExpired(long long) const + ?makeEncoder@QTextCodec@@QBEPAVQTextEncoder@@V?$QFlags@W4ConversionFlag@QTextCodec@@@@@Z @ 4434 NONAME ; class QTextEncoder * QTextCodec::makeEncoder(class QFlags<enum QTextCodec::ConversionFlag>) const + ??9QElapsedTimer@@QBE_NABV0@@Z @ 4435 NONAME ; bool QElapsedTimer::operator!=(class QElapsedTimer const &) const + ?setRawData@QString@@QAEAAV1@PBVQChar@@H@Z @ 4436 NONAME ; class QString & QString::setRawData(class QChar const *, int) + ?registerTypedef@QMetaType@@SAHPBDH@Z @ 4437 NONAME ; int QMetaType::registerTypedef(char const *, int) + ??8QElapsedTimer@@QBE_NABV0@@Z @ 4438 NONAME ; bool QElapsedTimer::operator==(class QElapsedTimer const &) const + ?makeDecoder@QTextCodec@@QBEPAVQTextDecoder@@V?$QFlags@W4ConversionFlag@QTextCodec@@@@@Z @ 4439 NONAME ; class QTextDecoder * QTextCodec::makeDecoder(class QFlags<enum QTextCodec::ConversionFlag>) const + ?metaObject@QEventDispatcherSymbian@@UBEPBUQMetaObject@@XZ @ 4440 NONAME ; struct QMetaObject const * QEventDispatcherSymbian::metaObject(void) const + ?transitions@QState@@QBE?AV?$QList@PAVQAbstractTransition@@@@XZ @ 4441 NONAME ; class QList<class QAbstractTransition *> QState::transitions(void) const + ?qDetectCPUFeatures@@YAIXZ @ 4442 NONAME ; unsigned int qDetectCPUFeatures(void) + ?isSharedWith@QString@@QBE_NABV1@@Z @ 4443 NONAME ; bool QString::isSharedWith(class QString const &) const + ?parentChanged@QAbstractDeclarativeData@@2P6AXPAV1@PAVQObject@@1@ZA @ 4444 NONAME ; void (*QAbstractDeclarativeData::parentChanged)(class QAbstractDeclarativeData *, class QObject *, class QObject *) + ?currentMSecsSinceEpoch@QDateTime@@SA_JXZ @ 4445 NONAME ; long long QDateTime::currentMSecsSinceEpoch(void) + ?staticMetaObject@QEventDispatcherSymbian@@2UQMetaObject@@B @ 4446 NONAME ; struct QMetaObject const QEventDispatcherSymbian::staticMetaObject + ?msecsTo@QElapsedTimer@@QBE_JABV1@@Z @ 4447 NONAME ; long long QElapsedTimer::msecsTo(class QElapsedTimer const &) const + ?toEasingCurve@QVariant@@QBE?AVQEasingCurve@@XZ @ 4448 NONAME ; class QEasingCurve QVariant::toEasingCurve(void) const ?registerStreamOperators@QMetaType@@SAXHP6AXAAVQDataStream@@PBX@ZP6AX0PAX@Z@Z @ 4449 NONAME ; void QMetaType::registerStreamOperators(int, void (*)(class QDataStream &, void const *), void (*)(class QDataStream &, void *)) - ?registerTypedef@QMetaType@@SAHPBDH@Z @ 4450 NONAME ; int QMetaType::registerTypedef(char const *, int) - ?replace@QByteArray@@QAEAAV1@HHPBDH@Z @ 4451 NONAME ; class QByteArray & QByteArray::replace(int, int, char const *, int) - ?restart@QElapsedTimer@@QAE_JXZ @ 4452 NONAME ; long long QElapsedTimer::restart(void) - ?secsTo@QElapsedTimer@@QBE_JABV1@@Z @ 4453 NONAME ; long long QElapsedTimer::secsTo(class QElapsedTimer const &) const - ?setMSecsSinceEpoch@QDateTime@@QAEX_J@Z @ 4454 NONAME ; void QDateTime::setMSecsSinceEpoch(long long) - ?start@QElapsedTimer@@QAEXXZ @ 4455 NONAME ; void QElapsedTimer::start(void) - ?toEasingCurve@QVariant@@QBE?AVQEasingCurve@@XZ @ 4456 NONAME ; class QEasingCurve QVariant::toEasingCurve(void) const - ?toMSecsSinceEpoch@QDateTime@@QBE_JXZ @ 4457 NONAME ; long long QDateTime::toMSecsSinceEpoch(void) const - ?transitions@QState@@QBE?AV?$QList@PAVQAbstractTransition@@@@XZ @ 4458 NONAME ; class QList<class QAbstractTransition *> QState::transitions(void) const - ?validCodecs@QTextCodec@@CA_NXZ @ 4459 NONAME ; bool QTextCodec::validCodecs(void) - ?destroyed@QDeclarativeData@@2P6AXPAV1@PAVQObject@@@ZA @ 4460 NONAME ABSENT ; void (*QDeclarativeData::destroyed)(class QDeclarativeData *, class QObject *) - ?parentChanged@QDeclarativeData@@2P6AXPAV1@PAVQObject@@1@ZA @ 4461 NONAME ABSENT ; void (*QDeclarativeData::parentChanged)(class QDeclarativeData *, class QObject *, class QObject *) - ?parentChanged@QAbstractDeclarativeData@@2P6AXPAV1@PAVQObject@@1@ZA @ 4462 NONAME ; void (*QAbstractDeclarativeData::parentChanged)(class QAbstractDeclarativeData *, class QObject *, class QObject *) - ?destroyed@QAbstractDeclarativeData@@2P6AXPAV1@PAVQObject@@@ZA @ 4463 NONAME ; void (*QAbstractDeclarativeData::destroyed)(class QAbstractDeclarativeData *, class QObject *) - ?selectThread@QEventDispatcherSymbian@@AAEAAVQSelectThread@@XZ @ 4464 NONAME ; class QSelectThread & QEventDispatcherSymbian::selectThread(void) - ?setRawData@QByteArray@@QAEAAV1@PBDI@Z @ 4465 NONAME ; class QByteArray & QByteArray::setRawData(char const *, unsigned int) - ?setRawData@QString@@QAEAAV1@PBVQChar@@H@Z @ 4466 NONAME ; class QString & QString::setRawData(class QChar const *, int) - ?getStaticMetaObject@QEventDispatcherSymbian@@SAABUQMetaObject@@XZ @ 4467 NONAME ; struct QMetaObject const & QEventDispatcherSymbian::getStaticMetaObject(void) - ?isHighSurrogate@QChar@@SA_NI@Z @ 4468 NONAME ; bool QChar::isHighSurrogate(unsigned int) - ?isLowSurrogate@QChar@@SA_NI@Z @ 4469 NONAME ; bool QChar::isLowSurrogate(unsigned int) - ?metaObject@QEventDispatcherSymbian@@UBEPBUQMetaObject@@XZ @ 4470 NONAME ; struct QMetaObject const * QEventDispatcherSymbian::metaObject(void) const - ?msecsTo@QDateTime@@QBE_JABV1@@Z @ 4471 NONAME ; long long QDateTime::msecsTo(class QDateTime const &) const - ?qt_metacall@QEventDispatcherSymbian@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 4472 NONAME ; int QEventDispatcherSymbian::qt_metacall(enum QMetaObject::Call, int, void * *) - ?qt_metacast@QEventDispatcherSymbian@@UAEPAXPBD@Z @ 4473 NONAME ; void * QEventDispatcherSymbian::qt_metacast(char const *) - ?requiresSurrogates@QChar@@SA_NI@Z @ 4474 NONAME ; bool QChar::requiresSurrogates(unsigned int) - ?symbianInit@QCoreApplicationPrivate@@QAEXXZ @ 4475 NONAME ; void QCoreApplicationPrivate::symbianInit(void) - ?tr@QEventDispatcherSymbian@@SA?AVQString@@PBD0@Z @ 4476 NONAME ; class QString QEventDispatcherSymbian::tr(char const *, char const *) - ?tr@QEventDispatcherSymbian@@SA?AVQString@@PBD0H@Z @ 4477 NONAME ; class QString QEventDispatcherSymbian::tr(char const *, char const *, int) - ?trUtf8@QEventDispatcherSymbian@@SA?AVQString@@PBD0@Z @ 4478 NONAME ; class QString QEventDispatcherSymbian::trUtf8(char const *, char const *) - ?trUtf8@QEventDispatcherSymbian@@SA?AVQString@@PBD0H@Z @ 4479 NONAME ; class QString QEventDispatcherSymbian::trUtf8(char const *, char const *, int) - ?staticMetaObject@QEventDispatcherSymbian@@2UQMetaObject@@B @ 4480 NONAME ; struct QMetaObject const QEventDispatcherSymbian::staticMetaObject + ?replace@QByteArray@@QAEAAV1@HHPBDH@Z @ 4450 NONAME ; class QByteArray & QByteArray::replace(int, int, char const *, int) + ?elapsed@QElapsedTimer@@QBE_JXZ @ 4451 NONAME ; long long QElapsedTimer::elapsed(void) const + ??0QTextEncoder@@QAE@PBVQTextCodec@@V?$QFlags@W4ConversionFlag@QTextCodec@@@@@Z @ 4452 NONAME ; QTextEncoder::QTextEncoder(class QTextCodec const *, class QFlags<enum QTextCodec::ConversionFlag>) + ??6@YAAAVQDataStream@@AAV0@ABVQEasingCurve@@@Z @ 4453 NONAME ; class QDataStream & operator<<(class QDataStream &, class QEasingCurve const &) + ?qDecodeDataUrl@@YA?AU?$QPair@VQString@@VQByteArray@@@@ABVQUrl@@@Z @ 4454 NONAME ; struct QPair<class QString, class QByteArray> qDecodeDataUrl(class QUrl const &) + ?trUtf8@QEventDispatcherSymbian@@SA?AVQString@@PBD0@Z @ 4455 NONAME ; class QString QEventDispatcherSymbian::trUtf8(char const *, char const *) + ?setNativeArguments@QProcess@@QAEXABVQString@@@Z @ 4456 NONAME ; void QProcess::setNativeArguments(class QString const &) + ?msecsTo@QDateTime@@QBE_JABV1@@Z @ 4457 NONAME ; long long QDateTime::msecsTo(class QDateTime const &) const + ?tr@QEventDispatcherSymbian@@SA?AVQString@@PBD0H@Z @ 4458 NONAME ; class QString QEventDispatcherSymbian::tr(char const *, char const *, int) + ?setMSecsSinceEpoch@QDateTime@@QAEX_J@Z @ 4459 NONAME ; void QDateTime::setMSecsSinceEpoch(long long) + ?tr@QEventDispatcherSymbian@@SA?AVQString@@PBD0@Z @ 4460 NONAME ; class QString QEventDispatcherSymbian::tr(char const *, char const *) + ?isSharedWith@QByteArray@@QBE_NABV1@@Z @ 4461 NONAME ; bool QByteArray::isSharedWith(class QByteArray const &) const + ?secsTo@QElapsedTimer@@QBE_JABV1@@Z @ 4462 NONAME ; long long QElapsedTimer::secsTo(class QElapsedTimer const &) const + ??5@YAAAVQDataStream@@AAV0@AAVQEasingCurve@@@Z @ 4463 NONAME ; class QDataStream & operator>>(class QDataStream &, class QEasingCurve &) + ??0QString@@QAE@PBVQChar@@@Z @ 4464 NONAME ; QString::QString(class QChar const *) + ?append@QListData@@QAEPAPAXH@Z @ 4465 NONAME ; void * * QListData::append(int) + ?getStaticMetaObject@QEventDispatcherSymbian@@SAABUQMetaObject@@XZ @ 4466 NONAME ; struct QMetaObject const & QEventDispatcherSymbian::getStaticMetaObject(void) + ?peek@QIODevicePrivate@@UAE?AVQByteArray@@_J@Z @ 4467 NONAME ; class QByteArray QIODevicePrivate::peek(long long) + ?detach_grow@QListData@@QAEPAUData@1@PAHH@Z @ 4468 NONAME ; struct QListData::Data * QListData::detach_grow(int *, int) + ?symbianInit@QCoreApplicationPrivate@@QAEXXZ @ 4469 NONAME ; void QCoreApplicationPrivate::symbianInit(void) + ??0QTextDecoder@@QAE@PBVQTextCodec@@V?$QFlags@W4ConversionFlag@QTextCodec@@@@@Z @ 4470 NONAME ; QTextDecoder::QTextDecoder(class QTextCodec const *, class QFlags<enum QTextCodec::ConversionFlag>) + ?requiresSurrogates@QChar@@SA_NI@Z @ 4471 NONAME ; bool QChar::requiresSurrogates(unsigned int) + ?isLowSurrogate@QChar@@SA_NI@Z @ 4472 NONAME ; bool QChar::isLowSurrogate(unsigned int) + ?qt_metacall@QEventDispatcherSymbian@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 4473 NONAME ; int QEventDispatcherSymbian::qt_metacall(enum QMetaObject::Call, int, void * *) + ?setRawData@QByteArray@@QAEAAV1@PBDI@Z @ 4474 NONAME ; class QByteArray & QByteArray::setRawData(char const *, unsigned int) + ?fromMSecsSinceEpoch@QDateTime@@SA?AV1@_J@Z @ 4475 NONAME ; class QDateTime QDateTime::fromMSecsSinceEpoch(long long) + ?invalidate@QElapsedTimer@@QAEXXZ @ 4476 NONAME ; void QElapsedTimer::invalidate(void) + ?restart@QElapsedTimer@@QAE_JXZ @ 4477 NONAME ; long long QElapsedTimer::restart(void) + ?currentDateTimeUtc@QDateTime@@SA?AV1@XZ @ 4478 NONAME ; class QDateTime QDateTime::currentDateTimeUtc(void) + ?isMonotonic@QElapsedTimer@@SA_NXZ @ 4479 NONAME ; bool QElapsedTimer::isMonotonic(void) + ?peek@QIODevicePrivate@@UAE_JPAD_J@Z @ 4480 NONAME ; long long QIODevicePrivate::peek(char *, long long) ?textDirection@QLocale@@QBE?AW4LayoutDirection@Qt@@XZ @ 4481 NONAME ; enum Qt::LayoutDirection QLocale::textDirection(void) const - ?peek@QIODevicePrivate@@UAE_JPAD_J@Z @ 4482 NONAME ; long long QIODevicePrivate::peek(char *, long long) - ?peek@QIODevicePrivate@@UAE?AVQByteArray@@_J@Z @ 4483 NONAME ; class QByteArray QIODevicePrivate::peek(long long) - ?nativeArguments@QProcess@@QBE?AVQString@@XZ @ 4484 NONAME ; class QString QProcess::nativeArguments(void) const - ?setNativeArguments@QProcess@@QAEXABVQString@@@Z @ 4485 NONAME ; void QProcess::setNativeArguments(class QString const &) + ?msecsSinceReference@QElapsedTimer@@QBE_JXZ @ 4482 NONAME ; long long QElapsedTimer::msecsSinceReference(void) const + ?selectThread@QEventDispatcherSymbian@@AAEAAVQSelectThread@@XZ @ 4483 NONAME ; class QSelectThread & QEventDispatcherSymbian::selectThread(void) diff --git a/src/s60installs/bwins/QtGuiu.def b/src/s60installs/bwins/QtGuiu.def index b06cbba..90c0878 100644 --- a/src/s60installs/bwins/QtGuiu.def +++ b/src/s60installs/bwins/QtGuiu.def @@ -12372,7 +12372,7 @@ EXPORTS ?staticMetaObject@QBoxLayout@@2UQMetaObject@@B @ 12371 NONAME ; struct QMetaObject const QBoxLayout::staticMetaObject ?qt_tab_all_widgets@@3_NA @ 12372 NONAME ; bool qt_tab_all_widgets ?staticMetaObject@QSpinBox@@2UQMetaObject@@B @ 12373 NONAME ; struct QMetaObject const QSpinBox::staticMetaObject - ?scanCodeCache@QApplicationPrivate@@0V?$QHash@HI@@A @ 12374 NONAME ; class QHash<int, unsigned int> QApplicationPrivate::scanCodeCache + ?scanCodeCache@QApplicationPrivate@@0V?$QHash@HI@@A @ 12374 NONAME ABSENT ; class QHash<int, unsigned int> QApplicationPrivate::scanCodeCache ?staticMetaObject@QItemSelectionModel@@2UQMetaObject@@B @ 12375 NONAME ; struct QMetaObject const QItemSelectionModel::staticMetaObject ?staticMetaObject@QItemDelegate@@2UQMetaObject@@B @ 12376 NONAME ; struct QMetaObject const QItemDelegate::staticMetaObject ?staticMetaObject@QPushButton@@2UQMetaObject@@B @ 12377 NONAME ; struct QMetaObject const QPushButton::staticMetaObject @@ -12832,7 +12832,7 @@ EXPORTS ?readBackInfo@QRuntimePixmapData@@QAEXXZ @ 12831 NONAME ; void QRuntimePixmapData::readBackInfo(void) ??_EQRuntimePixmapData@@UAE@I@Z @ 12832 NONAME ; QRuntimePixmapData::~QRuntimePixmapData(unsigned int) ?paintEngine@QRuntimePixmapData@@UBEPAVQPaintEngine@@XZ @ 12833 NONAME ; class QPaintEngine * QRuntimePixmapData::paintEngine(void) const - ?memoryUsage@QRuntimePixmapData@@UBEIXZ @ 12834 NONAME ; unsigned int QRuntimePixmapData::memoryUsage(void) const + ?memoryUsage@QRuntimePixmapData@@UBEIXZ @ 12834 NONAME ABSENT ; unsigned int QRuntimePixmapData::memoryUsage(void) const ?toImage@QRasterPixmapData@@UBE?AVQImage@@ABVQRect@@@Z @ 12835 NONAME ; class QImage QRasterPixmapData::toImage(class QRect const &) const ?fromImageReader@QRasterPixmapData@@UAEXPAVQImageReader@@V?$QFlags@W4ImageConversionFlag@Qt@@@@@Z @ 12836 NONAME ; void QRasterPixmapData::fromImageReader(class QImageReader *, class QFlags<enum Qt::ImageConversionFlag>) ?fill@QRuntimePixmapData@@UAEXABVQColor@@@Z @ 12837 NONAME ; void QRuntimePixmapData::fill(class QColor const &) @@ -12883,4 +12883,7 @@ EXPORTS ?focusScopeItemChange@QGraphicsItemPrivate@@UAEX_N@Z @ 12882 NONAME ; void QGraphicsItemPrivate::focusScopeItemChange(bool) ?setTimeout@QTapAndHoldGesture@@SAXH@Z @ 12883 NONAME ; void QTapAndHoldGesture::setTimeout(int) ?childrenBoundingRectHelper@QGraphicsItemPrivate@@QAEXPAVQTransform@@PAVQRectF@@_N@Z @ 12884 NONAME ; void QGraphicsItemPrivate::childrenBoundingRectHelper(class QTransform *, class QRectF *, bool) + ?zScaleChanged@QGraphicsScale@@IAEXXZ @ 12885 NONAME ; void QGraphicsScale::zScaleChanged(void) + ?xScaleChanged@QGraphicsScale@@IAEXXZ @ 12886 NONAME ; void QGraphicsScale::xScaleChanged(void) + ?yScaleChanged@QGraphicsScale@@IAEXXZ @ 12887 NONAME ; void QGraphicsScale::yScaleChanged(void) diff --git a/src/s60installs/bwins/QtNetworku.def b/src/s60installs/bwins/QtNetworku.def index 9911b36..2cf62a8 100644 --- a/src/s60installs/bwins/QtNetworku.def +++ b/src/s60installs/bwins/QtNetworku.def @@ -962,189 +962,187 @@ EXPORTS ?staticMetaObject@QTcpServer@@2UQMetaObject@@B @ 961 NONAME ; struct QMetaObject const QTcpServer::staticMetaObject ?staticMetaObject@QUdpSocket@@2UQMetaObject@@B @ 962 NONAME ; struct QMetaObject const QUdpSocket::staticMetaObject ?staticMetaObject@QAbstractSocket@@2UQMetaObject@@B @ 963 NONAME ; struct QMetaObject const QAbstractSocket::staticMetaObject - ??0QBearerEngine@@QAE@PAVQObject@@@Z @ 964 NONAME ; QBearerEngine::QBearerEngine(class QObject *) - ??0QBearerEnginePlugin@@QAE@PAVQObject@@@Z @ 965 NONAME ; QBearerEnginePlugin::QBearerEnginePlugin(class QObject *) - ??0QNetworkConfiguration@@QAE@ABV0@@Z @ 966 NONAME ; QNetworkConfiguration::QNetworkConfiguration(class QNetworkConfiguration const &) - ??0QNetworkConfiguration@@QAE@XZ @ 967 NONAME ; QNetworkConfiguration::QNetworkConfiguration(void) - ??0QNetworkConfigurationManager@@QAE@PAVQObject@@@Z @ 968 NONAME ; QNetworkConfigurationManager::QNetworkConfigurationManager(class QObject *) - ??0QNetworkConfigurationManagerPrivate@@QAE@XZ @ 969 NONAME ; QNetworkConfigurationManagerPrivate::QNetworkConfigurationManagerPrivate(void) - ??0QNetworkSession@@QAE@ABVQNetworkConfiguration@@PAVQObject@@@Z @ 970 NONAME ; QNetworkSession::QNetworkSession(class QNetworkConfiguration const &, class QObject *) - ??0QNetworkSessionPrivate@@QAE@XZ @ 971 NONAME ; QNetworkSessionPrivate::QNetworkSessionPrivate(void) - ??1QBearerEngine@@UAE@XZ @ 972 NONAME ; QBearerEngine::~QBearerEngine(void) - ??1QBearerEngineFactoryInterface@@UAE@XZ @ 973 NONAME ; QBearerEngineFactoryInterface::~QBearerEngineFactoryInterface(void) - ??1QBearerEnginePlugin@@UAE@XZ @ 974 NONAME ; QBearerEnginePlugin::~QBearerEnginePlugin(void) - ??1QNetworkConfiguration@@QAE@XZ @ 975 NONAME ; QNetworkConfiguration::~QNetworkConfiguration(void) - ??1QNetworkConfigurationManager@@UAE@XZ @ 976 NONAME ; QNetworkConfigurationManager::~QNetworkConfigurationManager(void) - ??1QNetworkConfigurationManagerPrivate@@UAE@XZ @ 977 NONAME ; QNetworkConfigurationManagerPrivate::~QNetworkConfigurationManagerPrivate(void) - ??1QNetworkSession@@UAE@XZ @ 978 NONAME ; QNetworkSession::~QNetworkSession(void) - ??1QNetworkSessionPrivate@@UAE@XZ @ 979 NONAME ; QNetworkSessionPrivate::~QNetworkSessionPrivate(void) - ??4QNetworkConfiguration@@QAEAAV0@ABV0@@Z @ 980 NONAME ; class QNetworkConfiguration & QNetworkConfiguration::operator=(class QNetworkConfiguration const &) - ??8QNetworkConfiguration@@QBE_NABV0@@Z @ 981 NONAME ; bool QNetworkConfiguration::operator==(class QNetworkConfiguration const &) const - ??9QNetworkConfiguration@@QBE_NABV0@@Z @ 982 NONAME ; bool QNetworkConfiguration::operator!=(class QNetworkConfiguration const &) const - ??_EQBearerEngine@@UAE@I@Z @ 983 NONAME ; QBearerEngine::~QBearerEngine(unsigned int) - ??_EQBearerEngineFactoryInterface@@UAE@I@Z @ 984 NONAME ; QBearerEngineFactoryInterface::~QBearerEngineFactoryInterface(unsigned int) - ??_EQBearerEnginePlugin@@UAE@I@Z @ 985 NONAME ; QBearerEnginePlugin::~QBearerEnginePlugin(unsigned int) - ??_EQNetworkConfigurationManager@@UAE@I@Z @ 986 NONAME ; QNetworkConfigurationManager::~QNetworkConfigurationManager(unsigned int) - ??_EQNetworkConfigurationManagerPrivate@@UAE@I@Z @ 987 NONAME ; QNetworkConfigurationManagerPrivate::~QNetworkConfigurationManagerPrivate(unsigned int) - ??_EQNetworkSession@@UAE@I@Z @ 988 NONAME ; QNetworkSession::~QNetworkSession(unsigned int) - ??_EQNetworkSessionPrivate@@UAE@I@Z @ 989 NONAME ; QNetworkSessionPrivate::~QNetworkSessionPrivate(unsigned int) - ?abort@QNetworkConfigurationManagerPrivate@@IAEXXZ @ 990 NONAME ; void QNetworkConfigurationManagerPrivate::abort(void) - ?accept@QNetworkSession@@QAEXXZ @ 991 NONAME ; void QNetworkSession::accept(void) - ?activeConfiguration@QNetworkAccessManager@@QBE?AVQNetworkConfiguration@@XZ @ 992 NONAME ; class QNetworkConfiguration QNetworkAccessManager::activeConfiguration(void) const - ?activeTime@QNetworkSession@@QBE_KXZ @ 993 NONAME ; unsigned long long QNetworkSession::activeTime(void) const - ?allConfigurations@QNetworkConfigurationManager@@QBE?AV?$QList@VQNetworkConfiguration@@@@V?$QFlags@W4StateFlag@QNetworkConfiguration@@@@@Z @ 994 NONAME ; class QList<class QNetworkConfiguration> QNetworkConfigurationManager::allConfigurations(class QFlags<enum QNetworkConfiguration::StateFlag>) const - ?bearerName@QNetworkConfiguration@@QBE?AVQString@@XZ @ 995 NONAME ; class QString QNetworkConfiguration::bearerName(void) const - ?bytesReceived@QNetworkSession@@QBE_KXZ @ 996 NONAME ; unsigned long long QNetworkSession::bytesReceived(void) const - ?bytesWritten@QNetworkSession@@QBE_KXZ @ 997 NONAME ; unsigned long long QNetworkSession::bytesWritten(void) const - ?capabilities@QNetworkConfigurationManager@@QBE?AV?$QFlags@W4Capability@QNetworkConfigurationManager@@@@XZ @ 998 NONAME ; class QFlags<enum QNetworkConfigurationManager::Capability> QNetworkConfigurationManager::capabilities(void) const - ?children@QNetworkConfiguration@@QBE?AV?$QList@VQNetworkConfiguration@@@@XZ @ 999 NONAME ; class QList<class QNetworkConfiguration> QNetworkConfiguration::children(void) const - ?close@QNetworkSession@@QAEXXZ @ 1000 NONAME ; void QNetworkSession::close(void) - ?closed@QNetworkSession@@IAEXXZ @ 1001 NONAME ; void QNetworkSession::closed(void) - ?closed@QNetworkSessionPrivate@@IAEXXZ @ 1002 NONAME ; void QNetworkSessionPrivate::closed(void) - ?configuration@QNetworkAccessManager@@QBE?AVQNetworkConfiguration@@XZ @ 1003 NONAME ; class QNetworkConfiguration QNetworkAccessManager::configuration(void) const - ?configuration@QNetworkSession@@QBE?AVQNetworkConfiguration@@XZ @ 1004 NONAME ; class QNetworkConfiguration QNetworkSession::configuration(void) const - ?configurationAdded@QBearerEngine@@IAEXV?$QExplicitlySharedDataPointer@VQNetworkConfigurationPrivate@@@@@Z @ 1005 NONAME ; void QBearerEngine::configurationAdded(class QExplicitlySharedDataPointer<class QNetworkConfigurationPrivate>) - ?configurationAdded@QNetworkConfigurationManager@@IAEXABVQNetworkConfiguration@@@Z @ 1006 NONAME ; void QNetworkConfigurationManager::configurationAdded(class QNetworkConfiguration const &) - ?configurationAdded@QNetworkConfigurationManagerPrivate@@AAEXV?$QExplicitlySharedDataPointer@VQNetworkConfigurationPrivate@@@@@Z @ 1007 NONAME ; void QNetworkConfigurationManagerPrivate::configurationAdded(class QExplicitlySharedDataPointer<class QNetworkConfigurationPrivate>) - ?configurationAdded@QNetworkConfigurationManagerPrivate@@IAEXABVQNetworkConfiguration@@@Z @ 1008 NONAME ; void QNetworkConfigurationManagerPrivate::configurationAdded(class QNetworkConfiguration const &) - ?configurationChanged@QBearerEngine@@IAEXV?$QExplicitlySharedDataPointer@VQNetworkConfigurationPrivate@@@@@Z @ 1009 NONAME ; void QBearerEngine::configurationChanged(class QExplicitlySharedDataPointer<class QNetworkConfigurationPrivate>) - ?configurationChanged@QNetworkConfigurationManager@@IAEXABVQNetworkConfiguration@@@Z @ 1010 NONAME ; void QNetworkConfigurationManager::configurationChanged(class QNetworkConfiguration const &) - ?configurationChanged@QNetworkConfigurationManagerPrivate@@AAEXV?$QExplicitlySharedDataPointer@VQNetworkConfigurationPrivate@@@@@Z @ 1011 NONAME ; void QNetworkConfigurationManagerPrivate::configurationChanged(class QExplicitlySharedDataPointer<class QNetworkConfigurationPrivate>) - ?configurationChanged@QNetworkConfigurationManagerPrivate@@IAEXABVQNetworkConfiguration@@@Z @ 1012 NONAME ; void QNetworkConfigurationManagerPrivate::configurationChanged(class QNetworkConfiguration const &) - ?configurationFromIdentifier@QNetworkConfigurationManager@@QBE?AVQNetworkConfiguration@@ABVQString@@@Z @ 1013 NONAME ; class QNetworkConfiguration QNetworkConfigurationManager::configurationFromIdentifier(class QString const &) const - ?configurationRemoved@QBearerEngine@@IAEXV?$QExplicitlySharedDataPointer@VQNetworkConfigurationPrivate@@@@@Z @ 1014 NONAME ; void QBearerEngine::configurationRemoved(class QExplicitlySharedDataPointer<class QNetworkConfigurationPrivate>) - ?configurationRemoved@QNetworkConfigurationManager@@IAEXABVQNetworkConfiguration@@@Z @ 1015 NONAME ; void QNetworkConfigurationManager::configurationRemoved(class QNetworkConfiguration const &) - ?configurationRemoved@QNetworkConfigurationManagerPrivate@@AAEXV?$QExplicitlySharedDataPointer@VQNetworkConfigurationPrivate@@@@@Z @ 1016 NONAME ; void QNetworkConfigurationManagerPrivate::configurationRemoved(class QExplicitlySharedDataPointer<class QNetworkConfigurationPrivate>) - ?configurationRemoved@QNetworkConfigurationManagerPrivate@@IAEXABVQNetworkConfiguration@@@Z @ 1017 NONAME ; void QNetworkConfigurationManagerPrivate::configurationRemoved(class QNetworkConfiguration const &) - ?configurationUpdateComplete@QNetworkConfigurationManagerPrivate@@IAEXXZ @ 1018 NONAME ; void QNetworkConfigurationManagerPrivate::configurationUpdateComplete(void) - ?connectNotify@QNetworkSession@@MAEXPBD@Z @ 1019 NONAME ; void QNetworkSession::connectNotify(char const *) - ?defaultConfiguration@QNetworkConfigurationManager@@QBE?AVQNetworkConfiguration@@XZ @ 1020 NONAME ; class QNetworkConfiguration QNetworkConfigurationManager::defaultConfiguration(void) const - ?disconnectNotify@QNetworkSession@@MAEXPBD@Z @ 1021 NONAME ; void QNetworkSession::disconnectNotify(char const *) - ?engines@QNetworkConfigurationManagerPrivate@@QAE?AV?$QList@PAVQBearerEngine@@@@XZ @ 1022 NONAME ; class QList<class QBearerEngine *> QNetworkConfigurationManagerPrivate::engines(void) - ?error@QNetworkSession@@IAEXW4SessionError@1@@Z @ 1023 NONAME ; void QNetworkSession::error(enum QNetworkSession::SessionError) - ?error@QNetworkSession@@QBE?AW4SessionError@1@XZ @ 1024 NONAME ; enum QNetworkSession::SessionError QNetworkSession::error(void) const - ?error@QNetworkSessionPrivate@@IAEXW4SessionError@QNetworkSession@@@Z @ 1025 NONAME ; void QNetworkSessionPrivate::error(enum QNetworkSession::SessionError) - ?errorString@QNetworkSession@@QBE?AVQString@@XZ @ 1026 NONAME ; class QString QNetworkSession::errorString(void) const - ?getStaticMetaObject@QBearerEngine@@SAABUQMetaObject@@XZ @ 1027 NONAME ; struct QMetaObject const & QBearerEngine::getStaticMetaObject(void) - ?getStaticMetaObject@QBearerEnginePlugin@@SAABUQMetaObject@@XZ @ 1028 NONAME ; struct QMetaObject const & QBearerEnginePlugin::getStaticMetaObject(void) - ?getStaticMetaObject@QNetworkConfigurationManager@@SAABUQMetaObject@@XZ @ 1029 NONAME ; struct QMetaObject const & QNetworkConfigurationManager::getStaticMetaObject(void) - ?getStaticMetaObject@QNetworkConfigurationManagerPrivate@@SAABUQMetaObject@@XZ @ 1030 NONAME ; struct QMetaObject const & QNetworkConfigurationManagerPrivate::getStaticMetaObject(void) - ?getStaticMetaObject@QNetworkSession@@SAABUQMetaObject@@XZ @ 1031 NONAME ; struct QMetaObject const & QNetworkSession::getStaticMetaObject(void) - ?getStaticMetaObject@QNetworkSessionPrivate@@SAABUQMetaObject@@XZ @ 1032 NONAME ; struct QMetaObject const & QNetworkSessionPrivate::getStaticMetaObject(void) - ?identifier@QNetworkConfiguration@@QBE?AVQString@@XZ @ 1033 NONAME ; class QString QNetworkConfiguration::identifier(void) const - ?ignore@QNetworkSession@@QAEXXZ @ 1034 NONAME ; void QNetworkSession::ignore(void) - ?interface@QNetworkSession@@QBE?AVQNetworkInterface@@XZ @ 1035 NONAME ; class QNetworkInterface QNetworkSession::interface(void) const - ?isOnline@QNetworkConfigurationManager@@QBE_NXZ @ 1036 NONAME ; bool QNetworkConfigurationManager::isOnline(void) const - ?isOpen@QNetworkSession@@QBE_NXZ @ 1037 NONAME ; bool QNetworkSession::isOpen(void) const - ?isRoamingAvailable@QNetworkConfiguration@@QBE_NXZ @ 1038 NONAME ; bool QNetworkConfiguration::isRoamingAvailable(void) const - ?isValid@QNetworkConfiguration@@QBE_NXZ @ 1039 NONAME ; bool QNetworkConfiguration::isValid(void) const - ?metaObject@QBearerEngine@@UBEPBUQMetaObject@@XZ @ 1040 NONAME ; struct QMetaObject const * QBearerEngine::metaObject(void) const - ?metaObject@QBearerEnginePlugin@@UBEPBUQMetaObject@@XZ @ 1041 NONAME ; struct QMetaObject const * QBearerEnginePlugin::metaObject(void) const - ?metaObject@QNetworkConfigurationManager@@UBEPBUQMetaObject@@XZ @ 1042 NONAME ; struct QMetaObject const * QNetworkConfigurationManager::metaObject(void) const - ?metaObject@QNetworkConfigurationManagerPrivate@@UBEPBUQMetaObject@@XZ @ 1043 NONAME ; struct QMetaObject const * QNetworkConfigurationManagerPrivate::metaObject(void) const - ?metaObject@QNetworkSession@@UBEPBUQMetaObject@@XZ @ 1044 NONAME ; struct QMetaObject const * QNetworkSession::metaObject(void) const - ?metaObject@QNetworkSessionPrivate@@UBEPBUQMetaObject@@XZ @ 1045 NONAME ; struct QMetaObject const * QNetworkSessionPrivate::metaObject(void) const - ?migrate@QNetworkSession@@QAEXXZ @ 1046 NONAME ; void QNetworkSession::migrate(void) - ?name@QNetworkConfiguration@@QBE?AVQString@@XZ @ 1047 NONAME ; class QString QNetworkConfiguration::name(void) const - ?networkAccessChanged@QNetworkAccessManager@@IAEX_N@Z @ 1048 NONAME ABSENT ; void QNetworkAccessManager::networkAccessChanged(bool) - ?networkAccessEnabled@QNetworkAccessManager@@QBE_NXZ @ 1049 NONAME ABSENT ; bool QNetworkAccessManager::networkAccessEnabled(void) const - ?networkSessionOnline@QNetworkAccessManager@@IAEXXZ @ 1050 NONAME ABSENT ; void QNetworkAccessManager::networkSessionOnline(void) - ?newConfigurationActivated@QNetworkSession@@IAEXXZ @ 1051 NONAME ; void QNetworkSession::newConfigurationActivated(void) - ?newConfigurationActivated@QNetworkSessionPrivate@@IAEXXZ @ 1052 NONAME ; void QNetworkSessionPrivate::newConfigurationActivated(void) - ?onlineStateChanged@QNetworkConfigurationManager@@IAEX_N@Z @ 1053 NONAME ; void QNetworkConfigurationManager::onlineStateChanged(bool) - ?onlineStateChanged@QNetworkConfigurationManagerPrivate@@IAEX_N@Z @ 1054 NONAME ; void QNetworkConfigurationManagerPrivate::onlineStateChanged(bool) - ?open@QNetworkSession@@QAEXXZ @ 1055 NONAME ; void QNetworkSession::open(void) - ?opened@QNetworkSession@@IAEXXZ @ 1056 NONAME ; void QNetworkSession::opened(void) - ?performAsyncConfigurationUpdate@QNetworkConfigurationManagerPrivate@@QAEXXZ @ 1057 NONAME ; void QNetworkConfigurationManagerPrivate::performAsyncConfigurationUpdate(void) - ?preferredConfigurationChanged@QNetworkSession@@IAEXABVQNetworkConfiguration@@_N@Z @ 1058 NONAME ; void QNetworkSession::preferredConfigurationChanged(class QNetworkConfiguration const &, bool) - ?preferredConfigurationChanged@QNetworkSessionPrivate@@IAEXABVQNetworkConfiguration@@_N@Z @ 1059 NONAME ; void QNetworkSessionPrivate::preferredConfigurationChanged(class QNetworkConfiguration const &, bool) - ?priority@QNetworkRequest@@QBE?AW4Priority@1@XZ @ 1060 NONAME ; enum QNetworkRequest::Priority QNetworkRequest::priority(void) const - ?privateConfiguration@QNetworkSessionPrivate@@IBE?AV?$QExplicitlySharedDataPointer@VQNetworkConfigurationPrivate@@@@ABVQNetworkConfiguration@@@Z @ 1061 NONAME ; class QExplicitlySharedDataPointer<class QNetworkConfigurationPrivate> QNetworkSessionPrivate::privateConfiguration(class QNetworkConfiguration const &) const - ?purpose@QNetworkConfiguration@@QBE?AW4Purpose@1@XZ @ 1062 NONAME ; enum QNetworkConfiguration::Purpose QNetworkConfiguration::purpose(void) const - ?qNetworkConfigurationManagerPrivate@@YAPAVQNetworkConfigurationManagerPrivate@@XZ @ 1063 NONAME ; class QNetworkConfigurationManagerPrivate * qNetworkConfigurationManagerPrivate(void) - ?qt_metacall@QBearerEngine@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 1064 NONAME ; int QBearerEngine::qt_metacall(enum QMetaObject::Call, int, void * *) - ?qt_metacall@QBearerEnginePlugin@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 1065 NONAME ; int QBearerEnginePlugin::qt_metacall(enum QMetaObject::Call, int, void * *) - ?qt_metacall@QNetworkConfigurationManager@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 1066 NONAME ; int QNetworkConfigurationManager::qt_metacall(enum QMetaObject::Call, int, void * *) - ?qt_metacall@QNetworkConfigurationManagerPrivate@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 1067 NONAME ; int QNetworkConfigurationManagerPrivate::qt_metacall(enum QMetaObject::Call, int, void * *) - ?qt_metacall@QNetworkSession@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 1068 NONAME ; int QNetworkSession::qt_metacall(enum QMetaObject::Call, int, void * *) - ?qt_metacall@QNetworkSessionPrivate@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 1069 NONAME ; int QNetworkSessionPrivate::qt_metacall(enum QMetaObject::Call, int, void * *) - ?qt_metacast@QBearerEngine@@UAEPAXPBD@Z @ 1070 NONAME ; void * QBearerEngine::qt_metacast(char const *) - ?qt_metacast@QBearerEnginePlugin@@UAEPAXPBD@Z @ 1071 NONAME ; void * QBearerEnginePlugin::qt_metacast(char const *) - ?qt_metacast@QNetworkConfigurationManager@@UAEPAXPBD@Z @ 1072 NONAME ; void * QNetworkConfigurationManager::qt_metacast(char const *) - ?qt_metacast@QNetworkConfigurationManagerPrivate@@UAEPAXPBD@Z @ 1073 NONAME ; void * QNetworkConfigurationManagerPrivate::qt_metacast(char const *) - ?qt_metacast@QNetworkSession@@UAEPAXPBD@Z @ 1074 NONAME ; void * QNetworkSession::qt_metacast(char const *) - ?qt_metacast@QNetworkSessionPrivate@@UAEPAXPBD@Z @ 1075 NONAME ; void * QNetworkSessionPrivate::qt_metacast(char const *) - ?quitPendingWaitsForOpened@QNetworkSessionPrivate@@IAEXXZ @ 1076 NONAME ; void QNetworkSessionPrivate::quitPendingWaitsForOpened(void) - ?rawHeaderPairs@QNetworkReply@@QBEABV?$QList@U?$QPair@VQByteArray@@V1@@@@@XZ @ 1077 NONAME ; class QList<struct QPair<class QByteArray, class QByteArray> > const & QNetworkReply::rawHeaderPairs(void) const - ?reject@QNetworkSession@@QAEXXZ @ 1078 NONAME ; void QNetworkSession::reject(void) - ?sendCustomRequest@QNetworkAccessManager@@QAEPAVQNetworkReply@@ABVQNetworkRequest@@ABVQByteArray@@PAVQIODevice@@@Z @ 1079 NONAME ; class QNetworkReply * QNetworkAccessManager::sendCustomRequest(class QNetworkRequest const &, class QByteArray const &, class QIODevice *) - ?sessionProperty@QNetworkSession@@QBE?AVQVariant@@ABVQString@@@Z @ 1080 NONAME ; class QVariant QNetworkSession::sessionProperty(class QString const &) const - ?setALREnabled@QNetworkSessionPrivate@@UAEX_N@Z @ 1081 NONAME ; void QNetworkSessionPrivate::setALREnabled(bool) - ?setConfiguration@QNetworkAccessManager@@QAEXABVQNetworkConfiguration@@@Z @ 1082 NONAME ; void QNetworkAccessManager::setConfiguration(class QNetworkConfiguration const &) - ?setNetworkAccessEnabled@QNetworkAccessManager@@QAEX_N@Z @ 1083 NONAME ABSENT ; void QNetworkAccessManager::setNetworkAccessEnabled(bool) - ?setPriority@QNetworkRequest@@QAEXW4Priority@1@@Z @ 1084 NONAME ; void QNetworkRequest::setPriority(enum QNetworkRequest::Priority) - ?setPrivateConfiguration@QNetworkSessionPrivate@@IBEXAAVQNetworkConfiguration@@V?$QExplicitlySharedDataPointer@VQNetworkConfigurationPrivate@@@@@Z @ 1085 NONAME ; void QNetworkSessionPrivate::setPrivateConfiguration(class QNetworkConfiguration &, class QExplicitlySharedDataPointer<class QNetworkConfigurationPrivate>) const - ?setSessionProperty@QNetworkSession@@QAEXABVQString@@ABVQVariant@@@Z @ 1086 NONAME ; void QNetworkSession::setSessionProperty(class QString const &, class QVariant const &) - ?state@QNetworkConfiguration@@QBE?AV?$QFlags@W4StateFlag@QNetworkConfiguration@@@@XZ @ 1087 NONAME ; class QFlags<enum QNetworkConfiguration::StateFlag> QNetworkConfiguration::state(void) const - ?state@QNetworkSession@@QBE?AW4State@1@XZ @ 1088 NONAME ; enum QNetworkSession::State QNetworkSession::state(void) const - ?stateChanged@QNetworkSession@@IAEXW4State@1@@Z @ 1089 NONAME ; void QNetworkSession::stateChanged(enum QNetworkSession::State) - ?stateChanged@QNetworkSessionPrivate@@IAEXW4State@QNetworkSession@@@Z @ 1090 NONAME ; void QNetworkSessionPrivate::stateChanged(enum QNetworkSession::State) - ?stop@QNetworkSession@@QAEXXZ @ 1091 NONAME ; void QNetworkSession::stop(void) - ?tr@QBearerEngine@@SA?AVQString@@PBD0@Z @ 1092 NONAME ; class QString QBearerEngine::tr(char const *, char const *) - ?tr@QBearerEngine@@SA?AVQString@@PBD0H@Z @ 1093 NONAME ; class QString QBearerEngine::tr(char const *, char const *, int) - ?tr@QBearerEnginePlugin@@SA?AVQString@@PBD0@Z @ 1094 NONAME ; class QString QBearerEnginePlugin::tr(char const *, char const *) - ?tr@QBearerEnginePlugin@@SA?AVQString@@PBD0H@Z @ 1095 NONAME ; class QString QBearerEnginePlugin::tr(char const *, char const *, int) - ?tr@QNetworkConfigurationManager@@SA?AVQString@@PBD0@Z @ 1096 NONAME ; class QString QNetworkConfigurationManager::tr(char const *, char const *) - ?tr@QNetworkConfigurationManager@@SA?AVQString@@PBD0H@Z @ 1097 NONAME ; class QString QNetworkConfigurationManager::tr(char const *, char const *, int) - ?tr@QNetworkConfigurationManagerPrivate@@SA?AVQString@@PBD0@Z @ 1098 NONAME ; class QString QNetworkConfigurationManagerPrivate::tr(char const *, char const *) - ?tr@QNetworkConfigurationManagerPrivate@@SA?AVQString@@PBD0H@Z @ 1099 NONAME ; class QString QNetworkConfigurationManagerPrivate::tr(char const *, char const *, int) - ?tr@QNetworkSession@@SA?AVQString@@PBD0@Z @ 1100 NONAME ; class QString QNetworkSession::tr(char const *, char const *) - ?tr@QNetworkSession@@SA?AVQString@@PBD0H@Z @ 1101 NONAME ; class QString QNetworkSession::tr(char const *, char const *, int) - ?tr@QNetworkSessionPrivate@@SA?AVQString@@PBD0@Z @ 1102 NONAME ; class QString QNetworkSessionPrivate::tr(char const *, char const *) - ?tr@QNetworkSessionPrivate@@SA?AVQString@@PBD0H@Z @ 1103 NONAME ; class QString QNetworkSessionPrivate::tr(char const *, char const *, int) - ?trUtf8@QBearerEngine@@SA?AVQString@@PBD0@Z @ 1104 NONAME ; class QString QBearerEngine::trUtf8(char const *, char const *) - ?trUtf8@QBearerEngine@@SA?AVQString@@PBD0H@Z @ 1105 NONAME ; class QString QBearerEngine::trUtf8(char const *, char const *, int) - ?trUtf8@QBearerEnginePlugin@@SA?AVQString@@PBD0@Z @ 1106 NONAME ; class QString QBearerEnginePlugin::trUtf8(char const *, char const *) - ?trUtf8@QBearerEnginePlugin@@SA?AVQString@@PBD0H@Z @ 1107 NONAME ; class QString QBearerEnginePlugin::trUtf8(char const *, char const *, int) - ?trUtf8@QNetworkConfigurationManager@@SA?AVQString@@PBD0@Z @ 1108 NONAME ; class QString QNetworkConfigurationManager::trUtf8(char const *, char const *) - ?trUtf8@QNetworkConfigurationManager@@SA?AVQString@@PBD0H@Z @ 1109 NONAME ; class QString QNetworkConfigurationManager::trUtf8(char const *, char const *, int) - ?trUtf8@QNetworkConfigurationManagerPrivate@@SA?AVQString@@PBD0@Z @ 1110 NONAME ; class QString QNetworkConfigurationManagerPrivate::trUtf8(char const *, char const *) - ?trUtf8@QNetworkConfigurationManagerPrivate@@SA?AVQString@@PBD0H@Z @ 1111 NONAME ; class QString QNetworkConfigurationManagerPrivate::trUtf8(char const *, char const *, int) - ?trUtf8@QNetworkSession@@SA?AVQString@@PBD0@Z @ 1112 NONAME ; class QString QNetworkSession::trUtf8(char const *, char const *) - ?trUtf8@QNetworkSession@@SA?AVQString@@PBD0H@Z @ 1113 NONAME ; class QString QNetworkSession::trUtf8(char const *, char const *, int) - ?trUtf8@QNetworkSessionPrivate@@SA?AVQString@@PBD0@Z @ 1114 NONAME ; class QString QNetworkSessionPrivate::trUtf8(char const *, char const *) - ?trUtf8@QNetworkSessionPrivate@@SA?AVQString@@PBD0H@Z @ 1115 NONAME ; class QString QNetworkSessionPrivate::trUtf8(char const *, char const *, int) - ?type@QNetworkConfiguration@@QBE?AW4Type@1@XZ @ 1116 NONAME ; enum QNetworkConfiguration::Type QNetworkConfiguration::type(void) const - ?updateCompleted@QBearerEngine@@IAEXXZ @ 1117 NONAME ; void QBearerEngine::updateCompleted(void) - ?updateCompleted@QNetworkConfigurationManager@@IAEXXZ @ 1118 NONAME ; void QNetworkConfigurationManager::updateCompleted(void) - ?updateConfigurations@QNetworkConfigurationManager@@QAEXXZ @ 1119 NONAME ; void QNetworkConfigurationManager::updateConfigurations(void) - ?updateConfigurations@QNetworkConfigurationManagerPrivate@@QAEXXZ @ 1120 NONAME ; void QNetworkConfigurationManagerPrivate::updateConfigurations(void) - ?waitForOpened@QNetworkSession@@QAE_NH@Z @ 1121 NONAME ; bool QNetworkSession::waitForOpened(int) - ?staticMetaObject@QNetworkSessionPrivate@@2UQMetaObject@@B @ 1122 NONAME ; struct QMetaObject const QNetworkSessionPrivate::staticMetaObject - ?staticMetaObject@QBearerEngine@@2UQMetaObject@@B @ 1123 NONAME ; struct QMetaObject const QBearerEngine::staticMetaObject - ?staticMetaObject@QNetworkSession@@2UQMetaObject@@B @ 1124 NONAME ; struct QMetaObject const QNetworkSession::staticMetaObject - ?staticMetaObject@QNetworkConfigurationManager@@2UQMetaObject@@B @ 1125 NONAME ; struct QMetaObject const QNetworkConfigurationManager::staticMetaObject - ?staticMetaObject@QBearerEnginePlugin@@2UQMetaObject@@B @ 1126 NONAME ; struct QMetaObject const QBearerEnginePlugin::staticMetaObject - ?staticMetaObject@QNetworkConfigurationManagerPrivate@@2UQMetaObject@@B @ 1127 NONAME ; struct QMetaObject const QNetworkConfigurationManagerPrivate::staticMetaObject - ?allConfigurations@QNetworkConfigurationManagerPrivate@@QAE?AV?$QList@VQNetworkConfiguration@@@@V?$QFlags@W4StateFlag@QNetworkConfiguration@@@@@Z @ 1128 NONAME ; class QList<class QNetworkConfiguration> QNetworkConfigurationManagerPrivate::allConfigurations(class QFlags<enum QNetworkConfiguration::StateFlag>) - ?configurationFromIdentifier@QNetworkConfigurationManagerPrivate@@QAE?AVQNetworkConfiguration@@ABVQString@@@Z @ 1129 NONAME ; class QNetworkConfiguration QNetworkConfigurationManagerPrivate::configurationFromIdentifier(class QString const &) - ?configurationsInUse@QBearerEngine@@QBE_NXZ @ 1130 NONAME ; bool QBearerEngine::configurationsInUse(void) const - ?defaultConfiguration@QNetworkConfigurationManagerPrivate@@QAE?AVQNetworkConfiguration@@XZ @ 1131 NONAME ; class QNetworkConfiguration QNetworkConfigurationManagerPrivate::defaultConfiguration(void) - ?disablePolling@QNetworkConfigurationManagerPrivate@@QAEXXZ @ 1132 NONAME ; void QNetworkConfigurationManagerPrivate::disablePolling(void) - ?enablePolling@QNetworkConfigurationManagerPrivate@@QAEXXZ @ 1133 NONAME ; void QNetworkConfigurationManagerPrivate::enablePolling(void) - ?isOnline@QNetworkConfigurationManagerPrivate@@QAE_NXZ @ 1134 NONAME ; bool QNetworkConfigurationManagerPrivate::isOnline(void) - ?networkAccessible@QNetworkAccessManager@@QBE?AW4NetworkAccessibility@1@XZ @ 1135 NONAME ; enum QNetworkAccessManager::NetworkAccessibility QNetworkAccessManager::networkAccessible(void) const - ?networkAccessibleChanged@QNetworkAccessManager@@IAEXW4NetworkAccessibility@1@@Z @ 1136 NONAME ; void QNetworkAccessManager::networkAccessibleChanged(enum QNetworkAccessManager::NetworkAccessibility) - ?networkSessionConnected@QNetworkAccessManager@@IAEXXZ @ 1137 NONAME ; void QNetworkAccessManager::networkSessionConnected(void) - ?pollEngines@QNetworkConfigurationManagerPrivate@@AAEXXZ @ 1138 NONAME ; void QNetworkConfigurationManagerPrivate::pollEngines(void) - ?qt_qhostinfo_clear_cache@@YAXXZ @ 1139 NONAME ABSENT ; void qt_qhostinfo_clear_cache(void) - ?qt_qhostinfo_lookup@@YA?AVQHostInfo@@ABVQString@@PAVQObject@@PBDPA_NPAH@Z @ 1140 NONAME ; class QHostInfo qt_qhostinfo_lookup(class QString const &, class QObject *, char const *, bool *, int *) - ?requiresPolling@QBearerEngine@@UBE_NXZ @ 1141 NONAME ; bool QBearerEngine::requiresPolling(void) const + ?qt_qhostinfo_clear_cache@@YAXXZ @ 964 NONAME ABSENT ; void qt_qhostinfo_clear_cache(void) + ?qt_qhostinfo_lookup@@YA?AVQHostInfo@@ABVQString@@PAVQObject@@PBDPA_NPAH@Z @ 965 NONAME ; class QHostInfo qt_qhostinfo_lookup(class QString const &, class QObject *, char const *, bool *, int *) + ?rawHeaderPairs@QNetworkReply@@QBEABV?$QList@U?$QPair@VQByteArray@@V1@@@@@XZ @ 966 NONAME ; class QList<struct QPair<class QByteArray, class QByteArray> > const & QNetworkReply::rawHeaderPairs(void) const + ?tr@QBearerEnginePlugin@@SA?AVQString@@PBD0H@Z @ 967 NONAME ; class QString QBearerEnginePlugin::tr(char const *, char const *, int) + ?qt_metacall@QNetworkConfigurationManager@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 968 NONAME ; int QNetworkConfigurationManager::qt_metacall(enum QMetaObject::Call, int, void * *) + ?configurationAdded@QNetworkConfigurationManagerPrivate@@AAEXV?$QExplicitlySharedDataPointer@VQNetworkConfigurationPrivate@@@@@Z @ 969 NONAME ; void QNetworkConfigurationManagerPrivate::configurationAdded(class QExplicitlySharedDataPointer<class QNetworkConfigurationPrivate>) + ?metaObject@QNetworkConfigurationManagerPrivate@@UBEPBUQMetaObject@@XZ @ 970 NONAME ; struct QMetaObject const * QNetworkConfigurationManagerPrivate::metaObject(void) const + ??1QBearerEngineFactoryInterface@@UAE@XZ @ 971 NONAME ; QBearerEngineFactoryInterface::~QBearerEngineFactoryInterface(void) + ?setConfiguration@QNetworkAccessManager@@QAEXABVQNetworkConfiguration@@@Z @ 972 NONAME ; void QNetworkAccessManager::setConfiguration(class QNetworkConfiguration const &) + ?identifier@QNetworkConfiguration@@QBE?AVQString@@XZ @ 973 NONAME ; class QString QNetworkConfiguration::identifier(void) const + ??0QBearerEngine@@QAE@PAVQObject@@@Z @ 974 NONAME ; QBearerEngine::QBearerEngine(class QObject *) + ?isRoamingAvailable@QNetworkConfiguration@@QBE_NXZ @ 975 NONAME ; bool QNetworkConfiguration::isRoamingAvailable(void) const + ?quitPendingWaitsForOpened@QNetworkSessionPrivate@@IAEXXZ @ 976 NONAME ; void QNetworkSessionPrivate::quitPendingWaitsForOpened(void) + ?trUtf8@QNetworkSessionPrivate@@SA?AVQString@@PBD0H@Z @ 977 NONAME ; class QString QNetworkSessionPrivate::trUtf8(char const *, char const *, int) + ?setPrivateConfiguration@QNetworkSessionPrivate@@IBEXAAVQNetworkConfiguration@@V?$QExplicitlySharedDataPointer@VQNetworkConfigurationPrivate@@@@@Z @ 978 NONAME ; void QNetworkSessionPrivate::setPrivateConfiguration(class QNetworkConfiguration &, class QExplicitlySharedDataPointer<class QNetworkConfigurationPrivate>) const + ?trUtf8@QNetworkConfigurationManager@@SA?AVQString@@PBD0H@Z @ 979 NONAME ; class QString QNetworkConfigurationManager::trUtf8(char const *, char const *, int) + ?stateChanged@QNetworkSession@@IAEXW4State@1@@Z @ 980 NONAME ; void QNetworkSession::stateChanged(enum QNetworkSession::State) + ??1QNetworkConfigurationManagerPrivate@@UAE@XZ @ 981 NONAME ; QNetworkConfigurationManagerPrivate::~QNetworkConfigurationManagerPrivate(void) + ?getStaticMetaObject@QBearerEnginePlugin@@SAABUQMetaObject@@XZ @ 982 NONAME ; struct QMetaObject const & QBearerEnginePlugin::getStaticMetaObject(void) + ?getStaticMetaObject@QNetworkConfigurationManagerPrivate@@SAABUQMetaObject@@XZ @ 983 NONAME ; struct QMetaObject const & QNetworkConfigurationManagerPrivate::getStaticMetaObject(void) + ??_EQNetworkConfigurationManagerPrivate@@UAE@I@Z @ 984 NONAME ; QNetworkConfigurationManagerPrivate::~QNetworkConfigurationManagerPrivate(unsigned int) + ?metaObject@QBearerEnginePlugin@@UBEPBUQMetaObject@@XZ @ 985 NONAME ; struct QMetaObject const * QBearerEnginePlugin::metaObject(void) const + ??4QNetworkConfiguration@@QAEAAV0@ABV0@@Z @ 986 NONAME ; class QNetworkConfiguration & QNetworkConfiguration::operator=(class QNetworkConfiguration const &) + ?metaObject@QBearerEngine@@UBEPBUQMetaObject@@XZ @ 987 NONAME ; struct QMetaObject const * QBearerEngine::metaObject(void) const + ?getStaticMetaObject@QBearerEngine@@SAABUQMetaObject@@XZ @ 988 NONAME ; struct QMetaObject const & QBearerEngine::getStaticMetaObject(void) + ?waitForOpened@QNetworkSession@@QAE_NH@Z @ 989 NONAME ; bool QNetworkSession::waitForOpened(int) + ??_EQBearerEngine@@UAE@I@Z @ 990 NONAME ; QBearerEngine::~QBearerEngine(unsigned int) + ?error@QNetworkSession@@IAEXW4SessionError@1@@Z @ 991 NONAME ; void QNetworkSession::error(enum QNetworkSession::SessionError) + ?stop@QNetworkSession@@QAEXXZ @ 992 NONAME ; void QNetworkSession::stop(void) + ?accept@QNetworkSession@@QAEXXZ @ 993 NONAME ; void QNetworkSession::accept(void) + ?qNetworkConfigurationManagerPrivate@@YAPAVQNetworkConfigurationManagerPrivate@@XZ @ 994 NONAME ; class QNetworkConfigurationManagerPrivate * qNetworkConfigurationManagerPrivate(void) + ?open@QNetworkSession@@QAEXXZ @ 995 NONAME ; void QNetworkSession::open(void) + ?newConfigurationActivated@QNetworkSession@@IAEXXZ @ 996 NONAME ; void QNetworkSession::newConfigurationActivated(void) + ?staticMetaObject@QNetworkSessionPrivate@@2UQMetaObject@@B @ 997 NONAME ; struct QMetaObject const QNetworkSessionPrivate::staticMetaObject + ?error@QNetworkSession@@QBE?AW4SessionError@1@XZ @ 998 NONAME ; enum QNetworkSession::SessionError QNetworkSession::error(void) const + ?qt_metacast@QBearerEngine@@UAEPAXPBD@Z @ 999 NONAME ; void * QBearerEngine::qt_metacast(char const *) + ?staticMetaObject@QNetworkSession@@2UQMetaObject@@B @ 1000 NONAME ; struct QMetaObject const QNetworkSession::staticMetaObject + ?trUtf8@QBearerEngine@@SA?AVQString@@PBD0@Z @ 1001 NONAME ; class QString QBearerEngine::trUtf8(char const *, char const *) + ?privateConfiguration@QNetworkSessionPrivate@@IBE?AV?$QExplicitlySharedDataPointer@VQNetworkConfigurationPrivate@@@@ABVQNetworkConfiguration@@@Z @ 1002 NONAME ; class QExplicitlySharedDataPointer<class QNetworkConfigurationPrivate> QNetworkSessionPrivate::privateConfiguration(class QNetworkConfiguration const &) const + ?isOnline@QNetworkConfigurationManagerPrivate@@QAE_NXZ @ 1003 NONAME ; bool QNetworkConfigurationManagerPrivate::isOnline(void) + ?state@QNetworkConfiguration@@QBE?AV?$QFlags@W4StateFlag@QNetworkConfiguration@@@@XZ @ 1004 NONAME ; class QFlags<enum QNetworkConfiguration::StateFlag> QNetworkConfiguration::state(void) const + ?configurationAdded@QNetworkConfigurationManagerPrivate@@IAEXABVQNetworkConfiguration@@@Z @ 1005 NONAME ; void QNetworkConfigurationManagerPrivate::configurationAdded(class QNetworkConfiguration const &) + ?defaultConfiguration@QNetworkConfigurationManager@@QBE?AVQNetworkConfiguration@@XZ @ 1006 NONAME ; class QNetworkConfiguration QNetworkConfigurationManager::defaultConfiguration(void) const + ?bytesReceived@QNetworkSession@@QBE_KXZ @ 1007 NONAME ; unsigned long long QNetworkSession::bytesReceived(void) const + ?updateConfigurations@QNetworkConfigurationManagerPrivate@@QAEXXZ @ 1008 NONAME ; void QNetworkConfigurationManagerPrivate::updateConfigurations(void) + ?errorString@QNetworkSession@@QBE?AVQString@@XZ @ 1009 NONAME ; class QString QNetworkSession::errorString(void) const + ?tr@QNetworkSession@@SA?AVQString@@PBD0H@Z @ 1010 NONAME ; class QString QNetworkSession::tr(char const *, char const *, int) + ??1QNetworkConfigurationManager@@UAE@XZ @ 1011 NONAME ; QNetworkConfigurationManager::~QNetworkConfigurationManager(void) + ?isOpen@QNetworkSession@@QBE_NXZ @ 1012 NONAME ; bool QNetworkSession::isOpen(void) const + ?configurationChanged@QNetworkConfigurationManager@@IAEXABVQNetworkConfiguration@@@Z @ 1013 NONAME ; void QNetworkConfigurationManager::configurationChanged(class QNetworkConfiguration const &) + ?configurationChanged@QNetworkConfigurationManagerPrivate@@AAEXV?$QExplicitlySharedDataPointer@VQNetworkConfigurationPrivate@@@@@Z @ 1014 NONAME ; void QNetworkConfigurationManagerPrivate::configurationChanged(class QExplicitlySharedDataPointer<class QNetworkConfigurationPrivate>) + ?configurationRemoved@QBearerEngine@@IAEXV?$QExplicitlySharedDataPointer@VQNetworkConfigurationPrivate@@@@@Z @ 1015 NONAME ; void QBearerEngine::configurationRemoved(class QExplicitlySharedDataPointer<class QNetworkConfigurationPrivate>) + ?qt_metacall@QBearerEnginePlugin@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 1016 NONAME ; int QBearerEnginePlugin::qt_metacall(enum QMetaObject::Call, int, void * *) + ??0QBearerEnginePlugin@@QAE@PAVQObject@@@Z @ 1017 NONAME ; QBearerEnginePlugin::QBearerEnginePlugin(class QObject *) + ?trUtf8@QNetworkSession@@SA?AVQString@@PBD0@Z @ 1018 NONAME ; class QString QNetworkSession::trUtf8(char const *, char const *) + ?metaObject@QNetworkSessionPrivate@@UBEPBUQMetaObject@@XZ @ 1019 NONAME ; struct QMetaObject const * QNetworkSessionPrivate::metaObject(void) const + ??_EQNetworkConfigurationManager@@UAE@I@Z @ 1020 NONAME ; QNetworkConfigurationManager::~QNetworkConfigurationManager(unsigned int) + ?trUtf8@QNetworkSessionPrivate@@SA?AVQString@@PBD0@Z @ 1021 NONAME ; class QString QNetworkSessionPrivate::trUtf8(char const *, char const *) + ?bearerName@QNetworkConfiguration@@QBE?AVQString@@XZ @ 1022 NONAME ; class QString QNetworkConfiguration::bearerName(void) const + ?trUtf8@QNetworkConfigurationManagerPrivate@@SA?AVQString@@PBD0H@Z @ 1023 NONAME ; class QString QNetworkConfigurationManagerPrivate::trUtf8(char const *, char const *, int) + ?setSessionProperty@QNetworkSession@@QAEXABVQString@@ABVQVariant@@@Z @ 1024 NONAME ; void QNetworkSession::setSessionProperty(class QString const &, class QVariant const &) + ?qt_metacall@QNetworkSession@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 1025 NONAME ; int QNetworkSession::qt_metacall(enum QMetaObject::Call, int, void * *) + ?staticMetaObject@QBearerEngine@@2UQMetaObject@@B @ 1026 NONAME ; struct QMetaObject const QBearerEngine::staticMetaObject + ?networkSessionConnected@QNetworkAccessManager@@IAEXXZ @ 1027 NONAME ; void QNetworkAccessManager::networkSessionConnected(void) + ??1QBearerEngine@@UAE@XZ @ 1028 NONAME ; QBearerEngine::~QBearerEngine(void) + ?capabilities@QNetworkConfigurationManagerPrivate@@QAE?AV?$QFlags@W4Capability@QNetworkConfigurationManager@@@@XZ @ 1029 NONAME ; class QFlags<enum QNetworkConfigurationManager::Capability> QNetworkConfigurationManagerPrivate::capabilities(void) + ??1QNetworkConfiguration@@QAE@XZ @ 1030 NONAME ; QNetworkConfiguration::~QNetworkConfiguration(void) + ??0QNetworkConfigurationManagerPrivate@@QAE@XZ @ 1031 NONAME ; QNetworkConfigurationManagerPrivate::QNetworkConfigurationManagerPrivate(void) + ?preferredConfigurationChanged@QNetworkSession@@IAEXABVQNetworkConfiguration@@_N@Z @ 1032 NONAME ; void QNetworkSession::preferredConfigurationChanged(class QNetworkConfiguration const &, bool) + ?isValid@QNetworkConfiguration@@QBE_NXZ @ 1033 NONAME ; bool QNetworkConfiguration::isValid(void) const + ?configurationAdded@QBearerEngine@@IAEXV?$QExplicitlySharedDataPointer@VQNetworkConfigurationPrivate@@@@@Z @ 1034 NONAME ; void QBearerEngine::configurationAdded(class QExplicitlySharedDataPointer<class QNetworkConfigurationPrivate>) + ??1QNetworkSession@@UAE@XZ @ 1035 NONAME ; QNetworkSession::~QNetworkSession(void) + ?qt_metacast@QBearerEnginePlugin@@UAEPAXPBD@Z @ 1036 NONAME ; void * QBearerEnginePlugin::qt_metacast(char const *) + ??0QNetworkSession@@QAE@ABVQNetworkConfiguration@@PAVQObject@@@Z @ 1037 NONAME ; QNetworkSession::QNetworkSession(class QNetworkConfiguration const &, class QObject *) + ?error@QNetworkSessionPrivate@@IAEXW4SessionError@QNetworkSession@@@Z @ 1038 NONAME ; void QNetworkSessionPrivate::error(enum QNetworkSession::SessionError) + ?name@QNetworkConfiguration@@QBE?AVQString@@XZ @ 1039 NONAME ; class QString QNetworkConfiguration::name(void) const + ?close@QNetworkSession@@QAEXXZ @ 1040 NONAME ; void QNetworkSession::close(void) + ?sessionProperty@QNetworkSession@@QBE?AVQVariant@@ABVQString@@@Z @ 1041 NONAME ; class QVariant QNetworkSession::sessionProperty(class QString const &) const + ?engines@QNetworkConfigurationManagerPrivate@@QAE?AV?$QList@PAVQBearerEngine@@@@XZ @ 1042 NONAME ; class QList<class QBearerEngine *> QNetworkConfigurationManagerPrivate::engines(void) + ?isOnline@QNetworkConfigurationManager@@QBE_NXZ @ 1043 NONAME ; bool QNetworkConfigurationManager::isOnline(void) const + ?capabilities@QNetworkConfigurationManager@@QBE?AV?$QFlags@W4Capability@QNetworkConfigurationManager@@@@XZ @ 1044 NONAME ; class QFlags<enum QNetworkConfigurationManager::Capability> QNetworkConfigurationManager::capabilities(void) const + ?configurationRemoved@QNetworkConfigurationManagerPrivate@@AAEXV?$QExplicitlySharedDataPointer@VQNetworkConfigurationPrivate@@@@@Z @ 1045 NONAME ; void QNetworkConfigurationManagerPrivate::configurationRemoved(class QExplicitlySharedDataPointer<class QNetworkConfigurationPrivate>) + ??0QNetworkConfiguration@@QAE@ABV0@@Z @ 1046 NONAME ; QNetworkConfiguration::QNetworkConfiguration(class QNetworkConfiguration const &) + ?setPriority@QNetworkRequest@@QAEXW4Priority@1@@Z @ 1047 NONAME ; void QNetworkRequest::setPriority(enum QNetworkRequest::Priority) + ?disconnectNotify@QNetworkSession@@MAEXPBD@Z @ 1048 NONAME ; void QNetworkSession::disconnectNotify(char const *) + ?metaObject@QNetworkSession@@UBEPBUQMetaObject@@XZ @ 1049 NONAME ; struct QMetaObject const * QNetworkSession::metaObject(void) const + ?trUtf8@QBearerEngine@@SA?AVQString@@PBD0H@Z @ 1050 NONAME ; class QString QBearerEngine::trUtf8(char const *, char const *, int) + ?configuration@QNetworkSession@@QBE?AVQNetworkConfiguration@@XZ @ 1051 NONAME ; class QNetworkConfiguration QNetworkSession::configuration(void) const + ?closed@QNetworkSessionPrivate@@IAEXXZ @ 1052 NONAME ; void QNetworkSessionPrivate::closed(void) + ??1QNetworkSessionPrivate@@UAE@XZ @ 1053 NONAME ; QNetworkSessionPrivate::~QNetworkSessionPrivate(void) + ?staticMetaObject@QNetworkConfigurationManager@@2UQMetaObject@@B @ 1054 NONAME ; struct QMetaObject const QNetworkConfigurationManager::staticMetaObject + ?tr@QNetworkConfigurationManager@@SA?AVQString@@PBD0H@Z @ 1055 NONAME ; class QString QNetworkConfigurationManager::tr(char const *, char const *, int) + ?tr@QNetworkConfigurationManagerPrivate@@SA?AVQString@@PBD0H@Z @ 1056 NONAME ; class QString QNetworkConfigurationManagerPrivate::tr(char const *, char const *, int) + ?configurationChanged@QBearerEngine@@IAEXV?$QExplicitlySharedDataPointer@VQNetworkConfigurationPrivate@@@@@Z @ 1057 NONAME ; void QBearerEngine::configurationChanged(class QExplicitlySharedDataPointer<class QNetworkConfigurationPrivate>) + ?tr@QBearerEngine@@SA?AVQString@@PBD0@Z @ 1058 NONAME ; class QString QBearerEngine::tr(char const *, char const *) + ??0QNetworkConfiguration@@QAE@XZ @ 1059 NONAME ; QNetworkConfiguration::QNetworkConfiguration(void) + ?configurationRemoved@QNetworkConfigurationManager@@IAEXABVQNetworkConfiguration@@@Z @ 1060 NONAME ; void QNetworkConfigurationManager::configurationRemoved(class QNetworkConfiguration const &) + ?preferredConfigurationChanged@QNetworkSessionPrivate@@IAEXABVQNetworkConfiguration@@_N@Z @ 1061 NONAME ; void QNetworkSessionPrivate::preferredConfigurationChanged(class QNetworkConfiguration const &, bool) + ??1QBearerEnginePlugin@@UAE@XZ @ 1062 NONAME ; QBearerEnginePlugin::~QBearerEnginePlugin(void) + ?tr@QNetworkSession@@SA?AVQString@@PBD0@Z @ 1063 NONAME ; class QString QNetworkSession::tr(char const *, char const *) + ??0QNetworkConfigurationManager@@QAE@PAVQObject@@@Z @ 1064 NONAME ; QNetworkConfigurationManager::QNetworkConfigurationManager(class QObject *) + ?qt_metacall@QNetworkConfigurationManagerPrivate@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 1065 NONAME ; int QNetworkConfigurationManagerPrivate::qt_metacall(enum QMetaObject::Call, int, void * *) + ??_EQNetworkSession@@UAE@I@Z @ 1066 NONAME ; QNetworkSession::~QNetworkSession(unsigned int) + ??9QNetworkConfiguration@@QBE_NABV0@@Z @ 1067 NONAME ; bool QNetworkConfiguration::operator!=(class QNetworkConfiguration const &) const + ?configurationsInUse@QBearerEngine@@QBE_NXZ @ 1068 NONAME ; bool QBearerEngine::configurationsInUse(void) const + ?tr@QBearerEngine@@SA?AVQString@@PBD0H@Z @ 1069 NONAME ; class QString QBearerEngine::tr(char const *, char const *, int) + ?configuration@QNetworkAccessManager@@QBE?AVQNetworkConfiguration@@XZ @ 1070 NONAME ; class QNetworkConfiguration QNetworkAccessManager::configuration(void) const + ?tr@QNetworkSessionPrivate@@SA?AVQString@@PBD0@Z @ 1071 NONAME ; class QString QNetworkSessionPrivate::tr(char const *, char const *) + ?activeTime@QNetworkSession@@QBE_KXZ @ 1072 NONAME ; unsigned long long QNetworkSession::activeTime(void) const + ?state@QNetworkSession@@QBE?AW4State@1@XZ @ 1073 NONAME ; enum QNetworkSession::State QNetworkSession::state(void) const + ?disablePolling@QNetworkConfigurationManagerPrivate@@QAEXXZ @ 1074 NONAME ; void QNetworkConfigurationManagerPrivate::disablePolling(void) + ?getStaticMetaObject@QNetworkSessionPrivate@@SAABUQMetaObject@@XZ @ 1075 NONAME ; struct QMetaObject const & QNetworkSessionPrivate::getStaticMetaObject(void) + ?configurationAdded@QNetworkConfigurationManager@@IAEXABVQNetworkConfiguration@@@Z @ 1076 NONAME ; void QNetworkConfigurationManager::configurationAdded(class QNetworkConfiguration const &) + ?tr@QNetworkSessionPrivate@@SA?AVQString@@PBD0H@Z @ 1077 NONAME ; class QString QNetworkSessionPrivate::tr(char const *, char const *, int) + ?performAsyncConfigurationUpdate@QNetworkConfigurationManagerPrivate@@QAEXXZ @ 1078 NONAME ; void QNetworkConfigurationManagerPrivate::performAsyncConfigurationUpdate(void) + ?trUtf8@QNetworkConfigurationManagerPrivate@@SA?AVQString@@PBD0@Z @ 1079 NONAME ; class QString QNetworkConfigurationManagerPrivate::trUtf8(char const *, char const *) + ?networkAccessible@QNetworkAccessManager@@QBE?AW4NetworkAccessibility@1@XZ @ 1080 NONAME ; enum QNetworkAccessManager::NetworkAccessibility QNetworkAccessManager::networkAccessible(void) const + ?setOption@QAuthenticator@@QAEXABVQString@@ABVQVariant@@@Z @ 1081 NONAME ; void QAuthenticator::setOption(class QString const &, class QVariant const &) + ?trUtf8@QBearerEnginePlugin@@SA?AVQString@@PBD0H@Z @ 1082 NONAME ; class QString QBearerEnginePlugin::trUtf8(char const *, char const *, int) + ?trUtf8@QNetworkConfigurationManager@@SA?AVQString@@PBD0@Z @ 1083 NONAME ; class QString QNetworkConfigurationManager::trUtf8(char const *, char const *) + ?allConfigurations@QNetworkConfigurationManager@@QBE?AV?$QList@VQNetworkConfiguration@@@@V?$QFlags@W4StateFlag@QNetworkConfiguration@@@@@Z @ 1084 NONAME ; class QList<class QNetworkConfiguration> QNetworkConfigurationManager::allConfigurations(class QFlags<enum QNetworkConfiguration::StateFlag>) const + ?requiresPolling@QBearerEngine@@UBE_NXZ @ 1085 NONAME ; bool QBearerEngine::requiresPolling(void) const + ?priority@QNetworkRequest@@QBE?AW4Priority@1@XZ @ 1086 NONAME ; enum QNetworkRequest::Priority QNetworkRequest::priority(void) const + ?networkAccessibleChanged@QNetworkAccessManager@@IAEXW4NetworkAccessibility@1@@Z @ 1087 NONAME ; void QNetworkAccessManager::networkAccessibleChanged(enum QNetworkAccessManager::NetworkAccessibility) + ??8QNetworkConfiguration@@QBE_NABV0@@Z @ 1088 NONAME ; bool QNetworkConfiguration::operator==(class QNetworkConfiguration const &) const + ?option@QAuthenticator@@QBE?AVQVariant@@ABVQString@@@Z @ 1089 NONAME ; class QVariant QAuthenticator::option(class QString const &) const + ?tr@QBearerEnginePlugin@@SA?AVQString@@PBD0@Z @ 1090 NONAME ; class QString QBearerEnginePlugin::tr(char const *, char const *) + ?configurationFromIdentifier@QNetworkConfigurationManager@@QBE?AVQNetworkConfiguration@@ABVQString@@@Z @ 1091 NONAME ; class QNetworkConfiguration QNetworkConfigurationManager::configurationFromIdentifier(class QString const &) const + ??_EQBearerEnginePlugin@@UAE@I@Z @ 1092 NONAME ; QBearerEnginePlugin::~QBearerEnginePlugin(unsigned int) + ?children@QNetworkConfiguration@@QBE?AV?$QList@VQNetworkConfiguration@@@@XZ @ 1093 NONAME ; class QList<class QNetworkConfiguration> QNetworkConfiguration::children(void) const + ?activeConfiguration@QNetworkAccessManager@@QBE?AVQNetworkConfiguration@@XZ @ 1094 NONAME ; class QNetworkConfiguration QNetworkAccessManager::activeConfiguration(void) const + ?defaultConfiguration@QNetworkConfigurationManagerPrivate@@QAE?AVQNetworkConfiguration@@XZ @ 1095 NONAME ; class QNetworkConfiguration QNetworkConfigurationManagerPrivate::defaultConfiguration(void) + ?getStaticMetaObject@QNetworkSession@@SAABUQMetaObject@@XZ @ 1096 NONAME ; struct QMetaObject const & QNetworkSession::getStaticMetaObject(void) + ?qt_metacast@QNetworkSession@@UAEPAXPBD@Z @ 1097 NONAME ; void * QNetworkSession::qt_metacast(char const *) + ?updateCompleted@QBearerEngine@@IAEXXZ @ 1098 NONAME ; void QBearerEngine::updateCompleted(void) + ?qt_metacall@QNetworkSessionPrivate@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 1099 NONAME ; int QNetworkSessionPrivate::qt_metacall(enum QMetaObject::Call, int, void * *) + ?onlineStateChanged@QNetworkConfigurationManager@@IAEX_N@Z @ 1100 NONAME ; void QNetworkConfigurationManager::onlineStateChanged(bool) + ?getStaticMetaObject@QNetworkConfigurationManager@@SAABUQMetaObject@@XZ @ 1101 NONAME ; struct QMetaObject const & QNetworkConfigurationManager::getStaticMetaObject(void) + ??0QNetworkSessionPrivate@@QAE@XZ @ 1102 NONAME ; QNetworkSessionPrivate::QNetworkSessionPrivate(void) + ?qt_metacast@QNetworkConfigurationManager@@UAEPAXPBD@Z @ 1103 NONAME ; void * QNetworkConfigurationManager::qt_metacast(char const *) + ?configurationChanged@QNetworkConfigurationManagerPrivate@@IAEXABVQNetworkConfiguration@@@Z @ 1104 NONAME ; void QNetworkConfigurationManagerPrivate::configurationChanged(class QNetworkConfiguration const &) + ?staticMetaObject@QBearerEnginePlugin@@2UQMetaObject@@B @ 1105 NONAME ; struct QMetaObject const QBearerEnginePlugin::staticMetaObject + ?qt_metacast@QNetworkConfigurationManagerPrivate@@UAEPAXPBD@Z @ 1106 NONAME ; void * QNetworkConfigurationManagerPrivate::qt_metacast(char const *) + ?newConfigurationActivated@QNetworkSessionPrivate@@IAEXXZ @ 1107 NONAME ; void QNetworkSessionPrivate::newConfigurationActivated(void) + ?qt_metacast@QNetworkSessionPrivate@@UAEPAXPBD@Z @ 1108 NONAME ; void * QNetworkSessionPrivate::qt_metacast(char const *) + ?startPolling@QNetworkConfigurationManagerPrivate@@QAEXXZ @ 1109 NONAME ; void QNetworkConfigurationManagerPrivate::startPolling(void) + ?allConfigurations@QNetworkConfigurationManagerPrivate@@QAE?AV?$QList@VQNetworkConfiguration@@@@V?$QFlags@W4StateFlag@QNetworkConfiguration@@@@@Z @ 1110 NONAME ; class QList<class QNetworkConfiguration> QNetworkConfigurationManagerPrivate::allConfigurations(class QFlags<enum QNetworkConfiguration::StateFlag>) + ?connectNotify@QNetworkSession@@MAEXPBD@Z @ 1111 NONAME ; void QNetworkSession::connectNotify(char const *) + ?onlineStateChanged@QNetworkConfigurationManagerPrivate@@IAEX_N@Z @ 1112 NONAME ; void QNetworkConfigurationManagerPrivate::onlineStateChanged(bool) + ?bytesWritten@QNetworkSession@@QBE_KXZ @ 1113 NONAME ; unsigned long long QNetworkSession::bytesWritten(void) const + ?sendCustomRequest@QNetworkAccessManager@@QAEPAVQNetworkReply@@ABVQNetworkRequest@@ABVQByteArray@@PAVQIODevice@@@Z @ 1114 NONAME ; class QNetworkReply * QNetworkAccessManager::sendCustomRequest(class QNetworkRequest const &, class QByteArray const &, class QIODevice *) + ?addPendingConnection@QTcpServer@@IAEXPAVQTcpSocket@@@Z @ 1115 NONAME ; void QTcpServer::addPendingConnection(class QTcpSocket *) + ?ignore@QNetworkSession@@QAEXXZ @ 1116 NONAME ; void QNetworkSession::ignore(void) + ?updateConfigurations@QNetworkConfigurationManager@@QAEXXZ @ 1117 NONAME ; void QNetworkConfigurationManager::updateConfigurations(void) + ?stateChanged@QNetworkSessionPrivate@@IAEXW4State@QNetworkSession@@@Z @ 1118 NONAME ; void QNetworkSessionPrivate::stateChanged(enum QNetworkSession::State) + ?setALREnabled@QNetworkSessionPrivate@@UAEX_N@Z @ 1119 NONAME ; void QNetworkSessionPrivate::setALREnabled(bool) + ?configurationRemoved@QNetworkConfigurationManagerPrivate@@IAEXABVQNetworkConfiguration@@@Z @ 1120 NONAME ; void QNetworkConfigurationManagerPrivate::configurationRemoved(class QNetworkConfiguration const &) + ?qt_metacall@QBearerEngine@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 1121 NONAME ; int QBearerEngine::qt_metacall(enum QMetaObject::Call, int, void * *) + ?interface@QNetworkSession@@QBE?AVQNetworkInterface@@XZ @ 1122 NONAME ; class QNetworkInterface QNetworkSession::interface(void) const + ?opened@QNetworkSession@@IAEXXZ @ 1123 NONAME ; void QNetworkSession::opened(void) + ?type@QNetworkConfiguration@@QBE?AW4Type@1@XZ @ 1124 NONAME ; enum QNetworkConfiguration::Type QNetworkConfiguration::type(void) const + ?migrate@QNetworkSession@@QAEXXZ @ 1125 NONAME ; void QNetworkSession::migrate(void) + ?closed@QNetworkSession@@IAEXXZ @ 1126 NONAME ; void QNetworkSession::closed(void) + ?pollEngines@QNetworkConfigurationManagerPrivate@@AAEXXZ @ 1127 NONAME ; void QNetworkConfigurationManagerPrivate::pollEngines(void) + ?staticMetaObject@QNetworkConfigurationManagerPrivate@@2UQMetaObject@@B @ 1128 NONAME ; struct QMetaObject const QNetworkConfigurationManagerPrivate::staticMetaObject + ?reject@QNetworkSession@@QAEXXZ @ 1129 NONAME ; void QNetworkSession::reject(void) + ?options@QAuthenticator@@QBE?AV?$QHash@VQString@@VQVariant@@@@XZ @ 1130 NONAME ; class QHash<class QString, class QVariant> QAuthenticator::options(void) const + ?purpose@QNetworkConfiguration@@QBE?AW4Purpose@1@XZ @ 1131 NONAME ; enum QNetworkConfiguration::Purpose QNetworkConfiguration::purpose(void) const + ?configurationFromIdentifier@QNetworkConfigurationManagerPrivate@@QAE?AVQNetworkConfiguration@@ABVQString@@@Z @ 1132 NONAME ; class QNetworkConfiguration QNetworkConfigurationManagerPrivate::configurationFromIdentifier(class QString const &) + ?abort@QNetworkConfigurationManagerPrivate@@IAEXXZ @ 1133 NONAME ; void QNetworkConfigurationManagerPrivate::abort(void) + ?tr@QNetworkConfigurationManager@@SA?AVQString@@PBD0@Z @ 1134 NONAME ; class QString QNetworkConfigurationManager::tr(char const *, char const *) + ?trUtf8@QNetworkSession@@SA?AVQString@@PBD0H@Z @ 1135 NONAME ; class QString QNetworkSession::trUtf8(char const *, char const *, int) + ?trUtf8@QBearerEnginePlugin@@SA?AVQString@@PBD0@Z @ 1136 NONAME ; class QString QBearerEnginePlugin::trUtf8(char const *, char const *) + ??_EQNetworkSessionPrivate@@UAE@I@Z @ 1137 NONAME ; QNetworkSessionPrivate::~QNetworkSessionPrivate(unsigned int) + ?configurationUpdateComplete@QNetworkConfigurationManagerPrivate@@IAEXXZ @ 1138 NONAME ; void QNetworkConfigurationManagerPrivate::configurationUpdateComplete(void) + ?metaObject@QNetworkConfigurationManager@@UBEPBUQMetaObject@@XZ @ 1139 NONAME ; struct QMetaObject const * QNetworkConfigurationManager::metaObject(void) const + ?tr@QNetworkConfigurationManagerPrivate@@SA?AVQString@@PBD0@Z @ 1140 NONAME ; class QString QNetworkConfigurationManagerPrivate::tr(char const *, char const *) + ?updateCompleted@QNetworkConfigurationManager@@IAEXXZ @ 1141 NONAME ; void QNetworkConfigurationManager::updateCompleted(void) ?setNetworkAccessible@QNetworkAccessManager@@QAEXW4NetworkAccessibility@1@@Z @ 1142 NONAME ; void QNetworkAccessManager::setNetworkAccessible(enum QNetworkAccessManager::NetworkAccessibility) - ?startPolling@QNetworkConfigurationManagerPrivate@@QAEXXZ @ 1143 NONAME ; void QNetworkConfigurationManagerPrivate::startPolling(void) - ?capabilities@QNetworkConfigurationManagerPrivate@@QAE?AV?$QFlags@W4Capability@QNetworkConfigurationManager@@@@XZ @ 1144 NONAME ; class QFlags<enum QNetworkConfigurationManager::Capability> QNetworkConfigurationManagerPrivate::capabilities(void) - ?addPendingConnection@QTcpServer@@IAEXPAVQTcpSocket@@@Z @ 1145 NONAME ; void QTcpServer::addPendingConnection(class QTcpSocket *) - ?option@QAuthenticator@@QBE?AVQVariant@@ABVQString@@@Z @ 1146 NONAME ; class QVariant QAuthenticator::option(class QString const &) const - ?options@QAuthenticator@@QBE?AV?$QHash@VQString@@VQVariant@@@@XZ @ 1147 NONAME ; class QHash<class QString, class QVariant> QAuthenticator::options(void) const - ?setOption@QAuthenticator@@QAEXABVQString@@ABVQVariant@@@Z @ 1148 NONAME ; void QAuthenticator::setOption(class QString const &, class QVariant const &) + ??_EQBearerEngineFactoryInterface@@UAE@I@Z @ 1143 NONAME ; QBearerEngineFactoryInterface::~QBearerEngineFactoryInterface(unsigned int) + ?enablePolling@QNetworkConfigurationManagerPrivate@@QAEXXZ @ 1144 NONAME ; void QNetworkConfigurationManagerPrivate::enablePolling(void) + ?bearerTypeName@QNetworkConfiguration@@QBE?AVQString@@XZ @ 1145 NONAME ; class QString QNetworkConfiguration::bearerTypeName(void) const + ?bearerType@QNetworkConfiguration@@QBE?AW4BearerType@1@XZ @ 1146 NONAME ; enum QNetworkConfiguration::BearerType QNetworkConfiguration::bearerType(void) const diff --git a/src/s60installs/bwins/QtOpenVGu.def b/src/s60installs/bwins/QtOpenVGu.def index f398055..1452383 100644 --- a/src/s60installs/bwins/QtOpenVGu.def +++ b/src/s60installs/bwins/QtOpenVGu.def @@ -164,12 +164,11 @@ EXPORTS ?qt_vg_create_context@@YAPAVQEglContext@@PAVQPaintDevice@@H@Z @ 163 NONAME ; class QEglContext * qt_vg_create_context(class QPaintDevice *, int) ?reclaimImages@QVGPixmapData@@UAEXXZ @ 164 NONAME ; void QVGPixmapData::reclaimImages(void) ?hibernate@QVGPixmapData@@UAEXXZ @ 165 NONAME ; void QVGPixmapData::hibernate(void) - ?drawStaticTextItem@QVGPaintEngine@@UAEXPAVQStaticTextItem@@@Z @ 166 NONAME ; void QVGPaintEngine::drawStaticTextItem(class QStaticTextItem *) - ?drawPixmapFragments@QVGPaintEngine@@UAEXPBVPixmapFragment@QPainter@@HABVQPixmap@@V?$QFlags@W4PixmapFragmentHint@QPainter@@@@@Z @ 167 NONAME ; void QVGPaintEngine::drawPixmapFragments(class QPainter::PixmapFragment const *, int, class QPixmap const &, class QFlags<enum QPainter::PixmapFragmentHint>) - ?drawCachedGlyphs@QVGPaintEngine@@QAE_NHPBIABVQFont@@PAVQFontEngine@@ABVQPointF@@@Z @ 168 NONAME ABSENT ; bool QVGPaintEngine::drawCachedGlyphs(int, unsigned int const *, class QFont const &, class QFontEngine *, class QPointF const &) - ?supportsStaticContents@QVGEGLWindowSurfaceDirect@@UBE_NXZ @ 169 NONAME ; bool QVGEGLWindowSurfaceDirect::supportsStaticContents(void) const - ?scroll@QVGEGLWindowSurfacePrivate@@UAE_NPAVQWidget@@ABVQRegion@@HH@Z @ 170 NONAME ; bool QVGEGLWindowSurfacePrivate::scroll(class QWidget *, class QRegion const &, int, int) - ?scroll@QVGEGLWindowSurfaceDirect@@UAE_NPAVQWidget@@ABVQRegion@@HH@Z @ 171 NONAME ; bool QVGEGLWindowSurfaceDirect::scroll(class QWidget *, class QRegion const &, int, int) - ?supportsStaticContents@QVGEGLWindowSurfacePrivate@@UBE_NXZ @ 172 NONAME ; bool QVGEGLWindowSurfacePrivate::supportsStaticContents(void) const - ?drawCachedGlyphs@QVGPaintEngine@@QAE_NHPBIABVQFont@@PAVQFontEngine@@ABVQPointF@@PBUQFixedPoint@@@Z @ 173 NONAME ; bool QVGPaintEngine::drawCachedGlyphs(int, unsigned int const *, class QFont const &, class QFontEngine *, class QPointF const &, struct QFixedPoint const *) + ?supportsStaticContents@QVGEGLWindowSurfaceDirect@@UBE_NXZ @ 166 NONAME ; bool QVGEGLWindowSurfaceDirect::supportsStaticContents(void) const + ?scroll@QVGEGLWindowSurfacePrivate@@UAE_NPAVQWidget@@ABVQRegion@@HH@Z @ 167 NONAME ; bool QVGEGLWindowSurfacePrivate::scroll(class QWidget *, class QRegion const &, int, int) + ?scroll@QVGEGLWindowSurfaceDirect@@UAE_NPAVQWidget@@ABVQRegion@@HH@Z @ 168 NONAME ; bool QVGEGLWindowSurfaceDirect::scroll(class QWidget *, class QRegion const &, int, int) + ?supportsStaticContents@QVGEGLWindowSurfacePrivate@@UBE_NXZ @ 169 NONAME ; bool QVGEGLWindowSurfacePrivate::supportsStaticContents(void) const + ?drawCachedGlyphs@QVGPaintEngine@@QAE_NHPBIABVQFont@@PAVQFontEngine@@ABVQPointF@@PBUQFixedPoint@@@Z @ 170 NONAME ; bool QVGPaintEngine::drawCachedGlyphs(int, unsigned int const *, class QFont const &, class QFontEngine *, class QPointF const &, struct QFixedPoint const *) + ?drawPixmapFragments@QVGPaintEngine@@UAEXPBVPixmapFragment@QPainter@@HABVQPixmap@@V?$QFlags@W4PixmapFragmentHint@QPainter@@@@@Z @ 171 NONAME ; void QVGPaintEngine::drawPixmapFragments(class QPainter::PixmapFragment const *, int, class QPixmap const &, class QFlags<enum QPainter::PixmapFragmentHint>) + ?drawStaticTextItem@QVGPaintEngine@@UAEXPAVQStaticTextItem@@@Z @ 172 NONAME ; void QVGPaintEngine::drawStaticTextItem(class QStaticTextItem *) diff --git a/src/s60installs/eabi/QtGuiu.def b/src/s60installs/eabi/QtGuiu.def index 8c11002..d8e86bf 100644 --- a/src/s60installs/eabi/QtGuiu.def +++ b/src/s60installs/eabi/QtGuiu.def @@ -4294,7 +4294,7 @@ EXPORTS _ZN19QApplicationPrivate13animate_comboE @ 4293 NONAME DATA 1 _ZN19QApplicationPrivate13mouse_buttonsE @ 4294 NONAME DATA 4 _ZN19QApplicationPrivate13notify_helperEP7QObjectP6QEvent @ 4295 NONAME - _ZN19QApplicationPrivate13scanCodeCacheE @ 4296 NONAME DATA 4 + _ZN19QApplicationPrivate13scanCodeCacheE @ 4296 NONAME DATA 4 ABSENT _ZN19QApplicationPrivate13setSystemFontERK5QFont @ 4297 NONAME _ZN19QApplicationPrivate13styleOverrideE @ 4298 NONAME DATA 4 _ZN19QApplicationPrivate14autoSipEnabledE @ 4299 NONAME DATA 1 @@ -12046,7 +12046,7 @@ EXPORTS _ZN18QRuntimePixmapDataD1Ev @ 12045 NONAME _ZN18QRuntimePixmapDataD2Ev @ 12046 NONAME _ZN7QPixmap15fromImageReaderEP12QImageReader6QFlagsIN2Qt19ImageConversionFlagEE @ 12047 NONAME - _ZNK18QRuntimePixmapData11memoryUsageEv @ 12048 NONAME + _ZNK18QRuntimePixmapData11memoryUsageEv @ 12048 NONAME ABSENT _ZNK18QRuntimePixmapData11paintEngineEv @ 12049 NONAME _ZNK18QRuntimePixmapData11runtimeDataEv @ 12050 NONAME _ZNK18QRuntimePixmapData11transformedERK10QTransformN2Qt18TransformationModeE @ 12051 NONAME @@ -12088,4 +12088,7 @@ EXPORTS _ZN18QTapAndHoldGesture7timeoutEv @ 12087 NONAME _ZN20QGraphicsItemPrivate20focusScopeItemChangeEb @ 12088 NONAME _ZN20QGraphicsItemPrivate26childrenBoundingRectHelperEP10QTransformP6QRectFb @ 12089 NONAME + _ZN14QGraphicsScale13xScaleChangedEv @ 12090 NONAME + _ZN14QGraphicsScale13yScaleChangedEv @ 12091 NONAME + _ZN14QGraphicsScale13zScaleChangedEv @ 12092 NONAME diff --git a/src/s60installs/eabi/QtNetworku.def b/src/s60installs/eabi/QtNetworku.def index eb30832..2442ee8 100644 --- a/src/s60installs/eabi/QtNetworku.def +++ b/src/s60installs/eabi/QtNetworku.def @@ -1167,4 +1167,6 @@ EXPORTS _ZN14QAuthenticator9setOptionERK7QStringRK8QVariant @ 1166 NONAME _ZNK14QAuthenticator6optionERK7QString @ 1167 NONAME _ZNK14QAuthenticator7optionsEv @ 1168 NONAME + _ZNK21QNetworkConfiguration10bearerTypeEv @ 1169 NONAME + _ZNK21QNetworkConfiguration14bearerTypeNameEv @ 1170 NONAME diff --git a/src/s60installs/s60installs.pro b/src/s60installs/s60installs.pro index 4addb84..8a8167b 100644 --- a/src/s60installs/s60installs.pro +++ b/src/s60installs/s60installs.pro @@ -57,8 +57,8 @@ symbian: { bearerPluginLocation = $${EPOCROOT}epoc32/release/$(PLATFORM)/$(TARGET) bearerStubZ = $${EPOCROOT}$${HW_ZDIR}$${QT_PLUGINS_BASE_DIR}/bearer/qsymbianbearer$${QT_LIBINFIX}.qtplugin BLD_INF_RULES.prj_exports += \ - "qsymbianbearer.qtplugin $$bearerStubZ" \ - "qsymbianbearer.qtplugin $${EPOCROOT}epoc32/winscw/c$${QT_PLUGINS_BASE_DIR}/bearer/qsymbianbearer$${QT_LIBINFIX}.qtplugin" + "qsymbianbearer.qtplugin /$${HW_ZDIR}$${QT_PLUGINS_BASE_DIR}/bearer/qsymbianbearer$${QT_LIBINFIX}.qtplugin" \ + "qsymbianbearer.qtplugin /epoc32/winscw/c$${QT_PLUGINS_BASE_DIR}/bearer/qsymbianbearer$${QT_LIBINFIX}.qtplugin" } else { pluginLocations = $$QT_BUILD_TREE/plugins/s60 bearerPluginLocation = $$QT_BUILD_TREE/plugins/bearer diff --git a/src/script/api/qscriptcontext.cpp b/src/script/api/qscriptcontext.cpp index 3f08e74..abaf5f9 100644 --- a/src/script/api/qscriptcontext.cpp +++ b/src/script/api/qscriptcontext.cpp @@ -323,6 +323,9 @@ QScriptValue QScriptContext::argumentsObject() const When a function is called as constructor, the thisObject() contains the newly constructed object to be initialized. + + \note This function is only guaranteed to work for a context + corresponding to native functions. */ bool QScriptContext::isCalledAsConstructor() const { @@ -413,6 +416,9 @@ void QScriptContext::setReturnValue(const QScriptValue &result) object provides access to the local variables associated with this context. + \note The activation object might not be available if there is no + active QScriptEngineAgent, as it might be optimized. + \sa argument(), argumentsObject() */ @@ -472,6 +478,10 @@ QScriptValue QScriptContext::activationObject() const activation. If \a activation is not an object, this function does nothing. + + \note For a context corresponding to a JavaScript function, this is only + guarenteed to work if there was an QScriptEngineAgent active on the + engine while the function was evaluated. */ void QScriptContext::setActivationObject(const QScriptValue &activation) { diff --git a/src/script/api/qscriptcontextinfo.cpp b/src/script/api/qscriptcontextinfo.cpp index ebb1770..a90e014 100644 --- a/src/script/api/qscriptcontextinfo.cpp +++ b/src/script/api/qscriptcontextinfo.cpp @@ -53,8 +53,7 @@ QT_BEGIN_NAMESPACE current statement. If the called function is executing Qt Script code, you can obtain - the script location with the functions fileName(), lineNumber() and - columnNumber(). + the script location with the functions fileName() and lineNumber(). You can obtain the starting line number and ending line number of a Qt Script function definition with functionStartLineNumber() and @@ -317,13 +316,7 @@ int QScriptContextInfo::lineNumber() const } /*! - Returns the column number corresponding to the statement being - executed, or -1 if the column number is not available. - - The column number is only available if Qt Script code is being - executed. - - \sa lineNumber(), fileName() + \obsolete */ int QScriptContextInfo::columnNumber() const { diff --git a/src/script/api/qscriptcontextinfo.h b/src/script/api/qscriptcontextinfo.h index d0b3f21..64a1e15 100644 --- a/src/script/api/qscriptcontextinfo.h +++ b/src/script/api/qscriptcontextinfo.h @@ -69,7 +69,9 @@ public: qint64 scriptId() const; QString fileName() const; int lineNumber() const; - int columnNumber() const; +#ifdef QT_DEPRECATED + QT_DEPRECATED int columnNumber() const; +#endif QString functionName() const; FunctionType functionType() const; diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp index ee02b9d..dc22ec3 100644 --- a/src/script/api/qscriptengine.cpp +++ b/src/script/api/qscriptengine.cpp @@ -44,7 +44,6 @@ #include "CodeBlock.h" #include "Error.h" -#include "JSLock.h" #include "Interpreter.h" #include "PrototypeFunction.h" @@ -152,8 +151,7 @@ QT_BEGIN_NAMESPACE evaluation caused an exception by calling hasUncaughtException(). In that case, you can call toString() on the error object to obtain an error message. The current uncaught exception is also available - through uncaughtException(). You can obtain a human-readable - backtrace of the exception with uncaughtExceptionBacktrace(). + through uncaughtException(). Calling clearExceptions() will cause any uncaught exceptions to be cleared. @@ -1003,7 +1001,6 @@ QScriptEnginePrivate::~QScriptEnginePrivate() detachAllRegisteredScriptStrings(); qDeleteAll(m_qobjectData); qDeleteAll(m_typeInfos); - JSC::JSLock lock(false); globalData->heap.destroy(); globalData->deref(); while (freeScriptValues) { @@ -1292,7 +1289,6 @@ bool QScriptEnginePrivate::isCollecting() const void QScriptEnginePrivate::collectGarbage() { - JSC::JSLock lock(false); QScript::APIShim shim(this); globalData->heap.collectAllGarbage(); } @@ -1322,7 +1318,6 @@ JSC::JSValue QScriptEnginePrivate::evaluateHelper(JSC::ExecState *exec, intptr_t bool &compile) { Q_Q(QScriptEngine); - JSC::JSLock lock(false); // ### hmmm QBoolBlocker inEvalBlocker(inEval, true); q->currentContext()->activationObject(); //force the creation of a context for native function; @@ -2799,8 +2794,7 @@ void QScriptEnginePrivate::popContext() The exception state is cleared when evaluate() is called. - \sa uncaughtException(), uncaughtExceptionLineNumber(), - uncaughtExceptionBacktrace() + \sa uncaughtException(), uncaughtExceptionLineNumber() */ bool QScriptEngine::hasUncaughtException() const { @@ -2818,7 +2812,6 @@ bool QScriptEngine::hasUncaughtException() const message. \sa hasUncaughtException(), uncaughtExceptionLineNumber(), - uncaughtExceptionBacktrace() */ QScriptValue QScriptEngine::uncaughtException() const { @@ -2838,7 +2831,7 @@ QScriptValue QScriptEngine::uncaughtException() const Line numbers are 1-based, unless a different base was specified as the second argument to evaluate(). - \sa hasUncaughtException(), uncaughtExceptionBacktrace() + \sa hasUncaughtException() */ int QScriptEngine::uncaughtExceptionLineNumber() const { @@ -2850,7 +2843,7 @@ int QScriptEngine::uncaughtExceptionLineNumber() const /*! Returns a human-readable backtrace of the last uncaught exception. - Each line is of the form \c{<function-name>(<arguments>)@<file-name>:<line-number>}. + It is in the form \c{<function-name>()@<file-name>:<line-number>}. \sa uncaughtException() */ diff --git a/src/script/api/qscriptengineagent.cpp b/src/script/api/qscriptengineagent.cpp index c3d1566..b1f131e 100644 --- a/src/script/api/qscriptengineagent.cpp +++ b/src/script/api/qscriptengineagent.cpp @@ -372,9 +372,8 @@ void QScriptEngineAgent::functionExit(qint64 scriptId, /*! This function is called when the engine is about to execute a new statement in the script identified by \a scriptId. The statement - begins on the line and column specified by \a lineNumber and \a - columnNumber. This event is not generated for native Qt Script - functions. + begins on the line and column specified by \a lineNumber + This event is not generated for native Qt Script functions. Reimplement this function to handle this event. For example, a debugger implementation could reimplement this function to provide @@ -383,6 +382,8 @@ void QScriptEngineAgent::functionExit(qint64 scriptId, The default implementation does nothing. + \note \a columnNumber is undefined + \sa scriptLoad(), functionEntry() */ void QScriptEngineAgent::positionChange(qint64 scriptId, diff --git a/src/script/bridge/qscriptactivationobject.cpp b/src/script/bridge/qscriptactivationobject.cpp index 6a8ae56..85224d1 100644 --- a/src/script/bridge/qscriptactivationobject.cpp +++ b/src/script/bridge/qscriptactivationobject.cpp @@ -53,7 +53,7 @@ QScriptActivationObject::QScriptActivationObject(JSC::ExecState *callFrame, JSC: QScriptActivationObject::~QScriptActivationObject() { - delete d; + delete d_ptr(); } bool QScriptActivationObject::getOwnPropertySlot(JSC::ExecState* exec, const JSC::Identifier& propertyName, JSC::PropertySlot& slot) diff --git a/src/script/bridge/qscriptstaticscopeobject.cpp b/src/script/bridge/qscriptstaticscopeobject.cpp index 44548a4..940c859 100644 --- a/src/script/bridge/qscriptstaticscopeobject.cpp +++ b/src/script/bridge/qscriptstaticscopeobject.cpp @@ -87,7 +87,7 @@ QScriptStaticScopeObject::QScriptStaticScopeObject(WTF::NonNullPassRefPtr<JSC::S QScriptStaticScopeObject::~QScriptStaticScopeObject() { - delete d; + delete d_ptr(); } bool QScriptStaticScopeObject::getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot& slot) diff --git a/src/sql/drivers/tds/qsql_tds.h b/src/sql/drivers/tds/qsql_tds.h index f23a672..3594a4d 100644 --- a/src/sql/drivers/tds/qsql_tds.h +++ b/src/sql/drivers/tds/qsql_tds.h @@ -48,7 +48,10 @@ #ifdef Q_OS_WIN32 #define WIN32_LEAN_AND_MEAN +#ifndef Q_USE_SYBASE #define DBNTWIN32 // indicates 32bit windows dblib +#endif +#include <winsock2.h> #include <QtCore/qt_windows.h> #include <sqlfront.h> #include <sqldb.h> diff --git a/src/sql/drivers/tds/qsql_tds.pri b/src/sql/drivers/tds/qsql_tds.pri index c552ead..037f793 100644 --- a/src/sql/drivers/tds/qsql_tds.pri +++ b/src/sql/drivers/tds/qsql_tds.pri @@ -1,8 +1,10 @@ HEADERS += $$PWD/qsql_tds.h SOURCES += $$PWD/qsql_tds.cpp -unix { +unix|win32-g++: { + !isEmpty(QT_LFLAGS_TDS):!static:LIBS *= $$QT_LFLAGS_TDS !contains(LIBS, .*sybdb.*):LIBS += -lsybdb + QMAKE_CXXFLAGS *= $$QT_CFLAGS_TDS } else:win32-borland { LIBS *= $(BCB)/lib/PSDK/NTWDBLIB.LIB } else { diff --git a/src/sql/kernel/qsqldatabase.cpp b/src/sql/kernel/qsqldatabase.cpp index 324a3ce..1cf5fde 100644 --- a/src/sql/kernel/qsqldatabase.cpp +++ b/src/sql/kernel/qsqldatabase.cpp @@ -60,7 +60,10 @@ #include "../drivers/oci/qsql_oci.h" #endif #ifdef QT_SQL_TDS +// conflicting RETCODE typedef between odbc and freetds +#define RETCODE DBRETCODE #include "../drivers/tds/qsql_tds.h" +#undef RETCODE #endif #ifdef QT_SQL_DB2 #include "../drivers/db2/qsql_db2.h" diff --git a/src/src.pro b/src/src.pro index 9704716..f856a0c 100644 --- a/src/src.pro +++ b/src/src.pro @@ -112,6 +112,7 @@ src_webkit_declarative.target = sub-webkitdeclarative src_declarative.depends = src_gui src_script src_network src_plugins.depends = src_gui src_sql src_svg src_multimedia src_s60installs.depends = $$TOOLS_SUBDIRS $$SRC_SUBDIRS + src_s60installs.depends -= src_s60installs src_imports.depends = src_gui src_declarative contains(QT_CONFIG, webkit) { src_webkit.depends = src_gui src_sql src_network diff --git a/src/testlib/qtestfilelogger.cpp b/src/testlib/qtestfilelogger.cpp index a5cdc80..9d1ee6a 100644 --- a/src/testlib/qtestfilelogger.cpp +++ b/src/testlib/qtestfilelogger.cpp @@ -44,6 +44,8 @@ #include "QtTest/private/qtestlog_p.h" #include "QtTest/private/qtestresult_p.h" +#include <QtCore/qdir.h> + #include <stdlib.h> #include <stdio.h> @@ -69,11 +71,19 @@ QTestFileLogger::~QTestFileLogger() void QTestFileLogger::init() { char filename[100]; + int index = 0; +#if defined(Q_OS_SYMBIAN) + QByteArray ba(QDir::toNativeSeparators(QString(QDir::homePath()+QDir::separator())).toUtf8()); + index = ba.length(); + QTest::qt_snprintf(filename, sizeof(filename), "%s%s.log", + ba.constData(), QTestResult::currentTestObjectName()); +#else QTest::qt_snprintf(filename, sizeof(filename), "%s.log", QTestResult::currentTestObjectName()); - - // Keep filenames simple - for (uint i = 0; i < sizeof(filename) && filename[i]; ++i) { +#endif + + // Keep filenames simple + for (uint i = index; i < sizeof(filename) && filename[i]; ++i) { char& c = filename[i]; if (!((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') || c == '-' || c == '.')) { diff --git a/src/tools/moc/moc.cpp b/src/tools/moc/moc.cpp index 84d1567..ac49d65 100644 --- a/src/tools/moc/moc.cpp +++ b/src/tools/moc/moc.cpp @@ -1211,7 +1211,7 @@ bool Moc::until(Token target) { //when searching commas within the default argument, we should take care of template depth (anglecount) // unfortunatelly, we do not have enough semantic information to know if '<' is the operator< or - // the begining of a template type. so we just use heuristics. + // the beginning of a template type. so we just use heuristics. int possible = -1; while (index < symbols.size()) { diff --git a/src/xml/dom/qdom.cpp b/src/xml/dom/qdom.cpp index 1267e7e..662c796 100644 --- a/src/xml/dom/qdom.cpp +++ b/src/xml/dom/qdom.cpp @@ -7418,8 +7418,10 @@ bool QDomHandler::startElement(const QString& nsURI, const QString&, const QStri n = doc->createElement(qName); } - if (n) - n->setLocation(locator->lineNumber(), locator->columnNumber()); + if (!n) + return false; + + n->setLocation(locator->lineNumber(), locator->columnNumber()); node->appendChild(n); node = n; diff --git a/src/xmlpatterns/api/qabstractxmlnodemodel.cpp b/src/xmlpatterns/api/qabstractxmlnodemodel.cpp index 7f2ad9f..0f9760d 100644 --- a/src/xmlpatterns/api/qabstractxmlnodemodel.cpp +++ b/src/xmlpatterns/api/qabstractxmlnodemodel.cpp @@ -1355,7 +1355,7 @@ bool QXmlItem::isNull() const QAbstractXmlNodeModel for its existence, the only way you can create an instance of QXmlNodeModelIndex is by asking the node model to create one for you with QAbstractXmlNodeModel::createIndex(). Since - that function is protected, it is usually a good ide to write a + that function is protected, it is usually a good idea to write a public function that creates a QXmlNodeModelIndex from arguments that are appropriate for your particular node model. diff --git a/src/xmlpatterns/api/qxmlquery.cpp b/src/xmlpatterns/api/qxmlquery.cpp index 0129af7..4d6a3b6 100644 --- a/src/xmlpatterns/api/qxmlquery.cpp +++ b/src/xmlpatterns/api/qxmlquery.cpp @@ -151,8 +151,8 @@ QT_BEGIN_NAMESPACE \endcode \note For the current release, XSLT support should be considered - experimental. See section \l{Using XML technologies#XSLT - 2.0}{XSLT conformance} for details. + experimental. See section \l{XQuery#XSLT 2.0} {XSLT conformance} for + details. Stylesheet parameters are bound using bindVariable(). @@ -291,8 +291,7 @@ QXmlQuery::QXmlQuery(const QXmlNamePool &np) : d(new QXmlQueryPrivate(np)) create instances of QXmlQuery for running XQueries. \note The XSL-T support in this release is considered experimental. - See the \l{Using XML technologies#XSLT 2.0}{XSLT conformance} for - details. + See the \l{XQuery#XSLT 2.0} {XSLT conformance} for details. \since 4.5 \sa queryLanguage() diff --git a/src/xmlpatterns/data/qabstractdatetime.cpp b/src/xmlpatterns/data/qabstractdatetime.cpp index 6329fbe..a298698 100644 --- a/src/xmlpatterns/data/qabstractdatetime.cpp +++ b/src/xmlpatterns/data/qabstractdatetime.cpp @@ -163,7 +163,7 @@ QDateTime AbstractDateTime::create(AtomicValue::Ptr &errorMessage, QString msecondsStr(getSafeCapt(mseconds)); if(!msecondsStr.isEmpty()) - msecondsStr = msecondsStr.leftJustified(3, QLatin1Char('0')); + msecondsStr = msecondsStr.leftJustified(3, QLatin1Char('0'), true); const MSecondProperty msecs = msecondsStr.toInt(); if(hour == 24) |