diff options
author | Daniel Nicoletti <dantti85-pk@yahoo.com.br> | 2011-11-09 12:27:23 -0200 |
---|---|---|
committer | Daniel Nicoletti <dantti85-pk@yahoo.com.br> | 2011-11-09 12:27:23 -0200 |
commit | 2950196e835cdca98ccf7bb52cc9481b29f5c870 (patch) | |
tree | 1038d14175e2148d6218a930184c86f3150b41a2 /lib | |
parent | 8312e6dd069c55e3414b0a2bce3287b5456c045f (diff) |
packagekit-qt: Drop packagekit-qt1 which is obsolete in favor of packagekit-qt2
Diffstat (limited to 'lib')
31 files changed, 0 insertions, 6164 deletions
diff --git a/lib/Makefile.am b/lib/Makefile.am index 974bab78..64d28fcd 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -1,10 +1,6 @@ SUBDIRS = python packagekit-glib2 if PK_BUILD_QT -SUBDIRS += packagekit-qt -endif - -if PK_BUILD_QT SUBDIRS += packagekit-qt2 endif diff --git a/lib/packagekit-qt/Doxyfile b/lib/packagekit-qt/Doxyfile deleted file mode 100644 index 388a083b..00000000 --- a/lib/packagekit-qt/Doxyfile +++ /dev/null @@ -1,1258 +0,0 @@ -# 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 = QPackageKit - -# 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-qt - -# 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 DETAILS_AT_TOP tag is set to YES then Doxygen -# will output the detailed description near the top, like JavaDoc. -# If set to NO, the detailed description appears after the member -# documentation. - -DETAILS_AT_TOP = 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 <command> <input-file>, where <command> is the value of -# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file -# provided by doxygen. Whatever the program writes to standard output -# is used as the file version. See the manual for examples. - -FILE_VERSION_FILTER = - -#--------------------------------------------------------------------------- -# 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 = ../../lib/packagekit-qt/src -# 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 <filter> <input-file>, where <filter> -# is the value of the INPUT_FILTER tag, and <input-file> is the name of an -# input file. Doxygen will then use the output that the filter program writes -# to standard output. If FILTER_PATTERNS is specified, this tag will be -# ignored. - -INPUT_FILTER = - -# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern -# basis. Doxygen will compare the file name with each pattern and apply the -# filter if there is a match. The filters are a list of the form: -# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further -# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER -# is applied to all files. - -FILTER_PATTERNS = - -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER) will be used to filter the input files when producing source -# files to browse (i.e. when SOURCE_BROWSER is set to YES). - -FILTER_SOURCE_FILES = NO - -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- - -# If the SOURCE_BROWSER tag is set to YES then a list of source files will -# be generated. Documented entities will be cross-referenced with these sources. -# Note: To get rid of all source code in the generated output, make sure also -# VERBATIM_HEADERS is set to NO. - -SOURCE_BROWSER = NO - -# Setting the INLINE_SOURCES tag to YES will include the body -# of functions and classes directly in the documentation. - -INLINE_SOURCES = NO - -# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct -# doxygen to hide any special comment blocks from generated source code -# fragments. Normal C and C++ comments will always remain visible. - -STRIP_CODE_COMMENTS = YES - -# If the REFERENCED_BY_RELATION tag is set to YES (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 diff --git a/lib/packagekit-qt/Makefile.am b/lib/packagekit-qt/Makefile.am deleted file mode 100644 index dc6fe8a2..00000000 --- a/lib/packagekit-qt/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ -SUBDIRS = modules src test - -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = \ - packagekit-qt.pc \ - $(NULL) - -EXTRA_DIST = \ - packagekit-qt.pc.in \ - Doxyfile - - --include $(top_srcdir)/git.mk diff --git a/lib/packagekit-qt/modules/FindQPackageKit.cmake b/lib/packagekit-qt/modules/FindQPackageKit.cmake deleted file mode 100644 index 5efc79a3..00000000 --- a/lib/packagekit-qt/modules/FindQPackageKit.cmake +++ /dev/null @@ -1,40 +0,0 @@ -# - Try to find QPackageKit -# Once done this will define -# -# QPACKAGEKIT_FOUND - system has QPackageKit -# QPACKAGEKIT_INCLUDE_DIR - the QPackageKit include directory -# QPACKAGEKIT_LIB - Link these to use QPackageKit -# QPACKAGEKIT_DEFINITIONS - Compiler switches required for using QPackageKit - -# Copyright (c) 2008, Adrien Bustany, <madcat@mymadcat.com> -# -# Redistribution and use is allowed according to the terms of the GPLv2+ license. - -IF (QPACKAGEKIT_INCLUDE_DIR AND QPACKAGEKIT_LIB) - SET(QPACKAGEKIT_FIND_QUIETLY TRUE) -ENDIF (QPACKAGEKIT_INCLUDE_DIR AND QPACKAGEKIT_LIB) - -FIND_PATH( QPACKAGEKIT_INCLUDE_DIR PackageKit/packagekit-qt/QPackageKit ) - -FIND_LIBRARY( QPACKAGEKIT_LIB NAMES packagekit-qt ) - -IF (QPACKAGEKIT_INCLUDE_DIR AND QPACKAGEKIT_LIB) - SET(QPACKAGEKIT_FOUND TRUE) -ELSE (QPACKAGEKIT_INCLUDE_DIR AND QPACKAGEKIT_LIB) - SET(QPACKAGEKIT_FOUND FALSE) -ENDIF (QPACKAGEKIT_INCLUDE_DIR AND QPACKAGEKIT_LIB) - -SET(QPACKAGEKIT_INCLUDE_DIR ${QPACKAGEKIT_INCLUDE_DIR}/PackageKit/packagekit-qt) - -IF (QPACKAGEKIT_FOUND) - IF (NOT QPACKAGEKIT_FIND_QUIETLY) - MESSAGE(STATUS "Found QPackageKit: ${QPACKAGEKIT_LIB}") - ENDIF (NOT QPACKAGEKIT_FIND_QUIETLY) -ELSE (QPACKAGEKIT_FOUND) - IF (QPACKAGEKIT_FIND_REQUIRED) - MESSAGE(FATAL_ERROR "Could NOT find QPackageKit") - ENDIF (QPACKAGEKIT_FIND_REQUIRED) -ENDIF (QPACKAGEKIT_FOUND) - -MARK_AS_ADVANCED(QPACKAGEKIT_INCLUDE_DIR QPACKAGEKIT_LIB) - diff --git a/lib/packagekit-qt/modules/Makefile.am b/lib/packagekit-qt/modules/Makefile.am deleted file mode 100644 index 9a102903..00000000 --- a/lib/packagekit-qt/modules/Makefile.am +++ /dev/null @@ -1,10 +0,0 @@ -cmakemoduledir = $(datadir)/cmake/Modules -cmakemodule_DATA = \ - FindQPackageKit.cmake \ - $(NULL) - -EXTRA_DIST = \ - $(cmakemodule_DATA) - - --include $(top_srcdir)/git.mk diff --git a/lib/packagekit-qt/packagekit-qt.pc.in b/lib/packagekit-qt/packagekit-qt.pc.in deleted file mode 100644 index 5e308aa7..00000000 --- a/lib/packagekit-qt/packagekit-qt.pc.in +++ /dev/null @@ -1,12 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: packagekit-qt -Description: PackageKit is a system daemon for installing stuff. -Version: @VERSION@ -Requires: QtCore, QtDBus, QtSql, QtXml -Libs: -L${libdir} -lpackagekit-qt -Cflags: -I${includedir}/PackageKit/packagekit-qt - diff --git a/lib/packagekit-qt/src/Makefile.am b/lib/packagekit-qt/src/Makefile.am deleted file mode 100644 index a9d65289..00000000 --- a/lib/packagekit-qt/src/Makefile.am +++ /dev/null @@ -1,116 +0,0 @@ -include ${top_srcdir}/moc.mk - -.NOTPARALLEL: - -NULL = - -INCLUDES = \ - $(QTCORE_CFLAGS) \ - $(QTDBUS_CFLAGS) \ - $(QTSQL_CFLAGS) \ - -DLOCALSTATEDIR=\""$(localstatedir)"\" \ - -DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\" - -METASOURCES = AUTO - -MOCFILES = \ - client.moc \ - clientprivate.moc \ - daemonproxy.moc \ - transactionproxy.moc \ - transaction.moc \ - transactionprivate.moc \ - enum.moc \ - $(NULL) - -lib_LTLIBRARIES = \ - libpackagekit-qt.la \ - $(NULL) - -libpackagekit_qt_includedir = $(includedir)/PackageKit/packagekit-qt - -libpackagekit_qt_include_HEADERS = \ - QPackageKit \ - client.h \ - transaction.h \ - package.h \ - bitfield.h \ - enum.h \ - $(NULL) - -libpackagekit_qt_la_SOURCES = \ - QPackageKit \ - common.h \ - client.h \ - client.cpp \ - clientprivate.h \ - clientprivate.cpp \ - daemonproxy.h \ - daemonproxy.cpp \ - transaction.h \ - transaction.cpp \ - transactionprivate.h \ - transactionprivate.cpp \ - transactionproxy.h \ - transactionproxy.cpp \ - package.h \ - package.cpp \ - util.h \ - util.cpp \ - bitfield.h \ - bitfield.cpp \ - enum.h \ - enum.cpp \ - dbus_proxies.stamp \ - $(NULL) - -libpackagekit_qt_la_LIBADD = \ - $(QTCORE_LIBS) \ - $(QTDBUS_LIBS) \ - $(QTSQL_LIBS) \ - $(NULL) - -libpackagekit_qt_la_CFLAGS = \ - $(WARNINGFLAGS_CPP) \ - $(NULL) - -libpackagekit_qt_la_LDFLAGS = \ - -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \ - -export-dynamic \ - -no-undefined \ - $(NULL) - -CLEANFILES = $(BUILT_SOURCES) - -clean-local: - rm -f *~ - rm -f $(CLEANFILES) - -EXTRA_DIST = \ - dbus_proxies.stamp \ - daemonproxy.h \ - daemonproxy.cpp \ - transactionproxy.h \ - transactionproxy.cpp \ - $(NULL) - -MAINTAINERCLEANFILES = \ - dbus_proxies.stamp \ - transactionproxy.h \ - transactionproxy.cpp \ - daemonproxy.h \ - daemonproxy.cpp \ - $(NULL) - -BUILT_SOURCES= \ - dbus_proxies.stamp \ - $(MOCFILES) \ - $(NULL) - -dbus_proxies.stamp: ${top_srcdir}/src/org.freedesktop.PackageKit.xml ${top_srcdir}/src/org.freedesktop.PackageKit.Transaction.xml - qdbusxml2cpp -c DaemonProxy -p daemonproxy -m -N ${top_srcdir}/src/org.freedesktop.PackageKit.xml - qdbusxml2cpp -c TransactionProxy -p transactionproxy -m -N ${top_srcdir}/src/org.freedesktop.PackageKit.Transaction.xml - touch $@ - - --include $(top_srcdir)/git.mk diff --git a/lib/packagekit-qt/src/QPackageKit b/lib/packagekit-qt/src/QPackageKit deleted file mode 100644 index d92c226d..00000000 --- a/lib/packagekit-qt/src/QPackageKit +++ /dev/null @@ -1,3 +0,0 @@ -#include "client.h" -#include "transaction.h" -#include "package.h" diff --git a/lib/packagekit-qt/src/bitfield.cpp b/lib/packagekit-qt/src/bitfield.cpp deleted file mode 100644 index cc1c54ec..00000000 --- a/lib/packagekit-qt/src/bitfield.cpp +++ /dev/null @@ -1,70 +0,0 @@ -#include "bitfield.h" - -using namespace PackageKit; - -Bitfield::Bitfield () : m_val (0) -{ -} - -Bitfield::Bitfield (qint64 val) : m_val (val) -{ -} - -Bitfield::~Bitfield () -{ -} - -qint64 Bitfield::operator& (qint64 mask) const -{ - return m_val & (1 << mask); -} - -qint64 Bitfield::operator&= (qint64 mask) -{ - m_val &= (1 << mask); - return m_val; -} - -qint64 Bitfield::operator| (qint64 mask) const -{ - return m_val | (1 << mask); -} - -qint64 Bitfield::operator|= (qint64 mask) -{ - m_val |= (1 << 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; -} diff --git a/lib/packagekit-qt/src/bitfield.h b/lib/packagekit-qt/src/bitfield.h deleted file mode 100644 index d7483a82..00000000 --- a/lib/packagekit-qt/src/bitfield.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef BITFIELD_H -#define BITFIELD_H - -#include <QtGlobal> - -namespace PackageKit { - class Bitfield - { - public: - Bitfield (); - Bitfield (qint64 val); - ~Bitfield (); - - qint64 operator& (qint64 mask) const; - qint64 operator&= (qint64 mask); - qint64 operator| (qint64 mask) const; - qint64 operator|= (qint64 mask); - - Bitfield operator& (Bitfield mask) const; - Bitfield operator&= (Bitfield mask); - Bitfield operator| (Bitfield mask) const; - Bitfield operator|= (Bitfield mask); - - Bitfield& operator= (const Bitfield& other); - - private: - qint64 m_val; - }; -} // End namespace PackageKit - -#endif diff --git a/lib/packagekit-qt/src/client.cpp b/lib/packagekit-qt/src/client.cpp deleted file mode 100644 index fa263f8a..00000000 --- a/lib/packagekit-qt/src/client.cpp +++ /dev/null @@ -1,587 +0,0 @@ -/* - * This file is part of the QPackageKit project - * Copyright (C) 2008 Adrien Bustany <madcat@mymadcat.com> - * Copyright (C) 2010 Daniel Nicoletti <dantti85-pk@yahoo.com.br> - * - * 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 <QtSql> - -#include "client.h" -#include "clientprivate.h" - -#include "common.h" -#include "daemonproxy.h" -#include "transaction.h" -#include "transactionprivate.h" -#include "package.h" -#include "util.h" - -#define CREATE_NEW_TRANSACTION \ - Transaction* t = new Transaction(QString(), this); \ - if (t->tid().isEmpty()) { \ - setLastError(ErrorDaemonUnreachable); \ - return t; \ - } \ - -#define RUN_TRANSACTION(blurb) \ - Q_D(Client); \ - CREATE_NEW_TRANSACTION \ - t->setHints(d->hints); \ - t->blurb; \ - return t; \ - -#define PK_DESKTOP_DEFAULT_DATABASE LOCALSTATEDIR "/lib/PackageKit/desktop-files.db" - -using namespace PackageKit; - -Client* Client::m_instance = 0; - -template<class T> Client::DaemonError daemonErrorFromDBusReply (QDBusPendingReply<T> e) { - return Util::errorFromString (e.error ().name ()); -} - -Client* Client::instance() -{ - if(!m_instance) - m_instance = new Client(qApp); - - return m_instance; -} - -Client::Client(QObject* parent) : QObject(parent), d_ptr(new ClientPrivate(this)) -{ - Q_D(Client); - d->daemon = new ::DaemonProxy(PK_NAME, PK_PATH, QDBusConnection::systemBus(), this); - - d->error = NoError; - - connect(d->daemon, SIGNAL(Changed()), this, SIGNAL(changed())); - connect(d->daemon, SIGNAL(RepoListChanged()), this, SIGNAL(repoListChanged())); - connect(d->daemon, SIGNAL(RestartSchedule()), this, SIGNAL(restartScheduled())); - connect(d->daemon, SIGNAL(TransactionListChanged(const QStringList&)), d, SLOT(transactionListChanged(const QStringList&))); - connect(d->daemon, SIGNAL(UpdatesChanged()), this, SIGNAL(updatesChanged())); - - // Set up database for desktop files - QSqlDatabase db; - db = QSqlDatabase::addDatabase("QSQLITE"); - db.setDatabaseName (PK_DESKTOP_DEFAULT_DATABASE); - if (!db.open()) { - qDebug() << "Failed to initialize the desktop files database"; - } -} - -Client::~Client() -{ -} - -Enum::Roles Client::actions() const -{ - Q_D(const Client); - QStringList roles = d->daemon->roles().split(";"); - - Enum::Roles flags; - foreach(const QString& role, roles) { - flags |= (Enum::Role) Util::enumFromString<Enum>(role, "Role", "Role"); - } - return flags; -} - -QString Client::backendName() const -{ - Q_D(const Client); - return d->daemon->backendName(); -} - -QString Client::backendDescription() const -{ - Q_D(const Client); - return d->daemon->backendDescription(); -} - -QString Client::backendAuthor() const -{ - Q_D(const Client); - return d->daemon->backendAuthor(); -} - -Enum::Filters Client::filters() const -{ - Q_D(const Client); - QStringList filters = d->daemon->filters().split(";"); - - // Adapt a slight difference in the enum - if(filters.contains("none")) { - filters[filters.indexOf("none")] = "no-filter"; - } - - Enum::Filters flags; - foreach(const QString& filter, filters) { - flags |= (Enum::Filter) Util::enumFromString<Enum>(filter, "Filter", "Filter"); - } - return flags; -} - -Enum::Groups Client::groups() const -{ - Q_D(const Client); - QStringList groups = d->daemon->groups().split(";"); - - Enum::Groups flags; - foreach(const QString& group, groups) { - flags.insert((Enum::Group) Util::enumFromString<Enum>(group, "Group", "Group")); - } - return flags; -} - -bool Client::locked() const -{ - Q_D(const Client); - return d->daemon->locked(); -} - -QStringList Client::mimeTypes() const -{ - Q_D(const Client); - return d->daemon->mimeTypes().split(";"); -} - -Enum::Network Client::networkState() const -{ - Q_D(const Client); - QString state = d->daemon->networkState(); - return (Enum::Network) Util::enumFromString<Enum>(state, "Network", "Network"); -} - -QString Client::distroId() const -{ - Q_D(const Client); - return d->daemon->distroId(); -} - -Enum::Authorize Client::canAuthorize(const QString &actionId) const -{ - Q_D(const Client); - QString result = d->daemon->CanAuthorize(actionId); - return (Enum::Authorize) Util::enumFromString<Enum>(result, "Authorize", "Authorize");; -} - -QString Client::getTid() const -{ - Q_D(const Client); - return d->daemon->GetTid(); -} - -uint Client::getTimeSinceAction(Enum::Role role) const -{ - Q_D(const Client); - QString roleName = Util::enumToString<Enum>(role, "Role", "Role"); - return d->daemon->GetTimeSinceAction(roleName); -} - -QStringList Client::getTransactionList() const -{ - Q_D(const Client); - return d->daemon->GetTransactionList(); -} - -QList<Transaction*> Client::getTransactionObjectList(QObject *parent) -{ - Q_D(Client); - return d->transactions(getTransactionList(), parent); -} - - -QList<Transaction*> Client::getTransactions() -{ - return getTransactionObjectList(this); -} - -void Client::setHints(const QStringList& hints) -{ - Q_D(Client); - d->hints = hints; -} - -void Client::setHints(const QString& hints) -{ - Q_D(Client); - d->hints = QStringList() << hints; -} - -bool Client::setProxy(const QString& http_proxy, const QString& ftp_proxy) -{ - Q_D(Client); - QDBusPendingReply<> r = d->daemon->SetProxy(http_proxy, NULL, ftp_proxy, NULL, NULL, NULL); - r.waitForFinished (); - if (r.isError ()) { - setLastError (daemonErrorFromDBusReply (r)); - return false; - } else { - return true; - } -} - -bool Client::setProxy(const QString& http_proxy, const QString& https_proxy, const QString& ftp_proxy, const QString& socks_proxy, const QString& no_proxy, const QString& pac) -{ - Q_D(Client); - QDBusPendingReply<> r = d->daemon->SetProxy(http_proxy, https_proxy, ftp_proxy, socks_proxy, no_proxy, pac); - r.waitForFinished (); - if (r.isError ()) { - setLastError (daemonErrorFromDBusReply (r)); - return false; - } else { - return true; - } -} - -void Client::stateHasChanged(const QString& reason) -{ - Q_D(Client); - d->daemon->StateHasChanged(reason); -} - -void Client::suggestDaemonQuit() -{ - Q_D(Client); - d->daemon->SuggestDaemonQuit(); -} - -Client::DaemonError Client::getLastError() const -{ - Q_D(const Client); - return d->error; -} - -uint Client::versionMajor() const -{ - Q_D(const Client); - return d->daemon->versionMajor(); -} - -uint Client::versionMinor() const -{ - Q_D(const Client); - return d->daemon->versionMinor(); -} - -uint Client::versionMicro() const -{ - Q_D(const Client); - return d->daemon->versionMicro(); -} - -////// Transaction functions - -Transaction* Client::acceptEula(EulaInfo info) -{ - RUN_TRANSACTION(acceptEula(info)) -} - -Transaction* Client::downloadPackages(const QList<QSharedPointer<Package> > &packages, bool storeInCache) -{ - RUN_TRANSACTION(downloadPackages(packages, storeInCache)) -} - -Transaction* Client::downloadPackages(QSharedPointer<Package> package, bool storeInCache) -{ - return downloadPackages(QList<QSharedPointer<Package> >() << package, storeInCache); -} - -Transaction* Client::getDepends(const QList<QSharedPointer<Package> >& packages, Enum::Filters filters, bool recursive) -{ - RUN_TRANSACTION(getDepends(packages, filters, recursive)) -} - -Transaction* Client::getDepends(QSharedPointer<Package> package, Enum::Filters filters, bool recursive) -{ - return getDepends(QList<QSharedPointer<Package> >() << package, filters, recursive); -} - -Transaction* Client::getDetails(const QList<QSharedPointer<Package> > &packages) -{ - RUN_TRANSACTION(getDetails(packages)) -} - -Transaction* Client::getDetails(QSharedPointer<Package> package) -{ - return getDetails(QList<QSharedPointer<Package> >() << package); -} - -Transaction* Client::getFiles(const QList<QSharedPointer<Package> >& packages) -{ - RUN_TRANSACTION(getFiles(packages)) -} - -Transaction* Client::getFiles(QSharedPointer<Package> package) -{ - return getFiles(QList<QSharedPointer<Package> >() << package); -} - -Transaction* Client::getOldTransactions(uint number) -{ - RUN_TRANSACTION(getOldTransactions(number)) -} - -Transaction* Client::getPackages(Enum::Filters filters) -{ - RUN_TRANSACTION(getPackages(filters)) -} - -Transaction* Client::getRepoList(Enum::Filters filters) -{ - RUN_TRANSACTION(getRepoList(filters)) -} - -Transaction* Client::getRequires(const QList<QSharedPointer<Package> >& packages, Enum::Filters filters, bool recursive) -{ - RUN_TRANSACTION(getRequires(packages, filters, recursive)) -} - -Transaction* Client::getRequires(QSharedPointer<Package> package, Enum::Filters filters, bool recursive) -{ - return getRequires(QList<QSharedPointer<Package> >() << package, filters, recursive); -} - -Transaction* Client::getUpdateDetail(const QList<QSharedPointer<Package> >& packages) -{ - RUN_TRANSACTION(getUpdateDetail(packages)) -} - -Transaction* Client::getUpdateDetail(QSharedPointer<Package> package) -{ - return getUpdateDetail(QList<QSharedPointer<Package> >() << package); -} - -Transaction* Client::getUpdates(Enum::Filters filters) -{ - RUN_TRANSACTION(getUpdates(filters)) -} - -Transaction* Client::getDistroUpgrades() -{ - RUN_TRANSACTION(getDistroUpgrades()) -} - -Transaction* Client::installFiles(const QStringList& files, bool only_trusted) -{ - RUN_TRANSACTION(installFiles(files, only_trusted)) -} - -Transaction* Client::installFiles(const QString& file, bool only_trusted) -{ - return installFiles(QStringList() << file, only_trusted); -} - -Transaction* Client::installPackages(bool only_trusted, const QList<QSharedPointer<Package> >& packages) -{ - RUN_TRANSACTION(installPackages(only_trusted, packages)) -} - -Transaction* Client::installPackages(bool only_trusted, QSharedPointer<Package> p) -{ - return installPackages(only_trusted, QList<QSharedPointer<Package> >() << p); -} - -Transaction* Client::installSignature(Enum::SigType type, const QString& key_id, QSharedPointer<Package> p) -{ - RUN_TRANSACTION(installSignature(type, key_id, p)) -} - -Transaction* Client::refreshCache(bool force) -{ - RUN_TRANSACTION(refreshCache(force)) -} - -Transaction* Client::removePackages(const QList<QSharedPointer<Package> >& packages, bool allow_deps, bool autoremove) -{ - RUN_TRANSACTION(removePackages(packages, allow_deps, autoremove)) -} - -Transaction* Client::removePackages(QSharedPointer<Package> p, bool allow_deps, bool autoremove) -{ - return removePackages(QList<QSharedPointer<Package> >() << p, allow_deps, autoremove); -} - -Transaction* Client::repoEnable(const QString& repo_id, bool enable) -{ - RUN_TRANSACTION(repoEnable(repo_id, enable)) -} - -Transaction* Client::repoSetData(const QString& repo_id, const QString ¶meter, const QString& value) -{ - RUN_TRANSACTION(repoSetData(repo_id, parameter, value)) -} - -Transaction* Client::resolve(const QStringList& packageNames, Enum::Filters filters) -{ - RUN_TRANSACTION(resolve(packageNames, filters)) -} - -Transaction* Client::resolve(const QString& packageName, Enum::Filters filters) -{ - return resolve(QStringList() << packageName, filters); -} - -Transaction* Client::rollback(Transaction* oldtrans) -{ - qWarning("NOT IMPLEMENTED"); - return 0; -} - -Transaction* Client::searchFiles(const QStringList& search, Enum::Filters filters) -{ - RUN_TRANSACTION(searchFiles(search, filters)) -} - -Transaction* Client::searchFiles(const QString& search, Enum::Filters filters) -{ - return searchFiles(QStringList() << search, filters); -} - -Transaction* Client::searchDetails(const QStringList& search, Enum::Filters filters) -{ - RUN_TRANSACTION(searchDetails(search, filters)) -} - -Transaction* Client::searchDetails(const QString& search, Enum::Filters filters) -{ - return searchDetails(QStringList() << search, filters); -} - -Transaction* Client::searchGroups(Enum::Groups groups, Enum::Filters filters) -{ - RUN_TRANSACTION(searchGroups(groups, filters)) -} - -Transaction* Client::searchGroups(Enum::Group group, Enum::Filters filters) -{ - return searchGroups(Enum::Groups() << group, filters); -} - -Transaction* Client::searchNames(const QStringList& search, Enum::Filters filters) -{ - RUN_TRANSACTION(searchNames(search, filters)) -} - -Transaction* Client::searchNames(const QString& search, Enum::Filters filters) -{ - return searchNames(QStringList() << search, filters); -} - -QSharedPointer<Package> Client::searchFromDesktopFile(const QString& path) -{ - QSqlDatabase db = QSqlDatabase::database(); - if (!db.isOpen()) { - qDebug() << "Desktop files database is not open"; - return QSharedPointer<Package> (NULL); - } - - QSqlQuery q(db); - q.prepare("SELECT package FROM cache WHERE filename = :path"); - q.bindValue(":path", path); - if(!q.exec()) { - qDebug() << "Error while running query " << q.executedQuery(); - return QSharedPointer<Package> (NULL); - } - - if (!q.next()) return QSharedPointer<Package> (NULL); // Return NULL if no results - - return QSharedPointer<Package> (new Package(q.value(0).toString())); - -} - -Transaction* Client::simulateInstallFiles(const QStringList& files) -{ - RUN_TRANSACTION(simulateInstallFiles(files)) -} - -Transaction* Client::simulateInstallFiles(const QString& file) -{ - return simulateInstallFiles(QStringList() << file); -} - -Transaction* Client::simulateInstallPackages(const QList<QSharedPointer<Package> >& packages) -{ - RUN_TRANSACTION(simulateInstallPackages(packages)) -} - -Transaction* Client::simulateInstallPackages(QSharedPointer<Package> package) -{ - return simulateInstallPackages(QList<QSharedPointer<Package> >() << package); -} - -Transaction* Client::simulateRemovePackages(const QList<QSharedPointer<Package> >& packages, bool autoremove) -{ - RUN_TRANSACTION(simulateRemovePackages(packages, autoremove)) -} - -Transaction* Client::simulateRemovePackages(QSharedPointer<Package> package, bool autoremove) -{ - return simulateRemovePackages(QList<QSharedPointer<Package> >() << package, autoremove); -} - -Transaction* Client::simulateUpdatePackages(const QList<QSharedPointer<Package> >& packages) -{ - RUN_TRANSACTION(simulateUpdatePackages(packages)) -} - -Transaction* Client::simulateUpdatePackages(QSharedPointer<Package> package) -{ - return simulateUpdatePackages(QList<QSharedPointer<Package> >() << package); -} - -Transaction* Client::updatePackages(bool only_trusted, const QList<QSharedPointer<Package> >& packages) -{ - RUN_TRANSACTION(updatePackages(only_trusted, packages)) -} - -Transaction* Client::updatePackages(bool only_trusted, QSharedPointer<Package> package) -{ - return updatePackages(only_trusted, QList<QSharedPointer<Package> >() << package); -} - -Transaction* Client::updateSystem(bool only_trusted) -{ - RUN_TRANSACTION(updateSystem(only_trusted)) -} - -Transaction* Client::whatProvides(Enum::Provides type, const QStringList& search, Enum::Filters filters) -{ - RUN_TRANSACTION(whatProvides(type, search, filters)) -} - -Transaction* Client::whatProvides(Enum::Provides type, const QString& search, Enum::Filters filters) -{ - return whatProvides(type, QStringList() << search, filters); -} - -void Client::setLastError (DaemonError e) -{ - Q_D(Client); - d->error = e; - emit error (e); -} - -void Client::destroyTransaction(const QString &tid) -{ - Q_D(Client); - d->destroyTransaction(tid); -} - -#include "client.moc" - diff --git a/lib/packagekit-qt/src/client.h b/lib/packagekit-qt/src/client.h deleted file mode 100644 index c3de25c3..00000000 --- a/lib/packagekit-qt/src/client.h +++ /dev/null @@ -1,663 +0,0 @@ -/* - * This file is part of the QPackageKit project - * Copyright (C) 2008 Adrien Bustany <madcat@mymadcat.com> - * - * 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 CLIENT_H -#define CLIENT_H - -#include <QtCore> -#include "enum.h" - -namespace PackageKit { - -class Package; -class Transaction; - -/** - * \class Client client.h Client - * \author Adrien Bustany <madcat@mymadcat.com> - * - * \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. - * The user should always use this class to initiate transactions. - * - * All the function returning a pointer to a Transaction work in an asynchronous way. The returned - * object can be used to alter the operation's execution, or monitor it's state. The Transaction - * object will be automatically deleted after it emits the finished() signal. - * - * \note This class is a singleton, its constructor is private. Call Client::instance() to get - * an instance of the Client object - */ -class ClientPrivate; -class Client : public QObject -{ - - Q_OBJECT - Q_ENUMS(DaemonError) - -public: - /** - * \brief Returns an instance of the Client - * - * The Client class is a singleton, you can call this method several times, - * a single Client object will exist. - */ - static Client* instance(); - - /** - * Destructor - */ - ~Client(); - - // Daemon functions - - /** - * Returns all the actions supported by the current backend - */ - Enum::Roles actions() const; - - /** - * The backend name, e.g. "yum". - */ - QString backendName() const; - - /** - * The backend description, e.g. "Yellow Dog Update Modifier". - */ - QString backendDescription() const; - - /** - * The backend author, e.g. "Joe Bloggs <joe@blogs.com>" - */ - QString backendAuthor() const; - - /** - * Returns the filters supported by the current backend - */ - Enum::Filters filters() const; - - /** - * Returns the groups supported by the current backend - */ - Enum::Groups groups() const; - - /** - * Set when the backend is locked and native tools would fail. - */ - bool locked() const; - - /** - * Returns a list containing the MIME types supported by the current backend - */ - QStringList mimeTypes() const; - - /** - * Returns the current network state - */ - Enum::Network networkState() const; - - /** - * The distribution identifier in the - * distro;version;arch form, - * e.g. "debian;squeeze/sid;x86_64". - */ - QString distroId() const; - - /** - * 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. - */ - Enum::Authorize canAuthorize(const QString &actionId) const; - - /** - * Returns the time (in seconds) since the specified \p action - */ - uint getTimeSinceAction(Enum::Role action) const; - - /** - * Returns the list of current transactions - */ - QStringList getTransactionList() const; - - /** - * Convenience function - * Returns the list of current transactions objects - * - * You must delete these yourself or pass a - * \p parent for these comming transactions - */ - QList<Transaction*> getTransactionObjectList(QObject *parent = 0); - - /** - * DEPRECATED - * Returns the list of current transactions - * You must delete these yourself or pass a - * \p parent for these comming transactions - */ - QList<Transaction*> Q_DECL_DEPRECATED getTransactions(); - - /** - * \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 Client::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 - */ - void setHints(const QString& hints); - void setHints(const QStringList& hints); - - /** - * Sets a proxy to be used for all the network operations - */ - bool setProxy(const QString& http_proxy, const QString& ftp_proxy); - bool 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 - */ - void stateHasChanged(const QString& reason); - - /** - * Asks PackageKit to quit, for example to let a native package manager operate - */ - void suggestDaemonQuit(); - - /** - * Describes a package signature - * \li \c package is a pointer to the signed package - * \li \c repoId is the id of the software repository containing the package - * \li \c keyUrl, \c keyId, \c keyFingerprint and \c keyTimestamp describe the key - * \li \c type is the signature type - */ - typedef struct { - QSharedPointer<Package> package; - QString repoId; - QString keyUrl; - QString keyUserid; - QString keyId; - QString keyFingerprint; - QString keyTimestamp; - Enum::SigType type; - } SignatureInfo; - - /** - * Describes an EULA - * \li \c id 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 - */ - typedef struct { - QString id; - QSharedPointer<Package> package; - QString vendorName; - QString licenseAgreement; - } EulaInfo; - - /** - * Describes an error at the daemon level (for example, PackageKit crashes or is unreachable) - * - * \sa Client::error - * \sa Transaction::error - */ - typedef enum { - NoError = 0, - UnkownError, - ErrorFailed, - ErrorFailedAuth, - ErrorNoTid, - ErrorAlreadyTid, - ErrorRoleUnkown, - ErrorCannotStartDaemon, - ErrorInvalidInput, - ErrorInvalidFile, - ErrorFunctionNotSupported, - ErrorDaemonUnreachable, - /* this always has to be at the end of the list */ - LastDaemonError - } DaemonError; - - /** - * Returns the last daemon error that was caught - */ - DaemonError getLastError() const; - - /** - * Describes a software update - * \li \c package is the package which triggered the update - * \li \c updates are the packages to be updated - * \li \c obsoletes lists the packages which will be obsoleted by this update - * \li \c vendorUrl, \c bugzillaUrl and \c cveUrl are links to webpages describing the update - * \li \c restart indicates if a restart will be required after this update - * \li \c updateText describes the update - * \li \c changelog holds the changelog - * \li \c state is the category of the update, eg. stable or testing - * \li \c issued and \c updated indicate the dates at which the update was issued and updated - */ - typedef struct { - QSharedPointer<Package> package; - QList<QSharedPointer<Package> > updates; - QList<QSharedPointer<Package> > obsoletes; - QString vendorUrl; - QString bugzillaUrl; - QString cveUrl; - Enum::Restart restart; - QString updateText; - QString changelog; - Enum::UpdateState state; - QDateTime issued; - QDateTime updated; - } UpdateInfo; - - /** - * Returns the major version number. - */ - uint versionMajor() const; - - /** - * The minor version number. - */ - uint versionMinor() const; - - /** - * The micro version number. - */ - uint versionMicro() const; - - // Transaction functions - - /** - * DEPRECATED - * \brief Accepts an EULA - * - * The EULA is identified by the EulaInfo structure \p info - * - * \note You need to restart the transaction which triggered the EULA manually - * - * \sa Transaction::eulaRequired - */ - Transaction* Q_DECL_DEPRECATED acceptEula(EulaInfo info); - - /** - * DEPRECATED - * Download the given \p packages to a temp dir, if \p storeInCache is true - * the download will be stored in the package manager cache - */ - Transaction* Q_DECL_DEPRECATED downloadPackages(const QList<QSharedPointer<Package> > &packages, bool storeInCache = false); - - /** - * DEPRECATED - * This is a convenience function - */ - Transaction* Q_DECL_DEPRECATED downloadPackages(QSharedPointer<Package> package, bool storeInCache = false); - - /** - * DEPRECATED - * Returns the collection categories - * - * \sa Transaction::category - */ - Transaction* Q_DECL_DEPRECATED getCategories(); - - /** - * DEPRECATED - * \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. - * - * \sa Transaction::package - * - */ - Transaction* Q_DECL_DEPRECATED getDepends(const QList<QSharedPointer<Package> >& packages, Enum::Filters filters, bool recursive); - Transaction* Q_DECL_DEPRECATED getDepends(QSharedPointer<Package> package, Enum::Filters filters , bool recursive); - - /** - * DEPRECATED - * Gets more details about the given \p packages - * - * \sa Transaction::details - */ - Transaction* Q_DECL_DEPRECATED getDetails(const QList<QSharedPointer<Package> >& packages); - Transaction* Q_DECL_DEPRECATED getDetails(QSharedPointer<Package> package); - - /** - * DEPRECATED - * Gets the files contained in the given \p packages - * - * \sa Transaction::files - */ - Transaction* Q_DECL_DEPRECATED getFiles(const QList<QSharedPointer<Package> >& packages); - Transaction* Q_DECL_DEPRECATED getFiles(QSharedPointer<Package> packages); - - /** - * DEPRECATED - * \brief Gets the last \p number finished transactions - * - * \note You must delete these transactions yourself - */ - Transaction* Q_DECL_DEPRECATED getOldTransactions(uint number); - - /** - * DEPRECATED - * Gets all the packages matching the given \p filters - * - * \sa Transaction::package - */ - Transaction* Q_DECL_DEPRECATED getPackages(Enum::Filters filters = Enum::NoFilter); - - /** - * DEPRECATED - * Gets the list of software repositories matching the given \p filters - */ - Transaction* Q_DECL_DEPRECATED getRepoList(Enum::Filters filter = Enum::NoFilter); - - /** - * DEPRECATED - * \brief Searches for the packages requiring the given \p packages - * - * The search can be limited using the \p filters parameter. The recursive flag is used to tell - * if the package manager should also search for the package requiring the resulting packages. - */ - Transaction* Q_DECL_DEPRECATED getRequires(const QList<QSharedPointer<Package> >& packages, Enum::Filters filters, bool recursive); - Transaction* Q_DECL_DEPRECATED getRequires(QSharedPointer<Package> package, Enum::Filters filters, bool recursive); - - /** - * DEPRECATED - * Retrieves more details about the update for the given \p packages - */ - Transaction* Q_DECL_DEPRECATED getUpdateDetail(const QList<QSharedPointer<Package> >& packages); - Transaction* Q_DECL_DEPRECATED getUpdateDetail(QSharedPointer<Package> package); - - /** - * DEPRECATED - * \p Gets the available updates - * - * The \p filters parameters can be used to restrict the updates returned - */ - Transaction* Q_DECL_DEPRECATED getUpdates(Enum::Filters filters = Enum::NoFilter); - - /** - * DEPRECATED - * Retrieves the available distribution upgrades - */ - Transaction* Q_DECL_DEPRECATED getDistroUpgrades(); - - /** - * DEPRECATED - * \brief Installs the local packages \p files - * - * \p only_trusted indicate if the packages are signed by a trusted authority - */ - Transaction* Q_DECL_DEPRECATED installFiles(const QStringList& files, bool only_trusted); - Transaction* Q_DECL_DEPRECATED installFiles(const QString& file, bool only_trusted); - - /** - * DEPRECATED - * Install the given \p packages - * - * \p only_trusted indicates if we should allow installation of untrusted packages (requires a different authorization) - */ - Transaction* Q_DECL_DEPRECATED installPackages(bool only_trusted, const QList<QSharedPointer<Package> >& packages); - Transaction* Q_DECL_DEPRECATED installPackages(bool only_trusted, QSharedPointer<Package> p); - - /** - * DEPRECATED - * \brief Installs a signature - * - * \p type, \p key_id and \p p generally come from the Transaction::repoSignatureRequired - */ - Transaction* Q_DECL_DEPRECATED installSignature(Enum::SigType type, const QString& key_id, QSharedPointer<Package> p); - - /** - * DEPRECATED - * Refreshes the package manager's cache - */ - Transaction* Q_DECL_DEPRECATED refreshCache(bool force); - - /** - * DEPRECATED - * \brief Removes the given \p packages - * - * \p allow_deps 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. - */ - Transaction* Q_DECL_DEPRECATED removePackages(const QList<QSharedPointer<Package> >& packages, bool allow_deps, bool autoremove); - Transaction* Q_DECL_DEPRECATED removePackages(QSharedPointer<Package> p, bool allow_deps, bool autoremove); - - /** - * DEPRECATED - * Activates or disables a repository - */ - Transaction* Q_DECL_DEPRECATED repoEnable(const QString& repo_id, bool enable); - - /** - * DEPRECATED - * Sets a repository's parameter - */ - Transaction* Q_DECL_DEPRECATED repoSetData(const QString& repo_id, const QString& parameter, const QString& value); - - /** - * DEPRECATED - * \brief Tries to create a Package object from the package's name - * - * The \p filters can be used to restrict the search - */ - Transaction* Q_DECL_DEPRECATED resolve(const QStringList& packageNames, Enum::Filters filters = Enum::NoFilter); - Transaction* Q_DECL_DEPRECATED resolve(const QString& packageName, Enum::Filters filters = Enum::NoFilter); - - /** - * DEPRECATED - * Rolls back the given \p transactions - */ - Transaction* Q_DECL_DEPRECATED rollback(Transaction* oldtrans); - - /** - * DEPRECATED - * \brief Search in the packages files - * - * \p filters can be used to restrict the returned packages - */ - Transaction* Q_DECL_DEPRECATED searchFiles(const QStringList& search, Enum::Filters filters = Enum::NoFilter); - Transaction* Q_DECL_DEPRECATED searchFiles(const QString& search, Enum::Filters filters = Enum::NoFilter); - - /** - * DEPRECATED - * \brief Search in the packages details - * - * \p filters can be used to restrict the returned packages - */ - Transaction* Q_DECL_DEPRECATED searchDetails(const QStringList& search, Enum::Filters filters = Enum::NoFilter); - Transaction* Q_DECL_DEPRECATED searchDetails(const QString& search, Enum::Filters filters = Enum::NoFilter); - - /** - * DEPRECATED - * \brief Lists all the packages in the given \p group - * - * \p filters can be used to restrict the returned packages - */ - Transaction* Q_DECL_DEPRECATED searchGroups(Enum::Groups group, Enum::Filters filters = Enum::NoFilter); - Transaction* Q_DECL_DEPRECATED searchGroups(Enum::Group group, Enum::Filters filters = Enum::NoFilter); - - /** - * DEPRECATED - * \brief Search in the packages names - * - * \p filters can be used to restrict the returned packages - */ - Transaction* Q_DECL_DEPRECATED searchNames(const QStringList& search, Enum::Filters filters = Enum::NoFilter); - Transaction* Q_DECL_DEPRECATED searchNames(const QString& search, Enum::Filters filters = Enum::NoFilter); - - /** - * DEPRECATED - * \brief Tries to find a package name from a desktop file - * - * This function looks into /var/lib/PackageKit/desktop-files.db and searches for the associated package name. - * - * \p path the path to the desktop file (as shipped by the package) - * \return The associated package, or NULL if there's no result - */ - QSharedPointer<Package> searchFromDesktopFile(const QString& path); - - /** - * DEPRECATED - * \brief Simulates an installation of \p files. - * - * You should call this method before installing \p files - * \note: This method might emit packages with INSTALLING, REMOVING, UPDATING, - * REINSTALLING or OBSOLETING status. - */ - Transaction* Q_DECL_DEPRECATED simulateInstallFiles(const QStringList& files); - Transaction* Q_DECL_DEPRECATED simulateInstallFiles(const QString& file); - - /** - * DEPRECATED - * \brief Simulates an installation of \p packages. - * - * You should call this method before installing \p packages - * \note: This method might emit packages with INSTALLING, REMOVING, UPDATING, - * REINSTALLING or OBSOLETING status. - */ - Transaction* Q_DECL_DEPRECATED simulateInstallPackages(const QList<QSharedPointer<Package> >& packages); - Transaction* Q_DECL_DEPRECATED simulateInstallPackages(QSharedPointer<Package> package); - - /** - * DEPRECATED - * \brief Simulates a removal of \p packages. - * - * You should call this method before removing \p packages - * \note: This method might emit packages with INSTALLING, REMOVING, UPDATING, - * REINSTALLING or OBSOLETING status. - */ - Transaction* Q_DECL_DEPRECATED simulateRemovePackages(const QList<QSharedPointer<Package> >& packages, bool autoremove); - Transaction* Q_DECL_DEPRECATED simulateRemovePackages(QSharedPointer<Package> package, bool autoremove); - - /** - * DEPRECATED - * \brief Simulates an update of \p packages. - * - * You should call this method before updating \p packages - * \note: This method might emit packages with INSTALLING, REMOVING, UPDATING, - * REINSTALLING or OBSOLETING status. - */ - Transaction* Q_DECL_DEPRECATED simulateUpdatePackages(const QList<QSharedPointer<Package> >& packages); - Transaction* Q_DECL_DEPRECATED simulateUpdatePackages(QSharedPointer<Package> package); - - /** - * DEPRECATED - * Update the given \p packages - */ - Transaction* Q_DECL_DEPRECATED updatePackages(bool only_trusted, const QList<QSharedPointer<Package> >& packages); - Transaction* Q_DECL_DEPRECATED updatePackages(bool only_trusted, QSharedPointer<Package> package); - - /** - * DEPRECATED - * Updates the whole system - * - * \p only_trusted indicates if this transaction is only allowed to install trusted packages - */ - Transaction* Q_DECL_DEPRECATED updateSystem(bool only_trusted); - - /** - * DEPRECATED - * Searchs for a package providing a file/a mimetype - */ - Transaction* Q_DECL_DEPRECATED whatProvides(Enum::Provides type, const QStringList& search, Enum::Filters filters = Enum::NoFilter); - Transaction* Q_DECL_DEPRECATED whatProvides(Enum::Provides type, const QString& search, Enum::Filters filters = Enum::NoFilter); - -Q_SIGNALS: - /** - * This signal is emitted when a property on the interface changes. - */ - void changed(); - - /** - * Emitted when the PackageKit daemon sends an error - */ - void error(PackageKit::Client::DaemonError e); - - /** - * 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 QList<PackageKit::Transaction*>&); - - /** - * Emitted when new updates are available - */ - void updatesChanged(); - -protected: - /** - * \brief creates a new transaction path - * This function register a new DBus path on PackageKit - * allowing a \c Transaction object to be created, - * unless you want to know the transaction id - * before creating the \c Transaction this function - * is not useful since passing a NULL string (QString()) - * when contructing the \c Transaction object will - * automatically create this path. - */ - QString getTid() const; - ClientPrivate * const d_ptr; - -private: - Q_DECLARE_PRIVATE(Client); - Client(QObject* parent = 0); - static Client* m_instance; - friend class TransactionPrivate; - friend class Transaction; - - void setLastError(DaemonError e); - - void destroyTransaction(const QString &tid); -}; - -} // End namespace PackageKit - -#endif diff --git a/lib/packagekit-qt/src/clientprivate.cpp b/lib/packagekit-qt/src/clientprivate.cpp deleted file mode 100644 index ed1fce88..00000000 --- a/lib/packagekit-qt/src/clientprivate.cpp +++ /dev/null @@ -1,90 +0,0 @@ -/* - * This file is part of the QPackageKit project - * Copyright (C) 2008 Adrien Bustany <madcat@mymadcat.com> - * - * 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 "clientprivate.h" -#include "transaction.h" -#include "transactionprivate.h" -#include "common.h" - -#include <QDBusConnection> - -using namespace PackageKit; - -ClientPrivate::ClientPrivate(Client* parent) - : QObject(parent), - c(parent) -{ - m_watcher = new QDBusServiceWatcher(PK_NAME, - QDBusConnection::systemBus(), - QDBusServiceWatcher::WatchForUnregistration, - this); - connect(m_watcher, SIGNAL(serviceUnregistered(const QString &)), - this, SLOT(serviceUnregistered())); -} - -ClientPrivate::~ClientPrivate() -{ -} - -QList<Transaction*> ClientPrivate::transactions(const QStringList& tids, QObject *parent) -{ -// qDebug() << "entering transactionListChanged"; - QList<Transaction*> trans; - foreach(const QString& tid, tids) { - if(runningTransactions.contains(tid)) { -// qDebug() << "reusing transaction from pool : " << tid; - trans.append(runningTransactions.value(tid)); - } else { -// qDebug() << "external transaction : " << tid; - Transaction* t = new Transaction(tid, parent); - trans.append(t); - runningTransactions.insert(tid, t); - } - } - return trans; -} - -void ClientPrivate::transactionListChanged(const QStringList& tids) -{ - c->transactionListChanged(transactions(tids, Client::instance())); -} - -void ClientPrivate::serviceUnregistered() -{ - error = Client::ErrorDaemonUnreachable; - c->error(error); - - foreach (Transaction *t, runningTransactions) { - t->finished (Enum::ExitFailed, 0); - t->d_ptr->destroy (); - } - - // We don't have more transactions running - c->transactionListChanged(QList<Transaction*>()); -} - -void ClientPrivate::destroyTransaction(const QString &tid) -{ -// qDebug() << "removing transaction from pool: " << tid; -// runningTransactions[tid]->deleteLater(); - runningTransactions.remove(tid); -} - -#include "clientprivate.moc" diff --git a/lib/packagekit-qt/src/clientprivate.h b/lib/packagekit-qt/src/clientprivate.h deleted file mode 100644 index c867dc82..00000000 --- a/lib/packagekit-qt/src/clientprivate.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * This file is part of the QPackageKit project - * Copyright (C) 2008 Adrien Bustany <madcat@mymadcat.com> - * Copyright (C) 2010 Daniel Nicoletti <dantti85-pk@yahoo.com.br> - * - * 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 CLIENTPRIVATE_H -#define CLIENTPRIVATE_H - -#include <QtCore> -#include <QDBusServiceWatcher> -#include "client.h" - -class DaemonProxy; - -namespace PackageKit { - -class Transaction; - -class ClientPrivate : public QObject -{ - Q_OBJECT - -public: - ~ClientPrivate(); - - ::DaemonProxy* daemon; - Client* c; - QStringList hints; - QHash<QString, Transaction*> runningTransactions; - Client::DaemonError error; - - QList<Transaction*> transactions(const QStringList &tids, QObject *parent); - void destroyTransaction(const QString &tid); - -public Q_SLOTS: - void transactionListChanged(const QStringList &tids); - void serviceUnregistered(); - -private: - friend class Client; - ClientPrivate(Client* parent); - - QDBusServiceWatcher *m_watcher; -}; - -} // End namespace PackageKit - -#endif diff --git a/lib/packagekit-qt/src/common.h b/lib/packagekit-qt/src/common.h deleted file mode 100644 index eb5e57bd..00000000 --- a/lib/packagekit-qt/src/common.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * This file is part of the QPackageKit project - * Copyright (C) 2008 Adrien Bustany <madcat@mymadcat.com> - * - * 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 PK_TRANSACTION_INTERFACE "org.freedesktop.PackageKit.Transaction" -#define PK_NAME "org.freedesktop.PackageKit" -#define PK_PATH "/org/freedesktop/PackageKit" - -#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_ROLLBACK "org.freedesktop.packagekit.system-rollback" -#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" - diff --git a/lib/packagekit-qt/src/enum.cpp b/lib/packagekit-qt/src/enum.cpp deleted file mode 100644 index 989d2c2c..00000000 --- a/lib/packagekit-qt/src/enum.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* - * This file is part of the QPackageKit project - * Copyright (C) 2008 Adrien Bustany <madcat@mymadcat.com> - * - * 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 "enum.h" -#include "enum.moc" - diff --git a/lib/packagekit-qt/src/enum.h b/lib/packagekit-qt/src/enum.h deleted file mode 100644 index f8703704..00000000 --- a/lib/packagekit-qt/src/enum.h +++ /dev/null @@ -1,621 +0,0 @@ -/* - * This file is part of the QPackageKit project - * Copyright (C) 2008 Adrien Bustany <madcat@mymadcat.com> - * Copyright (C) 2009-2010 Daniel Nicoletti <dantti85-pk@yahoo.com.br> - * - * 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 ENUM_H -#define ENUM_H - -#include <QtCore> -#include "bitfield.h" - -namespace PackageKit { - -/** -* \class Enum enum.h Enum -* \author Adrien Bustany <madcat@mymadcat.com> -* -* \brief Represents a PackageKit's enums -* -* This class represents a PackageKit enums. -* -*/ -class Enum : public QObject -{ - Q_OBJECT - Q_ENUMS(Role) - Q_ENUMS(Status) - Q_ENUMS(Exit) - Q_ENUMS(Network) - Q_ENUMS(Filter) - Q_ENUMS(Restart) - Q_ENUMS(Message) - Q_ENUMS(Error) - Q_ENUMS(Group) - Q_ENUMS(UpdateState) - Q_ENUMS(Info) - Q_ENUMS(DistroUpgrade) - Q_ENUMS(SigType) - Q_ENUMS(Provides) - Q_ENUMS(License) - Q_ENUMS(MediaType) - Q_ENUMS(Authorize) -public: - /** - * Lists all the available actions - * \sa getActions - */ - typedef enum { - UnknownRole, - RoleCancel, - RoleGetDepends, - RoleGetDetails, - RoleGetFiles, - RoleGetPackages, - RoleGetRepoList, - RoleGetRequires, - RoleGetUpdateDetail, - RoleGetUpdates, - RoleInstallFiles, - RoleInstallPackages, - RoleInstallSignature, - RoleRefreshCache, - RoleRemovePackages, - RoleRepoEnable, - RoleRepoSetData, - RoleResolve, - RoleRollback, - RoleSearchDetails, - RoleSearchFile, - RoleSearchGroup, - RoleSearchName, - RoleUpdatePackages, - RoleUpdateSystem, - RoleWhatProvides, - RoleAcceptEula, - RoleDownloadPackages, - RoleGetDistroUpgrades, - RoleGetCategories, - RoleGetOldTransactions, - RoleSimulateInstallFiles, - RoleSimulateInstallPackages, - RoleSimulateRemovePackages, - RoleSimulateUpdatePackages, - RoleUpgradeSystem, // Since 0.6.11 - /* this always has to be at the end of the list */ - LastRole - } Role; - typedef Bitfield Roles; - - /** - * Describes the current state of the transaction - */ - typedef enum { - UnknownStatus, - StatusWait, - StatusSetup, - StatusRunning, - StatusQuery, - StatusInfo, - StatusRemove, - StatusRefreshCache, - StatusDownload, - StatusInstall, - StatusUpdate, - StatusCleanup, - StatusObsolete, - StatusDepResolve, - StatusSigCheck, - StatusRollback, - StatusTestCommit, - StatusCommit, - StatusRequest, - StatusFinished, - StatusCancel, - StatusDownloadRepository, - StatusDownloadPackagelist, - StatusDownloadFilelist, - StatusDownloadChangelog, - StatusDownloadGroup, - StatusDownloadUpdateinfo, - StatusRepackaging, - StatusLoadingCache, - StatusScanApplications, - StatusGeneratePackageList, - StatusWaitingForLock, - StatusWaitingForAuth, - StatusScanProcessList, - StatusCheckExecutableFiles, - StatusCheckLibraries, - StatusCopyFiles, - /* this always has to be at the end of the list */ - LastStatus - } Status; - - /** - * Describes how the transaction finished - * \sa Transaction::finished() - */ - typedef enum { - UnknownExit, - ExitSuccess, - ExitFailed, - ExitCancelled, - ExitKeyRequired, - ExitEulaRequired, - ExitKilled, /* when we forced the cancel, but had to sigkill */ - ExitMediaChangeRequired, - ExitNeedUntrusted, - /* this always has to be at the end of the list */ - LastExit - } Exit; - - /** - * Describes the current network state - */ - typedef enum { - UnknownNetwork, - NetworkOffline, - NetworkOnline, - NetworkWired, - NetworkWifi, - NetworkMobile, - /* this always has to be at the end of the list */ - LastNetwork - } Network; - - /** - * Describes the different filters - */ - typedef enum { - UnknownFilter = 0x0000001, - NoFilter = 0x0000002, - FilterInstalled = 0x0000004, - FilterNotInstalled = 0x0000008, - FilterDevelopment = 0x0000010, - FilterNotDevelopment = 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, - /* this always has to be at the end of the list */ - FilterLast = 0x4000000 - } Filter; - Q_DECLARE_FLAGS(Filters, Filter) - - /** - * Describes a restart type - */ - typedef enum { - UnknownRestart, - RestartNone, - RestartApplication, - RestartSession, - RestartSystem, - RestartSecuritySession, - RestartSecuritySystem, - /* this always has to be at the end of the list */ - LastRestart - } Restart; - - /** - * Describes a message's type - */ - typedef enum { - UnknownMessage, - MessageBrokenMirror, - MessageConnectionRefused, - MessageParameterInvalid, - MessagePriorityInvalid, - MessageBackendError, - MessageDaemonError, - MessageCacheBeingRebuilt, - MessageUntrustedPackage, - MessageNewerPackageExists, - MessageCouldNotFindPackage, - MessageConfigFilesChanged, - MessagePackageAlreadyInstalled, - MessageAutoremoveIgnored, - MessageRepoMetadataDownloadFailed, - MessageRepoForDevelopersOnly, - MessageOtherUpdatesHeldBack, - /* this always has to be at the end of the list */ - LastMessage - } Message; - - /** - * Lists the different types of error - */ - typedef enum { - UnknownError, - 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, - /* this always has to be at the end of the list */ - LastError - } Error; - - /** - * Describes the different groups - */ - typedef enum { - UnknownGroup, - 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, - /* this always has to be at the end of the list */ - LastGroup - } Group; - typedef QSet<Group> Groups; - - /** - * Describes an update's state - */ - typedef enum { - UnknownUpdateState, - UpdateStateStable, - UpdateStateUnstable, - UpdateStateTesting, - /* this always has to be at the end of the list */ - LastUpdateState - } UpdateState; - - /** - * Describes the state of a package - */ - typedef enum { - UnknownInfo, - InfoInstalled, - InfoAvailable, - InfoLow, - InfoEnhancement, - InfoNormal, - InfoBugfix, - InfoImportant, - InfoSecurity, - InfoBlocked, - InfoDownloading, - InfoUpdating, - InfoInstalling, - InfoRemoving, - InfoCleanup, - InfoObsoleting, - InfoCollectionInstalled, - InfoCollectionAvailable, - InfoFinished, - InfoReinstalling, - InfoDowngrading, - InfoPreparing, - InfoDecompressing, - /* this always has to be at the end of the list */ - LastInfo - } Info; - - /** - * Describes an distro upgrade state - */ - typedef enum { - UnknownDistroUpgrade, - DistroUpgradeStable, - DistroUpgradeUnstable, - /* this always has to be at the end of the list */ - LastDistroUpgrade - } DistroUpgrade; - - /** - * Describes a signature type - */ - typedef enum { - UnknownSigType, - SigTypeGpg, - /* this always has to be at the end of the list */ - LastSigType - } SigType; - - - /** - * Enum used to describe a "provides" request - * \sa whatProvides - */ - typedef enum { - UnknownProvides, - ProvidesAny, - ProvidesModalias, - ProvidesCodec, - ProvidesMimetype, - ProvidesFont, - ProvidesHardwareDriver, - ProvidesPostscriptDriver, - ProvidesPlasmaService, - /* this always has to be at the end of the list */ - LastProvides - } Provides; - - /** - * Describes a package's license - */ - typedef enum { - UnknownLicense, - LicenseGlide, - LicenseAfl, - LicenseAmpasBsd, - LicenseAmazonDsl, - LicenseAdobe, - LicenseAgplv1, - LicenseAgplv3, - LicenseAsl1Dot0, - LicenseAsl1Dot1, - LicenseAsl2Dot0, - LicenseApsl2Dot0, - LicenseArtisticClarified, - LicenseArtistic2Dot0, - LicenseArl, - LicenseBittorrent, - LicenseBoost, - LicenseBsdWithAdvertising, - LicenseBsd, - LicenseCecill, - LicenseCddl, - LicenseCpl, - LicenseCondor, - LicenseCopyrightOnly, - LicenseCryptix, - LicenseCrystalStacker, - LicenseDoc, - LicenseWtfpl, - LicenseEpl, - LicenseEcos, - LicenseEfl2Dot0, - LicenseEu_datagrid, - LicenseLgplv2WithExceptions, - LicenseFtl, - LicenseGiftware, - LicenseGplv2, - LicenseGplv2WithExceptions, - LicenseGplv2PlusWithExceptions, - LicenseGplv3, - LicenseGplv3WithExceptions, - LicenseGplv3PlusWithExceptions, - LicenseLgplv2, - LicenseLgplv3, - LicenseGnuplot, - LicenseIbm, - LicenseImatix, - LicenseImagemagick, - LicenseImlib2, - LicenseIjg, - LicenseIntel_acpi, - LicenseInterbase, - LicenseIsc, - LicenseJabber, - LicenseJasper, - LicenseLppl, - LicenseLibtiff, - LicenseLpl, - LicenseMecabIpadic, - LicenseMit, - LicenseMitWithAdvertising, - LicenseMplv1Dot0, - LicenseMplv1Dot1, - LicenseNcsa, - LicenseNgpl, - LicenseNosl, - LicenseNetcdf, - LicenseNetscape, - LicenseNokia, - LicenseOpenldap, - LicenseOpenpbs, - LicenseOsl1Dot0, - LicenseOsl1Dot1, - LicenseOsl2Dot0, - LicenseOsl3Dot0, - LicenseOpenssl, - LicenseOreilly, - LicensePhorum, - LicensePhp, - LicensePublicDomain, - LicensePython, - LicenseQpl, - LicenseRpsl, - LicenseRuby, - LicenseSendmail, - LicenseSleepycat, - LicenseSlib, - LicenseSissl, - LicenseSpl, - LicenseTcl, - LicenseUcd, - LicenseVim, - LicenseVnlsl, - LicenseVsl, - LicenseW3c, - LicenseWxwidgets, - LicenseXinetd, - LicenseZend, - LicenseZplv1Dot0, - LicenseZplv2Dot0, - LicenseZplv2Dot1, - LicenseZlib, - LicenseZlibWithAck, - LicenseCdl, - LicenseFbsddl, - LicenseGfdl, - LicenseIeee, - LicenseOfsfdl, - LicenseOpenPublication, - LicenseCcBy, - LicenseCcBySa, - LicenseCcByNd, - LicenseDsl, - LicenseFreeArt, - LicenseOfl, - LicenseUtopia, - LicenseArphic, - LicenseBaekmuk, - LicenseBitstreamVera, - LicenseLucida, - LicenseMplus, - LicenseStix, - LicenseXano, - LicenseVostrom, - LicenseXerox, - LicenseRicebsd, - LicenseQhull, - /* this always has to be at the end of the list */ - LastLicense - } License; - - /** - * Describes what kind of media is required - */ - typedef enum { - UnknownMediaType, - MediaTypeCd, - MediaTypeDvd, - MediaTypeDisc, - /* this always has to be at the end of the list */ - LastMediaType - } MediaType; - - /** - * Describes the authorization result - */ - typedef enum { - UnknownAuthorize, - AuthorizeYes, - AuthorizeNo, - AuthorizeInteractive, - /* this always has to be at the end of the list */ - LastAuthorize - } Authorize; -}; -Q_DECLARE_OPERATORS_FOR_FLAGS(Enum::Filters) - -} // End namespace PackageKit - -#endif - diff --git a/lib/packagekit-qt/src/package.cpp b/lib/packagekit-qt/src/package.cpp deleted file mode 100644 index b2561390..00000000 --- a/lib/packagekit-qt/src/package.cpp +++ /dev/null @@ -1,231 +0,0 @@ -/* - * This file is part of the QPackageKit project - * Copyright (C) 2008 Adrien Bustany <madcat@mymadcat.com> - * - * 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 <QtSql> - -#include "package.h" -#include "util.h" - -using namespace PackageKit; - -////// Details class -class Package::DetailsPrivate -{ -public: - QSharedPointer<Package> package; - QString license; - Enum::Group group; - QString description; - QString url; - uint size; -}; - -Package::Details::Details(QSharedPointer<Package> p, const QString& license, const QString& group, const QString& detail, const QString& url, qulonglong size) : d_ptr(new DetailsPrivate) -{ - Q_D(Details); - d->package = p; - d->license = license; - d->group = (Enum::Group)Util::enumFromString<Enum>(group, "Group", "Group"); - d->description = detail; - d->url = url; - d->size = size; -} - -Package::Details::~Details() -{ - delete d_ptr; -} - -QSharedPointer<Package> Package::Details::package() const -{ - Q_D(const Details); - return d->package; -} - -QString Package::Details::license() const -{ - Q_D(const Details); - return d->license; -} - -Enum::Group Package::Details::group() const -{ - Q_D(const Details); - return d->group; -} - -QString Package::Details::description() const -{ - Q_D(const Details); - return d->description; -} - -QString Package::Details::url() const -{ - Q_D(const Details); - return d->url; -} - -qulonglong Package::Details::size() const -{ - Q_D(const Details); - return d->size; -} - -////// Package class - -class Package::Private -{ -public: - QString id; - QString name; - QString version; - QString arch; - QString data; - QString summary; - Enum::Info info; - Package::Details* details; - QString iconPath; -}; - -Package::Package(const QString& packageId, Enum::Info info, const QString& summary) - : d(new Private) -{ - d->id = packageId; - - // Break down the packageId - QStringList tokens = packageId.split(";"); - if(tokens.size() == 4) { - d->name = tokens.at(0); - d->version = tokens.at(1); - d->arch = tokens.at(2); - d->data = tokens.at(3); - } - - d->info = info; - d->summary = summary; - d->details = NULL; - d->iconPath = QString (); -} - -Package::~Package() -{ - if (hasDetails()) - delete d->details; - delete d; -} - -QString Package::id() const -{ - return d->id; -} - -QString Package::name() const -{ - return d->name; -} - -QString Package::version() const -{ - return d->version; -} - -QString Package::arch() const -{ - return d->arch; -} - -QString Package::data() const -{ - return d->data; -} - -QString Package::summary() const -{ - return d->summary; -} - -Enum::Info Package::info() const -{ - return d->info; -} - -bool Package::hasDetails() const -{ - return (d->details != NULL); -} - -Package::Details* Package::details() const -{ - return d->details; -} - -void Package::setDetails(Package::Details* det) -{ - d->details = det; -} - -void Package::setInfoSummary(const QString& info, const QString& summary) -{ - d->info = (Enum::Info)Util::enumFromString<Enum>(info, "Info", "Info"); - d->summary = summary; -} - -QString Package::iconPath () -{ - if (d->iconPath.isNull ()) { - d->iconPath = QString(""); - QSqlDatabase db = QSqlDatabase::database(); - if (!db.isOpen()) { - qDebug() << "Desktop files database is not open"; - return d->iconPath; - } - - QSqlQuery q(db); - q.prepare("SELECT filename FROM cache WHERE package = :name"); - q.bindValue(":name", d->name); - if(q.exec()) { - if (q.next()) { - QFile desktopFile (q.value(0).toString()); - if (desktopFile.open (QIODevice::ReadOnly | QIODevice::Text)) { - while (!desktopFile.atEnd ()) { - QByteArray line = desktopFile.readLine ().trimmed (); - if (line.startsWith ("Icon=")) { - d->iconPath = line.mid (5); - break; - } - } - desktopFile.close (); - } else { - qDebug() << "Cannot open desktop file " << q.value(0).toString (); - } - } - } else { - qDebug() << "Error while running query " << q.executedQuery(); - } - } - - return d->iconPath; -} - -bool Package::operator==(const Package *package) const -{ - return d->id == package->id(); -} diff --git a/lib/packagekit-qt/src/package.h b/lib/packagekit-qt/src/package.h deleted file mode 100644 index 6528cc9f..00000000 --- a/lib/packagekit-qt/src/package.h +++ /dev/null @@ -1,176 +0,0 @@ -/* - * This file is part of the QPackageKit project - * Copyright (C) 2008 Adrien Bustany <madcat@mymadcat.com> - * - * 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 PACKAGE_H -#define PACKAGE_H - -#include <QtCore> -#include "enum.h" - -namespace PackageKit { - -class Client; -/** - * \class Package package.h Package - * \author Adrien Bustany <madcat@mymadcat.com> - * - * \brief Represents a software package - * - * This class represents a software package. - * - * \note All Package objects should be deleted by the user. - */ -class Package -{ -public: - Package(const QString& packageId, Enum::Info info = Enum::UnknownInfo, const QString& summary = QString()); - /** - * Destructor - */ - ~Package(); - - /** - * \brief Returns the package ID - * - * A PID (package ID) uniquely identifies a package among all software repositories - */ - QString id() const; - - /** - * Returns the package name, for example vim - */ - QString name() const; - - /** - * Returns the package version, for example 7.0 - */ - QString version() const; - - /** - * Returns the package's architecture, for example x86_64 - */ - QString arch() const; - - /** - * Holds additionnal data about the package set by the backend - */ - QString data() const; - - /** - * Returns the package's summary. You can get more details by using Client::getDetails - */ - QString summary() const; - - /** - * Returns the package's info - */ - Enum::Info info() const; - - /** - * Holds additional details about a package - * \sa Client::getDetails - */ - class DetailsPrivate; - class Details - { - public: - /** - * Destructor - */ - ~Details(); - - /** - * Returns the package these details are linked to - * \return the Package object to which these details are related - */ - QSharedPointer<Package> package() const; - - /** - * Returns the package's license - */ - QString license() const; - - /** - * Returns the package's group (for example Multimedia, Editors...) - */ - Enum::Group group() const; - - /** - * Returns the package's long description - */ - QString description() const; - - /** - * Returns the software's homepage url - */ - QString url() const; - - /** - * Returns the package's size - */ - qulonglong size() const; - - protected: - DetailsPrivate * const d_ptr; - - private: - Q_DECLARE_PRIVATE(Details); - friend class Package; - friend class TransactionPrivate; - Details(QSharedPointer<Package> p, const QString& license, const QString& group, const QString& detail, const QString& url, qulonglong size); - }; - - /** - * Checks weither the package has details or not - * \sa Client::getDetails - * \sa Package::details - */ - bool hasDetails() const; - - /** - * \brief Returns the package's extended details - * - * \note The returned value is only valid if hasDetails returned true - * \return a pointer to a Package::Details class containing the package's details - * \sa Client::getDetails - */ - Details* details() const; - - /** - * \brief Returns the path to the package icon, if known - * - * \return A QString holding the path to the package icon if known, an empty QString else - */ - QString iconPath (); - - bool operator==(const Package *package) const; - -private: - friend class TransactionPrivate; - void setDetails(Details* det); - void setInfoSummary(const QString& info, const QString& summary); - class Private; - Private * const d; -}; - -} // End namespace PackageKit - -#endif - diff --git a/lib/packagekit-qt/src/transaction.cpp b/lib/packagekit-qt/src/transaction.cpp deleted file mode 100644 index a7d1b9f0..00000000 --- a/lib/packagekit-qt/src/transaction.cpp +++ /dev/null @@ -1,614 +0,0 @@ -/* - * This file is part of the QPackageKit project - * Copyright (C) 2008 Adrien Bustany <madcat@mymadcat.com> - * Copyright (C) 2010 Daniel Nicoletti <dantti85-pk@yahoo.com.br> - * - * 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 "clientprivate.h" -#include "common.h" -#include "package.h" -#include "util.h" - -#define CHECK_TRANSACTION \ - if (r.isError()) { \ - d->error = daemonErrorFromDBusReply(r); \ - } \ - -#define RUN_TRANSACTION(blurb) \ - Q_D(Transaction); \ - QDBusPendingReply<> r = d->p->blurb; \ - r.waitForFinished(); \ - CHECK_TRANSACTION \ - -using namespace PackageKit; - -template<class T> Client::DaemonError daemonErrorFromDBusReply(QDBusPendingReply<T> e) { - return Util::errorFromString(e.error().name()); -} - -Transaction::Transaction(const QString &tid, QObject *parent) - : QObject(parent), - d_ptr(new TransactionPrivate(this)) -{ - Q_D(Transaction); - - d->tid = tid; - d->oldtrans = FALSE; - d->p = 0; - - // If the user used a null tid - // he want us to get it - if (tid.isNull()) { - d->tid = Client::instance()->getTid(); - } - - int retry = 0; - do { - delete d->p; - d->p = new TransactionProxy(PK_NAME, d->tid, QDBusConnection::systemBus(), this); - if (d->p->lastError().isValid()) { - qDebug() << "Error, cannot create transaction proxy"; - qDebug() << d->p->lastError(); - QDBusMessage message; - message = QDBusMessage::createMethodCall("org.freedesktop.DBus", - "/", - "org.freedesktop.DBus", - QLatin1String("StartServiceByName")); - message << qVariantFromValue(QString("org.freedesktop.PackageKit")); - message << qVariantFromValue((uint) 0); - QDBusConnection::sessionBus().call(message, QDBus::BlockWithGui); - retry++; - } else { - retry = 0; - } - } while (retry == 1); - - if (d->tid.isEmpty()) { - d->error = Client::ErrorDaemonUnreachable; - } else { - d->error = Client::NoError; - Client::instance()->d_ptr->runningTransactions.insert(d->tid, this); - setHints(Client::instance()->d_ptr->hints); - } - - connect(d->p, SIGNAL(Changed()), - this, SIGNAL(changed())); - connect(d->p, SIGNAL(Category(const QString&, const QString&, const QString&, const QString&, const QString&)), - this, SIGNAL(category(const QString&, const QString&, const QString&, const QString&, const QString&))); - connect(d->p, SIGNAL(Destroy()), - d, SLOT(destroy())); - connect(d->p, SIGNAL(Details(const QString&, const QString&, const QString&, const QString&, const QString&, qulonglong)), - d, SLOT(details(const QString&, const QString&, const QString&, const QString&, const QString&, qulonglong))); - connect(d->p, SIGNAL(DistroUpgrade(const QString&, const QString&, const QString&)), - d, SLOT(distroUpgrade(const QString&, const QString&, const QString&))); - connect(d->p, SIGNAL(ErrorCode(const QString&, const QString&)), - d, SLOT(errorCode(const QString&, const QString&))); - connect(d->p, SIGNAL(Files(const QString&, const QString&)), - d, SLOT(files(const QString&, const QString&))); - connect(d->p, SIGNAL(Finished(const QString&, uint)), - d, SLOT(finished(const QString&, uint))); - connect(d->p, SIGNAL(Message(const QString&, const QString&)), - d, SLOT(message(const QString&, const QString&))); - connect(d->p, SIGNAL(Package(const QString&, const QString&, const QString&)), - d, SLOT(package(const QString&, const QString&, const QString&))); - connect(d->p, SIGNAL(RepoDetail(const QString&, const QString&, bool)), - this, SIGNAL(repoDetail(const QString&, const QString&, bool))); - connect(d->p, SIGNAL(RepoSignatureRequired(const QString&, const QString&, const QString&, const QString&, const QString&, const QString&, const QString&, const QString&)), - d, SLOT(repoSignatureRequired(const QString&, const QString&, const QString&, const QString&, const QString&, const QString&, const QString&, const QString&))); - connect(d->p, SIGNAL(EulaRequired(const QString&, const QString&, const QString&, const QString&)), - d, SLOT(eulaRequired(const QString&, const QString&, const QString&, const QString&))); - connect(d->p, SIGNAL(MediaChangeRequired(const QString&, const QString&, const QString&)), d, SLOT(mediaChangeRequired(const QString&, const QString&, const QString&))); - connect(d->p, SIGNAL(RequireRestart(const QString&, const QString&)), - d, SLOT(requireRestart(const QString&, const QString&))); - connect(d->p, SIGNAL(Transaction(const QString&, const QString&, bool, const QString&, uint, const QString&, uint, const QString&)), - d, SLOT(transaction(const QString&, const QString&, bool, const QString&, uint, const QString&, uint, const QString&))); - connect(d->p, SIGNAL(UpdateDetail(const QString&, const QString&, const QString&, const QString&, const QString&, const QString&, const QString&, const QString&, const QString&, const QString&, const QString&, const QString&)), - d, SLOT(updateDetail(const QString&, const QString&, const QString&, const QString&, const QString&, const QString&, const QString&, const QString&, const QString&, const QString&, const QString&, const QString&))); - -} - -Transaction::Transaction(const QString &tid, - const QString ×pec, - bool succeeded, - const QString &role, - uint duration, - const QString &data, - uint uid, - const QString &cmdline, - QObject *parent) - : QObject(parent), - d_ptr(new TransactionPrivate(this)) -{ - Q_D(Transaction); - d->oldtrans = TRUE; - d->tid = tid; - d->timespec = QDateTime::fromString(timespec, Qt::ISODate); - d->succeeded = succeeded; - d->role = (Enum::Role)Util::enumFromString<Enum>(role, "Role", "Role"); - d->duration = duration; - d->data = data; - d->uid = uid; - d->cmdline = cmdline; - d->error = Client::NoError; - d->destroyed = true; -} - -Transaction::~Transaction() -{ -// qDebug() << "Destroying transaction with tid" << tid(); -} - -QString Transaction::tid() const -{ - Q_D(const Transaction); - return d->tid; -} - -Client::DaemonError Transaction::error () const -{ - Q_D(const Transaction); - return d->error; -} - -bool Transaction::allowCancel() const -{ - Q_D(const Transaction); - if (d->destroyed) { - return false; - } - return d->p->allowCancel (); -} - -bool Transaction::callerActive() const -{ - Q_D(const Transaction); - if (d->destroyed) { - return false; - } - return d->p->callerActive (); -} - -void Transaction::cancel() -{ - Q_D(Transaction); - if (d->destroyed) { - return; - } - QDBusReply<void> r = d->p->Cancel (); - if (!r.isValid ()) { - d->error = Util::errorFromString (r.error ().message ()); - } -} - -QSharedPointer<Package> Transaction::lastPackage() const -{ - Q_D(const Transaction); - if (d->destroyed) { - return QSharedPointer<Package>(); - } - return QSharedPointer<Package> (new Package(d->p->lastPackage ())); -} - -uint Transaction::percentage() const -{ - Q_D(const Transaction); - if (d->destroyed) { - return 0; - } - return d->p->percentage (); -} - -uint Transaction::subpercentage() const -{ - Q_D(const Transaction); - if (d->destroyed) { - return 0; - } - return d->p->subpercentage (); -} - -uint Transaction::elapsedTime() const -{ - Q_D(const Transaction); - if (d->destroyed) { - return 0; - } - return d->p->elapsedTime (); -} - -uint Transaction::remainingTime() const -{ - Q_D(const Transaction); - if (d->destroyed) { - return 0; - } - return d->p->remainingTime (); -} - -uint Transaction::speed() const -{ - Q_D(const Transaction); - if (d->destroyed) { - return 0; - } - return d->p->speed (); -} - -Enum::Role Transaction::role() const -{ - Q_D(const Transaction); - if(d->oldtrans) - return d->role; - - if (d->destroyed) { - return Enum::UnknownRole; - } - return (Enum::Role) Util::enumFromString<Enum>(d->p->role (), "Role", "Role"); -} - -void Transaction::setHints(const QStringList &hints) -{ - Q_D(Transaction); - if (!d->destroyed) { - d->p->SetHints(hints); - } -} - -void Transaction::setHints(const QString &hints) -{ - setHints(QStringList() << hints); -} - -Enum::Status Transaction::status() const -{ - Q_D(const Transaction); - if (d->destroyed) { - return Enum::UnknownStatus; - } - return (Enum::Status) Util::enumFromString<Enum>(d->p->status (), "Status", "Status"); -} - -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); - if(d->destroyed) { - return d->uid; - } - return d->p->uid(); -} - -QString Transaction::cmdline() const -{ - Q_D(const Transaction); - return d->cmdline; -} - -////// Transaction functions - -void Transaction::acceptEula(const Client::EulaInfo &info) -{ - RUN_TRANSACTION(AcceptEula(info.id)) -} - -void Transaction::downloadPackages(const QList<QSharedPointer<Package> > &packages, bool storeInCache) -{ - RUN_TRANSACTION(DownloadPackages(storeInCache, Util::packageListToPids(packages))) -} - -void Transaction::downloadPackages(const QSharedPointer<Package> &package, bool storeInCache) -{ - downloadPackages(QList<QSharedPointer<Package> >() << package, storeInCache); -} - -void Transaction::getCategories() -{ - RUN_TRANSACTION(GetCategories()) -} - -void Transaction::getDepends(const QList<QSharedPointer<Package> > &packages, Enum::Filters filters, bool recursive) -{ - RUN_TRANSACTION(GetDepends(Util::filtersToString(filters), Util::packageListToPids(packages), recursive)) -} - -void Transaction::getDepends(const QSharedPointer<Package> &package, Enum::Filters filters, bool recursive) -{ - getDepends(QList<QSharedPointer<Package> >() << package, filters, recursive); -} - -void Transaction::getDetails(const QList<QSharedPointer<Package> > &packages) -{ - Q_D(Transaction); - foreach (const QSharedPointer<Package> &package, packages) { - d->packageMap.insert(package->id(), package); - } - - QDBusPendingReply<> r = d->p->GetDetails(Util::packageListToPids(packages)); - r.waitForFinished (); - - CHECK_TRANSACTION -} - -void Transaction::getDetails(const QSharedPointer<Package> &package) -{ - getDetails(QList<QSharedPointer<Package> >() << package); -} - -void Transaction::getFiles(const QList<QSharedPointer<Package> > &packages) -{ - RUN_TRANSACTION(GetFiles(Util::packageListToPids(packages))) -} - -void Transaction::getFiles(const QSharedPointer<Package> &package) -{ - getFiles(QList<QSharedPointer<Package> >() << package); -} - -void Transaction::getOldTransactions(uint number) -{ - RUN_TRANSACTION(GetOldTransactions(number)) -} - -void Transaction::getPackages(Enum::Filters filters) -{ - RUN_TRANSACTION(GetPackages(Util::filtersToString(filters))) -} - -void Transaction::getRepoList(Enum::Filters filters) -{ - RUN_TRANSACTION(GetRepoList(Util::filtersToString(filters))) -} - -void Transaction::getRequires(const QList<QSharedPointer<Package> > &packages, Enum::Filters filters, bool recursive) -{ - RUN_TRANSACTION(GetRequires(Util::filtersToString(filters), Util::packageListToPids(packages), recursive)) -} - -void Transaction::getRequires(const QSharedPointer<Package> &package, Enum::Filters filters, bool recursive) -{ - getRequires(QList<QSharedPointer<Package> >() << package, filters, recursive); -} - -void Transaction::getUpdateDetail(const QList<QSharedPointer<Package> > &packages) -{ - RUN_TRANSACTION(GetUpdateDetail(Util::packageListToPids(packages))) -} - -void Transaction::getUpdateDetail(const QSharedPointer<Package> &package) -{ - getUpdateDetail(QList<QSharedPointer<Package> >() << package); -} - -void Transaction::getUpdates(Enum::Filters filters) -{ - RUN_TRANSACTION(GetUpdates(Util::filtersToString(filters))) -} - -void Transaction::getDistroUpgrades() -{ - RUN_TRANSACTION(GetDistroUpgrades()) -} - -void Transaction::installFiles(const QStringList &files, bool only_trusted) -{ - RUN_TRANSACTION(InstallFiles(only_trusted, files)) -} - -void Transaction::installFiles(const QString &file, bool only_trusted) -{ - installFiles(QStringList() << file, only_trusted); -} - -void Transaction::installPackages(bool only_trusted, const QList<QSharedPointer<Package> > &packages) -{ - RUN_TRANSACTION(InstallPackages(only_trusted, Util::packageListToPids(packages))) -} - -void Transaction::installPackages(bool only_trusted, const QSharedPointer<Package> &package) -{ - installPackages(only_trusted, QList<QSharedPointer<Package> >() << package); -} - -void Transaction::installSignature(Enum::SigType type, const QString &key_id, const QSharedPointer<Package> &package) -{ - RUN_TRANSACTION(InstallSignature(Util::enumToString<Enum>(type, "SigType", "Signature"), key_id, package->id())) -} - -void Transaction::refreshCache(bool force) -{ - RUN_TRANSACTION(RefreshCache(force)) -} - -void Transaction::removePackages(const QList<QSharedPointer<Package> > &packages, bool allow_deps, bool autoremove) -{ - RUN_TRANSACTION(RemovePackages(Util::packageListToPids(packages), allow_deps, autoremove)) -} - -void Transaction::removePackages(const QSharedPointer<Package> &package, bool allow_deps, bool autoremove) -{ - removePackages(QList<QSharedPointer<Package> >() << package, allow_deps, autoremove); -} - -void Transaction::repoEnable(const QString &repo_id, bool enable) -{ - RUN_TRANSACTION(RepoEnable(repo_id, enable)) -} - -void Transaction::repoSetData(const QString &repo_id, const QString ¶meter, const QString &value) -{ - RUN_TRANSACTION(RepoSetData(repo_id, parameter, value)) -} - -void Transaction::resolve(const QStringList &packageNames, Enum::Filters filters) -{ - RUN_TRANSACTION(Resolve(Util::filtersToString(filters), packageNames)) -} - -void Transaction::resolve(const QString &packageName, Enum::Filters filters) -{ - resolve(QStringList() << packageName, filters); -} - -void Transaction::searchFiles(const QStringList &search, Enum::Filters filters) -{ - RUN_TRANSACTION(SearchFiles(Util::filtersToString(filters), search)) -} - -void Transaction::searchFiles(const QString &search, Enum::Filters filters) -{ - searchFiles(QStringList() << search, filters); -} - -void Transaction::searchDetails(const QStringList &search, Enum::Filters filters) -{ - RUN_TRANSACTION(SearchDetails(Util::filtersToString(filters), search)) -} - -void Transaction::searchDetails(const QString &search, Enum::Filters filters) -{ - searchDetails(QStringList() << search, filters); -} - -void Transaction::searchGroups(const QStringList &groups, Enum::Filters filters) -{ - RUN_TRANSACTION(SearchGroups(Util::filtersToString(filters), groups)) -} - -void Transaction::searchGroups(const QString &group, Enum::Filters filters) -{ - searchGroups(QStringList() << group, filters); -} - -void Transaction::searchGroups(Enum::Groups groups, Enum::Filters filters) -{ - QStringList groupsSL; - foreach (const Enum::Group group, groups) { - groupsSL << Util::enumToString<Enum>(group, "Group", "Group"); - } - - searchGroups(groupsSL, filters); -} - -void Transaction::searchGroups(Enum::Group group, Enum::Filters filters) -{ - searchGroups(Enum::Groups() << group, filters); -} - -void Transaction::searchNames(const QStringList &search, Enum::Filters filters) -{ - RUN_TRANSACTION(SearchNames(Util::filtersToString(filters), search)) -} - -void Transaction::searchNames(const QString &search, Enum::Filters filters) -{ - searchNames(QStringList() << search, filters); -} - -void Transaction::simulateInstallFiles(const QStringList &files) -{ - RUN_TRANSACTION(SimulateInstallFiles(files)) -} - -void Transaction::simulateInstallFiles(const QString &file) -{ - simulateInstallFiles(QStringList() << file); -} - -void Transaction::simulateInstallPackages(const QList<QSharedPointer<Package> > &packages) -{ - RUN_TRANSACTION(SimulateInstallPackages(Util::packageListToPids(packages))) -} - -void Transaction::simulateInstallPackages(const QSharedPointer<Package> &package) -{ - simulateInstallPackages(QList<QSharedPointer<Package> >() << package); -} - -void Transaction::simulateRemovePackages(const QList<QSharedPointer<Package> > &packages, bool autoremove) -{ - RUN_TRANSACTION(SimulateRemovePackages(Util::packageListToPids(packages), autoremove)) -} - -void Transaction::simulateRemovePackages(const QSharedPointer<Package> &package, bool autoremove) -{ - simulateRemovePackages(QList<QSharedPointer<Package> >() << package, autoremove); -} - -void Transaction::simulateUpdatePackages(const QList<QSharedPointer<Package> > &packages) -{ - RUN_TRANSACTION(SimulateUpdatePackages(Util::packageListToPids(packages))) -} - -void Transaction::simulateUpdatePackages(const QSharedPointer<Package> &package) -{ - simulateUpdatePackages(QList<QSharedPointer<Package> >() << package); -} - -void Transaction::updatePackages(bool only_trusted, const QList<QSharedPointer<Package> > &packages) -{ - RUN_TRANSACTION(UpdatePackages(only_trusted, Util::packageListToPids(packages))) -} - -void Transaction::updatePackages(bool only_trusted, const QSharedPointer<Package> &package) -{ - updatePackages(only_trusted, QList<QSharedPointer<Package> >() << package); -} - -void Transaction::updateSystem(bool only_trusted) -{ - RUN_TRANSACTION(UpdateSystem(only_trusted)) -} - -void Transaction::whatProvides(Enum::Provides type, const QStringList &search, Enum::Filters filters) -{ - RUN_TRANSACTION(WhatProvides(Util::filtersToString(filters), Util::enumToString<Enum>(type, "Provides", "Provides"), search)) -} - -void Transaction::whatProvides(Enum::Provides type, const QString &search, Enum::Filters filters) -{ - whatProvides(type, QStringList() << search, filters); -} - -#include "transaction.moc" diff --git a/lib/packagekit-qt/src/transaction.h b/lib/packagekit-qt/src/transaction.h deleted file mode 100644 index b49b517c..00000000 --- a/lib/packagekit-qt/src/transaction.h +++ /dev/null @@ -1,669 +0,0 @@ -/* - * This file is part of the QPackageKit project - * Copyright (C) 2008 Adrien Bustany <madcat@mymadcat.com> - * Copyright (C) 2010 Daniel Nicoletti <dantti85-pk@yahoo.com.br> - * - * 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 TRANSACTION_H -#define TRANSACTION_H - -#include <QtCore> -#include "enum.h" -#include "client.h" - -namespace PackageKit { - -class ClientPrivate; -class Package; - -/** - * \class Transaction transaction.h Transaction - * \author Adrien Bustany \e <madcat@mymadcat.com> - * \author Daniel Nicoletti \e <dantti85-pk@yahoo.com.br> - * - * \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. - * - * The Transaction will be automatically deleted as soon as it emits the finished() signal. - * - * You cannot create a Transaction directly, use the functions in the Client class instead. - * - * \sa Client - */ -class TransactionPrivate; -class Transaction : public QObject -{ - Q_OBJECT -public: - /** - * Create a transaction object with transaction id \p tid - * \note The if \p tid is a NULL string then it will automatically - * asks PackageKit for a tid - * - * The transaction object \b cannot be reused - * (i.e. simulateInstallPackages then installPackages) - * - * \warning after creating the transaction object be sure - * to verify if it doesn't have any \sa error() - */ - Transaction(const QString &tid, QObject *parent = 0); - - /** - * Destructor - */ - ~Transaction(); - - /** - * \brief Returns the TID of the Transaction - * - * The TID (Transaction ID) uniquely identifies the transaction. - * - * \return the TID of the current transaction - */ - QString tid() const; - - /** - * \brief Returns the error status of the Transaction - * - * \return A value from TransactionError describing the state of the transaction - * or 0 in case of not having an error - */ - Client::DaemonError error() const; - - /** - * Indicates weither 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 callerActive() 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 - * \sa transactionListChanged - * \sa getTransactionList - */ - QSharedPointer<Package> lastPackage() const; - - /** - * The percentage complete of the whole transaction. - * \return percentage, or 101 if not known. - */ - uint percentage() const; - - /** - * The percentage complete of the individual task, for example, downloading. - * \return percentage, or 101 if not known. - */ - uint subpercentage() 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 information describing the transaction - * like InstallPackages, SearchName or GetUpdates - * \return the current role of the transaction - */ - Enum::Role role() 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 Client::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 Client::setHints - */ - void setHints(const QString &hints); - void setHints(const QStringList &hints); - - /** - * Returns the current state of the transaction - * \return a Transaction::Status value describing the status of the transaction - */ - Enum::Status status() 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 trasaction 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 Accepts an EULA - * - * The EULA is identified by the EulaInfo structure \p info - * - * \note You need to restart the transaction which triggered the EULA manually - * - * \sa eulaRequired - */ - void acceptEula(const Client::EulaInfo &info); - - /** - * Download the given \p packages to a temp dir, if \p storeInCache is true - * the download will be stored in the package manager cache - */ - void downloadPackages(const QList<QSharedPointer<Package> > &packages, bool storeInCache = false); - - /** - * This is a convenience function - */ - void downloadPackages(const QSharedPointer<Package> &package, bool storeInCache = false); - - /** - * Returns the collection categories - * - * \sa category - */ - void 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() - */ - void getDepends(const QList<QSharedPointer<Package> > &packages, Enum::Filters filters, bool recursive); - void getDepends(const QSharedPointer<Package> &package, Enum::Filters filters , bool recursive); - - /** - * Gets more details about the given \p packages - * - * \sa Transaction::details - * \note This method emits \sa details() - */ - void getDetails(const QList<QSharedPointer<Package> > &packages); - void getDetails(const QSharedPointer<Package> &package); - - /** - * Gets the files contained in the given \p packages - * - * \note This method emits \sa files() - */ - void getFiles(const QList<QSharedPointer<Package> > &packages); - void getFiles(const QSharedPointer<Package> &packages); - - /** - * \brief Gets the last \p number finished transactions - * - * \note You must delete these transactions yourself - * \note This method emits \sa transaction() - */ - void getOldTransactions(uint number); - - /** - * Gets all the packages matching the given \p filters - * - * \note This method emits \sa package() - */ - void getPackages(Enum::Filters filters = Enum::NoFilter); - - /** - * Gets the list of software repositories matching the given \p filters - * - * \note This method emits \sa repository() - */ - void getRepoList(Enum::Filters filter = Enum::NoFilter); - - /** - * \brief Searches for the packages requiring the given \p packages - * - * The search can be limited using the \p filters parameter. The 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() - */ - void getRequires(const QList<QSharedPointer<Package> > &packages, Enum::Filters filters, bool recursive); - void getRequires(const QSharedPointer<Package> &package, Enum::Filters filters, bool recursive); - - /** - * Retrieves more details about the update for the given \p packages - * - * \note This method emits \sa updateDetail() - */ - void getUpdateDetail(const QList<QSharedPointer<Package> > &packages); - void getUpdateDetail(const QSharedPointer<Package> &package); - - /** - * \p Gets the available updates - * - * The \p filters parameters can be used to restrict the updates returned - * - * \note This method emits \sa package() - */ - void getUpdates(Enum::Filters filters = Enum::NoFilter); - - /** - * Retrieves the available distribution upgrades - * - * \note This method emits \sa distroUpgrade() - */ - void getDistroUpgrades(); - - /** - * \brief Installs the local packages \p files - * - * \p only_trusted indicate if the packages are signed by a trusted authority - * - * \note This method emits \sa package() - * and \sa changed() - */ - void installFiles(const QStringList &files, bool only_trusted); - void installFiles(const QString &file, bool only_trusted); - - /** - * 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() - */ - void installPackages(bool only_trusted, const QList<QSharedPointer<Package> > &packages); - void installPackages(bool only_trusted, const QSharedPointer<Package> &package); - - /** - * \brief Installs a signature - * - * \p type, \p keyId and \p package generally come from the Transaction::repoSignatureRequired - */ - void installSignature(Enum::SigType type, const QString &keyId, const QSharedPointer<Package> &package); - - /** - * Refreshes the package manager's cache - * - * \note This method emits \sa changed() - */ - void refreshCache(bool force); - - /** - * \brief Removes the given \p packages - * - * \p allow_deps 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() - */ - void removePackages(const QList<QSharedPointer<Package> > &packages, bool allow_deps, bool autoremove); - void removePackages(const QSharedPointer<Package> &package, bool allow_deps, bool autoremove); - - /** - * Activates or disables a repository - */ - void repoEnable(const QString &repo_id, bool enable); - - /** - * Sets a repository's parameter - */ - void repoSetData(const QString &repo_id, const QString& parameter, 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() - */ - void resolve(const QStringList &packageNames, Enum::Filters filters = Enum::NoFilter); - void resolve(const QString &packageName, Enum::Filters filters = Enum::NoFilter); - - /** - * \brief Search in the packages files - * - * \p filters can be used to restrict the returned packages - * - * \note This method emits \sa package() - */ - void searchFiles(const QStringList &search, Enum::Filters filters = Enum::NoFilter); - void searchFiles(const QString &search, Enum::Filters filters = Enum::NoFilter); - - /** - * \brief Search in the packages details - * - * \p filters can be used to restrict the returned packages - * - * \note This method emits \sa package() - */ - void searchDetails(const QStringList &search, Enum::Filters filters = Enum::NoFilter); - void searchDetails(const QString &search, Enum::Filters filters = Enum::NoFilter); - - /** - * \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() - */ - void searchGroups(const QStringList &groups, Enum::Filters filters = Enum::NoFilter); - void searchGroups(const QString &group, Enum::Filters filters = Enum::NoFilter); - - /** - * \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() - */ - void searchGroups(Enum::Groups group, Enum::Filters filters = Enum::NoFilter); - void searchGroups(Enum::Group group, Enum::Filters filters = Enum::NoFilter); - - /** - * \brief Search in the packages names - * - * \p filters can be used to restrict the returned packages - * - * \note This method emits \sa package() - */ - void searchNames(const QStringList &search, Enum::Filters filters = Enum::NoFilter); - void searchNames(const QString &search, Enum::Filters filters = Enum::NoFilter); - - /** - * \brief Simulates an installation of \p files. - * - * You should call this method before installing \p files - * \note: This method might emit \sa package() - * with INSTALLING, REMOVING, UPDATING, - * REINSTALLING or OBSOLETING status. - */ - void simulateInstallFiles(const QStringList &files); - void simulateInstallFiles(const QString &file); - - /** - * \brief Simulates an installation of \p packages. - * - * You should call this method before installing \p packages - * \note: This method might emit \sa package() - * with INSTALLING, REMOVING, UPDATING, - * REINSTALLING or OBSOLETING status. - */ - void simulateInstallPackages(const QList<QSharedPointer<Package> > &packages); - void simulateInstallPackages(const QSharedPointer<Package> &package); - - /** - * \brief Simulates a removal of \p packages. - * - * You should call this method before removing \p packages - * \note: This method might emit \sa package() - * with INSTALLING, REMOVING, UPDATING, - * REINSTALLING or OBSOLETING status. - */ - void simulateRemovePackages(const QList<QSharedPointer<Package> > &packages, bool autoremove); - void simulateRemovePackages(const QSharedPointer<Package> &package, bool autoremove); - - /** - * \brief Simulates an update of \p packages. - * - * You should call this method before updating \p packages - * \note: This method might emit \sa package() - * with INSTALLING, REMOVING, UPDATING, - * REINSTALLING or OBSOLETING status. - */ - void simulateUpdatePackages(const QList<QSharedPointer<Package> > &packages); - void simulateUpdatePackages(const QSharedPointer<Package> &package); - - /** - * Update the given \p packages - * - * \note This method emits \sa package() - * and \sa changed() - */ - void updatePackages(bool only_trusted, const QList<QSharedPointer<Package> > &packages); - void updatePackages(bool only_trusted, const QSharedPointer<Package> &package); - - /** - * Updates the whole system - * - * \p only_trusted indicates if this transaction is only allowed to install trusted packages - * - * \note This method emits \sa package() - * and \sa changed() - */ - void updateSystem(bool only_trusted); - - /** - * Searchs for a package providing a file/a mimetype - * - * \note This method emits \sa package() - */ - void whatProvides(Enum::Provides type, const QStringList &search, Enum::Filters filters = Enum::NoFilter); - void whatProvides(Enum::Provides type, const QString &search, Enum::Filters filters = Enum::NoFilter); - - -public Q_SLOTS: - /** - * Cancels the transaction - */ - void cancel(); - -Q_SIGNALS: - /** - * The transaction has changed one of it's properties - */ - void changed(); - - /** - * \brief Sends a category - * - * \li \p parent_id is the id of the parent category. A blank parent means a root category - * \li \p cat_id 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. - */ - void category(const QString &parent_id, const QString &cat_id, const QString &name, const QString &summary, const QString &icon); - - /** - * Sends additional details about the \p package - * \sa getDetails() - */ - void details(const QSharedPointer<PackageKit::Package> &package); - - /** - * Sent when the transaction has been destroyed and is - * no longer available for use. - * \warning the object will get deleted after this method is called - */ - void destroy (); - - /** - * Emitted when a distribution upgrade is available - * \sa getDistroUpgrades() - */ - void distroUpgrade(PackageKit::Enum::DistroUpgrade type, const QString& name, const QString& description); - - /** - * Emitted when an error occurs - */ - void errorCode(PackageKit::Enum::Error error, const QString& details); - - /** - * Emitted when an EULA agreement prevents the transaction from running - * \note You will need to relaunch the transaction after accepting the EULA - * \sa acceptEula() - */ - void eulaRequired(const PackageKit::Client::EulaInfo &info); - - /** - * 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::Enum::MediaType type, const QString& id, const QString& text); - - /** - * Sends the \p filenames contained in package \p package - * \sa Client::getFiles - */ - void files(const QSharedPointer<PackageKit::Package> &package, 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::Enum::Exit status, uint runtime); - - /** - * Conveys a message sent from the backend - * - * \p type is the type of the \p message - */ - void message(PackageKit::Enum::Message type, const QString &message); - - /** - * Emitted when the transaction sends a new package - */ - void package(const QSharedPointer<PackageKit::Package> &package); - - /** - * 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 - */ - void repoSignatureRequired(const PackageKit::Client::SignatureInfo &info); - - /** - * Indicates that a restart is required - * \p package is the package who triggered the restart signal - */ - void requireRestart(PackageKit::Enum::Restart type, const QSharedPointer<PackageKit::Package> &package); - - /** - * Sends an old transaction - * \sa Client::getOldTransactions - */ - void transaction(PackageKit::Transaction *transaction); - - /** - * Sends additionnal details about an update - * \sa Client::getUpdateDetail - */ - void updateDetail(const PackageKit::Client::UpdateInfo &info); - -protected: - TransactionPrivate * const d_ptr; - -private: - Q_DECLARE_PRIVATE(Transaction); - friend class ClientPrivate; - Transaction(const QString &tid, - const QString ×pec, - bool succeeded, - const QString &role, - uint duration, - const QString &data, - uint uid, - const QString &cmdline, - QObject *parent); -}; - -} // End namespace PackageKit - -#endif diff --git a/lib/packagekit-qt/src/transactionprivate.cpp b/lib/packagekit-qt/src/transactionprivate.cpp deleted file mode 100644 index 1adcd886..00000000 --- a/lib/packagekit-qt/src/transactionprivate.cpp +++ /dev/null @@ -1,160 +0,0 @@ -/* - * This file is part of the QPackageKit project - * Copyright (C) 2008 Adrien Bustany <madcat@mymadcat.com> - * - * 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 "transaction.h" -#include "package.h" -#include "util.h" - -using namespace PackageKit; - -TransactionPrivate::TransactionPrivate(Transaction* parent) - : QObject(parent), - p(0), - t(parent), - destroyed(false) -{ -} - -TransactionPrivate::~TransactionPrivate() -{ -} - -// Signals mangling - -void TransactionPrivate::details(const QString& pid, const QString& license, const QString& group, const QString& detail, const QString& url, qulonglong size) -{ - QSharedPointer<Package> p = packageMap.value(pid, QSharedPointer<Package> (NULL)); - if(p) { - packageMap.remove(pid); - } else { - p = QSharedPointer<Package> (new Package(pid)); - } - - Package::Details* d = new Package::Details(p, license, group, detail, url, size); - p->setDetails(d); - t->details(p); -} - -void TransactionPrivate::distroUpgrade(const QString& type, const QString& name, const QString& description) -{ - t->distroUpgrade((Enum::DistroUpgrade)Util::enumFromString<Enum>(type, "DistroUpgrade", "DistroUpgrade"), name, description); -} - -void TransactionPrivate::errorCode(const QString& error, const QString& details) -{ - t->errorCode((Enum::Error)Util::enumFromString<Enum>(error, "Error", "Error"), details); -} - -void TransactionPrivate::eulaRequired(const QString& eulaId, const QString& pid, const QString& vendor, const QString& licenseAgreement) -{ - Client::EulaInfo i; - i.id = eulaId; - i.package = QSharedPointer<Package> (new Package(pid)); - i.vendorName = vendor; - i.licenseAgreement = licenseAgreement; - t->eulaRequired(i); -} - -void TransactionPrivate::mediaChangeRequired(const QString& mediaType, const QString& mediaId, const QString& mediaText) -{ - t->mediaChangeRequired((Enum::MediaType)Util::enumFromString<Enum>(mediaType, "MediaType", "Media"), mediaId, mediaText); -} - -void TransactionPrivate::files(const QString& pid, const QString& filenames) -{ - t->files(QSharedPointer<Package> (new Package(pid)), filenames.split(";")); -} - -void TransactionPrivate::finished(const QString& exitCode, uint runtime) -{ - int exitValue = Util::enumFromString<Enum>(exitCode, "Exit", "Exit"); - t->finished((Enum::Exit)exitValue, runtime); -} - -void TransactionPrivate::destroy() -{ - emit t->destroy(); - Client::instance()->destroyTransaction(tid); -} - -void TransactionPrivate::message(const QString& type, const QString& message) -{ - t->message((Enum::Message)Util::enumFromString<Enum>(type, "Message", "Message"), message); -} - -void TransactionPrivate::package(const QString& info, const QString& pid, const QString& summary) -{ - t->package(QSharedPointer<Package> (new Package(pid, (Enum::Info)Util::enumFromString<Enum>(info, "Info", "Info"), summary))); -} - -void TransactionPrivate::repoSignatureRequired(const QString& pid, const QString& repoName, const QString& keyUrl, const QString& keyUserid, const QString& keyId, const QString& keyFingerprint, const QString& keyTimestamp, const QString& type) -{ - Client::SignatureInfo i; - i.package = QSharedPointer<Package> (new Package(pid)); - i.repoId = repoName; - i.keyUrl = keyUrl; - i.keyUserid = keyUserid; - i.keyId = keyId; - i.keyFingerprint = keyFingerprint; - i.keyTimestamp = keyTimestamp; - i.type = (Enum::SigType)Util::enumFromString<Enum>(type, "SigType", "Signature"); - - t->repoSignatureRequired(i); -} - -void TransactionPrivate::requireRestart(const QString& type, const QString& pid) -{ - t->requireRestart((Enum::Restart)Util::enumFromString<Enum>(type, "Restart", "Restart"), QSharedPointer<Package> (new Package(pid))); -} - -void TransactionPrivate::transaction(const QString& oldTid, const QString& timespec, bool succeeded, const QString& role, uint duration, const QString& data, uint uid, const QString& cmdline) -{ - t->transaction(new Transaction(oldTid, timespec, succeeded, role, duration, data, uid, cmdline, t->parent())); -} - -void TransactionPrivate::updateDetail(const QString& pid, const QString& updates, const QString& obsoletes, const QString& vendorUrl, const QString& bugzillaUrl, const QString& cveUrl, const QString& restart, const QString& updateText, const QString& changelog, const QString& state, const QString& issued, const QString& updated) -{ - Client::UpdateInfo i; - i.package = QSharedPointer<Package> (new Package(pid)); - if( !updates.isEmpty() ) { - foreach(const QString p, updates.split("&")) { - i.updates.append(QSharedPointer<Package> (new Package(p))); - } - } - if( !obsoletes.isEmpty() ) { - foreach(const QString p, obsoletes.split("&")) { - i.obsoletes.append(QSharedPointer<Package> (new Package(p))); - } - } - i.vendorUrl = vendorUrl; - i.bugzillaUrl = bugzillaUrl; - i.cveUrl = cveUrl; - i.restart = (Enum::Restart)Util::enumFromString<Enum>(restart, "Restart", "Restart"); - i.updateText = updateText; - i.changelog = changelog; - i.state = (Enum::UpdateState)Util::enumFromString<Enum>(state, "UpdateState", "UpdateState"); - i.issued = QDateTime::fromString(issued, Qt::ISODate); - i.updated = QDateTime::fromString(updated, Qt::ISODate); - - t->updateDetail(i); -} - -#include "transactionprivate.moc" diff --git a/lib/packagekit-qt/src/transactionprivate.h b/lib/packagekit-qt/src/transactionprivate.h deleted file mode 100644 index 50e275d0..00000000 --- a/lib/packagekit-qt/src/transactionprivate.h +++ /dev/null @@ -1,84 +0,0 @@ -/* - * This file is part of the QPackageKit project - * Copyright (C) 2008 Adrien Bustany <madcat@mymadcat.com> - * - * 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 TRANSACTIONPRIVATE_H -#define TRANSACTIONPRIVATE_H - -#include <QtCore> -#include "enum.h" -#include "client.h" - -class TransactionProxy; - -namespace PackageKit { - -class Transaction; -class TransactionPrivate : public QObject -{ - Q_OBJECT - -public: - ~TransactionPrivate(); - QString tid; - ::TransactionProxy* p; - Transaction* t; - - // Only used for old transactions - bool oldtrans; - QDateTime timespec; - Enum::Role role; - bool succeeded; - uint duration; - QString data; - uint uid; - QString cmdline; - // used for both old and destroyed transactions - bool destroyed; - - // Used for getDetails - QHash<QString, QSharedPointer<Package> > packageMap; - - Client::DaemonError error; - -public Q_SLOTS: - void details(const QString& pid, const QString& license, const QString& group, const QString& detail, const QString& url, qulonglong size); - void distroUpgrade(const QString& type, const QString& name, const QString& description); - void errorCode(const QString& error, const QString& details); - void eulaRequired(const QString& eulaId, const QString& pid, const QString& vendor, const QString& licenseAgreement); - void mediaChangeRequired(const QString& mediaType, const QString& mediaId, const QString& mediaText); - void files(const QString& pid, const QString& filenames); - void finished(const QString& exitCode, uint runtime); - void message(const QString& type, const QString& message); - void package(const QString& info, const QString& pid, const QString& summary); - void repoSignatureRequired(const QString& pid, const QString& repoName, const QString& keyUrl, const QString& keyUserid, const QString& keyId, const QString& keyFingerprint, const QString& keyTimestamp, const QString& type); - void requireRestart(const QString& type, const QString& pid); - void transaction(const QString& oldTid, const QString& timespec, bool succeeded, const QString& role, uint duration, const QString& data, uint uid, const QString& cmdline); - void updateDetail(const QString& pid, const QString& updates, const QString& obsoletes, const QString& vendorUrl, const QString& bugzillaUrl, const QString& cveUrl, const QString& restart, const QString& updateText, const QString& changelog, const QString& state, const QString& issued, const QString& updated); - void destroy(); - -private: - friend class Transaction; - friend class Client; - TransactionPrivate(Transaction* parent); -}; - -} // End namespace PackageKit - -#endif diff --git a/lib/packagekit-qt/src/util.cpp b/lib/packagekit-qt/src/util.cpp deleted file mode 100644 index a687153b..00000000 --- a/lib/packagekit-qt/src/util.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/* - * This file is part of the QPackageKit project - * Copyright (C) 2008 Adrien Bustany <madcat@mymadcat.com> - * - * 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 "util.h" -#include "package.h" - -using namespace PackageKit; - -QStringList Util::packageListToPids(const QList<QSharedPointer<Package> >& packages) -{ - QStringList pids; - foreach(QSharedPointer<Package> p, packages) - pids.append(p->id()); - - return pids; -} - -QString Util::filtersToString(const QFlags<PackageKit::Enum::Filter>& flags) -{ - QStringList flagStrings; - for (int i = Enum::UnknownFilter; i < Enum::FilterLast; i *= 2) { - if ((Enum::Filter) i & flags) { - flagStrings.append(Util::enumToString<Enum>((Enum::Filter) i, "Filter", "Filter")); - } - } - - return flagStrings.join(";"); -} - -Client::DaemonError Util::errorFromString (QString errorName) -{ - if (errorName.startsWith ("org.freedesktop.packagekit.")) { - return Client::ErrorFailedAuth; - } - - errorName.replace ("org.freedesktop.PackageKit.Transaction.", ""); - - if (errorName.startsWith ("PermissionDenied") || errorName.startsWith ("RefusedByPolicy")) { - return Client::ErrorFailedAuth; - } - - if (errorName.startsWith ("PackageIdInvalid") || errorName.startsWith ("SearchInvalid") || errorName.startsWith ("FilterInvalid") || errorName.startsWith ("InvalidProvide") || errorName.startsWith ("InputInvalid")) { - return Client::ErrorInvalidInput; - } - - if (errorName.startsWith ("PackInvalid") || errorName.startsWith ("NoSuchFile") || errorName.startsWith ("NoSuchDirectory")) { - return Client::ErrorInvalidFile; - } - - if (errorName.startsWith ("NotSupported")) { - return Client::ErrorFunctionNotSupported; - } - - return Client::ErrorFailed; -} - - diff --git a/lib/packagekit-qt/src/util.h b/lib/packagekit-qt/src/util.h deleted file mode 100644 index ba7d90fd..00000000 --- a/lib/packagekit-qt/src/util.h +++ /dev/null @@ -1,162 +0,0 @@ -/* - * This file is part of the QPackageKit project - * Copyright (C) 2008 Adrien Bustany <madcat@mymadcat.com> - * - * 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 UTIL_H -#define UTIL_H - -#include <QtCore> -#include "client.h" - -namespace PackageKit { - -class Package; - -class Util -{ - -public: - /** - * Converts \p str from the PK naming scheme to the QPackageKit enum naming - * scheme, prepending \p prefix to the result, and returns the value for enum \p enum - * For example, enumFromString("get_requires", "Action") == "ActionGetRequires" - * \return the enum value - */ - template<class T> static int enumFromString(const QString& str, const char* enumName, const QString& prefix = QString()) - { - 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.toAscii() == '-') { - lastWasDash = true; - } else if(buf.toAscii() == '~') { - lastWasDash = true; - realName += "Not"; - } else { - realName += buf; - } - }; - - if(!prefix.isNull()) - realName = prefix + realName; - - // Filter quirk - if(enumName == QString("Filter")) { - if(realName == QString("FilterNone")) - realName = "NoFilter"; - - if(realName == QString("FilterDevel") || realName == QString("FilterNotDevel")) - realName += "opment"; - } - - // Action quirk - if(enumName == QString("Action") && realName == QString("ActionUpdatePackage")) - realName = "ActionUpdatePackages"; - - - int id = T::staticMetaObject.indexOfEnumerator(enumName); - QMetaEnum e = T::staticMetaObject.enumerator(id); - int enumValue = e.keyToValue(realName.toAscii().data()); - - if(enumValue == -1) { - enumValue = e.keyToValue(QString("Unknown").append(enumName).toAscii().data()); - qDebug() << "enumFromString (" << enumName << ") : converted" << str << "to" << QString("Unknown").append(enumName) << ", enum value" << enumValue; - } - return enumValue; - } - - template<class T> static QString enumToString(int value, const char* enumName, const QString& prefix = QString()) - { - int id = T::staticMetaObject.indexOfEnumerator(enumName); - QMetaEnum e = T::staticMetaObject.enumerator(id); - if (!e.isValid ()) { - qDebug () << "Invalid enum " << enumName; - return QString (); - } - QString enumString = e.valueToKey(value); - if(enumString.isNull()) { - qDebug() << "Enum key not found while searching for value" << value << "in enum" << enumName; - 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 += QChar('-'); - } - pkName += enumString[enumString.length() - 1]; - - if(enumName == QString("Filter")) { - if(pkName.indexOf("Not-") == 0) { - pkName = pkName.replace(0, 4, "~"); - } - if(pkName == "No-Filter") - pkName = "none"; - if(pkName == "Development") - pkName = "devel"; - if(pkName == "~Development") - pkName = "~devel"; - } - - return pkName.toLower(); - }; - - static QStringList packageListToPids(const QList<QSharedPointer<Package> >& packages); - - static QString filtersToString(const QFlags<PackageKit::Enum::Filter>& flags); - - /* - * Describes the different errors that might happen on the bus - * - * \sa Client::error - * \sa Transaction::error - */ - typedef enum { - NoError = 0, - ErrorFailed, - ErrorFailedAuth, - ErrorNoTid, - ErrorAlreadyTid, - ErrorRoleUnkown, - ErrorCannotStartDaemon, - ErrorInvalidInput, - ErrorInvalidFile, - ErrorNotSupported - } TransactionError; - - static Client::DaemonError errorFromString (QString errorName); - -}; - -} // End namespace PackageKit - -#endif diff --git a/lib/packagekit-qt/test/Makefile.am b/lib/packagekit-qt/test/Makefile.am deleted file mode 100644 index e8b53c95..00000000 --- a/lib/packagekit-qt/test/Makefile.am +++ /dev/null @@ -1,67 +0,0 @@ -include ${top_srcdir}/moc.mk - -NULL = - -INCLUDES = \ - $(QTCORE_CFLAGS) \ - $(QTGUI_CFLAGS) \ - $(QTDBUS_CFLAGS) \ - $(POLKIT_CFLAGS) \ - $(CPPUNIT_CFLAGS) \ - -I$(top_srcdir)/lib/packagekit-qt/src \ - $(NULL) - -METASOURCES = AUTO - -if EGG_BUILD_TESTS - -PK_QT_LIBS = \ - $(top_builddir)/lib/packagekit-qt/src/libpackagekit-qt.la \ - $(NULL) - -check_PROGRAMS = \ - pk-self-test - -pk_self_test_SOURCES = \ - daemontest.h \ - daemontest.cpp \ - transactiontest.h \ - transactiontest.cpp \ - main.cpp \ - $(NULL) - -$(pk_self_test_OBJECTS) : \ - transactiontest.moc \ - daemontest.moc \ - $(NULL) - -pk_self_test_LDADD = \ - $(QTCORE_LIBS) \ - $(QTGUI_LIBS) \ - $(QTDBUS_LIBS) \ - $(POLKIT_LIBS) \ - $(CPPUNIT_LIBS) \ - $(PK_QT_LIBS) \ - $(NULL) - -pk_self_test_CFLAGS = -DEGG_TEST $(AM_CFLAGS) - -TESTS = pk-self-test -endif - -clean-local: - rm -f *~ - rm -f *.out - -CLEANFILES = $(BUILT_SOURCES) - -DISTCLEANFILES = \ - $(NULL) - -MAINTAINERCLEANFILES = \ - *~ \ - Makefile.in \ - $(NULL) - - --include $(top_srcdir)/git.mk diff --git a/lib/packagekit-qt/test/daemontest.cpp b/lib/packagekit-qt/test/daemontest.cpp deleted file mode 100644 index 6eade576..00000000 --- a/lib/packagekit-qt/test/daemontest.cpp +++ /dev/null @@ -1,43 +0,0 @@ -#include "daemontest.h" - -DaemonTest::DaemonTest(QObject* parent) : QObject(parent) -{ -} - -DaemonTest::~DaemonTest() -{ -} - -void DaemonTest::getActions() -{ - PackageKit::Enum::Roles act = PackageKit::Client::instance()->actions(); - CPPUNIT_ASSERT(act & PackageKit::Enum::RoleInstallPackages); // Not really a test, but if *that* fails, then things are going badly :) -} - -void DaemonTest::getBackendDetail() -{ - QString backendName = PackageKit::Client::instance()->backendName(); - CPPUNIT_ASSERT(!backendName.isNull()); -} - -void DaemonTest::getFilters() -{ - PackageKit::Enum::Filters f = PackageKit::Client::instance()->filters(); - CPPUNIT_ASSERT(f & PackageKit::Enum::FilterInstalled); // Not really a test, but if *that* fails, then things are going badly :) -} - -void DaemonTest::getGroups() -{ - PackageKit::Enum::Groups g = PackageKit::Client::instance()->groups(); - CPPUNIT_ASSERT(g.size() != 1); -} - -void DaemonTest::getTimeSinceAction() -{ - PackageKit::Client::instance()->getTimeSinceAction(PackageKit::Enum::RoleInstallPackages); -} - -CPPUNIT_TEST_SUITE_REGISTRATION(DaemonTest); - -#include "daemontest.moc" - diff --git a/lib/packagekit-qt/test/daemontest.h b/lib/packagekit-qt/test/daemontest.h deleted file mode 100644 index d62e5300..00000000 --- a/lib/packagekit-qt/test/daemontest.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef DAEMONTEST_H -#define DAEMONTEST_H - -#include <QObject> -#include <cppunit/TestFixture.h> -#include <cppunit/TestSuite.h> -#include <cppunit/extensions/HelperMacros.h> -#include "QPackageKit" - -class DaemonTest : public QObject, public CppUnit::TestFixture -{ - Q_OBJECT - - CPPUNIT_TEST_SUITE(DaemonTest); - CPPUNIT_TEST(getBackendDetail); - CPPUNIT_TEST(getActions); - CPPUNIT_TEST(getFilters); - CPPUNIT_TEST(getGroups); - CPPUNIT_TEST(getTimeSinceAction); - CPPUNIT_TEST_SUITE_END(); - -public: - DaemonTest(QObject* parent = 0); - ~DaemonTest(); - - void getActions(); - void getBackendDetail(); - void getFilters(); - void getGroups(); - void getTimeSinceAction(); -}; - -#endif diff --git a/lib/packagekit-qt/test/main.cpp b/lib/packagekit-qt/test/main.cpp deleted file mode 100644 index 600c77cf..00000000 --- a/lib/packagekit-qt/test/main.cpp +++ /dev/null @@ -1,23 +0,0 @@ -#include <QApplication> -#include <cppunit/TestFixture.h> -#include <cppunit/extensions/HelperMacros.h> -#include <cppunit/extensions/TestFactoryRegistry.h> -#include <cppunit/ui/text/TestRunner.h> - -#include "QPackageKit" - -int main(int argc, char **argv) -{ - // Check that we are using the dummy backend for testing (I'm sometimes absent minded) - QString backendName = PackageKit::Client::instance()->backendName(); - if(backendName != "dummy") { - qFatal("Please use the dummy backend for testing"); - } - - CppUnit::TextUi::TestRunner runner; - CppUnit::TestFactoryRegistry ®istry = CppUnit::TestFactoryRegistry::getRegistry(); - runner.addTest(registry.makeTest()); - QCoreApplication app(argc, argv); - runner.run(); - return 0; -} diff --git a/lib/packagekit-qt/test/transactiontest.cpp b/lib/packagekit-qt/test/transactiontest.cpp deleted file mode 100644 index 03fcffce..00000000 --- a/lib/packagekit-qt/test/transactiontest.cpp +++ /dev/null @@ -1,139 +0,0 @@ -#include "transactiontest.h" - -using namespace PackageKit; - -TransactionTest::TransactionTest(QObject* parent) : QObject(parent) -{ - currentPackage = QSharedPointer<Package> (NULL); - connect (PackageKit::Client::instance(), SIGNAL(error(PackageKit::Client::DaemonError)), this, SLOT(error(PackageKit::Client::DaemonError))); -} - -TransactionTest::~TransactionTest() -{ -} - -void TransactionTest::searchName() -{ - success = FALSE; - Transaction* t = PackageKit::Client::instance()->searchNames("vim"); - qDebug() << "searchName"; - QEventLoop el; - connect(t, SIGNAL(package(QSharedPointer<PackageKit::Package>)), this, SLOT(searchName_cb(QSharedPointer<PackageKit::Package>))); - connect(t, SIGNAL(finished(PackageKit::Enum::Exit, uint)), &el, SLOT(quit())); - el.exec(); - CPPUNIT_ASSERT_MESSAGE("searchName", success); -} - -void TransactionTest::searchDesktop() -{ - success = FALSE; - QSharedPointer<Package> p = PackageKit::Client::instance()->searchFromDesktopFile("/usr/share/applications/gnome-terminal.desktop"); - qDebug() << "searchDesktop"; - CPPUNIT_ASSERT_MESSAGE("searchDesktop", p); -} - -void TransactionTest::resolveAndInstallAndRemove() -{ - success = FALSE; - Client* c = Client::instance(); - Transaction* t = c->resolve("glib2"); - qDebug() << "Resolving"; - QEventLoop el; - connect(t, SIGNAL(package(QSharedPointer<PackageKit::Package>)), this, SLOT(resolveAndInstallAndRemove_cb(QSharedPointer<PackageKit::Package>))); - connect(t, SIGNAL(finished(PackageKit::Enum::Exit, uint)), &el, SLOT(quit())); - el.exec(); - CPPUNIT_ASSERT_MESSAGE("resolve", success); - - t = c->installPackages(FALSE, currentPackage); - CPPUNIT_ASSERT_MESSAGE("installPackages", t != NULL); - qDebug() << "Installing"; - connect(t, SIGNAL(finished(PackageKit::Enum::Exit, uint)), &el, SLOT(quit())); - el.exec(); - - t = c->removePackages(currentPackage, FALSE, FALSE); - CPPUNIT_ASSERT_MESSAGE("removePackages", t != NULL); - qDebug() << "Removing"; - connect(t, SIGNAL(finished(PackageKit::Enum::Exit, uint)), &el, SLOT(quit())); - el.exec(); -} - -void TransactionTest::refreshCache() -{ - Transaction* t = PackageKit::Client::instance()->refreshCache(true); - qDebug() << "Refreshing cache"; - CPPUNIT_ASSERT_MESSAGE("refreshCache", t != NULL); - QEventLoop el; - connect(t, SIGNAL(finished(PackageKit::Enum::Exit, uint)), &el, SLOT(quit())); - el.exec(); -} - -void TransactionTest::getDistroUpgrades() -{ - success = FALSE; - Transaction* t = PackageKit::Client::instance()->getDistroUpgrades(); - qDebug() << "Getting distro upgrades"; - CPPUNIT_ASSERT_MESSAGE("getDistroUpgrades", t != NULL); - QEventLoop el; - connect(t, SIGNAL(finished(PackageKit::Enum::Exit, uint)), &el, SLOT(quit())); - connect(t, SIGNAL(distroUpgrade(PackageKit::Enum::DistroUpgrade, const QString&, const QString&)), this, SLOT(getDistroUpgrades_cb())); - el.exec(); - CPPUNIT_ASSERT_MESSAGE("getDistroUpgrades (not fatal, only means there are no distro upgrades)", success); - -} - -void TransactionTest::getRepos() -{ - success = FALSE; - - Transaction* t = PackageKit::Client::instance()->getRepoList(); - CPPUNIT_ASSERT_MESSAGE("getRepoList", t != NULL); - qDebug() << "Getting repos (non filtered)"; - QEventLoop el; - connect(t, SIGNAL(finished(PackageKit::Enum::Exit, uint)), &el, SLOT(quit())); - connect(t, SIGNAL(repoDetail(const QString&, const QString&, bool)), this, SLOT(getRepos_cb(const QString&, const QString&, bool))); - el.exec(); - CPPUNIT_ASSERT_MESSAGE("getRepoList", success); - - success = FALSE; - t = PackageKit::Client::instance()->getRepoList(PackageKit::Enum::FilterNotDevelopment); - CPPUNIT_ASSERT_MESSAGE("getRepoList (filtered)", t != NULL); - qDebug() << "Getting repos (filtered)"; - connect(t, SIGNAL(finished(PackageKit::Enum::Exit, uint)), &el, SLOT(quit())); - connect(t, SIGNAL(repoDetail(const QString&, const QString&, bool)), this, SLOT(getRepos_cb(const QString&, const QString&, bool))); - el.exec(); - CPPUNIT_ASSERT_MESSAGE("getRepoList (filtered)", success); -} - -void TransactionTest::searchName_cb(QSharedPointer<Package> p) -{ - qDebug() << "Emitted package: " << p->name (); - success = TRUE; -} - -void TransactionTest::resolveAndInstallAndRemove_cb(QSharedPointer<Package> p) -{ - qDebug () << "Emitted package: " << p->name (); - currentPackage = p; - success = TRUE; -} - -void TransactionTest::getDistroUpgrades_cb() -{ - success = TRUE; -} - -void TransactionTest::getRepos_cb(const QString& repoName, const QString& repoDetail, bool enabled) -{ - qDebug() << "Repository" << repoName << " (" << repoDetail << ") is" << (enabled ? "enabled" : "disabled"); - success = TRUE; -} - -void TransactionTest::error (PackageKit::Client::DaemonError e) -{ - qDebug() << "Aieeeeee, daemon error!" << e; -} - -CPPUNIT_TEST_SUITE_REGISTRATION(TransactionTest); - -#include "transactiontest.moc" - diff --git a/lib/packagekit-qt/test/transactiontest.h b/lib/packagekit-qt/test/transactiontest.h deleted file mode 100644 index 13f2db61..00000000 --- a/lib/packagekit-qt/test/transactiontest.h +++ /dev/null @@ -1,48 +0,0 @@ -#ifndef TRANSACTIONTEST_H -#define TRANSACTIONTEST_H - -#include <QObject> -#include <cppunit/TestFixture.h> -#include <cppunit/TestSuite.h> -#include <cppunit/extensions/HelperMacros.h> -#include "QPackageKit" - -class TransactionTest : public QObject, public CppUnit::TestFixture -{ - Q_OBJECT - - CPPUNIT_TEST_SUITE(TransactionTest); - CPPUNIT_TEST(searchName); - CPPUNIT_TEST(searchDesktop); - CPPUNIT_TEST(resolveAndInstallAndRemove); - CPPUNIT_TEST(refreshCache); - CPPUNIT_TEST(getDistroUpgrades); - CPPUNIT_TEST(getRepos); - CPPUNIT_TEST_SUITE_END(); - -public: - TransactionTest(QObject* parent = 0); - ~TransactionTest(); - - void searchName(); - void searchDesktop(); - void resolveAndInstallAndRemove(); - void refreshCache(); - void getDistroUpgrades(); - void getRepos(); - -public slots: - void searchName_cb(QSharedPointer<PackageKit::Package> p); - void resolveAndInstallAndRemove_cb(QSharedPointer<PackageKit::Package> p); - void getDistroUpgrades_cb(); - void getRepos_cb(const QString& repoName, const QString& repoDetail, bool enabled); - - void error(PackageKit::Client::DaemonError e); - -private: - bool success; - QSharedPointer<PackageKit::Package> currentPackage; - -}; - -#endif |