pax_global_header00006660000000000000000000000064132274532740014523gustar00rootroot0000000000000052 comment=b98821a7fd65ddb3f449cf9d82efdb42a4676974 PackageKit-Qt-1.0.1/000077500000000000000000000000001322745327400141075ustar00rootroot00000000000000PackageKit-Qt-1.0.1/.gitignore000066400000000000000000000000241322745327400160730ustar00rootroot00000000000000build/ *~ *.o *.moc PackageKit-Qt-1.0.1/AUTHORS000066400000000000000000000002031322745327400151520ustar00rootroot00000000000000Daniel Nicoletti Matthias Klumpp Qt5 Port: Martin Grimme PackageKit-Qt-1.0.1/CMakeLists.txt000066400000000000000000000040341322745327400166500ustar00rootroot00000000000000cmake_minimum_required(VERSION 3.1) cmake_policy(SET CMP0048 NEW) if (POLICY CMP0043) cmake_policy(SET CMP0043 NEW) endif() if (POLICY CMP0063) cmake_policy(SET CMP0063 NEW) endif() project(packagekit-qt VERSION 1.0.1) # Used to set installation paths set(CMAKE_AUTOMOC ON) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(BUILD_SHARED_LIBS ON) set(CMAKE_INSTALL_RPATH_USE_LINK_PATH ON) include(GNUInstallDirs) set(QPACKAGEKIT_API_LEVEL "1") add_definitions( -DQT_NO_KEYWORDS -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_STRICT_ITERATORS -DQT_NO_URL_CAST_FROM_STRING -DQT_NO_CAST_FROM_BYTEARRAY -DQT_USE_QSTRINGBUILDER -DQT_NO_SIGNALS_SLOTS_KEYWORDS -DQT_USE_FAST_OPERATOR_PLUS -DQT_DISABLE_DEPRECATED_BEFORE=0x050900 ) # Forbid in-tree building if(${CMAKE_SOURCE_DIR} MATCHES ${CMAKE_BINARY_DIR}) message(STATUS "Please do an out-of-tree build:") message(STATUS "rm -f CMakeCache.txt && mkdir build && cd build; cmake .. && make") message(FATAL_ERROR "In-tree-build detected!") endif() if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) set(CMAKE_INSTALL_PREFIX "/usr" CACHE PATH "QPK default install prefix" FORCE) endif() set(CMAKE_CXX_VISIBILITY_PRESET hidden) set(CMAKE_VISIBILITY_INLINES_HIDDEN 1) # # Configure files # set (GETTEXT_PACKAGE "packagekit") set (VERSION "${QPACKAGEKIT_VERSION}") set (LOCALSTATEDIR "/var") set (CMAKECONFIG_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/packagekitqt5/") add_definitions("-DLOCALSTATEDIR=\"${LOCALSTATEDIR}\"") configure_file(config.h.in ${CMAKE_BINARY_DIR}/config.h) # # Custom C flags # option (DISABLE_MAINTAINER_CFLAGS "Disable maintainer CFlags" ON) if (NOT DISABLE_MAINTAINER_CFLAGS) set (MAINTAINER_CFLAGS "-Werror -Wall -Wcast-align -Wno-uninitialized -Wempty-body -Wformat-security -Winit-self") add_definitions(${MAINTAINER_CFLAGS}) endif () add_subdirectory(src) install(EXPORT PackageKitQtTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE PackageKitQtTargets.cmake NAMESPACE PK:: COMPONENT Devel) PackageKit-Qt-1.0.1/COPYING000066400000000000000000000636421322745327400151550ustar00rootroot00000000000000 GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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. Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! PackageKit-Qt-1.0.1/MAINTAINERS000066400000000000000000000002071322745327400156030ustar00rootroot00000000000000Daniel Nicoletti E-mail: dantti12@gmail.com Matthias Klumpp E-mail: matthias@tenstral.net Richard Hughes E-mail: richard@hughsie.com PackageKit-Qt-1.0.1/NEWS000066400000000000000000000124461322745327400146150ustar00rootroot00000000000000Version 0.9.6 ~~~~~~~~~~~~~ Released: 2016-09-20 Features: * Use Qt 5 by default (Aleix Pol) * Drop Qt4 support from PK-Qt (Aleix Pol) * Make use of QLoggingCategory packagekitqt (Daniel Nicoletti) * Change default visibility to hidden (Daniel Nicoletti) * Require at least Qt 5.6 (Matthias Klumpp) Bugfixes: * Fix compilation with strict QString() constructors on a host application (Aleix Pol) * Move enumTo/FromString code from header to cpp file (Aleix Pol) * No need to have random files marked as executable (Aleix Pol) * Reduce changes between QString <-> QByteArray (Aleix Pol) * Properly expose enums for introspection (Aleix Pol) Version 0.9.5 ~~~~~~~~~~~~~ Released: 2014-10-10 New Features: - Add operator== to bitfield (Daniel Nicoletti) Bugfixes: - Deprecate ::packageIcon methods (Aleix Pol) - Disable namespacing and classes names on the generated interfaces (Daniel Nicoletti) - Don't assume the target is packagekitqt5 (Aleix Pol) - Fix compilation due to not-set cmake variable (Matthias Klumpp) - Fix documentation (Aleix Pol) - Fix QPK include dir in cmake module (Matthias Klumpp) - Properly export cmake targets (Aleix Pol) - Remove daemon proxy conection to changed() (Daniel Nicoletti) - Remove RoleUpgradeSystem as it's not supported in 0.9.x anymore (Daniel Nicoletti) - Remove the metatype registration for Transaction types (Daniel Nicoletti) - Support RPATH by default (Aleix Pol) - Use GNUInstallDirs to determine most of used variables (Hrvoje Senjan) - Use "PackageKit" as the include namespace rather than the library name (Aleix Pol) Version 0.9.2 ~~~~~~~~~~~~~ Released: 2013-04-29 Notes: - Update to new PK API 0.9 (Daniel Nicoletti) - Applied a series of patches to port to Qt5 (Martin Grimme) New Features: - Add GetDetailsLocal, GetFilesLocal and RepoRemove (Daniel Nicoletti) - Make use of DBus Properties changed to make less blocking calls (Daniel Nicoletti) Bugfixes: - Allow for Details to be empty constructed (Daniel Nicoletti) - Cleaned include directive (Martin Grimme) - Finish the API changes to get rid of blocking calls (Daniel Nicoletti) - Fix CMake var names for both Qt versions (Daniel Nicoletti) - Fix libdir path (Daniel Nicoletti) - Fix reply signature for Transaction methods (Daniel Nicoletti) - Improve object handlying (Daniel Nicoletti) - I think the API level should be hidden from libname (Daniel Nicoletti) - Keep only one transaction flags, which is unlikely to change (Daniel Nicoletti) - PackageKit doesn't has a changed signal anymore (Daniel Nicoletti) - Properly delete private data on daemon as DaemonPrivate is not a QObject (Daniel Nicoletti) - Properly handle new Details signal (Daniel Nicoletti) - Properly init some Daemon values (Daniel Nicoletti) - Queue signals so that all transaction properties are available when needed (Daniel Nicoletti) - Remove debug info (Daniel Nicoletti) - Update Roles enum, remove Provides enum, and fix some docs typos (Daniel Nicoletti) Version 0.8.8 ~~~~~~~~~~~~~ Released: 2013-05-09 New Features: - Adding Provides property to Daemon (Daniel Nicoletti) - Adding some Meta information (Daniel Nicoletti) - Adds the transactionFlags to the Transaction class (Daniel Nicoletti) - Add TransactionFlags registration (Daniel Nicoletti) - Implement connectNotify and disconnectNotify (Daniel Nicoletti) Bugfixes: - Add missing declare enums (Daniel Nicoletti) - Fix searchGroups() be iterating over the flaged values (Daniel Nicoletti) - Ignore Interface isValid() check (Daniel Nicoletti) - Improve error handling and make it easier for QML use it (Daniel Nicoletti) - Make sure we set an error if we fail to contact PackageKit (Daniel Nicoletti) - Use the correct version of the LGPL library (Richard Hughes) Version 0.8.7 ~~~~~~~~~~~~~ Released: 2012-01-17 Notes: New Features: - Add back the destroy() signal, it might be useful for fast transactions (Daniel Nicoletti) - Compress release tarballs using LZMA by default (Matthias Klumpp) Bugfixes: - For some reason QML doesn't work with typedef enum (Daniel Nicoletti) - Make our package spliters static (Daniel Nicoletti) - Make sure we waitForFinishe() when getting the TransactionList (Daniel Nicoletti) - Only call Cancel() if the transaction proxy exist (Daniel Nicoletti) - The full namespace is needed for a slot to be called (Daniel Nicoletti) - Workaround Qt bug not contructing default values when the call fails (Daniel Nicoletti) Version 0.8.6 ~~~~~~~~~~~~~ Released: 2012-11-26 Notes: - This is the first release of Packagekit-Qt which has been split out of the main PackageKit project. - This project is decoupled from the main PackageKit project from this point onwards and does not subscribe to the same API and ABI promises of PackageKit. That said, it's no co-incidence that this tarball release happened on the same day as the PackageKit release :) New Features: - Add packagekit-qt library from the PackageKit project (Daniel Nicoletti) - Added release instructions and simple release-script (Matthias Klumpp) - Added versioning, Qt4 support and installed basic files (Matthias Klumpp) - Created basic project and CMake skeleton (Matthias Klumpp) Bugfixes: - Add bitfield.h to the files to install (Daniel Nicoletti) - Always make sure DBus interface specs are present (Matthias Klumpp) - Fix QPK API level (Matthias Klumpp) PackageKit-Qt-1.0.1/README.md000066400000000000000000000004131322745327400153640ustar00rootroot00000000000000# PackageKit-Qt Qt bindings for PackageKit ## PackageKit PackageKit is a DBUS abstraction layer that allows the session user to manage packages in a secure way using a cross-distro, cross-architecture API. For more information, please see http://www.packagekit.org PackageKit-Qt-1.0.1/RELEASE000066400000000000000000000023451322745327400151160ustar00rootroot00000000000000PackageKit-Qt Release Notes 1. Write NEWS entries for PackageKit-Qt in the same format as usual. git shortlog QPACKAGEKIT_0_9_6.. | grep -i -v trivial | grep -v Merge > NEWS.new -------------------------------------------------------------------------------- Version 0.9.7 ~~~~~~~~~~~~~ Released: 2014-xx-xx Notes: Features: Bugfixes: -------------------------------------------------------------------------------- 2. Update library version if new ABI or API in CMakeLists.txt 3. Commit changes in PackageKit-Qt git: git commit -a -m "Release version 0.9.7" git tag -s -f -m "Release 0.9.7" QPACKAGEKIT_0_9_7 git push --tags git push 4. run './release.sh --version=0.9.7 --git-tag=QPACKAGEKIT_0_9_7 --sign' 5. Upload tarball to: scp *.tar.* annarchy.freedesktop.org:/srv/www.freedesktop.org/www/software/PackageKit/releases/ 6. Do post release version bump in CMakeLists.txt, RELEASE 7. Commit trivial changes: git commit -a -m "trivial: post release version bump" git push 8. Send an email to packagekit@lists.freedesktop.org ================================================= PackageKit-Qt 0.9.7 released! Tarballs available here: http://www.packagekit.org/releases/ ================================================= PackageKit-Qt-1.0.1/TODO000066400000000000000000000001111322745327400145700ustar00rootroot00000000000000*** Timeframe: Everytime *** * Fix all bugs, implement new features :-) PackageKit-Qt-1.0.1/config.h.in000066400000000000000000000012211322745327400161260ustar00rootroot00000000000000#ifndef CONFIG_H #define CONFIG_H /* always defined to indicate that i18n is enabled */ #define ENABLE_NLS 1 /* Gettext Package */ #define GETTEXT_PACKAGE "@GETTEXT_PACKAGE@" /* Name of package */ #define PACKAGE_NAME "packagekit-qt" /* Define to the address where bug reports for this package should be sent. */ #define PACKAGE_BUGREPORT "http://www.packagekit.org/pk-bugs.html" /* Define to the home page for this package. */ #define PACKAGE_URL "http://packagekit.org" /* Define to the version of this package. */ #define PACKAGE_VERSION "@PROJECT_VERSION@" /* Version number of package */ #define VERSION "@PROJECT_VERSION@" #endif /*CONFIG_H*/ PackageKit-Qt-1.0.1/release.sh000077500000000000000000000032721322745327400160720ustar00rootroot00000000000000#!/bin/bash # # Create QPK release tarball from version control system # # (c) 2011 Matthias Klumpp # GPLv2+ set -e OPTION_SPEC="version:,git-tag:,sign" PARSED_OPTIONS=$(getopt -n "$0" -a -o h --l "$OPTION_SPEC" -- "$@") eval set -- "$PARSED_OPTIONS" if [ $? != 0 ] ; then usage ; exit 1 ; fi while true ; do case "$1" in --version ) case "$2" in "") echo "version parameter needs an argument!"; exit 3 ;; *) export QPK_VERSION=$2 ; shift 2 ;; esac ;; --git-tag ) case "$2" in "") echo "git-tag parameter needs an argument!"; exit 3 ;; *) export GIT_TAG=$2 ; shift 2 ;; esac ;; --sign ) SIGN_RELEASE=1; shift; ;; --) shift ; break ;; * ) echo "ERROR: unknown flag $1"; exit 2;; esac done if [ "$QPK_VERSION" = "" ]; then echo "No PackageKit-Qt version set!" exit 1 fi if [ "$GIT_TAG" = "" ]; then echo "No Git tag set!" exit 1 fi rm -rf ./release-tar-tmp # check if we can build PackageKit-Qt mkdir -p ./t-build-release make -C ./build clean all rm -rf ./t-build-release mkdir -p ./release-tar-tmp git archive --prefix="PackageKit-Qt-$QPK_VERSION/" "$GIT_TAG^{tree}" | tar -x -C ./release-tar-tmp R_ROOT="./release-tar-tmp/PackageKit-Qt-$QPK_VERSION" # cleanup files which should not go to the release tarball find ./release-tar-tmp -name .gitignore -type f -delete rm $R_ROOT/release.sh rm $R_ROOT/RELEASE # create release tarball cd ./release-tar-tmp tar cvJf "PackageKit-Qt-$QPK_VERSION.tar.xz" "./PackageKit-Qt-$QPK_VERSION/" mv "PackageKit-Qt-$QPK_VERSION.tar.xz" ../ cd .. # cleanup rm -r ./release-tar-tmp # sign release, if flag is set if [ "$SIGN_RELEASE" = "1" ]; then gpg --armor --sign --detach-sig "PackageKit-Qt-$QPK_VERSION.tar.xz" fi PackageKit-Qt-1.0.1/src/000077500000000000000000000000001322745327400146765ustar00rootroot00000000000000PackageKit-Qt-1.0.1/src/CMakeLists.txt000066400000000000000000000041771322745327400174470ustar00rootroot00000000000000# CMakeLists for PackageKit-Qt library find_package(Qt5 5.6 REQUIRED COMPONENTS Core DBus) set(packagekitqt_HEADERS Daemon Transaction common.h daemon.h transaction.h Details details.h bitfield.h packagekitqt_global.h offline.h Offline ) set(packagekitqt_SRC bitfield.cpp daemon.cpp daemonprivate.cpp transaction.cpp transactionprivate.cpp details.cpp offline.cpp ) find_path(PK_INTERFACES_DIR org.freedesktop.PackageKit.xml HINTS ${CMAKE_INSTALL_PREFIX} /usr PATH_SUFFIXES share/dbus-1/interfaces/ ) set(PK_INTERFACE_XML "${PK_INTERFACES_DIR}/org.freedesktop.PackageKit.xml") set(PK_TRANSACTION_INTERFACE_XML "${PK_INTERFACES_DIR}/org.freedesktop.PackageKit.Transaction.xml") if (NOT PK_INTERFACE_XML OR NOT PK_TRANSACTION_INTERFACE_XML) message (FATAL_ERROR "Unable to find PackageKit DBus specifications! Please install PackageKit to continue!") endif () set_source_files_properties(${PK_INTERFACE_XML} PROPERTIES NO_NAMESPACE true) set_source_files_properties(${PK_TRANSACTION_INTERFACE_XML} PROPERTIES NO_NAMESPACE true) qt5_add_dbus_interface(packagekitqt_SRC ${PK_INTERFACE_XML} daemonproxy) qt5_add_dbus_interface(packagekitqt_SRC ${PK_TRANSACTION_INTERFACE_XML} transactionproxy) add_library(packagekitqt5 ${packagekitqt_SRC} ${packagekitqt_HEADERS} ${packagekitqt_HEADERS_PRIVATE}) set_target_properties(packagekitqt5 PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION ${QPACKAGEKIT_API_LEVEL}) target_link_libraries(packagekitqt5 PUBLIC Qt5::DBus) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/packagekitqt5.pc.in ${CMAKE_CURRENT_BINARY_DIR}/packagekitqt5.pc @ONLY ) target_include_directories(packagekitqt5 INTERFACE "$") install(TARGETS packagekitqt5 EXPORT PackageKitQtTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/packagekitqt5.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig ) install(FILES ${packagekitqt_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/packagekitqt5/PackageKit/ ) add_subdirectory(modules) PackageKit-Qt-1.0.1/src/Daemon000066400000000000000000000000241322745327400160200ustar00rootroot00000000000000#include "daemon.h" PackageKit-Qt-1.0.1/src/Details000066400000000000000000000000251322745327400162030ustar00rootroot00000000000000#include "details.h" PackageKit-Qt-1.0.1/src/Doxyfile000066400000000000000000001453421322745327400164150ustar00rootroot00000000000000# Doxyfile 1.5.2 # 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 = QPackageKit2 # 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 = 2.0 # 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 = ../../docs/packagekit-qt2 # 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, Finnish, French, German, Greek, Hungarian, # Italian, Japanese, Japanese-en (Japanese with English messages), Korean, # Korean-en, Lithuanian, Norwegian, Polish, Portuguese, Romanian, Russian, # Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian. 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 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 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 = 4 # 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 # 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 # 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 #--------------------------------------------------------------------------- # 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 = YES # 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 = YES # 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 = NO # 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 = 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_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 # 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 , where is the value of # the FILE_VERSION_FILTER tag, and 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 = #--------------------------------------------------------------------------- # 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 = daemon.h transaction.h package.h signature.h eula.h # 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 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 = *private* *proxy* polkitclient* util.* # 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 # Exlude signal wrappers EXCLUDE_SYMBOLS = EXCLUDE_SYMBOLS += __emit* # 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 , where # is the value of the INPUT_FILTER tag, and 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 (the default) # 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 (the default) # 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 documentstion. REFERENCES_LINK_SOURCE = NO # 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 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 = NO # 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 = NO # 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_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 # 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 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 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 MAX_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 will always # show the root nodes and its direct children regardless of this setting. DOT_GRAPH_MAX_NODES = 50 # Set the DOT_TRANSPARENT tag to YES to generate images with a transparent # background. This is disabled by default, which results in a white background. # 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 = NO # 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 PackageKit-Qt-1.0.1/src/Offline000066400000000000000000000000251322745327400162000ustar00rootroot00000000000000#include "offline.h" PackageKit-Qt-1.0.1/src/Transaction000066400000000000000000000000311322745327400171000ustar00rootroot00000000000000#include "transaction.h" PackageKit-Qt-1.0.1/src/bitfield.cpp000066400000000000000000000037401322745327400171700ustar00rootroot00000000000000/* * This file is part of the QPackageKit project * Copyright (C) 2010-2016 Daniel Nicoletti * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 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 * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "bitfield.h" using namespace PackageKit; Bitfield::Bitfield () { } Bitfield::Bitfield (qulonglong val) : m_val (val) { } Bitfield::~Bitfield () { } qulonglong Bitfield::operator& (qulonglong mask) const { return m_val & (1ULL << mask); } qulonglong Bitfield::operator&= (qulonglong mask) { m_val &= (1ULL << mask); return m_val; } qulonglong Bitfield::operator| (qulonglong mask) const { return m_val | (1ULL << mask); } qulonglong Bitfield::operator|= (qulonglong mask) { m_val |= (1ULL << mask); return m_val; } Bitfield Bitfield::operator& (Bitfield mask) const { return m_val & mask.m_val; } Bitfield Bitfield::operator&= (Bitfield mask) { m_val &= mask.m_val; return m_val; } Bitfield Bitfield::operator| (Bitfield mask) const { return m_val | mask.m_val; } Bitfield Bitfield::operator|= (Bitfield mask) { m_val |= mask.m_val; return m_val; } Bitfield& Bitfield::operator= (const Bitfield& other) { if (this == &other) return *this; m_val = other.m_val; return *this; } bool Bitfield::operator==(const Bitfield &other) { return m_val == other.m_val; } PackageKit-Qt-1.0.1/src/bitfield.h000066400000000000000000000033241322745327400166330ustar00rootroot00000000000000/* * This file is part of the QPackageKit project * Copyright (C) 2010-2016 Daniel Nicoletti * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 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 * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef PACKAGEKIT_BITFIELD_H #define PACKAGEKIT_BITFIELD_H #include #include #include namespace PackageKit { class PACKAGEKITQT_LIBRARY Bitfield { public: Bitfield (); Bitfield (qulonglong val); ~Bitfield (); qulonglong operator& (qulonglong mask) const; qulonglong operator&= (qulonglong mask); qulonglong operator| (qulonglong mask) const; qulonglong operator|= (qulonglong mask); Bitfield operator& (Bitfield mask) const; Bitfield operator&= (Bitfield mask); Bitfield operator| (Bitfield mask) const; Bitfield operator|= (Bitfield mask); Bitfield& operator= (const Bitfield& other); bool operator==(const Bitfield &other); private: qulonglong m_val = 0; }; } // End namespace PackageKit Q_DECLARE_METATYPE(PackageKit::Bitfield) #endif PackageKit-Qt-1.0.1/src/common.h000066400000000000000000000034171322745327400163440ustar00rootroot00000000000000/* * This file is part of the QPackageKit project * Copyright (C) 2008 Adrien Bustany * Copyright (C) 2010-2018 Daniel Nicoletti * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 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 * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #define AUTH_PACKAGE_INSTALL "org.freedesktop.packagekit.package-install" #define AUTH_PACKAGE_INSTALL_UNTRUSTED "org.freedesktop.packagekit.package-install-untrusted" #define AUTH_SYSTEM_TRUST_SIGNING_KEY "org.freedesktop.packagekit.system-trust-signing-key" #define AUTH_PACKAGE_EULA_ACCEPT "org.freedesktop.packagekit.package-eula-accept" #define AUTH_PACKAGE_REMOVE "org.freedesktop.packagekit.package-remove" #define AUTH_SYSTEM_UPDATE "org.freedesktop.packagekit.system-update" #define AUTH_SYSTEM_SOURCES_CONFIGURE "org.freedesktop.packagekit.system-sources-configure" #define AUTH_SYSTEM_SOURCES_REFRESH "org.freedesktop.packagekit.system-sources-refresh" #define AUTH_SYSTEM_NETWORK_PROXY_CONFIGURE "org.freedesktop.packagekit.system-network-proxy-configure" #define AUTH_CANCEL_FOREIGN "org.freedesktop.packagekit.cancel-foreign" PackageKit-Qt-1.0.1/src/daemon.cpp000066400000000000000000000475601322745327400166610ustar00rootroot00000000000000/* * This file is part of the QPackageKit project * Copyright (C) 2008 Adrien Bustany * Copyright (C) 2010-2018 Daniel Nicoletti * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 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 * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "daemon.h" #include "daemonprivate.h" #include "transactionprivate.h" #include "daemonproxy.h" #include "common.h" Q_LOGGING_CATEGORY(PACKAGEKITQT_DAEMON, "packagekitqt.daemon") Q_LOGGING_CATEGORY(PACKAGEKITQT_OFFLINE, "packagekitqt.offline") using namespace PackageKit; Daemon* Daemon::m_global = nullptr; Daemon* Daemon::global() { if(!m_global) { m_global = new Daemon(qApp); } return m_global; } Daemon::Daemon(QObject *parent) : QObject(parent), d_ptr(new DaemonPrivate(this)) { Q_D(Daemon); d->daemon = new ::OrgFreedesktopPackageKitInterface(PK_NAME, PK_PATH, QDBusConnection::systemBus(), this); QDBusConnection::systemBus().connect(PK_NAME, PK_PATH, DBUS_PROPERTIES, QLatin1String("PropertiesChanged"), this, SLOT(propertiesChanged(QString,QVariantMap,QStringList))); } void DaemonPrivate::setupSignal(const QMetaMethod &signal) { Q_Q(Daemon); const char *signalToConnect = 0; const char *memberToConnect = 0; if (signal == QMetaMethod::fromSignal(&Daemon::repoListChanged)) { signalToConnect = SIGNAL(RepoListChanged()); memberToConnect = SIGNAL(repoListChanged()); } else if (signal == QMetaMethod::fromSignal(&Daemon::restartScheduled)) { signalToConnect = SIGNAL(RestartSchedule()); memberToConnect = SIGNAL(restartScheduled()); } else if (signal == QMetaMethod::fromSignal(&Daemon::transactionListChanged)) { signalToConnect = SIGNAL(TransactionListChanged(QStringList)); memberToConnect = SIGNAL(transactionListChanged(QStringList)); } else if (signal == QMetaMethod::fromSignal(&Daemon::updatesChanged)) { signalToConnect = SIGNAL(UpdatesChanged()); memberToConnect = SIGNAL(updatesChanged()); } if (signalToConnect && memberToConnect) { QObject::connect(daemon, signalToConnect, q, memberToConnect); } } void Daemon::connectNotify(const QMetaMethod &signal) { Q_D(Daemon); if (!d->connectedSignals.contains(signal) && d->daemon) { d->setupSignal(signal); d->connectedSignals << signal; } } void Daemon::disconnectNotify(const QMetaMethod &signal) { QObject::disconnectNotify(signal); } Daemon::~Daemon() { delete d_ptr; } bool Daemon::isRunning() { return global()->d_ptr->running; } Transaction::Roles Daemon::roles() { return global()->d_ptr->roles; } QString Daemon::backendName() { return global()->d_ptr->backendName; } QString Daemon::backendDescription() { return global()->d_ptr->backendDescription; } QString Daemon::backendAuthor() { return global()->d_ptr->backendAuthor; } Transaction::Filters Daemon::filters() { return global()->d_ptr->filters; } Transaction::Groups Daemon::groups() { return global()->d_ptr->groups; } bool Daemon::locked() { return global()->d_ptr->locked; } QStringList Daemon::mimeTypes() { return global()->d_ptr->mimeTypes; } Daemon::Network Daemon::networkState() { return global()->d_ptr->networkState; } QString Daemon::distroID() { return global()->d_ptr->distroId; } QDBusPendingReply Daemon::canAuthorize(const QString &actionId) { return global()->d_ptr->daemon->CanAuthorize(actionId); } QDBusPendingReply Daemon::createTransaction() { return global()->d_ptr->daemon->CreateTransaction(); } QDBusPendingReply Daemon::getTimeSinceAction(Transaction::Role role) { return global()->d_ptr->daemon->GetTimeSinceAction(role); } QDBusPendingReply > Daemon::getTransactionList() { return global()->d_ptr->daemon->GetTransactionList(); } void Daemon::setHints(const QStringList &hints) { global()->d_ptr->hints = hints; } void Daemon::setHints(const QString &hints) { global()->d_ptr->hints = QStringList{ hints }; } QStringList Daemon::hints() { return global()->d_ptr->hints; } QDBusPendingReply<> Daemon::setProxy(const QString& http_proxy, const QString& https_proxy, const QString& ftp_proxy, const QString& socks_proxy, const QString& no_proxy, const QString& pac) { return global()->d_ptr->daemon->SetProxy(http_proxy, https_proxy, ftp_proxy, socks_proxy, no_proxy, pac); } QDBusPendingReply<> Daemon::stateHasChanged(const QString& reason) { return global()->d_ptr->daemon->StateHasChanged(reason); } QDBusPendingReply<> Daemon::suggestDaemonQuit() { return global()->d_ptr->daemon->SuggestDaemonQuit(); } Offline *Daemon::offline() const { return global()->d_ptr->offline; } uint Daemon::versionMajor() { return global()->d_ptr->versionMajor; } uint Daemon::versionMinor() { return global()->d_ptr->versionMinor; } uint Daemon::versionMicro() { return global()->d_ptr->versionMicro; } QString Daemon::packageName(const QString &packageID) { return Transaction::packageName(packageID); } QString Daemon::packageVersion(const QString &packageID) { return Transaction::packageVersion(packageID); } QString Daemon::packageArch(const QString &packageID) { return Transaction::packageArch(packageID); } QString Daemon::packageData(const QString &packageID) { return Transaction::packageData(packageID); } Transaction *Daemon::acceptEula(const QString &eulaId) { auto ret = new Transaction; ret->d_ptr->role = Transaction::RoleAcceptEula; ret->d_ptr->eulaId = eulaId; return ret; } Transaction *Daemon::downloadPackages(const QStringList &packageIDs, bool storeInCache) { auto ret = new Transaction; ret->d_ptr->role = Transaction::RoleDownloadPackages; ret->d_ptr->search = packageIDs; ret->d_ptr->storeInCache = storeInCache; return ret; } Transaction *Daemon::downloadPackage(const QString &packageID, bool storeInCache) { return downloadPackages(QStringList{ packageID }, storeInCache); } Transaction *Daemon::getCategories() { auto ret = new Transaction; ret->d_ptr->role = Transaction::RoleGetCategories; return ret; } Transaction *Daemon::dependsOn(const QStringList &packageIDs, Transaction::Filters filters, bool recursive) { auto ret = new Transaction; ret->d_ptr->role = Transaction::RoleDependsOn; ret->d_ptr->search = packageIDs; ret->d_ptr->filters = filters; ret->d_ptr->recursive = recursive; return ret; } Transaction *Daemon::dependsOn(const QString &packageID, Transaction::Filters filters, bool recursive) { return dependsOn(QStringList{ packageID }, filters, recursive); } Transaction *Daemon::getDetails(const QStringList &packageIDs) { auto ret = new Transaction; ret->d_ptr->role = Transaction::RoleGetDetails; ret->d_ptr->search = packageIDs; return ret; } Transaction *Daemon::getDetails(const QString &packageID) { return getDetails(QStringList{ packageID }); } Transaction *Daemon::getDetailsLocal(const QStringList &files) { auto ret = new Transaction; ret->d_ptr->role = Transaction::RoleGetDetailsLocal; ret->d_ptr->search = files; return ret; } Transaction *Daemon::getDetailsLocal(const QString &file) { return getDetailsLocal(QStringList{ file }); } Transaction *Daemon::getFiles(const QStringList &packageIDs) { auto ret = new Transaction; ret->d_ptr->role = Transaction::RoleGetFiles; ret->d_ptr->search = packageIDs; return ret; } Transaction *Daemon::getFiles(const QString &packageID) { return getFiles(QStringList{ packageID }); } Transaction *Daemon::getFilesLocal(const QStringList &files) { auto ret = new Transaction; ret->d_ptr->role = Transaction::RoleGetFilesLocal; ret->d_ptr->search = files; return ret; } Transaction *Daemon::getFilesLocal(const QString &file) { return getFilesLocal(QStringList{ file }); } Transaction *Daemon::getOldTransactions(uint number) { auto ret = new Transaction; ret->d_ptr->role = Transaction::RoleGetOldTransactions; ret->d_ptr->numberOfOldTransactions = number; return ret; } Transaction *Daemon::getPackages(Transaction::Filters filters) { auto ret = new Transaction; ret->d_ptr->role = Transaction::RoleGetPackages; ret->d_ptr->filters = filters; return ret; } Transaction *Daemon::getRepoList(Transaction::Filters filters) { auto ret = new Transaction; ret->d_ptr->role = Transaction::RoleGetRepoList; ret->d_ptr->filters = filters; return ret; } Transaction *Daemon::requiredBy(const QStringList &packageIDs, Transaction::Filters filters, bool recursive) { auto ret = new Transaction; ret->d_ptr->role = Transaction::RoleRequiredBy; ret->d_ptr->search = packageIDs; ret->d_ptr->filters = filters; ret->d_ptr->recursive = recursive; return ret; } Transaction *Daemon::requiredBy(const QString &packageID, Transaction::Filters filters, bool recursive) { return requiredBy(QStringList{ packageID }, filters, recursive); } Transaction *Daemon::getUpdatesDetails(const QStringList &packageIDs) { auto ret = new Transaction; ret->d_ptr->role = Transaction::RoleGetUpdateDetail; ret->d_ptr->search = packageIDs; return ret; } Transaction *Daemon::getUpdateDetail(const QString &packageID) { return getUpdatesDetails(QStringList{ packageID }); } Transaction *Daemon::getUpdates(Transaction::Filters filters) { auto ret = new Transaction; ret->d_ptr->role = Transaction::RoleGetUpdates; ret->d_ptr->filters = filters; return ret; } Transaction *Daemon::getDistroUpgrades() { auto ret = new Transaction; ret->d_ptr->role = Transaction::RoleGetDistroUpgrades; return ret; } Transaction *Daemon::upgradeSystem(const QString &distroId, Transaction::UpgradeKind kind, Transaction::TransactionFlags flags) { auto ret = new Transaction; ret->d_ptr->role = Transaction::RoleUpgradeSystem; ret->d_ptr->upgradeDistroId = distroId; ret->d_ptr->upgradeKind = kind; ret->d_ptr->transactionFlags = flags; return ret; } Transaction *Daemon::installFiles(const QStringList &files, Transaction::TransactionFlags flags) { auto ret = new Transaction; ret->d_ptr->role = Transaction::RoleInstallFiles; ret->d_ptr->search = files; ret->d_ptr->transactionFlags = flags; return ret; } Transaction *Daemon::installFile(const QString &file, Transaction::TransactionFlags flags) { return installFiles(QStringList{ file }, flags); } Transaction *Daemon::installPackages(const QStringList &packageIDs, Transaction::TransactionFlags flags) { auto ret = new Transaction; ret->d_ptr->role = Transaction::RoleInstallPackages; ret->d_ptr->search = packageIDs; ret->d_ptr->transactionFlags = flags; return ret; } Transaction *Daemon::installPackage(const QString &packageID, Transaction::TransactionFlags flags) { return installPackages(QStringList{ packageID }, flags); } Transaction *Daemon::installSignature(Transaction::SigType type, const QString &keyID, const QString &packageID) { auto ret = new Transaction; ret->d_ptr->role = Transaction::RoleInstallSignature; ret->d_ptr->signatureType = type; ret->d_ptr->signatureKey = keyID; ret->d_ptr->signaturePackage = packageID; return ret; } Transaction *Daemon::refreshCache(bool force) { auto ret = new Transaction; ret->d_ptr->role = Transaction::RoleRefreshCache; ret->d_ptr->refreshCacheForce = force; return ret; } Transaction *Daemon::removePackages(const QStringList &packageIDs, bool allowDeps, bool autoremove, Transaction::TransactionFlags flags) { auto ret = new Transaction; ret->d_ptr->role = Transaction::RoleRemovePackages; ret->d_ptr->search = packageIDs; ret->d_ptr->allowDeps = allowDeps; ret->d_ptr->autoremove = autoremove; ret->d_ptr->transactionFlags = flags; return ret; } Transaction *Daemon::removePackage(const QString &packageID, bool allowDeps, bool autoremove, Transaction::TransactionFlags flags) { return removePackages(QStringList{ packageID }, allowDeps, autoremove, flags); } Transaction *Daemon::repairSystem(Transaction::TransactionFlags flags) { auto ret = new Transaction; ret->d_ptr->role = Transaction::RoleRepairSystem; ret->d_ptr->transactionFlags = flags; return ret; } Transaction *Daemon::repoEnable(const QString &repoId, bool enable) { auto ret = new Transaction; ret->d_ptr->role = Transaction::RoleRepoEnable; ret->d_ptr->repoId = repoId; ret->d_ptr->repoEnable = enable; return ret; } Transaction *Daemon::repoRemove(const QString &repoId, bool autoremove, Transaction::TransactionFlags flags) { auto ret = new Transaction; ret->d_ptr->role = Transaction::RoleRepoRemove; ret->d_ptr->repoId = repoId; ret->d_ptr->autoremove = autoremove; ret->d_ptr->transactionFlags = flags; return ret; } Transaction *Daemon::repoSetData(const QString &repoId, const QString ¶meter, const QString &value) { auto ret = new Transaction; ret->d_ptr->role = Transaction::RoleRepoSetData; ret->d_ptr->repoId = repoId; ret->d_ptr->repoParameter = parameter; ret->d_ptr->repoValue = value; return ret; } Transaction *Daemon::resolve(const QStringList &packageNames, Transaction::Filters filters) { auto ret = new Transaction; ret->d_ptr->role = Transaction::RoleResolve; ret->d_ptr->search = packageNames; ret->d_ptr->filters = filters; return ret; } Transaction *Daemon::resolve(const QString &packageName, Transaction::Filters filters) { return resolve(QStringList{ packageName }, filters); } Transaction *Daemon::searchFiles(const QStringList &search, Transaction::Filters filters) { auto ret = new Transaction; ret->d_ptr->role = Transaction::RoleSearchFile; ret->d_ptr->search = search; ret->d_ptr->filters = filters; return ret; } Transaction *Daemon::searchFiles(const QString &search, Transaction::Filters filters) { return searchFiles(QStringList{ search }, filters); } Transaction *Daemon::searchDetails(const QStringList &search, Transaction::Filters filters) { auto ret = new Transaction; ret->d_ptr->role = Transaction::RoleSearchDetails; ret->d_ptr->search = search; ret->d_ptr->filters = filters; return ret; } Transaction *Daemon::searchDetails(const QString &search, Transaction::Filters filters) { return searchDetails(QStringList{ search }, filters); } Transaction *Daemon::searchGroups(const QStringList &groups, Transaction::Filters filters) { auto ret = new Transaction; ret->d_ptr->role = Transaction::RoleSearchGroup; ret->d_ptr->search = groups; ret->d_ptr->filters = filters; return ret; } Transaction *Daemon::searchGroup(const QString &group, Transaction::Filters filters) { return searchGroups(QStringList{ group }, filters); } Transaction *Daemon::searchGroup(Transaction::Group group, Transaction::Filters filters) { QString groupString = Daemon::enumToString(group, "Group"); return searchGroup(groupString, filters); } Transaction *Daemon::searchGroups(Transaction::Groups groups, Transaction::Filters filters) { QStringList groupsStringList; for (int i = 1; i < 64; ++i) { if (groups & i) { Transaction::Group group = static_cast(i); if (group != Transaction::GroupUnknown) { groupsStringList << Daemon::enumToString(group, "Group"); } } } return searchGroups(groupsStringList, filters); } Transaction *Daemon::searchNames(const QStringList &search, Transaction::Filters filters) { auto ret = new Transaction; ret->d_ptr->role = Transaction::RoleSearchName; ret->d_ptr->search = search; ret->d_ptr->filters = filters; return ret; } Transaction *Daemon::searchNames(const QString &search, Transaction::Filters filters) { return searchNames(QStringList{ search }, filters); } Transaction *Daemon::updatePackages(const QStringList &packageIDs, Transaction::TransactionFlags flags) { auto ret = new Transaction; ret->d_ptr->role = Transaction::RoleUpdatePackages; ret->d_ptr->search = packageIDs; ret->d_ptr->transactionFlags = flags; return ret; } Transaction *Daemon::updatePackage(const QString &packageID, Transaction::TransactionFlags flags) { return updatePackages(QStringList{ packageID }, flags); } Transaction *Daemon::whatProvides(const QStringList &search, Transaction::Filters filters) { auto ret = new Transaction; ret->d_ptr->role = Transaction::RoleWhatProvides; ret->d_ptr->search = search; ret->d_ptr->filters = filters; return ret; } Transaction *Daemon::whatProvides(const QString &search, Transaction::Filters filters) { return whatProvides(QStringList{ search }, filters); } QString Daemon::enumToString(const QMetaObject &metaObject, int value, const char *enumName) { QString prefix = QLatin1String(enumName); int id = metaObject.indexOfEnumerator(enumName); QMetaEnum e = metaObject.enumerator(id); if (!e.isValid ()) { // qDebug() << "Invalid enum " << prefix; return QString(); } QString enumString = QString::fromLatin1(e.valueToKey(value)); if (enumString.isNull()) { // qDebug() << "Enum key not found while searching for value" << QString::number(value) << "in enum" << prefix; return QString(); } // Remove the prefix if(!prefix.isNull() && enumString.indexOf(prefix) == 0) { enumString.remove(0, prefix.length()); } QString pkName; for(int i = 0 ; i < enumString.length() - 1 ; ++i) { pkName += enumString[i]; if(enumString[i+1].isUpper()) pkName += QLatin1Char('-'); } pkName += enumString[enumString.length() - 1]; return pkName.toLower(); } int Daemon::enumFromString(const QMetaObject& metaObject, const QString &str, const char *enumName) { QString prefix = QLatin1String(enumName); QString realName; bool lastWasDash = false; QChar buf; for(int i = 0 ; i < str.length() ; ++i) { buf = str[i].toLower(); if(i == 0 || lastWasDash) { buf = buf.toUpper(); } lastWasDash = false; if(buf == QLatin1Char('-')) { lastWasDash = true; } else if(buf == QLatin1Char('~')) { lastWasDash = true; realName += QLatin1String("Not"); } else { realName += buf; } }; if (!prefix.isNull()) { realName = prefix + realName; } int id = metaObject.indexOfEnumerator(enumName); QMetaEnum e = metaObject.enumerator(id); int enumValue = e.keyToValue(realName.toLatin1().data()); if (enumValue == -1) { enumValue = e.keyToValue(prefix.append(QLatin1String("Unknown")).toLatin1().constData()); // if (!QByteArray(enumName).isEmpty()) { // qDebug() << "enumFromString (" << enumName << ") : converted" << str << "to" << QString("Unknown").append(enumName) << ", enum id" << id; // } } return enumValue; } #include "moc_daemon.cpp" PackageKit-Qt-1.0.1/src/daemon.h000066400000000000000000000743541322745327400163270ustar00rootroot00000000000000/* * This file is part of the QPackageKit project * Copyright (C) 2008 Adrien Bustany * Copyright (C) 2010-2018 Daniel Nicoletti * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 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 * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef PACKAGEKIT_DAEMON_H #define PACKAGEKIT_DAEMON_H #include #include #include #include #include #include "transaction.h" namespace PackageKit { class Offline; /** * \class Daemon daemon.h Daemon * \author Adrien Bustany \e * \author Daniel Nicoletti \e * * \brief Base class used to interact with the PackageKit daemon * * This class holds all the functions enabling the user to interact with the PackageKit daemon. * * Most methods are static so that you can just call Daemon::backendName() to get the name of the backend. * * This class is a singleton, its constructor is private. Call Daemon::global() to get * an instance of the Daemon object, you only need Daemon::global() when connecting to the signals * of this class. */ class DaemonPrivate; class PACKAGEKITQT_LIBRARY Daemon : public QObject { Q_OBJECT Q_PROPERTY(bool isRunning READ isRunning NOTIFY isRunningChanged) Q_PROPERTY(Transaction::Roles roles READ roles NOTIFY changed) Q_PROPERTY(QString backendName READ backendName NOTIFY changed) Q_PROPERTY(QString backendDescription READ backendDescription NOTIFY changed) Q_PROPERTY(QString backendAuthor READ backendAuthor NOTIFY changed) Q_PROPERTY(Transaction::Filters filters READ filters NOTIFY changed) Q_PROPERTY(Transaction::Groups groups READ groups NOTIFY changed) Q_PROPERTY(bool locked READ locked NOTIFY changed) Q_PROPERTY(QStringList mimeTypes READ mimeTypes NOTIFY changed) Q_PROPERTY(Daemon::Network networkState READ networkState NOTIFY networkStateChanged) Q_PROPERTY(QString distroID READ distroID NOTIFY changed) Q_PROPERTY(uint versionMajor READ versionMajor NOTIFY changed) Q_PROPERTY(uint versionMinor READ versionMinor NOTIFY changed) Q_PROPERTY(uint versionMicro READ versionMicro NOTIFY changed) public: /** * Describes the current network state */ enum Network { NetworkUnknown, NetworkOffline, NetworkOnline, NetworkWired, NetworkWifi, NetworkMobile }; Q_ENUM(Network) /** * Describes the authorization result * \sa canAuthorize() */ enum Authorize { AuthorizeUnknown, AuthorizeYes, AuthorizeNo, AuthorizeInteractive }; Q_ENUM(Authorize) /** * \brief Returns an instance of the Daemon * * The Daemon class is a singleton, you can call this method several times, * a single Daemon object will exist. * Use this only when connecting to this class signals */ static Daemon* global(); /** * Destructor */ ~Daemon(); /** * Returns true if the daemon is running (ie registered to DBus) */ static bool isRunning(); /** * Returns all the roles supported by the current backend */ static Transaction::Roles roles(); /** * The backend name, e.g. "yum". */ static QString backendName(); /** * The backend description, e.g. "Yellow Dog Update Modifier". */ static QString backendDescription(); /** * The backend author, e.g. "Joe Bloggs " */ static QString backendAuthor(); /** * Returns the package filters supported by the current backend */ static Transaction::Filters filters(); /** * Returns the package groups supported by the current backend */ static Transaction::Groups groups(); /** * Set when the backend is locked and native tools would fail. */ static bool locked(); /** * Returns a list containing the MIME types supported by the current backend */ static QStringList mimeTypes(); /** * Returns the current network state */ static Daemon::Network networkState(); /** * The distribution identifier in the * distro;version;arch form, * e.g. "debian;squeeze/sid;x86_64". */ static QString distroID(); /** * Returns the major version number. */ static uint versionMajor(); /** * The minor version number. */ static uint versionMinor(); /** * The micro version number. */ static uint versionMicro(); /** * Allows a client to find out if it would be allowed to authorize an action. * The action ID, e.g. org.freedesktop.packagekit.system-network-proxy-configure * specified in \p actionId * Returm might be either yes, no or interactive \sa Authorize. */ static QDBusPendingReply canAuthorize(const QString &actionId); /** * Returns the time (in seconds) since the specified \p action */ static QDBusPendingReply getTimeSinceAction(PackageKit::Transaction::Role action); /** * \brief creates a new transaction path * * This function register a new DBus path on PackageKit * allowing a \c Transaction object to be created. * * \note Unless you want to know the transaction id * before creating the \c Transaction object this function * is not useful as simply creating a \c Transaction object will * automatically create this path. */ static QDBusPendingReply createTransaction(); /** * Returns the list of current transactions */ static QDBusPendingReply > getTransactionList(); /** * \brief Sets a global hints for all the transactions to be created * * This method allows the calling session to set transaction \p hints for * the package manager which can change as the transaction runs. * * This method can be sent before the transaction has been run * (by using Daemon::setHints) or whilst it is running * (by using Transaction::setHints). * There is no limit to the number of times this * method can be sent, although some backends may only use the values * that were set before the transaction was started. * * The \p hints can be filled with entries like these * ('locale=en_GB.utf8','idle=true','interactive=false'). * * \sa Transaction::setHints */ static void setHints(const QStringList &hints); /** * Convenience function to set global hints * \sa setHints(const QStringList &hints) */ static void setHints(const QString &hints); /** * This method returns the current hints */ static QStringList hints(); /** * Sets a proxy to be used for all the network operations */ static QDBusPendingReply<> setProxy(const QString &http_proxy, const QString &https_proxy, const QString &ftp_proxy, const QString &socks_proxy, const QString &no_proxy, const QString &pac); /** * \brief Tells the daemon that the system state has changed, to make it reload its cache * * \p reason can be resume or posttrans */ static QDBusPendingReply<> stateHasChanged(const QString &reason); /** * Asks PackageKit to quit, for example to let a native package manager operate */ static QDBusPendingReply<> suggestDaemonQuit(); /** * Returns a class representing PackageKit offline interface, as with the Daemon * class this will only have valid properties if isRunning() is true */ Offline *offline() const; /** * Returns the package name from the \p packageID */ Q_INVOKABLE static QString packageName(const QString &packageID); /** * Returns the package version from the \p packageID */ Q_INVOKABLE static QString packageVersion(const QString &packageID); /** * Returns the package arch from the \p packageID */ Q_INVOKABLE static QString packageArch(const QString &packageID); /** * Returns the package data from the \p packageID */ Q_INVOKABLE static QString packageData(const QString &packageID); static QString enumToString(const QMetaObject &metaObject, int value, const char *enumName); /** * Returns the string representing the enum * Useful for PackageDetails::Group */ template static QString enumToString(int value, const char *enumName) { return enumToString(T::staticMetaObject, value, enumName); } static int enumFromString(const QMetaObject &metaObject, const QString &str, const char *enumName); template static int enumFromString(const QString &str, const char *enumName) { return enumFromString(T::staticMetaObject, str, enumName); } /** * \brief Accepts an EULA * * The EULA is identified by the \sa Eula structure \p info * * \note You need to manually restart the transaction which triggered the EULA. * \sa eulaRequired() * * \warning check \sa errorCode() signal to know if it the call has any error */ static Transaction *acceptEula(const QString &eulaID); /** * Download the given \p packages to a temp dir, if \p storeInCache is true * the download will be stored in the package manager cache * * \warning check \sa errorCode() signal to know if it the call has any error */ static Transaction *downloadPackages(const QStringList &packageIDs, bool storeInCache = false); /** * This is a convenience function to download this \p package * \sa downloadPackages(const QStringList &packageIDs, bool storeInCache = false) * * \warning check \sa errorCode() signal to know if it the call has any error */ static Transaction *downloadPackage(const QString &packageID, bool storeInCache = false); /** * Returns the collection categories * * \sa category * * \warning check \sa errorCode() signal to know if it the call has any error */ static Transaction *getCategories(); /** * \brief Gets the list of dependencies for the given \p packages * * You can use the \p filters to limit the results to certain packages. * The \p recursive flag indicates if the package manager should also * fetch the dependencies's dependencies. * * \note This method emits \sa package() * * \warning check \sa errorCode() signal to know if it the call has any error */ static Transaction *dependsOn(const QStringList &packageIDs, Transaction::Filters filters = Transaction::FilterNone, bool recursive = false); /** * Convenience function to get the dependencies of this \p package * \sa dependsOn(const QStringList &packageIDs, Filters filters, bool recursive = false) * * \warning check \sa errorCode() signal to know if it the call has any error */ static Transaction *dependsOn(const QString &packageID, Transaction::Filters filters = Transaction::FilterNone, bool recursive = false); /** * Gets more details about the given \p packages * * \sa Transaction::details * \note This method emits \sa package() * with details set * * \warning check \sa errorCode() signal to know if it the call has any error */ static Transaction *getDetails(const QStringList &packageIDs); /** * Convenience function to get the details about this \p package * \sa getDetails(const QStringList &packageIDs) * * \warning check \sa errorCode() signal to know if it the call has any error */ static Transaction *getDetails(const QString &packageID); /** * Gets more details about the given \p files * * \sa Transaction::details * \note This method emits \sa package() * with details set * * \warning check \sa errorCode() signal to know if it the call has any error */ static Transaction *getDetailsLocal(const QStringList &files); /** * Gets more details about the given \p file * * \sa Transaction::details * \note This method emits \sa package() * with details set * * \warning check \sa errorCode() signal to know if it the call has any error */ static Transaction *getDetailsLocal(const QString &file); /** * Gets the files contained in the given \p packages * * \note This method emits \sa files() * * \warning check \sa errorCode() signal to know if it the call has any error */ static Transaction *getFiles(const QStringList &packageIDs); /** * Convenience function to get the files contained in this \p package * \sa getFiles(const QStringList &packageIDs) * * \warning check \sa errorCode() signal to know if it the call has any error */ static Transaction *getFiles(const QString &packageIDs); /** * Gets the files contained in the given \p files * * \note This method emits \sa files() * * \warning check \sa errorCode() signal to know if it the call has any error */ static Transaction *getFilesLocal(const QStringList &files); /** * Gets the files contained in the given \p file * * \note This method emits \sa files() * * \warning check \sa errorCode() signal to know if it the call has any error */ static Transaction *getFilesLocal(const QString &file); /** * \brief Gets the last \p number finished transactions * * \note You must delete these transactions yourself * \note This method emits \sa transaction() * * \warning check \sa errorCode() signal to know if it the call has any error */ static Transaction *getOldTransactions(uint number); /** * Gets all the packages matching the given \p filters * * \note This method emits \sa package() * * \warning check \sa errorCode() signal to know if it the call has any error */ static Transaction *getPackages(Transaction::Filters filters = Transaction::FilterNone); /** * Gets the list of software repositories matching the given \p filters * * \note This method emits \sa repository() * * \warning check \sa errorCode() signal to know if it the call has any error */ static Transaction *getRepoList(Transaction::Filters filters = Transaction::FilterNone); /** * \brief Searches for the packages requiring the given \p packages * * The search can be limited using the \p filters parameter. * The \p recursive flag is used to tell if the package manager should * also search for the package requiring the resulting packages. * * \note This method emits \sa package() * * \warning check \sa errorCode() signal to know if it the call has any error */ static Transaction *requiredBy(const QStringList &packageIDs, Transaction::Filters filters = Transaction::FilterNone, bool recursive = false); /** * Convenience function to get packages requiring this package * \sa requiredBy(const QStringList &packageIDs, Filters filters, bool recursive = false) * * \warning check \sa errorCode() signal to know if it the call has any error */ static Transaction *requiredBy(const QString &packageID, Transaction::Filters filters = Transaction::FilterNone, bool recursive = false); /** * Retrieves more details about the update for the given \p packageIDs * * \note This method emits \sa updateDetail() * * \warning check \sa errorCode() signal to know if it the call has any error */ static Transaction *getUpdatesDetails(const QStringList &packageIDs); /** * Convenience function to get update details * \sa getUpdateDetail(const QStringList &packageIDs) * * \warning check \sa errorCode() signal to know if it the call has any error */ static Transaction *getUpdateDetail(const QString &packageID); /** * \p Gets the available updates * * The \p filters parameters can be used to restrict the updates returned * * \note This method emits \sa package() * * \warning check \sa errorCode() signal to know if it the call has any error */ static Transaction *getUpdates(Transaction::Filters filters = Transaction::FilterNone); /** * Retrieves the available distribution upgrades * * \note This method emits \sa distroUpgrade() * * \warning check \sa errorCode() signal to know if it the call has any error */ static Transaction *getDistroUpgrades(); /** * Updates the whole system * * This method perfoms a distribution upgrade to the * specified version. * * The \p type of upgrade, e.g. minimal, default or complete. * Minimal upgrades will download the smallest amount of data * before launching a installer. * The default is to download enough data to launch a full * graphical installer, but a complete upgrade will be * required if there is no internet access during install time. * * \note This method typically emits * \li progress() * \li status() * \li error() * \li package() * * \warning check \sa errorCode() signal to know if it the call has any error */ static Transaction *upgradeSystem(const QString &distroId, Transaction::UpgradeKind kind, Transaction::TransactionFlags flags = Transaction::TransactionFlagOnlyTrusted); /** * \brief Installs the local packages \p files * * \p onlyTrusted indicate if the packages are signed by a trusted authority * * \note This method emits \sa package() and \sa changed() * * \warning check \sa errorCode() signal to know if it the call has any error */ static Transaction *installFiles(const QStringList &files, Transaction::TransactionFlags flags = Transaction::TransactionFlagOnlyTrusted); /** * Convenience function to install a file * \sa installFiles(const QStringList &files, TransactionFlags flags) * * \warning check \sa errorCode() signal to know if it the call has any error */ static Transaction *installFile(const QString &file, Transaction::TransactionFlags flags = Transaction::TransactionFlagOnlyTrusted); /** * Install the given \p packages * * \p only_trusted indicates if we should allow installation of untrusted packages (requires a different authorization) * * \note This method emits \sa package() and \sa changed() * * \warning check \sa errorCode() signal to know if it the call has any error */ static Transaction *installPackages(const QStringList &packageIDs, Transaction::TransactionFlags flags = Transaction::TransactionFlagOnlyTrusted); /** * Convenience function to install a package * \sa installPackages(const QStringList &packageIDs, TransactionFlags flags) * * \warning check \sa errorCode() signal to know if it the call has any error */ static Transaction *installPackage(const QString &packageID, Transaction::TransactionFlags flags = Transaction::TransactionFlagOnlyTrusted); /** * \brief Installs a signature * * \p type, \p keyId and \p package generally come from the Transaction::repoSignatureRequired * * \warning check \sa errorCode() signal to know if it the call has any error */ static Transaction *installSignature(Transaction::SigType type, const QString &keyID, const QString &packageID); /** * Refreshes the package manager's cache * * \note This method emits \sa changed() * * \warning check \sa errorCode() signal to know if it the call has any error */ static Transaction *refreshCache(bool force); /** * \brief Removes the given \p packages * * \p allowDeps if the package manager has the right to remove other packages which depend on the * packages to be removed. \p autoRemove tells the package manager to remove all the package which * won't be needed anymore after the packages are uninstalled. * * \note This method emits \sa package() and \sa changed() * * \warning check \sa errorCode() signal to know if it the call has any error */ static Transaction *removePackages(const QStringList &packageIDs, bool allowDeps = false, bool autoRemove = false, Transaction::TransactionFlags flags = Transaction::TransactionFlagOnlyTrusted); /** * Convenience function to remove a package * * \sa removePackages(const PackageList &packages, bool allowDeps = false, bool autoRemove = false, TransactionFlags flags) * * \warning check \sa errorCode() signal to know if it the call has any error */ static Transaction *removePackage(const QString &packageID, bool allowDeps = false, bool autoRemove = false, Transaction::TransactionFlags flags = Transaction::TransactionFlagOnlyTrusted); /** * Repairs a broken system * * \warning check \sa errorCode() signal to know if it the call has any error */ static Transaction *repairSystem(Transaction::TransactionFlags flags = Transaction::TransactionFlagOnlyTrusted); /** * Activates or disables a repository * * \warning check \sa errorCode() signal to know if it the call has any error */ static Transaction *repoEnable(const QString &repoId, bool enable = true); /** * Removes a repository * * \p autoremove packages from this repository * * \warning check \sa errorCode() signal to know if it the call has any error */ static Transaction *repoRemove(const QString &repoId, bool autoremove, Transaction::TransactionFlags flags = Transaction::TransactionFlagNone); /** * Sets a repository's parameter * * \warning check \sa errorCode() signal to know if it the call has any error */ static Transaction *repoSetData(const QString &repoId, const QString ¶meter, const QString &value); /** * \brief Tries to create a Package object from the package's name * * The \p filters can be used to restrict the search * * \note This method emits \sa package() * * \warning check \sa errorCode() signal to know if it the call has any error */ static Transaction *resolve(const QStringList &packageNames, Transaction::Filters filters = Transaction::FilterNone); /** * Convenience function to remove a package name * \sa resolve(const QStringList &packageNames, Transaction::Filters filters = Transaction::FilterNone) * * \warning check \sa errorCode() signal to know if it the call has any error */ static Transaction *resolve(const QString &packageName, Transaction::Filters filters = Transaction::FilterNone); /** * \brief Search in the packages files * * \p filters can be used to restrict the returned packages * * \note This method emits \sa package() * * \warning check \sa errorCode() signal to know if it the call has any error */ static Transaction *searchFiles(const QStringList &search, Transaction::Filters filters = Transaction::FilterNone); /** * Convenience function to search for a file * \sa searchFiles(const QStringList &search, Transaction::Filters filters = Transaction::FilterNone) * * \warning check \sa errorCode() signal to know if it the call has any error */ static Transaction *searchFiles(const QString &search, Transaction::Filters filters = Transaction::FilterNone); /** * \brief Search in the packages details * * \p filters can be used to restrict the returned packages * * \note This method emits \sa package() * * \warning check \sa errorCode() signal to know if it the call has any error */ static Transaction *searchDetails(const QStringList &search, Transaction::Filters filters = Transaction::FilterNone); /** * Convenience function to search by details * \sa searchDetails(const QStringList &search, Transaction::Filters filters = Transaction::FilterNone) * * \warning check \sa errorCode() signal to know if it the call has any error */ static Transaction *searchDetails(const QString &search, Transaction::Filters filters = Transaction::FilterNone); /** * \brief Lists all the packages in the given \p group * * \p groups is the name of the group that you want, when searching for * categories prefix it with '@' * \p filters can be used to restrict the returned packages * * \note This method emits \sa package() * * \warning check \sa errorCode() signal to know if it the call has any error */ static Transaction *searchGroups(const QStringList &groups, Transaction::Filters filters = Transaction::FilterNone); /** * Convenience function to search by group string * \sa searchGroups(const QStringList &groups, Transaction::Filters filters = Transaction::FilterNone) * * \warning check \sa errorCode() signal to know if it the call has any error */ static Transaction *searchGroup(const QString &group, Transaction::Filters filters = Transaction::FilterNone); /** * Convenience function to search by group enum * \sa searchGroups(const QStringList &groups, Transaction::Filters filters = Transaction::FilterNone) * * \warning check \sa errorCode() signal to know if it the call has any error */ static Transaction *searchGroup(Transaction::Group group, Transaction::Filters filters = Transaction::FilterNone); /** * \brief Lists all the packages in the given \p group * * \p filters can be used to restrict the returned packages * * \note This method emits \sa package() * * \warning check \sa errorCode() signal to know if it the call has any error */ static Transaction *searchGroups(Transaction::Groups group, Transaction::Filters filters = Transaction::FilterNone); /** * \brief Search in the packages names * * \p filters can be used to restrict the returned packages * * \note This method emits \sa package() * * \warning check \sa errorCode() signal to know if it the call has any error */ static Transaction *searchNames(const QStringList &search, Transaction::Filters filters = Transaction::FilterNone); /** * Convenience function to search by names * \sa searchNames(const QStringList &search, Filters filters) * * \warning check \sa errorCode() signal to know if it the call has any error */ static Transaction *searchNames(const QString &search, Transaction::Filters filters = Transaction::FilterNone); /** * Update the given \p packages * * \p onlyTrusted indicates if this transaction is only allowed to install trusted packages * \note This method emits \sa package() and \sa changed() * * \warning check \sa errorCode() signal to know if it the call has any error */ static Transaction *updatePackages(const QStringList &packageIDs, Transaction::TransactionFlags flags = Transaction::TransactionFlagOnlyTrusted); /** * Convenience function to update a package * \sa updatePackages(const QStringList &packageIDs, TransactionFlags flags) * * \warning check \sa errorCode() signal to know if it the call has any error */ static Transaction *updatePackage(const QString &packageID, Transaction::TransactionFlags flags = Transaction::TransactionFlagOnlyTrusted); /** * Searchs for a package providing a file/a mimetype * * \note This method emits \sa package() * * \warning check \sa errorCode() signal to know if it the call has any error */ static Transaction *whatProvides(const QStringList &search, Transaction::Filters filters = Transaction::FilterNone); /** * Convenience function to search for what provides * \sa whatProvides(Provides type, const QStringList &search, Transaction::Filters filters = Transaction::FilterNone) * * \warning check \sa errorCode() signal to know if it the call has any error */ static Transaction *whatProvides(const QString &search, Transaction::Filters filters = Transaction::FilterNone); Q_SIGNALS: void isRunningChanged(); void networkStateChanged(); /** * This signal is emitted when a property on the interface changes. */ void changed(); /** * Emitted when the list of repositories changes */ void repoListChanged(); /** * Emmitted when a restart is scheduled */ void restartScheduled(); /** * \brief Emitted when the current transactions list changes. * * \note This is mostly useful for monitoring the daemon's state. */ void transactionListChanged(const QStringList &tids); /** * Emitted when new updates are available */ void updatesChanged(); /** * Emitted when the daemon quits */ void daemonQuit(); protected: /** * This method connects to DBus signals * \attention Make sure to call this method in inherited classes * otherwise no signals will be emitted */ void connectNotify(const QMetaMethod &signal) override; /** * \attention Make sure to call this method in inherited classes */ void disconnectNotify(const QMetaMethod &signal) override; DaemonPrivate * const d_ptr; private: Q_DECLARE_PRIVATE(Daemon) Q_PRIVATE_SLOT(d_func(), void propertiesChanged(QString,QVariantMap,QStringList)) Q_PRIVATE_SLOT(d_func(), void updateProperties(QVariantMap)) Daemon(QObject *parent = nullptr); static Daemon *m_global; }; } // End namespace PackageKit Q_DECLARE_METATYPE(PackageKit::Daemon::Network) Q_DECLARE_METATYPE(PackageKit::Daemon::Authorize) #endif PackageKit-Qt-1.0.1/src/daemonprivate.cpp000066400000000000000000000136651322745327400202530ustar00rootroot00000000000000/* * This file is part of the QPackageKit project * Copyright (C) 2008 Adrien Bustany * Copyright (C) 2010-2018 Daniel Nicoletti * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 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 * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "daemonprivate.h" #include "transaction.h" #include "common.h" #include "offline_p.h" #include #include #include #include #include using namespace PackageKit; DaemonPrivate::DaemonPrivate(Daemon* parent) : q_ptr(parent) , offline(new Offline(parent)) { Q_Q(Daemon); auto watcher = new QDBusServiceWatcher(PK_NAME, QDBusConnection::systemBus(), QDBusServiceWatcher::WatchForOwnerChange, q_ptr); q->connect(watcher, &QDBusServiceWatcher::serviceOwnerChanged, q, [this, q] (const QString &service, const QString &oldOwner, const QString &newOwner) { Q_UNUSED(service) if (newOwner.isEmpty() || !oldOwner.isEmpty()) { // TODO check if we don't emit this twice when // the daemon exits cleanly q->daemonQuit(); } // There is a new PackageKit running get it's props if (!newOwner.isEmpty()) { // We don't have more transactions running q->transactionListChanged(QStringList()); getAllProperties(); if (!running) { running = true; q->isRunningChanged(); } } else if (running) { running = false; q->isRunningChanged(); } }); getAllProperties(); } void DaemonPrivate::getAllProperties() { Q_Q(Daemon); QDBusMessage message = QDBusMessage::createMethodCall(PK_NAME, PK_PATH, DBUS_PROPERTIES, QLatin1String("GetAll")); message << PK_NAME; QDBusConnection::systemBus().callWithCallback(message, q, SLOT(updateProperties(QVariantMap))); message = QDBusMessage::createMethodCall(PK_NAME, PK_PATH, DBUS_PROPERTIES, QLatin1String("GetAll")); message << PK_OFFLINE_INTERFACE; QDBusConnection::systemBus().callWithCallback(message, offline, SLOT(updateProperties(QVariantMap))); } void DaemonPrivate::propertiesChanged(const QString &interface, const QVariantMap &properties, const QStringList &invalidatedProperties) { Q_UNUSED(invalidatedProperties) if (interface == PK_NAME) { updateProperties(properties); } else if (interface == PK_OFFLINE_INTERFACE) { offline->d_ptr->updateProperties(properties); } else { qCWarning(PACKAGEKITQT_DAEMON) << "Unknown PackageKit interface:" << interface; } } void DaemonPrivate::updateProperties(const QVariantMap &properties) { Q_Q(Daemon); if (!running) { running = true; q->isRunningChanged(); } QVariantMap::ConstIterator it = properties.constBegin(); while (it != properties.constEnd()) { const QString &property = it.key(); const QVariant &value = it.value(); if (property == QLatin1String("BackendAuthor")) { backendAuthor = value.toString(); } else if (property == QLatin1String("BackendDescription")) { backendDescription = value.toString(); } else if (property == QLatin1String("BackendName")) { backendName = value.toString(); } else if (property == QLatin1String("DistroId")) { distroId = value.toString(); } else if (property == QLatin1String("Filters")) { filters = static_cast(value.toUInt()); } else if (property == QLatin1String("Groups")) { groups = static_cast(value.toULongLong()); } else if (property == QLatin1String("Locked")) { locked = value.toBool(); } else if (property == QLatin1String("MimeTypes")) { mimeTypes = value.toStringList(); } else if (property == QLatin1String("NetworkState")) { networkState = static_cast(value.toUInt()); q->networkStateChanged(); } else if (property == QLatin1String("Roles")) { roles = value.toULongLong(); } else if (property == QLatin1String("VersionMajor")) { versionMajor = value.toUInt(); } else if (property == QLatin1String("VersionMicro")) { versionMicro = value.toUInt(); } else if (property == QLatin1String("VersionMinor")) { versionMinor = value.toUInt(); } else { qCWarning(PACKAGEKITQT_DAEMON) << "Unknown Daemon property:" << property << value; } ++it; } if (!properties.isEmpty()) { q->changed(); } } PackageKit-Qt-1.0.1/src/daemonprivate.h000066400000000000000000000053571322745327400177170ustar00rootroot00000000000000/* * This file is part of the QPackageKit project * Copyright (C) 2008 Adrien Bustany * Copyright (C) 2010-2016 Daniel Nicoletti * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 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 * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef DAEMON_PRIVATE_H #define DAEMON_PRIVATE_H #include #include #include "daemon.h" #include "offline.h" Q_DECLARE_LOGGING_CATEGORY(PACKAGEKITQT_TRANSACTION) Q_DECLARE_LOGGING_CATEGORY(PACKAGEKITQT_DAEMON) class OrgFreedesktopPackageKitInterface; namespace PackageKit { static QString PK_NAME = QStringLiteral("org.freedesktop.PackageKit"); static QString PK_OFFLINE_INTERFACE = QStringLiteral("org.freedesktop.PackageKit.Offline"); static QString PK_PATH = QStringLiteral("/org/freedesktop/PackageKit"); static QString PK_TRANSACTION_INTERFACE = QStringLiteral("org.freedesktop.PackageKit.Transaction"); static QString DBUS_PROPERTIES = QStringLiteral("org.freedesktop.DBus.Properties"); class DaemonPrivate { Q_DECLARE_PUBLIC(Daemon) protected: DaemonPrivate(Daemon *parent); virtual ~DaemonPrivate() {} Daemon *q_ptr; ::OrgFreedesktopPackageKitInterface *daemon; QStringList hints; QList connectedSignals; void setupSignal(const QMetaMethod &signal); void getAllProperties(); QString backendAuthor; QString backendDescription; QString backendName; QString distroId; Transaction::Filters filters = Transaction::FilterNone; Transaction::Groups groups = Transaction::GroupUnknown; QStringList mimeTypes; Daemon::Network networkState = Daemon::NetworkUnknown; Transaction::Roles roles = Transaction::RoleUnknown; Offline *offline; uint versionMajor = 0; uint versionMicro = 0; uint versionMinor = 0; bool locked = false; bool running = false; protected Q_SLOTS: void propertiesChanged(const QString &interface, const QVariantMap &properties, const QStringList &invalidatedProperties); void updateProperties(const QVariantMap &properties); }; } // End namespace PackageKit #endif PackageKit-Qt-1.0.1/src/details.cpp000066400000000000000000000035061322745327400170330ustar00rootroot00000000000000/* * This file is part of the PackageKitQt project * Copyright (C) 2014-2016 Daniel Nicoletti * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 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 * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "details.h" #include PackageKit::Details::Details() { } PackageKit::Details::Details(const QVariantMap &other) : QVariantMap(other) { } QString PackageKit::Details::packageId() const { return value(QLatin1String("package-id")).toString(); } QString PackageKit::Details::description() const { return value(QLatin1String("description")).toString(); } PackageKit::Transaction::Group PackageKit::Details::group() const { return static_cast(value(QLatin1String("group")).toUInt()); } QString PackageKit::Details::summary() const { return value(QLatin1String("summary")).toString(); } QString PackageKit::Details::url() const { return value(QLatin1String("url")).toString(); } QString PackageKit::Details::license() const { return value(QLatin1String("license")).toString(); } qulonglong PackageKit::Details::size() const { return value(QLatin1String("size")).toULongLong(); } PackageKit-Qt-1.0.1/src/details.h000066400000000000000000000025401322745327400164750ustar00rootroot00000000000000/* * This file is part of the PackageKitQt project * Copyright (C) 2014-2016 Daniel Nicoletti * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 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 * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef DETAILS_H #define DETAILS_H #include #include "transaction.h" namespace PackageKit { class PACKAGEKITQT_LIBRARY Details : public QVariantMap { public: Details(); Details(const QVariantMap &other); QString packageId() const; QString description() const; Transaction::Group group() const; QString summary() const; QString url() const; QString license() const; qulonglong size() const; }; } #endif // DETAILS_H PackageKit-Qt-1.0.1/src/modules/000077500000000000000000000000001322745327400163465ustar00rootroot00000000000000PackageKit-Qt-1.0.1/src/modules/CMakeLists.txt000066400000000000000000000011511322745327400211040ustar00rootroot00000000000000include(CMakePackageConfigHelpers) configure_package_config_file( ${CMAKE_CURRENT_SOURCE_DIR}/packagekit-qt-config.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/packagekitqt5-config.cmake INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/packagekitqt5/ ) write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/packagekitqt5-config-version.cmake VERSION ${PROJECT_VERSION} COMPATIBILITY SameMajorVersion) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/packagekitqt5-config.cmake ${CMAKE_CURRENT_BINARY_DIR}/packagekitqt5-config-version.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/packagekitqt5/ ) PackageKit-Qt-1.0.1/src/modules/packagekit-qt-config.cmake.in000066400000000000000000000002451322745327400237460ustar00rootroot00000000000000@PACKAGE_INIT@ check_required_components(Qt5DBus) SET(PackageKitQt5_LIBRARIES "PK::packagekitqt5") include("${CMAKE_CURRENT_LIST_DIR}/PackageKitQtTargets.cmake") PackageKit-Qt-1.0.1/src/offline.cpp000066400000000000000000000122531322745327400170270ustar00rootroot00000000000000/* * This file is part of the PackageKitQt project * Copyright (C) 2018 Daniel Nicoletti * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 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 * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "offline_p.h" Q_DECLARE_LOGGING_CATEGORY(PACKAGEKITQT_OFFLINE) using namespace PackageKit; Offline::Offline(QObject *parent) : QObject(parent) , d_ptr(new OfflinePrivate(this)) { QDBusConnection::systemBus().connect(PK_NAME, PK_PATH, DBUS_PROPERTIES, QLatin1String("PropertiesChanged"), this, SLOT(propertiesChanged(QString,QVariantMap,QStringList))); } Offline::~Offline() { delete d_ptr; } QVariantMap Offline::preparedUpgrade() const { Q_D(const Offline); return d->preparedUpgrade; } Offline::Action Offline::triggerAction() const { Q_D(const Offline); return d->triggerAction; } bool Offline::updatePrepared() const { Q_D(const Offline); return d->updatePrepared; } bool Offline::updateTriggered() const { Q_D(const Offline); return d->updateTriggered; } bool Offline::upgradePrepared() const { Q_D(const Offline); return d->upgradePrepared; } bool Offline::upgradeTriggered() const { Q_D(const Offline); return d->upgradeTriggered; } QDBusPendingReply<> Offline::trigger(Action action) { Q_D(Offline); QString actionStr; switch(action) { case ActionPowerOff: actionStr = QStringLiteral("power-off"); break; case ActionReboot: actionStr = QStringLiteral("reboot"); break; case ActionUnset: break; }; Q_ASSERT(!actionStr.isEmpty()); return d->iface.Trigger(actionStr); } QDBusPendingReply<> Offline::triggerUpgrade(Action action) { Q_D(Offline); QString actionStr; switch(action) { case ActionPowerOff: actionStr = QStringLiteral("power-off"); break; case ActionReboot: actionStr = QStringLiteral("reboot"); break; case ActionUnset: break; }; Q_ASSERT(!actionStr.isEmpty()); return d->iface.TriggerUpgrade(actionStr); } QDBusPendingReply<> Offline::cancel() { Q_D(Offline); return d->iface.Cancel(); } QDBusPendingReply<> Offline::clearResults() { Q_D(Offline); return d->iface.ClearResults(); } void Offline::getPrepared() { Q_D(Offline); QDBusPendingReply reply = d->iface.GetPrepared(); auto watcher = new QDBusPendingCallWatcher(reply, this); connect(watcher, &QDBusPendingCallWatcher::finished, this, [=] (QDBusPendingCallWatcher *call) { QDBusPendingReply reply = *call; QStringList pkgids; if (!reply.isError()) { pkgids = reply.argumentAt<0>(); } else { qCWarning(PACKAGEKITQT_OFFLINE) << "Failed to GetPrepared" << reply.error(); } Q_EMIT preparedUpdates(pkgids); call->deleteLater(); }); } void OfflinePrivate::updateProperties(const QVariantMap &properties) { Q_Q(Offline); QVariantMap::ConstIterator it = properties.constBegin(); while (it != properties.constEnd()) { const QString &property = it.key(); const QVariant &value = it.value(); if (property == QLatin1String("PreparedUpgrade")) { preparedUpgrade = value.toMap();; } else if (property == QLatin1String("TriggerAction")) { const QString actionStr = value.toString(); if (actionStr == QLatin1String("power-off")) { triggerAction = Offline::ActionPowerOff; } else if (actionStr == QLatin1String("reboot")) { triggerAction = Offline::ActionReboot; } else { triggerAction = Offline::ActionUnset; } } else if (property == QLatin1String("UpdatePrepared")) { updatePrepared = value.toBool(); } else if (property == QLatin1String("UpdateTriggered")) { updateTriggered = value.toBool(); } else if (property == QLatin1String("UpgradePrepared")) { upgradePrepared = value.toBool(); } else if (property == QLatin1String("UpgradeTriggered")) { upgradeTriggered = value.toBool(); } else { qCWarning(PACKAGEKITQT_OFFLINE) << "Unknown property:" << property << value; } ++it; } if (!properties.isEmpty()) { q->changed(); } } #include "moc_offline.cpp" PackageKit-Qt-1.0.1/src/offline.h000066400000000000000000000074771322745327400165100ustar00rootroot00000000000000/* * This file is part of the PackageKitQt project * Copyright (C) 2018 Daniel Nicoletti * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 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 * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef OFFLINE_H #define OFFLINE_H #include #include #include #include namespace PackageKit { class OfflinePrivate; class PACKAGEKITQT_LIBRARY Offline : public QObject { Q_OBJECT Q_DECLARE_PRIVATE(Offline) public: /** * Actions to trigger * * \sa offlineTrigger() */ enum Action { ActionUnset, ActionPowerOff, /** < powers off the computer after applying offline updates */ ActionReboot /** < reboots the computer after applying offline updates */ }; Q_ENUM(Action) ~Offline(); Q_PROPERTY(QVariantMap preparedUpgrade READ preparedUpgrade NOTIFY changed) /** * Details about a prepared system upgrade. * Currently recognized keys are "name" and "version". */ QVariantMap preparedUpgrade() const; Q_PROPERTY(Action triggerAction READ triggerAction NOTIFY changed) /** * The action to take when finished applying updates, known values */ Action triggerAction() const; Q_PROPERTY(bool updatePrepared READ updatePrepared NOTIFY changed) /** * If an update has been prepared and is ready to be triggered. */ bool updatePrepared() const; Q_PROPERTY(bool updateTriggered READ updateTriggered NOTIFY changed) /** * If an update has been triggered. */ bool updateTriggered() const; Q_PROPERTY(bool upgradePrepared READ upgradePrepared NOTIFY changed) /** * If a system upgrade has been prepared and is ready to be triggered. */ bool upgradePrepared() const; Q_PROPERTY(bool upgradeTriggered READ upgradeTriggered NOTIFY changed) /** * If a system upgrade has been triggered. */ bool upgradeTriggered() const; /** * Triggers the offline update for the next boot * * @p action is the action to take when finished applying updates */ QDBusPendingReply<> trigger(Action action); /** * Triggers the offline system upgrade for next boot. * * @p action is the action to take when finished installing the system upgrade */ QDBusPendingReply<> triggerUpgrade(Action action); /** * Cancels the offline update so the next boot procceeds as normal. */ QDBusPendingReply<> cancel(); /** * Clears the offline update results store. */ QDBusPendingReply<> clearResults(); /** * Asks for the list of prepared packages for update. * \sa preparedUpdates() signal */ void getPrepared(); Q_SIGNALS: /** * A list of package-ids ready to be installed */ void preparedUpdates(const QStringList &updates); /** * Emitted when any of the properties changes */ void changed(); protected: friend class DaemonPrivate; explicit Offline(QObject *parent = nullptr); private: Q_PRIVATE_SLOT(d_func(), void updateProperties(QVariantMap)) OfflinePrivate *d_ptr; }; } #endif // OFFLINE_H PackageKit-Qt-1.0.1/src/offline_p.h000066400000000000000000000030601322745327400170070ustar00rootroot00000000000000/* * This file is part of the PackageKitQt project * Copyright (C) 2018 Daniel Nicoletti * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 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 * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef OFFLINE_P_H #define OFFLINE_P_H #include "offline.h" #include "daemonproxy.h" #include "daemonprivate.h" namespace PackageKit { class OfflinePrivate { Q_DECLARE_PUBLIC(Offline) public: OfflinePrivate(Offline *q) : q_ptr(q), iface(PK_NAME, PK_PATH, QDBusConnection::systemBus()) { } void updateProperties(const QVariantMap &properties); Offline *q_ptr; OrgFreedesktopPackageKitOfflineInterface iface; QVariantMap preparedUpgrade; Offline::Action triggerAction = Offline::ActionUnset; bool updatePrepared = false; bool updateTriggered = false; bool upgradePrepared = false; bool upgradeTriggered = false; }; } #endif // OFFLINE_P_H PackageKit-Qt-1.0.1/src/packagekitqt5.pc.in000066400000000000000000000005351322745327400203670ustar00rootroot00000000000000prefix=@CMAKE_INSTALL_PREFIX@ exec_prefix=${prefix} libdir=@CMAKE_INSTALL_FULL_LIBDIR@ includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ Name: @LIBNAME@ Description: PackageKit is a system daemon for installing stuff. Version: @PROJECT_VERSION@ Requires: Qt5Core, Qt5DBus Libs: -L${libdir} -lpackagekitqt5 Cflags: -I${includedir}/packagekitqt5/PackageKit PackageKit-Qt-1.0.1/src/packagekitqt_global.h000066400000000000000000000004031322745327400210340ustar00rootroot00000000000000#ifndef PACKAGEKITQT_GLOBAL_H #define PACKAGEKITQT_GLOBAL_H #include #if defined(PACKAGEKITQT_LIBRARY) # define PACKAGEKITQT_LIBRARY Q_DECL_EXPORT #else # define PACKAGEKITQT_LIBRARY Q_DECL_IMPORT #endif #endif // PACKAGEKITQT_GLOBAL_H PackageKit-Qt-1.0.1/src/transaction.cpp000066400000000000000000000270711322745327400177360ustar00rootroot00000000000000/* * This file is part of the QPackageKit project * Copyright (C) 2008 Adrien Bustany * Copyright (C) 2010-2018 Daniel Nicoletti * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 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 * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "transaction.h" #include "transactionprivate.h" #include "transactionproxy.h" #include "daemon.h" #include "common.h" #include Q_LOGGING_CATEGORY(PACKAGEKITQT_TRANSACTION, "packagekitqt.transaction") using namespace PackageKit; Transaction::Transaction() : d_ptr(new TransactionPrivate(this)) { Q_D(Transaction); connect(Daemon::global(), SIGNAL(daemonQuit()), SLOT(daemonQuit())); QDBusPendingReply reply = Daemon::global()->createTransaction(); auto watcher = new QDBusPendingCallWatcher(reply, this); connect(watcher, &QDBusPendingCallWatcher::finished, this, [this, d] (QDBusPendingCallWatcher *call) { QDBusPendingReply reply = *call; if (reply.isError()) { errorCode(Transaction::ErrorInternalError, reply.error().message()); d->finished(Transaction::ExitFailed, 0); d->destroy(); } else { // Setup our new Transaction ID d->setup(reply.argumentAt<0>()); } call->deleteLater(); }); } Transaction::Transaction(const QDBusObjectPath &tid) : d_ptr(new TransactionPrivate(this)) { Q_D(Transaction); connect(Daemon::global(), SIGNAL(daemonQuit()), SLOT(daemonQuit())); d->setup(tid); } void Transaction::connectNotify(const QMetaMethod &signal) { Q_D(Transaction); if (!d->connectedSignals.contains(signal)) { d->connectedSignals << signal; if (d->p) { d->setupSignal(signal); } } } void Transaction::disconnectNotify(const QMetaMethod &signal) { QObject::disconnectNotify(signal); } Transaction::Transaction(TransactionPrivate *d) : d_ptr(d) { } void TransactionPrivate::setupSignal(const QMetaMethod &signal) { Q_Q(Transaction); const char *signalToConnect = 0; const char *memberToConnect = 0; if (signal == QMetaMethod::fromSignal(&Transaction::category)) { signalToConnect = SIGNAL(Category(QString,QString,QString,QString,QString)); memberToConnect = SIGNAL(category(QString,QString,QString,QString,QString)); } else if (signal == QMetaMethod::fromSignal(&Transaction::details)) { signalToConnect = SIGNAL(Details(QVariantMap)); memberToConnect = SLOT(details(QVariantMap)); } else if (signal == QMetaMethod::fromSignal(&Transaction::distroUpgrade)) { signalToConnect = SIGNAL(DistroUpgrade(uint,QString,QString)); memberToConnect = SLOT(distroUpgrade(uint,QString,QString)); } else if (signal == QMetaMethod::fromSignal(&Transaction::errorCode)) { signalToConnect = SIGNAL(ErrorCode(uint,QString)); memberToConnect = SLOT(errorCode(uint,QString)); } else if (signal == QMetaMethod::fromSignal(&Transaction::files)) { signalToConnect = SIGNAL(Files(QString,QStringList)); memberToConnect = SIGNAL(files(QString,QStringList)); } else if (signal == QMetaMethod::fromSignal(&Transaction::finished)) { signalToConnect = SIGNAL(Finished(uint,uint)); memberToConnect = SLOT(finished(uint,uint)); } else if (signal == QMetaMethod::fromSignal(&Transaction::package)) { signalToConnect = SIGNAL(Package(uint,QString,QString)); memberToConnect = SLOT(Package(uint,QString,QString)); } else if (signal == QMetaMethod::fromSignal(&Transaction::repoDetail)) { signalToConnect = SIGNAL(RepoDetail(QString,QString,bool)); memberToConnect = SIGNAL(repoDetail(QString,QString,bool)); } else if (signal == QMetaMethod::fromSignal(&Transaction::repoSignatureRequired)) { signalToConnect = SIGNAL(RepoSignatureRequired(QString,QString,QString,QString,QString,QString,QString,uint)); memberToConnect = SLOT(RepoSignatureRequired(QString,QString,QString,QString,QString,QString,QString,uint)); } else if (signal == QMetaMethod::fromSignal(&Transaction::eulaRequired)) { signalToConnect = SIGNAL(EulaRequired(QString,QString,QString,QString)); memberToConnect = SIGNAL(eulaRequired(QString,QString,QString,QString)); } else if (signal == QMetaMethod::fromSignal(&Transaction::mediaChangeRequired)) { signalToConnect = SIGNAL(MediaChangeRequired(uint,QString,QString)); memberToConnect = SLOT(mediaChangeRequired(uint,QString,QString)); } else if (signal == QMetaMethod::fromSignal(&Transaction::itemProgress)) { signalToConnect = SIGNAL(ItemProgress(QString,uint,uint)); memberToConnect = SLOT(ItemProgress(QString,uint,uint)); } else if (signal == QMetaMethod::fromSignal(&Transaction::requireRestart)) { signalToConnect = SIGNAL(RequireRestart(uint,QString)); memberToConnect = SLOT(requireRestart(uint,QString)); } else if (signal == QMetaMethod::fromSignal(&Transaction::transaction)) { signalToConnect = SIGNAL(Transaction(QDBusObjectPath,QString,bool,uint,uint,QString,uint,QString)); memberToConnect = SLOT(transaction(QDBusObjectPath,QString,bool,uint,uint,QString,uint,QString)); } else if (signal == QMetaMethod::fromSignal(&Transaction::updateDetail)) { signalToConnect = SIGNAL(UpdateDetail(QString,QStringList,QStringList,QStringList,QStringList,QStringList,uint,QString,QString,uint,QString,QString)); memberToConnect = SLOT(UpdateDetail(QString,QStringList,QStringList,QStringList,QStringList,QStringList,uint,QString,QString,uint,QString,QString)); } if (signalToConnect && memberToConnect) { QObject::connect(p, signalToConnect, q, memberToConnect); } } Transaction::~Transaction() { // qDebug() << "Destroying transaction with tid" << d_ptr->tid.path(); delete d_ptr; } QDBusObjectPath Transaction::tid() const { Q_D(const Transaction); return d->tid; } bool Transaction::allowCancel() const { Q_D(const Transaction); return d->allowCancel; } bool Transaction::isCallerActive() const { Q_D(const Transaction); return d->callerActive; } QDBusPendingReply<> Transaction::cancel() { Q_D(const Transaction); if (d->p) { return d->p->Cancel(); } return QDBusPendingReply<>(); } QString Transaction::packageName(const QString &packageID) { QString ret; ret = packageID.left(packageID.indexOf(QLatin1Char(';'))); return ret; } QString Transaction::packageVersion(const QString &packageID) { QString ret; int start = packageID.indexOf(QLatin1Char(';')); if (start == -1) { return ret; } int end = packageID.indexOf(QLatin1Char(';'), ++start); if (Q_UNLIKELY(end == -1)) { ret = packageID.mid(start); } else { ret = packageID.mid(start, end - start); } return ret; } QString Transaction::packageArch(const QString &packageID) { QString ret; int start = packageID.indexOf(QLatin1Char(';')); if (start == -1) { return ret; } start = packageID.indexOf(QLatin1Char(';'), ++start); if (start == -1) { return ret; } int end = packageID.indexOf(QLatin1Char(';'), ++start); if (Q_UNLIKELY(end == -1)) { ret = packageID.mid(start); } else { ret = packageID.mid(start, end - start); } return ret; } QString Transaction::packageData(const QString &packageID) { QString ret; int start = packageID.indexOf(QLatin1Char(';')); if (start == -1) { return ret; } start = packageID.indexOf(QLatin1Char(';'), ++start); if (start == -1) { return ret; } start = packageID.indexOf(QLatin1Char(';'), ++start); if (start == -1) { return ret; } ret = packageID.mid(++start); return ret; } QString Transaction::lastPackage() const { Q_D(const Transaction); return d->lastPackage; } uint Transaction::percentage() const { Q_D(const Transaction); return d->percentage; } uint Transaction::elapsedTime() const { Q_D(const Transaction); return d->elapsedTime; } uint Transaction::remainingTime() const { Q_D(const Transaction); return d->remainingTime; } uint Transaction::speed() const { Q_D(const Transaction); return d->speed; } qulonglong Transaction::downloadSizeRemaining() const { Q_D(const Transaction); return d->downloadSizeRemaining; } Transaction::Role Transaction::role() const { Q_D(const Transaction); return d->role; } QDBusPendingReply<> Transaction::setHints(const QStringList &hints) { Q_D(Transaction); if (d->p) { return d->p->SetHints(hints); } return QDBusPendingReply<>(); } QDBusPendingReply<> Transaction::setHints(const QString &hints) { return setHints(QStringList{ hints }); } Transaction::Status Transaction::status() const { Q_D(const Transaction); return d->status; } Transaction::TransactionFlags Transaction::transactionFlags() const { Q_D(const Transaction); return d->transactionFlags; } QDateTime Transaction::timespec() const { Q_D(const Transaction); return d->timespec; } bool Transaction::succeeded() const { Q_D(const Transaction); return d->succeeded; } uint Transaction::duration() const { Q_D(const Transaction); return d->duration; } QString Transaction::data() const { Q_D(const Transaction); return d->data; } uint Transaction::uid() const { Q_D(const Transaction); return d->uid; } QString Transaction::cmdline() const { Q_D(const Transaction); return d->cmdline; } Transaction::InternalError Transaction::parseError(const QString &errorName) { QString error = errorName; if (error.startsWith(QLatin1String("org.freedesktop.packagekit."))) { return Transaction::InternalErrorFailedAuth; } error.remove(QLatin1String("org.freedesktop.PackageKit.Transaction.")); if (error.startsWith(QLatin1String("PermissionDenied")) || error.startsWith(QLatin1String("RefusedByPolicy"))) { return Transaction::InternalErrorFailedAuth; } if (error.startsWith(QLatin1String("PackageIdInvalid")) || error.startsWith(QLatin1String("SearchInvalid")) || error.startsWith(QLatin1String("FilterInvalid")) || error.startsWith(QLatin1String("InvalidProvide")) || error.startsWith(QLatin1String("InputInvalid"))) { return Transaction::InternalErrorInvalidInput; } if (error.startsWith(QLatin1String("PackInvalid")) || error.startsWith(QLatin1String("NoSuchFile")) || error.startsWith(QLatin1String("NoSuchDirectory"))) { return Transaction::InternalErrorInvalidFile; } if (error.startsWith(QLatin1String("NotSupported"))) { return Transaction::InternalErrorFunctionNotSupported; } qCWarning(PACKAGEKITQT_TRANSACTION) << "Transaction::parseError: unknown error" << errorName; return Transaction::InternalErrorFailed; } #include "moc_transaction.cpp" PackageKit-Qt-1.0.1/src/transaction.h000066400000000000000000000704501322745327400174020ustar00rootroot00000000000000/* * This file is part of the QPackageKit project * Copyright (C) 2008 Adrien Bustany * Copyright (C) 2010-2018 Daniel Nicoletti * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 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 * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef PACKAGEKIT_TRANSACTION_H #define PACKAGEKIT_TRANSACTION_H #include #include #include #include #include #include "bitfield.h" namespace PackageKit { class Details; /** * \class Transaction transaction.h Transaction * \author Adrien Bustany \e * \author Daniel Nicoletti \e * * \brief A transaction represents an occurring action in PackageKit * * A Transaction is created whenever you do an asynchronous action (for example a Search, Install...). * This class allows you to monitor and control the flow of the action. * * Transaction will be automatically deleted after finished() is emitted * * \sa Daemon */ class TransactionPrivate; class PACKAGEKITQT_LIBRARY Transaction : public QObject { Q_OBJECT Q_FLAGS(TransactionFlag TransactionFlags) Q_FLAGS(Filter Filters) Q_PROPERTY(QDBusObjectPath tid READ tid) Q_PROPERTY(bool allowCancel READ allowCancel NOTIFY allowCancelChanged) Q_PROPERTY(bool isCallerActive READ isCallerActive NOTIFY isCallerActiveChanged) Q_PROPERTY(QString lastPackage READ lastPackage NOTIFY lastPackageChanged) Q_PROPERTY(uint percentage READ percentage NOTIFY percentageChanged) Q_PROPERTY(uint elapsedTime READ elapsedTime NOTIFY elapsedTimeChanged) Q_PROPERTY(uint remainingTime READ remainingTime NOTIFY remainingTimeChanged) Q_PROPERTY(uint speed READ speed NOTIFY speedChanged) Q_PROPERTY(qulonglong downloadSizeRemaining READ downloadSizeRemaining NOTIFY downloadSizeRemainingChanged) Q_PROPERTY(Role role READ role NOTIFY roleChanged) Q_PROPERTY(Status status READ status NOTIFY statusChanged) Q_PROPERTY(TransactionFlags transactionFlags READ transactionFlags NOTIFY transactionFlagsChanged) Q_PROPERTY(QDateTime timespec READ timespec) Q_PROPERTY(bool succeeded READ succeeded) Q_PROPERTY(uint duration READ duration) Q_PROPERTY(QString data READ data) Q_PROPERTY(uint uid READ uid NOTIFY uidChanged) Q_PROPERTY(QString cmdline READ cmdline) public: /** * Describes an error at the daemon level (for example, PackageKit crashes or is unreachable) * * \sa Transaction::error */ enum InternalError { InternalErrorNone = 0, InternalErrorUnkown, InternalErrorFailed, InternalErrorFailedAuth, InternalErrorNoTid, InternalErrorAlreadyTid, InternalErrorRoleUnkown, InternalErrorCannotStartDaemon, InternalErrorInvalidInput, InternalErrorInvalidFile, InternalErrorFunctionNotSupported, InternalErrorDaemonUnreachable }; /** * Describes the role of the transaction */ enum Role { RoleUnknown, RoleCancel, RoleDependsOn, RoleGetDetails, RoleGetFiles, RoleGetPackages, RoleGetRepoList, RoleRequiredBy, RoleGetUpdateDetail, RoleGetUpdates, RoleInstallFiles, RoleInstallPackages, RoleInstallSignature, RoleRefreshCache, RoleRemovePackages, RoleRepoEnable, RoleRepoSetData, RoleResolve, RoleSearchDetails, RoleSearchFile, RoleSearchGroup, RoleSearchName, RoleUpdatePackages, RoleWhatProvides, RoleAcceptEula, RoleDownloadPackages, RoleGetDistroUpgrades, RoleGetCategories, RoleGetOldTransactions, RoleRepairSystem, // Since 0.7.2 RoleGetDetailsLocal, // Since 0.8.17 RoleGetFilesLocal, // Since 0.9.1 RoleRepoRemove, // Since 0.9.1 RoleUpgradeSystem // since 1.0.11 }; Q_ENUM(Role) typedef Bitfield Roles; /** * Describes the different types of error */ enum Error { ErrorUnknown, ErrorOom, ErrorNoNetwork, ErrorNotSupported, ErrorInternalError, ErrorGpgFailure, ErrorPackageIdInvalid, ErrorPackageNotInstalled, ErrorPackageNotFound, ErrorPackageAlreadyInstalled, ErrorPackageDownloadFailed, ErrorGroupNotFound, ErrorGroupListInvalid, ErrorDepResolutionFailed, ErrorFilterInvalid, ErrorCreateThreadFailed, ErrorTransactionError, ErrorTransactionCancelled, ErrorNoCache, ErrorRepoNotFound, ErrorCannotRemoveSystemPackage, ErrorProcessKill, ErrorFailedInitialization, ErrorFailedFinalise, ErrorFailedConfigParsing, ErrorCannotCancel, ErrorCannotGetLock, ErrorNoPackagesToUpdate, ErrorCannotWriteRepoConfig, ErrorLocalInstallFailed, ErrorBadGpgSignature, ErrorMissingGpgSignature, ErrorCannotInstallSourcePackage, ErrorRepoConfigurationError, ErrorNoLicenseAgreement, ErrorFileConflicts, ErrorPackageConflicts, ErrorRepoNotAvailable, ErrorInvalidPackageFile, ErrorPackageInstallBlocked, ErrorPackageCorrupt, ErrorAllPackagesAlreadyInstalled, ErrorFileNotFound, ErrorNoMoreMirrorsToTry, ErrorNoDistroUpgradeData, ErrorIncompatibleArchitecture, ErrorNoSpaceOnDevice, ErrorMediaChangeRequired, ErrorNotAuthorized, ErrorUpdateNotFound, ErrorCannotInstallRepoUnsigned, ErrorCannotUpdateRepoUnsigned, ErrorCannotGetFilelist, ErrorCannotGetRequires, ErrorCannotDisableRepository, ErrorRestrictedDownload, ErrorPackageFailedToConfigure, ErrorPackageFailedToBuild, ErrorPackageFailedToInstall, ErrorPackageFailedToRemove, ErrorUpdateFailedDueToRunningProcess, ErrorPackageDatabaseChanged, ErrorProvideTypeNotSupported, ErrorInstallRootInvalid, ErrorCannotFetchSources, ErrorCancelledPriority, ErrorUnfinishedTransaction, ErrorLockRequired }; Q_ENUM(Error) /** * Describes how the transaction finished * \sa Transaction::finished() */ enum Exit { ExitUnknown, ExitSuccess, ExitFailed, ExitCancelled, ExitKeyRequired, ExitEulaRequired, ExitKilled, /* when we forced the cancel, but had to sigkill */ ExitMediaChangeRequired, ExitNeedUntrusted, ExitCancelledPriority, ExitRepairRequired }; Q_ENUM(Exit) /** * Describes the different package filters */ enum Filter { FilterUnknown = 0x0000001, FilterNone = 0x0000002, FilterInstalled = 0x0000004, FilterNotInstalled = 0x0000008, FilterDevel = 0x0000010, FilterNotDevel = 0x0000020, FilterGui = 0x0000040, FilterNotGui = 0x0000080, FilterFree = 0x0000100, FilterNotFree = 0x0000200, FilterVisible = 0x0000400, FilterNotVisible = 0x0000800, FilterSupported = 0x0001000, FilterNotSupported = 0x0002000, FilterBasename = 0x0004000, FilterNotBasename = 0x0008000, FilterNewest = 0x0010000, FilterNotNewest = 0x0020000, FilterArch = 0x0040000, FilterNotArch = 0x0080000, FilterSource = 0x0100000, FilterNotSource = 0x0200000, FilterCollections = 0x0400000, FilterNotCollections = 0x0800000, FilterApplication = 0x1000000, FilterNotApplication = 0x2000000, FilterDownloaded = 0x4000000, FilterNotDownloaded = 0x8000000, /* this always has to be at the end of the list */ FilterLast = 0x10000000 }; Q_ENUM(Filter) Q_DECLARE_FLAGS(Filters, Filter) /** * Describes the current state of the transaction */ enum Status { StatusUnknown, StatusWait, StatusSetup, StatusRunning, StatusQuery, StatusInfo, StatusRemove, StatusRefreshCache, StatusDownload, StatusInstall, StatusUpdate, StatusCleanup, StatusObsolete, StatusDepResolve, StatusSigCheck, StatusTestCommit, StatusCommit, StatusRequest, StatusFinished, StatusCancel, StatusDownloadRepository, StatusDownloadPackagelist, StatusDownloadFilelist, StatusDownloadChangelog, StatusDownloadGroup, StatusDownloadUpdateinfo, StatusRepackaging, StatusLoadingCache, StatusScanApplications, StatusGeneratePackageList, StatusWaitingForLock, StatusWaitingForAuth, StatusScanProcessList, StatusCheckExecutableFiles, StatusCheckLibraries, StatusCopyFiles, StatusRunHook }; Q_ENUM(Status) /** * Describes what kind of media is required */ enum MediaType { MediaTypeUnknown, MediaTypeCd, MediaTypeDvd, MediaTypeDisc }; Q_ENUM(MediaType) /** * Describes an distro upgrade state */ enum DistroUpgrade { DistroUpgradeUnknown, DistroUpgradeStable, DistroUpgradeUnstable }; Q_ENUM(DistroUpgrade) /** * Describes the type of distribution upgrade to perform * \sa Daemon::upgradeSystem() */ enum UpgradeKind { UpgradeKindUnknown, UpgradeKindMinimal, UpgradeKindDefault, UpgradeKindComplete }; Q_ENUM(UpgradeKind) /** * Describes the type of distribution upgrade to perform * \sa Daemon::upgradeSystem() */ enum TransactionFlag { TransactionFlagNone = 1 << 0, // Since: 0.8.1 TransactionFlagOnlyTrusted = 1 << 1, // Since: 0.8.1 TransactionFlagSimulate = 1 << 2, // Since: 0.8.1 TransactionFlagOnlyDownload = 1 << 3, // Since: 1.0.2 TransactionFlagAllowReinstall = 1 << 4, // Since: 1.0.2 TransactionFlagJustReinstall = 1 << 5, // Since: 1.0.2 TransactionFlagAllowDowngrade = 1 << 6 // Since: 0.8.1 }; Q_DECLARE_FLAGS(TransactionFlags, TransactionFlag) Q_ENUM(TransactionFlag) /** * Describes a restart type */ enum Restart { RestartUnknown, RestartNone, RestartApplication, RestartSession, RestartSystem, RestartSecuritySession, /* a library that is being used by this package has been updated for security */ RestartSecuritySystem }; Q_ENUM(Restart) /** * Describes an update's state */ enum UpdateState { UpdateStateUnknown, UpdateStateStable, UpdateStateUnstable, UpdateStateTesting }; Q_ENUM(UpdateState) /** * Describes the different package groups */ enum Group { GroupUnknown, GroupAccessibility, GroupAccessories, GroupAdminTools, GroupCommunication, GroupDesktopGnome, GroupDesktopKde, GroupDesktopOther, GroupDesktopXfce, GroupEducation, GroupFonts, GroupGames, GroupGraphics, GroupInternet, GroupLegacy, GroupLocalization, GroupMaps, GroupMultimedia, GroupNetwork, GroupOffice, GroupOther, GroupPowerManagement, GroupProgramming, GroupPublishing, GroupRepos, GroupSecurity, GroupServers, GroupSystem, GroupVirtualization, GroupScience, GroupDocumentation, GroupElectronics, GroupCollections, GroupVendor, GroupNewest }; typedef Bitfield Groups; Q_ENUM(Group) /** * Describes the state of a package */ enum Info { InfoUnknown, InfoInstalled, InfoAvailable, InfoLow, InfoEnhancement, InfoNormal, InfoBugfix, InfoImportant, InfoSecurity, InfoBlocked, InfoDownloading, InfoUpdating, InfoInstalling, InfoRemoving, InfoCleanup, InfoObsoleting, InfoCollectionInstalled, InfoCollectionAvailable, InfoFinished, InfoReinstalling, InfoDowngrading, InfoPreparing, InfoDecompressing, InfoUntrusted, InfoTrusted, InfoUnavailable }; Q_ENUM(Info) /** * Describes a signature type */ enum SigType { SigTypeUnknown, SigTypeGpg }; Q_ENUM(SigType) /** * Create a transaction object with transaction id \p tid * * Before using any members wait for roleChanged() signal * to be emitted, this is because we ask for the Transaction * properties in async mode. * * The transaction is automatically deleted once finished() * is emitted. * */ Transaction(const QDBusObjectPath &tid); /** * Destructor */ ~Transaction(); /** * \brief Returns the TID of the Transaction * * The TID (Transaction ID) uniquely identifies the transaction. * * \return the TID of the current transaction */ QDBusObjectPath tid() const; /** * Indicates whether you can cancel the transaction or not * i.e. the backend forbids cancelling the transaction while * it's installing packages * * \return true if you are able cancel the transaction, false else */ bool allowCancel() const; /** * Indicates weither the transaction caller is active or not * * The caller can be inactive if it has quitted before the transaction finished. * * \return true if the caller is active, false else */ bool isCallerActive() const; /** * Returns the last package processed by the transaction * * This is mostly used when getting an already existing Transaction, to * display a more complete summary of the transaction. * * \return the last package processed by the transaction */ QString lastPackage() const; /** * The percentage complete of the whole transaction. * \return percentage, or 101 if not known. */ uint percentage() const; /** * The amount of time elapsed during the transaction in seconds. * \return time in seconds. */ uint elapsedTime() const; /** * The estimated time remaining of the transaction in seconds, or 0 if not known. * \return time in seconds, or 0 if not known. */ uint remainingTime() const; /** * Returns the estimated speed of the transaction (copying, downloading, etc.) * \return speed bits per second, or 0 if not known. */ uint speed() const; /** * Returns the number of bytes remaining to download * \return bytes to download, or 0 if nothing is left to download. */ qulonglong downloadSizeRemaining() const; /** * Returns information describing the transaction * like InstallPackages, SearchName or GetUpdates * \return the current role of the transaction */ Role role() const; /** * Returns the current state of the transaction * \return a Transaction::Status value describing the status of the transaction */ Status status() const; /** * The current flags set in this transaction * \return a \sa Transaction::TransactionFlags of this transaction */ TransactionFlags transactionFlags() const; /** * Returns the date at which the transaction was created * \return a QDateTime object containing the date at which the transaction was created * \note This function only returns a real value for old transactions returned by getOldTransactions */ QDateTime timespec() const; /** * Returns weither the transaction succeded or not * \return true if the transaction succeeded, false else * \note This function only returns a real value for old transactions returned by getOldTransactions */ bool succeeded() const; /** * Returns the time the transaction took to finish * \return the number of milliseconds the transaction took to finish * \note This function only returns a real value for old transactions returned by getOldTransactions */ uint duration() const; /** * Returns some data set by the backend to pass additionnal information * \return a string set by the backend * \note This function only returns a real value for old transactions returned by getOldTransactions */ QString data() const; /** * Returns the UID of the calling process * \return the uid of the calling process * \note This function only returns a real value for old transactions returned by getOldTransactions */ uint uid() const; /** * Returns the command line for the calling process * \return a string of the command line for the calling process * \note This function only returns a real value for old transactions returned by getOldTransactions */ QString cmdline() const; /** * \brief Tells the underlying package manager to use the given \p hints * * This method allows the calling session to set transaction \p hints for * the package manager which can change as the transaction runs. * * This method can be sent before the transaction has been run * (by using Daemon::setHints) or whilst it is running * (by using Transaction::setHints). * There is no limit to the number of times this * method can be sent, although some backends may only use the values * that were set before the transaction was started. * * The \p hints can be filled with entries like these * ('locale=en_GB.utf8','idle=true','interactive=false'). * * \sa Daemon::setHints */ QDBusPendingReply<> setHints(const QStringList &hints); /** * Convenience function to set this transaction \p hints * \sa getDetails(const QStringList &hints) */ QDBusPendingReply<> setHints(const QString &hints); /** * Cancels the transaction * * \warning check \sa errorCode() signal to know if it the call has any error */ Q_INVOKABLE QDBusPendingReply<> cancel(); /** * Returns the package name from the \p packageID */ static QString packageName(const QString &packageID); /** * Returns the package version from the \p packageID */ static QString packageVersion(const QString &packageID); /** * Returns the package arch from the \p packageID */ static QString packageArch(const QString &packageID); /** * Returns the package data from the \p packageID */ static QString packageData(const QString &packageID); Q_SIGNALS: void allowCancelChanged(); void isCallerActiveChanged(); void downloadSizeRemainingChanged(); void elapsedTimeChanged(); void lastPackageChanged(); void percentageChanged(); void remainingTimeChanged(); void roleChanged(); void speedChanged(); void statusChanged(); void transactionFlagsChanged(); void uidChanged(); /** * \brief Sends a category * * \li \p parentId is the id of the parent category. A blank parent means a root category * \li \p categoryId is the id of the category * \li \p name is the category's name. This name is localized. * \li \p summary is the category's summary. It is localized. * \li \p icon is the icon identifier eg. server-cfg. If unknown, it is set to icon-missing. * * \sa getCategories() */ void category(const QString &parentId, const QString &categoryId, const QString &name, const QString &summary, const QString &icon); /** * Emitted when a distribution upgrade is available * \sa getDistroUpgrades() */ void distroUpgrade(PackageKit::Transaction::DistroUpgrade type, const QString &name, const QString &description); /** * Emitted when an error occurs */ void errorCode(PackageKit::Transaction::Error error, const QString &details); /** * Emitted when an EULA agreement prevents the transaction from running * \li \c eulaId is the EULA identifier * \li \c package is the package for which an EULA is required * \li \c vendorName is the vendor name * \li \c licenseAgreement is the EULA text * * \note You will need to relaunch the transaction after accepting the EULA * \sa acceptEula() */ void eulaRequired(const QString &eulaID, const QString &packageID, const QString &vendor, const QString &licenseAgreement); /** * Emitted when a different media is required in order to fetch packages * which prevents the transaction from running * \note You will need to relaunch the transaction after changing the media * \sa Transaction::MediaType */ void mediaChangeRequired(PackageKit::Transaction::MediaType type, const QString &id, const QString &text); /** * Sends the \p item current progress \p percentage * Currently only a package id is emitted */ void itemProgress(const QString &itemID, PackageKit::Transaction::Status status, uint percentage); /** * Sends the \p filenames contained in package \p package * \sa getFiles() */ void files(const QString &packageID, const QStringList &filenames); /** * Emitted when the transaction finishes * * \p status describes the exit status, \p runtime is the number of seconds it took to complete the transaction */ void finished(PackageKit::Transaction::Exit status, uint runtime); /** * Emitted when the transaction sends a new package */ void package(PackageKit::Transaction::Info info, const QString &packageID, const QString &summary); /** * Emitted when the transaction sends details of a package */ void details(const PackageKit::Details &values); /** * Emitted when the transaction sends details of an update */ void updateDetail(const QString &packageID, const QStringList &updates, const QStringList &obsoletes, const QStringList &vendorUrls, const QStringList &bugzillaUrls, const QStringList &cveUrls, PackageKit::Transaction::Restart restart, const QString &updateText, const QString &changelog, PackageKit::Transaction::UpdateState state, const QDateTime &issued, const QDateTime &updated); /** * Sends some additional details about a software repository * \sa getRepoList() */ void repoDetail(const QString &repoId, const QString &description, bool enabled); /** * Emitted when the user has to validate a repository's signature * \sa installSignature() */ void repoSignatureRequired(const QString &packageID, const QString &repoName, const QString &keyUrl, const QString &keyUserid, const QString &keyId, const QString &keyFingerprint, const QString &keyTimestamp, PackageKit::Transaction::SigType type); /** * Indicates that a restart is required * \p package is the package who triggered the restart signal */ void requireRestart(PackageKit::Transaction::Restart type, const QString &packageID); /** * Sends an old transaction * \sa getOldTransactions() * * These objects must be manually deleted */ void transaction(PackageKit::Transaction *transaction); protected: static Transaction::InternalError parseError(const QString &errorName); /** * This method connects to DBus signals * \attention Make sure to call this method in inherited classes * otherwise no signals will be emitted */ void connectNotify(const QMetaMethod &signal) override; /** * \attention Make sure to call this method in inherited classes */ void disconnectNotify(const QMetaMethod &signal) override; TransactionPrivate * const d_ptr; /** * Creates a new transaction object * asking PackageKit for a new TID * * This constructor is used by Daemon * */ Transaction(); Transaction(TransactionPrivate *d); private: friend class Daemon; Q_DECLARE_PRIVATE(Transaction) Q_DISABLE_COPY(Transaction) Q_PRIVATE_SLOT(d_func(), void distroUpgrade(uint type, const QString &name, const QString &description)) Q_PRIVATE_SLOT(d_func(), void details(const QVariantMap &values)) Q_PRIVATE_SLOT(d_func(), void errorCode(uint error, const QString &details)) Q_PRIVATE_SLOT(d_func(), void mediaChangeRequired(uint mediaType, const QString &mediaId, const QString &mediaText)) Q_PRIVATE_SLOT(d_func(), void finished(uint exitCode, uint runtime)) Q_PRIVATE_SLOT(d_func(), void Package(uint info, const QString &pid, const QString &summary)) Q_PRIVATE_SLOT(d_func(), void ItemProgress(const QString &itemID, uint status, uint percentage)) Q_PRIVATE_SLOT(d_func(), void RepoSignatureRequired(const QString &pid, const QString &repoName, const QString &keyUrl, const QString &keyUserid, const QString &keyId, const QString &keyFingerprint, const QString &keyTimestamp, uint type)) Q_PRIVATE_SLOT(d_func(), void requireRestart(uint type, const QString &pid)) Q_PRIVATE_SLOT(d_func(), void transaction(const QDBusObjectPath &oldTid, const QString ×pec, bool succeeded, uint role, uint duration, const QString &data, uint uid, const QString &cmdline)) Q_PRIVATE_SLOT(d_func(), void UpdateDetail(const QString &package_id, const QStringList &updates, const QStringList &obsoletes, const QStringList &vendor_urls, const QStringList &bugzilla_urls, const QStringList &cve_urls, uint restart, const QString &update_text, const QString &changelog, uint state, const QString &issued, const QString &updated)) Q_PRIVATE_SLOT(d_func(), void destroy()) Q_PRIVATE_SLOT(d_func(), void daemonQuit()) Q_PRIVATE_SLOT(d_func(), void propertiesChanged(QString,QVariantMap,QStringList)) Q_PRIVATE_SLOT(d_func(), void updateProperties(QVariantMap)) }; Q_DECLARE_OPERATORS_FOR_FLAGS(Transaction::Filters) Q_DECLARE_OPERATORS_FOR_FLAGS(Transaction::TransactionFlags) } // End namespace PackageKit Q_DECLARE_METATYPE(PackageKit::Transaction::InternalError) Q_DECLARE_METATYPE(PackageKit::Transaction::Role) Q_DECLARE_METATYPE(PackageKit::Transaction::Error) Q_DECLARE_METATYPE(PackageKit::Transaction::Exit) Q_DECLARE_METATYPE(PackageKit::Transaction::Status) Q_DECLARE_METATYPE(PackageKit::Transaction::MediaType) Q_DECLARE_METATYPE(PackageKit::Transaction::DistroUpgrade) Q_DECLARE_METATYPE(PackageKit::Transaction::TransactionFlag) Q_DECLARE_METATYPE(PackageKit::Transaction::Restart) Q_DECLARE_METATYPE(PackageKit::Transaction::UpdateState) Q_DECLARE_METATYPE(PackageKit::Transaction::Group) Q_DECLARE_METATYPE(PackageKit::Transaction::Info) Q_DECLARE_METATYPE(PackageKit::Transaction::SigType) Q_DECLARE_METATYPE(PackageKit::Transaction::Filter) Q_DECLARE_METATYPE(PackageKit::Transaction::TransactionFlags) Q_DECLARE_METATYPE(PackageKit::Transaction::Filters) Q_DECLARE_METATYPE(PackageKit::Transaction::UpgradeKind) #endif PackageKit-Qt-1.0.1/src/transactionprivate.cpp000066400000000000000000000363601322745327400213320ustar00rootroot00000000000000/* * This file is part of the QPackageKit project * Copyright (C) 2008 Adrien Bustany * Copyright (C) 2010-2018 Daniel Nicoletti * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 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 * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "transactionprivate.h" #include "daemonprivate.h" #include "daemon.h" #include "common.h" #include "details.h" #include using namespace PackageKit; TransactionPrivate::TransactionPrivate(Transaction* parent) : q_ptr(parent) { } TransactionPrivate::~TransactionPrivate() { delete p; } void TransactionPrivate::setup(const QDBusObjectPath &transactionId) { Q_Q(Transaction); tid = transactionId; p = new OrgFreedesktopPackageKitTransactionInterface(PK_NAME, tid.path(), QDBusConnection::systemBus(), q); if (!Daemon::global()->hints().isEmpty()) { q->setHints(Daemon::global()->hints()); } q->connect(p, SIGNAL(Destroy()), SLOT(destroy())); // Get current properties QDBusMessage message = QDBusMessage::createMethodCall(PK_NAME, tid.path(), DBUS_PROPERTIES, QLatin1String("GetAll")); message << PK_TRANSACTION_INTERFACE; QDBusConnection::systemBus().callWithCallback(message, q, SLOT(updateProperties(QVariantMap))); // Watch for properties updates QDBusConnection::systemBus().connect(PK_NAME, tid.path(), DBUS_PROPERTIES, QLatin1String("PropertiesChanged"), q, SLOT(propertiesChanged(QString,QVariantMap,QStringList))); const QVector signals = connectedSignals; for (const QMetaMethod &signal : signals) { setupSignal(signal); } // Execute pending call runQueuedTransaction(); } void TransactionPrivate::runQueuedTransaction() { Q_Q(Transaction); QDBusPendingReply<> reply; switch (role) { case Transaction::RoleAcceptEula: reply = p->AcceptEula(eulaId); break; case Transaction::RoleDownloadPackages: reply = p->DownloadPackages(storeInCache, search); break; case Transaction::RoleGetCategories: reply = p->GetCategories(); break; case Transaction::RoleDependsOn: reply = p->DependsOn(filters, search, recursive); break; case Transaction::RoleGetDetails: reply = p->GetDetails(search); break; case Transaction::RoleGetFiles: reply = p->GetFiles(search); break; case Transaction::RoleGetOldTransactions: reply = p->GetOldTransactions(numberOfOldTransactions); break; case Transaction::RoleGetPackages: reply = p->GetPackages(filters); break; case Transaction::RoleGetRepoList: reply = p->GetRepoList(filters); break; case Transaction::RoleRequiredBy: reply = p->RequiredBy(filters, search, recursive); break; case Transaction::RoleGetUpdateDetail: reply = p->GetUpdateDetail(search); break; case Transaction::RoleGetUpdates: reply = p->GetUpdates(filters); break; case Transaction::RoleGetDistroUpgrades: reply = p->GetDistroUpgrades(); break; case Transaction::RoleInstallFiles: reply = p->InstallFiles(transactionFlags, search); break; case Transaction::RoleInstallPackages: reply = p->InstallPackages(transactionFlags, search); break; case Transaction::RoleInstallSignature: reply = p->InstallSignature(signatureType, signatureKey, signaturePackage); break; case Transaction::RoleRefreshCache: reply = p->RefreshCache(refreshCacheForce); break; case Transaction::RoleRemovePackages: reply = p->RemovePackages(transactionFlags, search, allowDeps, autoremove); break; case Transaction::RoleRepairSystem: reply = p->RepairSystem(transactionFlags); break; case Transaction::RoleRepoEnable: reply = p->RepoEnable(repoId, repoEnable); break; case Transaction::RoleRepoSetData: reply = p->RepoSetData(repoId, repoParameter, repoValue); break; case Transaction::RoleResolve: reply = p->Resolve(filters, search); break; case Transaction::RoleSearchFile: reply = p->SearchFiles(filters, search); break; case Transaction::RoleSearchDetails: reply = p->SearchDetails(filters, search); break; case Transaction::RoleSearchGroup: reply = p->SearchGroups(filters, search); break; case Transaction::RoleSearchName: reply = p->SearchNames(filters, search); break; case Transaction::RoleUpdatePackages: reply = p->UpdatePackages(transactionFlags, search); break; case Transaction::RoleWhatProvides: reply = p->WhatProvides(filters, search); break; case Transaction::RoleGetDetailsLocal: reply = p->GetDetailsLocal(search); break; case Transaction::RoleGetFilesLocal: reply = p->GetFilesLocal(search); break; case Transaction::RoleRepoRemove: reply = p->RepoRemove(transactionFlags, repoId, autoremove); break; case Transaction::RoleUpgradeSystem: reply = p->UpgradeSystem(transactionFlags, upgradeDistroId, upgradeKind); break; default: break; } auto watcher = new QDBusPendingCallWatcher(reply, q); q->connect(watcher, &QDBusPendingCallWatcher::finished, q, [this, q] (QDBusPendingCallWatcher *call) { QDBusPendingReply<> reply = *call; if (reply.isError()) { q->errorCode(Transaction::ErrorInternalError, reply.error().message()); finished(Transaction::ExitFailed, 0); destroy(); } call->deleteLater(); }); } void TransactionPrivate::details(const QVariantMap &values) { Q_Q(Transaction); q->details(PackageKit::Details(values)); } void TransactionPrivate::distroUpgrade(uint type, const QString &name, const QString &description) { Q_Q(Transaction); q->distroUpgrade(static_cast(type), name, description); } void TransactionPrivate::errorCode(uint error, const QString &details) { Q_Q(Transaction); q->errorCode(static_cast(error), details); } void TransactionPrivate::mediaChangeRequired(uint mediaType, const QString &mediaId, const QString &mediaText) { Q_Q(Transaction); q->mediaChangeRequired(static_cast(mediaType), mediaId, mediaText); } void TransactionPrivate::finished(uint exitCode, uint runtime) { Q_Q(Transaction); q->finished(static_cast(exitCode), runtime); sentFinished = true; q->deleteLater(); } void TransactionPrivate::destroy() { Q_Q(Transaction); if (p) { delete p; p = nullptr; } if (!sentFinished) { // If after we connect to a transaction we happend // to only receive destroyed signal send a finished // to the client q->finished(Transaction::ExitUnknown, 0); } q->deleteLater(); } void TransactionPrivate::daemonQuit() { Q_Q(Transaction); if (p) { q->errorCode(Transaction::ErrorProcessKill, QObject::tr("The PackageKit daemon has crashed")); finished(Transaction::ExitKilled, 0); destroy(); } } void TransactionPrivate::propertiesChanged(const QString &interface, const QVariantMap &properties, const QStringList &invalidatedProperties) { Q_UNUSED(interface) Q_UNUSED(invalidatedProperties) updateProperties(properties); } void TransactionPrivate::updateProperties(const QVariantMap &properties) { Q_Q(Transaction); QVariantMap::ConstIterator it = properties.constBegin(); while (it != properties.constEnd()) { const QString &property = it.key(); const QVariant &value = it.value(); if (property == QLatin1String("AllowCancel")) { allowCancel = value.toBool(); QMetaObject::invokeMethod(q, "allowCancelChanged", Qt::QueuedConnection); } else if (property == QLatin1String("CallerActive")) { callerActive = value.toBool(); QMetaObject::invokeMethod(q, "isCallerActiveChanged", Qt::QueuedConnection); } else if (property == QLatin1String("DownloadSizeRemaining")) { downloadSizeRemaining = value.toLongLong(); QMetaObject::invokeMethod(q, "downloadSizeRemainingChanged", Qt::QueuedConnection); } else if (property == QLatin1String("ElapsedTime")) { elapsedTime = value.toUInt(); QMetaObject::invokeMethod(q, "elapsedTimeChanged", Qt::QueuedConnection); } else if (property == QLatin1String("LastPackage")) { lastPackage = value.toString(); QMetaObject::invokeMethod(q, "lastPackageChanged", Qt::QueuedConnection); } else if (property == QLatin1String("Percentage")) { percentage = value.toUInt(); QMetaObject::invokeMethod(q, "percentageChanged", Qt::QueuedConnection); } else if (property == QLatin1String("RemainingTime")) { remainingTime = value.toUInt(); q->remainingTimeChanged(); } else if (property == QLatin1String("Role")) { role = static_cast(value.toUInt()); QMetaObject::invokeMethod(q, "roleChanged", Qt::QueuedConnection); } else if (property == QLatin1String("Speed")) { speed = value.toUInt(); QMetaObject::invokeMethod(q, "speedChanged", Qt::QueuedConnection); } else if (property == QLatin1String("Status")) { status = static_cast(value.toUInt()); QMetaObject::invokeMethod(q, "statusChanged", Qt::QueuedConnection); } else if (property == QLatin1String("TransactionFlags")) { transactionFlags = static_cast(value.toUInt()); QMetaObject::invokeMethod(q, "transactionFlagsChanged", Qt::QueuedConnection); } else if (property == QLatin1String("Uid")) { uid = value.toUInt(); QMetaObject::invokeMethod(q, "uidChanged", Qt::QueuedConnection); } else { qCWarning(PACKAGEKITQT_TRANSACTION) << "Unknown Transaction property:" << property << value; } ++it; } } void TransactionPrivate::Package(uint info, const QString &pid, const QString &summary) { Q_Q(Transaction); q->package(static_cast(info), pid, summary); } void TransactionPrivate::ItemProgress(const QString &itemID, uint status, uint percentage) { Q_Q(Transaction); q->itemProgress(itemID, static_cast(status), percentage); } void TransactionPrivate::RepoSignatureRequired(const QString &pid, const QString &repoName, const QString &keyUrl, const QString &keyUserid, const QString &keyId, const QString &keyFingerprint, const QString &keyTimestamp, uint type) { Q_Q(Transaction); q->repoSignatureRequired(pid, repoName, keyUrl, keyUserid, keyId, keyFingerprint, keyTimestamp, static_cast(type)); } void TransactionPrivate::requireRestart(uint type, const QString &pid) { Q_Q(Transaction); q->requireRestart(static_cast(type), pid); } void TransactionPrivate::transaction(const QDBusObjectPath &oldTid, const QString ×pec, bool succeeded, uint role, uint duration, const QString &data, uint uid, const QString &cmdline) { Q_Q(Transaction); auto priv = new TransactionPrivate(q); priv->tid = tid; priv->timespec = QDateTime::fromString(timespec, Qt::ISODate); priv->succeeded = succeeded; priv->role = static_cast(role); priv->duration = duration; priv->data = data; priv->uid = uid; priv->cmdline = cmdline; auto transaction = new Transaction(priv); priv->q_ptr = transaction; q->transaction(transaction); } void TransactionPrivate::UpdateDetail(const QString &package_id, const QStringList &updates, const QStringList &obsoletes, const QStringList &vendor_urls, const QStringList &bugzilla_urls, const QStringList &cve_urls, uint restart, const QString &update_text, const QString &changelog, uint state, const QString &issued, const QString &updated) { Q_Q(Transaction); q->updateDetail(package_id, updates, obsoletes, vendor_urls, bugzilla_urls, cve_urls, static_cast(restart), update_text, changelog, static_cast(state), QDateTime::fromString(issued, Qt::ISODate), QDateTime::fromString(updated, Qt::ISODate)); } PackageKit-Qt-1.0.1/src/transactionprivate.h000066400000000000000000000112001322745327400207610ustar00rootroot00000000000000/* * This file is part of the QPackageKit project * Copyright (C) 2008 Adrien Bustany * Copyright (C) 2010-2016 Daniel Nicoletti * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 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 * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef PACKAGEKIT_TRANSACTION_PRIVATE_H #define PACKAGEKIT_TRANSACTION_PRIVATE_H #include #include #include #include #include "transaction.h" #include "transactionproxy.h" namespace PackageKit { class TransactionPrivate { Q_DECLARE_PUBLIC(Transaction) friend class Daemon; protected: TransactionPrivate(Transaction *parent); virtual ~TransactionPrivate(); void setup(const QDBusObjectPath &transactionId); void runQueuedTransaction(); QDBusObjectPath tid; QPointer<::OrgFreedesktopPackageKitTransactionInterface> p; Transaction *q_ptr; QVector connectedSignals; qulonglong downloadSizeRemaining = 0; uint elapsedTime = 0; QString lastPackage; uint percentage = 0; uint remainingTime = 0; Transaction::Role role = Transaction::RoleUnknown; uint speed = 0; Transaction::Status status = Transaction::StatusUnknown; uint uid = 0; bool sentFinished = false; bool allowCancel = false; bool callerActive = false; // Queue params QString eulaId; bool storeInCache; Transaction::Filters filters; bool recursive = false; uint numberOfOldTransactions = 0; Transaction::TransactionFlags transactionFlags = Transaction::TransactionFlagNone; Transaction::SigType signatureType = Transaction::SigTypeUnknown; QString signatureKey; QString signaturePackage; bool refreshCacheForce; bool allowDeps; bool autoremove; QString repoId; QString repoParameter; QString repoValue; bool repoEnable; QStringList search; // Only used for old transactions QDateTime timespec; bool succeeded; uint duration; QString data; QString cmdline; QString upgradeDistroId; Transaction::UpgradeKind upgradeKind; void setupSignal(const QMetaMethod &signal); private: template void processConnect(bool connect, Func1 signal, Func2 slot); protected Q_SLOTS: void details(const QVariantMap &values); void distroUpgrade(uint type, const QString &name, const QString &description); void errorCode(uint error, const QString &details); void mediaChangeRequired(uint mediaType, const QString &mediaId, const QString &mediaText); void finished(uint exitCode, uint runtime); void Package(uint info, const QString &pid, const QString &summary); void ItemProgress(const QString &itemID, uint status, uint percentage); void RepoSignatureRequired(const QString &pid, const QString &repoName, const QString &keyUrl, const QString &keyUserid, const QString &keyId, const QString &keyFingerprint, const QString &keyTimestamp, uint type); void requireRestart(uint type, const QString &pid); void transaction(const QDBusObjectPath &oldTid, const QString ×pec, bool succeeded, uint role, uint duration, const QString &data, uint uid, const QString &cmdline); void UpdateDetail(const QString &package_id, const QStringList &updates, const QStringList &obsoletes, const QStringList &vendor_urls, const QStringList &bugzilla_urls, const QStringList &cve_urls, uint restart, const QString &update_text, const QString &changelog, uint state, const QString &issued, const QString &updated); void destroy(); void daemonQuit(); void propertiesChanged(const QString &interface, const QVariantMap &properties, const QStringList &invalidatedProperties); void updateProperties(const QVariantMap &properties); }; } // End namespace PackageKit #endif