pax_global_header 0000666 0000000 0000000 00000000064 15074160566 0014524 g ustar 00root root 0000000 0000000 52 comment=cfab90b8ad9542a48c33f91df86b7903701e19c4
linuxdeepin-udisks2-qt6-d816036/ 0000775 0000000 0000000 00000000000 15074160566 0016417 5 ustar 00root root 0000000 0000000 linuxdeepin-udisks2-qt6-d816036/.clog.toml 0000664 0000000 0000000 00000000163 15074160566 0020316 0 ustar 00root root 0000000 0000000 [clog]
repository = "https://github.com/linuxdeepin/udisks2-qt5"
changelog = "CHANGELOG.md"
from-latest-tag = true
linuxdeepin-udisks2-qt6-d816036/.github/ 0000775 0000000 0000000 00000000000 15074160566 0017757 5 ustar 00root root 0000000 0000000 linuxdeepin-udisks2-qt6-d816036/.github/workflows/ 0000775 0000000 0000000 00000000000 15074160566 0022014 5 ustar 00root root 0000000 0000000 linuxdeepin-udisks2-qt6-d816036/.github/workflows/backup-to-gitlab.yml 0000664 0000000 0000000 00000000537 15074160566 0025671 0 ustar 00root root 0000000 0000000 name: backup to gitlab
on: [push]
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
jobs:
backup-to-gitlabwh:
uses: linuxdeepin/.github/.github/workflows/backup-to-gitlabwh.yml@master
secrets: inherit
backup-to-gitee:
uses: linuxdeepin/.github/.github/workflows/backup-to-gitee.yml@master
secrets: inherit
linuxdeepin-udisks2-qt6-d816036/.github/workflows/call-auto-tag.yml 0000664 0000000 0000000 00000000517 15074160566 0025174 0 ustar 00root root 0000000 0000000 name: auto tag
on:
pull_request_target:
types: [opened, synchronize, closed]
paths:
- "debian/changelog"
concurrency:
group: ${{ github.workflow }}-pull/${{ github.event.number }}
cancel-in-progress: true
jobs:
auto_tag:
uses: linuxdeepin/.github/.github/workflows/auto-tag.yml@master
secrets: inherit
linuxdeepin-udisks2-qt6-d816036/.github/workflows/call-build-distribution.yml 0000664 0000000 0000000 00000000432 15074160566 0027263 0 ustar 00root root 0000000 0000000 name: Call build-distribution
on:
push:
paths-ignore:
- ".github/workflows/**"
pull_request_target:
paths-ignore:
- ".github/workflows/**"
jobs:
check_job:
uses: linuxdeepin/.github/.github/workflows/build-distribution.yml@master
secrets: inherit
linuxdeepin-udisks2-qt6-d816036/.github/workflows/call-chatOps.yml 0000664 0000000 0000000 00000000242 15074160566 0025047 0 ustar 00root root 0000000 0000000 name: chatOps
on:
issue_comment:
types: [created]
jobs:
chatopt:
uses: linuxdeepin/.github/.github/workflows/chatOps.yml@master
secrets: inherit
linuxdeepin-udisks2-qt6-d816036/.github/workflows/call-clacheck.yml 0000664 0000000 0000000 00000000525 15074160566 0025207 0 ustar 00root root 0000000 0000000 name: Call CLA check
on:
issue_comment:
types: [created]
pull_request_target:
types: [opened, closed, synchronize]
concurrency:
group: ${{ github.workflow }}-pull/${{ github.event.number }}
cancel-in-progress: true
jobs:
clacheck:
uses: linuxdeepin/.github/.github/workflows/cla-check.yml@master
secrets: inherit
linuxdeepin-udisks2-qt6-d816036/.github/workflows/call-commitlint.yml 0000664 0000000 0000000 00000000364 15074160566 0025632 0 ustar 00root root 0000000 0000000 name: Call commitlint
on:
pull_request_target:
concurrency:
group: ${{ github.workflow }}-pull/${{ github.event.number }}
cancel-in-progress: true
jobs:
check_job:
uses: linuxdeepin/.github/.github/workflows/commitlint.yml@master
linuxdeepin-udisks2-qt6-d816036/.github/workflows/call-license-check.yml 0000664 0000000 0000000 00000000552 15074160566 0026147 0 ustar 00root root 0000000 0000000 name: Call License and README Check
on:
pull_request_target:
types: [opened, synchronize, reopened]
permissions:
pull-requests: write
contents: read
concurrency:
group: ${{ github.workflow }}-pull/${{ github.event.number }}
cancel-in-progress: true
jobs:
license-check:
uses: linuxdeepin/.github/.github/workflows/license-check.yml@master
linuxdeepin-udisks2-qt6-d816036/.github/workflows/cppcheck.yml 0000664 0000000 0000000 00000001265 15074160566 0024323 0 ustar 00root root 0000000 0000000 name: cppcheck
on:
pull_request_target:
paths-ignore:
- ".github/workflows/**"
concurrency:
group: ${{ github.workflow }}-pull/${{ github.event.number }}
cancel-in-progress: true
jobs:
cppchceck:
name: cppcheck
runs-on: ubuntu-latest
steps:
- run: export
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
persist-credentials: false
- uses: linuxdeepin/action-cppcheck@main
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
repository: ${{ github.repository }}
pull_request_id: ${{ github.event.pull_request.number }}
allow_approve: false
linuxdeepin-udisks2-qt6-d816036/.gitignore 0000664 0000000 0000000 00000000051 15074160566 0020403 0 ustar 00root root 0000000 0000000 # IDE related
*.user
# Misc
.directory
linuxdeepin-udisks2-qt6-d816036/.reuse/ 0000775 0000000 0000000 00000000000 15074160566 0017620 5 ustar 00root root 0000000 0000000 linuxdeepin-udisks2-qt6-d816036/.reuse/dep5 0000664 0000000 0000000 00000001535 15074160566 0020404 0 ustar 00root root 0000000 0000000 Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: udisks2-qt5
Upstream-Contact: UnionTech Software Technology Co., Ltd. <>
Source: https://github.com/linuxdeepin/udisks2-qt5
# github
Files: .github/*
Copyright: None
License: CC0-1.0
# gitignore
Files: .clog.toml .gitignore org.freedesktop.UDisks2.ObjectManager.xml CHANGELOG.md
Copyright: None
License: CC0-1.0
# debian & arch & rpm
Files: debian/* archlinux/* rpm/*
Copyright: None
License: CC0-1.0
# Project file
Files: *CMakeLists.txt udisks2-qt6.pc.in udisks2-qt6Config.cmake.in
Copyright: None
License: CC0-1.0
# README
Files: README.md README.zh_CN.md CHANGELOG.md
Copyright: UnionTech Software Technology Co., Ltd.
License: CC-BY-4.0
# org.freedesktop.UDisks2.xml
Files: org.freedesktop.UDisks2.xml
Copyright: 2011 David Zeuthen
License: LGPL-2.0-or-later
linuxdeepin-udisks2-qt6-d816036/CHANGELOG.md 0000664 0000000 0000000 00000000273 15074160566 0020232 0 ustar 00root root 0000000 0000000
## 0.0.1 (2019-03-26)
#### Features
* add interfaces ([6668fc33](https://github.com/linuxdeepin/udisks2-qt5/commit/6668fc33c0ffe46b87c69e0f6315fcc3b698dac7))
linuxdeepin-udisks2-qt6-d816036/CMakeLists.txt 0000664 0000000 0000000 00000006740 15074160566 0021166 0 ustar 00root root 0000000 0000000 cmake_minimum_required(VERSION 3.13)
project(udisks2-qt6 VERSION 6.0.0 LANGUAGES CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
# 查找Qt6组件而不是Qt5
find_package(Qt6 COMPONENTS Core DBus REQUIRED)
# 添加私有头文件
set(PRIVATE_HEADERS
private/dblockdevice_p.h
)
# 设置源文件
set(SOURCES
ddiskdevice.cpp
ddiskmanager.cpp
udisks2_dbus_common.cpp
dblockdevice.cpp
dblockpartition.cpp
dudisksjob.cpp
)
# 设置头文件
set(HEADERS
ddiskdevice.h
udisks2_dbus_common.h
ddiskmanager.h
dblockdevice.h
dblockpartition.h
dudisksjob.h
${PRIVATE_HEADERS} # 添加私有头文件到头文件列表
)
# 处理DBus接口 (使用Qt6的DBus工具)
set_source_files_properties(org.freedesktop.UDisks2.xml PROPERTIES
INCLUDE "udisks2_dbus_common.h"
NO_NAMESPACE TRUE
)
set_source_files_properties(org.freedesktop.UDisks2.ObjectManager.xml PROPERTIES
NO_NAMESPACE TRUE
)
qt_add_dbus_interface(DBUS_SOURCES
org.freedesktop.UDisks2.xml
udisks2_interface
)
qt_add_dbus_interface(DBUS_SOURCES
org.freedesktop.UDisks2.ObjectManager.xml
objectmanager_interface
)
# 创建共享库
add_library(${PROJECT_NAME} SHARED
${SOURCES}
${HEADERS}
${DBUS_SOURCES}
)
# 设置SO版本
set_target_properties(${PROJECT_NAME} PROPERTIES
VERSION ${PROJECT_VERSION}
SOVERSION 1
OUTPUT_NAME ${PROJECT_NAME}
)
# 设置目标属性
target_link_libraries(${PROJECT_NAME}
PRIVATE
Qt6::Core
Qt6::DBus
)
target_include_directories(${PROJECT_NAME} PUBLIC
$
$
)
target_include_directories(${PROJECT_NAME} PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
)
# 安装配置
include(GNUInstallDirs)
# 安装库文件
install(TARGETS ${PROJECT_NAME}
EXPORT ${PROJECT_NAME}Targets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
# 安装公共头文件(不包括私有头文件)
install(FILES
ddiskdevice.h
udisks2_dbus_common.h
ddiskmanager.h
dblockdevice.h
dblockpartition.h
dudisksjob.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}
)
# 安装private头文件到特定目录
install(FILES ${PRIVATE_HEADERS}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}/private
)
# 生成并安装pkgconfig文件
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/udisks2-qt6.pc.in
${CMAKE_CURRENT_BINARY_DIR}/udisks2-qt6.pc
@ONLY
)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/udisks2-qt6.pc
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
)
# 导出目标
install(EXPORT ${PROJECT_NAME}Targets
FILE ${PROJECT_NAME}Targets.cmake
NAMESPACE ${PROJECT_NAME}::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
)
include(CMakePackageConfigHelpers)
# 生成cmake配置文件
configure_package_config_file(
${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}Config.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
)
# 生成版本文件
write_basic_package_version_file(
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
VERSION ${PROJECT_VERSION}
COMPATIBILITY SameMajorVersion
)
# 安装cmake配置文件
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
) linuxdeepin-udisks2-qt6-d816036/LICENSE.txt 0000664 0000000 0000000 00000103556 15074160566 0020254 0 ustar 00root root 0000000 0000000 GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright © 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for software and other kinds of works.
The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too.
When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions.
Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and modification follow.
TERMS AND CONDITIONS
0. Definitions.
“This License” refers to version 3 of the GNU General Public License.
“Copyright” also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.
“The Program” refers to any copyrightable work licensed under this License. Each licensee is addressed as “you”. “Licensees” and “recipients” may be individuals or organizations.
To “modify” a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a “modified version” of the earlier work or a work “based on” the earlier work.
A “covered work” means either the unmodified Program or a work based on the Program.
To “propagate” a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.
To “convey” a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays “Appropriate Legal Notices” to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.
1. Source Code.
The “source code” for a work means the preferred form of the work for making modifications to it. “Object code” means any non-source form of a work.
A “Standard Interface” means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.
The “System Libraries” of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A “Major Component”, in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.
The “Corresponding Source” for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work.
The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.
The Corresponding Source for a work in source code form is that same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.
When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified it, and giving a relevant date.
b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to “keep intact all notices”.
c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.
A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an “aggregate” if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:
a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.
d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.
A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.
A “User Product” is either (1) a “consumer product”, which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, “normally used” refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.
“Installation Information” for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.
If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).
The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.
7. Additional Terms.
“Additional permissions” are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or authors of the material; or
e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.
All other non-permissive additional terms are considered “further restrictions” within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).
However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.
Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.
An “entity transaction” is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.
11. Patents.
A “contributor” is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's “contributor version”.
A contributor's “essential patent claims” are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, “control” includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.
In the following three paragraphs, a “patent license” is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To “grant” such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.
If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. “Knowingly relying” means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.
A patent license is “discriminatory” if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation.
If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program.
Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the “copyright” line and a pointer to where the full notice is found.
Copyright (C)
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see .
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode:
Copyright (C)
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an “about box”.
You should also get your employer (if you work as a programmer) or school, if any, to sign a “copyright disclaimer” for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see .
The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read .
linuxdeepin-udisks2-qt6-d816036/LICENSES/ 0000775 0000000 0000000 00000000000 15074160566 0017624 5 ustar 00root root 0000000 0000000 linuxdeepin-udisks2-qt6-d816036/LICENSES/CC-BY-4.0.txt 0000664 0000000 0000000 00000041177 15074160566 0021473 0 ustar 00root root 0000000 0000000 Creative Commons Attribution 4.0 International
Creative Commons Corporation (“Creative Commons”) is not a law firm and does not provide legal services or legal advice. Distribution of Creative Commons public licenses does not create a lawyer-client or other relationship. Creative Commons makes its licenses and related information available on an “as-is” basis. Creative Commons gives no warranties regarding its licenses, any material licensed under their terms and conditions, or any related information. Creative Commons disclaims all liability for damages resulting from their use to the fullest extent possible.
Using Creative Commons Public Licenses
Creative Commons public licenses provide a standard set of terms and conditions that creators and other rights holders may use to share original works of authorship and other material subject to copyright and certain other rights specified in the public license below. The following considerations are for informational purposes only, are not exhaustive, and do not form part of our licenses.
Considerations for licensors: Our public licenses are intended for use by those authorized to give the public permission to use material in ways otherwise restricted by copyright and certain other rights. Our licenses are irrevocable. Licensors should read and understand the terms and conditions of the license they choose before applying it. Licensors should also secure all rights necessary before applying our licenses so that the public can reuse the material as expected. Licensors should clearly mark any material not subject to the license. This includes other CC-licensed material, or material used under an exception or limitation to copyright. More considerations for licensors.
Considerations for the public: By using one of our public licenses, a licensor grants the public permission to use the licensed material under specified terms and conditions. If the licensor’s permission is not necessary for any reason–for example, because of any applicable exception or limitation to copyright–then that use is not regulated by the license. Our licenses grant only permissions under copyright and certain other rights that a licensor has authority to grant. Use of the licensed material may still be restricted for other reasons, including because others have copyright or other rights in the material. A licensor may make special requests, such as asking that all changes be marked or described. Although not required by our licenses, you are encouraged to respect those requests where reasonable. More considerations for the public.
Creative Commons Attribution 4.0 International Public License
By exercising the Licensed Rights (defined below), You accept and agree to be bound by the terms and conditions of this Creative Commons Attribution 4.0 International Public License ("Public License"). To the extent this Public License may be interpreted as a contract, You are granted the Licensed Rights in consideration of Your acceptance of these terms and conditions, and the Licensor grants You such rights in consideration of benefits the Licensor receives from making the Licensed Material available under these terms and conditions.
Section 1 – Definitions.
a. Adapted Material means material subject to Copyright and Similar Rights that is derived from or based upon the Licensed Material and in which the Licensed Material is translated, altered, arranged, transformed, or otherwise modified in a manner requiring permission under the Copyright and Similar Rights held by the Licensor. For purposes of this Public License, where the Licensed Material is a musical work, performance, or sound recording, Adapted Material is always produced where the Licensed Material is synched in timed relation with a moving image.
b. Adapter's License means the license You apply to Your Copyright and Similar Rights in Your contributions to Adapted Material in accordance with the terms and conditions of this Public License.
c. Copyright and Similar Rights means copyright and/or similar rights closely related to copyright including, without limitation, performance, broadcast, sound recording, and Sui Generis Database Rights, without regard to how the rights are labeled or categorized. For purposes of this Public License, the rights specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights.
d. Effective Technological Measures means those measures that, in the absence of proper authority, may not be circumvented under laws fulfilling obligations under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, and/or similar international agreements.
e. Exceptions and Limitations means fair use, fair dealing, and/or any other exception or limitation to Copyright and Similar Rights that applies to Your use of the Licensed Material.
f. Licensed Material means the artistic or literary work, database, or other material to which the Licensor applied this Public License.
g. Licensed Rights means the rights granted to You subject to the terms and conditions of this Public License, which are limited to all Copyright and Similar Rights that apply to Your use of the Licensed Material and that the Licensor has authority to license.
h. Licensor means the individual(s) or entity(ies) granting rights under this Public License.
i. Share means to provide material to the public by any means or process that requires permission under the Licensed Rights, such as reproduction, public display, public performance, distribution, dissemination, communication, or importation, and to make material available to the public including in ways that members of the public may access the material from a place and at a time individually chosen by them.
j. Sui Generis Database Rights means rights other than copyright resulting from Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, as amended and/or succeeded, as well as other essentially equivalent rights anywhere in the world.
k. You means the individual or entity exercising the Licensed Rights under this Public License. Your has a corresponding meaning.
Section 2 – Scope.
a. License grant.
1. Subject to the terms and conditions of this Public License, the Licensor hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive, irrevocable license to exercise the Licensed Rights in the Licensed Material to:
A. reproduce and Share the Licensed Material, in whole or in part; and
B. produce, reproduce, and Share Adapted Material.
2. Exceptions and Limitations. For the avoidance of doubt, where Exceptions and Limitations apply to Your use, this Public License does not apply, and You do not need to comply with its terms and conditions.
3. Term. The term of this Public License is specified in Section 6(a).
4. Media and formats; technical modifications allowed. The Licensor authorizes You to exercise the Licensed Rights in all media and formats whether now known or hereafter created, and to make technical modifications necessary to do so. The Licensor waives and/or agrees not to assert any right or authority to forbid You from making technical modifications necessary to exercise the Licensed Rights, including technical modifications necessary to circumvent Effective Technological Measures. For purposes of this Public License, simply making modifications authorized by this Section 2(a)(4) never produces Adapted Material.
5. Downstream recipients.
A. Offer from the Licensor – Licensed Material. Every recipient of the Licensed Material automatically receives an offer from the Licensor to exercise the Licensed Rights under the terms and conditions of this Public License.
B. No downstream restrictions. You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, the Licensed Material if doing so restricts exercise of the Licensed Rights by any recipient of the Licensed Material.
6. No endorsement. Nothing in this Public License constitutes or may be construed as permission to assert or imply that You are, or that Your use of the Licensed Material is, connected with, or sponsored, endorsed, or granted official status by, the Licensor or others designated to receive attribution as provided in Section 3(a)(1)(A)(i).
b. Other rights.
1. Moral rights, such as the right of integrity, are not licensed under this Public License, nor are publicity, privacy, and/or other similar personality rights; however, to the extent possible, the Licensor waives and/or agrees not to assert any such rights held by the Licensor to the limited extent necessary to allow You to exercise the Licensed Rights, but not otherwise.
2. Patent and trademark rights are not licensed under this Public License.
3. To the extent possible, the Licensor waives any right to collect royalties from You for the exercise of the Licensed Rights, whether directly or through a collecting society under any voluntary or waivable statutory or compulsory licensing scheme. In all other cases the Licensor expressly reserves any right to collect such royalties.
Section 3 – License Conditions.
Your exercise of the Licensed Rights is expressly made subject to the following conditions.
a. Attribution.
1. If You Share the Licensed Material (including in modified form), You must:
A. retain the following if it is supplied by the Licensor with the Licensed Material:
i. identification of the creator(s) of the Licensed Material and any others designated to receive attribution, in any reasonable manner requested by the Licensor (including by pseudonym if designated);
ii. a copyright notice;
iii. a notice that refers to this Public License;
iv. a notice that refers to the disclaimer of warranties;
v. a URI or hyperlink to the Licensed Material to the extent reasonably practicable;
B. indicate if You modified the Licensed Material and retain an indication of any previous modifications; and
C. indicate the Licensed Material is licensed under this Public License, and include the text of, or the URI or hyperlink to, this Public License.
2. You may satisfy the conditions in Section 3(a)(1) in any reasonable manner based on the medium, means, and context in which You Share the Licensed Material. For example, it may be reasonable to satisfy the conditions by providing a URI or hyperlink to a resource that includes the required information.
3. If requested by the Licensor, You must remove any of the information required by Section 3(a)(1)(A) to the extent reasonably practicable.
4. If You Share Adapted Material You produce, the Adapter's License You apply must not prevent recipients of the Adapted Material from complying with this Public License.
Section 4 – Sui Generis Database Rights.
Where the Licensed Rights include Sui Generis Database Rights that apply to Your use of the Licensed Material:
a. for the avoidance of doubt, Section 2(a)(1) grants You the right to extract, reuse, reproduce, and Share all or a substantial portion of the contents of the database;
b. if You include all or a substantial portion of the database contents in a database in which You have Sui Generis Database Rights, then the database in which You have Sui Generis Database Rights (but not its individual contents) is Adapted Material; and
c. You must comply with the conditions in Section 3(a) if You Share all or a substantial portion of the contents of the database.
For the avoidance of doubt, this Section 4 supplements and does not replace Your obligations under this Public License where the Licensed Rights include other Copyright and Similar Rights.
Section 5 – Disclaimer of Warranties and Limitation of Liability.
a. Unless otherwise separately undertaken by the Licensor, to the extent possible, the Licensor offers the Licensed Material as-is and as-available, and makes no representations or warranties of any kind concerning the Licensed Material, whether express, implied, statutory, or other. This includes, without limitation, warranties of title, merchantability, fitness for a particular purpose, non-infringement, absence of latent or other defects, accuracy, or the presence or absence of errors, whether or not known or discoverable. Where disclaimers of warranties are not allowed in full or in part, this disclaimer may not apply to You.
b. To the extent possible, in no event will the Licensor be liable to You on any legal theory (including, without limitation, negligence) or otherwise for any direct, special, indirect, incidental, consequential, punitive, exemplary, or other losses, costs, expenses, or damages arising out of this Public License or use of the Licensed Material, even if the Licensor has been advised of the possibility of such losses, costs, expenses, or damages. Where a limitation of liability is not allowed in full or in part, this limitation may not apply to You.
c. The disclaimer of warranties and limitation of liability provided above shall be interpreted in a manner that, to the extent possible, most closely approximates an absolute disclaimer and waiver of all liability.
Section 6 – Term and Termination.
a. This Public License applies for the term of the Copyright and Similar Rights licensed here. However, if You fail to comply with this Public License, then Your rights under this Public License terminate automatically.
b. Where Your right to use the Licensed Material has terminated under Section 6(a), it reinstates:
1. automatically as of the date the violation is cured, provided it is cured within 30 days of Your discovery of the violation; or
2. upon express reinstatement by the Licensor.
c. For the avoidance of doubt, this Section 6(b) does not affect any right the Licensor may have to seek remedies for Your violations of this Public License.
d. For the avoidance of doubt, the Licensor may also offer the Licensed Material under separate terms or conditions or stop distributing the Licensed Material at any time; however, doing so will not terminate this Public License.
e. Sections 1, 5, 6, 7, and 8 survive termination of this Public License.
Section 7 – Other Terms and Conditions.
a. The Licensor shall not be bound by any additional or different terms or conditions communicated by You unless expressly agreed.
b. Any arrangements, understandings, or agreements regarding the Licensed Material not stated herein are separate from and independent of the terms and conditions of this Public License.
Section 8 – Interpretation.
a. For the avoidance of doubt, this Public License does not, and shall not be interpreted to, reduce, limit, restrict, or impose conditions on any use of the Licensed Material that could lawfully be made without permission under this Public License.
b. To the extent possible, if any provision of this Public License is deemed unenforceable, it shall be automatically reformed to the minimum extent necessary to make it enforceable. If the provision cannot be reformed, it shall be severed from this Public License without affecting the enforceability of the remaining terms and conditions.
c. No term or condition of this Public License will be waived and no failure to comply consented to unless expressly agreed to by the Licensor.
d. Nothing in this Public License constitutes or may be interpreted as a limitation upon, or waiver of, any privileges and immunities that apply to the Licensor or You, including from the legal processes of any jurisdiction or authority.
Creative Commons is not a party to its public licenses. Notwithstanding, Creative Commons may elect to apply one of its public licenses to material it publishes and in those instances will be considered the “Licensor.” Except for the limited purpose of indicating that material is shared under a Creative Commons public license or as otherwise permitted by the Creative Commons policies published at creativecommons.org/policies, Creative Commons does not authorize the use of the trademark “Creative Commons” or any other trademark or logo of Creative Commons without its prior written consent including, without limitation, in connection with any unauthorized modifications to any of its public licenses or any other arrangements, understandings, or agreements concerning use of licensed material. For the avoidance of doubt, this paragraph does not form part of the public licenses.
Creative Commons may be contacted at creativecommons.org.
linuxdeepin-udisks2-qt6-d816036/LICENSES/CC0-1.0.txt 0000664 0000000 0000000 00000015610 15074160566 0021231 0 ustar 00root root 0000000 0000000 Creative Commons Legal Code
CC0 1.0 Universal
CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
HEREUNDER.
Statement of Purpose
The laws of most jurisdictions throughout the world automatically confer
exclusive Copyright and Related Rights (defined below) upon the creator
and subsequent owner(s) (each and all, an "owner") of an original work of
authorship and/or a database (each, a "Work").
Certain owners wish to permanently relinquish those rights to a Work for
the purpose of contributing to a commons of creative, cultural and
scientific works ("Commons") that the public can reliably and without fear
of later claims of infringement build upon, modify, incorporate in other
works, reuse and redistribute as freely as possible in any form whatsoever
and for any purposes, including without limitation commercial purposes.
These owners may contribute to the Commons to promote the ideal of a free
culture and the further production of creative, cultural and scientific
works, or to gain reputation or greater distribution for their Work in
part through the use and efforts of others.
For these and/or other purposes and motivations, and without any
expectation of additional consideration or compensation, the person
associating CC0 with a Work (the "Affirmer"), to the extent that he or she
is an owner of Copyright and Related Rights in the Work, voluntarily
elects to apply CC0 to the Work and publicly distribute the Work under its
terms, with knowledge of his or her Copyright and Related Rights in the
Work and the meaning and intended legal effect of CC0 on those rights.
1. Copyright and Related Rights. A Work made available under CC0 may be
protected by copyright and related or neighboring rights ("Copyright and
Related Rights"). Copyright and Related Rights include, but are not
limited to, the following:
i. the right to reproduce, adapt, distribute, perform, display,
communicate, and translate a Work;
ii. moral rights retained by the original author(s) and/or performer(s);
iii. publicity and privacy rights pertaining to a person's image or
likeness depicted in a Work;
iv. rights protecting against unfair competition in regards to a Work,
subject to the limitations in paragraph 4(a), below;
v. rights protecting the extraction, dissemination, use and reuse of data
in a Work;
vi. database rights (such as those arising under Directive 96/9/EC of the
European Parliament and of the Council of 11 March 1996 on the legal
protection of databases, and under any national implementation
thereof, including any amended or successor version of such
directive); and
vii. other similar, equivalent or corresponding rights throughout the
world based on applicable law or treaty, and any national
implementations thereof.
2. Waiver. To the greatest extent permitted by, but not in contravention
of, applicable law, Affirmer hereby overtly, fully, permanently,
irrevocably and unconditionally waives, abandons, and surrenders all of
Affirmer's Copyright and Related Rights and associated claims and causes
of action, whether now known or unknown (including existing as well as
future claims and causes of action), in the Work (i) in all territories
worldwide, (ii) for the maximum duration provided by applicable law or
treaty (including future time extensions), (iii) in any current or future
medium and for any number of copies, and (iv) for any purpose whatsoever,
including without limitation commercial, advertising or promotional
purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
member of the public at large and to the detriment of Affirmer's heirs and
successors, fully intending that such Waiver shall not be subject to
revocation, rescission, cancellation, termination, or any other legal or
equitable action to disrupt the quiet enjoyment of the Work by the public
as contemplated by Affirmer's express Statement of Purpose.
3. Public License Fallback. Should any part of the Waiver for any reason
be judged legally invalid or ineffective under applicable law, then the
Waiver shall be preserved to the maximum extent permitted taking into
account Affirmer's express Statement of Purpose. In addition, to the
extent the Waiver is so judged Affirmer hereby grants to each affected
person a royalty-free, non transferable, non sublicensable, non exclusive,
irrevocable and unconditional license to exercise Affirmer's Copyright and
Related Rights in the Work (i) in all territories worldwide, (ii) for the
maximum duration provided by applicable law or treaty (including future
time extensions), (iii) in any current or future medium and for any number
of copies, and (iv) for any purpose whatsoever, including without
limitation commercial, advertising or promotional purposes (the
"License"). The License shall be deemed effective as of the date CC0 was
applied by Affirmer to the Work. Should any part of the License for any
reason be judged legally invalid or ineffective under applicable law, such
partial invalidity or ineffectiveness shall not invalidate the remainder
of the License, and in such case Affirmer hereby affirms that he or she
will not (i) exercise any of his or her remaining Copyright and Related
Rights in the Work or (ii) assert any associated claims and causes of
action with respect to the Work, in either case contrary to Affirmer's
express Statement of Purpose.
4. Limitations and Disclaimers.
a. No trademark or patent rights held by Affirmer are waived, abandoned,
surrendered, licensed or otherwise affected by this document.
b. Affirmer offers the Work as-is and makes no representations or
warranties of any kind concerning the Work, express, implied,
statutory or otherwise, including without limitation warranties of
title, merchantability, fitness for a particular purpose, non
infringement, or the absence of latent or other defects, accuracy, or
the present or absence of errors, whether or not discoverable, all to
the greatest extent permissible under applicable law.
c. Affirmer disclaims responsibility for clearing rights of other persons
that may apply to the Work or any use thereof, including without
limitation any person's Copyright and Related Rights in the Work.
Further, Affirmer disclaims responsibility for obtaining any necessary
consents, permissions or other rights required for any use of the
Work.
d. Affirmer understands and acknowledges that Creative Commons is not a
party to this document and has no duty or obligation with respect to
this CC0 or use of the Work.
linuxdeepin-udisks2-qt6-d816036/LICENSES/GPL-3.0-or-later.txt 0000664 0000000 0000000 00000103556 15074160566 0023042 0 ustar 00root root 0000000 0000000 GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright © 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for software and other kinds of works.
The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too.
When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions.
Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and modification follow.
TERMS AND CONDITIONS
0. Definitions.
“This License” refers to version 3 of the GNU General Public License.
“Copyright” also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.
“The Program” refers to any copyrightable work licensed under this License. Each licensee is addressed as “you”. “Licensees” and “recipients” may be individuals or organizations.
To “modify” a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a “modified version” of the earlier work or a work “based on” the earlier work.
A “covered work” means either the unmodified Program or a work based on the Program.
To “propagate” a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.
To “convey” a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays “Appropriate Legal Notices” to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.
1. Source Code.
The “source code” for a work means the preferred form of the work for making modifications to it. “Object code” means any non-source form of a work.
A “Standard Interface” means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.
The “System Libraries” of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A “Major Component”, in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.
The “Corresponding Source” for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work.
The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.
The Corresponding Source for a work in source code form is that same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.
When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified it, and giving a relevant date.
b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to “keep intact all notices”.
c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.
A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an “aggregate” if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:
a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.
d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.
A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.
A “User Product” is either (1) a “consumer product”, which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, “normally used” refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.
“Installation Information” for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.
If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).
The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.
7. Additional Terms.
“Additional permissions” are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or authors of the material; or
e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.
All other non-permissive additional terms are considered “further restrictions” within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).
However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.
Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.
An “entity transaction” is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.
11. Patents.
A “contributor” is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's “contributor version”.
A contributor's “essential patent claims” are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, “control” includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.
In the following three paragraphs, a “patent license” is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To “grant” such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.
If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. “Knowingly relying” means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.
A patent license is “discriminatory” if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation.
If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program.
Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the “copyright” line and a pointer to where the full notice is found.
Copyright (C)
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see .
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode:
Copyright (C)
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an “about box”.
You should also get your employer (if you work as a programmer) or school, if any, to sign a “copyright disclaimer” for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see .
The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read .
linuxdeepin-udisks2-qt6-d816036/README.md 0000664 0000000 0000000 00000001441 15074160566 0017676 0 ustar 00root root 0000000 0000000 # udisks2-qt6
UDisks2 DBus interfaces binding for Qt6.
### Build dependencies
- cmake
- qt6-base-dev
- pkg-config
## Installation
### Build from source code
``` shell
$ cd /path/to/your/source/code
$ mkdir build
$ cd build
$ cmake ..
$ make
$ sudo make install
```
## Getting help
- [Official Forum](https://bbs.deepin.org/) for generic discussion and help.
- [Developer Center](https://github.com/linuxdeepin/developer-center) for BUG report and suggestions.
- [Wiki](https://wiki.deepin.org/)
## Getting involved
We encourage you to report issues and contribute changes
- [Contribution guide for developers](https://github.com/linuxdeepin/developer-center/wiki/Contribution-Guidelines-for-Developers-en) (English)
## License
udisks2-qt6 is licensed under [GPL-3.0-or-later](LICENSE.txt) linuxdeepin-udisks2-qt6-d816036/README.zh_CN.md 0000664 0000000 0000000 00000001254 15074160566 0020700 0 ustar 00root root 0000000 0000000 # udisks2-qt6
使用 Qt6 封装的 UDisks2 的 DBus 接口。
### 编译依赖
- cmake
- qt6-base-dev
- pkg-config
## 安装
### 构建过程
``` shell
$ cd /path/to/your/source/code
$ mkdir build
$ cd build
$ cmake ..
$ make
$ sudo make install
```
## 帮助
- [官方论坛](https://bbs.deepin.org/)
- [开发者中心](https://github.com/linuxdeepin/developer-center)
- [Wiki](https://wiki.deepin.org/)
## 贡献指南
我们鼓励您报告问题并做出更改
- [开发者代码贡献指南](https://github.com/linuxdeepin/developer-center/wiki/Contribution-Guidelines-for-Developers)
## 开源许可证
udisks2-qt6 在 [GPL-3.0-or-later](LICENSE.txt)下发布。 linuxdeepin-udisks2-qt6-d816036/archlinux/ 0000775 0000000 0000000 00000000000 15074160566 0020414 5 ustar 00root root 0000000 0000000 linuxdeepin-udisks2-qt6-d816036/archlinux/PKGBUILD 0000664 0000000 0000000 00000001204 15074160566 0021535 0 ustar 00root root 0000000 0000000 # Maintainer: Dingyuan Zhang
pkgname=udisks2-qt6-git
pkgver=6.0.0
pkgrel=1
pkgdesc='UDisks2 DBus interfaces binding for Qt6'
arch=('x86_64')
url="https://github.com/linuxdeepin/udisks2-qt6"
license=('GPL3')
depends=('qt6-base' 'udisks2')
makedepends=('cmake' 'ninja')
conflicts=('udisks2-qt6')
provides=('udisks2-qt6')
group=('deepin-git')
source=('source.tar.gz')
sha512sums=('SKIP')
build() {
cd $deepin_source_name
cmake -GNinja -B build \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_BUILD_TYPE=Release
cmake --build build
}
package() {
cd $deepin_source_name
DESTDIR="$pkgdir" cmake --install build
}
linuxdeepin-udisks2-qt6-d816036/dblockdevice.cpp 0000664 0000000 0000000 00000046335 15074160566 0021554 0 ustar 00root root 0000000 0000000 // SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later
#include "dblockdevice.h"
#include "private/dblockdevice_p.h"
#include "udisks2_interface.h"
#include "objectmanager_interface.h"
#include
DBlockDevicePrivate::DBlockDevicePrivate(DBlockDevice *qq)
: q_ptr(qq)
{
qDebug() << "Creating DBlockDevicePrivate";
}
void DBlockDevice::onInterfacesAdded(const QDBusObjectPath &object_path, const QMap &interfaces_and_properties)
{
Q_D(DBlockDevice);
qDebug() << "Interfaces added for block device:" << object_path.path();
const QString &path = object_path.path();
if (path != d->dbus->path())
return;
if (interfaces_and_properties.contains(QStringLiteral(UDISKS2_SERVICE ".Filesystem"))) {
qDebug() << "Filesystem interface added for block device:" << path;
Q_EMIT hasFileSystemChanged(true);
}
if (interfaces_and_properties.contains(QStringLiteral(UDISKS2_SERVICE ".Partition"))) {
qDebug() << "Partition interface added for block device:" << path;
Q_EMIT hasPartitionChanged(true);
}
if (interfaces_and_properties.contains(QStringLiteral(UDISKS2_SERVICE ".Encrypted"))) {
qDebug() << "Encrypted interface added for block device:" << path;
Q_EMIT isEncryptedChanged(true);
}
}
void DBlockDevice::onInterfacesRemoved(const QDBusObjectPath &object_path, const QStringList &interfaces)
{
Q_D(DBlockDevice);
qDebug() << "Interfaces removed for block device:" << object_path.path();
const QString &path = object_path.path();
if (path != d->dbus->path())
return;
for (const QString &i : interfaces) {
if (i == QStringLiteral(UDISKS2_SERVICE ".Filesystem")) {
qDebug() << "Filesystem interface removed for block device:" << path;
Q_EMIT hasFileSystemChanged(false);
} else if (i == QStringLiteral(UDISKS2_SERVICE ".Partition")) {
qDebug() << "Partition interface removed for block device:" << path;
Q_EMIT hasPartitionChanged(false);
} else if (i == QStringLiteral(UDISKS2_SERVICE ".Encrypted")) {
qDebug() << "Encrypted interface removed for block device:" << path;
Q_EMIT isEncryptedChanged(false);
}
}
}
void DBlockDevice::onPropertiesChanged(const QString &interface, const QVariantMap &changed_properties)
{
qDebug() << "Properties changed for block device:" << d_ptr->dbus->path() << "interface:" << interface;
if (interface.endsWith(".PartitionTable")) {
auto begin = changed_properties.begin();
while (begin != changed_properties.constEnd()) {
if (begin.key() == "Type") {
qDebug() << "Partition table type changed for block device:" << d_ptr->dbus->path();
Q_EMIT ptTypeChanged();
break;
}
++begin;
}
} else {
auto begin = changed_properties.begin();
for (; begin != changed_properties.constEnd(); ++begin) {
QString property_name = begin.key();
int pindex = this->metaObject()->indexOfProperty(property_name.toLatin1().constData());
if (pindex < 0) {
property_name[0] = property_name.at(0).toLower();
pindex = this->metaObject()->indexOfProperty(property_name.toLatin1().constData());
}
if (pindex < 0)
continue;
const QMetaProperty &mp = this->metaObject()->property(pindex);
if (!mp.hasNotifySignal())
continue;
mp.notifySignal().invoke(this, QGenericArgument(begin.value().typeName(), begin.value().constData()));
}
}
}
DBlockDevice::~DBlockDevice()
{
qDebug() << "DBlockDevice destroyed:" << path();
}
bool DBlockDevice::isValid() const
{
Q_D(const DBlockDevice);
qDebug() << "Checking if block device is valid:" << d->dbus->path();
return d->dbus->isValid();
}
bool DBlockDevice::watchChanges() const
{
Q_D(const DBlockDevice);
qDebug() << "Getting block device watch changes status:" << d->dbus->path();
return d->watchChanges;
}
/*!
* \brief Get the block device (patition) DBus path.
*
* \return the DBus path
*/
QString DBlockDevice::path() const
{
Q_D(const DBlockDevice);
qDebug() << "Getting block device path:" << d->dbus->path();
return d->dbus->path();
}
QList > DBlockDevice::configuration() const
{
Q_D(const DBlockDevice);
qDebug() << "Getting block device configuration:" << d->dbus->path();
return d->dbus->configuration();
}
QString DBlockDevice::cryptoBackingDevice() const
{
Q_D(const DBlockDevice);
qDebug() << "Getting block device crypto backing device:" << d->dbus->path();
return d->dbus->cryptoBackingDevice().path();
}
/*!
* \brief Get the device path, like `/dev/sda1`
*
* \return Device path in QByteArray.
*/
QByteArray DBlockDevice::device() const
{
Q_D(const DBlockDevice);
qDebug() << "Getting block device device path:" << d->dbus->path();
return d->dbus->device();
}
qulonglong DBlockDevice::deviceNumber() const
{
Q_D(const DBlockDevice);
qDebug() << "Getting block device number:" << d->dbus->path();
return d->dbus->deviceNumber();
}
/*!
* \brief Get the disk device dbus path
*
* \return a dbus path in QString
*/
QString DBlockDevice::drive() const
{
Q_D(const DBlockDevice);
qDebug() << "Getting block device drive path:" << d->dbus->path();
return d->dbus->drive().path();
}
bool DBlockDevice::hintAuto() const
{
Q_D(const DBlockDevice);
qDebug() << "Getting block device hint auto:" << d->dbus->path();
return d->dbus->hintAuto();
}
QString DBlockDevice::hintIconName() const
{
Q_D(const DBlockDevice);
qDebug() << "Getting block device hint icon name:" << d->dbus->path();
return d->dbus->hintIconName();
}
bool DBlockDevice::hintIgnore() const
{
Q_D(const DBlockDevice);
qDebug() << "Getting block device hint ignore:" << d->dbus->path();
return d->dbus->hintIgnore();
}
QString DBlockDevice::hintName() const
{
Q_D(const DBlockDevice);
qDebug() << "Getting block device hint name:" << d->dbus->path();
return d->dbus->hintName();
}
bool DBlockDevice::hintPartitionable() const
{
Q_D(const DBlockDevice);
qDebug() << "Getting block device hint partitionable:" << d->dbus->path();
return d->dbus->hintPartitionable();
}
QString DBlockDevice::hintSymbolicIconName() const
{
Q_D(const DBlockDevice);
qDebug() << "Getting block device hint symbolic icon name:" << d->dbus->path();
return d->dbus->hintSymbolicIconName();
}
bool DBlockDevice::hintSystem() const
{
Q_D(const DBlockDevice);
qDebug() << "Getting block device hint system:" << d->dbus->path();
return d->dbus->hintSystem();
}
QString DBlockDevice::id() const
{
Q_D(const DBlockDevice);
qDebug() << "Getting block device ID:" << d->dbus->path();
return d->dbus->id();
}
QString DBlockDevice::idLabel() const
{
Q_D(const DBlockDevice);
qDebug() << "Getting block device ID label:" << d->dbus->path();
return d->dbus->idLabel();
}
QString DBlockDevice::idType() const
{
Q_D(const DBlockDevice);
qDebug() << "Getting block device ID type:" << d->dbus->path();
return d->dbus->idType();
}
DBlockDevice::FSType DBlockDevice::fsType() const
{
const QString &fs_type = idType();
qDebug() << "Getting block device filesystem type:" << path() << "type:" << fs_type;
if (fs_type.isEmpty()) {
qWarning() << "Filesystem type is empty:" << path();
return InvalidFS;
}
if (fs_type == "hfs+")
return hfs_plus;
bool ok = false;
const QMetaEnum me = QMetaEnum::fromType();
int value = me.keyToValue(fs_type.toLatin1().constData(), &ok);
if (!ok) {
qWarning() << "Failed to convert filesystem type:" << path() << "type:" << fs_type;
return UnknowFS;
}
return static_cast(value);
}
QString DBlockDevice::idUUID() const
{
Q_D(const DBlockDevice);
return d->dbus->idUUID();
}
QString DBlockDevice::idUsage() const
{
Q_D(const DBlockDevice);
return d->dbus->idUsage();
}
QString DBlockDevice::idVersion() const
{
Q_D(const DBlockDevice);
return d->dbus->idVersion();
}
QString DBlockDevice::mDRaid() const
{
Q_D(const DBlockDevice);
return d->dbus->mDRaid().path();
}
QString DBlockDevice::mDRaidMember() const
{
Q_D(const DBlockDevice);
return d->dbus->mDRaidMember().path();
}
QByteArray DBlockDevice::preferredDevice() const
{
Q_D(const DBlockDevice);
return d->dbus->preferredDevice();
}
bool DBlockDevice::readOnly() const
{
Q_D(const DBlockDevice);
return d->dbus->readOnly();
}
qulonglong DBlockDevice::size() const
{
Q_D(const DBlockDevice);
return d->dbus->size();
}
QByteArrayList DBlockDevice::symlinks() const
{
Q_D(const DBlockDevice);
return d->dbus->symlinks();
}
QStringList DBlockDevice::userspaceMountOptions() const
{
Q_D(const DBlockDevice);
return d->dbus->userspaceMountOptions();
}
bool DBlockDevice::hasFileSystem() const
{
Q_D(const DBlockDevice);
return hasFileSystem(d->dbus->path());
}
bool DBlockDevice::hasPartitionTable() const
{
Q_D(const DBlockDevice);
return hasPartitionTable(d->dbus->path());
}
bool DBlockDevice::hasPartition() const
{
Q_D(const DBlockDevice);
return hasPartition(d->dbus->path());
}
bool DBlockDevice::isEncrypted() const
{
Q_D(const DBlockDevice);
return isEncrypted(d->dbus->path());
}
bool DBlockDevice::isLoopDevice() const
{
Q_D(const DBlockDevice);
return UDisks2::interfaceExists(d->dbus->path(), UDISKS2_SERVICE ".Loop");
}
bool DBlockDevice::hasFileSystem(const QString &path)
{
return UDisks2::interfaceExists(path, UDISKS2_SERVICE ".Filesystem");
}
bool DBlockDevice::hasPartitionTable(const QString &path)
{
return UDisks2::interfaceExists(path, UDISKS2_SERVICE ".PartitionTable");
}
bool DBlockDevice::hasPartition(const QString &path)
{
return UDisks2::interfaceExists(path, UDISKS2_SERVICE ".Partition");
}
bool DBlockDevice::isEncrypted(const QString &path)
{
return UDisks2::interfaceExists(path, UDISKS2_SERVICE ".Encrypted");
}
QByteArrayList DBlockDevice::mountPoints() const
{
if (!hasFileSystem())
return QByteArrayList();
Q_D(const DBlockDevice);
OrgFreedesktopUDisks2FilesystemInterface fsif(UDISKS2_SERVICE, d->dbus->path(), QDBusConnection::systemBus());
return fsif.mountPoints();
}
DBlockDevice::PTType DBlockDevice::ptType() const
{
Q_D(const DBlockDevice);
if (!UDisks2::interfaceExists(d->dbus->path(), UDISKS2_SERVICE ".PartitionTable")) {
return InvalidPT;
}
OrgFreedesktopUDisks2PartitionTableInterface ptif(UDISKS2_SERVICE, d->dbus->path(), QDBusConnection::systemBus());
const QString &type = ptif.type();
if (type.isEmpty()) {
return InvalidPT;
}
if (type == "dos") {
return MBR;
}
if (type == "gpt") {
return GPT;
}
return UnknowPT;
}
QList > DBlockDevice::childConfiguration() const
{
Q_D(const DBlockDevice);
if (!isEncrypted()) {
return QList>();
}
OrgFreedesktopUDisks2EncryptedInterface eif(UDISKS2_SERVICE, d->dbus->path(), QDBusConnection::systemBus());
return eif.childConfiguration();
}
QDBusError DBlockDevice::lastError() const
{
Q_D(const DBlockDevice);
return d->err;
}
void DBlockDevice::setWatchChanges(bool watchChanges)
{
Q_D(DBlockDevice);
if (d->watchChanges == watchChanges)
return;
d->watchChanges = watchChanges;
OrgFreedesktopDBusObjectManagerInterface *object_manager = UDisks2::objectManager();
auto sb = QDBusConnection::systemBus();
if (watchChanges) {
connect(object_manager, &OrgFreedesktopDBusObjectManagerInterface::InterfacesAdded,
this, &DBlockDevice::onInterfacesAdded);
connect(object_manager, &OrgFreedesktopDBusObjectManagerInterface::InterfacesRemoved,
this, &DBlockDevice::onInterfacesRemoved);
sb.connect(UDISKS2_SERVICE, d->dbus->path(), "org.freedesktop.DBus.Properties",
"PropertiesChanged", this, SLOT(onPropertiesChanged(const QString &, const QVariantMap &)));
} else {
disconnect(object_manager, &OrgFreedesktopDBusObjectManagerInterface::InterfacesAdded,
this, &DBlockDevice::onInterfacesAdded);
disconnect(object_manager, &OrgFreedesktopDBusObjectManagerInterface::InterfacesRemoved,
this, &DBlockDevice::onInterfacesRemoved);
sb.disconnect(UDISKS2_SERVICE, d->dbus->path(), "org.freedesktop.DBus.Properties",
"PropertiesChanged", this, SLOT(onPropertiesChanged(const QString &, const QVariantMap &)));
}
}
void DBlockDevice::addConfigurationItem(const QPair &item, const QVariantMap &options)
{
Q_D(DBlockDevice);
auto r = d->dbus->AddConfigurationItem(item, options);
r.waitForFinished();
d->err = r.error();
}
void DBlockDevice::format(const QString &type, const QVariantMap &options)
{
Q_D(DBlockDevice);
d->dbus->setTimeout(INT_MAX);
auto r = d->dbus->Format(type, options);
r.waitForFinished();
d->err = r.error();
d->dbus->setTimeout(-1);
}
void DBlockDevice::format(const DBlockDevice::FSType &type, const QVariantMap &options)
{
if (type < ext2)
return;
format(QString::fromLatin1(QMetaEnum::fromType().valueToKey(type)), options);
}
QList > DBlockDevice::getSecretConfiguration(const QVariantMap &options)
{
Q_D(DBlockDevice);
auto r = d->dbus->GetSecretConfiguration(options);
r.waitForFinished();
d->err = r.error();
return r.value();
}
QDBusUnixFileDescriptor DBlockDevice::openDevice(const QString &mode, const QVariantMap &options)
{
Q_D(DBlockDevice);
auto r = d->dbus->OpenDevice(mode, options);
r.waitForFinished();
d->err = r.error();
return r.value();
}
QDBusUnixFileDescriptor DBlockDevice::openForBackup(const QVariantMap &options)
{
Q_D(DBlockDevice);
auto r = d->dbus->OpenForBackup(options);
r.waitForFinished();
d->err = r.error();
return r.value();
}
QDBusUnixFileDescriptor DBlockDevice::openForBenchmark(const QVariantMap &options)
{
Q_D(DBlockDevice);
auto r = d->dbus->OpenForBenchmark(options);
r.waitForFinished();
d->err = r.error();
return r.value();
}
QDBusUnixFileDescriptor DBlockDevice::openForRestore(const QVariantMap &options)
{
Q_D(DBlockDevice);
auto r = d->dbus->OpenForRestore(options);
r.waitForFinished();
d->err = r.error();
return r.value();
}
void DBlockDevice::removeConfigurationItem(const QPair &item, const QVariantMap &options)
{
Q_D(DBlockDevice);
auto r = d->dbus->RemoveConfigurationItem(item, options);
r.waitForFinished();
d->err = r.error();
}
void DBlockDevice::rescan(const QVariantMap &options)
{
Q_D(DBlockDevice);
auto r = d->dbus->Rescan(options);
r.waitForFinished();
d->err = r.error();
}
void DBlockDevice::updateConfigurationItem(const QPair &old_item, const QPair &new_item, const QVariantMap &options)
{
Q_D(DBlockDevice);
auto r = d->dbus->UpdateConfigurationItem(old_item, new_item, options);
r.waitForFinished();
d->err = r.error();
}
/*!
* \brief Mount the block device.
*
* \param options please refer to \l {http://storaged.org/doc/udisks2-api/latest/gdbus-org.freedesktop.UDisks2.Filesystem.html#gdbus-method-org-freedesktop-UDisks2-Filesystem.Mount} {UDisks2.Filesystem Mount()}
*
* \return the mount point path.
*
* \sa unmount()
*/
QString DBlockDevice::mount(const QVariantMap &options)
{
if (!hasFileSystem()) {
return QString();
}
Q_D(DBlockDevice);
OrgFreedesktopUDisks2FilesystemInterface fsif(UDISKS2_SERVICE, d->dbus->path(), QDBusConnection::systemBus());
auto r = fsif.Mount(options);
r.waitForFinished();
d->err = r.error();
return r.value();
}
void DBlockDevice::unmount(const QVariantMap &options)
{
if (!hasFileSystem()) {
return;
}
Q_D(DBlockDevice);
OrgFreedesktopUDisks2FilesystemInterface fsif(UDISKS2_SERVICE, d->dbus->path(), QDBusConnection::systemBus());
auto r = fsif.Unmount(options);
r.waitForFinished();
d->err = r.error();
}
/*!
* \brief Check if we can set the filesystem label.
*
* \return
*/
bool DBlockDevice::canSetLabel() const
{
if (!hasFileSystem()) {
return false;
}
// blumia: Since gvfs can't correctly mount a label-renamed patition
// we simply disable rename support if we don't unmount the
// patition. Will be add back when we switch to udisks2.
if (/*fsType() == ntfs && */!mountPoints().isEmpty()) {
return false;
}
return true;
}
/*!
* \brief Sets the filesystem label.
*
* \param options Options (currently unused except for standard options).
*/
void DBlockDevice::setLabel(const QString &label, const QVariantMap &options)
{
if (!hasFileSystem()) {
return;
}
Q_D(DBlockDevice);
OrgFreedesktopUDisks2FilesystemInterface fsif(UDISKS2_SERVICE, d->dbus->path(), QDBusConnection::systemBus());
auto r = fsif.SetLabel(label, options);
r.waitForFinished();
d->err = r.error();
}
void DBlockDevice::changePassphrase(const QString &passphrase, const QString &new_passphrase, const QVariantMap &options)
{
if (!isEncrypted()) {
return;
}
Q_D(DBlockDevice);
OrgFreedesktopUDisks2EncryptedInterface eif(UDISKS2_SERVICE, d->dbus->path(), QDBusConnection::systemBus());
auto r = eif.ChangePassphrase(passphrase, new_passphrase, options);
r.waitForFinished();
d->err = r.error();
}
void DBlockDevice::lock(const QVariantMap &options)
{
if (!isEncrypted()) {
return;
}
Q_D(DBlockDevice);
OrgFreedesktopUDisks2EncryptedInterface eif(UDISKS2_SERVICE, d->dbus->path(), QDBusConnection::systemBus());
QDBusPendingReply r = eif.Lock(options);
r.waitForFinished();
d->err = r.error();
}
QString DBlockDevice::unlock(const QString &passphrase, const QVariantMap &options)
{
if (!isEncrypted()) {
return QString();
}
Q_D(DBlockDevice);
OrgFreedesktopUDisks2EncryptedInterface eif(UDISKS2_SERVICE, d->dbus->path(), QDBusConnection::systemBus());
auto r = eif.Unlock(passphrase, options);
r.waitForFinished();
d->err = r.error();
return r.value().path();
}
QString DBlockDevice::cleartextDevice()
{
if (!isEncrypted()) {
return QString();
}
Q_D(const DBlockDevice);
OrgFreedesktopUDisks2EncryptedInterface eif(UDISKS2_SERVICE, d->dbus->path(), QDBusConnection::systemBus());
return eif.cleartextDevice().path();
}
DBlockDevice::DBlockDevice(const QString &path, QObject *parent)
: DBlockDevice(*new DBlockDevicePrivate(this), path, parent)
{
}
DBlockDevice::DBlockDevice(DBlockDevicePrivate &dd, const QString &path, QObject *parent)
: QObject(parent)
, d_ptr(&dd)
{
dd.dbus = new OrgFreedesktopUDisks2BlockInterface(UDISKS2_SERVICE, path, QDBusConnection::systemBus(), this);
connect(this, &DBlockDevice::idTypeChanged, this, &DBlockDevice::fsTypeChanged);
}
linuxdeepin-udisks2-qt6-d816036/dblockdevice.h 0000664 0000000 0000000 00000021246 15074160566 0021213 0 ustar 00root root 0000000 0000000 // SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later
#ifndef DBLOCKDEVICE_H
#define DBLOCKDEVICE_H
#include
#include
#include
#include
class QDBusObjectPath;
class DBlockDevicePrivate;
class DBlockDevice : public QObject
{
Q_OBJECT
Q_DECLARE_PRIVATE(DBlockDevice)
Q_PROPERTY(QString path READ path CONSTANT FINAL)
Q_PROPERTY(bool watchChanges READ watchChanges WRITE setWatchChanges)
Q_PROPERTY(bool hasFileSystem READ hasFileSystem NOTIFY hasFileSystemChanged)
Q_PROPERTY(bool hasPartition READ hasPartition NOTIFY hasPartitionChanged)
Q_PROPERTY(bool isEncrypted READ isEncrypted NOTIFY isEncryptedChanged)
Q_PROPERTY(bool isLoopDevice READ isLoopDevice)
Q_PROPERTY(QList> configuration READ configuration NOTIFY configurationChanged)
Q_PROPERTY(QString cryptoBackingDevice READ cryptoBackingDevice NOTIFY cryptoBackingDeviceChanged)
Q_PROPERTY(QByteArray device READ device)
Q_PROPERTY(qulonglong deviceNumber READ deviceNumber)
Q_PROPERTY(QString drive READ drive)
Q_PROPERTY(bool hintAuto READ hintAuto NOTIFY hintAutoChanged)
Q_PROPERTY(QString hintIconName READ hintIconName NOTIFY hintIconNameChanged)
Q_PROPERTY(bool hintIgnore READ hintIgnore NOTIFY hintIgnoreChanged)
Q_PROPERTY(QString hintName READ hintName NOTIFY hintNameChanged)
Q_PROPERTY(bool hintPartitionable READ hintPartitionable NOTIFY hintPartitionableChanged)
Q_PROPERTY(QString hintSymbolicIconName READ hintSymbolicIconName NOTIFY hintSymbolicIconNameChanged)
Q_PROPERTY(bool hintSystem READ hintSystem)
Q_PROPERTY(QString id READ id)
Q_PROPERTY(QString idLabel READ idLabel NOTIFY idLabelChanged)
Q_PROPERTY(QString idType READ idType NOTIFY idTypeChanged)
Q_PROPERTY(FSType fsType READ fsType NOTIFY fsTypeChanged)
Q_PROPERTY(QString idUUID READ idUUID NOTIFY idUUIDChanged)
Q_PROPERTY(QString idUsage READ idUsage NOTIFY idUsageChanged)
Q_PROPERTY(QString idVersion READ idVersion NOTIFY idVersionChanged)
Q_PROPERTY(QString mDRaid READ mDRaid NOTIFY mDRaidChanged)
Q_PROPERTY(QString mDRaidMember READ mDRaidMember NOTIFY mDRaidMemberChanged)
Q_PROPERTY(QByteArray preferredDevice READ preferredDevice NOTIFY preferredDeviceChanged)
Q_PROPERTY(bool readOnly READ readOnly NOTIFY readOnlyChanged)
Q_PROPERTY(qulonglong size READ size NOTIFY sizeChanged)
Q_PROPERTY(QByteArrayList symlinks READ symlinks NOTIFY symlinksChanged)
Q_PROPERTY(QStringList userspaceMountOptions READ userspaceMountOptions NOTIFY userspaceMountOptionsChanged)
// of FileSystem
Q_PROPERTY(QByteArrayList mountPoints READ mountPoints NOTIFY mountPointsChanged)
// of ParitionTable
Q_PROPERTY(PTType ptType READ ptType NOTIFY ptTypeChanged)
// of Encrypted
Q_PROPERTY(QList> childConfiguration READ childConfiguration NOTIFY childConfigurationChanged)
Q_PROPERTY(QString cleartextDevice READ cleartextDevice NOTIFY cleartextDeviceChanged)
public:
// partition table type
enum PTType {
InvalidPT,
MBR,
GPT,
UnknowPT
};
Q_ENUM(PTType)
enum FSType {
InvalidFS,
UnknowFS,
ext2,
ext3,
ext4,
fat12,
fat16,
fat32,
btrfs,
f2fs,
hfs_plus,
minix,
nilfs2,
ntfs,
reiser4,
vfat,
iso9660,
jfs,
xfs,
swap,
LVM2_member,
crypto_LUKS
};
Q_ENUM(FSType)
~DBlockDevice();
bool isValid() const;
bool watchChanges() const;
QString path() const;
QList> configuration() const;
QString cryptoBackingDevice() const;
QByteArray device() const;
qulonglong deviceNumber() const;
QString drive() const;
bool hintAuto() const;
QString hintIconName() const;
bool hintIgnore() const;
QString hintName() const;
bool hintPartitionable() const;
QString hintSymbolicIconName() const;
bool hintSystem() const;
QString id() const;
QString idLabel() const;
QString idType() const;
FSType fsType() const;
QString idUUID() const;
QString idUsage() const;
QString idVersion() const;
QString mDRaid() const;
QString mDRaidMember() const;
QByteArray preferredDevice() const;
bool readOnly() const;
qulonglong size() const;
QByteArrayList symlinks() const;
QStringList userspaceMountOptions() const;
bool hasFileSystem() const;
bool hasPartitionTable() const;
bool hasPartition() const;
bool isEncrypted() const;
bool isLoopDevice() const;
static bool hasFileSystem(const QString &path);
static bool hasPartitionTable(const QString &path);
static bool hasPartition(const QString &path);
static bool isEncrypted(const QString &path);
QByteArrayList mountPoints() const;
PTType ptType() const;
QList> childConfiguration() const;
QDBusError lastError() const;
public Q_SLOTS:
void setWatchChanges(bool watchChanges);
void addConfigurationItem(const QPair &item, const QVariantMap &options);
void format(const QString &type, const QVariantMap &options);
void format(const FSType &type, const QVariantMap &options);
QList> getSecretConfiguration(const QVariantMap &options);
QDBusUnixFileDescriptor openDevice(const QString &mode, const QVariantMap &options);
QDBusUnixFileDescriptor openForBackup(const QVariantMap &options);
QDBusUnixFileDescriptor openForBenchmark(const QVariantMap &options);
QDBusUnixFileDescriptor openForRestore(const QVariantMap &options);
void removeConfigurationItem(const QPair &item, const QVariantMap &options);
void rescan(const QVariantMap &options);
void updateConfigurationItem(const QPair &old_item, const QPair &new_item, const QVariantMap &options);
// of Filesystem
QString mount(const QVariantMap &options);
void unmount(const QVariantMap &options);
bool canSetLabel() const;
void setLabel(const QString &label, const QVariantMap &options);
// of Encrypted
void changePassphrase(const QString &passphrase, const QString &new_passphrase, const QVariantMap &options);
void lock(const QVariantMap &options);
QString unlock(const QString &passphrase, const QVariantMap &options);
QString cleartextDevice();
Q_SIGNALS:
void hasFileSystemChanged(bool hasFileSystem);
void hasPartitionChanged(bool hasPartition);
void isEncryptedChanged(bool isEncrypted);
void configurationChanged(QList> configuration);
void cryptoBackingDeviceChanged(QString cryptoBackingDevice);
void hintAutoChanged(bool hintAuto);
void hintIconNameChanged(QString hintIconName);
void hintIgnoreChanged(bool hintIgnore);
void hintNameChanged(QString hintName);
void hintPartitionableChanged(bool hintPartitionable);
void hintSymbolicIconNameChanged(QString hintSymbolicIconName);
void idLabelChanged(QString idLabel);
void idTypeChanged(QString idType);
void fsTypeChanged();
void idUUIDChanged(QString idUUID);
void idUsageChanged(QString idUsage);
void idVersionChanged(QString idVersion);
void mDRaidChanged(QString mDRaid);
void mDRaidMemberChanged(QString mDRaidMember);
void preferredDeviceChanged(QByteArray preferredDevice);
void readOnlyChanged(bool readOnly);
void sizeChanged(qulonglong size);
void symlinksChanged(QByteArrayList symlinks);
void userspaceMountOptionsChanged(QStringList userspaceMountOptions);
void ptTypeChanged();
void mountPointsChanged(const QByteArrayList &mountPoints);
void childConfigurationChanged(QList> childConfiguration);
void cleartextDeviceChanged(const QString &cleartextDevice);
protected:
explicit DBlockDevice(const QString &path, QObject *parent = nullptr);
explicit DBlockDevice(DBlockDevicePrivate &dd, const QString &path, QObject *parent = nullptr);
QScopedPointer d_ptr;
private Q_SLOTS:
void onInterfacesAdded(const QDBusObjectPath &object_path, const QMap &interfaces_and_properties);
void onInterfacesRemoved(const QDBusObjectPath &object_path, const QStringList &interfaces);
void onPropertiesChanged(const QString &interface, const QVariantMap &changed_properties);
// Q_PRIVATE_SLOT(d_ptr, void _q_onPropertiesChanged(const QString &, const QVariantMap &))
friend class DDiskManager;
};
#endif // DBLOCKDEVICE_H
linuxdeepin-udisks2-qt6-d816036/dblockpartition.cpp 0000664 0000000 0000000 00000061324 15074160566 0022321 0 ustar 00root root 0000000 0000000 // SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later
#include "dblockpartition.h"
#include "private/dblockdevice_p.h"
#include "udisks2_interface.h"
#include
class DBlockPartitionPrivate : public DBlockDevicePrivate
{
public:
DBlockPartitionPrivate(DBlockPartition *qq);
OrgFreedesktopUDisks2PartitionInterface *dbus;
};
DBlockPartitionPrivate::DBlockPartitionPrivate(DBlockPartition *qq)
: DBlockDevicePrivate(qq)
{
qDebug() << "Creating DBlockPartitionPrivate";
}
qulonglong DBlockPartition::flags() const
{
Q_D(const DBlockPartition);
qDebug() << "Getting partition flags:" << d->dbus->path();
return d->dbus->flags();
}
bool DBlockPartition::isContained() const
{
Q_D(const DBlockPartition);
qDebug() << "Checking if partition is contained:" << d->dbus->path();
return d->dbus->isContained();
}
bool DBlockPartition::isContainer() const
{
Q_D(const DBlockPartition);
qDebug() << "Checking if partition is container:" << d->dbus->path();
return d->dbus->isContainer();
}
QString DBlockPartition::name() const
{
Q_D(const DBlockPartition);
qDebug() << "Getting partition name:" << d->dbus->path();
return d->dbus->name();
}
uint DBlockPartition::number() const
{
Q_D(const DBlockPartition);
qDebug() << "Getting partition number:" << d->dbus->path();
return d->dbus->number();
}
qulonglong DBlockPartition::offset() const
{
Q_D(const DBlockPartition);
qDebug() << "Getting partition offset:" << d->dbus->path();
return d->dbus->offset();
}
qulonglong DBlockPartition::size() const
{
Q_D(const DBlockPartition);
qDebug() << "Getting partition size:" << d->dbus->path();
return d->dbus->size();
}
QString DBlockPartition::table() const
{
Q_D(const DBlockPartition);
qDebug() << "Getting partition table:" << d->dbus->path();
return d->dbus->table().path();
}
QString DBlockPartition::type() const
{
Q_D(const DBlockPartition);
qDebug() << "Getting partition type:" << d->dbus->path();
return d->dbus->type();
}
DBlockPartition::Type DBlockPartition::eType() const
{
const QString &type = this->type();
qDebug() << "Getting partition enum type:" << path() << "type:" << type;
if (type.isEmpty())
return Empty;
bool ok = false;
int value = type.toInt(&ok, 16);
if (!ok) {
qWarning() << "Invalid partition type:" << type;
return Unknow;
}
return static_cast(value);
}
QString DBlockPartition::UUID() const
{
Q_D(const DBlockPartition);
qDebug() << "Getting partition UUID:" << d->dbus->path();
return d->dbus->uUID();
}
DBlockPartition::GUIDType DBlockPartition::guidType() const
{
qDebug() << "Getting partition GUID type:" << path();
static QByteArrayList list;
if (list.isEmpty()) {
qDebug() << "Initializing GUID type list";
// None
list << "00000000-0000-0000-0000-000000000000"
<< "024DEE41-33E7-11D3-9D69-0008C781F39F"
<< "C12A7328-F81F-11D2-BA4B-00A0C93EC93B"
<< "21686148-6449-6E6F-744E-656564454649"
<< "D3BFE2DE-3DAF-11DF-BA40-E3A556D89593"
<< "F4019732-066E-4E12-8273-346C5641494F"
<< "BFBFAFE7-A34F-448A-9A5B-6213EB736C22"
// Windows
<< "E3C9E316-0B5C-4DB8-817D-F92DF00215AE"
<< "EBD0A0A2-B9E5-4433-87C0-68B6B72699C7"
<< "5808C8AA-7E8F-42E0-85D2-E1E90434CFB3"
<< "AF9B60A0-1431-4F62-BC68-3311714A69AD"
<< "DE94BBA4-06D1-4D40-A16A-BFD50179D6AC"
<< "37AFFC90-EF7D-4e96-91C3-2D7AE055B174"
<< "E75CAF8F-F680-4CEE-AFA3-B001E56EFC2D"
// HP-UX
<< "75894C1E-3AEB-11D3-B7C1-7B03A0000000"
<< "E2A1E728-32E3-11D6-A682-7B03A0000000"
// Linux
<< "0FC63DAF-8483-4772-8E79-3D69D8477DE4"
<< "A19D880F-05FC-4D3B-A006-743F0F84911E"
<< "44479540-F297-41B2-9AF7-D131D5F0458A"
<< "4F68BCE3-E8CD-4DB1-96E7-FBCAF984B709"
<< "69DAD710-2CE4-4E3C-B16C-21A1D49ABED3"
<< "B921B045-1DF0-41C3-AF44-4C6F280D3FAE"
<< "0657FD6D-A4AB-43C4-84E5-0933C84B4F4F"
<< "E6D6D379-F507-44C2-A23C-238F2A3DF928"
<< "933AC7E1-2EB4-4F13-B844-0E14E2AEF915"
<< "3B8F8425-20E0-4F3B-907F-1A25A76F98E8"
<< "7FFEC5C9-2D00-49B7-8941-3EA10A5586B7"
<< "CA7D7CCB-63ED-4C53-861C-1742536059CC"
<< "8DA63339-0007-60C0-C436-083AC8230908"
// FreeBSD
<< "83BD6B9D-7F41-11DC-BE0B-001560B84F0F"
<< "516E7CB4-6ECF-11D6-8FF8-00022D09712B"
<< "516E7CB5-6ECF-11D6-8FF8-00022D09712B"
<< "516E7CB6-6ECF-11D6-8FF8-00022D09712B"
<< "516E7CB8-6ECF-11D6-8FF8-00022D09712B"
<< "516E7CBA-6ECF-11D6-8FF8-00022D09712B"
// macOS Darwin
<< "48465300-0000-11AA-AA11-00306543ECAC"
<< "55465300-0000-11AA-AA11-00306543ECAC"
<< "6A898CC3-1DD2-11B2-99A6-080020736631"
<< "52414944-0000-11AA-AA11-00306543ECAC"
<< "52414944-5F4F-11AA-AA11-00306543ECAC"
<< "426F6F74-0000-11AA-AA11-00306543ECAC"
<< "4C616265-6C00-11AA-AA11-00306543ECAC"
<< "5265636F-7665-11AA-AA11-00306543ECAC"
<< "53746F72-6167-11AA-AA11-00306543ECAC"
<< "B6FA30DA-92D2-4A9A-96F1-871EC6486200"
<< "2E313465-19B9-463F-8126-8A7993773801"
<< "FA709C7E-65B1-4593-BFD5-E71D61DE9B02"
<< "BBBA6DF5-F46F-4A89-8F59-8765B2727503"
// Solaris illumos
<< "6A82CB45-1DD2-11B2-99A6-080020736631"
<< "6A85CF4D-1DD2-11B2-99A6-080020736631"
<< "6A87C46F-1DD2-11B2-99A6-080020736631"
<< "6A8B642B-1DD2-11B2-99A6-080020736631"
// << "6A898CC3-1DD2-11B2-99A6-080020736631"
<< "6A8EF2E9-1DD2-11B2-99A6-080020736631"
<< "6A90BA39-1DD2-11B2-99A6-080020736631"
<< "6A9283A5-1DD2-11B2-99A6-080020736631"
// reserved partition
<< "6A945A3B-1DD2-11B2-99A6-080020736631"
<< "6A9630D1-1DD2-11B2-99A6-080020736631"
<< "6A980767-1DD2-11B2-99A6-080020736631"
<< "6A96237F-1DD2-11B2-99A6-080020736631"
<< "6A8D2AC7-1DD2-11B2-99A6-080020736631"
// NetBSD
<< "49F48D32-B10E-11DC-B99B-0019D1879648"
<< "49F48D5A-B10E-11DC-B99B-0019D1879648"
<< "49F48D82-B10E-11DC-B99B-0019D1879648"
<< "49F48DAA-B10E-11DC-B99B-0019D1879648"
<< "2DB519C4-B10F-11DC-B99B-0019D1879648"
<< "2DB519EC-B10F-11DC-B99B-0019D1879648"
// ChromeOS
<< "FE3A2A5D-4F32-41A7-B725-ACCC3285A309"
<< "3CB8E202-3B7E-47DD-8A3C-7FF2A13CFCEC"
<< "2E0A753D-9E48-43B0-8337-B15192CB1B5E"
// HaiKu
<< "42465331-3BA3-10F1-802A-4861696B7521"
// MidnightBSD
<< "85D5E45E-237C-11E1-B4B3-E89A8F7FC3A7"
<< "85D5E45A-237C-11E1-B4B3-E89A8F7FC3A7"
<< "85D5E45B-237C-11E1-B4B3-E89A8F7FC3A7"
<< "0394EF8B-237E-11E1-B4B3-E89A8F7FC3A7"
<< "85D5E45C-237C-11E1-B4B3-E89A8F7FC3A7"
<< "85D5E45D-237C-11E1-B4B3-E89A8F7FC3A7"
// Ceph
<< "45B0969E-9B03-4F30-B4C6-B4B80CEFF106"
<< "45B0969E-9B03-4F30-B4C6-5EC00CEFF106"
<< "4FBD7E29-9D25-41B8-AFD0-062C0CEFF05D"
<< "4FBD7E29-9D25-41B8-AFD0-5EC00CEFF05D"
<< "89C57F98-2FE5-4DC0-89C1-F3AD0CEFF2BE"
<< "89C57F98-2FE5-4DC0-89C1-5EC00CEFF2BE"
// OpenBSD
<< "824CC7A0-36A8-11E3-890A-952519AD3F61"
// QNX
<< "CEF5A9AD-73BC-4601-89F3-CDEEEEE321A1"
// Plan 9
<< "C91818F9-8025-47AF-89D2-F030D7000C2C"
// VMware ESX
<< "9D275380-40AD-11DB-BF97-000C2911D1B8"
<< "AA31E02A-400F-11DB-9590-000C2911D1B8"
<< "9198EFFC-31C0-11DB-8F78-000C2911D1B8"
// Android-IA
<< "2568845D-2332-4675-BC39-8FA5A4748D15"
<< "114EAFFE-1552-4022-B26E-9B053604CF84"
<< "49A4D17F-93A3-45C1-A0DE-F50B2EBE2599"
<< "4177C722-9E92-4AAB-8644-43502BFD5506"
<< "EF32A33B-A409-486C-9141-9FFB711F6266"
<< "20AC26BE-20B7-11E3-84C5-6CFDB94711E9"
<< "38F428E6-D326-425D-9140-6E0EA133647C"
<< "A893EF21-E428-470A-9E55-0668FD91A2D9"
<< "DC76DDA9-5AC1-491C-AF42-A82591580C0D"
<< "EBC597D0-2053-4B15-8B64-E0AAC75F4DB1"
<< "8F68CC74-C5E5-48DA-BE91-A0C8C15E9C80"
<< "767941D0-2085-11E3-AD3B-6CFDB94711E9"
<< "AC6D7924-EB71-4DF8-B48D-E267B27148FF"
// Open Network Install Environment (ONIE)
<< "7412F7D5-A156-4B13-81DC-867174929325"
<< "D4E6E2CD-4469-46F3-B5CB-1BFF57AFC149"
// PowerPC
<< "9E1A2D38-C612-4316-AA26-8B49521E5A8B"
// freedesktop.org OSes (Linux, etc.)
<< "BC13C2FF-59E6-4262-A352-B275FD6F7172"
// Atari IOS
<< "734E5AFE-F61A-11E6-BC64-92361F002671";
}
const QString &guid = this->type();
if (guid.isEmpty())
return InvalidUUID;
int index = list.indexOf(guid.toLatin1());
if (index < 0)
return UnknowUUID;
return static_cast((index + GUIDTypeBegin));
}
QString DBlockPartition::typeDescription(DBlockPartition::Type type)
{
switch (type) {
case Empty:
return "Empty";
case FAT12Type:
return "FAT12";
case XENIX_root:
return "XENIX root";
case XENIX_usr:
return "XENIX usr";
case FAT16_Less_32M:
return "FAT16 <32M";
case Extended:
return "Extended";
case FAT16Type:
return "FAT16";
case HPFS_NTFS:
return "HPFS/NTFS";
case AIX:
return "AIX";
case AIX_bootable:
return "AIX bootable";
case OS2_Boot_Manager:
return "OS2 Boot Manager";
case Win95_FAT32:
return "Win95 FAT32";
case Win95_FAT32_LBA:
return "Win95 FAT32 (LBA)";
case Win95_FAT16_LBA:
return "Win95 FAT16 (LBA)";
case Win95_Extended_LBA:
return "Win95 Ext'd (LBA)";
case OPUS:
return "OPUS";
case Hidden_FAT12:
return "Hidden FAT12";
case Compaq_diagnostics:
return "Compaq diagnostics";
case Hidden_FAT16_Less_32M:
return "Hidden FAT16 <32M";
case Hidden_FAT16:
return "Hidden FAT16";
case Hidden_HPFS_or_NTFS:
return "Hidden HPFS/NTFS";
case AST_SmartSleep:
return "AST SmartSleep";
case Hidden_Win95_FAT32:
return "Hidden Win95 FAT32";
case Hidden_Win95_FAT32_LBA:
return "Hidden Win95 FAT32 (LBA)";
case Hidden_Win95_FAT16_LBA:
return "Hidden Win95 FAT16";
case NEC_DOS:
return "NEC DOS";
case Plan9:
return "Plan 9";
case PartitionMagic_recovery:
return "PartitionMagic recovery";
case Venix_80286:
return "Venix 80286";
case PPC_PReP_Boot:
return "PPC PReP Boot";
case SFS:
return "SFS";
case QNX4_dot_x:
return "QNX4.x";
case QNX4_dot_x_2nd_part:
return "QNX4.x.2nd part";
case QNX4_dot_x_3rd_part:
return "QNX4.x 3rd part";
case OnTrack_DM:
return "OnTrack DM";
case OnTrack_DM6_Aux1:
return "OnTrack DM6 Aux1";
case CP_M:
return "CP/M";
case OnTrack_DM6_Aux3:
return "OnTrack DM6 Aux3";
case OnTrackDM6:
return "OnTrackDM6";
case EZ_Drive:
return "EZ-Drive";
case Golden_Bow:
return "Golden Bow";
case Priam_Edisk:
return "Priam Edisk";
case SpeedStor:
return "SpeedStor";
case GNU_HURD_or_SysV:
return "GNU HURD or SysV";
case Novell_Netware_286:
return "Novell Netware 286";
case Novell_Netware_386:
return "Novell Netware 386";
case DiskSecure_Multi_Boot:
return "DiskSecure Multi-Boot";
case PC_IX:
return "PC/IX";
case Old_Minix:
return "Old Minix";
case Minix_old_Linux:
return "Minix / old Linux";
case Linux_swap:
return "Linux swap";
case Linux:
return "Linux";
case OS2_hidden_C_drive:
return "OS/2 hidden C: drive";
case Linux_extended:
return "Linux extended";
case NTFS_volume_set_1:
return "NTFS volume set";
case NTFS_volume_set_2:
return "NTFS volume set";
case Linux_LVM:
return "Linux LVM";
case Amoeba:
return "Amoeba";
case Amoeba_BBT:
return "Amoeba BBT";
case BSD_OS:
return "BSD/OS";
case IBM_Thinkpad_hibernation:
return "IBM Thinkpad hibernation";
case FreeBSD:
return "FreeBSD";
case OpenBSD:
return "OpenBSD";
case NeXTSTEP:
return "NeXTSTEP";
case NetBSD:
return "NetBSD";
case BSDI_fs:
return "BSDI fs";
case BSDI_swap:
return "BSDI swap";
case Boot_Wizard_hidden:
return "Boot Wizard hidden";
case DRDOS_sec_FAT12:
return "DRDOS/sec (FAT-12)";
case DRDOS_sec_FAT16_Less_32M:
return "DRDOS/sec (FAT-16 < 32M)";
case DRDOS_sec_FAT16:
return "DRDOS/sec (FAT-16)";
case Syrinx:
return "Syrinx";
case Non_FS_data:
return "Non-FS data";
case CP_M_CTOS_dot_dot_dot:
return "CP/M / CTOS / ...";
case Dell_Utility:
return "Dell Utility";
case BootIt:
return "BootIt";
case DOS_access:
return "DOS access";
case DOS_R_O:
return "DOS R/O";
case SpeedStor_1:
return "SpeedStor";
case BeOS_fs:
return "BeOS fs";
case EFI_GPT:
return "EFI GPT";
case EFI_FAT12_16_32:
return "EFI (FAT-12/16/32)";
case Linux_PA_RISC_boot:
return "Linux/PA-RISC boot";
case SpeedStor_2:
return "SpeedStor";
case SeppdStor_3:
return "SpeedStor";
case DOS_secondary:
return "DOS secondary";
case Linux_raid_autodetect:
return "Linux raid autodetect";
case LANstep:
return "LANstep";
case BBT:
return "BBT";
default:
break;
}
return QString();
}
QString DBlockPartition::guidTypeDescription(GUIDType type)
{
switch ((int)type) {
case Unused_None:
return "Unused entry";
case MBR_PS_None:
return "MBR partition scheme";
case EFI_SP_None:
return "EFI System partition";
case BIOS_BP_None:
return "BIOS boot partition";
case iFFS_None:
return "Intel Fast Flash (iFFS) partition (for Intel Rapid Start technology)";
case Sony_BP_None:
return "Sony boot partition";
case Lenove_BP_None:
return "Lenovo boot partition";
// Windows
case MSR_Win:
return "Microsoft Reserved Partition (MSR)";
case BasicData_Win:
return "Basic data partition of Windows";
case LDM_Win:
return "Logical Disk Manager (LDM) metadata partition of Windows";
case LDM_DP_Win:
return "Logical Disk Manager data partition of Windows";
case WRE_Win:
return "Windows Recovery Environment";
case IBM_GPFS_Win:
return "IBM General Parallel File System (GPFS) partition of Windows";
case SSP_Win:
return "Storage Spaces partition of Windows";
// HP-UX
case DP_HPUX:
return "Data partition of HP-UX";
case SP_HPUX:
return "Service Partition of HP-UX";
// Linux
case LFD_Linux:
return "Linux filesystem data";
case RAID_P_Linux:
return "RAID partition of Linux";
case RP_x86_Linux:
return "Root partition (x86) of Linux";
case RP_x86_64_Linux:
return "Root partition (x86-64) of Linux";
case RP_32bit_ARM_Linux:
return "Root partition (32-bit ARM) of Linux";
case RP_64bit_ARM_Linux:
return "Root partition (64-bit ARM/AArch64) of Linux";
case SP_Linux:
return "Swap partition of Linux";
case LVM_P_Linux:
return "Logical Volume Manager (LVM) partition of Linux";
case Home_P_Linux:
return "/home partition of Linux";
case Srv_P_Linux:
return "/srv (server data) partition of Linux";
case Plain_DC_P_Linux:
return "Plain dm-crypt partition of Linux";
case LUKS_P_Linux:
return "LUKS partition of Linux";
case Reserved_Linux:
return "Reserved of Linux";
// FreeBSD
case BP_FreeBSD:
return "Boot partition of FreeBSD";
case DP_FreeBSD:
return "Data partition of FreeBSD";
case SP_FreeBSD:
return "Swap partition of FreeBSD";
case UFS_P_FreeBSD:
return "Unix File System (UFS) partition of FreeBSD";
case VVM_P_FreeBSD:
return "Vinum volume manager partition of FreeBSD";
case ZFS_P_FreeBSD:
return "ZFS partition of FreeBSD";
// macOS Darwin
case HFS_PLUS_P_Mac:
return "Hierarchical File System Plus (HFS+) partition of macOS";
case UFS_Mac:
return "Apple UFS";
case ZFS_Mac:
return "ZFS of macOS(Or /usr partition of Solaris illumos)";
case RAID_P_Mac:
return "Apple RAID partition";
case RAID_P_Offline_Mac:
return "Apple RAID partition, offline";
case BP_Mac:
return "Apple Boot partition (Recovery HD)";
case Label_Mac:
return "Apple Label";
case TV_RP_Mac:
return "Apple TV Recovery partition";
case CS_P_Mac:
return "Apple Core Storage (i.e. Lion FileVault) partition";
case SoftRAID_Status_Mac:
return "SoftRAID_Status of macOS";
case SoftRAID_Scratch_Mac:
return "SoftRAID_Scratch of macOS";
case SoftRAID_Volume_Mac:
return "SoftRAID_Volume of macOS";
case SoftRAID_Cache_Mac:
return "SoftRAID_Cache of macOS";
// Solaris illumos
case BP_Solaris:
return "Boot partition of Solaris illumos";
case RP_Solaris:
return "Root partition of Solaris illumos";
case SP_Solaris:
return "Swap partition of Solaris illumos";
case Backup_P_Solaris:
return "Backup partition of Solaris illumos";
case Var_P_Solaris:
return "/var partition of Solaris illumos";
case Home_P_Solaris:
return "/home partition of Solaris illumos";
case AS_Solaris:
return "Alternate sector os Solaris illumos";
case Reserved_Solaris:
return "Reserved partition os Solaris illumos";
// NetBSD
case SP_NetBSD:
return "Swap partition of NetBSD";
case FFS_P_NetBSD:
return "FFS partition of NetBSD";
case LFS_P_NetBSD:
return "LFS partition of NetBSD";
case RAID_P_NetBSD:
return "RAID partition of NetBSD";
case CP_NetBSD:
return "Concatenated partition of NetBSD";
case EP_NetBSD:
return "Encrypted partition of NetBSD";
// ChromeOS
case Kernel_ChromeOS:
return "ChromeOS kernel";
case Rootfs_ChromeOS:
return "ChromeOS rootfs";
case FU_ChromeOS:
return "ChromeOS future use";
// Haiku
case BFS_Haiku:
return "Haiku BFS";
// MidnightBSD
case BP_MidnightBSD:
return "Boot partition of MidnightBSD";
case DP_MidnightBSD:
return "Data partition of MidnightBSD";
case SP_MidnightBSD:
return "Swap partition of MidnightBSD";
case UFS_P_MidnightBSD:
return "Unix File System (UFS) partition of MidnightBSD";
case VVM_P_MidnightBSD:
return "Vinum volume manager partition of MidnightBSD";
case ZFS_P_MidnightBSD:
return "ZFS partition of MidnightBSD";
// Ceph
case Journal_Ceph:
return "Ceph Journal";
case DC_EJ_Ceph:
return "Ceph dm-crypt Encrypted Journal";
case OSD_Ceph:
return "Ceph OSD";
case DC_OSD_Ceph:
return "Ceph dm-crypt OSD";
case DIC_Ceph:
return "Ceph disk in creation";
case DC_DIC_Ceph:
return "Ceph dm-crypt disk in creation";
// OpenBSD
case DP_OpenBSD:
return "Data partition of OpenBSD";
// QNX
case PAFS_QNX:
return "Power-safe (QNX6) file system of QNX";
// Plan9
case Partition_Plan9:
return "Plan 9 partition of Plan9";
// VMware ESX
case Vmkcore_VMware:
return "vmkcore (coredump partition)";
case VMFS_VMware:
return "VMFS filesystem partition";
case Reserved_VMware:
return "VMware Reserved";
// Android-IA
case Bootloader_Android:
return "Android Bootloader";
case Bottloader2_Android:
return "Android Bootloader2";
case Boot_Android:
return "Android Boot";
case Recovery_Android:
return "Android Recovery";
case Misc_Android:
return "Android Misc";
case Metadata_Android:
return "Android Metadata";
case System_Android:
return "Android System";
case Cache_Android:
return "Android Cache";
case Data_Android:
return "Android Data";
case Persistent_Android:
return "Android Persistent";
case Factory_Android:
return "Android Factory";
case Fastboot_Android:
return "Android Fastboot";
case OEM_Android:
return "Android OEM";
// Open Network Install Environment (ONIE)
case Boot_ONIE:
return "Open Network Install Environment Boot";
case Config_ONIE:
return "Open Network Install Environment Config";
// PowerPC
case Boot_PowerPC:
return "PowerPC PReP boot";
// freedesktop.org OSes (Linux, etc.)
case SBLC_OSes:
return "Shared boot loader configuration of freedesktop.org OSes (Linux, etc.)";
// Atari TOS
case BD_P_Atari:
return "Basic data partition (GEM, BGM, F32) of Atari TOS";
case UnknowUUID:
return "Unknow GUID";
}
return "Invalid GUID type";
}
void DBlockPartition::deletePartition(const QVariantMap &options)
{
Q_D(DBlockPartition);
qDebug() << "Deleting partition:" << d->dbus->path() << "options:" << options;
auto r = d->dbus->Delete(options);
r.waitForFinished();
if (r.isError()) {
qWarning() << "Failed to delete partition:" << d->dbus->path() << "error:" << r.error().message();
}
}
void DBlockPartition::resize(qulonglong size, const QVariantMap &options)
{
Q_D(DBlockPartition);
qDebug() << "Resizing partition:" << d->dbus->path() << "new size:" << size << "options:" << options;
auto r = d->dbus->Resize(size, options);
r.waitForFinished();
if (r.isError()) {
qWarning() << "Failed to resize partition:" << d->dbus->path() << "error:" << r.error().message();
}
}
void DBlockPartition::setFlags(qulonglong flags, const QVariantMap &options)
{
Q_D(DBlockPartition);
qDebug() << "Setting partition flags:" << d->dbus->path() << "flags:" << flags << "options:" << options;
auto r = d->dbus->SetFlags(flags, options);
r.waitForFinished();
if (r.isError()) {
qWarning() << "Failed to set partition flags:" << d->dbus->path() << "error:" << r.error().message();
}
}
void DBlockPartition::setName(const QString &name, const QVariantMap &options)
{
Q_D(DBlockPartition);
qDebug() << "Setting partition name:" << d->dbus->path() << "new name:" << name << "options:" << options;
auto r = d->dbus->SetName(name, options);
r.waitForFinished();
if (r.isError()) {
qWarning() << "Failed to set partition name:" << d->dbus->path() << "error:" << r.error().message();
}
}
void DBlockPartition::setType(const QString &type, const QVariantMap &options)
{
Q_D(DBlockPartition);
qDebug() << "Setting partition type:" << d->dbus->path() << "new type:" << type << "options:" << options;
auto r = d->dbus->SetType(type, options);
r.waitForFinished();
if (r.isError()) {
qWarning() << "Failed to set partition type:" << d->dbus->path() << "error:" << r.error().message();
}
}
void DBlockPartition::setType(DBlockPartition::Type type, const QVariantMap &options)
{
if (type == Unknow) {
qWarning() << "Invalid partition type:" << type;
return;
}
QString type_string = QString::asprintf("0x%.2s", QByteArray::number(type, 16).constData());
type_string.replace(" ", "0");
setType(type_string, options);
}
/*!
* \class DBlockPartition
* \inmodule dde-file-manager-lib
*
* \brief DBlockPartition class comment goes here
*
* \sa DDiskManager::createBlockPartition
*/
DBlockPartition::DBlockPartition(const QString &path, QObject *parent)
: DBlockDevice(*new DBlockPartitionPrivate(this), path, parent)
{
d_func()->dbus = new OrgFreedesktopUDisks2PartitionInterface(UDISKS2_SERVICE, path, QDBusConnection::systemBus(), this);
connect(this, &DBlockPartition::typeChanged, this, &DBlockPartition::eTypeChanged);
connect(this, &DBlockPartition::UUIDChanged, this, &DBlockPartition::guidTypeChanged);
}
linuxdeepin-udisks2-qt6-d816036/dblockpartition.h 0000664 0000000 0000000 00000021002 15074160566 0021753 0 ustar 00root root 0000000 0000000 // SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later
#ifndef DBLOCKPARTITION_H
#define DBLOCKPARTITION_H
#include
class DBlockPartitionPrivate;
class DBlockPartition : public DBlockDevice
{
Q_OBJECT
Q_DECLARE_PRIVATE(DBlockPartition)
Q_PROPERTY(qulonglong flags READ flags NOTIFY flagsChanged)
Q_PROPERTY(bool isContained READ isContained NOTIFY isContainedChanged)
Q_PROPERTY(bool isContainer READ isContainer NOTIFY isContainerChanged)
Q_PROPERTY(QString name READ name NOTIFY nameChanged)
Q_PROPERTY(uint number READ number NOTIFY numberChanged)
Q_PROPERTY(qulonglong offset READ offset NOTIFY offsetChanged)
Q_PROPERTY(qulonglong size READ size NOTIFY sizeChanged)
Q_PROPERTY(QString table READ table)
Q_PROPERTY(QString type READ type NOTIFY typeChanged)
// MBR Partition Type
Q_PROPERTY(Type eType READ eType NOTIFY eTypeChanged)
// GPT Partition Type
Q_PROPERTY(GUIDType guidType READ guidType NOTIFY guidTypeChanged)
Q_PROPERTY(QString UUID READ UUID NOTIFY UUIDChanged)
public:
enum Type {
Empty = 0x0,
FAT12Type = 0x1,
XENIX_root = 0x2,
XENIX_usr = 0x3,
FAT16_Less_32M = 0x4,
Extended = 0x5,
FAT16Type = 0x6,
HPFS_NTFS = 0x7,
AIX = 0x8,
AIX_bootable = 0x9,
OS2_Boot_Manager = 0xa,
Win95_FAT32 = 0xb,
Win95_FAT32_LBA = 0xc,
Win95_FAT16_LBA = 0xe,
Win95_Extended_LBA = 0xf,
OPUS = 0x10,
Hidden_FAT12 = 0x11,
Compaq_diagnostics = 0x12,
Hidden_FAT16_Less_32M = 0x14,
Hidden_FAT16 = 0x16,
Hidden_HPFS_or_NTFS = 0x17,
AST_SmartSleep = 0x18,
Hidden_Win95_FAT32 = 0x1b,
Hidden_Win95_FAT32_LBA = 0x1c,
Hidden_Win95_FAT16_LBA = 0x1e,
NEC_DOS = 0x24,
Plan9 = 0x39,
PartitionMagic_recovery = 0x3c,
Venix_80286 = 0x40,
PPC_PReP_Boot = 0x41,
SFS = 0x42,
QNX4_dot_x = 0x4d,
QNX4_dot_x_2nd_part = 0x4e,
QNX4_dot_x_3rd_part = 0x4f,
OnTrack_DM = 0x50,
OnTrack_DM6_Aux1 = 0x51,
CP_M = 0x52,
OnTrack_DM6_Aux3 = 0x53,
OnTrackDM6 = 0x54,
EZ_Drive = 0x55,
Golden_Bow = 0x56,
Priam_Edisk = 0x5c,
SpeedStor = 0x61,
GNU_HURD_or_SysV = 0x63,
Novell_Netware_286 = 0x64,
Novell_Netware_386 = 0x65,
DiskSecure_Multi_Boot = 0x70,
PC_IX = 0x75,
Old_Minix = 0x80,
Minix_old_Linux = 0x81,
Linux_swap = 0x82,
Linux = 0x83,
OS2_hidden_C_drive = 0x84,
Linux_extended = 0x85,
NTFS_volume_set_1 = 0x86,
NTFS_volume_set_2 = 0x87,
Linux_LVM = 0x8e,
Amoeba = 0x93,
Amoeba_BBT = 0x94,
BSD_OS = 0x9f,
IBM_Thinkpad_hibernation = 0xa0,
FreeBSD = 0xa5,
OpenBSD = 0xa6,
NeXTSTEP = 0xa7,
NetBSD = 0xa8,
BSDI_fs = 0xa9,
BSDI_swap = 0xb7,
Boot_Wizard_hidden = 0xb8,
DRDOS_sec_FAT12 = 0xbb,
DRDOS_sec_FAT16_Less_32M = 0xc1,
DRDOS_sec_FAT16 = 0xc4,
DRDOS_sec_extend = 0xc5,
Syrinx = 0xc6,
Non_FS_data = 0xc7,
Multiuser_DOS_extend = 0xd5,
CP_M_CTOS_dot_dot_dot = 0xda,
Dell_Utility = 0xdb,
BootIt = 0xde,
DOS_access = 0xdf,
DOS_R_O = 0xe1,
SpeedStor_1 = 0xe3,
BeOS_fs = 0xe4,
EFI_GPT = 0xeb,
EFI_FAT12_16_32 = 0xee,
Linux_PA_RISC_boot = 0xef,
SpeedStor_2 = 0xf0,
SeppdStor_3 = 0xf4,
DOS_secondary = 0xf2,
Linux_raid_autodetect = 0xfd,
LANstep = 0xfe,
BBT = 0xff,
Unknow
};
Q_ENUM(Type)
enum GUIDType {
InvalidUUID = 0,
GUIDTypeBegin = 1,
// None
Unused_None = GUIDTypeBegin,
MBR_PS_None = 2,
EFI_SP_None = 3,
BIOS_BP_None = 4,
iFFS_None = 5,
Sony_BP_None = 6,
Lenove_BP_None = 7,
// Windows
MSR_Win = 8,
BasicData_Win = 9,
LDM_Win = 10,
LDM_DP_Win = 11,
WRE_Win = 12,
IBM_GPFS_Win = 13,
SSP_Win = 14,
// HP-UX
DP_HPUX = 15,
SP_HPUX = 16,
// Linux
LFD_Linux = 17,
RAID_P_Linux = 18,
RP_x86_Linux = 19,
RP_x86_64_Linux = 20,
RP_32bit_ARM_Linux = 21,
RP_64bit_ARM_Linux = 22,
SP_Linux = 23,
LVM_P_Linux = 24,
Home_P_Linux = 25,
Srv_P_Linux = 26,
Plain_DC_P_Linux = 27,
LUKS_P_Linux = 28,
Reserved_Linux = 29,
// FreeBSD
BP_FreeBSD = 30,
DP_FreeBSD = 31,
SP_FreeBSD = 32,
UFS_P_FreeBSD = 33,
VVM_P_FreeBSD = 34,
ZFS_P_FreeBSD = 35,
// macOS Darwin
HFS_PLUS_P_Mac = 36,
UFS_Mac = 37,
ZFS_Mac = 38,
RAID_P_Mac = 39,
RAID_P_Offline_Mac = 40,
BP_Mac = 41,
Label_Mac = 42,
TV_RP_Mac = 43,
CS_P_Mac = 44,
SoftRAID_Status_Mac = 45,
SoftRAID_Scratch_Mac = 46,
SoftRAID_Volume_Mac = 47,
SoftRAID_Cache_Mac = 48,
// Solaris illumos
BP_Solaris = 49,
RP_Solaris = 50,
SP_Solaris = 51,
Backup_P_Solaris = 52,
Usr_P_Solaris = ZFS_Mac,
Var_P_Solaris = 53,
Home_P_Solaris = 54,
AS_Solaris = 55,
Reserved_Solaris = 56,
// NetBSD
SP_NetBSD = 57,
FFS_P_NetBSD = 58,
LFS_P_NetBSD = 59,
RAID_P_NetBSD = 60,
CP_NetBSD = 61,
EP_NetBSD = 62,
// ChromeOS
Kernel_ChromeOS = 63,
Rootfs_ChromeOS = 64,
FU_ChromeOS = 65,
// Haiku
BFS_Haiku = 66,
// MidnightBSD
BP_MidnightBSD = 67,
DP_MidnightBSD = 68,
SP_MidnightBSD = 69,
UFS_P_MidnightBSD = 70,
VVM_P_MidnightBSD = 71,
ZFS_P_MidnightBSD = 72,
// Ceph
Journal_Ceph = 73,
DC_EJ_Ceph = 74,
OSD_Ceph = 75,
DC_OSD_Ceph = 76,
DIC_Ceph = 77,
DC_DIC_Ceph = 78,
// OpenBSD
DP_OpenBSD = 79,
// QNX
PAFS_QNX = 80,
// Plan9
Partition_Plan9 = 81,
// VMware ESX
Vmkcore_VMware = 82,
VMFS_VMware = 83,
Reserved_VMware = 84,
// Android-IA
Bootloader_Android = 85,
Bottloader2_Android = 86,
Boot_Android = 87,
Recovery_Android = 88,
Misc_Android = 89,
Metadata_Android = 90,
System_Android = 91,
Cache_Android = 92,
Data_Android = 93,
Persistent_Android = 94,
Factory_Android = 95,
Fastboot_Android = 96,
OEM_Android = 97,
// Open Network Install Environment (ONIE)
Boot_ONIE = 98,
Config_ONIE = 99,
// PowerPC
Boot_PowerPC = 100,
// freedesktop.org OSes (Linux, etc.)
SBLC_OSes = 101,
// Atari TOS
BD_P_Atari = 102,
GUIDTypeEnd,
UnknowUUID
};
Q_ENUM(GUIDType)
qulonglong flags() const;
bool isContained() const;
bool isContainer() const;
QString name() const;
uint number() const;
qulonglong offset() const;
qulonglong size() const;
QString table() const;
QString type() const;
Type eType() const;
GUIDType guidType() const;
QString UUID() const;
static QString typeDescription(Type type);
static QString guidTypeDescription(GUIDType type);
public Q_SLOTS: // METHODS
void deletePartition(const QVariantMap &options);
void resize(qulonglong size, const QVariantMap &options);
void setFlags(qulonglong flags, const QVariantMap &options);
void setName(const QString &name, const QVariantMap &options);
void setType(const QString &type, const QVariantMap &options);
void setType(Type type, const QVariantMap &options);
Q_SIGNALS:
void flagsChanged(qulonglong flags);
void isContainedChanged(bool isContained);
void isContainerChanged(bool isContainer);
void nameChanged(const QString &name);
void numberChanged(uint number);
void offsetChanged(qulonglong offset);
void sizeChanged(qulonglong size);
void typeChanged(const QString &type);
void eTypeChanged();
void UUIDChanged(const QString &UUID);
void guidTypeChanged();
private:
explicit DBlockPartition(const QString &path, QObject *parent = nullptr);
friend class DDiskManager;
};
#endif // DBLOCKPARTITION_H
linuxdeepin-udisks2-qt6-d816036/ddiskdevice.cpp 0000664 0000000 0000000 00000014703 15074160566 0021406 0 ustar 00root root 0000000 0000000 // SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later
#include "ddiskdevice.h"
#include "udisks2_interface.h"
#include
class DDiskDevicePrivate
{
public:
OrgFreedesktopUDisks2DriveInterface *dbus = nullptr;
QDBusError err;
};
DDiskDevice::DDiskDevice(const QString &path, QObject *parent)
: QObject(parent)
, d_ptr(new DDiskDevicePrivate())
{
qDebug() << "Creating DDiskDevice for path:" << path;
d_ptr->dbus = new OrgFreedesktopUDisks2DriveInterface(UDISKS2_SERVICE, path, QDBusConnection::systemBus(), this);
}
DDiskDevice::~DDiskDevice()
{
qDebug() << "DDiskDevice destroyed:" << path();
}
QString DDiskDevice::path() const
{
Q_D(const DDiskDevice);
qDebug() << "Getting disk device path:" << d->dbus->path();
return d->dbus->path();
}
bool DDiskDevice::canPowerOff() const
{
qDebug() << "Checking if disk device can power off:" << path();
return d_ptr->dbus->canPowerOff();
}
QVariantMap DDiskDevice::configuration() const
{
qDebug() << "Getting disk device configuration:" << path();
return d_ptr->dbus->configuration();
}
QString DDiskDevice::connectionBus() const
{
qDebug() << "Getting disk device connection bus:" << path();
return d_ptr->dbus->connectionBus();
}
bool DDiskDevice::ejectable() const
{
qDebug() << "Checking if disk device is ejectable:" << path();
return d_ptr->dbus->ejectable();
}
QString DDiskDevice::id() const
{
qDebug() << "Getting disk device ID:" << path();
return d_ptr->dbus->id();
}
QString DDiskDevice::media() const
{
qDebug() << "Getting disk device media:" << path();
return d_ptr->dbus->media();
}
bool DDiskDevice::mediaAvailable() const
{
qDebug() << "Checking if disk device media is available:" << path();
return d_ptr->dbus->mediaAvailable();
}
bool DDiskDevice::mediaChangeDetected() const
{
qDebug() << "Checking if disk device media change is detected:" << path();
return d_ptr->dbus->mediaChangeDetected();
}
QStringList DDiskDevice::mediaCompatibility() const
{
qDebug() << "Getting disk device media compatibility:" << path();
return d_ptr->dbus->mediaCompatibility();
}
bool DDiskDevice::mediaRemovable() const
{
qDebug() << "Checking if disk device media is removable:" << path();
return d_ptr->dbus->mediaRemovable();
}
QString DDiskDevice::model() const
{
qDebug() << "Getting disk device model:" << path();
return d_ptr->dbus->model();
}
bool DDiskDevice::optical() const
{
qDebug() << "Checking if disk device is optical:" << path();
return d_ptr->dbus->optical();
}
bool DDiskDevice::opticalBlank() const
{
qDebug() << "Checking if disk device is optical blank:" << path();
return d_ptr->dbus->opticalBlank();
}
uint DDiskDevice::opticalNumAudioTracks() const
{
qDebug() << "Getting disk device optical number of audio tracks:" << path();
return d_ptr->dbus->opticalNumAudioTracks();
}
uint DDiskDevice::opticalNumDataTracks() const
{
qDebug() << "Getting disk device optical number of data tracks:" << path();
return d_ptr->dbus->opticalNumDataTracks();
}
uint DDiskDevice::opticalNumSessions() const
{
qDebug() << "Getting disk device optical number of sessions:" << path();
return d_ptr->dbus->opticalNumSessions();
}
uint DDiskDevice::opticalNumTracks() const
{
qDebug() << "Getting disk device optical number of tracks:" << path();
return d_ptr->dbus->opticalNumTracks();
}
bool DDiskDevice::removable() const
{
qDebug() << "Checking if disk device is removable:" << path();
return d_ptr->dbus->removable();
}
QString DDiskDevice::revision() const
{
qDebug() << "Getting disk device revision:" << path();
return d_ptr->dbus->revision();
}
int DDiskDevice::rotationRate() const
{
qDebug() << "Getting disk device rotation rate:" << path();
return d_ptr->dbus->rotationRate();
}
QString DDiskDevice::seat() const
{
qDebug() << "Getting disk device seat:" << path();
return d_ptr->dbus->seat();
}
QString DDiskDevice::serial() const
{
qDebug() << "Getting disk device serial:" << path();
return d_ptr->dbus->serial();
}
QString DDiskDevice::siblingId() const
{
qDebug() << "Getting disk device sibling ID:" << path();
return d_ptr->dbus->siblingId();
}
qulonglong DDiskDevice::size() const
{
qDebug() << "Getting disk device size:" << path();
return d_ptr->dbus->size();
}
QString DDiskDevice::sortKey() const
{
qDebug() << "Getting disk device sort key:" << path();
return d_ptr->dbus->sortKey();
}
qulonglong DDiskDevice::timeDetected() const
{
qDebug() << "Getting disk device time detected:" << path();
return d_ptr->dbus->timeDetected();
}
qulonglong DDiskDevice::timeMediaDetected() const
{
qDebug() << "Getting disk device time media detected:" << path();
return d_ptr->dbus->timeMediaDetected();
}
QString DDiskDevice::vendor() const
{
qDebug() << "Getting disk device vendor:" << path();
return d_ptr->dbus->vendor();
}
QString DDiskDevice::WWN() const
{
qDebug() << "Getting disk device WWN:" << path();
return d_ptr->dbus->wWN();
}
QDBusError DDiskDevice::lastError() const
{
Q_D(const DDiskDevice);
qDebug() << "Getting disk device last error:" << path();
return d->err;
}
void DDiskDevice::eject(const QVariantMap &options)
{
Q_D(DDiskDevice);
qDebug() << "Ejecting disk device:" << path() << "with options:" << options;
auto r = d_ptr->dbus->Eject(options);
r.waitForFinished();
d->err = r.error();
if (r.isError()) {
qWarning() << "Failed to eject disk device:" << path() << "error:" << r.error().message();
}
}
void DDiskDevice::powerOff(const QVariantMap &options)
{
Q_D(DDiskDevice);
qDebug() << "Powering off disk device:" << path() << "with options:" << options;
auto r = d_ptr->dbus->PowerOff(options);
r.waitForFinished();
d->err = r.error();
if (r.isError()) {
qWarning() << "Failed to power off disk device:" << path() << "error:" << r.error().message();
}
}
void DDiskDevice::setConfiguration(const QVariantMap &value, const QVariantMap &options)
{
Q_D(DDiskDevice);
qDebug() << "Setting disk device configuration:" << path() << "value:" << value << "options:" << options;
auto r = d_ptr->dbus->SetConfiguration(value, options);
r.waitForFinished();
d->err = r.error();
if (r.isError()) {
qWarning() << "Failed to set disk device configuration:" << path() << "error:" << r.error().message();
}
}
linuxdeepin-udisks2-qt6-d816036/ddiskdevice.h 0000664 0000000 0000000 00000007251 15074160566 0021053 0 ustar 00root root 0000000 0000000 // SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later
#ifndef DDISKDEVICE_H
#define DDISKDEVICE_H
#include
#include
#include
class DDiskDevicePrivate;
class DDiskDevice : public QObject
{
Q_OBJECT
Q_DECLARE_PRIVATE(DDiskDevice)
Q_PROPERTY(QString path READ path CONSTANT FINAL)
Q_PROPERTY(bool canPowerOff READ canPowerOff CONSTANT FINAL)
Q_PROPERTY(QVariantMap configuration READ configuration CONSTANT FINAL)
Q_PROPERTY(QString connectionBus READ connectionBus CONSTANT FINAL)
Q_PROPERTY(bool ejectable READ ejectable CONSTANT FINAL)
Q_PROPERTY(QString id READ id CONSTANT FINAL)
Q_PROPERTY(QString media READ media CONSTANT FINAL)
Q_PROPERTY(bool mediaAvailable READ mediaAvailable CONSTANT FINAL)
Q_PROPERTY(bool mediaChangeDetected READ mediaChangeDetected CONSTANT FINAL)
Q_PROPERTY(QStringList mediaCompatibility READ mediaCompatibility CONSTANT FINAL)
Q_PROPERTY(bool mediaRemovable READ mediaRemovable CONSTANT FINAL)
Q_PROPERTY(QString model READ model CONSTANT FINAL)
Q_PROPERTY(bool optical READ optical CONSTANT FINAL)
Q_PROPERTY(bool opticalBlank READ opticalBlank CONSTANT FINAL)
Q_PROPERTY(uint opticalNumAudioTracks READ opticalNumAudioTracks CONSTANT FINAL)
Q_PROPERTY(uint opticalNumDataTracks READ opticalNumDataTracks CONSTANT FINAL)
Q_PROPERTY(uint opticalNumSessions READ opticalNumSessions CONSTANT FINAL)
Q_PROPERTY(uint opticalNumTracks READ opticalNumTracks CONSTANT FINAL)
Q_PROPERTY(bool removable READ removable CONSTANT FINAL)
Q_PROPERTY(QString revision READ revision CONSTANT FINAL)
Q_PROPERTY(int rotationRate READ rotationRate CONSTANT FINAL)
Q_PROPERTY(QString seat READ seat CONSTANT FINAL)
Q_PROPERTY(QString serial READ serial CONSTANT FINAL)
Q_PROPERTY(QString siblingId READ siblingId CONSTANT FINAL)
Q_PROPERTY(qulonglong size READ size CONSTANT FINAL)
Q_PROPERTY(QString sortKey READ sortKey CONSTANT FINAL)
Q_PROPERTY(qulonglong timeDetected READ timeDetected CONSTANT FINAL)
Q_PROPERTY(qulonglong timeMediaDetected READ timeMediaDetected CONSTANT FINAL)
Q_PROPERTY(QString vendor READ vendor CONSTANT FINAL)
Q_PROPERTY(QString WWN READ WWN CONSTANT FINAL)
public:
~DDiskDevice();
QString path() const;
bool canPowerOff() const;
QVariantMap configuration() const;
QString connectionBus() const;
bool ejectable() const;
QString id() const;
QString media() const;
bool mediaAvailable() const;
bool mediaChangeDetected() const;
QStringList mediaCompatibility() const;
bool mediaRemovable() const;
QString model() const;
bool optical() const;
bool opticalBlank() const;
uint opticalNumAudioTracks() const;
uint opticalNumDataTracks() const;
uint opticalNumSessions() const;
uint opticalNumTracks() const;
bool removable() const;
QString revision() const;
int rotationRate() const;
QString seat() const;
QString serial() const;
QString siblingId() const;
qulonglong size() const;
QString sortKey() const;
qulonglong timeDetected() const;
qulonglong timeMediaDetected() const;
QString vendor() const;
QString WWN() const;
QDBusError lastError() const;
public Q_SLOTS: // METHODS
void eject(const QVariantMap &options);
void powerOff(const QVariantMap &options);
void setConfiguration(const QVariantMap &value, const QVariantMap &options);
private:
explicit DDiskDevice(const QString &path, QObject *parent = nullptr);
QScopedPointer d_ptr;
friend class DDiskManager;
};
#endif // DDISKDEVICE_H
linuxdeepin-udisks2-qt6-d816036/ddiskmanager.cpp 0000664 0000000 0000000 00000041474 15074160566 0021566 0 ustar 00root root 0000000 0000000 // SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later
#include "ddiskmanager.h"
#include "udisks2_dbus_common.h"
#include "udisks2_interface.h"
#include "objectmanager_interface.h"
#include "dblockdevice.h"
#include "dblockpartition.h"
#include "ddiskdevice.h"
#include "dudisksjob.h"
#include
#include
#include
#include
#include
#include
const QString ManagerPath = "/org/freedesktop/UDisks2/Manager";
static int udisks2VersionCompare(const QString &version)
{
qDebug() << "Comparing UDisks2 version:" << version;
const QStringList &version_list = UDisks2::version().split(".");
const QStringList &v_v_list = version.split(".");
for (int i = 0; i < version_list.count(); ++i) {
if (v_v_list.count() <= i)
return -1;
int number_v = version_list[i].toInt();
int number_v_v = v_v_list[i].toInt();
if (number_v == number_v_v)
continue;
return number_v_v > number_v ? 1 : -1;
}
return v_v_list.count() > version_list.count() ? 1 : 0;
}
// 2.1.7版本的UDisks2在U盘插入时没有drive device added的信号
// 当收到block device added信号后,通过diskDeviceAddSignalFlag
// 判断此块设备对应的磁盘设备信号是否已发送,未发送时补发信号
// 风险:如果 diskDeviceAddSignalFlag 的值删除的不及时
// 会导致设备再插入时不会再有信号发出
static bool fixUDisks2DiskAddSignal()
{
static bool fix = udisks2VersionCompare("2.1.7.1") > 0;
qDebug() << "UDisks2 disk add signal fix status:" << fix;
return fix;
}
class DDiskManagerPrivate
{
public:
DDiskManagerPrivate(DDiskManager *qq);
void updateBlockDeviceMountPointsMap();
bool watchChanges = false;
QMap blockDeviceMountPointsMap;
QSet diskDeviceAddSignalFlag;
DDiskManager *q_ptr;
};
DDiskManagerPrivate::DDiskManagerPrivate(DDiskManager *qq)
: q_ptr(qq)
{
qDebug() << "Creating DDiskManagerPrivate";
}
void DDiskManagerPrivate::updateBlockDeviceMountPointsMap()
{
qDebug() << "Updating block device mount points map";
blockDeviceMountPointsMap.clear();
auto om = UDisks2::objectManager();
const QMap> &objects = om->GetManagedObjects().value();
auto begin = objects.constBegin();
while (begin != objects.constEnd()) {
const QString path = begin.key().path();
const QMap object = begin.value();
++begin;
if (!path.startsWith(QStringLiteral("/org/freedesktop/UDisks2/block_devices/"))) {
continue;
}
const QVariantMap &filesystem = object.value(QStringLiteral(UDISKS2_SERVICE ".Filesystem"));
if (filesystem.isEmpty()) {
continue;
}
blockDeviceMountPointsMap[path] = qdbus_cast(filesystem.value("MountPoints"));
}
}
void DDiskManager::onInterfacesAdded(const QDBusObjectPath &object_path, const QMap &interfaces_and_properties)
{
const QString &path = object_path.path();
const QString &path_drive = QStringLiteral("/org/freedesktop/UDisks2/drives/");
const QString &path_device = QStringLiteral("/org/freedesktop/UDisks2/block_devices/");
const QString &path_job = QStringLiteral("/org/freedesktop/UDisks2/jobs/");
Q_D(DDiskManager);
qDebug() << "Interfaces added for path:" << path;
if (path.startsWith(path_drive)) {
if (interfaces_and_properties.contains(QStringLiteral(UDISKS2_SERVICE ".Drive"))) {
if (fixUDisks2DiskAddSignal()) {
if (!d->diskDeviceAddSignalFlag.contains(path)) {
d->diskDeviceAddSignalFlag.insert(path);
// 防止flag未清除导致再也收不到此设备的信号
QTimer::singleShot(1000, this, [d, path] {
d->diskDeviceAddSignalFlag.remove(path);
});
qDebug() << "Disk device added:" << path;
Q_EMIT diskDeviceAdded(path);
}
} else {
qDebug() << "Disk device added:" << path;
Q_EMIT diskDeviceAdded(path);
}
}
} else if (path.startsWith(path_device)) {
if (interfaces_and_properties.contains(QStringLiteral(UDISKS2_SERVICE ".Block"))) {
if (fixUDisks2DiskAddSignal()) {
QScopedPointer bd(createBlockDevice(path));
const QString &drive = bd->drive();
if (!d->diskDeviceAddSignalFlag.contains(drive)) {
d->diskDeviceAddSignalFlag.insert(drive);
// 防止flag未清除导致再也收不到此设备的信号
QTimer::singleShot(1000, this, [d, drive] {
d->diskDeviceAddSignalFlag.remove(drive);
});
qDebug() << "Disk device added:" << drive;
Q_EMIT diskDeviceAdded(drive);
}
}
qDebug() << "Block device added:" << path;
Q_EMIT blockDeviceAdded(path);
}
if (interfaces_and_properties.contains(QStringLiteral(UDISKS2_SERVICE ".Filesystem"))) {
Q_D(DDiskManager);
d->blockDeviceMountPointsMap.remove(object_path.path());
qDebug() << "Filesystem added for block device:" << path;
Q_EMIT fileSystemAdded(path);
}
} else if (path.startsWith(path_job)) {
if (interfaces_and_properties.contains(QStringLiteral(UDISKS2_SERVICE ".Job"))) {
qDebug() << "Job added:" << path;
Q_EMIT jobAdded(path);
}
}
}
void DDiskManager::onInterfacesRemoved(const QDBusObjectPath &object_path, const QStringList &interfaces)
{
const QString &path = object_path.path();
qDebug() << "Interfaces removed for path:" << path;
Q_D(DDiskManager);
for (const QString &i : interfaces) {
if (i == QStringLiteral(UDISKS2_SERVICE ".Drive")) {
d->diskDeviceAddSignalFlag.remove(path);
qDebug() << "Disk device removed:" << path;
Q_EMIT diskDeviceRemoved(path);
} else if (i == QStringLiteral(UDISKS2_SERVICE ".Filesystem")) {
d->blockDeviceMountPointsMap.remove(object_path.path());
qDebug() << "Filesystem removed for block device:" << path;
Q_EMIT fileSystemRemoved(path);
} else if (i == QStringLiteral(UDISKS2_SERVICE ".Block")) {
qDebug() << "Block device removed:" << path;
Q_EMIT blockDeviceRemoved(path);
}
}
}
void DDiskManager::onPropertiesChanged(const QString &interface, const QVariantMap &changed_properties, const QDBusMessage &message)
{
Q_D(DDiskManager);
qDebug() << "Properties changed for interface:" << interface << "path:" << message.path();
const QString &path = message.path();
if (changed_properties.contains("Optical")) {
qDebug() << "Optical property changed for device:" << path;
Q_EMIT opticalChanged(path);
}
if (interface != UDISKS2_SERVICE ".Filesystem") {
return;
}
if (!changed_properties.contains("MountPoints")) {
return;
}
const QByteArrayList old_mount_points = d->blockDeviceMountPointsMap.value(path);
const QByteArrayList &new_mount_points = qdbus_cast(changed_properties.value("MountPoints"));
d->blockDeviceMountPointsMap[path] = new_mount_points;
qDebug() << "Mount points changed for block device:" << path << "old:" << old_mount_points << "new:" << new_mount_points;
Q_EMIT mountPointsChanged(path, old_mount_points, new_mount_points);
if (old_mount_points.isEmpty()) {
if (!new_mount_points.isEmpty()) {
qDebug() << "Mount added for block device:" << path << "mount point:" << new_mount_points.first();
Q_EMIT mountAdded(path, new_mount_points.first());
}
} else if (new_mount_points.isEmpty()) {
qDebug() << "Mount removed for block device:" << path << "mount point:" << old_mount_points.first();
Q_EMIT mountRemoved(path, old_mount_points.first());
}
}
/*!
* \class DDiskManager
* \inmodule dde-file-manager-lib
*
* \brief DDiskManager provide severial ways to manage devices and partitions.
*
* \sa DBlockPartition, DBlockDevice, UDiskDeviceInfo
*/
DDiskManager::DDiskManager(QObject *parent)
: QObject(parent)
, d_ptr(new DDiskManagerPrivate(this))
{
qDebug() << "Creating DDiskManager";
}
DDiskManager::~DDiskManager()
{
qDebug() << "DDiskManager destroyed";
}
static QStringList getDBusNodeNameList(const QString &service, const QString &path, const QDBusConnection &connection)
{
qDebug() << "Getting DBus node name list for service:" << service << "path:" << path;
QDBusInterface ud2(service, path, "org.freedesktop.DBus.Introspectable", connection);
QDBusReply reply = ud2.call("Introspect");
QXmlStreamReader xml_parser(reply.value());
QStringList nodeList;
while (!xml_parser.atEnd()) {
xml_parser.readNext();
if (xml_parser.tokenType() == QXmlStreamReader::StartElement
&& xml_parser.name().toString() == "node") {
const QString &name = xml_parser.attributes().value("name").toString();
if (!name.isEmpty()) {
nodeList << path + "/" + name;
}
}
}
return nodeList;
}
QStringList DDiskManager::blockDevices() const
{
return getDBusNodeNameList(UDISKS2_SERVICE, "/org/freedesktop/UDisks2/block_devices", QDBusConnection::systemBus());
}
QStringList DDiskManager::diskDevices() const
{
return getDBusNodeNameList(UDISKS2_SERVICE, "/org/freedesktop/UDisks2/drives", QDBusConnection::systemBus());
}
QStringList DDiskManager::blockDevices(QVariantMap options)
{
OrgFreedesktopUDisks2ManagerInterface udisksmgr(UDISKS2_SERVICE, ManagerPath, QDBusConnection::systemBus());
auto reply = udisksmgr.GetBlockDevices(options);
reply.waitForFinished();
QList resultList = reply.value();
QStringList dbusPaths;
for (const QDBusObjectPath &singleResult : resultList) {
dbusPaths << singleResult.path();
}
return dbusPaths;
}
bool DDiskManager::watchChanges() const
{
Q_D(const DDiskManager);
return d->watchChanges;
}
QString DDiskManager::objectPrintable(const QObject *object)
{
QString string;
QDebug debug(&string);
const QMetaObject *mo = object->metaObject();
debug << object;
int property_count = mo->propertyCount();
int base_property_count = QObject::staticMetaObject.propertyCount();
debug << "\n";
for (int i = base_property_count; i < property_count; ++i) {
const QMetaProperty &mp = mo->property(i);
debug.nospace() << mp.name() << ": " << mp.read(object);
debug << "\n";
}
return string;
}
DBlockDevice *DDiskManager::createBlockDevice(const QString &path, QObject *parent)
{
return new DBlockDevice(path, parent);
}
DBlockDevice *DDiskManager::createBlockDeviceByDevicePath(const QByteArray &path, QObject *parent) const
{
for (const QString &block : blockDevices()) {
DBlockDevice *device = new DBlockDevice(block, parent);
if (device->device() == path) {
return device;
}
device->deleteLater();
}
return nullptr;
}
DBlockPartition *DDiskManager::createBlockPartition(const QString &path, QObject *parent)
{
return new DBlockPartition(path, parent);
}
DBlockPartition *DDiskManager::createBlockPartitionByMountPoint(const QByteArray &path, QObject *parent) const
{
for (const QString &block : blockDevices()) {
DBlockPartition *device = new DBlockPartition(block, parent);
if (device->mountPoints().contains(path)) {
return device;
}
device->deleteLater();
}
return nullptr;
}
DBlockPartition *DDiskManager::createBlockPartition(const QStorageInfo &info, QObject *parent) const
{
return createBlockPartitionByMountPoint(info.rootPath().toLocal8Bit() + '\0', parent);
}
DDiskDevice *DDiskManager::createDiskDevice(const QString &path, QObject *parent)
{
return new DDiskDevice(path, parent);
}
DUDisksJob *DDiskManager::createJob(const QString &path, QObject *parent)
{
return new DUDisksJob(path, parent);
}
QStringList DDiskManager::supportedFilesystems()
{
OrgFreedesktopUDisks2ManagerInterface udisksmgr(UDISKS2_SERVICE, ManagerPath, QDBusConnection::systemBus());
return udisksmgr.supportedFilesystems();
}
QStringList DDiskManager::supportedEncryptionTypes()
{
OrgFreedesktopUDisks2ManagerInterface udisksmgr(UDISKS2_SERVICE, ManagerPath, QDBusConnection::systemBus());
return udisksmgr.supportedEncryptionTypes();
}
QStringList DDiskManager::resolveDevice(QVariantMap devspec, QVariantMap options)
{
OrgFreedesktopUDisks2ManagerInterface udisksmgr(UDISKS2_SERVICE, ManagerPath, QDBusConnection::systemBus());
QStringList ret;
auto devices = udisksmgr.ResolveDevice(devspec, options);
devices.waitForFinished();
if (!devices.isError()) {
for (auto &d : devices.value()) {
ret.push_back(d.path());
}
}
return ret;
}
QStringList DDiskManager::resolveDeviceNode(QString devnode, QVariantMap options)
{
return resolveDevice({{"path", QVariant(devnode)}}, options);
}
bool DDiskManager::canCheck(const QString &type, QString *requiredUtil)
{
OrgFreedesktopUDisks2ManagerInterface udisksmgr(UDISKS2_SERVICE, ManagerPath, QDBusConnection::systemBus());
auto r = udisksmgr.CanCheck(type);
r.waitForFinished();
if (r.isError()) {
return false;
}
if (requiredUtil) {
*requiredUtil = r.value().second;
}
return r.value().first;
}
bool DDiskManager::canFormat(const QString &type, QString *requiredUtil)
{
OrgFreedesktopUDisks2ManagerInterface udisksmgr(UDISKS2_SERVICE, ManagerPath, QDBusConnection::systemBus());
auto r = udisksmgr.CanFormat(type);
r.waitForFinished();
if (r.isError()) {
return false;
}
if (requiredUtil) {
*requiredUtil = r.value().second;
}
return r.value().first;
}
bool DDiskManager::canRepair(const QString &type, QString *requiredUtil)
{
OrgFreedesktopUDisks2ManagerInterface udisksmgr(UDISKS2_SERVICE, ManagerPath, QDBusConnection::systemBus());
auto r = udisksmgr.CanRepair(type);
r.waitForFinished();
if (r.isError()) {
return false;
}
if (requiredUtil) {
*requiredUtil = r.value().second;
}
return r.value().first;
}
bool DDiskManager::canResize(const QString &type, QString *requiredUtil)
{
OrgFreedesktopUDisks2ManagerInterface udisksmgr(UDISKS2_SERVICE, ManagerPath, QDBusConnection::systemBus());
auto r = udisksmgr.CanRepair(type);
r.waitForFinished();
if (r.isError()) {
return false;
}
if (requiredUtil) {
*requiredUtil = r.value().second;
}
return r.value().first;
}
QString DDiskManager::loopSetup(int fd, QVariantMap options)
{
OrgFreedesktopUDisks2ManagerInterface udisksmgr(UDISKS2_SERVICE, ManagerPath, QDBusConnection::systemBus());
QDBusUnixFileDescriptor dbusfd;
dbusfd.setFileDescriptor(fd);
auto r = udisksmgr.LoopSetup(dbusfd, options);
r.waitForFinished();
return r.value().path();
}
QDBusError DDiskManager::lastError()
{
return QDBusConnection::systemBus().lastError();
}
void DDiskManager::setWatchChanges(bool watchChanges)
{
Q_D(DDiskManager);
if (d->watchChanges == watchChanges)
return;
OrgFreedesktopDBusObjectManagerInterface *object_manager = UDisks2::objectManager();
auto sc = QDBusConnection::systemBus();
if (watchChanges) {
connect(object_manager, &OrgFreedesktopDBusObjectManagerInterface::InterfacesAdded,
this, &DDiskManager::onInterfacesAdded);
connect(object_manager, &OrgFreedesktopDBusObjectManagerInterface::InterfacesRemoved,
this, &DDiskManager::onInterfacesRemoved);
d->updateBlockDeviceMountPointsMap();
sc.connect(UDISKS2_SERVICE, QString(), "org.freedesktop.DBus.Properties", "PropertiesChanged",
this, SLOT(onPropertiesChanged(const QString &, const QVariantMap &, const QDBusMessage&)));
} else {
disconnect(object_manager, &OrgFreedesktopDBusObjectManagerInterface::InterfacesAdded,
this, &DDiskManager::onInterfacesAdded);
disconnect(object_manager, &OrgFreedesktopDBusObjectManagerInterface::InterfacesRemoved,
this, &DDiskManager::onInterfacesRemoved);
d->blockDeviceMountPointsMap.clear();
sc.disconnect(UDISKS2_SERVICE, QString(), "org.freedesktop.DBus.Properties", "PropertiesChanged",
this, SLOT(onPropertiesChanged(const QString &, const QVariantMap &, const QDBusMessage&)));
}
}
linuxdeepin-udisks2-qt6-d816036/ddiskmanager.h 0000664 0000000 0000000 00000006760 15074160566 0021232 0 ustar 00root root 0000000 0000000 // SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later
#ifndef DDISKMANAGER_H
#define DDISKMANAGER_H
#include
#include
#include
QT_BEGIN_NAMESPACE
class QDBusObjectPath;
class QStorageInfo;
QT_END_NAMESPACE
class DBlockDevice;
class DBlockPartition;
class DDiskDevice;
class DUDisksJob;
class DDiskManagerPrivate;
class DDiskManager : public QObject
{
Q_OBJECT
Q_DECLARE_PRIVATE(DDiskManager)
Q_PROPERTY(bool watchChanges READ watchChanges WRITE setWatchChanges)
public:
explicit DDiskManager(QObject *parent = nullptr);
~DDiskManager();
Q_DECL_DEPRECATED_X("Use the static variant instead") QStringList blockDevices() const;
QStringList diskDevices() const;
static QStringList blockDevices(QVariantMap options);
bool watchChanges() const;
static QString objectPrintable(const QObject *object);
static DBlockDevice *createBlockDevice(const QString &path, QObject *parent = nullptr);
// device 路径以 '\0' 结尾
DBlockDevice *createBlockDeviceByDevicePath(const QByteArray &path, QObject *parent = nullptr) const;
static DBlockPartition *createBlockPartition(const QString &path, QObject *parent = nullptr);
// 挂载点以 '\0' 结尾
DBlockPartition *createBlockPartitionByMountPoint(const QByteArray &path, QObject *parent = nullptr) const;
DBlockPartition *createBlockPartition(const QStorageInfo &info, QObject *parent = nullptr) const;
static DDiskDevice *createDiskDevice(const QString &path, QObject *parent = nullptr);
static DUDisksJob *createJob(const QString &path, QObject *parent = nullptr);
static QStringList supportedFilesystems();
static QStringList supportedEncryptionTypes();
static QStringList resolveDevice(QVariantMap devspec, QVariantMap options);
static QStringList resolveDeviceNode(QString devnode, QVariantMap options);
static bool canCheck(const QString &type, QString *requiredUtil = nullptr);
static bool canFormat(const QString &type, QString *requiredUtil = nullptr);
static bool canRepair(const QString &type, QString *requiredUtil = nullptr);
static bool canResize(const QString &type, QString *requiredUtil = nullptr);
static QString loopSetup(int fd, QVariantMap options);
static QDBusError lastError();
public Q_SLOTS:
void setWatchChanges(bool watchChanges);
Q_SIGNALS:
void blockDeviceAdded(const QString &path);
void blockDeviceRemoved(const QString &path);
void diskDeviceAdded(const QString &path);
void diskDeviceRemoved(const QString &path);
void fileSystemAdded(const QString &blockDevicePath);
void fileSystemRemoved(const QString &blockDevicePath);
void mountAdded(const QString &blockDevicePath, const QByteArray &mountPoint);
void mountRemoved(const QString &blockDevicePath, const QByteArray &mountPoint);
void mountPointsChanged(const QString &blockDevicePath, const QByteArrayList &oldMountPoints, const QByteArrayList &newMountPoints);
void jobAdded(const QString &jobPath);
void opticalChanged(const QString &path);
private:
QScopedPointer d_ptr;
private Q_SLOTS:
void onInterfacesAdded(const QDBusObjectPath &, const QMap &);
void onInterfacesRemoved(const QDBusObjectPath &object_path, const QStringList &interfaces);
void onPropertiesChanged(const QString &interface, const QVariantMap &changed_properties, const QDBusMessage &message);
};
#endif // DDISKMANAGER_H
linuxdeepin-udisks2-qt6-d816036/debian/ 0000775 0000000 0000000 00000000000 15074160566 0017641 5 ustar 00root root 0000000 0000000 linuxdeepin-udisks2-qt6-d816036/debian/changelog 0000664 0000000 0000000 00000000776 15074160566 0021525 0 ustar 00root root 0000000 0000000 udisks2-qt6 (6.0.1) unstable; urgency=medium
* Update version to 6.0.1
-- zhanghongyuan Thu, 16 Oct 2024 19:40:00 +0800
udisks2-qt6 (6.0.0) unstable; urgency=medium
* Initial release for Qt6 version.
* Port from udisks2-qt5 to udisks2-qt6.
-- Zhang Sheng Tue, 31 Dec 2024 11:26:00 +0800
udisks2-qt6 (0.0.1) unstable; urgency=medium
* Initial release.
-- Deepin Package Builder Tue, 26 Feb 2019 11:46:47 +0800
linuxdeepin-udisks2-qt6-d816036/debian/control 0000664 0000000 0000000 00000001524 15074160566 0021246 0 ustar 00root root 0000000 0000000 Source: udisks2-qt6
Section: libs
Priority: optional
Maintainer: Deepin Package Builder
Build-Depends: debhelper-compat (= 13),
cmake,
qt6-base-dev,
qt6-base-private-dev,
pkg-config
Standards-Version: 4.5.1
Homepage: https://github.com/linuxdeepin/udisks2-qt6
Package: libudisks2-qt6
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: UDisks2 library with Qt6
UDisks2 library developed by Qt6.
.
This package contains the shared libraries.
Package: libudisks2-qt6-dev
Section: libdevel
Architecture: any
Depends: libudisks2-qt6 (= ${binary:Version}),
${misc:Depends},
qt6-base-dev
Description: UDisks2 library with Qt6 - development files
UDisks2 library developed by Qt6.
.
This package contains the development files.
linuxdeepin-udisks2-qt6-d816036/debian/copyright 0000664 0000000 0000000 00000001716 15074160566 0021601 0 ustar 00root root 0000000 0000000 Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: udisks2-qt6
Source: https://github.com/linuxdeepin/udisks2-qt6
Files: *
Copyright: 2018-2024 Deepin.Inc
License: GPL-3+
This package is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
.
This package is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with this program. If not, see
.
On Debian systems, the complete text of the GNU General
Public License version 3 can be found in "/usr/share/common-licenses/GPL-3".
linuxdeepin-udisks2-qt6-d816036/debian/libudisks2-qt6-dev.install 0000664 0000000 0000000 00000000127 15074160566 0024570 0 ustar 00root root 0000000 0000000 usr/include/udisks2-qt6/*
usr/lib/*/cmake/udisks2-qt6/*.cmake
usr/lib/*/pkgconfig/*.pc
linuxdeepin-udisks2-qt6-d816036/debian/libudisks2-qt6.install 0000664 0000000 0000000 00000000035 15074160566 0024012 0 ustar 00root root 0000000 0000000 usr/lib/*/libudisks2-qt6.so* linuxdeepin-udisks2-qt6-d816036/debian/rules 0000775 0000000 0000000 00000000352 15074160566 0020721 0 ustar 00root root 0000000 0000000 #!/usr/bin/make -f
%:
dh $@
override_dh_installinit:
true
override_dh_auto_configure:
dh_auto_configure -- \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LIBDIR=/usr/lib/$(DEB_HOST_MULTIARCH)
linuxdeepin-udisks2-qt6-d816036/debian/source/ 0000775 0000000 0000000 00000000000 15074160566 0021141 5 ustar 00root root 0000000 0000000 linuxdeepin-udisks2-qt6-d816036/debian/source/format 0000664 0000000 0000000 00000000015 15074160566 0022350 0 ustar 00root root 0000000 0000000 3.0 (native)
linuxdeepin-udisks2-qt6-d816036/dudisksjob.cpp 0000664 0000000 0000000 00000010722 15074160566 0021266 0 ustar 00root root 0000000 0000000 // SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later
#include "dudisksjob.h"
#include "udisks2_interface.h"
#include
#include
class DUDisksJobPrivate
{
DUDisksJobPrivate(DUDisksJob *)
{
}
DUDisksJob *q_ptr;
OrgFreedesktopUDisks2JobInterface *dbusif;
Q_DECLARE_PUBLIC(DUDisksJob)
};
DUDisksJob::~DUDisksJob()
{
qDebug() << "DUDisksJob destroyed:" << path();
}
QString DUDisksJob::path() const
{
Q_D(const DUDisksJob);
qDebug() << "Getting job path:" << d->dbusif->path();
return d->dbusif->path();
}
QStringList DUDisksJob::objects() const
{
Q_D(const DUDisksJob);
qDebug() << "Getting job objects for path:" << d->dbusif->path();
QStringList ret;
for (auto &o : d->dbusif->objects()) {
ret.push_back(o.path());
}
return ret;
}
bool DUDisksJob::cancelable() const
{
Q_D(const DUDisksJob);
qDebug() << "Checking if job is cancelable:" << d->dbusif->path();
return d->dbusif->cancelable();
}
bool DUDisksJob::progressValid() const
{
Q_D(const DUDisksJob);
qDebug() << "Checking if job progress is valid:" << d->dbusif->path();
return d->dbusif->progressValid();
}
double DUDisksJob::progress() const
{
Q_D(const DUDisksJob);
qDebug() << "Getting job progress:" << d->dbusif->path() << "progress:" << d->dbusif->progress();
return d->dbusif->progress();
}
QString DUDisksJob::operation() const
{
Q_D(const DUDisksJob);
qDebug() << "Getting job operation:" << d->dbusif->path() << "operation:" << d->dbusif->operation();
return d->dbusif->operation();
}
quint32 DUDisksJob::startedByUid() const
{
Q_D(const DUDisksJob);
qDebug() << "Getting job started by UID:" << d->dbusif->path();
return d->dbusif->startedByUID();
}
quint64 DUDisksJob::bytes() const
{
Q_D(const DUDisksJob);
qDebug() << "Getting job bytes:" << d->dbusif->path() << "bytes:" << d->dbusif->bytes();
return d->dbusif->bytes();
}
quint64 DUDisksJob::expectedEndTime() const
{
Q_D(const DUDisksJob);
qDebug() << "Getting job expected end time:" << d->dbusif->path();
return d->dbusif->expectedEndTime();
}
quint64 DUDisksJob::rate() const
{
Q_D(const DUDisksJob);
qDebug() << "Getting job rate:" << d->dbusif->path() << "rate:" << d->dbusif->rate();
return d->dbusif->rate();
}
quint64 DUDisksJob::startTime() const
{
Q_D(const DUDisksJob);
qDebug() << "Getting job start time:" << d->dbusif->path();
return d->dbusif->startTime();
}
void DUDisksJob::cancel(const QVariantMap &options)
{
Q_D(DUDisksJob);
qDebug() << "Cancelling job:" << d->dbusif->path() << "with options:" << options;
auto r = d->dbusif->Cancel(options);
r.waitForFinished();
if (r.isError()) {
qWarning() << "Failed to cancel job:" << d->dbusif->path() << "error:" << r.error().message();
}
}
DUDisksJob::DUDisksJob(QString path, QObject *parent)
: QObject(parent)
, d_ptr(new DUDisksJobPrivate(this))
{
Q_D(DUDisksJob);
qDebug() << "Creating DUDisksJob for path:" << path;
d->dbusif = new OrgFreedesktopUDisks2JobInterface(UDISKS2_SERVICE, path, QDBusConnection::systemBus());
QDBusConnection::systemBus().connect(UDISKS2_SERVICE, d->dbusif->path(), "org.freedesktop.DBus.Properties",
"PropertiesChanged", this, SLOT(onPropertiesChanged(const QString &, const QVariantMap &)));
connect(d->dbusif, &OrgFreedesktopUDisks2JobInterface::Completed, this, &DUDisksJob::completed);
}
void DUDisksJob::onPropertiesChanged(const QString &interface, const QVariantMap &changed_properties)
{
Q_UNUSED(interface)
qDebug() << "Properties changed for job:" << d_ptr->dbusif->path() << "interface:" << interface;
auto begin = changed_properties.begin();
for (; begin != changed_properties.constEnd(); ++begin) {
QString property_name = begin.key();
int pindex = this->metaObject()->indexOfProperty(property_name.toLatin1().constData());
if (pindex < 0) {
property_name[0] = property_name.at(0).toLower();
pindex = this->metaObject()->indexOfProperty(property_name.toLatin1().constData());
}
if (pindex < 0)
continue;
const QMetaProperty &mp = this->metaObject()->property(pindex);
if (!mp.hasNotifySignal())
continue;
mp.notifySignal().invoke(this, QGenericArgument(begin.value().typeName(), begin.value().constData()));
}
}
linuxdeepin-udisks2-qt6-d816036/dudisksjob.h 0000664 0000000 0000000 00000003626 15074160566 0020740 0 ustar 00root root 0000000 0000000 // SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later
#ifndef DUDISKSJOB_H
#define DUDISKSJOB_H
#include
class DUDisksJobPrivate;
class DUDisksJob : public QObject
{
Q_OBJECT
Q_DECLARE_PRIVATE(DUDisksJob)
Q_PROPERTY(QString path READ path CONSTANT FINAL)
Q_PROPERTY(QStringList objects READ objects CONSTANT FINAL)
Q_PROPERTY(bool cancelable READ cancelable CONSTANT FINAL)
Q_PROPERTY(bool progressValid READ progressValid CONSTANT FINAL)
Q_PROPERTY(double progress READ progress NOTIFY progressChanged FINAL)
Q_PROPERTY(QString operation READ operation CONSTANT FINAL)
Q_PROPERTY(quint32 startedByUid READ startedByUid CONSTANT FINAL)
Q_PROPERTY(quint64 bytes READ bytes CONSTANT FINAL)
Q_PROPERTY(quint64 expectedEndTime READ expectedEndTime NOTIFY expectedEndTimeChanged FINAL)
Q_PROPERTY(quint64 rate READ rate NOTIFY rateChanged FINAL)
Q_PROPERTY(quint64 startTime READ startTime CONSTANT FINAL)
public:
~DUDisksJob();
QString path() const;
QStringList objects() const;
bool cancelable() const;
bool progressValid() const;
double progress() const;
QString operation() const;
quint32 startedByUid() const;
quint64 bytes() const;
quint64 expectedEndTime() const;
quint64 rate() const;
quint64 startTime() const;
public Q_SLOTS:
void cancel(const QVariantMap &options);
Q_SIGNALS:
void completed(bool success, QString message);
void progressChanged(double progress);
void rateChanged(quint64 rate);
void expectedEndTimeChanged(quint64 expectedEndTime);
private:
QScopedPointer d_ptr;
explicit DUDisksJob(QString path, QObject *parent = nullptr);
private Q_SLOTS:
void onPropertiesChanged(const QString &interface, const QVariantMap &changed_properties);
friend class DDiskManager;
};
#endif
linuxdeepin-udisks2-qt6-d816036/org.freedesktop.UDisks2.ObjectManager.xml 0000664 0000000 0000000 00000002026 15074160566 0026225 0 ustar 00root root 0000000 0000000
linuxdeepin-udisks2-qt6-d816036/org.freedesktop.UDisks2.xml 0000664 0000000 0000000 00000370026 15074160566 0023535 0 ustar 00root root 0000000 0000000
linuxdeepin-udisks2-qt6-d816036/private/ 0000775 0000000 0000000 00000000000 15074160566 0020071 5 ustar 00root root 0000000 0000000 linuxdeepin-udisks2-qt6-d816036/private/dblockdevice_p.h 0000664 0000000 0000000 00000001624 15074160566 0023202 0 ustar 00root root 0000000 0000000 // SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later
#ifndef DBLOCKDEVICE_P_H
#define DBLOCKDEVICE_P_H
#include "dblockdevice.h"
QT_BEGIN_NAMESPACE
class QDBusObjectPath;
QT_END_NAMESPACE
class OrgFreedesktopUDisks2BlockInterface;
class DBlockDevicePrivate
{
public:
explicit DBlockDevicePrivate(DBlockDevice *qq);
OrgFreedesktopUDisks2BlockInterface *dbus;
bool watchChanges = false;
DBlockDevice *q_ptr;
QDBusError err;
void _q_onInterfacesAdded(const QDBusObjectPath &object_path, const QMap &interfaces_and_properties);
void _q_onInterfacesRemoved(const QDBusObjectPath &object_path, const QStringList &interfaces);
void _q_onPropertiesChanged(const QString &interface, const QVariantMap &changed_properties);
Q_DECLARE_PUBLIC(DBlockDevice)
};
#endif // DBLOCKDEVICE_P_H
linuxdeepin-udisks2-qt6-d816036/rpm/ 0000775 0000000 0000000 00000000000 15074160566 0017215 5 ustar 00root root 0000000 0000000 linuxdeepin-udisks2-qt6-d816036/rpm/udisks2-qt6.spec 0000664 0000000 0000000 00000002227 15074160566 0022170 0 ustar 00root root 0000000 0000000 Name: udisks2-qt6
Version: 6.0.0
Release: 3%{?dist}
Summary: Qt6 binding for udisks2
License: GPLv3+
URL: https://github.com/linuxdeepin/udisks2-qt6
Source0: %{name}_%{version}.tar.gz
BuildRequires: gcc-c++
BuildRequires: pkgconfig(Qt6Core)
BuildRequires: pkgconfig(Qt6DBus)
BuildRequires: cmake
%description
This package provides a Qt6 binding for udisks2.
%package devel
Summary: Development package for %{name}
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: qt6-qtbase-devel%{?isa}
Requires: qt6-qtdbus-devel%{?isa}
%description devel
Header files and libraries for %{name}.
%prep
%setup -q
%build
%cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} \
-DCMAKE_BUILD_TYPE=Release
%cmake_build
%install
%cmake_install
%files
%doc CHANGELOG.md
%{_libdir}/libudisks2-qt6.so.*
%files devel
%{_includedir}/udisks2-qt6/
%{_libdir}/cmake/udisks2-qt6/
%{_libdir}/pkgconfig/udisks2-qt6.pc
%{_libdir}/libudisks2-qt6.so
%changelog
* Wed Jul 29 2020 Fedora Release Engineering - 5.0.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild linuxdeepin-udisks2-qt6-d816036/udisks2-qt6.pc.in 0000664 0000000 0000000 00000000507 15074160566 0021446 0 ustar 00root root 0000000 0000000 prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix}
libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@
includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@/@PROJECT_NAME@
Name: @PROJECT_NAME@
Description: UDisks2 Library with Qt6
Version: @PROJECT_VERSION@
Requires: Qt6Core Qt6DBus
Libs: -L${libdir} -l@PROJECT_NAME@
Cflags: -I${includedir} linuxdeepin-udisks2-qt6-d816036/udisks2-qt6Config.cmake.in 0000664 0000000 0000000 00000000312 15074160566 0023244 0 ustar 00root root 0000000 0000000 @PACKAGE_INIT@
include(CMakeFindDependencyMacro)
find_dependency(Qt6 COMPONENTS Core DBus)
include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake")
check_required_components(@PROJECT_NAME@) linuxdeepin-udisks2-qt6-d816036/udisks2_dbus_common.cpp 0000664 0000000 0000000 00000010311 15074160566 0023070 0 ustar 00root root 0000000 0000000 // SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later
#include "udisks2_dbus_common.h"
#include "objectmanager_interface.h"
#include "udisks2_interface.h"
#include
#include
#include
#include
#include
#include
namespace UDisks2 {
Q_GLOBAL_STATIC_WITH_ARGS(OrgFreedesktopDBusObjectManagerInterface, omGlobal, (UDISKS2_SERVICE, "/org/freedesktop/UDisks2", QDBusConnection::systemBus()))
Q_GLOBAL_STATIC_WITH_ARGS(OrgFreedesktopUDisks2ManagerInterface, umGlobal, (UDISKS2_SERVICE, "/org/freedesktop/UDisks2/Manager", QDBusConnection::systemBus()))
bool interfaceExists(const QString &path, const QString &interface)
{
qDebug() << "Checking if interface exists:" << interface << "for path:" << path;
QDBusInterface ud2(UDISKS2_SERVICE, path, "org.freedesktop.DBus.Introspectable", QDBusConnection::systemBus());
QDBusReply reply = ud2.call("Introspect");
QXmlStreamReader xml_parser(reply.value());
while (!xml_parser.atEnd()) {
xml_parser.readNext();
if (xml_parser.tokenType() == QXmlStreamReader::StartElement
&& xml_parser.name().toString() == "interface") {
const QString &name = xml_parser.attributes().value("name").toString();
if (name == interface) {
qDebug() << "Interface found:" << interface;
return true;
}
}
}
qDebug() << "Interface not found:" << interface;
return false;
}
OrgFreedesktopDBusObjectManagerInterface *objectManager()
{
qDebug() << "Getting UDisks2 object manager";
if (!omGlobal.exists()) {
qDebug() << "Registering DBus meta types";
qDBusRegisterMetaType>();
qDBusRegisterMetaType>>();
qDBusRegisterMetaType();
qDBusRegisterMetaType>();
qDBusRegisterMetaType>>();
}
return omGlobal;
}
QString version()
{
qDebug() << "Getting UDisks2 version";
return umGlobal->version();
}
QStringList supportedFilesystems()
{
qDebug() << "Getting UDisks2 supported filesystems";
return umGlobal->supportedFilesystems();
}
}
QDBusArgument &operator<<(QDBusArgument &argument, const UDisks2::SmartAttribute &mystruct)
{
qDebug() << "Serializing SmartAttribute to DBus argument";
argument.beginStructure();
argument << mystruct.id
<< mystruct.name
<< mystruct.flags
<< mystruct.value
<< mystruct.worst
<< mystruct.threshold
<< mystruct.pretty
<< mystruct.pretty_unit
<< mystruct.expansion;
argument.endStructure();
return argument;
}
const QDBusArgument &operator>>(const QDBusArgument &argument, UDisks2::SmartAttribute &mystruct)
{
qDebug() << "Deserializing SmartAttribute from DBus argument";
argument.beginStructure();
argument >> mystruct.id
>> mystruct.name
>> mystruct.flags
>> mystruct.value
>> mystruct.worst
>> mystruct.threshold
>> mystruct.pretty
>> mystruct.pretty_unit
>> mystruct.expansion;
argument.endStructure();
return argument;
}
QDBusArgument &operator<<(QDBusArgument &argument, const UDisks2::ActiveDeviceInfo &mystruct)
{
qDebug() << "Serializing ActiveDeviceInfo to DBus argument";
argument.beginStructure();
argument << mystruct.block
<< mystruct.slot
<< mystruct.state
<< mystruct.num_read_errors
<< mystruct.expansion;
argument.endStructure();
return argument;
}
const QDBusArgument &operator>>(const QDBusArgument &argument, UDisks2::ActiveDeviceInfo &mystruct)
{
qDebug() << "Deserializing ActiveDeviceInfo from DBus argument";
argument.beginStructure();
argument >> mystruct.block
>> mystruct.slot
>> mystruct.state
>> mystruct.num_read_errors
>> mystruct.expansion;
argument.endStructure();
return argument;
}
linuxdeepin-udisks2-qt6-d816036/udisks2_dbus_common.h 0000664 0000000 0000000 00000006271 15074160566 0022547 0 ustar 00root root 0000000 0000000 // SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later
#ifndef UDISK2_DBUS_COMMON_H
#define UDISK2_DBUS_COMMON_H
#include
#include
#include
QT_BEGIN_NAMESPACE
class QDBusArgument;
QT_END_NAMESPACE
class OrgFreedesktopDBusObjectManagerInterface;
#define UDISKS2_SERVICE "org.freedesktop.UDisks2"
namespace UDisks2 {
/// by: http://storaged.org/doc/udisks2-api/2.7.2/gdbus-org.freedesktop.UDisks2.Drive.Ata.html#gdbus-method-org-freedesktop-UDisks2-Drive-Ata.SmartGetAttributes
struct SmartAttribute
{
uchar id; // Attribute Identifier
QString name; // The identifier as a string.
quint16 flags; // 16-bit attribute flags (bit 0 is prefail/oldage, bit 1 is online/offline).
qint32 value; // The current value or -1 if unknown.
qint32 worst; // The worst value of -1 if unknown.
qint32 threshold; // The threshold or -1 if unknown.
qint64 pretty; // An interpretation of the value - must be ignored if pretty_unit is 0.
qint32 pretty_unit; // The unit of the pretty value - the following units are known: 0 (unknown), 1 (dimensionless), 2 (milliseconds), 3 (sectors), 4 (millikelvin).
QVariantMap expansion; // Currently unused. Intended for future expansion.
};
/// by: http://storaged.org/doc/udisks2-api/2.7.2/gdbus-org.freedesktop.UDisks2.MDRaid.html#gdbus-property-org-freedesktop-UDisks2-MDRaid.ActiveDevices
struct ActiveDeviceInfo
{
QDBusObjectPath block; // The object path for the underlying block device (guaranteed to implement the org.freedesktop.UDisks2.Block interface)
qint32 slot; // -1 if the device is not currently part of the array (ie. spare or faulty), otherwise the slot number the device currently fills (between 0 and "NumDevices")
QStringList state; // The state of the device - known elements include faulty, in_sync, write_mostly, blocked and spare
quint64 num_read_errors; // An ongoing count of read errors that have been detected on this device but have not caused the device to be evicted from the array
QVariantMap expansion; // Currently unused. Intended for future expansion.
};
/// by: http://storaged.org/doc/udisks2-api/2.7.2/udisks-std-options.html
// default options
// Many method calls take a parameter of type 'a{sv}' that is normally called options. The following table lists well-known options:
// "auth.no_user_interaction" bool // If set to TRUE, then no user interaction will happen when checking if the method call is authorized.
bool interfaceExists(const QString &path, const QString &interface);
OrgFreedesktopDBusObjectManagerInterface *objectManager();
QStringList supportedFilesystems();
QString version();
}
Q_DECLARE_METATYPE(UDisks2::SmartAttribute)
QDBusArgument &operator<<(QDBusArgument &argument, const UDisks2::SmartAttribute &mystruct);
const QDBusArgument &operator>>(const QDBusArgument &argument, UDisks2::SmartAttribute &mystruct);
Q_DECLARE_METATYPE(UDisks2::ActiveDeviceInfo)
QDBusArgument &operator<<(QDBusArgument &argument, const UDisks2::ActiveDeviceInfo &mystruct);
const QDBusArgument &operator>>(const QDBusArgument &argument, UDisks2::ActiveDeviceInfo &mystruct);
#endif // UDISK2_DBUS_COMMON_H