mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-12-04 15:39:34 +01:00
Compare commits
236 Commits
2.0.0
...
2.0.3-http
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e19559fe81 | ||
|
|
7dd30d4db1 | ||
|
|
9b8b7b490a | ||
|
|
5ec9d0685d | ||
|
|
004c412501 | ||
|
|
f05caf7623 | ||
|
|
7d165f133a | ||
|
|
fff9e7ac46 | ||
|
|
ad834f0f58 | ||
|
|
8a50ee8b22 | ||
|
|
cf8186312a | ||
|
|
8f87b5cfd4 | ||
|
|
61ce733c6f | ||
|
|
c78822f6e6 | ||
|
|
a10a30f390 | ||
|
|
7c7014d951 | ||
|
|
dee331d52d | ||
|
|
2146392a2f | ||
|
|
e011a6eb25 | ||
|
|
5eadd10612 | ||
|
|
c2a80ce570 | ||
|
|
3415073051 | ||
|
|
ba68e0a4a1 | ||
|
|
8a7e98820a | ||
|
|
d61e4d69b5 | ||
|
|
9b8912c483 | ||
|
|
878995366a | ||
|
|
1635a5211f | ||
|
|
595b1011dd | ||
|
|
9bb291235d | ||
|
|
7d4ef0b8d0 | ||
|
|
8d16522d39 | ||
|
|
cd1192b409 | ||
|
|
bf2fd63131 | ||
|
|
029da87346 | ||
|
|
9532bedd7d | ||
|
|
e9c8363b70 | ||
|
|
fb57ed2bcd | ||
|
|
57ec558396 | ||
|
|
6e2de1cd79 | ||
|
|
8ace3ab7f2 | ||
|
|
18e4dca6c9 | ||
|
|
99bb5d33f2 | ||
|
|
d4ed4f9325 | ||
|
|
bb2e1ee8da | ||
|
|
51bfbc964e | ||
|
|
48eca3e11f | ||
|
|
57c1a0f4b6 | ||
|
|
bde4d63fdb | ||
|
|
cbb1269b39 | ||
|
|
175167b311 | ||
|
|
029052fa18 | ||
|
|
a454469949 | ||
|
|
0562ed720b | ||
|
|
cbe8a9649c | ||
|
|
f48fdc1d71 | ||
|
|
7f7753a004 | ||
|
|
aba4fa94be | ||
|
|
4eea7c8297 | ||
|
|
4867d26f7d | ||
|
|
9bd3ab717e | ||
|
|
d6d92ce90a | ||
|
|
3679b21701 | ||
|
|
49f58b4ed8 | ||
|
|
235361faf4 | ||
|
|
208b803fbe | ||
|
|
8a92cec03f | ||
|
|
00f068b93e | ||
|
|
654353e26b | ||
|
|
d670ef2638 | ||
|
|
aff935b3c7 | ||
|
|
107c0673c7 | ||
|
|
c14d04b3e8 | ||
|
|
7a017041bf | ||
|
|
bfae81ec70 | ||
|
|
71d4cb781d | ||
|
|
eb56bd8973 | ||
|
|
93585aded7 | ||
|
|
38245aa2a9 | ||
|
|
1f33e6f044 | ||
|
|
4752adf9d3 | ||
|
|
2d741afe3e | ||
|
|
5e6b17aba4 | ||
|
|
c51098e2cf | ||
|
|
ecfbf72a57 | ||
|
|
0c36c40a5d | ||
|
|
6337e673f9 | ||
|
|
e800892cc1 | ||
|
|
a21e893749 | ||
|
|
dff3fc0572 | ||
|
|
5de0ec94e0 | ||
|
|
a408b01111 | ||
|
|
6e45cf0dab | ||
|
|
dc7b6623a9 | ||
|
|
9484af5329 | ||
|
|
3cf1a16398 | ||
|
|
0f0af12353 | ||
|
|
7cb9a4ee4a | ||
|
|
28a1eb86da | ||
|
|
86f12d9e83 | ||
|
|
539f86fd0b | ||
|
|
c93b12ff05 | ||
|
|
319edca870 | ||
|
|
5a59287927 | ||
|
|
20726ae75c | ||
|
|
3b2a39fd38 | ||
|
|
c8ae31a248 | ||
|
|
66a01e4fef | ||
|
|
d559db4fb1 | ||
|
|
6f5871434d | ||
|
|
685f249fd0 | ||
|
|
26ccd577b5 | ||
|
|
5a13402b51 | ||
|
|
82aa02a980 | ||
|
|
3dd98deecc | ||
|
|
2e23fb203a | ||
|
|
625e9a2547 | ||
|
|
aab2b7df1c | ||
|
|
31bd44bec5 | ||
|
|
11532b603a | ||
|
|
523c88b80d | ||
|
|
7cf1bb7e38 | ||
|
|
eb9fdb43c1 | ||
|
|
0362f45547 | ||
|
|
31f55fdb26 | ||
|
|
26928a63e8 | ||
|
|
abacec5787 | ||
|
|
d84af2def0 | ||
|
|
7fa0eddc5f | ||
|
|
0e85c98d02 | ||
|
|
ae2b27d400 | ||
|
|
7c424e1b85 | ||
|
|
ba1ca4ec08 | ||
|
|
20b13a4a2e | ||
|
|
460b23b1eb | ||
|
|
9882f16614 | ||
|
|
60daa2b41b | ||
|
|
d81565df55 | ||
|
|
e2ac176d3c | ||
|
|
ec8c0bb3e7 | ||
|
|
b904fe5acd | ||
|
|
3b07098731 | ||
|
|
03a330a4dd | ||
|
|
6502da549b | ||
|
|
a71e25a8ba | ||
|
|
9e05f41747 | ||
|
|
208b0f39e6 | ||
|
|
5ad9edc3fd | ||
|
|
c714fc89f1 | ||
|
|
e3cde7b55e | ||
|
|
5a745da07b | ||
|
|
531018e58d | ||
|
|
813c64a055 | ||
|
|
0390c67c4d | ||
|
|
1f6161132e | ||
|
|
fc74e16097 | ||
|
|
b03f54ffcd | ||
|
|
26f33a1c12 | ||
|
|
6e8aeea76d | ||
|
|
c736ba7059 | ||
|
|
3eb4b3b208 | ||
|
|
5982763bed | ||
|
|
6b7f7bb777 | ||
|
|
5b9338e40e | ||
|
|
eab4861383 | ||
|
|
4008e6ab58 | ||
|
|
a115bbdc6f | ||
|
|
33ed4fd7cf | ||
|
|
d70ee509b4 | ||
|
|
e20968bdfe | ||
|
|
9e124e4a75 | ||
|
|
db37b7b933 | ||
|
|
2e94066e50 | ||
|
|
61c6962bf2 | ||
|
|
9cbdd58af5 | ||
|
|
eea9d7db97 | ||
|
|
235baa3dcc | ||
|
|
f04f4302a2 | ||
|
|
65eb71e645 | ||
|
|
47e885ddbf | ||
|
|
65626f0da2 | ||
|
|
8584901f9e | ||
|
|
e2d446e446 | ||
|
|
54306473f3 | ||
|
|
c7158234dc | ||
|
|
b28cb19ae3 | ||
|
|
86a01b6984 | ||
|
|
b432103b82 | ||
|
|
75564c8fb5 | ||
|
|
b87097a7ab | ||
|
|
6ef5f34070 | ||
|
|
b953ea9042 | ||
|
|
61ada66e3a | ||
|
|
a9a724714f | ||
|
|
612ef0ef9b | ||
|
|
a627870bbb | ||
|
|
fae4f69b8c | ||
|
|
b27ba03d42 | ||
|
|
2cd6787141 | ||
|
|
21204971ff | ||
|
|
c570a13a1f | ||
|
|
5c71260c12 | ||
|
|
e105970945 | ||
|
|
0c33019f93 | ||
|
|
16598a8386 | ||
|
|
f52f6e2d44 | ||
|
|
304cebefe4 | ||
|
|
d7a8a43024 | ||
|
|
73f91db939 | ||
|
|
41be9e8178 | ||
|
|
be24872bba | ||
|
|
db56546871 | ||
|
|
53b30e267c | ||
|
|
8f33c5235b | ||
|
|
d8857bf42d | ||
|
|
a85ac07576 | ||
|
|
d2ab008aa0 | ||
|
|
f4ff8b17f7 | ||
|
|
d5c8787451 | ||
|
|
850c7c7ecf | ||
|
|
7ff475977e | ||
|
|
478d30b529 | ||
|
|
d6597400de | ||
|
|
af394ff65c | ||
|
|
f6fa6d6563 | ||
|
|
fd7a49f4a6 | ||
|
|
47d7598e99 | ||
|
|
e2ba754f91 | ||
|
|
c98aad698a | ||
|
|
75f0d132e5 | ||
|
|
f82725139a | ||
|
|
b9e58c77af | ||
|
|
ad67eac257 | ||
|
|
eef51f26f0 | ||
|
|
ea992bc3e6 | ||
|
|
20f3f23576 |
28
.travis.yml
28
.travis.yml
@@ -1,20 +1,32 @@
|
||||
language: cpp
|
||||
sudo: required
|
||||
dist: trusty
|
||||
|
||||
os:
|
||||
- linux
|
||||
- osx
|
||||
# - osx
|
||||
|
||||
compiler:
|
||||
- gcc
|
||||
- clang
|
||||
language: cpp
|
||||
install:
|
||||
# - clang
|
||||
|
||||
git:
|
||||
depth: 3
|
||||
|
||||
before_install:
|
||||
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get -qq update; fi
|
||||
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get -qq install cmake libqt4-dev libgcrypt11-dev zlib1g-dev libxtst-dev; fi
|
||||
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get -qq install cmake libmicrohttpd10 libmicrohttpd-dev libxi-dev qtbase5-dev libqt5x11extras5-dev qttools5-dev qttools5-dev-tools libgcrypt20-dev zlib1g-dev libxtst-dev xvfb; fi
|
||||
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew update; fi
|
||||
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew ls | grep -wq cmake || brew install cmake; fi
|
||||
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew ls | grep -wq qt || brew install qt; fi
|
||||
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew ls | grep -wq qt5 || brew install qt5; fi
|
||||
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew ls | grep -wq libgcrypt || brew install libgcrypt; fi
|
||||
before_script: mkdir build && pushd build
|
||||
|
||||
before_script:
|
||||
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then CMAKE_ARGS="-DCMAKE_PREFIX_PATH=/usr/local/opt/qt5"; fi
|
||||
- mkdir build && pushd build
|
||||
|
||||
script:
|
||||
- cmake -DCMAKE_BUILD_TYPE=Debug -DWITH_GUI_TESTS=ON ..
|
||||
- cmake -DCMAKE_BUILD_TYPE=Release -DWITH_GUI_TESTS=ON $CMAKE_ARGS ..
|
||||
- make
|
||||
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then make test ARGS+="-E testgui --output-on-failure"; fi
|
||||
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then xvfb-run -a --server-args="-screen 0 800x600x24" make test ARGS+="-R testgui --output-on-failure"; fi
|
||||
|
||||
32
CHANGELOG
32
CHANGELOG
@@ -1,3 +1,35 @@
|
||||
2.0.3 (2016-09-04)
|
||||
=========================
|
||||
|
||||
- Improved error reporting when reading / writing databases fails. [#450, #462]
|
||||
- Display an error message when opening a custom icon fails.
|
||||
- Detect custom icon format based on contents instead of the filename. [#512]
|
||||
- Keep symlink intact when saving databases. [#442].
|
||||
- Fix a crash when deleting parent group of recycle bin. [#520]
|
||||
- Display a confirm dialog before moving an entry to the recycle bin. [#447]
|
||||
- Repair UUIDs of inconsistent history items. [#130]
|
||||
- Only include top-level windows in auto-type window list when using gnome-shell.
|
||||
- Update translations.
|
||||
|
||||
2.0.2 (2016-02-02)
|
||||
=========================
|
||||
|
||||
- Fix regression in database writer that caused it to strip certain special
|
||||
characters (characters from Unicode plane > 0).
|
||||
- Fix bug in repair function that caused it to strip non-ASCII characters.
|
||||
|
||||
2.0.1 (2016-01-31)
|
||||
=========================
|
||||
|
||||
- Flush temporary file before opening attachment. [#390]
|
||||
- Disable password generator when showing entry in history mode. [#422]
|
||||
- Strip invalid XML chars when writing databases. [#392]
|
||||
- Add repair function to fix databases with invalid XML chars. [#392]
|
||||
- Display custom icons scaled. [#322]
|
||||
- Allow opening databases that have no password and keyfile. [#391]
|
||||
- Fix crash when importing .kdb files with invalid icon ids. [#425]
|
||||
- Update translations.
|
||||
|
||||
2.0 (2015-12-06)
|
||||
=========================
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ endif()
|
||||
|
||||
project(KeePassX)
|
||||
|
||||
cmake_minimum_required(VERSION 2.6.4)
|
||||
cmake_minimum_required(VERSION 2.8.12)
|
||||
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
|
||||
|
||||
@@ -31,10 +31,10 @@ include(CheckCXXSourceCompiles)
|
||||
|
||||
option(WITH_TESTS "Enable building of unit tests" ON)
|
||||
option(WITH_GUI_TESTS "Enable building of GUI tests" OFF)
|
||||
option(WITH_CXX11 "Build with the C++ 11 standard" ON)
|
||||
option(WITH_DEV_BUILD "Use only for development. Disables/warns about deprecated methods." OFF)
|
||||
|
||||
set(KEEPASSX_VERSION "2.0")
|
||||
set(KEEPASSX_VERSION_NUM "2.0")
|
||||
set(KEEPASSX_VERSION "2.0.3")
|
||||
set(KEEPASSX_VERSION_NUM "2.0.3")
|
||||
|
||||
if("${CMAKE_C_COMPILER}" MATCHES "clang$" OR "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
|
||||
set(CMAKE_COMPILER_IS_CLANG 1)
|
||||
@@ -61,7 +61,7 @@ macro(add_gcc_compiler_flags FLAGS)
|
||||
add_gcc_compiler_cflags("${FLAGS}")
|
||||
endmacro(add_gcc_compiler_flags)
|
||||
|
||||
add_definitions(-DQT_NO_KEYWORDS -DQT_NO_EXCEPTIONS -DQT_NO_STL -DQT_STRICT_ITERATORS -DQT_NO_CAST_TO_ASCII)
|
||||
add_definitions(-DQT_NO_KEYWORDS -DQT_NO_EXCEPTIONS -DQT_STRICT_ITERATORS -DQT_NO_CAST_TO_ASCII)
|
||||
|
||||
add_gcc_compiler_flags("-fno-common -fstack-protector --param=ssp-buffer-size=4")
|
||||
add_gcc_compiler_flags("-Wall -Wextra -Wundef -Wpointer-arith -Wno-long-long")
|
||||
@@ -100,14 +100,16 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,-z,relro")
|
||||
endif()
|
||||
|
||||
if (WITH_CXX11)
|
||||
add_gcc_compiler_cxxflags("-std=c++0x")
|
||||
add_gcc_compiler_cflags("-ansi")
|
||||
if(APPLE)
|
||||
add_gcc_compiler_cxxflags("-stdlib=libc++")
|
||||
endif()
|
||||
else()
|
||||
add_gcc_compiler_flags("-ansi")
|
||||
add_gcc_compiler_cxxflags("-std=c++11")
|
||||
|
||||
if(APPLE)
|
||||
add_gcc_compiler_cxxflags("-stdlib=libc++")
|
||||
endif()
|
||||
|
||||
add_gcc_compiler_cflags("-ansi")
|
||||
|
||||
if(WITH_DEV_BUILD)
|
||||
add_definitions(-DQT_DEPRECATED_WARNINGS -DGCRYPT_NO_DEPRECATED)
|
||||
endif()
|
||||
|
||||
if(MINGW)
|
||||
@@ -146,19 +148,21 @@ if(WITH_TESTS)
|
||||
enable_testing()
|
||||
endif(WITH_TESTS)
|
||||
|
||||
set(QT_REQUIRED_MODULES QtCore QtGui QtTest)
|
||||
find_package(Qt5Core 5.2 REQUIRED)
|
||||
find_package(Qt5Concurrent 5.2 REQUIRED)
|
||||
find_package(Qt5Widgets 5.2 REQUIRED)
|
||||
find_package(Qt5Test 5.2 REQUIRED)
|
||||
find_package(Qt5LinguistTools 5.2 REQUIRED)
|
||||
find_package(Qt5Network 5.2 REQUIRED)
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
|
||||
find_package(Qt4 4.6.0 REQUIRED ${QT_REQUIRED_MODULES})
|
||||
include(${QT_USE_FILE})
|
||||
# Debian sets the the build type to None for package builds.
|
||||
# Make sure we don't enable asserts there.
|
||||
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_NONE QT_NO_DEBUG)
|
||||
|
||||
find_package(Gcrypt REQUIRED)
|
||||
if(NOT (${GCRYPT_VERSION_STRING} VERSION_LESS "1.6.0"))
|
||||
message(STATUS "Gcrypt ${GCRYPT_VERSION_STRING} supports the SALSA20 cipher")
|
||||
set(GCRYPT_HAS_SALSA20 1)
|
||||
endif()
|
||||
find_package(Gcrypt 1.6.0 REQUIRED)
|
||||
|
||||
find_package(LibMicroHTTPD REQUIRED)
|
||||
|
||||
find_package(ZLIB REQUIRED)
|
||||
|
||||
@@ -199,10 +203,7 @@ endif()
|
||||
|
||||
include_directories(SYSTEM ${GCRYPT_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR})
|
||||
|
||||
if(NOT (${CMAKE_VERSION} VERSION_LESS 2.8.3))
|
||||
set(PRINT_SUMMARY ON)
|
||||
include(FeatureSummary)
|
||||
endif()
|
||||
include(FeatureSummary)
|
||||
|
||||
add_subdirectory(src)
|
||||
add_subdirectory(share)
|
||||
|
||||
63
README.md
63
README.md
@@ -1,68 +1,35 @@
|
||||
# KeePassX
|
||||
# KeePassX v2.0.2 + keepasshttp
|
||||
|
||||

|
||||
|
||||
## About
|
||||
|
||||
KeePassX is an application for people with extremely high demands on secure personal data management.
|
||||
It has a light interface, is cross platform and published under the terms of the GNU General Public License.
|
||||
Fork of [KeePassX](https://www.keepassx.org/) with keepasshttp support for use with [PassIFox](https://addons.mozilla.org/en-us/firefox/addon/passifox/) for Mozilla Firefox and [chromeIPass](https://chrome.google.com/webstore/detail/chromeipass/ompiailgknfdndiefoaoiligalphfdae) for Google Chrome.
|
||||
|
||||
KeePassX saves many different information e.g. user names, passwords, urls, attachments and comments in one single database.
|
||||
For a better management user-defined titles and icons can be specified for each single entry.
|
||||
Furthermore the entries are sorted in groups, which are customizable as well. The integrated search function allows to search in a single group or the complete database.
|
||||
KeePassX offers a little utility for secure password generation. The password generator is very customizable, fast and easy to use.
|
||||
Especially someone who generates passwords frequently will appreciate this feature.
|
||||
KeePassHttp implementation has been forked from jdachtera's repository, which in turn was based on code from code with Francois Ferrand's [keepassx-http](https://gitorious.org/keepassx/keepassx-http/source/master:) repository.
|
||||
|
||||
The complete database is always encrypted with the AES (aka Rijndael) encryption algorithm using a 256 bit key.
|
||||
Therefore the saved information can be considered as quite safe. KeePassX uses a database format that is compatible with [KeePass Password Safe](http://keepass.info/).
|
||||
This makes the use of that application even more favorable.
|
||||
|
||||
## Install
|
||||
|
||||
KeePassX can be downloaded and installed using an assortment of installers available on the main [KeePassX website](http://www.keepassx.org).
|
||||
KeePassX can also be installed from the official repositories of many Linux repositories.
|
||||
If you wish to build KeePassX from source, rather than rely on the pre-compiled binaries, you may wish to read up on the _From Source_ section.
|
||||
|
||||
### Debian
|
||||
|
||||
To install KeePassX from the Debian repository:
|
||||
|
||||
```bash
|
||||
sudo apt-get install keepassx
|
||||
```
|
||||
|
||||
### Red Hat
|
||||
|
||||
Install KeePassX from the Red Hat (or CentOS) repository:
|
||||
|
||||
```bash
|
||||
sudo yum install keepassx
|
||||
```
|
||||
|
||||
### Windows / Mac OS X
|
||||
|
||||
Download the installer from the KeePassX [download](https://www.keepassx.org/downloads) page.
|
||||
Once downloaded, double click on the file to execute the installer.
|
||||
|
||||
### From Source
|
||||
This is a rebuild from [denk-mal's keepasshttp](https://github.com/denk-mal/keepassx.git) that brings it forward to Qt5 and KeePassX v2.0.2.
|
||||
|
||||
#### Build Dependencies
|
||||
|
||||
The following tools must exist within your PATH:
|
||||
|
||||
* make
|
||||
* cmake (>= 2.6.4)
|
||||
* g++ or clang++
|
||||
* cmake (>= 2.8.12)
|
||||
* g++ (>= 4.7) or clang++ (>= 3.0)
|
||||
|
||||
The following libraries are required:
|
||||
|
||||
* Qt 4 (>= 4.6)
|
||||
* libgcrypt
|
||||
* Qt 5 (>= 5.2): qtbase and qttools5
|
||||
* libgcrypt (>= 1.6)
|
||||
* zlib
|
||||
* libxtst (optional for auto-type on X11)
|
||||
* libmicrohttpd
|
||||
* libxi, libxtst, qtx11extras (optional for auto-type on X11)
|
||||
|
||||
On Debian you can install them with:
|
||||
|
||||
```bash
|
||||
sudo apt-get install build-essential cmake libqt4-dev libgcrypt11-dev zlib1g-dev
|
||||
sudo apt-get install build-essential cmake libmicrohttpd-dev libxi-dev qtbase5-dev libqt5x11extras5-dev qttools5-dev qttools5-dev-tools libgcrypt20-dev zlib1g-dev
|
||||
```
|
||||
|
||||
#### Build Steps
|
||||
@@ -72,7 +39,7 @@ To compile from source:
|
||||
```bash
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ..
|
||||
cmake -DWITH_TESTS=OFF ..
|
||||
make [-jX]
|
||||
```
|
||||
|
||||
@@ -121,7 +88,7 @@ Our software isn't always perfect, but we strive to always improve our work. You
|
||||
|
||||
Along with our desire to hear your feedback and suggestions, we're also interested in accepting direct assistance in the form of code.
|
||||
|
||||
Issue merge requests against our [GitHub repository](https://github.com/keepassx/keepassx).
|
||||
Issue merge requests against our [GitHub repository](https://github.com/keepassxreboot/keepassx).
|
||||
|
||||
### Translations
|
||||
|
||||
|
||||
9
cmake/FindLibMicroHTTPD.cmake
Normal file
9
cmake/FindLibMicroHTTPD.cmake
Normal file
@@ -0,0 +1,9 @@
|
||||
|
||||
find_path(MHD_INCLUDE_DIR microhttpd.h)
|
||||
|
||||
find_library(MHD_LIBRARIES microhttpd)
|
||||
|
||||
mark_as_advanced(MHD_LIBRARIES MHD_INCLUDE_DIR)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(LibMicroHTTPD DEFAULT_MSG MHD_LIBRARIES MHD_INCLUDE_DIR)
|
||||
@@ -17,9 +17,9 @@ file(GLOB TRANSLATION_FILES *.ts)
|
||||
get_filename_component(TRANSLATION_EN_ABS keepassx_en.ts ABSOLUTE)
|
||||
list(REMOVE_ITEM TRANSLATION_FILES keepassx_en.ts)
|
||||
list(REMOVE_ITEM TRANSLATION_FILES ${TRANSLATION_EN_ABS})
|
||||
message(STATUS ${TRANSLATION_FILES})
|
||||
message(STATUS "${TRANSLATION_FILES}")
|
||||
|
||||
qt4_add_translation(QM_FILES ${TRANSLATION_FILES})
|
||||
qt5_add_translation(QM_FILES ${TRANSLATION_FILES})
|
||||
|
||||
install(FILES ${QM_FILES} DESTINATION ${DATA_INSTALL_DIR}/translations)
|
||||
add_custom_target(translations DEPENDS ${QM_FILES})
|
||||
|
||||
@@ -13,6 +13,10 @@
|
||||
<source>Revision</source>
|
||||
<translation>Revize</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Using:</source>
|
||||
<translation>S použitím:</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>AutoType</name>
|
||||
@@ -95,7 +99,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Unable to create Key File : </source>
|
||||
<translation>Nedaří se vytvořit soubor s klíčem :</translation>
|
||||
<translation>Nedaří se vytvořit soubor s klíčem:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Select a key file</source>
|
||||
@@ -103,7 +107,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Question</source>
|
||||
<translation>Otázka</translation>
|
||||
<translation>Dotaz</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Do you really want to use an empty string as password?</source>
|
||||
@@ -148,7 +152,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Unable to open the database.</source>
|
||||
<translation>Databázi se nepodařilo otevřít.</translation>
|
||||
<translation>Databázi se nedaří otevřít.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Can't open key file</source>
|
||||
@@ -167,6 +171,43 @@
|
||||
<translation>Vyberte soubor s klíčem</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DatabaseRepairWidget</name>
|
||||
<message>
|
||||
<source>Repair database</source>
|
||||
<translation>Opravit databázi</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Error</source>
|
||||
<translation>Chyba</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Can't open key file</source>
|
||||
<translation>Nedaří se otevřít soubor s klíčem</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Database opened fine. Nothing to do.</source>
|
||||
<translation>Databáze je v pořádku otevřená. Není třeba žádného zásahu.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unable to open the database.</source>
|
||||
<translation>Nedaří se otevřít databázi.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Success</source>
|
||||
<translation>Úspěch</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The database has been successfully repaired
|
||||
You can now save it.</source>
|
||||
<translation>Databáze je úspěšně opravená
|
||||
Nyní jí můžete uložit.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unable to repair the database.</source>
|
||||
<translation>Databázi se nedaří opravit.</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DatabaseSettingsWidget</name>
|
||||
<message>
|
||||
@@ -179,7 +220,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Transform rounds:</source>
|
||||
<translation>Počet průchodů algoritmu:</translation>
|
||||
<translation>Počet průchodů šifrovacího algoritmu:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Default username:</source>
|
||||
@@ -191,7 +232,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source> MiB</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation> MiB</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Benchmark</source>
|
||||
@@ -199,11 +240,11 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Max. history items:</source>
|
||||
<translation>Nejvyšší umožněný počet položek historie:</translation>
|
||||
<translation>Omezit počet uchovávaných předchozích verzí položky na:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Max. history size:</source>
|
||||
<translation>Nejvyšší umožněný objem dat historie záznamů:</translation>
|
||||
<translation>Omezit datový objem předchozích verzí položek na:</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@@ -214,7 +255,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>KeePass 2 Database</source>
|
||||
<translation>Databáze aplikace KeePass verze 2</translation>
|
||||
<translation>Databáze ve formátu KeePass verze 2</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>All files</source>
|
||||
@@ -234,11 +275,11 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Open KeePass 1 database</source>
|
||||
<translation>Otevřít databázi aplikace KeePass verze 1</translation>
|
||||
<translation>Otevřít databázi ve formátu KeePass verze 1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>KeePass 1 database</source>
|
||||
<translation>Databáze aplikace KeePass verze 1</translation>
|
||||
<translation>Databáze ve formátu KeePass verze 1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>All files (*)</source>
|
||||
@@ -255,7 +296,7 @@
|
||||
<message>
|
||||
<source>"%1" was modified.
|
||||
Save changes?</source>
|
||||
<translation>%1 bylo změněno.
|
||||
<translation>„%1“ bylo změněno.
|
||||
Uložit změny?</translation>
|
||||
</message>
|
||||
<message>
|
||||
@@ -282,7 +323,7 @@ Uložit změny?</translation>
|
||||
<source>The database you are trying to open is locked by another instance of KeePassX.
|
||||
Do you want to open it anyway? Alternatively the database is opened read-only.</source>
|
||||
<translation>Pro databázi, kterou se pokoušíte otevřít, existuje zámek úprav (stejnojmenný
|
||||
.lock soubor). To znamená, že je nejspíš již otevřená v jiném okně KeePassX
|
||||
.lock soubor). To znamená, že je nejspíš už otevřená v jiném okně KeePassX
|
||||
(v případě sdíleného úložiště, třeba i na jiném počítači). Pokud tomu tak není,
|
||||
je zámek nejspíš pozůstatkem předchozího neočekávaného ukončení aplikace
|
||||
a je možné ho smazat. V každém případě, dotčenou databázi je možné otevřít
|
||||
@@ -302,7 +343,7 @@ Pokud chcete změny dokončit, klikněte na Zrušit. V opačném případě změ
|
||||
<source>This database has never been saved.
|
||||
You can save the database or stop locking it.</source>
|
||||
<translation>Tato databáze doposud ještě nebyla uložena.
|
||||
Buď ji můžete uložit, nebo neuzamykat.</translation>
|
||||
Buď ji můžete uložit, nebo neuzamknout.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>This database has been modified.
|
||||
@@ -315,7 +356,7 @@ Pokud ne, provedené změny budou ztraceny.</translation>
|
||||
<message>
|
||||
<source>"%1" is in edit mode.
|
||||
Discard changes and close anyway?</source>
|
||||
<translation>%1 je právě upravováno.
|
||||
<translation>„%1“ je právě upravováno.
|
||||
Přesto zavřít a zahodit změny?</translation>
|
||||
</message>
|
||||
<message>
|
||||
@@ -349,7 +390,7 @@ Přesto uložit?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Do you really want to delete the entry "%1" for good?</source>
|
||||
<translation>Opravdu chcete nenávratně smazat položku %1?</translation>
|
||||
<translation>Opravdu chcete nenávratně smazat položku „%1“?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Delete entries?</source>
|
||||
@@ -373,7 +414,7 @@ Přesto uložit?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Do you really want to delete the group "%1" for good?</source>
|
||||
<translation>Opravdu chcete nenávratně smazat skupinu %1?</translation>
|
||||
<translation>Opravdu chcete nenávratně smazat skupinu „%1“?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Current group</source>
|
||||
@@ -385,7 +426,7 @@ Přesto uložit?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unable to calculate master key</source>
|
||||
<translation>Nepodařilo se spočítat hlavní klíč</translation>
|
||||
<translation>Nedaří se spočítat hlavní klíč</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@@ -520,11 +561,11 @@ Přesto uložit?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>+</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>+</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>-</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>-</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Window title:</source>
|
||||
@@ -574,7 +615,7 @@ Přesto uložit?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Repeat:</source>
|
||||
<translation>Zopakovat:</translation>
|
||||
<translation>Zopakování hesla:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Gen.</source>
|
||||
@@ -590,7 +631,7 @@ Přesto uložit?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Presets</source>
|
||||
<translation>Přednastavené</translation>
|
||||
<translation>Předpřipravené</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Notes:</source>
|
||||
@@ -699,7 +740,7 @@ Přesto uložit?</translation>
|
||||
</message>
|
||||
<message numerus="yes">
|
||||
<source>Can't delete icon. Still used by %n item(s).</source>
|
||||
<translation><numerusform>Ikonu není možné smazat. Je používána %n položkou.</numerusform><numerusform>Ikonu není možné smazat. Je používána %n položkami.</numerusform><numerusform>Ikonu není možné smazat. Používá ji %n položek</numerusform></translation>
|
||||
<translation><numerusform>Ikonu není možné smazat. Je používána %n položkou.</numerusform><numerusform>Ikonu není možné smazat. Je používána %n položkami.</numerusform><numerusform>Ikonu není možné smazat. Ještě jí používá %n položek.</numerusform></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@@ -777,7 +818,7 @@ Přesto uložit?</translation>
|
||||
<name>KeePass1OpenWidget</name>
|
||||
<message>
|
||||
<source>Import KeePass1 database</source>
|
||||
<translation>Importovat databázi aplikace KeePass verze 1</translation>
|
||||
<translation>Importovat databázi ve formátu KeePass verze 1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Error</source>
|
||||
@@ -785,14 +826,14 @@ Přesto uložit?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unable to open the database.</source>
|
||||
<translation>Databázi nelze otevřít.</translation>
|
||||
<translation>Databázi se nedaří otevřít.</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>KeePass1Reader</name>
|
||||
<message>
|
||||
<source>Unable to read keyfile.</source>
|
||||
<translation>Soubor s klíčem nebylo možné načíst.</translation>
|
||||
<translation>Nedaří se načíst soubor s klíčem.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Not a KeePass database.</source>
|
||||
@@ -833,6 +874,16 @@ Přesto uložit?</translation>
|
||||
<source>Unable to calculate master key</source>
|
||||
<translation>Nedaří se spočítat hlavní klíč</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The selected file is an old KeePass 1 database (.kdb).
|
||||
|
||||
You can import it by clicking on Database > 'Import KeePass 1 database'.
|
||||
This is a one-way migration. You won't be able to open the imported database with the old KeePassX 0.4 version.</source>
|
||||
<translation>Zvolený soubor je databáze ve starém formátu KeePass 1 (.kdb).
|
||||
|
||||
Můžete ho importovat pomocí Databáze → Importovat databázi KeePass 1.
|
||||
Jedná se o jednosměrný převod. Databázi, vzniklou z importu, nepůjde otevřít ve staré verzi KeePassX 0.4.</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>Main</name>
|
||||
@@ -877,7 +928,7 @@ Přesto uložit?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Quit</source>
|
||||
<translation>Ukončit</translation>
|
||||
<translation>Ukončit aplikaci</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>About</source>
|
||||
@@ -993,7 +1044,7 @@ Přesto uložit?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Toggle window</source>
|
||||
<translation>Přepnout okno</translation>
|
||||
<translation>Zobrazit/skrýt okno</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Tools</source>
|
||||
@@ -1011,6 +1062,30 @@ Přesto uložit?</translation>
|
||||
<source>Export to CSV file</source>
|
||||
<translation>Exportovat do CSV souboru</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Repair database</source>
|
||||
<translation>Opravit databázi</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>KeePass 2 Database</source>
|
||||
<translation>Databáze ve formátu KeePass 2</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>All files</source>
|
||||
<translation>Všechny soubory</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Save repaired database</source>
|
||||
<translation>Uložit opravenou databázi</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Error</source>
|
||||
<translation>Chyba</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Writing the database failed.</source>
|
||||
<translation>Zápis do databáze se nezdařil.</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>PasswordGeneratorWidget</name>
|
||||
@@ -1036,7 +1111,7 @@ Přesto uložit?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Numbers</source>
|
||||
<translation>Čísla</translation>
|
||||
<translation>Číslice</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Special Characters</source>
|
||||
@@ -1155,7 +1230,7 @@ Přesto uložit?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Case sensitive</source>
|
||||
<translation>Rozlišovat velikost písmen</translation>
|
||||
<translation>Rozlišovat malá/velká písmena</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Current group</source>
|
||||
@@ -1221,7 +1296,7 @@ Přesto uložit?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Show a system tray icon</source>
|
||||
<translation>Zobrazit ikonu v oznamovací oblasti systémového panelu</translation>
|
||||
<translation>Zobrazovat ikonu v oznamovací oblasti systémového panelu</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Hide window to system tray when minimized</source>
|
||||
|
||||
@@ -13,6 +13,10 @@
|
||||
<source>Revision</source>
|
||||
<translation>Revision</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Using:</source>
|
||||
<translation>Bruger:</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>AutoType</name>
|
||||
@@ -167,6 +171,43 @@
|
||||
<translation>Vælg nøglefil</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DatabaseRepairWidget</name>
|
||||
<message>
|
||||
<source>Repair database</source>
|
||||
<translation>Reparer database</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Error</source>
|
||||
<translation>Fejl</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Can't open key file</source>
|
||||
<translation>Kan ikke åbne nøglefil</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Database opened fine. Nothing to do.</source>
|
||||
<translation>Databasen åbnede fint. Intet at gøre.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unable to open the database.</source>
|
||||
<translation>Kan ikke åbne databasen.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Success</source>
|
||||
<translation>Succes</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The database has been successfully repaired
|
||||
You can now save it.</source>
|
||||
<translation>Databasen er blevet succesfuldt repareret
|
||||
Du kan gemme den nu.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unable to repair the database.</source>
|
||||
<translation>Kan ikke reparere databasen.</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DatabaseSettingsWidget</name>
|
||||
<message>
|
||||
@@ -828,6 +869,16 @@ Vil du alligevel gemme?</translation>
|
||||
<source>Unable to calculate master key</source>
|
||||
<translation>Kan ikke beregne hovednøgle</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The selected file is an old KeePass 1 database (.kdb).
|
||||
|
||||
You can import it by clicking on Database > 'Import KeePass 1 database'.
|
||||
This is a one-way migration. You won't be able to open the imported database with the old KeePassX 0.4 version.</source>
|
||||
<translation>Den valgte fil er en gammel KeePass 1 databasefil (.kdb).
|
||||
|
||||
Du kan importere den ved at klikke på Database > 'Importér KeePass 1 database'.
|
||||
Dette er en envejs konvertering. Du vil ikke være i stand til at åbne den importerede database med den gamle KeePassX 0.4 version.</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>Main</name>
|
||||
@@ -1006,6 +1057,30 @@ Vil du alligevel gemme?</translation>
|
||||
<source>Export to CSV file</source>
|
||||
<translation>Eksportér til CSV-fil</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Repair database</source>
|
||||
<translation>Reparer database</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>KeePass 2 Database</source>
|
||||
<translation>KeePass 2 Database</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>All files</source>
|
||||
<translation>Alle filer</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Save repaired database</source>
|
||||
<translation>Gem repareret database</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Error</source>
|
||||
<translation>Fejl</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Writing the database failed.</source>
|
||||
<translation>Skrivning til database fejler.</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>PasswordGeneratorWidget</name>
|
||||
|
||||
@@ -13,6 +13,10 @@
|
||||
<source>Revision</source>
|
||||
<translation>Überarbeitung</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Using:</source>
|
||||
<translation>In Benutzung:</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>AutoType</name>
|
||||
@@ -166,6 +170,43 @@
|
||||
<translation>Schlüsseldatei auswählen</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DatabaseRepairWidget</name>
|
||||
<message>
|
||||
<source>Repair database</source>
|
||||
<translation>Datenbank reparieren</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Error</source>
|
||||
<translation>Fehler</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Can't open key file</source>
|
||||
<translation>Schlüsseldatei kann nicht geöffnet werden</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Database opened fine. Nothing to do.</source>
|
||||
<translation>Datenbank wurde ordnungsgemäß geöffnet. Es gibt nichts zu tun.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unable to open the database.</source>
|
||||
<translation>Öffnen der Datenbank nicht möglich.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Success</source>
|
||||
<translation>Erfolg</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The database has been successfully repaired
|
||||
You can now save it.</source>
|
||||
<translation>Datenbank erfolgreich repariert
|
||||
sie kann nun gespeichert werden.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unable to repair the database.</source>
|
||||
<translation>Reparieren der Datenbank nicht möglich.</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DatabaseSettingsWidget</name>
|
||||
<message>
|
||||
@@ -826,6 +867,16 @@ Soll sie dennoch gespeichert werden? </translation>
|
||||
<source>Unable to calculate master key</source>
|
||||
<translation>Berechnung des "master keys" gescheitert</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The selected file is an old KeePass 1 database (.kdb).
|
||||
|
||||
You can import it by clicking on Database > 'Import KeePass 1 database'.
|
||||
This is a one-way migration. You won't be able to open the imported database with the old KeePassX 0.4 version.</source>
|
||||
<translation>Die ausgewählte Datei ist eine alte KeePass 1 Datenbank (.kdb).
|
||||
|
||||
Zum Importieren gehen Sie auf Datenbank > 'KeePass 1 Datenbank importieren'.
|
||||
Dieser Vorgang ist nur in eine Richtung möglich. Die importierte Datenbank kann später nicht mehr mit der alten KeePassX Version 0.4 geöffnet werden.</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>Main</name>
|
||||
@@ -1004,6 +1055,30 @@ Soll sie dennoch gespeichert werden? </translation>
|
||||
<source>Export to CSV file</source>
|
||||
<translation>Als CSV Datei exportieren</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Repair database</source>
|
||||
<translation>Datenbank reparieren</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>KeePass 2 Database</source>
|
||||
<translation>KeePass 2 Datenbank</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>All files</source>
|
||||
<translation>Alle Dateien</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Save repaired database</source>
|
||||
<translation>Reparierte Datenbank speichern</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Error</source>
|
||||
<translation>Fehler</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Writing the database failed.</source>
|
||||
<translation>Schreiben der Datenbank fehlgeschlagen.</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>PasswordGeneratorWidget</name>
|
||||
@@ -1220,6 +1295,14 @@ Soll sie dennoch gespeichert werden? </translation>
|
||||
<source>Hide window to system tray when minimized</source>
|
||||
<translation>Fenster verstecken wenn minimiert</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Hide window to system tray instead of App Exit</source>
|
||||
<translation>Fenster zu Taskleistensymbol minimieren statt Programm beenden</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Hide window to system tray on App start</source>
|
||||
<translation>Fenster zu Taskleistensymbol minimieren wenn Programm started</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Remember last key files</source>
|
||||
<translation>Letzte Schlüsseldateien merken</translation>
|
||||
|
||||
@@ -172,6 +172,42 @@
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DatabaseRepairWidget</name>
|
||||
<message>
|
||||
<source>Repair database</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Error</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Can't open key file</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Database opened fine. Nothing to do.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unable to open the database.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Success</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The database has been successfully repaired
|
||||
You can now save it.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unable to repair the database.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DatabaseSettingsWidget</name>
|
||||
<message>
|
||||
@@ -329,6 +365,10 @@ Discard changes and close anyway?</source>
|
||||
Do you want to save it anyway?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unable to open the database.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DatabaseWidget</name>
|
||||
@@ -383,6 +423,14 @@ Do you want to save it anyway?</source>
|
||||
<source>Unable to calculate master key</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Move entry to recycle bin?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Do you really want to move entry "%1" to the recycle bin?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>EditEntryWidget</name>
|
||||
@@ -705,6 +753,14 @@ Do you want to save it anyway?</source>
|
||||
<numerusform></numerusform>
|
||||
</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Error</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Can't read icon:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>EditWidgetProperties</name>
|
||||
@@ -818,6 +874,10 @@ Do you want to save it anyway?</source>
|
||||
<source>Unable to calculate master key</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Wrong key or database file is corrupt.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>KeePass2Reader</name>
|
||||
@@ -1022,6 +1082,30 @@ This is a one-way migration. You won't be able to open the imported databas
|
||||
<source>Export to CSV file</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Repair database</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>KeePass 2 Database</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>All files</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Save repaired database</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Error</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Writing the database failed.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>PasswordGeneratorWidget</name>
|
||||
@@ -1242,6 +1326,14 @@ This is a one-way migration. You won't be able to open the imported databas
|
||||
<source>Remember last key files</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Hide window to system tray instead of App Exit</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Hide window to system tray on App start</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SettingsWidgetSecurity</name>
|
||||
|
||||
@@ -9,6 +9,14 @@
|
||||
<source>KeePassX is distributed under the term of the GNU General Public License (GPL) version 2 or (at your option) version 3.</source>
|
||||
<translation>KeePassX es distribuido bajo los términos de la versión 2 de la Licencia Pública GNU (GPL) o por la versión 3 (si así lo prefiere).</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Revision</source>
|
||||
<translation>Revisión</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Using:</source>
|
||||
<translation>Usando:</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>AutoType</name>
|
||||
@@ -163,6 +171,43 @@
|
||||
<translation>Seleccionar archivo llave</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DatabaseRepairWidget</name>
|
||||
<message>
|
||||
<source>Repair database</source>
|
||||
<translation>Reparar base de datos</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Error</source>
|
||||
<translation>Error</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Can't open key file</source>
|
||||
<translation>No se puede abrir el archivo llave</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Database opened fine. Nothing to do.</source>
|
||||
<translation>Base de datos abierta correctamente. Nada que hacer.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unable to open the database.</source>
|
||||
<translation>No se pudo abrir la base de datos.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Success</source>
|
||||
<translation>Éxito</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The database has been successfully repaired
|
||||
You can now save it.</source>
|
||||
<translation>La base de datos ha sido reparada correctamente
|
||||
Ahora puede guardarla.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unable to repair the database.</source>
|
||||
<translation>No se pudo reparar la base de datos.</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DatabaseSettingsWidget</name>
|
||||
<message>
|
||||
@@ -322,6 +367,12 @@ Discard changes and close anyway?</source>
|
||||
<source>Writing the CSV file failed.</source>
|
||||
<translation>La escritura del archivo CSV falló.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The database you are trying to save as is locked by another instance of KeePassX.
|
||||
Do you want to save it anyway?</source>
|
||||
<translation>La base de datos que está tratando de guardar está bloqueda por otra instancia de KeePassX.
|
||||
̉¿Desea guardarla de cualquier manera?</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DatabaseWidget</name>
|
||||
@@ -819,6 +870,16 @@ Discard changes and close anyway?</source>
|
||||
<source>Unable to calculate master key</source>
|
||||
<translation>No se puede calcular la clave maestra</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The selected file is an old KeePass 1 database (.kdb).
|
||||
|
||||
You can import it by clicking on Database > 'Import KeePass 1 database'.
|
||||
This is a one-way migration. You won't be able to open the imported database with the old KeePassX 0.4 version.</source>
|
||||
<translation>El archivo seleccionado es una vieja base de datos de KeePass 1 (.kdb).
|
||||
|
||||
Puede importarla haciendo click en 'Base de datos' > 'Importar base de datos de Keepass 1'.
|
||||
Esta migración es en un único sentido. No podrá abrir la base importada con la vieja versión 0.4 de KeePassX. </translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>Main</name>
|
||||
@@ -997,6 +1058,30 @@ Discard changes and close anyway?</source>
|
||||
<source>Export to CSV file</source>
|
||||
<translation>Exportar a un archivo CSV</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Repair database</source>
|
||||
<translation>Reparar la base de datos</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>KeePass 2 Database</source>
|
||||
<translation>Base de datos de KeePass 2</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>All files</source>
|
||||
<translation>Todos los archivos</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Save repaired database</source>
|
||||
<translation>Guardar base de datos reparada</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Error</source>
|
||||
<translation>Error</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Writing the database failed.</source>
|
||||
<translation>Fallo al escribir la base de datos.</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>PasswordGeneratorWidget</name>
|
||||
@@ -1269,10 +1354,6 @@ Discard changes and close anyway?</source>
|
||||
<source>path to a custom config file</source>
|
||||
<translation>ruta a un archivo de configuración personalizado</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>password of the database (DANGEROUS!)</source>
|
||||
<translation>contraseña de la base de datos (¡PELIGROSO!)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>key file of the database</source>
|
||||
<translation>archivo llave de la base de datos</translation>
|
||||
|
||||
@@ -13,6 +13,10 @@
|
||||
<source>Revision</source>
|
||||
<translation>Version</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Using:</source>
|
||||
<translation>Utilise :</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>AutoType</name>
|
||||
@@ -79,7 +83,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Key files</source>
|
||||
<translation>Fichiers de clé</translation>
|
||||
<translation>Fichiers-clés</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>All files</source>
|
||||
@@ -120,7 +124,7 @@
|
||||
<message>
|
||||
<source>Failed to set %1 as the Key file:
|
||||
%2</source>
|
||||
<translation>Impossible de définir %1 comme fichier-clé:
|
||||
<translation>Impossible de définir %1 comme fichier-clé :
|
||||
%2</translation>
|
||||
</message>
|
||||
</context>
|
||||
@@ -167,6 +171,43 @@
|
||||
<translation>Choisissez un fichier-clé</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DatabaseRepairWidget</name>
|
||||
<message>
|
||||
<source>Repair database</source>
|
||||
<translation>Réparer la base de données</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Error</source>
|
||||
<translation>Erreur</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Can't open key file</source>
|
||||
<translation>Impossible d'ouvrir le fichier-clé</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Database opened fine. Nothing to do.</source>
|
||||
<translation>La base de données s'est bien ouverte. Aucune action à effectuer.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unable to open the database.</source>
|
||||
<translation>Impossible d'ouvrir la base de données.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Success</source>
|
||||
<translation>Succès</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The database has been successfully repaired
|
||||
You can now save it.</source>
|
||||
<translation>La base de données a correctement été réparée.
|
||||
Vous pouvez maintenant la sauvegarder.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unable to repair the database.</source>
|
||||
<translation>Impossible de réparer la base de données.</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DatabaseSettingsWidget</name>
|
||||
<message>
|
||||
@@ -286,7 +327,7 @@ Voulez-vous quand même l'ouvrir ? Dans ce cas, elle sera ouverte en lectur
|
||||
</message>
|
||||
<message>
|
||||
<source>Lock database</source>
|
||||
<translation>Verrouiiler la base de données</translation>
|
||||
<translation>Verrouiller la base de données</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Can't lock the database as you are currently editing it.
|
||||
@@ -449,7 +490,7 @@ Voulez-vous quand même la sauvegarder ?</translation>
|
||||
<message>
|
||||
<source>Unable to save the attachment:
|
||||
</source>
|
||||
<translation>Impossible d'enregistrer le fichier attaché:
|
||||
<translation>Impossible d'enregistrer le fichier attaché :
|
||||
</translation>
|
||||
</message>
|
||||
<message>
|
||||
@@ -532,7 +573,7 @@ Voulez-vous quand même la sauvegarder ?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Set custom sequence:</source>
|
||||
<translation>Définir une séquence personnalisé :</translation>
|
||||
<translation>Définir une séquence personnalisée :</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@@ -562,7 +603,7 @@ Voulez-vous quand même la sauvegarder ?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Username:</source>
|
||||
<translation>Non d'utilisateur :</translation>
|
||||
<translation>Nom d'utilisateur :</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Password:</source>
|
||||
@@ -755,7 +796,7 @@ Voulez-vous quand même la sauvegarder ?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Username</source>
|
||||
<translation>Non d'utilisateur</translation>
|
||||
<translation>Nom d'utilisateur</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>URL</source>
|
||||
@@ -792,7 +833,7 @@ Voulez-vous quand même la sauvegarder ?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Not a KeePass database.</source>
|
||||
<translation>Ce n'est pas une base de donnée KeePass.</translation>
|
||||
<translation>Ce n'est pas une base de données KeePass.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unsupported encryption algorithm.</source>
|
||||
@@ -800,7 +841,7 @@ Voulez-vous quand même la sauvegarder ?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unsupported KeePass database version.</source>
|
||||
<translation>Version de base de donnée KeePass non supportée.</translation>
|
||||
<translation>Version de base de données KeePass non supportée.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Root</source>
|
||||
@@ -815,20 +856,30 @@ Voulez-vous quand même la sauvegarder ?</translation>
|
||||
<name>KeePass2Reader</name>
|
||||
<message>
|
||||
<source>Not a KeePass database.</source>
|
||||
<translation>Ce n'est pas une base de donnée KeePass.</translation>
|
||||
<translation>Ce n'est pas une base de données KeePass.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unsupported KeePass database version.</source>
|
||||
<translation>Version de base de donnée KeePass non supportée.</translation>
|
||||
<translation>Version de base de données KeePass non supportée.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Wrong key or database file is corrupt.</source>
|
||||
<translation>Mauvaise clé ou fichier de base de donnée corrompu.</translation>
|
||||
<translation>Mauvaise clé ou fichier de base de données corrompu.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unable to calculate master key</source>
|
||||
<translation>Impossible de calculer la clé maître</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The selected file is an old KeePass 1 database (.kdb).
|
||||
|
||||
You can import it by clicking on Database > 'Import KeePass 1 database'.
|
||||
This is a one-way migration. You won't be able to open the imported database with the old KeePassX 0.4 version.</source>
|
||||
<translation>Le fichier sélectionné est une ancienne base de données pour KeePass 1 (.kdb).
|
||||
|
||||
Vous pouvez l'importer en cliquant sur "Base de données" > "Importer une base de données KeePass 1".
|
||||
Ceci est une migration à sens unique. Vous ne serez plus en mesure d'ouvrir la base de données importée avec l'ancienne version KeePassX version 0.4.</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>Main</name>
|
||||
@@ -861,7 +912,7 @@ Voulez-vous quand même la sauvegarder ?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Copy attribute to clipboard</source>
|
||||
<translation>Copier l'attribut dans le presse-papiers</translation>
|
||||
<translation>Copier l'attribut dans le presse-papier</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Groups</source>
|
||||
@@ -881,19 +932,19 @@ Voulez-vous quand même la sauvegarder ?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Open database</source>
|
||||
<translation>Ouvrir une base de donnée</translation>
|
||||
<translation>Ouvrir une base de données</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Save database</source>
|
||||
<translation>Enregistrer la base de donnée</translation>
|
||||
<translation>Enregistrer la base de données</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Close database</source>
|
||||
<translation>Fermer la base de donnée</translation>
|
||||
<translation>Fermer la base de données</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>New database</source>
|
||||
<translation>Nouvelle base de donnée</translation>
|
||||
<translation>Nouvelle base de données</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Add new entry</source>
|
||||
@@ -921,7 +972,7 @@ Voulez-vous quand même la sauvegarder ?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Save database as</source>
|
||||
<translation>Enregistrer la base de donnée sous</translation>
|
||||
<translation>Enregistrer la base de données sous</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Change master key</source>
|
||||
@@ -929,11 +980,11 @@ Voulez-vous quand même la sauvegarder ?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Database settings</source>
|
||||
<translation>Paramètre de la base de donnée</translation>
|
||||
<translation>Paramètres de la base de données</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Import KeePass 1 database</source>
|
||||
<translation>Importer une base de donnée KeePass 1</translation>
|
||||
<translation>Importer une base de données KeePass 1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Clone entry</source>
|
||||
@@ -945,11 +996,11 @@ Voulez-vous quand même la sauvegarder ?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Copy username to clipboard</source>
|
||||
<translation>Copier le nom d'utilisateur dans le presse-papiers</translation>
|
||||
<translation>Copier le nom d'utilisateur dans le presse-papier</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Copy password to clipboard</source>
|
||||
<translation>Copier le mot de passe dans le presse-papiers</translation>
|
||||
<translation>Copier le mot de passe dans le presse-papier</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Settings</source>
|
||||
@@ -1007,6 +1058,30 @@ Voulez-vous quand même la sauvegarder ?</translation>
|
||||
<source>Export to CSV file</source>
|
||||
<translation>Exporter au format CSV</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Repair database</source>
|
||||
<translation>Réparer la base de données</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>KeePass 2 Database</source>
|
||||
<translation>Base de données KeePass 2</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>All files</source>
|
||||
<translation>Tous les fichiers</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Save repaired database</source>
|
||||
<translation>Sauvegarder la base de données réparée</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Error</source>
|
||||
<translation>Erreur</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Writing the database failed.</source>
|
||||
<translation>Une erreur s'est produite lors de l'écriture de la base de données.</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>PasswordGeneratorWidget</name>
|
||||
@@ -1020,7 +1095,7 @@ Voulez-vous quand même la sauvegarder ?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Character Types</source>
|
||||
<translation>Types de caractère</translation>
|
||||
<translation>Types de caractères</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Upper Case Letters</source>
|
||||
@@ -1055,7 +1130,7 @@ Voulez-vous quand même la sauvegarder ?</translation>
|
||||
<name>QCommandLineParser</name>
|
||||
<message>
|
||||
<source>Displays version information.</source>
|
||||
<translation>Afficher les informations de version</translation>
|
||||
<translation>Afficher les informations de version.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Displays this help.</source>
|
||||
@@ -1166,7 +1241,7 @@ Voulez-vous quand même la sauvegarder ?</translation>
|
||||
<name>SettingsWidget</name>
|
||||
<message>
|
||||
<source>Application Settings</source>
|
||||
<translation>Paramètre de l'application</translation>
|
||||
<translation>Paramètres de l'application</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>General</source>
|
||||
@@ -1185,19 +1260,19 @@ Voulez-vous quand même la sauvegarder ?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Open previous databases on startup</source>
|
||||
<translation>Ouvrir les base de données précédentes au démarrage</translation>
|
||||
<translation>Ouvrir les bases de données précédentes au démarrage</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Automatically save on exit</source>
|
||||
<translation>Sauvegarde automatiquement à la sortie</translation>
|
||||
<translation>Sauvegarder automatiquement à la sortie</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Automatically save after every change</source>
|
||||
<translation>Sauvegarde automatiquement après chaque modification</translation>
|
||||
<translation>Sauvegarder automatiquement après chaque modification</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Minimize when copying to clipboard</source>
|
||||
<translation>Réduire lors de la copie dans le presse-papiers</translation>
|
||||
<translation>Réduire lors de la copie dans le presse-papier</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Use group icon on entry creation</source>
|
||||
@@ -1232,7 +1307,7 @@ Voulez-vous quand même la sauvegarder ?</translation>
|
||||
<name>SettingsWidgetSecurity</name>
|
||||
<message>
|
||||
<source>Clear clipboard after</source>
|
||||
<translation>Vider le presse-papiers après</translation>
|
||||
<translation>Vider le presse-papier après</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source> sec</source>
|
||||
@@ -1240,7 +1315,7 @@ Voulez-vous quand même la sauvegarder ?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Lock databases after inactivity of</source>
|
||||
<translation>Verrouiller les bases de donnée après une inactivité de</translation>
|
||||
<translation>Verrouiller les bases de données après une inactivité de</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Show passwords in cleartext by default</source>
|
||||
@@ -1255,7 +1330,7 @@ Voulez-vous quand même la sauvegarder ?</translation>
|
||||
<name>UnlockDatabaseWidget</name>
|
||||
<message>
|
||||
<source>Unlock database</source>
|
||||
<translation>Déverrouiller la base de donnée</translation>
|
||||
<translation>Déverrouiller la base de données</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@@ -1273,7 +1348,7 @@ Voulez-vous quand même la sauvegarder ?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>filename of the password database to open (*.kdbx)</source>
|
||||
<translation>Nom de fichier de la base de donnée de mot de pass à ouvrir (*.kdbx)</translation>
|
||||
<translation>Nom de fichier de la base de données de mot de passe à ouvrir (*.kdbx)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>path to a custom config file</source>
|
||||
|
||||
@@ -13,6 +13,10 @@
|
||||
<source>Revision</source>
|
||||
<translation>Revisi</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Using:</source>
|
||||
<translation>Menggunakan:</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>AutoType</name>
|
||||
@@ -79,7 +83,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Key files</source>
|
||||
<translation>Berkas Kunci</translation>
|
||||
<translation>Berkas kunci</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>All files</source>
|
||||
@@ -99,7 +103,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Select a key file</source>
|
||||
<translation>Pilih sebuah berkas kunci</translation>
|
||||
<translation>Pilih berkas kunci</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Question</source>
|
||||
@@ -111,7 +115,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Different passwords supplied.</source>
|
||||
<translation>Sandi yang berbeda diberikan.</translation>
|
||||
<translation>Sandi berbeda.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Failed to set key file</source>
|
||||
@@ -167,6 +171,43 @@
|
||||
<translation>Pilih berkas kunci</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DatabaseRepairWidget</name>
|
||||
<message>
|
||||
<source>Repair database</source>
|
||||
<translation>Perbaiki basis data</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Error</source>
|
||||
<translation>Galat</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Can't open key file</source>
|
||||
<translation>Tidak bisa membuka berkas kunci</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Database opened fine. Nothing to do.</source>
|
||||
<translation>Basis data terbuka dengan baik. Tidak perlu melakukan apa-apa.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unable to open the database.</source>
|
||||
<translation>Tidak bisa membuka basis data.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Success</source>
|
||||
<translation>Sukses</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The database has been successfully repaired
|
||||
You can now save it.</source>
|
||||
<translation>Basis data berhasil diperbaiki
|
||||
Anda bisa menyimpannya sekarang.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unable to repair the database.</source>
|
||||
<translation>Tidak bisa memperbaiki basis data.</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DatabaseSettingsWidget</name>
|
||||
<message>
|
||||
@@ -428,7 +469,7 @@ Apakah Anda tetap ingin menyimpannya?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Different passwords supplied.</source>
|
||||
<translation>Kata sandi yang berbeda diberikan.</translation>
|
||||
<translation>Sandi berbeda.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>New attribute</source>
|
||||
@@ -586,7 +627,7 @@ Apakah Anda tetap ingin menyimpannya?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Presets</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Prasetel</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Notes:</source>
|
||||
@@ -829,6 +870,16 @@ Apakah Anda tetap ingin menyimpannya?</translation>
|
||||
<source>Unable to calculate master key</source>
|
||||
<translation>Tidak bisa mengkalkulasi kunci utama</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The selected file is an old KeePass 1 database (.kdb).
|
||||
|
||||
You can import it by clicking on Database > 'Import KeePass 1 database'.
|
||||
This is a one-way migration. You won't be able to open the imported database with the old KeePassX 0.4 version.</source>
|
||||
<translation>Berkas yang dipilih adalah basis data KeePass 1 yang lama (.kdb).
|
||||
|
||||
Anda bisa mengimpornya dengan mengklik Basis Data > 'Impor basis data KeePass 1'.
|
||||
Ini adalah migrasi satu arah. Anda tidak akan bisa lagi membuka basis data yang diimpor dengan versi lama KeePassX 0.4.</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>Main</name>
|
||||
@@ -1007,6 +1058,30 @@ Apakah Anda tetap ingin menyimpannya?</translation>
|
||||
<source>Export to CSV file</source>
|
||||
<translation>Ekspor ke berkas CSV</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Repair database</source>
|
||||
<translation>Perbaiki basis data</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>KeePass 2 Database</source>
|
||||
<translation>Basis Data KeePass 2</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>All files</source>
|
||||
<translation>Semua Berkas</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Save repaired database</source>
|
||||
<translation>Simpan basis data yang sudah diperbaiki</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Error</source>
|
||||
<translation>Galat</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Writing the database failed.</source>
|
||||
<translation>Gagal menyimpan basis data.</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>PasswordGeneratorWidget</name>
|
||||
@@ -1117,15 +1192,15 @@ Apakah Anda tetap ingin menyimpannya?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Error writing to underlying device: </source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Terjadi kesalahan saat menyimpan ke perangkat:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Error opening underlying device: </source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Terjadi kesalahan saat membuka perangkat:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Error reading data from underlying device: </source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Terjadi kesalahan saat membaca data dari perangkat:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Internal zlib error when decompressing: </source>
|
||||
|
||||
@@ -13,6 +13,10 @@
|
||||
<source>Revision</source>
|
||||
<translation>Revisione</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Using:</source>
|
||||
<translation>In uso:</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>AutoType</name>
|
||||
@@ -48,7 +52,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Select entry to Auto-Type:</source>
|
||||
<translation>Selezionare una voce per Auto-Type:</translation>
|
||||
<translation>Seleziona una voce per Auto-Type:</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@@ -59,11 +63,11 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Enter password:</source>
|
||||
<translation>Inserire password:</translation>
|
||||
<translation>Inserisci password:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Repeat password:</source>
|
||||
<translation>Ripetere password:</translation>
|
||||
<translation>Ripeti password:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Key file</source>
|
||||
@@ -75,7 +79,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Create</source>
|
||||
<translation>Creare</translation>
|
||||
<translation>Crea</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Key files</source>
|
||||
@@ -87,7 +91,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Create Key File...</source>
|
||||
<translation>Creare file chiave...</translation>
|
||||
<translation>Crea file chiave...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Error</source>
|
||||
@@ -120,18 +124,19 @@
|
||||
<message>
|
||||
<source>Failed to set %1 as the Key file:
|
||||
%2</source>
|
||||
<translation>Impossibile impostare %1 come file Chiave: %2</translation>
|
||||
<translation>Impossibile impostare %1 come file chiave:
|
||||
%2</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DatabaseOpenWidget</name>
|
||||
<message>
|
||||
<source>Enter master key</source>
|
||||
<translation>Inserire password</translation>
|
||||
<translation>Inserisci la chiave principale</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Key File:</source>
|
||||
<translation>File Chiave:</translation>
|
||||
<translation>File chiave:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Password:</source>
|
||||
@@ -139,7 +144,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Browse</source>
|
||||
<translation>Sfogliare</translation>
|
||||
<translation>Sfoglia</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Error</source>
|
||||
@@ -159,18 +164,55 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Key files</source>
|
||||
<translation>Files chiave</translation>
|
||||
<translation>File chiave</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Select key file</source>
|
||||
<translation>Seleziona file chiave</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DatabaseRepairWidget</name>
|
||||
<message>
|
||||
<source>Repair database</source>
|
||||
<translation>Ripara database</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Error</source>
|
||||
<translation>Errore</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Can't open key file</source>
|
||||
<translation>Impossibile aprire il file chiave</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Database opened fine. Nothing to do.</source>
|
||||
<translation>Database aperto correttamente. Nessuna operazione da eseguire.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unable to open the database.</source>
|
||||
<translation>Impossibile aprire il database</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Success</source>
|
||||
<translation>Successo</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The database has been successfully repaired
|
||||
You can now save it.</source>
|
||||
<translation>Il database è stato riparato con successo
|
||||
Adesso puoi salvarlo.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unable to repair the database.</source>
|
||||
<translation>Impossibile riparare il database</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DatabaseSettingsWidget</name>
|
||||
<message>
|
||||
<source>Database name:</source>
|
||||
<translation>Nome database:</translation>
|
||||
<translation>Nome del database:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Database description:</source>
|
||||
@@ -178,7 +220,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Transform rounds:</source>
|
||||
<translation>Rounds di trasformazione:</translation>
|
||||
<translation>Round di trasformazione:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Default username:</source>
|
||||
@@ -186,7 +228,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Use recycle bin:</source>
|
||||
<translation>Utilizzare cestino:</translation>
|
||||
<translation>Utilizza cestino:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source> MiB</source>
|
||||
@@ -254,7 +296,7 @@
|
||||
<message>
|
||||
<source>"%1" was modified.
|
||||
Save changes?</source>
|
||||
<translation>"%1" è stata modificata.
|
||||
<translation>"%1" è stata modificato.
|
||||
Salvare le modifiche?</translation>
|
||||
</message>
|
||||
<message>
|
||||
@@ -263,11 +305,11 @@ Salvare le modifiche?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Writing the database failed.</source>
|
||||
<translation>Scrittura del database fallita.</translation>
|
||||
<translation>Scrittura del database non riuscita.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Save database as</source>
|
||||
<translation>Salvare database come</translation>
|
||||
<translation>Salva database come</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>New database</source>
|
||||
@@ -280,18 +322,18 @@ Salvare le modifiche?</translation>
|
||||
<message>
|
||||
<source>The database you are trying to open is locked by another instance of KeePassX.
|
||||
Do you want to open it anyway? Alternatively the database is opened read-only.</source>
|
||||
<translation>Il Database che stai tentando di aprire è bloccato da un'altra esecuzione di KeePassX.
|
||||
Vuoi aprirlo comunque? In alternativa, il database verrà aperto in sola lettura.</translation>
|
||||
<translation>Il database che stai tentando di aprire è bloccato da un'altra istanza di KeePassX.
|
||||
Vuoi aprirlo comunque? Altrimenti il database verrà aperto in sola lettura.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Lock database</source>
|
||||
<translation>Bloccare database</translation>
|
||||
<translation>Blocca database</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Can't lock the database as you are currently editing it.
|
||||
Please press cancel to finish your changes or discard them.</source>
|
||||
<translation>Non è possibile bloccare il database nel modo in cui lo stai modificando.
|
||||
Premere annulla per terminare le modifiche o scartarle .</translation>
|
||||
<translation>Non è possibile bloccare il database dato che lo stai modificando.
|
||||
Premere Annulla per completare le modifiche o scartarle.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>This database has never been saved.
|
||||
@@ -323,12 +365,12 @@ Annullare le modifiche e chiudere comunque?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Writing the CSV file failed.</source>
|
||||
<translation>Scrittura del file CSV fallita.</translation>
|
||||
<translation>Scrittura del file CSV non riuscita.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The database you are trying to save as is locked by another instance of KeePassX.
|
||||
Do you want to save it anyway?</source>
|
||||
<translation>Il database che si sta tentando di salvare è bloccato da un'altra istanza di KeePassX.
|
||||
<translation>Il database che stai tentando di salvare è bloccato da un'altra istanza di KeePassX.
|
||||
Vuoi salvare comunque?</translation>
|
||||
</message>
|
||||
</context>
|
||||
@@ -336,7 +378,7 @@ Vuoi salvare comunque?</translation>
|
||||
<name>DatabaseWidget</name>
|
||||
<message>
|
||||
<source>Change master key</source>
|
||||
<translation>Cambia password principale</translation>
|
||||
<translation>Cambia chiave principale</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Delete entry?</source>
|
||||
@@ -457,15 +499,15 @@ Vuoi salvare comunque?</translation>
|
||||
</message>
|
||||
<message numerus="yes">
|
||||
<source>%n week(s)</source>
|
||||
<translation><numerusform>%n settimana(e)</numerusform><numerusform>%n settimana(e)</numerusform></translation>
|
||||
<translation><numerusform>%n settimana</numerusform><numerusform>%n settimane</numerusform></translation>
|
||||
</message>
|
||||
<message numerus="yes">
|
||||
<source>%n month(s)</source>
|
||||
<translation><numerusform>%n mese(i)</numerusform><numerusform>%n mese(i)</numerusform></translation>
|
||||
<translation><numerusform>%n mese</numerusform><numerusform>%n mesi</numerusform></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>1 year</source>
|
||||
<translation>1 anno</translation>
|
||||
<translation>Un anno</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@@ -476,15 +518,15 @@ Vuoi salvare comunque?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Add</source>
|
||||
<translation>Aggiungere</translation>
|
||||
<translation>Aggiungi</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Edit</source>
|
||||
<translation>Modificare</translation>
|
||||
<translation>Modifica</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Remove</source>
|
||||
<translation>Rimuovere</translation>
|
||||
<translation>Rimuovi</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Attachments</source>
|
||||
@@ -492,26 +534,26 @@ Vuoi salvare comunque?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Save</source>
|
||||
<translation>Salvare</translation>
|
||||
<translation>Salva</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Open</source>
|
||||
<translation>Aprire</translation>
|
||||
<translation>Apri</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>EditEntryWidgetAutoType</name>
|
||||
<message>
|
||||
<source>Enable Auto-Type for this entry</source>
|
||||
<translation>Abilitare Auto-Type per questa voce</translation>
|
||||
<translation>Abilita Auto-Type per questa voce</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Inherit default Auto-Type sequence from the group</source>
|
||||
<translation>Ereditare la sequenza predefinita di Auto-Type dal gruppo</translation>
|
||||
<translation>Eredita la sequenza predefinita di Auto-Type dal gruppo</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Use custom Auto-Type sequence:</source>
|
||||
<translation>Usare sequenza personalizzata di Auto-Type:</translation>
|
||||
<translation>Usa sequenza personalizzata di Auto-Type:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>+</source>
|
||||
@@ -527,30 +569,30 @@ Vuoi salvare comunque?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Use default sequence</source>
|
||||
<translation>Usare sequenza predefinita</translation>
|
||||
<translation>Usa sequenza predefinita</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Set custom sequence:</source>
|
||||
<translation>Impostare sequenza personalizzata:</translation>
|
||||
<translation>Imposta sequenza personalizzata:</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>EditEntryWidgetHistory</name>
|
||||
<message>
|
||||
<source>Show</source>
|
||||
<translation>Mostrare</translation>
|
||||
<translation>Mostra</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Restore</source>
|
||||
<translation>Ripristinare</translation>
|
||||
<translation>Ripristina</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Delete</source>
|
||||
<translation>Eliminare</translation>
|
||||
<translation>Elimina</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Delete all</source>
|
||||
<translation>Eliminare tutti</translation>
|
||||
<translation>Elimina tutti</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@@ -569,7 +611,7 @@ Vuoi salvare comunque?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Repeat:</source>
|
||||
<translation>Ripetere:</translation>
|
||||
<translation>Ripeti:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Gen.</source>
|
||||
@@ -585,7 +627,7 @@ Vuoi salvare comunque?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Presets</source>
|
||||
<translation>Presets</translation>
|
||||
<translation>Preimpostazioni</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Notes:</source>
|
||||
@@ -624,7 +666,7 @@ Vuoi salvare comunque?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Inherit from parent group (%1)</source>
|
||||
<translation>Ereditare dal gruppo genitore (%1)</translation>
|
||||
<translation>Eredita dal gruppo genitore (%1)</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@@ -643,7 +685,7 @@ Vuoi salvare comunque?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Search</source>
|
||||
<translation>Cercare</translation>
|
||||
<translation>Cerca</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Auto-type</source>
|
||||
@@ -651,30 +693,30 @@ Vuoi salvare comunque?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Use default auto-type sequence of parent group</source>
|
||||
<translation>Ereditare la sequenza predefinita di auto-type dal gruppo</translation>
|
||||
<translation>Eredita la sequenza predefinita di auto-type dal gruppo</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Set default auto-type sequence</source>
|
||||
<translation>Usare sequenza auto-type predefinita</translation>
|
||||
<translation>Usa sequenza di auto-type predefinita</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>EditWidgetIcons</name>
|
||||
<message>
|
||||
<source>Use default icon</source>
|
||||
<translation>Usare icona predefinita</translation>
|
||||
<translation>Usa icona predefinita</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Use custom icon</source>
|
||||
<translation>Usare icona personalizzata</translation>
|
||||
<translation>Usa icona personalizzata</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Add custom icon</source>
|
||||
<translation>Aggiungere icona personalizzata</translation>
|
||||
<translation>Aggiungi icona personalizzata</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Delete custom icon</source>
|
||||
<translation>Rimuovere icona personalizzata</translation>
|
||||
<translation>Rimuovi icona personalizzata</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Images</source>
|
||||
@@ -686,7 +728,7 @@ Vuoi salvare comunque?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Select Image</source>
|
||||
<translation>Seleziona Immagine</translation>
|
||||
<translation>Seleziona immagine</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Can't delete icon!</source>
|
||||
@@ -694,18 +736,18 @@ Vuoi salvare comunque?</translation>
|
||||
</message>
|
||||
<message numerus="yes">
|
||||
<source>Can't delete icon. Still used by %n item(s).</source>
|
||||
<translation><numerusform>Impossibile eliminare l'icona in quanto è in uso da %n voce(i).</numerusform><numerusform>Impossibile eliminare l'icona in quanto è in uso da %n voce(i).</numerusform></translation>
|
||||
<translation><numerusform>Impossibile eliminare l'icona in quanto è in uso da %n voce.</numerusform><numerusform>Impossibile eliminare l'icona in quanto è in uso da %n voci.</numerusform></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>EditWidgetProperties</name>
|
||||
<message>
|
||||
<source>Created:</source>
|
||||
<translation>Creato:</translation>
|
||||
<translation>Creazione:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Modified:</source>
|
||||
<translation>Modificato:</translation>
|
||||
<translation>Modifica:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Accessed:</source>
|
||||
@@ -713,7 +755,7 @@ Vuoi salvare comunque?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Uuid:</source>
|
||||
<translation>Uuid:</translation>
|
||||
<translation>UUID:</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@@ -754,7 +796,7 @@ Vuoi salvare comunque?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Username</source>
|
||||
<translation>Nome Utente</translation>
|
||||
<translation>Nome utente</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>URL</source>
|
||||
@@ -772,7 +814,7 @@ Vuoi salvare comunque?</translation>
|
||||
<name>KeePass1OpenWidget</name>
|
||||
<message>
|
||||
<source>Import KeePass1 database</source>
|
||||
<translation>Importare database KeePass1</translation>
|
||||
<translation>Importa database KeePass1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Error</source>
|
||||
@@ -787,7 +829,7 @@ Vuoi salvare comunque?</translation>
|
||||
<name>KeePass1Reader</name>
|
||||
<message>
|
||||
<source>Unable to read keyfile.</source>
|
||||
<translation>Impossibile leggere il file chiave.</translation>
|
||||
<translation>Impossibile leggere il file della chiave.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Not a KeePass database.</source>
|
||||
@@ -807,7 +849,7 @@ Vuoi salvare comunque?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unable to calculate master key</source>
|
||||
<translation>Impossibile calcolare la chiave master</translation>
|
||||
<translation>Impossibile calcolare la chiave principale</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@@ -822,11 +864,21 @@ Vuoi salvare comunque?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Wrong key or database file is corrupt.</source>
|
||||
<translation>Password errata o file database corrotto.</translation>
|
||||
<translation>Chiave errata o file del database danneggiato.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unable to calculate master key</source>
|
||||
<translation>Impossibile calcolare la chiave master</translation>
|
||||
<translation>Impossibile calcolare la chiave principale</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The selected file is an old KeePass 1 database (.kdb).
|
||||
|
||||
You can import it by clicking on Database > 'Import KeePass 1 database'.
|
||||
This is a one-way migration. You won't be able to open the imported database with the old KeePassX 0.4 version.</source>
|
||||
<translation>Il file selezionato è un vecchio database KeePass 1 (.kdb).
|
||||
|
||||
Puoi importarlo facendo clic su Database > 'Importa database KeePass 1'.
|
||||
Questa è una migrazione in una sola direzione. Non potrai aprire il database importato con la vecchia versione 0.4 di KeePassX. </translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@@ -872,23 +924,23 @@ Vuoi salvare comunque?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Quit</source>
|
||||
<translation>Uscire</translation>
|
||||
<translation>Esci</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>About</source>
|
||||
<translation>A Proposito</translation>
|
||||
<translation>Informazioni</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Open database</source>
|
||||
<translation>Aprire database</translation>
|
||||
<translation>Apri database</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Save database</source>
|
||||
<translation>Salvare database</translation>
|
||||
<translation>Salva database</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Close database</source>
|
||||
<translation>Chiudere database</translation>
|
||||
<translation>Chiudi database</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>New database</source>
|
||||
@@ -896,35 +948,35 @@ Vuoi salvare comunque?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Add new entry</source>
|
||||
<translation>Aggiungere nuova voce</translation>
|
||||
<translation>Aggiungi nuova voce</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>View/Edit entry</source>
|
||||
<translation>Visualizzare/Modificare voce</translation>
|
||||
<translation>Visualizza/modifica voce</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Delete entry</source>
|
||||
<translation>Eliminare voce</translation>
|
||||
<translation>Elimina voce</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Add new group</source>
|
||||
<translation>Aggiungere nuovo gruppo</translation>
|
||||
<translation>Aggiungi nuovo gruppo</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Edit group</source>
|
||||
<translation>Modificare gruppo</translation>
|
||||
<translation>Modifica gruppo</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Delete group</source>
|
||||
<translation>Eliminare gruppo</translation>
|
||||
<translation>Elimina gruppo</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Save database as</source>
|
||||
<translation>Salvare database come</translation>
|
||||
<translation>Salva database come</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Change master key</source>
|
||||
<translation>Cambiare password principale</translation>
|
||||
<translation>Cambia chiave principale</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Database settings</source>
|
||||
@@ -932,7 +984,7 @@ Vuoi salvare comunque?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Import KeePass 1 database</source>
|
||||
<translation>Importare database KeePass 1</translation>
|
||||
<translation>Importa database KeePass 1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Clone entry</source>
|
||||
@@ -940,15 +992,15 @@ Vuoi salvare comunque?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Find</source>
|
||||
<translation>Trovare</translation>
|
||||
<translation>Trova</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Copy username to clipboard</source>
|
||||
<translation>Copiare nome utente negli appunti</translation>
|
||||
<translation>Copia nome utente negli appunti</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Copy password to clipboard</source>
|
||||
<translation>Copiare password negli appunti</translation>
|
||||
<translation>Copia password negli appunti</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Settings</source>
|
||||
@@ -956,15 +1008,15 @@ Vuoi salvare comunque?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Perform Auto-Type</source>
|
||||
<translation>Eseguire Auto-Type</translation>
|
||||
<translation>Esegui Auto-Type</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Open URL</source>
|
||||
<translation>Aprire URL</translation>
|
||||
<translation>Apri URL</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Lock databases</source>
|
||||
<translation>Bloccare database</translation>
|
||||
<translation>Blocca database</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Title</source>
|
||||
@@ -1006,6 +1058,30 @@ Vuoi salvare comunque?</translation>
|
||||
<source>Export to CSV file</source>
|
||||
<translation>Esporta in un file CSV</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Repair database</source>
|
||||
<translation>Ripara database</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>KeePass 2 Database</source>
|
||||
<translation>Database KeePass 2</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>All files</source>
|
||||
<translation>Tutti i file</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Save repaired database</source>
|
||||
<translation>Salva il database riparato</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Error</source>
|
||||
<translation>Errore</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Writing the database failed.</source>
|
||||
<translation>Scrittura del database non riuscita.</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>PasswordGeneratorWidget</name>
|
||||
@@ -1039,26 +1115,26 @@ Vuoi salvare comunque?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Exclude look-alike characters</source>
|
||||
<translation>Escludere caratteri simili</translation>
|
||||
<translation>Escludi caratteri simili</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Ensure that the password contains characters from every group</source>
|
||||
<translation>Assicurare che la password contenga caratteri di ogni gruppo</translation>
|
||||
<translation>Verifica che la password contenga caratteri di ogni gruppo</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Accept</source>
|
||||
<translation>Accettare</translation>
|
||||
<translation>Accetta</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>QCommandLineParser</name>
|
||||
<message>
|
||||
<source>Displays version information.</source>
|
||||
<translation>Mostrare informazioni sulla versione.</translation>
|
||||
<translation>Mostra informazioni sulla versione.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Displays this help.</source>
|
||||
<translation>Mostrare questo aiuto.</translation>
|
||||
<translation>Mostra questo aiuto.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unknown option '%1'.</source>
|
||||
@@ -1101,7 +1177,7 @@ Vuoi salvare comunque?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Writing canceled by application</source>
|
||||
<translation>Scrittura cancellata dall'applicazione</translation>
|
||||
<translation>Scrittura annullata dall'applicazione</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Partial write. Partition full?</source>
|
||||
@@ -1146,7 +1222,7 @@ Vuoi salvare comunque?</translation>
|
||||
<name>SearchWidget</name>
|
||||
<message>
|
||||
<source>Find:</source>
|
||||
<translation>Trovare:</translation>
|
||||
<translation>Trova:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Case sensitive</source>
|
||||
@@ -1184,23 +1260,23 @@ Vuoi salvare comunque?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Open previous databases on startup</source>
|
||||
<translation>Aprire precedente database all'avvio</translation>
|
||||
<translation>Apri il database precedente all'avvio</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Automatically save on exit</source>
|
||||
<translation>Salvare automaticamente all'uscita</translation>
|
||||
<translation>Salva automaticamente all'uscita</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Automatically save after every change</source>
|
||||
<translation>Salvare automaticamente dopo ogni modifica</translation>
|
||||
<translation>Salva automaticamente dopo ogni modifica</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Minimize when copying to clipboard</source>
|
||||
<translation>Minimizzare quando si copia negli appunti</translation>
|
||||
<translation>Minimizza quando si copia negli appunti</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Use group icon on entry creation</source>
|
||||
<translation>Usare l'icona del gruppo alla creazione di una voce</translation>
|
||||
<translation>Usa l'icona del gruppo alla creazione di una voce</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Global Auto-Type shortcut</source>
|
||||
@@ -1208,7 +1284,7 @@ Vuoi salvare comunque?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Use entry title to match windows for global auto-type</source>
|
||||
<translation>Utilizzare il titolo della voce per abbinare la finestra per auto-type globale</translation>
|
||||
<translation>Utilizza il titolo della voce per abbinare la finestra per auto-type globale</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Language</source>
|
||||
@@ -1224,14 +1300,14 @@ Vuoi salvare comunque?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Remember last key files</source>
|
||||
<translation>Ricorda gli ultimi files chiave</translation>
|
||||
<translation>Ricorda gli ultimi file di chiavi</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SettingsWidgetSecurity</name>
|
||||
<message>
|
||||
<source>Clear clipboard after</source>
|
||||
<translation>Pulire appunti dopo</translation>
|
||||
<translation>Pulisci appunti dopo</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source> sec</source>
|
||||
@@ -1239,22 +1315,22 @@ Vuoi salvare comunque?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Lock databases after inactivity of</source>
|
||||
<translation>Bloccare i database dopo un'inattività di</translation>
|
||||
<translation>Blocca i database dopo un'inattività di</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Show passwords in cleartext by default</source>
|
||||
<translation>Mostrare la password in chiaro in maniera predefinita</translation>
|
||||
<translation>Mostra la password in chiaro in maniera predefinita</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Always ask before performing auto-type</source>
|
||||
<translation>Chiedere sempre prima di eseguire auto-type</translation>
|
||||
<translation>Chiedi sempre prima di eseguire auto-type</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>UnlockDatabaseWidget</name>
|
||||
<message>
|
||||
<source>Unlock database</source>
|
||||
<translation>Sbloccare database</translation>
|
||||
<translation>Sblocca database</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@@ -1272,7 +1348,7 @@ Vuoi salvare comunque?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>filename of the password database to open (*.kdbx)</source>
|
||||
<translation>nome del file del database da aprire (*.kdbx)</translation>
|
||||
<translation>nome del file di database da aprire (*.kdbx)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>path to a custom config file</source>
|
||||
|
||||
@@ -9,6 +9,14 @@
|
||||
<source>KeePassX is distributed under the term of the GNU General Public License (GPL) version 2 or (at your option) version 3.</source>
|
||||
<translation>KeePassXはGNU General Public License (GPL) version 2 または version 3 (どちらかを選択)の条件で配布されます。</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Revision</source>
|
||||
<translation>リビジョン</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Using:</source>
|
||||
<translation>利用中:</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>AutoType</name>
|
||||
@@ -18,7 +26,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Couldn't find an entry that matches the window title:</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>ウィンドウタイトルに一致するエントリーが見つかりませんでした:</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@@ -29,11 +37,11 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Sequence</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>シーケンス</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Default sequence</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>デフォルトのシーケンス</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@@ -44,7 +52,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Select entry to Auto-Type:</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>自動入力するエントリーを選択してください:</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@@ -107,16 +115,17 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Different passwords supplied.</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>異なるパスワードが入力されました。</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Failed to set key file</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>キーファイルのセットに失敗しました</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Failed to set %1 as the Key file:
|
||||
%2</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>%1 をキーファイルとしてセットできませんでした:
|
||||
%2</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@@ -147,7 +156,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Can't open key file</source>
|
||||
<translation>キーファイルを開けませんでした。</translation>
|
||||
<translation>キーファイルを開けませんでした</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>All files</source>
|
||||
@@ -162,6 +171,43 @@
|
||||
<translation>キーファイルを選択</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DatabaseRepairWidget</name>
|
||||
<message>
|
||||
<source>Repair database</source>
|
||||
<translation>データベースを修復する</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Error</source>
|
||||
<translation>エラー</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Can't open key file</source>
|
||||
<translation>キーファイルを開けませんでした</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Database opened fine. Nothing to do.</source>
|
||||
<translation>データベースは正常に開かれています。行うべきことはありません。</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unable to open the database.</source>
|
||||
<translation>データベースを開けませんでした。</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Success</source>
|
||||
<translation>成功</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The database has been successfully repaired
|
||||
You can now save it.</source>
|
||||
<translation>データベースは正常に修復されました
|
||||
データベースの保存を行ってください。</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unable to repair the database.</source>
|
||||
<translation>データベースを修復できませんでした。</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DatabaseSettingsWidget</name>
|
||||
<message>
|
||||
@@ -205,7 +251,7 @@
|
||||
<name>DatabaseTabWidget</name>
|
||||
<message>
|
||||
<source>Root</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>ルート</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>KeePass 2 Database</source>
|
||||
@@ -286,35 +332,46 @@ Do you want to open it anyway? Alternatively the database is opened read-only.</
|
||||
<message>
|
||||
<source>Can't lock the database as you are currently editing it.
|
||||
Please press cancel to finish your changes or discard them.</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>現在編集中のため、データベースをロックすることができませんでした。
|
||||
キャンセルボタンを押し、変更を完了させるか破棄してください。</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>This database has never been saved.
|
||||
You can save the database or stop locking it.</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>このデータベースは一度も保存されていません。
|
||||
データベースを保存してロックを解除してください。</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>This database has been modified.
|
||||
Do you want to save the database before locking it?
|
||||
Otherwise your changes are lost.</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>このデータベースは変更されました。
|
||||
ロックを行う前にデータベースを保存しますか?
|
||||
保存しない場合には変更点は失われます。</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>"%1" is in edit mode.
|
||||
Discard changes and close anyway?</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>"%1" は現在編集モードです。
|
||||
変更を破棄して閉じてしまってもよろしいですか?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Export database to CSV file</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>データベースをCSVファイルにエクスポートする</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>CSV file</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>CSVファイル</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Writing the CSV file failed.</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>CSVファイルの書き込みに失敗しました。</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The database you are trying to save as is locked by another instance of KeePassX.
|
||||
Do you want to save it anyway?</source>
|
||||
<translation>保存しようとしたデータベースは別のKeePassXプログラムからロックされています。
|
||||
とにかく保存しますか?</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@@ -329,7 +386,7 @@ Discard changes and close anyway?</source>
|
||||
</message>
|
||||
<message>
|
||||
<source>Do you really want to delete the entry "%1" for good?</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>本当にエントリー "%1" を永遠に消去しますか?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Delete entries?</source>
|
||||
@@ -337,7 +394,7 @@ Discard changes and close anyway?</source>
|
||||
</message>
|
||||
<message>
|
||||
<source>Do you really want to delete %1 entries for good?</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>本当に %1 個のエントリーを永遠に消去しますか?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Move entries to recycle bin?</source>
|
||||
@@ -412,7 +469,7 @@ Discard changes and close anyway?</source>
|
||||
</message>
|
||||
<message>
|
||||
<source>Different passwords supplied.</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>異なるパスワードが入力されました。</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>New attribute</source>
|
||||
@@ -442,11 +499,11 @@ Discard changes and close anyway?</source>
|
||||
</message>
|
||||
<message numerus="yes">
|
||||
<source>%n week(s)</source>
|
||||
<translation><numerusform>%s週間()</numerusform></translation>
|
||||
<translation><numerusform>%n週間</numerusform></translation>
|
||||
</message>
|
||||
<message numerus="yes">
|
||||
<source>%n month(s)</source>
|
||||
<translation><numerusform>%nヶ月()</numerusform></translation>
|
||||
<translation><numerusform>%nヶ月</numerusform></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>1 year</source>
|
||||
@@ -496,7 +553,7 @@ Discard changes and close anyway?</source>
|
||||
</message>
|
||||
<message>
|
||||
<source>Use custom Auto-Type sequence:</source>
|
||||
<translation>カスタムの自動入力手順を使う</translation>
|
||||
<translation>カスタムの自動入力手順を使う:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>+</source>
|
||||
@@ -546,7 +603,7 @@ Discard changes and close anyway?</source>
|
||||
</message>
|
||||
<message>
|
||||
<source>Username:</source>
|
||||
<translation>ユーザ名</translation>
|
||||
<translation>ユーザ名:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Password:</source>
|
||||
@@ -679,7 +736,7 @@ Discard changes and close anyway?</source>
|
||||
</message>
|
||||
<message numerus="yes">
|
||||
<source>Can't delete icon. Still used by %n item(s).</source>
|
||||
<translation><numerusform>%s個のアイテム()から使われているので、アイコンを削除できません。</numerusform></translation>
|
||||
<translation><numerusform>%n個のアイテムから使われているので、アイコンを削除できません。</numerusform></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@@ -705,7 +762,7 @@ Discard changes and close anyway?</source>
|
||||
<name>EntryAttributesModel</name>
|
||||
<message>
|
||||
<source>Name</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>名前</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@@ -813,6 +870,16 @@ Discard changes and close anyway?</source>
|
||||
<source>Unable to calculate master key</source>
|
||||
<translation>マスターキーを計算できません</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The selected file is an old KeePass 1 database (.kdb).
|
||||
|
||||
You can import it by clicking on Database > 'Import KeePass 1 database'.
|
||||
This is a one-way migration. You won't be able to open the imported database with the old KeePassX 0.4 version.</source>
|
||||
<translation>選択されたファイルは古い KeePass 1 のデータベース (.kdb) です。
|
||||
|
||||
データベース > 'KeePass 1 データベースをインポート' をクリックすることでインポートできます。
|
||||
これは一方向の移行操作であり、インポートされたデータベースは古い KeePassX 0.4 のバージョンでは開くことはできません。</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>Main</name>
|
||||
@@ -973,7 +1040,7 @@ Discard changes and close anyway?</source>
|
||||
</message>
|
||||
<message>
|
||||
<source>Toggle window</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>ウィンドウ切替</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Tools</source>
|
||||
@@ -981,15 +1048,39 @@ Discard changes and close anyway?</source>
|
||||
</message>
|
||||
<message>
|
||||
<source>Copy username</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>ユーザ名をコピー</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Copy password</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>パスワードをコピー</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Export to CSV file</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>CSVファイルへエクスポート</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Repair database</source>
|
||||
<translation>データベースを修復する</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>KeePass 2 Database</source>
|
||||
<translation>KeePass 2 データベース</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>All files</source>
|
||||
<translation>全てのファイル</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Save repaired database</source>
|
||||
<translation>修復されたデータベースを保存する</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Error</source>
|
||||
<translation>エラー</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Writing the database failed.</source>
|
||||
<translation>データベースの書き込みに失敗しました。</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@@ -1039,11 +1130,11 @@ Discard changes and close anyway?</source>
|
||||
<name>QCommandLineParser</name>
|
||||
<message>
|
||||
<source>Displays version information.</source>
|
||||
<translation>バージョン情報を表示する</translation>
|
||||
<translation>バージョン情報を表示する。</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Displays this help.</source>
|
||||
<translation>このヘルプを表示する</translation>
|
||||
<translation>このヘルプを表示する。</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unknown option '%1'.</source>
|
||||
@@ -1082,7 +1173,7 @@ Discard changes and close anyway?</source>
|
||||
<name>QSaveFile</name>
|
||||
<message>
|
||||
<source>Existing file %1 is not writable</source>
|
||||
<translation>存在するファイル %1 は書き込みできません。</translation>
|
||||
<translation>存在するファイル %1 は書き込みできません</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Writing canceled by application</source>
|
||||
@@ -1090,14 +1181,14 @@ Discard changes and close anyway?</source>
|
||||
</message>
|
||||
<message>
|
||||
<source>Partial write. Partition full?</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>一部しか書き込めませんでした。パーティションがいっぱいかも?</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>QtIOCompressor</name>
|
||||
<message>
|
||||
<source>Internal zlib error when compressing: </source>
|
||||
<translation>圧縮時に内部zlibエラーが発生しました</translation>
|
||||
<translation>圧縮時に内部zlibエラーが発生しました: </translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Error writing to underlying device: </source>
|
||||
@@ -1113,7 +1204,7 @@ Discard changes and close anyway?</source>
|
||||
</message>
|
||||
<message>
|
||||
<source>Internal zlib error when decompressing: </source>
|
||||
<translation>解凍時に内部zlibエラーが発生しました</translation>
|
||||
<translation>解凍時に内部zlibエラーが発生しました: </translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@@ -1193,7 +1284,7 @@ Discard changes and close anyway?</source>
|
||||
</message>
|
||||
<message>
|
||||
<source>Use entry title to match windows for global auto-type</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>グローバル自動入力の際に、エントリーのタイトルとウィンドウのマッチングを行う</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Language</source>
|
||||
@@ -1205,7 +1296,7 @@ Discard changes and close anyway?</source>
|
||||
</message>
|
||||
<message>
|
||||
<source>Hide window to system tray when minimized</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>最小化された際にシステムトレイへ格納する</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Remember last key files</source>
|
||||
@@ -1261,11 +1352,7 @@ Discard changes and close anyway?</source>
|
||||
</message>
|
||||
<message>
|
||||
<source>path to a custom config file</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
<source>password of the database (DANGEROUS!)</source>
|
||||
<translation>データベースのパスワード (危険!)</translation>
|
||||
<translation>カスタム設定ファイルへのパス</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>key file of the database</source>
|
||||
|
||||
@@ -13,6 +13,10 @@
|
||||
<source>Revision</source>
|
||||
<translation>리비전</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Using:</source>
|
||||
<translation>사용:</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>AutoType</name>
|
||||
@@ -166,6 +170,43 @@
|
||||
<translation>키 파일 선택</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DatabaseRepairWidget</name>
|
||||
<message>
|
||||
<source>Repair database</source>
|
||||
<translation>데이터베이스 복구</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Error</source>
|
||||
<translation>오류</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Can't open key file</source>
|
||||
<translation>키 파일을 열 수 없음</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Database opened fine. Nothing to do.</source>
|
||||
<translation>데이터베이스를 열었습니다. 할 일이 없습니다.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unable to open the database.</source>
|
||||
<translation>데이터베이스를 열 수 없습니다.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Success</source>
|
||||
<translation>성공</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The database has been successfully repaired
|
||||
You can now save it.</source>
|
||||
<translation>데이터베이스를 복구했습니다
|
||||
이제 저장할 수 있습니다.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unable to repair the database.</source>
|
||||
<translation>데이터베이스를 복구할 수 없습니다.</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DatabaseSettingsWidget</name>
|
||||
<message>
|
||||
@@ -826,6 +867,16 @@ Do you want to save it anyway?</source>
|
||||
<source>Unable to calculate master key</source>
|
||||
<translation>마스터 키를 계산할 수 없습니다</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The selected file is an old KeePass 1 database (.kdb).
|
||||
|
||||
You can import it by clicking on Database > 'Import KeePass 1 database'.
|
||||
This is a one-way migration. You won't be able to open the imported database with the old KeePassX 0.4 version.</source>
|
||||
<translation>선택한 파일은 KeePass 1 데이터베이스(.kdb)입니다.
|
||||
|
||||
데이터베이스 > 'KeePass 1 데이터베이스 가져오기' 항목을 선택해서 변환해야 합니다.
|
||||
변환은 한 방향으로만 이루어지며, 가져온 데이터베이스는 KeePassX 0.4 버전으로 더 이상 열 수 없습니다.</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>Main</name>
|
||||
@@ -1004,6 +1055,30 @@ Do you want to save it anyway?</source>
|
||||
<source>Export to CSV file</source>
|
||||
<translation>CSV 파일로 내보내기</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Repair database</source>
|
||||
<translation>데이터베이스 복구</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>KeePass 2 Database</source>
|
||||
<translation>KeePass 2 데이터베이스</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>All files</source>
|
||||
<translation>모든 파일</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Save repaired database</source>
|
||||
<translation>복구한 데이터베이스 저장</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Error</source>
|
||||
<translation>오류</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Writing the database failed.</source>
|
||||
<translation>데이터베이스에 쓸 수 없습니다.</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>PasswordGeneratorWidget</name>
|
||||
|
||||
@@ -13,12 +13,16 @@
|
||||
<source>Revision</source>
|
||||
<translation>Poversijis</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Using:</source>
|
||||
<translation>Naudojama:</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>AutoType</name>
|
||||
<message>
|
||||
<source>Auto-Type - KeePassX</source>
|
||||
<translation>Automatinis Rinkimas - KeePassX</translation>
|
||||
<translation>Automatinis rinkimas - KeePassX</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Couldn't find an entry that matches the window title:</source>
|
||||
@@ -44,11 +48,11 @@
|
||||
<name>AutoTypeSelectDialog</name>
|
||||
<message>
|
||||
<source>Auto-Type - KeePassX</source>
|
||||
<translation>Automatinis Rinkimas - KeePassX</translation>
|
||||
<translation>Automatinis rinkimas - KeePassX</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Select entry to Auto-Type:</source>
|
||||
<translation>Pasirinkite įrašą Automatiniam Rinkimui:</translation>
|
||||
<translation>Pasirinkite įrašą automatiniam rinkimui:</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@@ -59,7 +63,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Enter password:</source>
|
||||
<translation>Įveskite slaptažodį:</translation>
|
||||
<translation>Įrašykite slaptažodį:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Repeat password:</source>
|
||||
@@ -87,7 +91,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Create Key File...</source>
|
||||
<translation>Sukurti Rakto Failą...</translation>
|
||||
<translation>Sukurti rakto failą...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Error</source>
|
||||
@@ -95,7 +99,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Unable to create Key File : </source>
|
||||
<translation>Nepavyko sukurti Rakto Failo : </translation>
|
||||
<translation>Nepavyko sukurti rakto failo : </translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Select a key file</source>
|
||||
@@ -120,7 +124,7 @@
|
||||
<message>
|
||||
<source>Failed to set %1 as the Key file:
|
||||
%2</source>
|
||||
<translation>Nepavyko nustatyti %1 kaip Rakto failą:
|
||||
<translation>Nepavyko nustatyti %1 kaip rakto failą:
|
||||
%2</translation>
|
||||
</message>
|
||||
</context>
|
||||
@@ -132,7 +136,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Key File:</source>
|
||||
<translation>Rakto Failas:</translation>
|
||||
<translation>Rakto failas:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Password:</source>
|
||||
@@ -167,6 +171,43 @@
|
||||
<translation>Pasirinkite rakto failą</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DatabaseRepairWidget</name>
|
||||
<message>
|
||||
<source>Repair database</source>
|
||||
<translation>Taisyti duomenų bazę</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Error</source>
|
||||
<translation>Klaida</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Can't open key file</source>
|
||||
<translation>Nepavyksta atverti rakto failo</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Database opened fine. Nothing to do.</source>
|
||||
<translation>Duomenų bazė atsivėrė tvarkingai. Nėra ką atlikti.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unable to open the database.</source>
|
||||
<translation>Nepavyko atverti duomenų bazės.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Success</source>
|
||||
<translation>Pavyko</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The database has been successfully repaired
|
||||
You can now save it.</source>
|
||||
<translation>Duomenų bazė buvo sėkmingai pataisyta
|
||||
Dabar galite ją įrašyti.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unable to repair the database.</source>
|
||||
<translation>Duomenų bazės pataisyti nepavyko.</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DatabaseSettingsWidget</name>
|
||||
<message>
|
||||
@@ -214,7 +255,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>KeePass 2 Database</source>
|
||||
<translation>KeePass 2 Duomenų Bazė</translation>
|
||||
<translation>KeePass 2 duomenų bazė</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>All files</source>
|
||||
@@ -400,7 +441,7 @@ Ar vis tiek norite ją įrašyti?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Auto-Type</source>
|
||||
<translation>Automatinis Rinkimas</translation>
|
||||
<translation>Automatinis rinkimas</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Properties</source>
|
||||
@@ -504,15 +545,15 @@ Ar vis tiek norite ją įrašyti?</translation>
|
||||
<name>EditEntryWidgetAutoType</name>
|
||||
<message>
|
||||
<source>Enable Auto-Type for this entry</source>
|
||||
<translation>Įjungti šiam įrašui Automatinį Rinkimą</translation>
|
||||
<translation>Įjungti šiam įrašui automatinį rinkimą</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Inherit default Auto-Type sequence from the group</source>
|
||||
<translation>Paveldėti numatytąją Automatinio Rinkimo seką iš grupės</translation>
|
||||
<translation>Paveldėti numatytąją automatinio rinkimo seką iš grupės</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Use custom Auto-Type sequence:</source>
|
||||
<translation>Naudoti tinkintą Automatinio Rinkimo seka:</translation>
|
||||
<translation>Naudoti tinkintą automatinio rinkimo seka:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>+</source>
|
||||
@@ -687,7 +728,7 @@ Ar vis tiek norite ją įrašyti?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Select Image</source>
|
||||
<translation>Pasirinkite Paveikslą</translation>
|
||||
<translation>Pasirinkite paveikslą</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Can't delete icon!</source>
|
||||
@@ -829,6 +870,16 @@ Ar vis tiek norite ją įrašyti?</translation>
|
||||
<source>Unable to calculate master key</source>
|
||||
<translation>Nepavyko apskaičiuoti pagrindinio rakto</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The selected file is an old KeePass 1 database (.kdb).
|
||||
|
||||
You can import it by clicking on Database > 'Import KeePass 1 database'.
|
||||
This is a one-way migration. You won't be able to open the imported database with the old KeePassX 0.4 version.</source>
|
||||
<translation>Pasirinktas failas yra sena KeePass 1 duomenų bazė (.kdb).
|
||||
|
||||
Jūs galite ją importuoti, nuspausdami Duomenų bazė > "Importuoti KeePass 1 duomenų bazę".
|
||||
Tai yra vienakryptis perkėlimas. Jūs negalėsite atverti importuotos duomenų bazės, naudodami senąją KeePassX 0.4 versija.</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>Main</name>
|
||||
@@ -957,7 +1008,7 @@ Ar vis tiek norite ją įrašyti?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Perform Auto-Type</source>
|
||||
<translation>Atlikti Automatinį Rinkimą</translation>
|
||||
<translation>Atlikti automatinį rinkimą</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Open URL</source>
|
||||
@@ -1007,6 +1058,30 @@ Ar vis tiek norite ją įrašyti?</translation>
|
||||
<source>Export to CSV file</source>
|
||||
<translation>Eksportuoti į CSV failą</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Repair database</source>
|
||||
<translation>Taisyti duomenų bazę</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>KeePass 2 Database</source>
|
||||
<translation>KeePass 2 duomenų bazė</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>All files</source>
|
||||
<translation>Visi failai</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Save repaired database</source>
|
||||
<translation>Įrašyti pataisytą duomenų bazę</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Error</source>
|
||||
<translation>Klaida</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Writing the database failed.</source>
|
||||
<translation>Duomenų bazės rašymas nepavyko.</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>PasswordGeneratorWidget</name>
|
||||
@@ -1020,15 +1095,15 @@ Ar vis tiek norite ją įrašyti?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Character Types</source>
|
||||
<translation>Simbolių Tipai</translation>
|
||||
<translation>Simbolių tipai</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Upper Case Letters</source>
|
||||
<translation>Viršutinio Registro Raidės</translation>
|
||||
<translation>Viršutinio registro raidės</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Lower Case Letters</source>
|
||||
<translation>Apatinio Registro Raidės</translation>
|
||||
<translation>Apatinio registro raidės</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Numbers</source>
|
||||
@@ -1036,7 +1111,7 @@ Ar vis tiek norite ją įrašyti?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Special Characters</source>
|
||||
<translation>Specialūs Simboliai</translation>
|
||||
<translation>Specialūs simboliai</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Exclude look-alike characters</source>
|
||||
@@ -1166,7 +1241,7 @@ Ar vis tiek norite ją įrašyti?</translation>
|
||||
<name>SettingsWidget</name>
|
||||
<message>
|
||||
<source>Application Settings</source>
|
||||
<translation>Programos Nustatymai</translation>
|
||||
<translation>Programos nustatymai</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>General</source>
|
||||
@@ -1205,7 +1280,7 @@ Ar vis tiek norite ją įrašyti?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Global Auto-Type shortcut</source>
|
||||
<translation>Visuotinis Automatinio Rinkimo spartusis klavišas</translation>
|
||||
<translation>Visuotinis automatinio rinkimo spartusis klavišas</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Use entry title to match windows for global auto-type</source>
|
||||
|
||||
@@ -13,6 +13,10 @@
|
||||
<source>Revision</source>
|
||||
<translation>Revisie</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Using:</source>
|
||||
<translation>Maakt gebruik van:</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>AutoType</name>
|
||||
@@ -167,6 +171,43 @@
|
||||
<translation>Kies sleutelbestand</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DatabaseRepairWidget</name>
|
||||
<message>
|
||||
<source>Repair database</source>
|
||||
<translation>Database repareren</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Error</source>
|
||||
<translation>Fout</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Can't open key file</source>
|
||||
<translation>Niet mogelijk om het sleutelbestand te openen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Database opened fine. Nothing to do.</source>
|
||||
<translation>Database werd zonder problemen geopend. Niets te doen.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unable to open the database.</source>
|
||||
<translation>Niet mogelijk om de database te openen.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Success</source>
|
||||
<translation>Gelukt</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The database has been successfully repaired
|
||||
You can now save it.</source>
|
||||
<translation>De database is met succes gerepareerd
|
||||
U kunt deze nu opslaan.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unable to repair the database.</source>
|
||||
<translation>Niet mogelijk om de database te repareren.</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DatabaseSettingsWidget</name>
|
||||
<message>
|
||||
@@ -829,6 +870,16 @@ Wilt u toch doorgaan met opslaan?</translation>
|
||||
<source>Unable to calculate master key</source>
|
||||
<translation>Niet mogelijk om hoofdsleutel te berekenen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The selected file is an old KeePass 1 database (.kdb).
|
||||
|
||||
You can import it by clicking on Database > 'Import KeePass 1 database'.
|
||||
This is a one-way migration. You won't be able to open the imported database with the old KeePassX 0.4 version.</source>
|
||||
<translation>Het gekozen bestand is een oude KeePass 1 database (.kdb).
|
||||
|
||||
U kunt het importeren door te klikken op Database > 'KeePass 1 database importeren'.
|
||||
Deze actie is niet omkeerbaar. U kunt de geimporteerde database niet meer openen met KeePassX 0.4.</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>Main</name>
|
||||
@@ -1007,6 +1058,30 @@ Wilt u toch doorgaan met opslaan?</translation>
|
||||
<source>Export to CSV file</source>
|
||||
<translation>Naar CSV-bestand exporteren</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Repair database</source>
|
||||
<translation>Database repareren</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>KeePass 2 Database</source>
|
||||
<translation>KeePass 2 Database</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>All files</source>
|
||||
<translation>Alle bestanden</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Save repaired database</source>
|
||||
<translation>Gerepareerde database opslaan</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Error</source>
|
||||
<translation>Fout</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Writing the database failed.</source>
|
||||
<translation>Opslaan van de database is mislukt.</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>PasswordGeneratorWidget</name>
|
||||
@@ -1197,7 +1272,7 @@ Wilt u toch doorgaan met opslaan?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Minimize when copying to clipboard</source>
|
||||
<translation>Minimaliseer bij kopieeren naar klembord</translation>
|
||||
<translation>Minimaliseer bij kopiëren naar klembord</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Use group icon on entry creation</source>
|
||||
|
||||
@@ -13,6 +13,10 @@
|
||||
<source>Revision</source>
|
||||
<translation>Rewizja</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Using:</source>
|
||||
<translation>Używanie:</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>AutoType</name>
|
||||
@@ -22,7 +26,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Couldn't find an entry that matches the window title:</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Nie mogę znaleźć wpisu, który by pasował do tytułu okna: </translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@@ -95,7 +99,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Unable to create Key File : </source>
|
||||
<translation>Nie można utworzyć pliku klucza</translation>
|
||||
<translation>Nie można utworzyć pliku klucza :</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Select a key file</source>
|
||||
@@ -111,16 +115,17 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Different passwords supplied.</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Podano różne hasła.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Failed to set key file</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Błąd w ustawianiu pliku z kluczem</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Failed to set %1 as the Key file:
|
||||
%2</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Błąd w ustawieniu %1 jako plik klucza:
|
||||
%2</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@@ -166,6 +171,43 @@
|
||||
<translation>Wybierz plik z kluczem</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DatabaseRepairWidget</name>
|
||||
<message>
|
||||
<source>Repair database</source>
|
||||
<translation>Napraw bazę</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Error</source>
|
||||
<translation>Błąd</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Can't open key file</source>
|
||||
<translation>Nie mogę otworzyć pliku z kluczem</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Database opened fine. Nothing to do.</source>
|
||||
<translation>Pomyślnie otworzono bazę. Nic do zrobienia.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unable to open the database.</source>
|
||||
<translation>Nie można otworzyć bazy kluczy.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Success</source>
|
||||
<translation>Sukces</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The database has been successfully repaired
|
||||
You can now save it.</source>
|
||||
<translation>Baza została naprawiona
|
||||
Możesz teraz ją już zapisać.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unable to repair the database.</source>
|
||||
<translation>Nie mogę naprawić bazę.</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DatabaseSettingsWidget</name>
|
||||
<message>
|
||||
@@ -174,7 +216,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Database description:</source>
|
||||
<translation>Opis bazy danych</translation>
|
||||
<translation>Opis bazy danych:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Transform rounds:</source>
|
||||
@@ -198,11 +240,11 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Max. history items:</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Max. ilość wpisów w historii:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Max. history size:</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Max. rozmiar historii:</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@@ -237,24 +279,25 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>KeePass 1 database</source>
|
||||
<translation>Baza danych KeePass1</translation>
|
||||
<translation>Baza danych KeePass 1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>All files (*)</source>
|
||||
<translation>Wszystkie pliki(*)</translation>
|
||||
<translation>Wszystkie pliki (*)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Close?</source>
|
||||
<translation>Zamknąć ?</translation>
|
||||
<translation>Zamknąć?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Save changes?</source>
|
||||
<translation>Zapisać zmiany ?</translation>
|
||||
<translation>Zapisać zmiany?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>"%1" was modified.
|
||||
Save changes?</source>
|
||||
<translation>"%1" został zmieniony. Zapisać zmiany ?</translation>
|
||||
<translation>"%1" został zmieniony.
|
||||
Zapisać zmiany?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Error</source>
|
||||
@@ -274,12 +317,13 @@ Save changes?</source>
|
||||
</message>
|
||||
<message>
|
||||
<source>locked</source>
|
||||
<translation>plik CSV</translation>
|
||||
<translation>zablokowana</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The database you are trying to open is locked by another instance of KeePassX.
|
||||
Do you want to open it anyway? Alternatively the database is opened read-only.</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Baza, którą próbujesz otworzyć, jest zablokowana przez inną instancję KeePassX.
|
||||
Czy chcesz ją otworzyć pomimo tego? Inaczej baza będzie otwarta tylko do odczytu.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Lock database</source>
|
||||
@@ -288,23 +332,28 @@ Do you want to open it anyway? Alternatively the database is opened read-only.</
|
||||
<message>
|
||||
<source>Can't lock the database as you are currently editing it.
|
||||
Please press cancel to finish your changes or discard them.</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Nie można zablokować bazy, którą edytujesz.
|
||||
Naciśnij anuluj, aby zakończyć zmiany albo porzucić je.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>This database has never been saved.
|
||||
You can save the database or stop locking it.</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Baza nie została nigdy zapisana.
|
||||
Możesz ją zapisać albo przestać blokować.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>This database has been modified.
|
||||
Do you want to save the database before locking it?
|
||||
Otherwise your changes are lost.</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Baza została zmodyfikowana.
|
||||
Czy chcesz zapisać przed zablokowaniem jej?
|
||||
W przeciwnym wypadku zmiany zostaną porzucone.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>"%1" is in edit mode.
|
||||
Discard changes and close anyway?</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>"%1" jest w trybie edytowania.
|
||||
Odrzucić zmiany i zamknąć?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Export database to CSV file</source>
|
||||
@@ -321,7 +370,8 @@ Discard changes and close anyway?</source>
|
||||
<message>
|
||||
<source>The database you are trying to save as is locked by another instance of KeePassX.
|
||||
Do you want to save it anyway?</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Baza, którą próbujesz zapisać jest zablokowana przez inną instancję KeePassX.
|
||||
Czy chcesz zapisać mimo to?</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@@ -352,7 +402,7 @@ Do you want to save it anyway?</source>
|
||||
</message>
|
||||
<message numerus="yes">
|
||||
<source>Do you really want to move %n entry(s) to the recycle bin?</source>
|
||||
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation>
|
||||
<translation><numerusform>Czy na pewno chcesz przenieść %n wpis do kosza?</numerusform><numerusform>Czy na pewno chcesz przenieść %n wpisów do kosza?</numerusform><numerusform>Czy na pewno chcesz przenieść %n wpisów do kosza?</numerusform></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Delete group?</source>
|
||||
@@ -407,7 +457,7 @@ Do you want to save it anyway?</source>
|
||||
</message>
|
||||
<message>
|
||||
<source>Add entry</source>
|
||||
<translation>Nowy wpis</translation>
|
||||
<translation>Dodaj wpis</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Edit entry</source>
|
||||
@@ -419,7 +469,7 @@ Do you want to save it anyway?</source>
|
||||
</message>
|
||||
<message>
|
||||
<source>Different passwords supplied.</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Podano różne hasła.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>New attribute</source>
|
||||
@@ -565,7 +615,7 @@ Do you want to save it anyway?</source>
|
||||
</message>
|
||||
<message>
|
||||
<source>Gen.</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Gen.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>URL:</source>
|
||||
@@ -577,7 +627,7 @@ Do you want to save it anyway?</source>
|
||||
</message>
|
||||
<message>
|
||||
<source>Presets</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Prezentuje</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Notes:</source>
|
||||
@@ -686,7 +736,7 @@ Do you want to save it anyway?</source>
|
||||
</message>
|
||||
<message numerus="yes">
|
||||
<source>Can't delete icon. Still used by %n item(s).</source>
|
||||
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation>
|
||||
<translation><numerusform>Nie mogę usunąć ikony. Nadal używana przez %n wpis.</numerusform><numerusform>Nie mogę usunąć ikony. Nadal używana przez %n wpisów.</numerusform><numerusform>Nie mogę usunąć ikony. Nadal używana przez %n wpisów.</numerusform></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@@ -820,6 +870,16 @@ Do you want to save it anyway?</source>
|
||||
<source>Unable to calculate master key</source>
|
||||
<translation>Nie mogę wyliczyć głównego klucza</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The selected file is an old KeePass 1 database (.kdb).
|
||||
|
||||
You can import it by clicking on Database > 'Import KeePass 1 database'.
|
||||
This is a one-way migration. You won't be able to open the imported database with the old KeePassX 0.4 version.</source>
|
||||
<translation>Wybrany plik jest bazą starego KeePassX 1 (.kdb).
|
||||
|
||||
Możesz zaimportować ją przez wybranie Baza > 'Importuj bazę danych KeePass 1'.
|
||||
Nie będzie można skonwertować nowej bazy do starego programu KeePassX 0.4.</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>Main</name>
|
||||
@@ -980,7 +1040,7 @@ Do you want to save it anyway?</source>
|
||||
</message>
|
||||
<message>
|
||||
<source>Toggle window</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Pokaż/ukryj okno</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Tools</source>
|
||||
@@ -998,6 +1058,30 @@ Do you want to save it anyway?</source>
|
||||
<source>Export to CSV file</source>
|
||||
<translation>Eksport do pliku CSV</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Repair database</source>
|
||||
<translation>Napraw bazę</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>KeePass 2 Database</source>
|
||||
<translation>Baza KeePass 2</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>All files</source>
|
||||
<translation>Wszystkie pliki</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Save repaired database</source>
|
||||
<translation>Zapisz naprawioną bazę</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Error</source>
|
||||
<translation>Błąd</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Writing the database failed.</source>
|
||||
<translation>Błąd przy zapisie bazy.</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>PasswordGeneratorWidget</name>
|
||||
@@ -1011,7 +1095,7 @@ Do you want to save it anyway?</source>
|
||||
</message>
|
||||
<message>
|
||||
<source>Character Types</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Typy znaków</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Upper Case Letters</source>
|
||||
@@ -1035,7 +1119,7 @@ Do you want to save it anyway?</source>
|
||||
</message>
|
||||
<message>
|
||||
<source>Ensure that the password contains characters from every group</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Zapewnij, że hasło będzie zawierało znaki ze wszystkich grup</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Accept</source>
|
||||
@@ -1074,7 +1158,7 @@ Do you want to save it anyway?</source>
|
||||
</message>
|
||||
<message>
|
||||
<source>Usage: %1</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Używanie: %1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Options:</source>
|
||||
@@ -1089,7 +1173,7 @@ Do you want to save it anyway?</source>
|
||||
<name>QSaveFile</name>
|
||||
<message>
|
||||
<source>Existing file %1 is not writable</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Istniejący plik %1 jest nie do zapisu</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Writing canceled by application</source>
|
||||
@@ -1097,7 +1181,7 @@ Do you want to save it anyway?</source>
|
||||
</message>
|
||||
<message>
|
||||
<source>Partial write. Partition full?</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Częściowy zapis. Pełny dysk?</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@@ -1108,15 +1192,15 @@ Do you want to save it anyway?</source>
|
||||
</message>
|
||||
<message>
|
||||
<source>Error writing to underlying device: </source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Błąd w zapisie na urządzenie:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Error opening underlying device: </source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Błąd w otwieraniu z urządzenia:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Error reading data from underlying device: </source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Błąd w odczycie danych z urządzenia:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Internal zlib error when decompressing: </source>
|
||||
@@ -1150,7 +1234,7 @@ Do you want to save it anyway?</source>
|
||||
</message>
|
||||
<message>
|
||||
<source>Root group</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Główna grupa</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@@ -1200,7 +1284,7 @@ Do you want to save it anyway?</source>
|
||||
</message>
|
||||
<message>
|
||||
<source>Use entry title to match windows for global auto-type</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Wykorzystaj tytuł wpisu do dopasowania dla globalnego auto-wpisywania</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Language</source>
|
||||
@@ -1227,7 +1311,7 @@ Do you want to save it anyway?</source>
|
||||
</message>
|
||||
<message>
|
||||
<source> sec</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>s</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Lock databases after inactivity of</source>
|
||||
@@ -1260,15 +1344,15 @@ Do you want to save it anyway?</source>
|
||||
<name>main</name>
|
||||
<message>
|
||||
<source>KeePassX - cross-platform password manager</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>KeePassX - wieloplatformowy menadżer haseł</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>filename of the password database to open (*.kdbx)</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>nazwa pliku z bazą haseł do otwarcia (*.kdbx)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>path to a custom config file</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>ścieżka do pliku z ustawieniami</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>key file of the database</source>
|
||||
|
||||
@@ -11,7 +11,11 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Revision</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Revisão</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Using:</source>
|
||||
<translation>Usando:</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@@ -22,7 +26,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Couldn't find an entry that matches the window title:</source>
|
||||
<translation>Não foi possível encontrar uma entrada que corresponda ao título da janela:</translation>
|
||||
<translation>Não foi possível localizar uma entrada que corresponda ao título da janela:</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@@ -95,7 +99,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Unable to create Key File : </source>
|
||||
<translation>Não foi possível criar o Arquivo-Chave :</translation>
|
||||
<translation>Não foi possível criar o Arquivo-Chave : </translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Select a key file</source>
|
||||
@@ -167,15 +171,52 @@
|
||||
<translation>Escolha o arquivo-chave</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DatabaseRepairWidget</name>
|
||||
<message>
|
||||
<source>Repair database</source>
|
||||
<translation>Reparar banco de dados</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Error</source>
|
||||
<translation>Erro</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Can't open key file</source>
|
||||
<translation>Não foi possível abrir arquivo-chave</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Database opened fine. Nothing to do.</source>
|
||||
<translation>Banco de dados aberto com sucesso. Nada para fazer.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unable to open the database.</source>
|
||||
<translation>Não foi possível abrir o banco de dados.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Success</source>
|
||||
<translation>Sucesso</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The database has been successfully repaired
|
||||
You can now save it.</source>
|
||||
<translation>O banco de dados foi reparado com sucesso
|
||||
Você pode salvá-lo agora.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unable to repair the database.</source>
|
||||
<translation>Não foi possível reparar o banco de dados.</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DatabaseSettingsWidget</name>
|
||||
<message>
|
||||
<source>Database name:</source>
|
||||
<translation>Nome do Banco de Dados:</translation>
|
||||
<translation>Nome do banco de dados:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Database description:</source>
|
||||
<translation>Descrição do Banco de Dados:</translation>
|
||||
<translation>Descrição do banco de dados:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Transform rounds:</source>
|
||||
@@ -191,7 +232,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source> MiB</source>
|
||||
<translation>MB</translation>
|
||||
<translation> MB</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Benchmark</source>
|
||||
@@ -199,18 +240,18 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Max. history items:</source>
|
||||
<translation>Máx. Itens no histórico:</translation>
|
||||
<translation>Máx. itens no histórico:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Max. history size:</source>
|
||||
<translation>Tamanho Máx. do histórico:</translation>
|
||||
<translation>Tamanho máx. do histórico:</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DatabaseTabWidget</name>
|
||||
<message>
|
||||
<source>Root</source>
|
||||
<translation>Raíz</translation>
|
||||
<translation>Raiz</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>KeePass 2 Database</source>
|
||||
@@ -230,7 +271,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>File not found!</source>
|
||||
<translation>Arquivo não encontrado!</translation>
|
||||
<translation>Arquivo não localizado!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Open KeePass 1 database</source>
|
||||
@@ -238,7 +279,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>KeePass 1 database</source>
|
||||
<translation>banco de dados KeePass 1</translation>
|
||||
<translation>Banco de dados KeePass 1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>All files (*)</source>
|
||||
@@ -276,13 +317,13 @@ Salvar alterações?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>locked</source>
|
||||
<translation>Trancado</translation>
|
||||
<translation>trancado</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The database you are trying to open is locked by another instance of KeePassX.
|
||||
Do you want to open it anyway? Alternatively the database is opened read-only.</source>
|
||||
<translation>O banco de dados que você está tentando abrir está bloqueado por outra instância do KeePassX.
|
||||
Você quer abri-lo de qualquer forma? Alternativamente o banco de dados é aberto como somente leitura.</translation>
|
||||
Você quer abri-lo de qualquer forma? Alternativamente, o banco de dados é aberto como somente leitura.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Lock database</source>
|
||||
@@ -292,23 +333,27 @@ Você quer abri-lo de qualquer forma? Alternativamente o banco de dados é abert
|
||||
<source>Can't lock the database as you are currently editing it.
|
||||
Please press cancel to finish your changes or discard them.</source>
|
||||
<translation>Não é possível trancar o banco de dados uma vez que você o está editando.
|
||||
Por favor aperte cancelar para finalizar suas alterações ou descartá-las.</translation>
|
||||
Por favor, aperte cancelar para finalizar suas alterações ou descartá-las.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>This database has never been saved.
|
||||
You can save the database or stop locking it.</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Esse banco de dados nunca foi salvo.
|
||||
Você pode salvar o banco de dados ou parar de trancá-lo.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>This database has been modified.
|
||||
Do you want to save the database before locking it?
|
||||
Otherwise your changes are lost.</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Esse banco de dados foi modificado.
|
||||
Você deseja salvar o banco de dados antes de travá-lo?
|
||||
Do contrário, suas alterações serão perdidas.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>"%1" is in edit mode.
|
||||
Discard changes and close anyway?</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>"%1" está em modo de edição.
|
||||
Descartar alterações e fechar mesmo assim?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Export database to CSV file</source>
|
||||
@@ -325,7 +370,8 @@ Discard changes and close anyway?</source>
|
||||
<message>
|
||||
<source>The database you are trying to save as is locked by another instance of KeePassX.
|
||||
Do you want to save it anyway?</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>O banco de dados que você está tentando salvar como está travado por uma outra instância de KeePassX.
|
||||
Você deseja salvá-lo mesmo assim?</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@@ -356,7 +402,7 @@ Do you want to save it anyway?</source>
|
||||
</message>
|
||||
<message numerus="yes">
|
||||
<source>Do you really want to move %n entry(s) to the recycle bin?</source>
|
||||
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
|
||||
<translation><numerusform>Você realmente deseja mover %n entrada para a lixeira?</numerusform><numerusform>Você realmente deseja mover %n entradas para a lixeira?</numerusform></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Delete group?</source>
|
||||
@@ -565,7 +611,7 @@ Do you want to save it anyway?</source>
|
||||
</message>
|
||||
<message>
|
||||
<source>Repeat:</source>
|
||||
<translation>Repetir</translation>
|
||||
<translation>Repetir:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Gen.</source>
|
||||
@@ -577,7 +623,7 @@ Do you want to save it anyway?</source>
|
||||
</message>
|
||||
<message>
|
||||
<source>Expires</source>
|
||||
<translation>Expira em:</translation>
|
||||
<translation>Expira em</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Presets</source>
|
||||
@@ -647,18 +693,18 @@ Do you want to save it anyway?</source>
|
||||
</message>
|
||||
<message>
|
||||
<source>Use default auto-type sequence of parent group</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Usar sequência de auto-digitação padrão do grupo pai</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Set default auto-type sequence</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Definir sequência auto-digitação padrão</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>EditWidgetIcons</name>
|
||||
<message>
|
||||
<source>Use default icon</source>
|
||||
<translation>Usar Ícone padrão</translation>
|
||||
<translation>Usar ícone padrão</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Use custom icon</source>
|
||||
@@ -690,7 +736,7 @@ Do you want to save it anyway?</source>
|
||||
</message>
|
||||
<message numerus="yes">
|
||||
<source>Can't delete icon. Still used by %n item(s).</source>
|
||||
<translation><numerusform>Não é possível apagar o ícone. Ainda usado por %n item.</numerusform><numerusform>Não é possível apagar o ícone. Ainda usado por %n item(s).</numerusform></translation>
|
||||
<translation><numerusform>Não é possível apagar o ícone. Ainda usado por %n item.</numerusform><numerusform>Não é possível apagar o ícone. Ainda usado por %n itens.</numerusform></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@@ -818,18 +864,28 @@ Do you want to save it anyway?</source>
|
||||
</message>
|
||||
<message>
|
||||
<source>Wrong key or database file is corrupt.</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Chave errada ou arquivo de banco de dados está corrompido.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unable to calculate master key</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Não foi possível calcular a chave mestre</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The selected file is an old KeePass 1 database (.kdb).
|
||||
|
||||
You can import it by clicking on Database > 'Import KeePass 1 database'.
|
||||
This is a one-way migration. You won't be able to open the imported database with the old KeePassX 0.4 version.</source>
|
||||
<translation>O arquivo selecionado é um banco de dados antigo do KeePass 1 (.kdb).
|
||||
|
||||
Você pode importá-lo clicando em Banco de Dados > 'Importar banco de dados KeePass 1'.
|
||||
Esta é uma migração de uma via. Você não poderá abrir o banco de dados importado com a versão antiga do KeePassX 0.4.</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>Main</name>
|
||||
<message>
|
||||
<source>Fatal error while testing the cryptographic functions.</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Erro fatal enquanto testava as funções criptográficas.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>KeePassX - Error</source>
|
||||
@@ -936,7 +992,7 @@ Do you want to save it anyway?</source>
|
||||
</message>
|
||||
<message>
|
||||
<source>Find</source>
|
||||
<translation>Encontrar</translation>
|
||||
<translation>Localizar</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Copy username to clipboard</source>
|
||||
@@ -1002,6 +1058,30 @@ Do you want to save it anyway?</source>
|
||||
<source>Export to CSV file</source>
|
||||
<translation>Exportar para arquivo CSV</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Repair database</source>
|
||||
<translation>Reparar banco de dados</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>KeePass 2 Database</source>
|
||||
<translation>Banco de dados Keepass 2</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>All files</source>
|
||||
<translation>Todos arquivos</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Save repaired database</source>
|
||||
<translation>Salvar banco de dados reparado</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Error</source>
|
||||
<translation>Erro</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Writing the database failed.</source>
|
||||
<translation>Escrita do banco de dados falhou.</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>PasswordGeneratorWidget</name>
|
||||
@@ -1108,45 +1188,45 @@ Do you want to save it anyway?</source>
|
||||
<name>QtIOCompressor</name>
|
||||
<message>
|
||||
<source>Internal zlib error when compressing: </source>
|
||||
<translation>Erro interno do zlib ao compactar:</translation>
|
||||
<translation>Erro interno do zlib ao compactar: </translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Error writing to underlying device: </source>
|
||||
<translation>Erro ao gravar no dispositivo subjacente:</translation>
|
||||
<translation>Erro ao gravar no dispositivo subjacente: </translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Error opening underlying device: </source>
|
||||
<translation>Erro ao abrir dispositivo subjacente:</translation>
|
||||
<translation>Erro ao abrir dispositivo subjacente: </translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Error reading data from underlying device: </source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Erro ao ler dados do dispositivo subjacente: </translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Internal zlib error when decompressing: </source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Erro interno do zlib ao descompactar: </translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>QtIOCompressor::open</name>
|
||||
<message>
|
||||
<source>The gzip format not supported in this version of zlib.</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Sem suporte ao formato gzip nesta versão do zlib.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Internal zlib error: </source>
|
||||
<translation>Erro interno do zlib:</translation>
|
||||
<translation>Erro interno do zlib: </translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SearchWidget</name>
|
||||
<message>
|
||||
<source>Find:</source>
|
||||
<translation>Encontrar:</translation>
|
||||
<translation>Localizar:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Case sensitive</source>
|
||||
<translation>diferenciar maiúsculas e minúsculas</translation>
|
||||
<translation>Diferenciar maiúsculas e minúsculas</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Current group</source>
|
||||
@@ -1154,7 +1234,7 @@ Do you want to save it anyway?</source>
|
||||
</message>
|
||||
<message>
|
||||
<source>Root group</source>
|
||||
<translation>Grupo Raíz</translation>
|
||||
<translation>Grupo Raiz</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@@ -1196,15 +1276,15 @@ Do you want to save it anyway?</source>
|
||||
</message>
|
||||
<message>
|
||||
<source>Use group icon on entry creation</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Usar ícone de grupo na criação da entrada</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Global Auto-Type shortcut</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Atalho para Auto-Digitação Global</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Use entry title to match windows for global auto-type</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Usar título da entrada para comparar janelas para auto-digitação global</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Language</source>
|
||||
@@ -1216,34 +1296,34 @@ Do you want to save it anyway?</source>
|
||||
</message>
|
||||
<message>
|
||||
<source>Hide window to system tray when minimized</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Ocultar janela na bandeja de sistema quando minimizada</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Remember last key files</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Lembrar dos últimos arquivos-chave</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SettingsWidgetSecurity</name>
|
||||
<message>
|
||||
<source>Clear clipboard after</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Limpar área de transferência após</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source> sec</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation> seg</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Lock databases after inactivity of</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Travar bancos de dados após inatividade de</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Show passwords in cleartext by default</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Mostrar senhas em texto claro por padrão</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Always ask before performing auto-type</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Sempre perguntar antes de realizar auto-digitação</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@@ -1257,26 +1337,26 @@ Do you want to save it anyway?</source>
|
||||
<name>WelcomeWidget</name>
|
||||
<message>
|
||||
<source>Welcome!</source>
|
||||
<translation>Bemvindo!</translation>
|
||||
<translation>Bem-vindo!</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>main</name>
|
||||
<message>
|
||||
<source>KeePassX - cross-platform password manager</source>
|
||||
<translation>KeePassX - gerenciador de senhas Multiplataforma</translation>
|
||||
<translation>KeePassX - gerenciador de senhas multiplataforma</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>filename of the password database to open (*.kdbx)</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>nome de arquivo do banco de dados de senhas a ser aberto (*.kdbx)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>path to a custom config file</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>caminho para um arquivo de configuração personalizado</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>key file of the database</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>arquivo-chave do banco de dados</translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
@@ -9,6 +9,14 @@
|
||||
<source>KeePassX is distributed under the term of the GNU General Public License (GPL) version 2 or (at your option) version 3.</source>
|
||||
<translation>KeePassX é distribuído sob os termos GNU de licença pública geral (GPL) versão 2 ou (á sua escolha) versão 3.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Revision</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
<source>Using:</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>AutoType</name>
|
||||
@@ -163,6 +171,42 @@
|
||||
<translation>Seleccionar o ficheiro chave</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DatabaseRepairWidget</name>
|
||||
<message>
|
||||
<source>Repair database</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
<source>Error</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
<source>Can't open key file</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
<source>Database opened fine. Nothing to do.</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unable to open the database.</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
<source>Success</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
<source>The database has been successfully repaired
|
||||
You can now save it.</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unable to repair the database.</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DatabaseSettingsWidget</name>
|
||||
<message>
|
||||
@@ -322,6 +366,11 @@ Fechar e Ignorar alterações ?</translation>
|
||||
<source>Writing the CSV file failed.</source>
|
||||
<translation>Falha na escrita do ficheiro CSV</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The database you are trying to save as is locked by another instance of KeePassX.
|
||||
Do you want to save it anyway?</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DatabaseWidget</name>
|
||||
@@ -818,6 +867,13 @@ Fechar e Ignorar alterações ?</translation>
|
||||
<source>Unable to calculate master key</source>
|
||||
<translation>Impossível calcular chave mestra:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The selected file is an old KeePass 1 database (.kdb).
|
||||
|
||||
You can import it by clicking on Database > 'Import KeePass 1 database'.
|
||||
This is a one-way migration. You won't be able to open the imported database with the old KeePassX 0.4 version.</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>Main</name>
|
||||
@@ -996,6 +1052,30 @@ Fechar e Ignorar alterações ?</translation>
|
||||
<source>Export to CSV file</source>
|
||||
<translation>Exportar para ficheiro CSV</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Repair database</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
<source>KeePass 2 Database</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
<source>All files</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
<source>Save repaired database</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
<source>Error</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
<source>Writing the database failed.</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>PasswordGeneratorWidget</name>
|
||||
@@ -1268,10 +1348,6 @@ Fechar e Ignorar alterações ?</translation>
|
||||
<source>path to a custom config file</source>
|
||||
<translation>caminho para um ficheiro de configuração personalizado</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>password of the database (DANGEROUS!)</source>
|
||||
<translation>senha da base de dados (PERIGOSO !)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>key file of the database</source>
|
||||
<translation>ficheiro chave da base de dados</translation>
|
||||
|
||||
@@ -13,6 +13,10 @@
|
||||
<source>Revision</source>
|
||||
<translation>Ревизия</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Using:</source>
|
||||
<translation>С помощью:</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>AutoType</name>
|
||||
@@ -167,6 +171,43 @@
|
||||
<translation>Выберите файл-ключ</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DatabaseRepairWidget</name>
|
||||
<message>
|
||||
<source>Repair database</source>
|
||||
<translation>Восстановление хранилища</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Error</source>
|
||||
<translation>Ошибка</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Can't open key file</source>
|
||||
<translation>Не могу открыть файл-ключ</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Database opened fine. Nothing to do.</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unable to open the database.</source>
|
||||
<translation>Невозможно открыть хранилище.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Success</source>
|
||||
<translation>Успешно</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The database has been successfully repaired
|
||||
You can now save it.</source>
|
||||
<translation>Хранилище было восстановлено.
|
||||
Теперь Вы можете сохранить его.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unable to repair the database.</source>
|
||||
<translation>Невозможно восстановить хранилище.</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DatabaseSettingsWidget</name>
|
||||
<message>
|
||||
@@ -290,12 +331,14 @@ Do you want to open it anyway? Alternatively the database is opened read-only.</
|
||||
<message>
|
||||
<source>Can't lock the database as you are currently editing it.
|
||||
Please press cancel to finish your changes or discard them.</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Невозможно заблокировать базу данных, так как вы в настоящее время редактируете её.
|
||||
Пожалуйста нажмите Отмена, чтобы завершить свои изменения или отклонить их.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>This database has never been saved.
|
||||
You can save the database or stop locking it.</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Эта база данных никогда не была сохранена.
|
||||
Вы можете сохранить базу данных или остановить её заблокированной.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>This database has been modified.
|
||||
@@ -571,7 +614,7 @@ Do you want to save it anyway?</source>
|
||||
</message>
|
||||
<message>
|
||||
<source>Gen.</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Генеральный.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>URL:</source>
|
||||
@@ -649,11 +692,11 @@ Do you want to save it anyway?</source>
|
||||
</message>
|
||||
<message>
|
||||
<source>Use default auto-type sequence of parent group</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Используйте стандартный автоввод из последовательности родительской группы</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Set default auto-type sequence</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>Последовательность автоввода указать по умолчанию</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@@ -826,6 +869,16 @@ Do you want to save it anyway?</source>
|
||||
<source>Unable to calculate master key</source>
|
||||
<translation>Невозможно вычислить мастер-пароль</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The selected file is an old KeePass 1 database (.kdb).
|
||||
|
||||
You can import it by clicking on Database > 'Import KeePass 1 database'.
|
||||
This is a one-way migration. You won't be able to open the imported database with the old KeePassX 0.4 version.</source>
|
||||
<translation>Выбранный файл от старой KeePass 1 базы данных (.kdb).
|
||||
|
||||
Вы можете импортировать его, нажав на База Данных > 'Импорт KeePass 1 базы данных'.
|
||||
Это одностороннее перемещение. Вы не сможете открыть импортированный базу данных на старой версии KeePassX 0,4.</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>Main</name>
|
||||
@@ -1004,6 +1057,30 @@ Do you want to save it anyway?</source>
|
||||
<source>Export to CSV file</source>
|
||||
<translation>Экспортировать в файл CSV</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Repair database</source>
|
||||
<translation>Восстановление хранилища</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>KeePass 2 Database</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
<source>All files</source>
|
||||
<translation>Все файлы</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Save repaired database</source>
|
||||
<translation>Сохранить восстановленное хранилище</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Error</source>
|
||||
<translation>Ошибка</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Writing the database failed.</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>PasswordGeneratorWidget</name>
|
||||
|
||||
@@ -13,6 +13,10 @@
|
||||
<source>Revision</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
<source>Using:</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>AutoType</name>
|
||||
@@ -167,6 +171,42 @@
|
||||
<translation>Izberi datoteko s ključi</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DatabaseRepairWidget</name>
|
||||
<message>
|
||||
<source>Repair database</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
<source>Error</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
<source>Can't open key file</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
<source>Database opened fine. Nothing to do.</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unable to open the database.</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
<source>Success</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
<source>The database has been successfully repaired
|
||||
You can now save it.</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unable to repair the database.</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DatabaseSettingsWidget</name>
|
||||
<message>
|
||||
@@ -827,6 +867,13 @@ Do you want to save it anyway?</source>
|
||||
<source>Unable to calculate master key</source>
|
||||
<translation>Izračun glavnega ključa ni uspel</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The selected file is an old KeePass 1 database (.kdb).
|
||||
|
||||
You can import it by clicking on Database > 'Import KeePass 1 database'.
|
||||
This is a one-way migration. You won't be able to open the imported database with the old KeePassX 0.4 version.</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>Main</name>
|
||||
@@ -1005,6 +1052,30 @@ Do you want to save it anyway?</source>
|
||||
<source>Export to CSV file</source>
|
||||
<translation>Izvozi v CSV datoteko</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Repair database</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
<source>KeePass 2 Database</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
<source>All files</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
<source>Save repaired database</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
<source>Error</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
<source>Writing the database failed.</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>PasswordGeneratorWidget</name>
|
||||
|
||||
@@ -13,6 +13,10 @@
|
||||
<source>Revision</source>
|
||||
<translation>Revision</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Using:</source>
|
||||
<translation>Använder:</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>AutoType</name>
|
||||
@@ -167,6 +171,43 @@
|
||||
<translation>Välj nyckel-fil</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DatabaseRepairWidget</name>
|
||||
<message>
|
||||
<source>Repair database</source>
|
||||
<translation>Laga databasen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Error</source>
|
||||
<translation>Fel</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Can't open key file</source>
|
||||
<translation>Kan inte öppna nyckelfilen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Database opened fine. Nothing to do.</source>
|
||||
<translation>Databas öppnades fint. Inget att göra.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unable to open the database.</source>
|
||||
<translation>Misslyckades att öppna databasen.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Success</source>
|
||||
<translation>Succé</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The database has been successfully repaired
|
||||
You can now save it.</source>
|
||||
<translation>Databasens reparation har varit lyckad.
|
||||
Du kan nu spara den.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unable to repair the database.</source>
|
||||
<translation>Misslyckades med att laga databasen.</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DatabaseSettingsWidget</name>
|
||||
<message>
|
||||
@@ -291,7 +332,7 @@ Vill du öppna den ändå? Databasen kommer då att öppnas skrivskyddad.</trans
|
||||
<message>
|
||||
<source>Can't lock the database as you are currently editing it.
|
||||
Please press cancel to finish your changes or discard them.</source>
|
||||
<translation>Kan inte låsa databasen eftersom du håller på att redigera den.
|
||||
<translation>Kan inte låsa databasen eftersom du håller på att redigera den.
|
||||
Tryck avbryt för att ansluta dina ändringar alternativt kasta dem.</translation>
|
||||
</message>
|
||||
<message>
|
||||
@@ -829,6 +870,16 @@ Vill du spara endå?</translation>
|
||||
<source>Unable to calculate master key</source>
|
||||
<translation>Kunde inte räkna nu master-nyckeln</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The selected file is an old KeePass 1 database (.kdb).
|
||||
|
||||
You can import it by clicking on Database > 'Import KeePass 1 database'.
|
||||
This is a one-way migration. You won't be able to open the imported database with the old KeePassX 0.4 version.</source>
|
||||
<translation>Den valda filen är en gammal KeePass 1 databas (.kdb)
|
||||
|
||||
Du kan importera den genom att klicka på Databas > Importera KeePass 1 databas.
|
||||
Detta är en envägsmigration. Du kan inte spara en databas som KeePass1 databas. Det som används i KeePassX 0.4.</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>Main</name>
|
||||
@@ -849,7 +900,7 @@ Vill du spara endå?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Recent databases</source>
|
||||
<translation>Senast använda databser</translation>
|
||||
<translation>Senast använda databaser</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Help</source>
|
||||
@@ -1007,6 +1058,30 @@ Vill du spara endå?</translation>
|
||||
<source>Export to CSV file</source>
|
||||
<translation>Exportera till CSV-fil</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Repair database</source>
|
||||
<translation>Laga databasen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>KeePass 2 Database</source>
|
||||
<translation>KeePass 2 databas</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>All files</source>
|
||||
<translation>Alla filer</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Save repaired database</source>
|
||||
<translation>Spara lagad databas</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Error</source>
|
||||
<translation>Fel</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Writing the database failed.</source>
|
||||
<translation>Misslyckades med att skriva till databasen.</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>PasswordGeneratorWidget</name>
|
||||
@@ -1185,11 +1260,11 @@ Vill du spara endå?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Open previous databases on startup</source>
|
||||
<translation>Öppna senaste databasen är programmet startar</translation>
|
||||
<translation>Öppna senaste databasen när programmet startar</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Automatically save on exit</source>
|
||||
<translation>Spara automatiskt är applikationen anslutas</translation>
|
||||
<translation>Spara automatiskt när applikationen anslutas</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Automatically save after every change</source>
|
||||
|
||||
@@ -13,6 +13,10 @@
|
||||
<source>Revision</source>
|
||||
<translation>Ревізія</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Using:</source>
|
||||
<translation>Використання:</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>AutoType</name>
|
||||
@@ -167,6 +171,42 @@
|
||||
<translation>Оберіть файл-ключ</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DatabaseRepairWidget</name>
|
||||
<message>
|
||||
<source>Repair database</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
<source>Error</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
<source>Can't open key file</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
<source>Database opened fine. Nothing to do.</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unable to open the database.</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
<source>Success</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
<source>The database has been successfully repaired
|
||||
You can now save it.</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unable to repair the database.</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DatabaseSettingsWidget</name>
|
||||
<message>
|
||||
@@ -828,6 +868,16 @@ Do you want to save it anyway?</source>
|
||||
<source>Unable to calculate master key</source>
|
||||
<translation>Неможливо вирахувати майстер-пароль</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The selected file is an old KeePass 1 database (.kdb).
|
||||
|
||||
You can import it by clicking on Database > 'Import KeePass 1 database'.
|
||||
This is a one-way migration. You won't be able to open the imported database with the old KeePassX 0.4 version.</source>
|
||||
<translation>Обрано файл сховища попередньої версії KeePass 1 (.kdb).
|
||||
|
||||
Ви можете імпортувати його, натиснувши Сховище > 'Імпортувати сховище KeePass 1'.
|
||||
Це односторонній спосіб міграції. Ви не зможете відкрити імпортоване сховище в попередній версії KeePassX 0.4.</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>Main</name>
|
||||
@@ -1006,6 +1056,30 @@ Do you want to save it anyway?</source>
|
||||
<source>Export to CSV file</source>
|
||||
<translation>Експортувати в файл CSV</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Repair database</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
<source>KeePass 2 Database</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
<source>All files</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
<source>Save repaired database</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
<source>Error</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
<source>Writing the database failed.</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>PasswordGeneratorWidget</name>
|
||||
|
||||
@@ -9,6 +9,14 @@
|
||||
<source>KeePassX is distributed under the term of the GNU General Public License (GPL) version 2 or (at your option) version 3.</source>
|
||||
<translation>KeePassX 使用的是第 2 版 GNU 通用公共授权协议(GPL)(你可以根据需要选用第 3 版).</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Revision</source>
|
||||
<translation>修改</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Using:</source>
|
||||
<translation>使用:</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>AutoType</name>
|
||||
@@ -163,6 +171,43 @@
|
||||
<translation>选择秘钥文件</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DatabaseRepairWidget</name>
|
||||
<message>
|
||||
<source>Repair database</source>
|
||||
<translation>修复数据库</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Error</source>
|
||||
<translation>错误</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Can't open key file</source>
|
||||
<translation>无法打开密钥文件</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Database opened fine. Nothing to do.</source>
|
||||
<translation>数据库打开正常。没什么可做的。</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unable to open the database.</source>
|
||||
<translation>无法打开数据库</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Success</source>
|
||||
<translation>成功</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The database has been successfully repaired
|
||||
You can now save it.</source>
|
||||
<translation>数据库已经修复成功
|
||||
现在可以保存数据库</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unable to repair the database.</source>
|
||||
<translation>无法修复数据库</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DatabaseSettingsWidget</name>
|
||||
<message>
|
||||
@@ -307,19 +352,26 @@ Otherwise your changes are lost.</source>
|
||||
<message>
|
||||
<source>"%1" is in edit mode.
|
||||
Discard changes and close anyway?</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>正在编辑 "%1" 。
|
||||
仍然要放弃修改并且关闭吗?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Export database to CSV file</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>把数据库导出为CSV格式文件</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>CSV file</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>CSV格式文件</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Writing the CSV file failed.</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>写入CSV格式文件失败</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The database you are trying to save as is locked by another instance of KeePassX.
|
||||
Do you want to save it anyway?</source>
|
||||
<translation>你要保存的数据库已被另一个KeePassX锁住。
|
||||
你仍然要保存吗?</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@@ -762,7 +814,7 @@ Discard changes and close anyway?</source>
|
||||
<name>KeePass1OpenWidget</name>
|
||||
<message>
|
||||
<source>Import KeePass1 database</source>
|
||||
<translation>导入KeePass 1 数据库</translation>
|
||||
<translation>导入 KeePass 1 数据库</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Error</source>
|
||||
@@ -818,6 +870,15 @@ Discard changes and close anyway?</source>
|
||||
<source>Unable to calculate master key</source>
|
||||
<translation>无法计算主密码</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The selected file is an old KeePass 1 database (.kdb).
|
||||
|
||||
You can import it by clicking on Database > 'Import KeePass 1 database'.
|
||||
This is a one-way migration. You won't be able to open the imported database with the old KeePassX 0.4 version.</source>
|
||||
<translation>当前选择的文件是旧版本 KeePass 1 数据库(.kdb)。
|
||||
你可以通过点击 数据库 > '导入KeePass 1 数据库’ 来导入。
|
||||
这是不可逆的修改。导入后的数据库将无法由旧版的KeePassX 0.4版本打开。</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>Main</name>
|
||||
@@ -986,15 +1047,39 @@ Discard changes and close anyway?</source>
|
||||
</message>
|
||||
<message>
|
||||
<source>Copy username</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>复制用户名</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Copy password</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>复制密码</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Export to CSV file</source>
|
||||
<translation type="unfinished"/>
|
||||
<translation>导出为CSV格式文件</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Repair database</source>
|
||||
<translation>修复数据库</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>KeePass 2 Database</source>
|
||||
<translation>KeePass 2 数据库</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>All files</source>
|
||||
<translation>所有文件</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Save repaired database</source>
|
||||
<translation>保存修复后的数据库</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Error</source>
|
||||
<translation>错误</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Writing the database failed.</source>
|
||||
<translation>数据库写入失败</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@@ -1268,10 +1353,6 @@ Discard changes and close anyway?</source>
|
||||
<source>path to a custom config file</source>
|
||||
<translation>自定义配置文件路径</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>password of the database (DANGEROUS!)</source>
|
||||
<translation>数据库密码(危险!)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>key file of the database</source>
|
||||
<translation>数据库秘钥文件</translation>
|
||||
|
||||
@@ -13,6 +13,10 @@
|
||||
<source>Revision</source>
|
||||
<translation>修改紀錄</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Using:</source>
|
||||
<translation>使用:</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>AutoType</name>
|
||||
@@ -167,6 +171,43 @@
|
||||
<translation>選擇金鑰檔案</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DatabaseRepairWidget</name>
|
||||
<message>
|
||||
<source>Repair database</source>
|
||||
<translation>修復資料庫</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Error</source>
|
||||
<translation>錯誤</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Can't open key file</source>
|
||||
<translation>無法打開金鑰檔案</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Database opened fine. Nothing to do.</source>
|
||||
<translation>資料庫正常打開。沒什麼事。</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unable to open the database.</source>
|
||||
<translation>無法打開這個資料庫</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Success</source>
|
||||
<translation>成功</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The database has been successfully repaired
|
||||
You can now save it.</source>
|
||||
<translation>這個資料庫已經成功修復
|
||||
現在你可以儲存它。</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unable to repair the database.</source>
|
||||
<translation>無法開啟這個資料庫</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DatabaseSettingsWidget</name>
|
||||
<message>
|
||||
@@ -828,6 +869,17 @@ Do you want to save it anyway?</source>
|
||||
<source>Unable to calculate master key</source>
|
||||
<translation>無法計算主金鑰</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The selected file is an old KeePass 1 database (.kdb).
|
||||
|
||||
You can import it by clicking on Database > 'Import KeePass 1 database'.
|
||||
This is a one-way migration. You won't be able to open the imported database with the old KeePassX 0.4 version.</source>
|
||||
<translation>被選擇的檔案是舊的 KeePass 1 資料庫 (.kdb) 。
|
||||
|
||||
|
||||
你可以點選 資料庫 > 「匯入 KeePass 1 資料庫」。
|
||||
這是單向遷移。你無法用舊的 KeePassX 0.4 的版本打開被匯入的資料庫。</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>Main</name>
|
||||
@@ -1006,6 +1058,30 @@ Do you want to save it anyway?</source>
|
||||
<source>Export to CSV file</source>
|
||||
<translation>輸出成 CSV 檔案</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Repair database</source>
|
||||
<translation>修復資料庫</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>KeePass 2 Database</source>
|
||||
<translation>KeePass 2 資料庫</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>All files</source>
|
||||
<translation>所有的檔案</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Save repaired database</source>
|
||||
<translation>儲存已修復的資料庫</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Error</source>
|
||||
<translation>錯誤</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Writing the database failed.</source>
|
||||
<translation>寫入資料庫失敗</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>PasswordGeneratorWidget</name>
|
||||
|
||||
@@ -54,9 +54,6 @@ set(keepassx_SOURCES
|
||||
core/ListDeleter.h
|
||||
core/Metadata.cpp
|
||||
core/PasswordGenerator.cpp
|
||||
core/qlockfile.cpp
|
||||
core/qsavefile.cpp
|
||||
core/qsavefile_p.h
|
||||
core/SignalMultiplexer.cpp
|
||||
core/TimeDelta.cpp
|
||||
core/TimeInfo.cpp
|
||||
@@ -64,8 +61,6 @@ set(keepassx_SOURCES
|
||||
core/Tools.cpp
|
||||
core/Translator.cpp
|
||||
core/Uuid.cpp
|
||||
core/qcommandlineoption.cpp
|
||||
core/qcommandlineparser.cpp
|
||||
crypto/Crypto.cpp
|
||||
crypto/CryptoHash.cpp
|
||||
crypto/Random.cpp
|
||||
@@ -78,6 +73,7 @@ set(keepassx_SOURCES
|
||||
format/KeePass2.h
|
||||
format/KeePass2RandomStream.cpp
|
||||
format/KeePass2Reader.cpp
|
||||
format/KeePass2Repair.cpp
|
||||
format/KeePass2Writer.cpp
|
||||
format/KeePass2XmlReader.cpp
|
||||
format/KeePass2XmlWriter.cpp
|
||||
@@ -86,6 +82,7 @@ set(keepassx_SOURCES
|
||||
gui/ChangeMasterKeyWidget.cpp
|
||||
gui/Clipboard.cpp
|
||||
gui/DatabaseOpenWidget.cpp
|
||||
gui/DatabaseRepairWidget.cpp
|
||||
gui/DatabaseSettingsWidget.cpp
|
||||
gui/DatabaseTabWidget.cpp
|
||||
gui/DatabaseWidget.cpp
|
||||
@@ -119,6 +116,14 @@ set(keepassx_SOURCES
|
||||
gui/group/EditGroupWidget.cpp
|
||||
gui/group/GroupModel.cpp
|
||||
gui/group/GroupView.cpp
|
||||
http/AccessControlDialog.cpp
|
||||
http/EntryConfig.cpp
|
||||
http/HttpPasswordGeneratorWidget.cpp
|
||||
http/HttpSettings.cpp
|
||||
http/OptionDialog.cpp
|
||||
http/Protocol.cpp
|
||||
http/Server.cpp
|
||||
http/Service.cpp
|
||||
keys/CompositeKey.cpp
|
||||
keys/CompositeKey_p.h
|
||||
keys/FileKey.cpp
|
||||
@@ -131,93 +136,10 @@ set(keepassx_SOURCES
|
||||
streams/SymmetricCipherStream.cpp
|
||||
)
|
||||
|
||||
if(NOT GCRYPT_HAS_SALSA20)
|
||||
set(keepassx_SOURCES
|
||||
${keepassx_SOURCES}
|
||||
crypto/salsa20/ecrypt-config.h
|
||||
crypto/salsa20/ecrypt-machine.h
|
||||
crypto/salsa20/ecrypt-portable.h
|
||||
crypto/salsa20/ecrypt-sync.h
|
||||
crypto/salsa20/salsa20.c
|
||||
crypto/SymmetricCipherSalsa20.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
if(UNIX)
|
||||
set(keepassx_SOURCES
|
||||
${keepassx_SOURCES}
|
||||
core/qlockfile_unix.cpp
|
||||
)
|
||||
elseif(MINGW)
|
||||
set(keepassx_SOURCES
|
||||
${keepassx_SOURCES}
|
||||
core/qlockfile_win.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
set(keepassx_SOURCES_MAINEXE
|
||||
main.cpp
|
||||
)
|
||||
|
||||
set(keepassx_MOC
|
||||
autotype/AutoType.h
|
||||
autotype/AutoTypeSelectDialog.h
|
||||
autotype/AutoTypeSelectView.h
|
||||
autotype/ShortcutWidget.h
|
||||
autotype/WindowSelectComboBox.h
|
||||
core/AutoTypeAssociations.h
|
||||
core/Config.h
|
||||
core/Database.h
|
||||
core/Entry.h
|
||||
core/EntryAttachments.h
|
||||
core/EntryAttributes.h
|
||||
core/Group.h
|
||||
core/InactivityTimer.h
|
||||
core/Metadata.h
|
||||
core/qsavefile.h
|
||||
gui/AboutDialog.h
|
||||
gui/Application.h
|
||||
gui/ChangeMasterKeyWidget.h
|
||||
gui/Clipboard.h
|
||||
gui/DatabaseOpenWidget.h
|
||||
gui/DatabaseSettingsWidget.h
|
||||
gui/DatabaseTabWidget.h
|
||||
gui/DatabaseWidget.h
|
||||
gui/DatabaseWidgetStateSync.h
|
||||
gui/DialogyWidget.h
|
||||
gui/DragTabBar.h
|
||||
gui/EditWidget.h
|
||||
gui/EditWidgetIcons.h
|
||||
gui/EditWidgetProperties.h
|
||||
gui/IconModels.h
|
||||
gui/KeePass1OpenWidget.h
|
||||
gui/LineEdit.h
|
||||
gui/MainWindow.h
|
||||
gui/PasswordEdit.h
|
||||
gui/PasswordGeneratorWidget.h
|
||||
gui/PasswordComboBox.h
|
||||
gui/SettingsWidget.h
|
||||
gui/SortFilterHideProxyModel.h
|
||||
gui/UnlockDatabaseWidget.h
|
||||
gui/WelcomeWidget.h
|
||||
gui/entry/AutoTypeAssociationsModel.h
|
||||
gui/entry/EditEntryWidget.h
|
||||
gui/entry/EntryAttachmentsModel.h
|
||||
gui/entry/EntryAttributesModel.h
|
||||
gui/entry/EntryHistoryModel.h
|
||||
gui/entry/EntryModel.h
|
||||
gui/entry/EntryView.h
|
||||
gui/group/EditGroupWidget.h
|
||||
gui/group/GroupModel.h
|
||||
gui/group/GroupView.h
|
||||
keys/CompositeKey_p.h
|
||||
streams/HashedBlockStream.h
|
||||
streams/LayeredStream.h
|
||||
streams/qtiocompressor.h
|
||||
streams/StoreDataStream.h
|
||||
streams/SymmetricCipherStream.h
|
||||
)
|
||||
|
||||
set(keepassx_FORMS
|
||||
gui/AboutDialog.ui
|
||||
gui/ChangeMasterKeyWidget.ui
|
||||
@@ -237,6 +159,9 @@ set(keepassx_FORMS
|
||||
gui/entry/EditEntryWidgetHistory.ui
|
||||
gui/entry/EditEntryWidgetMain.ui
|
||||
gui/group/EditGroupWidgetMain.ui
|
||||
http/AccessControlDialog.ui
|
||||
http/HttpPasswordGeneratorWidget.ui
|
||||
http/OptionDialog.ui
|
||||
)
|
||||
|
||||
if(MINGW)
|
||||
@@ -245,17 +170,20 @@ if(MINGW)
|
||||
${CMAKE_SOURCE_DIR}/share/windows/icon.rc)
|
||||
endif()
|
||||
|
||||
qt4_wrap_ui(keepassx_SOURCES ${keepassx_FORMS})
|
||||
qt4_wrap_cpp(keepassx_SOURCES ${keepassx_MOC})
|
||||
qt5_wrap_ui(keepassx_SOURCES ${keepassx_FORMS})
|
||||
|
||||
add_library(keepassx_core STATIC ${keepassx_SOURCES})
|
||||
set_target_properties(keepassx_core PROPERTIES COMPILE_DEFINITIONS KEEPASSX_BUILDING_CORE)
|
||||
target_link_libraries(keepassx_core Qt5::Core Qt5::Concurrent Qt5::Widgets Qt5::Network)
|
||||
|
||||
add_executable(${PROGNAME} WIN32 MACOSX_BUNDLE ${keepassx_SOURCES_MAINEXE})
|
||||
target_link_libraries(${PROGNAME}
|
||||
keepassx_core
|
||||
${QT_QTCORE_LIBRARY}
|
||||
${QT_QTGUI_LIBRARY}
|
||||
${MHD_LIBRARIES}
|
||||
Qt5::Core
|
||||
Qt5::Concurrent
|
||||
Qt5::Widgets
|
||||
Qt5::Network
|
||||
${GCRYPT_LIBRARIES}
|
||||
${ZLIB_LIBRARIES})
|
||||
|
||||
@@ -273,7 +201,7 @@ install(TARGETS ${PROGNAME}
|
||||
|
||||
add_subdirectory(autotype)
|
||||
|
||||
if(APPLE AND NOT (${CMAKE_VERSION} VERSION_LESS 2.8.8))
|
||||
if(APPLE)
|
||||
if(QT_MAC_USE_COCOA AND EXISTS "${QT_LIBRARY_DIR}/Resources/qt_menu.nib")
|
||||
install(DIRECTORY "${QT_LIBRARY_DIR}/Resources/qt_menu.nib"
|
||||
DESTINATION "${DATA_INSTALL_DIR}")
|
||||
@@ -291,7 +219,7 @@ if(APPLE AND NOT (${CMAKE_VERSION} VERSION_LESS 2.8.8))
|
||||
install_qt4_executable(${PROGNAME}.app "qjpeg;qgif;qico;qtaccessiblewidgets")
|
||||
endif()
|
||||
|
||||
if(MINGW AND NOT (${CMAKE_VERSION} VERSION_LESS 2.8.8))
|
||||
if(MINGW )
|
||||
set(CPACK_GENERATOR "ZIP")
|
||||
set(CPACK_STRIP_FILES ON)
|
||||
set(CPACK_PACKAGE_FILE_NAME "${PROGNAME}-${KEEPASSX_VERSION_NUM}")
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
#include "core/Tools.h"
|
||||
#include "gui/MessageBox.h"
|
||||
|
||||
AutoType* AutoType::m_instance = Q_NULLPTR;
|
||||
AutoType* AutoType::m_instance = nullptr;
|
||||
|
||||
AutoType::AutoType(QObject* parent, bool test)
|
||||
: QObject(parent)
|
||||
@@ -40,8 +40,8 @@ AutoType::AutoType(QObject* parent, bool test)
|
||||
, m_currentGlobalKey(static_cast<Qt::Key>(0))
|
||||
, m_currentGlobalModifiers(0)
|
||||
, m_pluginLoader(new QPluginLoader(this))
|
||||
, m_plugin(Q_NULLPTR)
|
||||
, m_executor(Q_NULLPTR)
|
||||
, m_plugin(nullptr)
|
||||
, m_executor(nullptr)
|
||||
, m_windowFromGlobal(0)
|
||||
{
|
||||
// prevent crash when the plugin has unresolved symbols
|
||||
@@ -49,7 +49,7 @@ AutoType::AutoType(QObject* parent, bool test)
|
||||
|
||||
QString pluginName = "keepassx-autotype-";
|
||||
if (!test) {
|
||||
pluginName += Tools::platform();
|
||||
pluginName += QApplication::platformName();
|
||||
}
|
||||
else {
|
||||
pluginName += "test";
|
||||
@@ -68,7 +68,7 @@ AutoType::~AutoType()
|
||||
{
|
||||
if (m_executor) {
|
||||
delete m_executor;
|
||||
m_executor = Q_NULLPTR;
|
||||
m_executor = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ void AutoType::loadPlugin(const QString& pluginPath)
|
||||
QObject* pluginInstance = m_pluginLoader->instance();
|
||||
if (pluginInstance) {
|
||||
m_plugin = qobject_cast<AutoTypePlatformInterface*>(pluginInstance);
|
||||
m_executor = Q_NULLPTR;
|
||||
m_executor = nullptr;
|
||||
|
||||
if (m_plugin) {
|
||||
if (m_plugin->isAvailable()) {
|
||||
@@ -157,7 +157,7 @@ void AutoType::performAutoType(const Entry* entry, QWidget* hideWindow, const QS
|
||||
|
||||
QCoreApplication::processEvents(QEventLoop::AllEvents, 10);
|
||||
|
||||
Q_FOREACH (AutoTypeAction* action, actions) {
|
||||
for (AutoTypeAction* action : asConst(actions)) {
|
||||
if (m_plugin->activeWindow() != window) {
|
||||
qWarning("Active window changed, interrupting auto-type.");
|
||||
break;
|
||||
@@ -187,8 +187,9 @@ void AutoType::performGlobalAutoType(const QList<Database*>& dbList)
|
||||
QList<Entry*> entryList;
|
||||
QHash<Entry*, QString> sequenceHash;
|
||||
|
||||
Q_FOREACH (Database* db, dbList) {
|
||||
Q_FOREACH (Entry* entry, db->rootGroup()->entriesRecursive()) {
|
||||
for (Database* db : dbList) {
|
||||
const QList<Entry*> dbEntries = db->rootGroup()->entriesRecursive();
|
||||
for (Entry* entry : dbEntries) {
|
||||
QString sequence = autoTypeSequence(entry, windowTitle);
|
||||
if (!sequence.isEmpty()) {
|
||||
entryList << entry;
|
||||
@@ -202,11 +203,11 @@ void AutoType::performGlobalAutoType(const QList<Database*>& dbList)
|
||||
QString message = tr("Couldn't find an entry that matches the window title:");
|
||||
message.append("\n\n");
|
||||
message.append(windowTitle);
|
||||
MessageBox::information(Q_NULLPTR, tr("Auto-Type - KeePassX"), message);
|
||||
MessageBox::information(nullptr, tr("Auto-Type - KeePassX"), message);
|
||||
}
|
||||
else if ((entryList.size() == 1) && !config()->get("security/autotypeask").toBool()) {
|
||||
m_inAutoType = false;
|
||||
performAutoType(entryList.first(), Q_NULLPTR, sequenceHash[entryList.first()]);
|
||||
performAutoType(entryList.first(), nullptr, sequenceHash[entryList.first()]);
|
||||
}
|
||||
else {
|
||||
m_windowFromGlobal = m_plugin->activeWindow();
|
||||
@@ -228,7 +229,7 @@ void AutoType::performAutoTypeFromGlobal(Entry* entry, const QString& sequence)
|
||||
m_plugin->raiseWindow(m_windowFromGlobal);
|
||||
|
||||
m_inAutoType = false;
|
||||
performAutoType(entry, Q_NULLPTR, sequence, m_windowFromGlobal);
|
||||
performAutoType(entry, nullptr, sequence, m_windowFromGlobal);
|
||||
}
|
||||
|
||||
void AutoType::resetInAutoType()
|
||||
@@ -242,12 +243,12 @@ void AutoType::unloadPlugin()
|
||||
{
|
||||
if (m_executor) {
|
||||
delete m_executor;
|
||||
m_executor = Q_NULLPTR;
|
||||
m_executor = nullptr;
|
||||
}
|
||||
|
||||
if (m_plugin) {
|
||||
m_plugin->unload();
|
||||
m_plugin = Q_NULLPTR;
|
||||
m_plugin = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -300,7 +301,7 @@ bool AutoType::parseActions(const QString& sequence, const Entry* entry, QList<A
|
||||
QString tmpl;
|
||||
bool inTmpl = false;
|
||||
|
||||
Q_FOREACH (const QChar& ch, sequence) {
|
||||
for (const QChar& ch : sequence) {
|
||||
// TODO: implement support for {{}, {}} and {DELAY=X}
|
||||
|
||||
if (inTmpl) {
|
||||
@@ -482,10 +483,10 @@ QList<AutoTypeAction*> AutoType::createActionFromTemplate(const QString& tmpl, c
|
||||
}
|
||||
|
||||
|
||||
QString placeholder = QString("{%1}").arg(tmplName);
|
||||
QString resolved = entry->resolvePlaceholders(placeholder);
|
||||
const QString placeholder = QString("{%1}").arg(tmplName);
|
||||
const QString resolved = entry->resolvePlaceholders(placeholder);
|
||||
if (placeholder != resolved) {
|
||||
Q_FOREACH (const QChar& ch, resolved) {
|
||||
for (const QChar& ch : resolved) {
|
||||
if (ch == '\n') {
|
||||
list.append(new AutoTypeKey(Qt::Key_Enter));
|
||||
}
|
||||
@@ -511,7 +512,8 @@ QString AutoType::autoTypeSequence(const Entry* entry, const QString& windowTitl
|
||||
QString sequence;
|
||||
if (!windowTitle.isEmpty()) {
|
||||
bool match = false;
|
||||
Q_FOREACH (const AutoTypeAssociations::Association& assoc, entry->autoTypeAssociations()->getAll()) {
|
||||
const QList<AutoTypeAssociations::Association> assocList = entry->autoTypeAssociations()->getAll();
|
||||
for (const AutoTypeAssociations::Association& assoc : assocList) {
|
||||
if (windowMatches(windowTitle, assoc.window)) {
|
||||
if (!assoc.sequence.isEmpty()) {
|
||||
sequence = assoc.sequence;
|
||||
|
||||
@@ -22,8 +22,6 @@
|
||||
#include <QStringList>
|
||||
#include <QWidget>
|
||||
|
||||
#include "core/Global.h"
|
||||
|
||||
class AutoTypeAction;
|
||||
class AutoTypeExecutor;
|
||||
class AutoTypePlatformInterface;
|
||||
@@ -37,7 +35,7 @@ class AutoType : public QObject
|
||||
|
||||
public:
|
||||
QStringList windowTitles();
|
||||
void performAutoType(const Entry* entry, QWidget* hideWindow = Q_NULLPTR,
|
||||
void performAutoType(const Entry* entry, QWidget* hideWindow = nullptr,
|
||||
const QString& customSequence = QString(), WId window = 0);
|
||||
bool registerGlobalShortcut(Qt::Key key, Qt::KeyboardModifiers modifiers);
|
||||
void unregisterGlobalShortcut();
|
||||
@@ -62,7 +60,7 @@ private Q_SLOTS:
|
||||
void unloadPlugin();
|
||||
|
||||
private:
|
||||
explicit AutoType(QObject* parent = Q_NULLPTR, bool test = false);
|
||||
explicit AutoType(QObject* parent = nullptr, bool test = false);
|
||||
~AutoType();
|
||||
void loadPlugin(const QString& pluginPath);
|
||||
bool parseActions(const QString& sequence, const Entry* entry, QList<AutoTypeAction*>& actions);
|
||||
|
||||
@@ -66,7 +66,7 @@ public:
|
||||
class KEEPASSX_EXPORT AutoTypeClearField : public AutoTypeAction
|
||||
{
|
||||
public:
|
||||
explicit AutoTypeClearField();
|
||||
AutoTypeClearField();
|
||||
AutoTypeAction* clone();
|
||||
void accept(AutoTypeExecutor* executor);
|
||||
};
|
||||
|
||||
@@ -20,10 +20,12 @@
|
||||
#include <QApplication>
|
||||
#include <QDesktopWidget>
|
||||
#include <QDialogButtonBox>
|
||||
#include <QHeaderView>
|
||||
#include <QLabel>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
#include "autotype/AutoTypeSelectView.h"
|
||||
#include "core/Config.h"
|
||||
#include "core/FilePath.h"
|
||||
#include "gui/entry/EntryModel.h"
|
||||
|
||||
@@ -39,11 +41,14 @@ AutoTypeSelectDialog::AutoTypeSelectDialog(QWidget* parent)
|
||||
setWindowTitle(tr("Auto-Type - KeePassX"));
|
||||
setWindowIcon(filePath()->applicationIcon());
|
||||
|
||||
QSize size(400, 250);
|
||||
QRect screenGeometry = QApplication::desktop()->availableGeometry(QCursor::pos());
|
||||
QSize size = config()->get("GUI/AutoTypeSelectDialogSize", QSize(400, 250)).toSize();
|
||||
size.setWidth(qMin(size.width(), screenGeometry.width()));
|
||||
size.setHeight(qMin(size.height(), screenGeometry.height()));
|
||||
resize(size);
|
||||
|
||||
// move dialog to the center of the screen
|
||||
QPoint screenCenter = QApplication::desktop()->availableGeometry(QCursor::pos()).center();
|
||||
QPoint screenCenter = screenGeometry.center();
|
||||
move(screenCenter.x() - (size.width() / 2), screenCenter.y() - (size.height() / 2));
|
||||
|
||||
QVBoxLayout* layout = new QVBoxLayout(this);
|
||||
@@ -65,6 +70,15 @@ void AutoTypeSelectDialog::setEntries(const QList<Entry*>& entries, const QHash<
|
||||
{
|
||||
m_sequences = sequences;
|
||||
m_view->setEntryList(entries);
|
||||
|
||||
m_view->header()->resizeSections(QHeaderView::ResizeToContents);
|
||||
}
|
||||
|
||||
void AutoTypeSelectDialog::done(int r)
|
||||
{
|
||||
config()->set("GUI/AutoTypeSelectDialogSize", size());
|
||||
|
||||
QDialog::done(r);
|
||||
}
|
||||
|
||||
void AutoTypeSelectDialog::emitEntryActivated(const QModelIndex& index)
|
||||
|
||||
@@ -22,8 +22,6 @@
|
||||
#include <QDialog>
|
||||
#include <QHash>
|
||||
|
||||
#include "core/Global.h"
|
||||
|
||||
class AutoTypeSelectView;
|
||||
class Entry;
|
||||
|
||||
@@ -32,12 +30,15 @@ class AutoTypeSelectDialog : public QDialog
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit AutoTypeSelectDialog(QWidget* parent = Q_NULLPTR);
|
||||
explicit AutoTypeSelectDialog(QWidget* parent = nullptr);
|
||||
void setEntries(const QList<Entry*>& entries, const QHash<Entry*, QString>& sequences);
|
||||
|
||||
Q_SIGNALS:
|
||||
void entryActivated(Entry* entry, const QString& sequence);
|
||||
|
||||
public Q_SLOTS:
|
||||
void done(int r) override;
|
||||
|
||||
private Q_SLOTS:
|
||||
void emitEntryActivated(const QModelIndex& index);
|
||||
void entryRemoved();
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
#ifndef KEEPASSX_AUTOTYPESELECTVIEW_H
|
||||
#define KEEPASSX_AUTOTYPESELECTVIEW_H
|
||||
|
||||
#include "core/Global.h"
|
||||
#include "gui/entry/EntryView.h"
|
||||
|
||||
class Entry;
|
||||
@@ -28,10 +27,10 @@ class AutoTypeSelectView : public EntryView
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit AutoTypeSelectView(QWidget* parent = Q_NULLPTR);
|
||||
explicit AutoTypeSelectView(QWidget* parent = nullptr);
|
||||
|
||||
protected:
|
||||
void mouseMoveEvent(QMouseEvent* event) Q_DECL_OVERRIDE;
|
||||
void mouseMoveEvent(QMouseEvent* event) override;
|
||||
|
||||
private Q_SLOTS:
|
||||
void selectFirstEntry();
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
if(Q_WS_X11)
|
||||
if(UNIX AND NOT APPLE)
|
||||
find_package(X11)
|
||||
find_package(Qt5X11Extras 5.2)
|
||||
if(PRINT_SUMMARY)
|
||||
add_feature_info(libXi X11_Xi_FOUND "The X11 Xi Protocol library is required for auto-type")
|
||||
add_feature_info(libXtest X11_XTest_FOUND "The X11 XTEST Protocol library is required for auto-type")
|
||||
add_feature_info(libXtst X11_XTest_FOUND "The X11 XTEST Protocol library is required for auto-type")
|
||||
add_feature_info(Qt5X11Extras Qt5X11Extras_FOUND "The Qt5X11Extras library is required for auto-type")
|
||||
endif()
|
||||
|
||||
if(X11_FOUND AND X11_Xi_FOUND AND X11_XTest_FOUND)
|
||||
add_subdirectory(x11)
|
||||
if(X11_FOUND AND X11_Xi_FOUND AND X11_XTest_FOUND AND Qt5X11Extras_FOUND)
|
||||
add_subdirectory(xcb)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
@@ -20,21 +20,19 @@
|
||||
|
||||
#include <QLineEdit>
|
||||
|
||||
#include "core/Global.h"
|
||||
|
||||
class ShortcutWidget : public QLineEdit
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ShortcutWidget(QWidget* parent = Q_NULLPTR);
|
||||
explicit ShortcutWidget(QWidget* parent = nullptr);
|
||||
Qt::Key key() const;
|
||||
Qt::KeyboardModifiers modifiers() const;
|
||||
void setShortcut(Qt::Key key, Qt::KeyboardModifiers modifiers);
|
||||
|
||||
protected:
|
||||
void keyPressEvent(QKeyEvent* event) Q_DECL_OVERRIDE;
|
||||
void keyReleaseEvent(QKeyEvent* event) Q_DECL_OVERRIDE;
|
||||
void keyPressEvent(QKeyEvent* event) override;
|
||||
void keyReleaseEvent(QKeyEvent* event) override;
|
||||
|
||||
private:
|
||||
void keyEvent(QKeyEvent* event);
|
||||
|
||||
@@ -70,7 +70,7 @@ bool WildcardMatcher::startOrEndDoesNotMatch(const QStringList& parts)
|
||||
bool WildcardMatcher::partsMatch(const QStringList& parts)
|
||||
{
|
||||
int index = 0;
|
||||
Q_FOREACH (const QString& part, parts) {
|
||||
for (const QString& part : parts) {
|
||||
int matchIndex = getMatchIndex(part, index);
|
||||
if (noMatchFound(matchIndex)) {
|
||||
return false;
|
||||
|
||||
@@ -20,19 +20,17 @@
|
||||
|
||||
#include <QComboBox>
|
||||
|
||||
#include "core/Global.h"
|
||||
|
||||
class WindowSelectComboBox : public QComboBox
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit WindowSelectComboBox(QWidget* parent = Q_NULLPTR);
|
||||
explicit WindowSelectComboBox(QWidget* parent = nullptr);
|
||||
void refreshWindowList();
|
||||
|
||||
void showPopup() Q_DECL_OVERRIDE;
|
||||
QSize sizeHint() const Q_DECL_OVERRIDE;
|
||||
QSize minimumSizeHint() const Q_DECL_OVERRIDE;
|
||||
void showPopup() override;
|
||||
QSize sizeHint() const override;
|
||||
QSize minimumSizeHint() const override;
|
||||
};
|
||||
|
||||
#endif // KEEPASSX_WINDOWSELECTCOMBOBOX_H
|
||||
|
||||
@@ -129,5 +129,3 @@ void AutoTypeExecturorTest::execKey(AutoTypeKey* action)
|
||||
{
|
||||
m_platform->addActionKey(action);
|
||||
}
|
||||
|
||||
Q_EXPORT_PLUGIN2(keepassx-autotype-test, AutoTypePlatformTest)
|
||||
|
||||
@@ -23,34 +23,34 @@
|
||||
#include "autotype/AutoTypePlatformPlugin.h"
|
||||
#include "autotype/AutoTypeAction.h"
|
||||
#include "autotype/test/AutoTypeTestInterface.h"
|
||||
#include "core/Global.h"
|
||||
|
||||
class AutoTypePlatformTest : public QObject,
|
||||
public AutoTypePlatformInterface,
|
||||
public AutoTypeTestInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PLUGIN_METADATA(IID "org.keepassx.AutoTypePlatformInterface")
|
||||
Q_INTERFACES(AutoTypePlatformInterface AutoTypeTestInterface)
|
||||
|
||||
public:
|
||||
QString keyToString(Qt::Key key) Q_DECL_OVERRIDE;
|
||||
QString keyToString(Qt::Key key) override;
|
||||
|
||||
bool isAvailable() Q_DECL_OVERRIDE;
|
||||
QStringList windowTitles() Q_DECL_OVERRIDE;
|
||||
WId activeWindow() Q_DECL_OVERRIDE;
|
||||
QString activeWindowTitle() Q_DECL_OVERRIDE;
|
||||
bool registerGlobalShortcut(Qt::Key key, Qt::KeyboardModifiers modifiers) Q_DECL_OVERRIDE;
|
||||
void unregisterGlobalShortcut(Qt::Key key, Qt::KeyboardModifiers modifiers) Q_DECL_OVERRIDE;
|
||||
int platformEventFilter(void* event) Q_DECL_OVERRIDE;
|
||||
int initialTimeout() Q_DECL_OVERRIDE;
|
||||
bool raiseWindow(WId window) Q_DECL_OVERRIDE;
|
||||
AutoTypeExecutor* createExecutor() Q_DECL_OVERRIDE;
|
||||
bool isAvailable() override;
|
||||
QStringList windowTitles() override;
|
||||
WId activeWindow() override;
|
||||
QString activeWindowTitle() override;
|
||||
bool registerGlobalShortcut(Qt::Key key, Qt::KeyboardModifiers modifiers) override;
|
||||
void unregisterGlobalShortcut(Qt::Key key, Qt::KeyboardModifiers modifiers) override;
|
||||
int platformEventFilter(void* event) override;
|
||||
int initialTimeout() override;
|
||||
bool raiseWindow(WId window) override;
|
||||
AutoTypeExecutor* createExecutor() override;
|
||||
|
||||
void setActiveWindowTitle(const QString& title) Q_DECL_OVERRIDE;
|
||||
void setActiveWindowTitle(const QString& title) override;
|
||||
|
||||
QString actionChars() Q_DECL_OVERRIDE;
|
||||
int actionCount() Q_DECL_OVERRIDE;
|
||||
void clearActions() Q_DECL_OVERRIDE;
|
||||
QString actionChars() override;
|
||||
int actionCount() override;
|
||||
void clearActions() override;
|
||||
|
||||
void addActionChar(AutoTypeChar* action);
|
||||
void addActionKey(AutoTypeKey* action);
|
||||
@@ -69,8 +69,8 @@ class AutoTypeExecturorTest : public AutoTypeExecutor
|
||||
public:
|
||||
explicit AutoTypeExecturorTest(AutoTypePlatformTest* platform);
|
||||
|
||||
void execChar(AutoTypeChar* action) Q_DECL_OVERRIDE;
|
||||
void execKey(AutoTypeKey* action) Q_DECL_OVERRIDE;
|
||||
void execChar(AutoTypeChar* action) override;
|
||||
void execKey(AutoTypeKey* action) override;
|
||||
|
||||
private:
|
||||
AutoTypePlatformTest* const m_platform;
|
||||
|
||||
@@ -2,11 +2,5 @@ set(autotype_test_SOURCES
|
||||
AutoTypeTest.cpp
|
||||
)
|
||||
|
||||
set(autotype_test_MOC
|
||||
AutoTypeTest.h
|
||||
)
|
||||
|
||||
qt4_wrap_cpp(autotype_test_SOURCES ${autotype_test_MOC})
|
||||
|
||||
add_library(keepassx-autotype-test MODULE ${autotype_test_SOURCES})
|
||||
target_link_libraries(keepassx-autotype-test testautotype ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY})
|
||||
target_link_libraries(keepassx-autotype-test testautotype Qt5::Core Qt5::Widgets)
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
include_directories(SYSTEM ${X11_X11_INCLUDE_PATH})
|
||||
|
||||
set(autotype_X11_SOURCES
|
||||
AutoTypeX11.cpp
|
||||
)
|
||||
|
||||
set(autotype_X11_MOC
|
||||
AutoTypeX11.h
|
||||
)
|
||||
|
||||
qt4_wrap_cpp(autotype_X11_SOURCES ${autotype_X11_MOC})
|
||||
|
||||
add_library(keepassx-autotype-x11 MODULE ${autotype_X11_SOURCES})
|
||||
target_link_libraries(keepassx-autotype-x11 ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${X11_X11_LIB} ${X11_Xi_LIB} ${X11_XTest_LIB})
|
||||
install(TARGETS keepassx-autotype-x11
|
||||
BUNDLE DESTINATION . COMPONENT Runtime
|
||||
LIBRARY DESTINATION ${PLUGIN_INSTALL_DIR} COMPONENT Runtime)
|
||||
@@ -16,14 +16,16 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "AutoTypeX11.h"
|
||||
#include "AutoTypeXCB.h"
|
||||
#include "KeySymMap.h"
|
||||
#include "core/Tools.h"
|
||||
|
||||
#include <time.h>
|
||||
#include <xcb/xcb.h>
|
||||
|
||||
bool AutoTypePlatformX11::m_catchXErrors = false;
|
||||
bool AutoTypePlatformX11::m_xErrorOccured = false;
|
||||
int (*AutoTypePlatformX11::m_oldXErrorHandler)(Display*, XErrorEvent*) = Q_NULLPTR;
|
||||
int (*AutoTypePlatformX11::m_oldXErrorHandler)(Display*, XErrorEvent*) = nullptr;
|
||||
|
||||
AutoTypePlatformX11::AutoTypePlatformX11()
|
||||
{
|
||||
@@ -46,8 +48,8 @@ AutoTypePlatformX11::AutoTypePlatformX11()
|
||||
m_currentGlobalKey = static_cast<Qt::Key>(0);
|
||||
m_currentGlobalModifiers = 0;
|
||||
|
||||
m_keysymTable = Q_NULLPTR;
|
||||
m_xkb = Q_NULLPTR;
|
||||
m_keysymTable = nullptr;
|
||||
m_xkb = nullptr;
|
||||
m_remapKeycode = 0;
|
||||
m_currentRemapKeysym = NoSymbol;
|
||||
m_modifierMask = ControlMask | ShiftMask | Mod1Mask | Mod4Mask;
|
||||
@@ -119,7 +121,7 @@ WId AutoTypePlatformX11::activeWindow()
|
||||
|
||||
Window root;
|
||||
Window parent;
|
||||
Window* children = Q_NULLPTR;
|
||||
Window* children = nullptr;
|
||||
unsigned int numChildren;
|
||||
tree = XQueryTree(m_dpy, window, &root, &parent, &children, &numChildren);
|
||||
window = parent;
|
||||
@@ -202,22 +204,42 @@ void AutoTypePlatformX11::unregisterGlobalShortcut(Qt::Key key, Qt::KeyboardModi
|
||||
|
||||
int AutoTypePlatformX11::platformEventFilter(void* event)
|
||||
{
|
||||
XEvent* xevent = static_cast<XEvent*>(event);
|
||||
xcb_generic_event_t* genericEvent = static_cast<xcb_generic_event_t*>(event);
|
||||
quint8 type = genericEvent->response_type & 0x7f;
|
||||
|
||||
if ((xevent->type == KeyPress || xevent->type == KeyRelease)
|
||||
&& m_currentGlobalKey
|
||||
&& xevent->xkey.keycode == m_currentGlobalKeycode
|
||||
&& (xevent->xkey.state & m_modifierMask) == m_currentGlobalNativeModifiers
|
||||
&& (!QApplication::activeWindow() || QApplication::activeWindow()->isMinimized())
|
||||
&& m_loaded) {
|
||||
if (xevent->type == KeyPress) {
|
||||
Q_EMIT globalShortcutTriggered();
|
||||
if (type == XCB_KEY_PRESS || type == XCB_KEY_RELEASE) {
|
||||
xcb_key_press_event_t* keyPressEvent = static_cast<xcb_key_press_event_t*>(event);
|
||||
if (keyPressEvent->detail == m_currentGlobalKeycode
|
||||
&& (keyPressEvent->state & m_modifierMask) == m_currentGlobalNativeModifiers
|
||||
&& (!QApplication::activeWindow() || QApplication::activeWindow()->isMinimized())
|
||||
&& m_loaded) {
|
||||
if (type == XCB_KEY_PRESS) {
|
||||
Q_EMIT globalShortcutTriggered();
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
if (xevent->type == MappingNotify && m_loaded) {
|
||||
XRefreshKeyboardMapping(reinterpret_cast<XMappingEvent*>(xevent));
|
||||
updateKeymap();
|
||||
else if (type == XCB_MAPPING_NOTIFY) {
|
||||
xcb_mapping_notify_event_t* mappingNotifyEvent = static_cast<xcb_mapping_notify_event_t*>(event);
|
||||
if (mappingNotifyEvent->request == XCB_MAPPING_KEYBOARD
|
||||
|| mappingNotifyEvent->request == XCB_MAPPING_MODIFIER)
|
||||
{
|
||||
XMappingEvent xMappingEvent;
|
||||
memset(&xMappingEvent, 0, sizeof(xMappingEvent));
|
||||
xMappingEvent.type = MappingNotify;
|
||||
xMappingEvent.display = m_dpy;
|
||||
if (mappingNotifyEvent->request == XCB_MAPPING_KEYBOARD) {
|
||||
xMappingEvent.request = MappingKeyboard;
|
||||
}
|
||||
else {
|
||||
xMappingEvent.request = MappingModifier;
|
||||
}
|
||||
xMappingEvent.first_keycode = mappingNotifyEvent->first_keycode;
|
||||
xMappingEvent.count = mappingNotifyEvent->count;
|
||||
XRefreshKeyboardMapping(&xMappingEvent);
|
||||
updateKeymap();
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
@@ -236,7 +258,7 @@ QString AutoTypePlatformX11::windowTitle(Window window, bool useBlacklist)
|
||||
int format;
|
||||
unsigned long nitems;
|
||||
unsigned long after;
|
||||
unsigned char* data = Q_NULLPTR;
|
||||
unsigned char* data = nullptr;
|
||||
|
||||
// the window manager spec says we should read _NET_WM_NAME first, then fall back to WM_NAME
|
||||
|
||||
@@ -250,7 +272,7 @@ QString AutoTypePlatformX11::windowTitle(Window window, bool useBlacklist)
|
||||
XTextProperty textProp;
|
||||
retVal = XGetTextProperty(m_dpy, window, &textProp, m_atomWmName);
|
||||
if ((retVal != 0) && textProp.value) {
|
||||
char** textList = Q_NULLPTR;
|
||||
char** textList = nullptr;
|
||||
int count;
|
||||
|
||||
if (textProp.encoding == m_atomUtf8String) {
|
||||
@@ -302,8 +324,8 @@ QString AutoTypePlatformX11::windowClassName(Window window)
|
||||
QString className;
|
||||
|
||||
XClassHint wmClass;
|
||||
wmClass.res_name = Q_NULLPTR;
|
||||
wmClass.res_class = Q_NULLPTR;
|
||||
wmClass.res_name = nullptr;
|
||||
wmClass.res_class = nullptr;
|
||||
|
||||
if (XGetClassHint(m_dpy, window, &wmClass) && wmClass.res_name) {
|
||||
className = QString::fromLocal8Bit(wmClass.res_name);
|
||||
@@ -322,7 +344,7 @@ QList<Window> AutoTypePlatformX11::widgetsToX11Windows(const QWidgetList& widget
|
||||
{
|
||||
QList<Window> windows;
|
||||
|
||||
Q_FOREACH (const QWidget* widget, widgetList) {
|
||||
for (const QWidget* widget : widgetList) {
|
||||
windows.append(widget->effectiveWinId());
|
||||
}
|
||||
|
||||
@@ -342,7 +364,7 @@ QStringList AutoTypePlatformX11::windowTitlesRecursive(Window window)
|
||||
|
||||
Window root;
|
||||
Window parent;
|
||||
Window* children = Q_NULLPTR;
|
||||
Window* children = nullptr;
|
||||
unsigned int numChildren;
|
||||
if (XQueryTree(m_dpy, window, &root, &parent, &children, &numChildren) && children) {
|
||||
for (uint i = 0; i < numChildren; i++) {
|
||||
@@ -363,13 +385,21 @@ bool AutoTypePlatformX11::isTopLevelWindow(Window window)
|
||||
unsigned long nitems;
|
||||
unsigned long after;
|
||||
unsigned char* data = Q_NULLPTR;
|
||||
int retVal = XGetWindowProperty(m_dpy, window, m_atomWmState, 0, 0, False, AnyPropertyType, &type, &format,
|
||||
int retVal = XGetWindowProperty(m_dpy, window, m_atomWmState, 0, 2, False, m_atomWmState, &type, &format,
|
||||
&nitems, &after, &data);
|
||||
if (data) {
|
||||
|
||||
bool result = false;
|
||||
|
||||
if (retVal == 0 && data) {
|
||||
if (type == m_atomWmState && format == 32 && nitems > 0) {
|
||||
qint32 state = static_cast<qint32>(*data);
|
||||
result = (state != WithdrawnState);
|
||||
}
|
||||
|
||||
XFree(data);
|
||||
}
|
||||
|
||||
return (retVal == 0) && type;
|
||||
return result;
|
||||
}
|
||||
|
||||
KeySym AutoTypePlatformX11::charToKeySym(const QChar& ch)
|
||||
@@ -383,9 +413,9 @@ KeySym AutoTypePlatformX11::charToKeySym(const QChar& ch)
|
||||
}
|
||||
|
||||
/* mapping table generated from keysymdef.h */
|
||||
const uint* match = qBinaryFind(m_unicodeToKeysymKeys,
|
||||
m_unicodeToKeysymKeys + m_unicodeToKeysymLen,
|
||||
unicode);
|
||||
const uint* match = Tools::binaryFind(m_unicodeToKeysymKeys,
|
||||
m_unicodeToKeysymKeys + m_unicodeToKeysymLen,
|
||||
unicode);
|
||||
int index = match - m_unicodeToKeysymKeys;
|
||||
if (index != m_unicodeToKeysymLen) {
|
||||
return m_unicodeToKeysymValues[index];
|
||||
@@ -506,7 +536,7 @@ void AutoTypePlatformX11::updateKeymap()
|
||||
timespec ts;
|
||||
ts.tv_sec = 0;
|
||||
ts.tv_nsec = 30 * 1000 * 1000;
|
||||
nanosleep(&ts, Q_NULLPTR);
|
||||
nanosleep(&ts, nullptr);
|
||||
}
|
||||
|
||||
bool AutoTypePlatformX11::isRemapKeycodeValid()
|
||||
@@ -557,7 +587,7 @@ XkbDescPtr AutoTypePlatformX11::getKeyboard()
|
||||
XID keyboard_id = XkbUseCoreKbd;
|
||||
XDeviceInfo* devices = XListInputDevices(m_dpy, &num_devices);
|
||||
if (!devices) {
|
||||
return Q_NULLPTR;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
for (int i = 0; i < num_devices; i++) {
|
||||
@@ -713,7 +743,7 @@ void AutoTypePlatformX11::SendKeyPressedEvent(KeySym keysym)
|
||||
event.y = 1;
|
||||
event.x_root = 1;
|
||||
event.y_root = 1;
|
||||
event.same_screen = TRUE;
|
||||
event.same_screen = True;
|
||||
|
||||
Window root, child;
|
||||
int root_x, root_y, x, y;
|
||||
@@ -846,5 +876,3 @@ bool AutoTypePlatformX11::raiseWindow(WId window)
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Q_EXPORT_PLUGIN2(keepassx-autotype-x11, AutoTypePlatformX11)
|
||||
@@ -16,8 +16,8 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef KEEPASSX_AUTOTYPEX11_H
|
||||
#define KEEPASSX_AUTOTYPEX11_H
|
||||
#ifndef KEEPASSX_AUTOTYPEXCB_H
|
||||
#define KEEPASSX_AUTOTYPEXCB_H
|
||||
|
||||
#include <QApplication>
|
||||
#include <QSet>
|
||||
@@ -31,28 +31,28 @@
|
||||
|
||||
#include "autotype/AutoTypePlatformPlugin.h"
|
||||
#include "autotype/AutoTypeAction.h"
|
||||
#include "core/Global.h"
|
||||
|
||||
#define N_MOD_INDICES (Mod5MapIndex + 1)
|
||||
|
||||
class AutoTypePlatformX11 : public QObject, public AutoTypePlatformInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PLUGIN_METADATA(IID "org.keepassx.AutoTypePlatformX11")
|
||||
Q_INTERFACES(AutoTypePlatformInterface)
|
||||
|
||||
public:
|
||||
AutoTypePlatformX11();
|
||||
bool isAvailable() Q_DECL_OVERRIDE;
|
||||
void unload() Q_DECL_OVERRIDE;
|
||||
QStringList windowTitles() Q_DECL_OVERRIDE;
|
||||
WId activeWindow() Q_DECL_OVERRIDE;
|
||||
QString activeWindowTitle() Q_DECL_OVERRIDE;
|
||||
bool registerGlobalShortcut(Qt::Key key, Qt::KeyboardModifiers modifiers) Q_DECL_OVERRIDE;
|
||||
void unregisterGlobalShortcut(Qt::Key key, Qt::KeyboardModifiers modifiers) Q_DECL_OVERRIDE;
|
||||
int platformEventFilter(void* event) Q_DECL_OVERRIDE;
|
||||
int initialTimeout() Q_DECL_OVERRIDE;
|
||||
bool raiseWindow(WId window) Q_DECL_OVERRIDE;
|
||||
AutoTypeExecutor* createExecutor() Q_DECL_OVERRIDE;
|
||||
bool isAvailable() override;
|
||||
void unload() override;
|
||||
QStringList windowTitles() override;
|
||||
WId activeWindow() override;
|
||||
QString activeWindowTitle() override;
|
||||
bool registerGlobalShortcut(Qt::Key key, Qt::KeyboardModifiers modifiers) override;
|
||||
void unregisterGlobalShortcut(Qt::Key key, Qt::KeyboardModifiers modifiers) override;
|
||||
int platformEventFilter(void* event) override;
|
||||
int initialTimeout() override;
|
||||
bool raiseWindow(WId window) override;
|
||||
AutoTypeExecutor* createExecutor() override;
|
||||
|
||||
KeySym charToKeySym(const QChar& ch);
|
||||
KeySym keyToKeySym(Qt::Key key);
|
||||
@@ -124,11 +124,11 @@ class AutoTypeExecturorX11 : public AutoTypeExecutor
|
||||
public:
|
||||
explicit AutoTypeExecturorX11(AutoTypePlatformX11* platform);
|
||||
|
||||
void execChar(AutoTypeChar* action) Q_DECL_OVERRIDE;
|
||||
void execKey(AutoTypeKey* action) Q_DECL_OVERRIDE;
|
||||
void execChar(AutoTypeChar* action) override;
|
||||
void execKey(AutoTypeKey* action) override;
|
||||
|
||||
private:
|
||||
AutoTypePlatformX11* const m_platform;
|
||||
};
|
||||
|
||||
#endif // KEEPASSX_AUTOTYPEX11_H
|
||||
#endif // KEEPASSX_AUTOTYPEXCB_H
|
||||
11
src/autotype/xcb/CMakeLists.txt
Normal file
11
src/autotype/xcb/CMakeLists.txt
Normal file
@@ -0,0 +1,11 @@
|
||||
include_directories(SYSTEM ${X11_X11_INCLUDE_PATH})
|
||||
|
||||
set(autotype_XCB_SOURCES
|
||||
AutoTypeXCB.cpp
|
||||
)
|
||||
|
||||
add_library(keepassx-autotype-xcb MODULE ${autotype_XCB_SOURCES})
|
||||
target_link_libraries(keepassx-autotype-xcb Qt5::Core Qt5::Widgets Qt5::X11Extras ${X11_X11_LIB} ${X11_Xi_LIB} ${X11_XTest_LIB})
|
||||
install(TARGETS keepassx-autotype-xcb
|
||||
BUNDLE DESTINATION . COMPONENT Runtime
|
||||
LIBRARY DESTINATION ${PLUGIN_INSTALL_DIR} COMPONENT Runtime)
|
||||
@@ -16,6 +16,4 @@
|
||||
#cmakedefine HAVE_RLIMIT_CORE 1
|
||||
#cmakedefine HAVE_PT_DENY_ATTACH 1
|
||||
|
||||
#cmakedefine GCRYPT_HAS_SALSA20
|
||||
|
||||
#endif // KEEPASSX_CONFIG_KEEPASSX_H
|
||||
|
||||
@@ -20,8 +20,6 @@
|
||||
|
||||
#include <QObject>
|
||||
|
||||
#include "core/Global.h"
|
||||
|
||||
class AutoTypeAssociations : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -36,7 +34,7 @@ public:
|
||||
bool operator!=(const AutoTypeAssociations::Association& other) const;
|
||||
};
|
||||
|
||||
explicit AutoTypeAssociations(QObject* parent = Q_NULLPTR);
|
||||
explicit AutoTypeAssociations(QObject* parent = nullptr);
|
||||
void copyDataFrom(const AutoTypeAssociations* other);
|
||||
void add(const AutoTypeAssociations::Association& association);
|
||||
void remove(int index);
|
||||
|
||||
@@ -18,12 +18,12 @@
|
||||
#include "Config.h"
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QDesktopServices>
|
||||
#include <QDir>
|
||||
#include <QSettings>
|
||||
#include <QStandardPaths>
|
||||
#include <QTemporaryFile>
|
||||
|
||||
Config* Config::m_instance(Q_NULLPTR);
|
||||
Config* Config::m_instance(nullptr);
|
||||
|
||||
QVariant Config::get(const QString& key)
|
||||
{
|
||||
@@ -53,7 +53,7 @@ Config::Config(QObject* parent)
|
||||
QString homePath = QDir::homePath();
|
||||
|
||||
#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
|
||||
// we can't use QDesktopServices on X11 as it uses XDG_DATA_HOME instead of XDG_CONFIG_HOME
|
||||
// we can't use QStandardPaths on X11 as it uses XDG_DATA_HOME instead of XDG_CONFIG_HOME
|
||||
QByteArray env = qgetenv("XDG_CONFIG_HOME");
|
||||
if (env.isEmpty()) {
|
||||
userPath = homePath;
|
||||
@@ -70,7 +70,7 @@ Config::Config(QObject* parent)
|
||||
|
||||
userPath += "/keepassx/";
|
||||
#else
|
||||
userPath = QDir::fromNativeSeparators(QDesktopServices::storageLocation(QDesktopServices::DataLocation));
|
||||
userPath = QDir::fromNativeSeparators(QStandardPaths::writableLocation(QStandardPaths::DataLocation));
|
||||
// storageLocation() appends the application name ("/keepassx") to the end
|
||||
userPath += "/";
|
||||
#endif
|
||||
@@ -106,6 +106,7 @@ void Config::init(const QString& fileName)
|
||||
m_defaults.insert("GUI/Language", "system");
|
||||
m_defaults.insert("GUI/ShowTrayIcon", false);
|
||||
m_defaults.insert("GUI/MinimizeToTray", false);
|
||||
m_defaults.insert("GUI/MinimizeOnClose", false);
|
||||
}
|
||||
|
||||
Config* Config::instance()
|
||||
|
||||
@@ -21,8 +21,6 @@
|
||||
#include <QScopedPointer>
|
||||
#include <QVariant>
|
||||
|
||||
#include "core/Global.h"
|
||||
|
||||
class QSettings;
|
||||
|
||||
class Config : public QObject
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
|
||||
#include "core/Group.h"
|
||||
#include "core/Metadata.h"
|
||||
#include "core/Tools.h"
|
||||
#include "crypto/Random.h"
|
||||
#include "format/KeePass2.h"
|
||||
|
||||
@@ -92,20 +91,22 @@ Entry* Database::resolveEntry(const Uuid& uuid)
|
||||
|
||||
Entry* Database::recFindEntry(const Uuid& uuid, Group* group)
|
||||
{
|
||||
Q_FOREACH (Entry* entry, group->entries()) {
|
||||
const QList<Entry*> entryList = group->entries();
|
||||
for (Entry* entry : entryList) {
|
||||
if (entry->uuid() == uuid) {
|
||||
return entry;
|
||||
}
|
||||
}
|
||||
|
||||
Q_FOREACH (Group* child, group->children()) {
|
||||
const QList<Group*> children = group->children();
|
||||
for (Group* child : children) {
|
||||
Entry* result = recFindEntry(uuid, child);
|
||||
if (result) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
return Q_NULLPTR;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Group* Database::resolveGroup(const Uuid& uuid)
|
||||
@@ -119,14 +120,15 @@ Group* Database::recFindGroup(const Uuid& uuid, Group* group)
|
||||
return group;
|
||||
}
|
||||
|
||||
Q_FOREACH (Group* child, group->children()) {
|
||||
const QList<Group*> children = group->children();
|
||||
for (Group* child : children) {
|
||||
Group* result = recFindGroup(uuid, child);
|
||||
if (result) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
return Q_NULLPTR;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
QList<DeletedObject> Database::deletedObjects()
|
||||
@@ -143,7 +145,7 @@ void Database::addDeletedObject(const DeletedObject& delObj)
|
||||
void Database::addDeletedObject(const Uuid& uuid)
|
||||
{
|
||||
DeletedObject delObj;
|
||||
delObj.deletionTime = Tools::currentDateTimeUtc();
|
||||
delObj.deletionTime = QDateTime::currentDateTimeUtc();
|
||||
delObj.uuid = uuid;
|
||||
|
||||
addDeletedObject(delObj);
|
||||
@@ -223,7 +225,7 @@ bool Database::setKey(const CompositeKey& key, const QByteArray& transformSeed,
|
||||
m_data.transformedMasterKey = transformedMasterKey;
|
||||
m_data.hasKey = true;
|
||||
if (updateChangedTime) {
|
||||
m_metadata->setMasterKeyChanged(Tools::currentDateTimeUtc());
|
||||
m_metadata->setMasterKeyChanged(QDateTime::currentDateTimeUtc());
|
||||
}
|
||||
Q_EMIT modifiedImmediate();
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
|
||||
#include <QDateTime>
|
||||
#include <QHash>
|
||||
#include <QObject>
|
||||
|
||||
#include "core/Uuid.h"
|
||||
#include "keys/CompositeKey.h"
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
#include "core/FilePath.h"
|
||||
|
||||
DatabaseIcons* DatabaseIcons::m_instance(Q_NULLPTR);
|
||||
DatabaseIcons* DatabaseIcons::m_instance(nullptr);
|
||||
const int DatabaseIcons::IconCount(69);
|
||||
const int DatabaseIcons::ExpiredIconIndex(45);
|
||||
const char* const DatabaseIcons::m_indexToName[] = {
|
||||
|
||||
@@ -23,8 +23,6 @@
|
||||
#include <QPixmapCache>
|
||||
#include <QVector>
|
||||
|
||||
#include "core/Global.h"
|
||||
|
||||
class DatabaseIcons
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
#include "core/DatabaseIcons.h"
|
||||
#include "core/Group.h"
|
||||
#include "core/Metadata.h"
|
||||
#include "core/Tools.h"
|
||||
|
||||
const int Entry::DefaultIconNumber = 0;
|
||||
|
||||
@@ -29,7 +28,7 @@ Entry::Entry()
|
||||
: m_attributes(new EntryAttributes(this))
|
||||
, m_attachments(new EntryAttachments(this))
|
||||
, m_autoTypeAssociations(new AutoTypeAssociations(this))
|
||||
, m_tmpHistoryItem(Q_NULLPTR)
|
||||
, m_tmpHistoryItem(nullptr)
|
||||
, m_modifiedSinceBegin(false)
|
||||
, m_updateTimeinfo(true)
|
||||
{
|
||||
@@ -74,8 +73,8 @@ template <class T> inline bool Entry::set(T& property, const T& value)
|
||||
void Entry::updateTimeinfo()
|
||||
{
|
||||
if (m_updateTimeinfo) {
|
||||
m_data.timeInfo.setLastModificationTime(Tools::currentDateTimeUtc());
|
||||
m_data.timeInfo.setLastAccessTime(Tools::currentDateTimeUtc());
|
||||
m_data.timeInfo.setLastModificationTime(QDateTime::currentDateTimeUtc());
|
||||
m_data.timeInfo.setLastAccessTime(QDateTime::currentDateTimeUtc());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,13 +113,25 @@ QPixmap Entry::iconPixmap() const
|
||||
else {
|
||||
Q_ASSERT(database());
|
||||
|
||||
QPixmap pixmap;
|
||||
if (database() && !QPixmapCache::find(m_pixmapCacheKey, &pixmap)) {
|
||||
pixmap = QPixmap::fromImage(database()->metadata()->customIcon(m_data.customIcon));
|
||||
m_pixmapCacheKey = QPixmapCache::insert(pixmap);
|
||||
if (database()) {
|
||||
return database()->metadata()->customIconPixmap(m_data.customIcon);
|
||||
}
|
||||
else {
|
||||
return QPixmap();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return pixmap;
|
||||
QPixmap Entry::iconScaledPixmap() const
|
||||
{
|
||||
if (m_data.customIcon.isNull()) {
|
||||
// built-in icons are 16x16 so don't need to be scaled
|
||||
return databaseIcons()->iconPixmap(m_data.iconNumber);
|
||||
}
|
||||
else {
|
||||
Q_ASSERT(database());
|
||||
|
||||
return database()->metadata()->customIconScaledPixmap(m_data.customIcon);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -211,7 +222,7 @@ QString Entry::notes() const
|
||||
|
||||
bool Entry::isExpired() const
|
||||
{
|
||||
return m_data.timeInfo.expires() && m_data.timeInfo.expiryTime() < Tools::currentDateTimeUtc();
|
||||
return m_data.timeInfo.expires() && m_data.timeInfo.expiryTime() < QDateTime::currentDateTimeUtc();
|
||||
}
|
||||
|
||||
EntryAttributes* Entry::attributes()
|
||||
@@ -248,8 +259,6 @@ void Entry::setIcon(int iconNumber)
|
||||
m_data.iconNumber = iconNumber;
|
||||
m_data.customIcon = Uuid();
|
||||
|
||||
m_pixmapCacheKey = QPixmapCache::Key();
|
||||
|
||||
Q_EMIT modified();
|
||||
emitDataChanged();
|
||||
}
|
||||
@@ -263,8 +272,6 @@ void Entry::setIcon(const Uuid& uuid)
|
||||
m_data.customIcon = uuid;
|
||||
m_data.iconNumber = 0;
|
||||
|
||||
m_pixmapCacheKey = QPixmapCache::Key();
|
||||
|
||||
Q_EMIT modified();
|
||||
emitDataChanged();
|
||||
}
|
||||
@@ -364,7 +371,6 @@ const QList<Entry*>& Entry::historyItems() const
|
||||
void Entry::addHistoryItem(Entry* entry)
|
||||
{
|
||||
Q_ASSERT(!entry->parent());
|
||||
Q_ASSERT(entry->uuid() == uuid());
|
||||
|
||||
m_history.append(entry);
|
||||
Q_EMIT modified();
|
||||
@@ -376,7 +382,7 @@ void Entry::removeHistoryItems(const QList<Entry*>& historyEntries)
|
||||
return;
|
||||
}
|
||||
|
||||
Q_FOREACH (Entry* entry, historyEntries) {
|
||||
for (Entry* entry : historyEntries) {
|
||||
Q_ASSERT(!entry->parent());
|
||||
Q_ASSERT(entry->uuid() == uuid());
|
||||
Q_ASSERT(m_history.contains(entry));
|
||||
@@ -425,8 +431,8 @@ void Entry::truncateHistory()
|
||||
if (size <= histMaxSize) {
|
||||
size += historyItem->attributes()->attributesSize();
|
||||
|
||||
QSet<QByteArray> newAttachments = historyItem->attachments()->values().toSet() - foundAttachements;
|
||||
Q_FOREACH (const QByteArray& attachment, newAttachments) {
|
||||
const QSet<QByteArray> newAttachments = historyItem->attachments()->values().toSet() - foundAttachements;
|
||||
for (const QByteArray& attachment : newAttachments) {
|
||||
size += attachment.size();
|
||||
}
|
||||
foundAttachements += newAttachments;
|
||||
@@ -455,7 +461,7 @@ Entry* Entry::clone(CloneFlags flags) const
|
||||
entry->m_attachments->copyDataFrom(m_attachments);
|
||||
entry->m_autoTypeAssociations->copyDataFrom(this->m_autoTypeAssociations);
|
||||
if (flags & CloneIncludeHistory) {
|
||||
Q_FOREACH (Entry* historyItem, m_history) {
|
||||
for (Entry* historyItem : m_history) {
|
||||
Entry* historyItemClone = historyItem->clone(flags & ~CloneIncludeHistory & ~CloneNewUuid);
|
||||
historyItemClone->setUpdateTimeinfo(false);
|
||||
historyItemClone->setUuid(entry->uuid());
|
||||
@@ -466,7 +472,7 @@ Entry* Entry::clone(CloneFlags flags) const
|
||||
entry->setUpdateTimeinfo(true);
|
||||
|
||||
if (flags & CloneResetTimeInfo) {
|
||||
QDateTime now = Tools::currentDateTimeUtc();
|
||||
QDateTime now = QDateTime::currentDateTimeUtc();
|
||||
entry->m_data.timeInfo.setCreationTime(now);
|
||||
entry->m_data.timeInfo.setLastModificationTime(now);
|
||||
entry->m_data.timeInfo.setLastAccessTime(now);
|
||||
@@ -502,7 +508,7 @@ void Entry::beginUpdate()
|
||||
m_modifiedSinceBegin = false;
|
||||
}
|
||||
|
||||
void Entry::endUpdate()
|
||||
bool Entry::endUpdate()
|
||||
{
|
||||
Q_ASSERT(m_tmpHistoryItem);
|
||||
if (m_modifiedSinceBegin) {
|
||||
@@ -514,7 +520,9 @@ void Entry::endUpdate()
|
||||
delete m_tmpHistoryItem;
|
||||
}
|
||||
|
||||
m_tmpHistoryItem = Q_NULLPTR;
|
||||
m_tmpHistoryItem = nullptr;
|
||||
|
||||
return m_modifiedSinceBegin;
|
||||
}
|
||||
|
||||
void Entry::updateModifiedSinceBegin()
|
||||
@@ -560,7 +568,7 @@ void Entry::setGroup(Group* group)
|
||||
QObject::setParent(group);
|
||||
|
||||
if (m_updateTimeinfo) {
|
||||
m_data.timeInfo.setLocationChanged(Tools::currentDateTimeUtc());
|
||||
m_data.timeInfo.setLocationChanged(QDateTime::currentDateTimeUtc());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -575,7 +583,7 @@ const Database* Entry::database() const
|
||||
return m_group->database();
|
||||
}
|
||||
else {
|
||||
return Q_NULLPTR;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
#include <QImage>
|
||||
#include <QMap>
|
||||
#include <QPixmap>
|
||||
#include <QPixmapCache>
|
||||
#include <QPointer>
|
||||
#include <QSet>
|
||||
#include <QUrl>
|
||||
@@ -30,7 +29,6 @@
|
||||
#include "core/AutoTypeAssociations.h"
|
||||
#include "core/EntryAttachments.h"
|
||||
#include "core/EntryAttributes.h"
|
||||
#include "core/Global.h"
|
||||
#include "core/TimeInfo.h"
|
||||
#include "core/Uuid.h"
|
||||
|
||||
@@ -61,6 +59,7 @@ public:
|
||||
Uuid uuid() const;
|
||||
QImage icon() const;
|
||||
QPixmap iconPixmap() const;
|
||||
QPixmap iconScaledPixmap() const;
|
||||
int iconNumber() const;
|
||||
Uuid iconUuid() const;
|
||||
QColor foregroundColor() const;
|
||||
@@ -134,7 +133,7 @@ public:
|
||||
* if the entry has been changed.
|
||||
*/
|
||||
void beginUpdate();
|
||||
void endUpdate();
|
||||
bool endUpdate();
|
||||
|
||||
Group* group();
|
||||
const Group* group() const;
|
||||
@@ -169,7 +168,6 @@ private:
|
||||
Entry* m_tmpHistoryItem;
|
||||
bool m_modifiedSinceBegin;
|
||||
QPointer<Group> m_group;
|
||||
mutable QPixmapCache::Key m_pixmapCacheKey;
|
||||
bool m_updateTimeinfo;
|
||||
};
|
||||
|
||||
|
||||
@@ -21,14 +21,12 @@
|
||||
#include <QMap>
|
||||
#include <QObject>
|
||||
|
||||
#include "core/Global.h"
|
||||
|
||||
class EntryAttachments : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit EntryAttachments(QObject* parent = Q_NULLPTR);
|
||||
explicit EntryAttachments(QObject* parent = nullptr);
|
||||
QList<QString> keys() const;
|
||||
bool hasKey(const QString& key) const;
|
||||
QList<QByteArray> values() const;
|
||||
|
||||
@@ -44,7 +44,8 @@ bool EntryAttributes::hasKey(const QString& key) const
|
||||
QList<QString> EntryAttributes::customKeys()
|
||||
{
|
||||
QList<QString> customKeys;
|
||||
Q_FOREACH (const QString& key, keys()) {
|
||||
const QList<QString> keyList = keys();
|
||||
for (const QString& key : keyList) {
|
||||
if (!isDefaultAttribute(key)) {
|
||||
customKeys.append(key);
|
||||
}
|
||||
@@ -57,6 +58,11 @@ QString EntryAttributes::value(const QString& key) const
|
||||
return m_attributes.value(key);
|
||||
}
|
||||
|
||||
bool EntryAttributes::contains(const QString &key) const
|
||||
{
|
||||
return m_attributes.contains(key);
|
||||
}
|
||||
|
||||
bool EntryAttributes::isProtected(const QString& key) const
|
||||
{
|
||||
return m_protectedAttributes.contains(key);
|
||||
@@ -162,14 +168,16 @@ void EntryAttributes::copyCustomKeysFrom(const EntryAttributes* other)
|
||||
Q_EMIT aboutToBeReset();
|
||||
|
||||
// remove all non-default keys
|
||||
Q_FOREACH (const QString& key, keys()) {
|
||||
const QList<QString> keyList = keys();
|
||||
for (const QString& key : keyList) {
|
||||
if (!isDefaultAttribute(key)) {
|
||||
m_attributes.remove(key);
|
||||
m_protectedAttributes.remove(key);
|
||||
}
|
||||
}
|
||||
|
||||
Q_FOREACH (const QString& key, other->keys()) {
|
||||
const QList<QString> otherKeyList = other->keys();
|
||||
for (const QString& key : otherKeyList) {
|
||||
if (!isDefaultAttribute(key)) {
|
||||
m_attributes.insert(key, other->value(key));
|
||||
if (other->isProtected(key)) {
|
||||
@@ -189,7 +197,8 @@ bool EntryAttributes::areCustomKeysDifferent(const EntryAttributes* other)
|
||||
return true;
|
||||
}
|
||||
|
||||
Q_FOREACH (const QString& key, keys()) {
|
||||
const QList<QString> keyList = keys();
|
||||
for (const QString& key : keyList) {
|
||||
if (isDefaultAttribute(key)) {
|
||||
continue;
|
||||
}
|
||||
@@ -234,7 +243,7 @@ void EntryAttributes::clear()
|
||||
m_attributes.clear();
|
||||
m_protectedAttributes.clear();
|
||||
|
||||
Q_FOREACH (const QString& key, DefaultAttributes) {
|
||||
for (const QString& key : DefaultAttributes) {
|
||||
m_attributes.insert(key, "");
|
||||
}
|
||||
|
||||
|
||||
@@ -23,18 +23,17 @@
|
||||
#include <QSet>
|
||||
#include <QStringList>
|
||||
|
||||
#include "core/Global.h"
|
||||
|
||||
class EntryAttributes : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit EntryAttributes(QObject* parent = Q_NULLPTR);
|
||||
explicit EntryAttributes(QObject* parent = nullptr);
|
||||
QList<QString> keys() const;
|
||||
bool hasKey(const QString& key) const;
|
||||
QList<QString> customKeys();
|
||||
QString value(const QString& key) const;
|
||||
bool contains(const QString& key) const;
|
||||
bool isProtected(const QString& key) const;
|
||||
void set(const QString& key, const QString& value, bool protect = false);
|
||||
void remove(const QString& key);
|
||||
|
||||
@@ -19,7 +19,8 @@
|
||||
|
||||
#include "core/Group.h"
|
||||
|
||||
QList<Entry*> EntrySearcher::search(const QString &searchTerm, const Group* group, Qt::CaseSensitivity caseSensitivity)
|
||||
QList<Entry*> EntrySearcher::search(const QString& searchTerm, const Group* group,
|
||||
Qt::CaseSensitivity caseSensitivity)
|
||||
{
|
||||
if (!group->resolveSearchingEnabled()) {
|
||||
return QList<Entry*>();
|
||||
@@ -28,14 +29,18 @@ QList<Entry*> EntrySearcher::search(const QString &searchTerm, const Group* grou
|
||||
return searchEntries(searchTerm, group, caseSensitivity);
|
||||
}
|
||||
|
||||
QList<Entry*> EntrySearcher::searchEntries(const QString& searchTerm, const Group* group, Qt::CaseSensitivity caseSensitivity)
|
||||
QList<Entry*> EntrySearcher::searchEntries(const QString& searchTerm, const Group* group,
|
||||
Qt::CaseSensitivity caseSensitivity)
|
||||
{
|
||||
QList<Entry*> searchResult;
|
||||
|
||||
Q_FOREACH (Entry* entry, group->entries()) {
|
||||
searchResult.append(matchEntry(searchTerm, entry, caseSensitivity));
|
||||
const QList<Entry*> entryList = group->entries();
|
||||
for (Entry* entry : entryList) {
|
||||
searchResult.append(matchEntry(searchTerm, entry, caseSensitivity));
|
||||
}
|
||||
Q_FOREACH (Group* childGroup, group->children()) {
|
||||
|
||||
const QList<Group*> children = group->children();
|
||||
for (Group* childGroup : children) {
|
||||
if (childGroup->searchingEnabled() != Group::Disable) {
|
||||
searchResult.append(searchEntries(searchTerm, childGroup, caseSensitivity));
|
||||
}
|
||||
@@ -44,10 +49,11 @@ QList<Entry*> EntrySearcher::searchEntries(const QString& searchTerm, const Grou
|
||||
return searchResult;
|
||||
}
|
||||
|
||||
QList<Entry*> EntrySearcher::matchEntry(const QString& searchTerm, Entry* entry, Qt::CaseSensitivity caseSensitivity)
|
||||
QList<Entry*> EntrySearcher::matchEntry(const QString& searchTerm, Entry* entry,
|
||||
Qt::CaseSensitivity caseSensitivity)
|
||||
{
|
||||
QStringList wordList = searchTerm.split(QRegExp("\\s"), QString::SkipEmptyParts);
|
||||
Q_FOREACH (const QString& word, wordList) {
|
||||
const QStringList wordList = searchTerm.split(QRegExp("\\s"), QString::SkipEmptyParts);
|
||||
for (const QString& word : wordList) {
|
||||
if (!wordMatch(word, entry, caseSensitivity)) {
|
||||
return QList<Entry*>();
|
||||
}
|
||||
|
||||
@@ -28,10 +28,11 @@ class EntrySearcher
|
||||
{
|
||||
public:
|
||||
QList<Entry*> search(const QString& searchTerm, const Group* group, Qt::CaseSensitivity caseSensitivity);
|
||||
|
||||
private:
|
||||
QList<Entry*> searchEntries(const QString& searchTerm, const Group* group, Qt::CaseSensitivity caseSensitivity);
|
||||
QList<Entry*> matchEntry(const QString& searchTerm, Entry* entry, Qt::CaseSensitivity caseSensitivity);
|
||||
bool wordMatch(const QString &word, Entry *entry, Qt::CaseSensitivity caseSensitivity);
|
||||
bool wordMatch(const QString& word, Entry* entry, Qt::CaseSensitivity caseSensitivity);
|
||||
};
|
||||
|
||||
#endif // KEEPASSX_ENTRYSEARCHER_H
|
||||
|
||||
@@ -22,8 +22,9 @@
|
||||
#include <QLibrary>
|
||||
|
||||
#include "config-keepassx.h"
|
||||
#include "core/Global.h"
|
||||
|
||||
FilePath* FilePath::m_instance(Q_NULLPTR);
|
||||
FilePath* FilePath::m_instance(nullptr);
|
||||
|
||||
QString FilePath::dataPath(const QString& name)
|
||||
{
|
||||
@@ -40,7 +41,8 @@ QString FilePath::pluginPath(const QString& name)
|
||||
QStringList pluginPaths;
|
||||
|
||||
QDir buildDir(QCoreApplication::applicationDirPath() + "/autotype");
|
||||
Q_FOREACH (const QString& dir, buildDir.entryList(QDir::Dirs | QDir::NoDotAndDotDot)) {
|
||||
const QStringList buildDirEntryList = buildDir.entryList(QDir::Dirs | QDir::NoDotAndDotDot);
|
||||
for (const QString& dir : buildDirEntryList) {
|
||||
pluginPaths << QCoreApplication::applicationDirPath() + "/autotype/" + dir;
|
||||
}
|
||||
|
||||
@@ -68,10 +70,10 @@ QString FilePath::pluginPath(const QString& name)
|
||||
QStringList dirFilter;
|
||||
dirFilter << QString("*%1*").arg(name);
|
||||
|
||||
Q_FOREACH (const QString& path, pluginPaths) {
|
||||
QStringList fileCandidates = QDir(path).entryList(dirFilter, QDir::Files);
|
||||
for (const QString& path : asConst(pluginPaths)) {
|
||||
const QStringList fileCandidates = QDir(path).entryList(dirFilter, QDir::Files);
|
||||
|
||||
Q_FOREACH (const QString& file, fileCandidates) {
|
||||
for (const QString& file : fileCandidates) {
|
||||
QString filePath = path + "/" + file;
|
||||
|
||||
if (QLibrary::isLibrary(filePath)) {
|
||||
@@ -103,10 +105,9 @@ QIcon FilePath::icon(const QString& category, const QString& name, bool fromThem
|
||||
}
|
||||
|
||||
if (icon.isNull()) {
|
||||
QList<int> pngSizes;
|
||||
pngSizes << 16 << 22 << 24 << 32 << 48 << 64 << 128;
|
||||
const QList<int> pngSizes = { 16, 22, 24, 32, 48, 64, 128 };
|
||||
QString filename;
|
||||
Q_FOREACH (int size, pngSizes) {
|
||||
for (int size : pngSizes) {
|
||||
filename = QString("%1/icons/application/%2x%2/%3.png").arg(m_dataPath, QString::number(size),
|
||||
combinedName);
|
||||
if (QFile::exists(filename)) {
|
||||
@@ -148,10 +149,9 @@ QIcon FilePath::onOffIcon(const QString& category, const QString& name)
|
||||
stateName = "on";
|
||||
}
|
||||
|
||||
QList<int> pngSizes;
|
||||
pngSizes << 16 << 22 << 24 << 32 << 48 << 64 << 128;
|
||||
const QList<int> pngSizes = { 16, 22, 24, 32, 48, 64, 128 };
|
||||
QString filename;
|
||||
Q_FOREACH (int size, pngSizes) {
|
||||
for (int size : pngSizes) {
|
||||
filename = QString("%1/icons/application/%2x%2/%3-%4.png").arg(m_dataPath, QString::number(size),
|
||||
combinedName, stateName);
|
||||
if (QFile::exists(filename)) {
|
||||
|
||||
@@ -22,8 +22,6 @@
|
||||
#include <QIcon>
|
||||
#include <QString>
|
||||
|
||||
#include "core/Global.h"
|
||||
|
||||
class FilePath
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -20,104 +20,8 @@
|
||||
#ifndef KEEPASSX_GLOBAL_H
|
||||
#define KEEPASSX_GLOBAL_H
|
||||
|
||||
// mostly copied from qcompilerdetection.h which is part of Qt 5
|
||||
|
||||
#include <QtGlobal>
|
||||
|
||||
#ifdef Q_CC_CLANG
|
||||
# if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__)
|
||||
# if __has_feature(cxx_strong_enums)
|
||||
# define COMPILER_CLASS_ENUM
|
||||
# endif
|
||||
# if __has_feature(cxx_constexpr)
|
||||
# define COMPILER_CONSTEXPR
|
||||
# endif
|
||||
# if __has_feature(cxx_decltype) /* && __has_feature(cxx_decltype_incomplete_return_types) */
|
||||
# define COMPILER_DECLTYPE
|
||||
# endif
|
||||
# if __has_feature(cxx_override_control)
|
||||
# define COMPILER_EXPLICIT_OVERRIDES
|
||||
# endif
|
||||
# if __has_feature(cxx_nullptr)
|
||||
# define COMPILER_NULLPTR
|
||||
# endif
|
||||
# if __has_feature(cxx_static_assert)
|
||||
# define COMPILER_STATIC_ASSERT
|
||||
# endif
|
||||
# endif
|
||||
#endif // Q_CC_CLANG
|
||||
|
||||
#if defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && !defined(Q_CC_CLANG)
|
||||
# if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L
|
||||
# if (__GNUC__ * 100 + __GNUC_MINOR__) >= 403
|
||||
# define COMPILER_DECLTYPE
|
||||
# define COMPILER_STATIC_ASSERT
|
||||
# endif
|
||||
# if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404
|
||||
# define COMPILER_CLASS_ENUM
|
||||
# endif
|
||||
# if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406
|
||||
# define COMPILER_CONSTEXPR
|
||||
# define COMPILER_NULLPTR
|
||||
# endif
|
||||
# if (__GNUC__ * 100 + __GNUC_MINOR__) >= 407
|
||||
# define COMPILER_EXPLICIT_OVERRIDES
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* C++11 keywords and expressions
|
||||
*/
|
||||
#if !defined(Q_NULLPTR)
|
||||
# ifdef COMPILER_NULLPTR
|
||||
# define Q_NULLPTR nullptr
|
||||
# else
|
||||
# define Q_NULLPTR 0
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined(Q_DECL_CONSTEXPR)
|
||||
# ifdef COMPILER_CONSTEXPR
|
||||
# define Q_DECL_CONSTEXPR constexpr
|
||||
# else
|
||||
# define Q_DECL_CONSTEXPR
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined(Q_DECL_OVERRIDE) && !defined(Q_DECL_FINAL) && !defined(Q_DECL_FINAL_CLASS)
|
||||
# ifdef COMPILER_EXPLICIT_OVERRIDES
|
||||
# define Q_DECL_OVERRIDE override
|
||||
# define Q_DECL_FINAL final
|
||||
# ifdef COMPILER_DECLTYPE
|
||||
# define Q_DECL_FINAL_CLASS final
|
||||
# else
|
||||
# define Q_DECL_FINAL_CLASS
|
||||
# endif
|
||||
# else
|
||||
# define Q_DECL_OVERRIDE
|
||||
# define Q_DECL_FINAL
|
||||
# define Q_DECL_FINAL_CLASS
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined(Q_STATIC_ASSERT) && !defined(Q_STATIC_ASSERT_X)
|
||||
#ifdef COMPILER_STATIC_ASSERT
|
||||
#define Q_STATIC_ASSERT(Condition) static_assert(static_cast<bool>(Condition), #Condition)
|
||||
#define Q_STATIC_ASSERT_X(Condition, Message) static_assert(static_cast<bool>(Condition), Message)
|
||||
#else
|
||||
// Intentionally undefined
|
||||
template <bool Test> class QStaticAssertFailure;
|
||||
template <> class QStaticAssertFailure<true> {};
|
||||
|
||||
#define Q_STATIC_ASSERT_PRIVATE_JOIN(A, B) Q_STATIC_ASSERT_PRIVATE_JOIN_IMPL(A, B)
|
||||
#define Q_STATIC_ASSERT_PRIVATE_JOIN_IMPL(A, B) A ## B
|
||||
#define Q_STATIC_ASSERT(Condition) \
|
||||
enum {Q_STATIC_ASSERT_PRIVATE_JOIN(q_static_assert_result, __LINE__) = sizeof(QStaticAssertFailure<!!(Condition)>)}
|
||||
#define Q_STATIC_ASSERT_X(Condition, Message) Q_STATIC_ASSERT(Condition)
|
||||
#endif // COMPILER_STATIC_ASSERT
|
||||
#endif // !defined(Q_STATIC_ASSERT) && !defined(Q_STATIC_ASSERT_X)
|
||||
|
||||
#if defined(Q_OS_WIN)
|
||||
# if defined(KEEPASSX_BUILDING_CORE)
|
||||
# define KEEPASSX_EXPORT Q_DECL_EXPORT
|
||||
@@ -132,4 +36,13 @@ template <> class QStaticAssertFailure<true> {};
|
||||
#define QUINT32_MAX 4294967295U
|
||||
#endif
|
||||
|
||||
template <typename T> struct AddConst { typedef const T Type; };
|
||||
|
||||
// this adds const to non-const objects (like std::as_const)
|
||||
template <typename T>
|
||||
constexpr typename AddConst<T>::Type& asConst(T &t) noexcept { return t; }
|
||||
// prevent rvalue arguments:
|
||||
template <typename T>
|
||||
void asConst(const T&&) = delete;
|
||||
|
||||
#endif // KEEPASSX_GLOBAL_H
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
#include "Group.h"
|
||||
|
||||
#include "core/Config.h"
|
||||
#include "core/Global.h"
|
||||
#include "core/DatabaseIcons.h"
|
||||
#include "core/Metadata.h"
|
||||
#include "core/Tools.h"
|
||||
|
||||
const int Group::DefaultIconNumber = 48;
|
||||
const int Group::RecycleBinIconNumber = 43;
|
||||
@@ -38,19 +38,19 @@ Group::~Group()
|
||||
{
|
||||
// Destroy entries and children manually so DeletedObjects can be added
|
||||
// to database.
|
||||
QList<Entry*> entries = m_entries;
|
||||
Q_FOREACH (Entry* entry, entries) {
|
||||
const QList<Entry*> entries = m_entries;
|
||||
for (Entry* entry : entries) {
|
||||
delete entry;
|
||||
}
|
||||
|
||||
QList<Group*> children = m_children;
|
||||
Q_FOREACH (Group* group, children) {
|
||||
const QList<Group*> children = m_children;
|
||||
for (Group* group : children) {
|
||||
delete group;
|
||||
}
|
||||
|
||||
if (m_db && m_parent) {
|
||||
DeletedObject delGroup;
|
||||
delGroup.deletionTime = Tools::currentDateTimeUtc();
|
||||
delGroup.deletionTime = QDateTime::currentDateTimeUtc();
|
||||
delGroup.uuid = m_uuid;
|
||||
m_db->addDeletedObject(delGroup);
|
||||
}
|
||||
@@ -84,8 +84,8 @@ template <class P, class V> inline bool Group::set(P& property, const V& value)
|
||||
void Group::updateTimeinfo()
|
||||
{
|
||||
if (m_updateTimeinfo) {
|
||||
m_data.timeInfo.setLastModificationTime(Tools::currentDateTimeUtc());
|
||||
m_data.timeInfo.setLastAccessTime(Tools::currentDateTimeUtc());
|
||||
m_data.timeInfo.setLastModificationTime(QDateTime::currentDateTimeUtc());
|
||||
m_data.timeInfo.setLastAccessTime(QDateTime::currentDateTimeUtc());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,13 +134,30 @@ QPixmap Group::iconPixmap() const
|
||||
else {
|
||||
Q_ASSERT(m_db);
|
||||
|
||||
QPixmap pixmap;
|
||||
if (m_db && !QPixmapCache::find(m_pixmapCacheKey, &pixmap)) {
|
||||
pixmap = QPixmap::fromImage(m_db->metadata()->customIcon(m_data.customIcon));
|
||||
m_pixmapCacheKey = QPixmapCache::insert(pixmap);
|
||||
if (m_db) {
|
||||
return m_db->metadata()->customIconPixmap(m_data.customIcon);
|
||||
}
|
||||
else {
|
||||
return QPixmap();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return pixmap;
|
||||
QPixmap Group::iconScaledPixmap() const
|
||||
{
|
||||
if (m_data.customIcon.isNull()) {
|
||||
// built-in icons are 16x16 so don't need to be scaled
|
||||
return databaseIcons()->iconPixmap(m_data.iconNumber);
|
||||
}
|
||||
else {
|
||||
Q_ASSERT(m_db);
|
||||
|
||||
if (m_db) {
|
||||
return m_db->metadata()->customIconScaledPixmap(m_data.customIcon);
|
||||
}
|
||||
else {
|
||||
return QPixmap();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -186,7 +203,7 @@ Entry* Group::lastTopVisibleEntry() const
|
||||
|
||||
bool Group::isExpired() const
|
||||
{
|
||||
return m_data.timeInfo.expires() && m_data.timeInfo.expiryTime() < Tools::currentDateTimeUtc();
|
||||
return m_data.timeInfo.expires() && m_data.timeInfo.expiryTime() < QDateTime::currentDateTimeUtc();
|
||||
}
|
||||
|
||||
void Group::setUuid(const Uuid& uuid)
|
||||
@@ -214,8 +231,6 @@ void Group::setIcon(int iconNumber)
|
||||
m_data.iconNumber = iconNumber;
|
||||
m_data.customIcon = Uuid();
|
||||
|
||||
m_pixmapCacheKey = QPixmapCache::Key();
|
||||
|
||||
updateTimeinfo();
|
||||
Q_EMIT modified();
|
||||
Q_EMIT dataChanged(this);
|
||||
@@ -230,8 +245,6 @@ void Group::setIcon(const Uuid& uuid)
|
||||
m_data.customIcon = uuid;
|
||||
m_data.iconNumber = 0;
|
||||
|
||||
m_pixmapCacheKey = QPixmapCache::Key();
|
||||
|
||||
updateTimeinfo();
|
||||
Q_EMIT modified();
|
||||
Q_EMIT dataChanged(this);
|
||||
@@ -352,7 +365,7 @@ void Group::setParent(Group* parent, int index)
|
||||
}
|
||||
|
||||
if (m_updateTimeinfo) {
|
||||
m_data.timeInfo.setLocationChanged(Tools::currentDateTimeUtc());
|
||||
m_data.timeInfo.setLocationChanged(QDateTime::currentDateTimeUtc());
|
||||
}
|
||||
|
||||
Q_EMIT modified();
|
||||
@@ -372,7 +385,7 @@ void Group::setParent(Database* db)
|
||||
|
||||
cleanupParent();
|
||||
|
||||
m_parent = Q_NULLPTR;
|
||||
m_parent = nullptr;
|
||||
recSetDatabase(db);
|
||||
|
||||
QObject::setParent(db);
|
||||
@@ -415,12 +428,12 @@ QList<Entry*> Group::entriesRecursive(bool includeHistoryItems) const
|
||||
entryList.append(m_entries);
|
||||
|
||||
if (includeHistoryItems) {
|
||||
Q_FOREACH (Entry* entry, m_entries) {
|
||||
for (Entry* entry : m_entries) {
|
||||
entryList.append(entry->historyItems());
|
||||
}
|
||||
}
|
||||
|
||||
Q_FOREACH (Group* group, m_children) {
|
||||
for (Group* group : m_children) {
|
||||
entryList.append(group->entriesRecursive(includeHistoryItems));
|
||||
}
|
||||
|
||||
@@ -434,7 +447,7 @@ QList<const Group*> Group::groupsRecursive(bool includeSelf) const
|
||||
groupList.append(this);
|
||||
}
|
||||
|
||||
Q_FOREACH (const Group* group, m_children) {
|
||||
for (const Group* group : m_children) {
|
||||
groupList.append(group->groupsRecursive(true));
|
||||
}
|
||||
|
||||
@@ -448,7 +461,7 @@ QList<Group*> Group::groupsRecursive(bool includeSelf)
|
||||
groupList.append(this);
|
||||
}
|
||||
|
||||
Q_FOREACH (Group* group, m_children) {
|
||||
for (Group* group : asConst(m_children)) {
|
||||
groupList.append(group->groupsRecursive(true));
|
||||
}
|
||||
|
||||
@@ -463,13 +476,14 @@ QSet<Uuid> Group::customIconsRecursive() const
|
||||
result.insert(iconUuid());
|
||||
}
|
||||
|
||||
Q_FOREACH (Entry* entry, entriesRecursive(true)) {
|
||||
const QList<Entry*> entryList = entriesRecursive(true);
|
||||
for (Entry* entry : entryList) {
|
||||
if (!entry->iconUuid().isNull()) {
|
||||
result.insert(entry->iconUuid());
|
||||
}
|
||||
}
|
||||
|
||||
Q_FOREACH (Group* group, m_children) {
|
||||
for (Group* group : m_children) {
|
||||
result.unite(group->customIconsRecursive());
|
||||
}
|
||||
|
||||
@@ -485,19 +499,21 @@ Group* Group::clone(Entry::CloneFlags entryFlags) const
|
||||
clonedGroup->setUuid(Uuid::random());
|
||||
clonedGroup->m_data = m_data;
|
||||
|
||||
Q_FOREACH (Entry* entry, entries()) {
|
||||
const QList<Entry*> entryList = entries();
|
||||
for (Entry* entry : entryList) {
|
||||
Entry* clonedEntry = entry->clone(entryFlags);
|
||||
clonedEntry->setGroup(clonedGroup);
|
||||
}
|
||||
|
||||
Q_FOREACH (Group* groupChild, children()) {
|
||||
Group* clonedGroupChild = groupChild->clone();
|
||||
const QList<Group*> childrenGroups = children();
|
||||
for (Group* groupChild : childrenGroups) {
|
||||
Group* clonedGroupChild = groupChild->clone(entryFlags);
|
||||
clonedGroupChild->setParent(clonedGroup);
|
||||
}
|
||||
|
||||
clonedGroup->setUpdateTimeinfo(true);
|
||||
|
||||
QDateTime now = Tools::currentDateTimeUtc();
|
||||
QDateTime now = QDateTime::currentDateTimeUtc();
|
||||
clonedGroup->m_data.timeInfo.setCreationTime(now);
|
||||
clonedGroup->m_data.timeInfo.setLastModificationTime(now);
|
||||
clonedGroup->m_data.timeInfo.setLastAccessTime(now);
|
||||
@@ -557,7 +573,7 @@ void Group::recSetDatabase(Database* db)
|
||||
disconnect(SIGNAL(modified()), m_db);
|
||||
}
|
||||
|
||||
Q_FOREACH (Entry* entry, m_entries) {
|
||||
for (Entry* entry : asConst(m_entries)) {
|
||||
if (m_db) {
|
||||
entry->disconnect(m_db);
|
||||
}
|
||||
@@ -579,7 +595,7 @@ void Group::recSetDatabase(Database* db)
|
||||
|
||||
m_db = db;
|
||||
|
||||
Q_FOREACH (Group* group, m_children) {
|
||||
for (Group* group : asConst(m_children)) {
|
||||
group->recSetDatabase(db);
|
||||
}
|
||||
}
|
||||
@@ -597,11 +613,11 @@ void Group::cleanupParent()
|
||||
void Group::recCreateDelObjects()
|
||||
{
|
||||
if (m_db) {
|
||||
Q_FOREACH (Entry* entry, m_entries) {
|
||||
for (Entry* entry : asConst(m_entries)) {
|
||||
m_db->addDeletedObject(entry->uuid());
|
||||
}
|
||||
|
||||
Q_FOREACH (Group* group, m_children) {
|
||||
for (Group* group : asConst(m_children)) {
|
||||
group->recCreateDelObjects();
|
||||
}
|
||||
m_db->addDeletedObject(m_uuid);
|
||||
|
||||
@@ -58,6 +58,7 @@ public:
|
||||
QString notes() const;
|
||||
QImage icon() const;
|
||||
QPixmap iconPixmap() const;
|
||||
QPixmap iconScaledPixmap() const;
|
||||
int iconNumber() const;
|
||||
Uuid iconUuid() const;
|
||||
TimeInfo timeInfo() const;
|
||||
@@ -155,7 +156,6 @@ private:
|
||||
QList<Entry*> m_entries;
|
||||
|
||||
QPointer<Group> m_parent;
|
||||
mutable QPixmapCache::Key m_pixmapCacheKey;
|
||||
|
||||
bool m_updateTimeinfo;
|
||||
|
||||
|
||||
@@ -21,8 +21,6 @@
|
||||
#include <QMutex>
|
||||
#include <QObject>
|
||||
|
||||
#include "core/Global.h"
|
||||
|
||||
class QTimer;
|
||||
|
||||
class InactivityTimer : public QObject
|
||||
@@ -30,7 +28,7 @@ class InactivityTimer : public QObject
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit InactivityTimer(QObject* parent = Q_NULLPTR);
|
||||
explicit InactivityTimer(QObject* parent = nullptr);
|
||||
void setInactivityTimeout(int inactivityTimeout);
|
||||
void activate();
|
||||
void deactivate();
|
||||
|
||||
@@ -42,7 +42,7 @@ Metadata::Metadata(QObject* parent)
|
||||
m_data.protectNotes = false;
|
||||
// m_data.autoEnableVisualHiding = false;
|
||||
|
||||
QDateTime now = Tools::currentDateTimeUtc();
|
||||
QDateTime now = QDateTime::currentDateTimeUtc();
|
||||
m_data.nameChanged = now;
|
||||
m_data.descriptionChanged = now;
|
||||
m_data.defaultUserNameChanged = now;
|
||||
@@ -67,7 +67,7 @@ template <class P, class V> bool Metadata::set(P& property, const V& value, QDat
|
||||
if (property != value) {
|
||||
property = value;
|
||||
if (m_updateDatetime) {
|
||||
dateTime = Tools::currentDateTimeUtc();
|
||||
dateTime = QDateTime::currentDateTimeUtc();
|
||||
}
|
||||
Q_EMIT modified();
|
||||
return true;
|
||||
@@ -167,6 +167,43 @@ QImage Metadata::customIcon(const Uuid& uuid) const
|
||||
return m_customIcons.value(uuid);
|
||||
}
|
||||
|
||||
QPixmap Metadata::customIconPixmap(const Uuid& uuid) const
|
||||
{
|
||||
QPixmap pixmap;
|
||||
|
||||
if (!m_customIcons.contains(uuid)) {
|
||||
return pixmap;
|
||||
}
|
||||
|
||||
QPixmapCache::Key& cacheKey = m_customIconCacheKeys[uuid];
|
||||
|
||||
if (!QPixmapCache::find(cacheKey, &pixmap)) {
|
||||
pixmap = QPixmap::fromImage(m_customIcons.value(uuid));
|
||||
cacheKey = QPixmapCache::insert(pixmap);
|
||||
}
|
||||
|
||||
return pixmap;
|
||||
}
|
||||
|
||||
QPixmap Metadata::customIconScaledPixmap(const Uuid& uuid) const
|
||||
{
|
||||
QPixmap pixmap;
|
||||
|
||||
if (!m_customIcons.contains(uuid)) {
|
||||
return pixmap;
|
||||
}
|
||||
|
||||
QPixmapCache::Key& cacheKey = m_customIconScaledCacheKeys[uuid];
|
||||
|
||||
if (!QPixmapCache::find(cacheKey, &pixmap)) {
|
||||
QImage image = m_customIcons.value(uuid).scaled(16, 16, Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
||||
pixmap = QPixmap::fromImage(image);
|
||||
cacheKey = QPixmapCache::insert(pixmap);
|
||||
}
|
||||
|
||||
return pixmap;
|
||||
}
|
||||
|
||||
bool Metadata::containsCustomIcon(const Uuid& uuid) const
|
||||
{
|
||||
return m_customIcons.contains(uuid);
|
||||
@@ -177,6 +214,17 @@ QHash<Uuid, QImage> Metadata::customIcons() const
|
||||
return m_customIcons;
|
||||
}
|
||||
|
||||
QHash<Uuid, QPixmap> Metadata::customIconsScaledPixmaps() const
|
||||
{
|
||||
QHash<Uuid, QPixmap> result;
|
||||
|
||||
for (const Uuid& uuid : m_customIconsOrder) {
|
||||
result.insert(uuid, customIconScaledPixmap(uuid));
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
QList<Uuid> Metadata::customIconsOrder() const
|
||||
{
|
||||
return m_customIconsOrder;
|
||||
@@ -338,6 +386,9 @@ void Metadata::addCustomIcon(const Uuid& uuid, const QImage& icon)
|
||||
Q_ASSERT(!m_customIcons.contains(uuid));
|
||||
|
||||
m_customIcons.insert(uuid, icon);
|
||||
// reset cache in case there is also an icon with that uuid
|
||||
m_customIconCacheKeys[uuid] = QPixmapCache::Key();
|
||||
m_customIconScaledCacheKeys[uuid] = QPixmapCache::Key();
|
||||
m_customIconsOrder.append(uuid);
|
||||
Q_ASSERT(m_customIcons.count() == m_customIconsOrder.count());
|
||||
Q_EMIT modified();
|
||||
@@ -365,6 +416,10 @@ void Metadata::removeCustomIcon(const Uuid& uuid)
|
||||
Q_ASSERT(m_customIcons.contains(uuid));
|
||||
|
||||
m_customIcons.remove(uuid);
|
||||
QPixmapCache::remove(m_customIconCacheKeys.value(uuid));
|
||||
m_customIconCacheKeys.remove(uuid);
|
||||
QPixmapCache::remove(m_customIconScaledCacheKeys.value(uuid));
|
||||
m_customIconScaledCacheKeys.remove(uuid);
|
||||
m_customIconsOrder.removeAll(uuid);
|
||||
Q_ASSERT(m_customIcons.count() == m_customIconsOrder.count());
|
||||
Q_EMIT modified();
|
||||
@@ -372,7 +427,7 @@ void Metadata::removeCustomIcon(const Uuid& uuid)
|
||||
|
||||
void Metadata::copyCustomIcons(const QSet<Uuid>& iconList, const Metadata* otherMetadata)
|
||||
{
|
||||
Q_FOREACH (const Uuid& uuid, iconList) {
|
||||
for (const Uuid& uuid : iconList) {
|
||||
Q_ASSERT(otherMetadata->containsCustomIcon(uuid));
|
||||
|
||||
if (!containsCustomIcon(uuid) && otherMetadata->containsCustomIcon(uuid)) {
|
||||
|
||||
@@ -22,9 +22,10 @@
|
||||
#include <QDateTime>
|
||||
#include <QHash>
|
||||
#include <QImage>
|
||||
#include <QPixmap>
|
||||
#include <QPixmapCache>
|
||||
#include <QPointer>
|
||||
|
||||
#include "core/Global.h"
|
||||
#include "core/Uuid.h"
|
||||
|
||||
class Database;
|
||||
@@ -35,7 +36,7 @@ class Metadata : public QObject
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit Metadata(QObject* parent = Q_NULLPTR);
|
||||
explicit Metadata(QObject* parent = nullptr);
|
||||
|
||||
struct MetadataData
|
||||
{
|
||||
@@ -78,10 +79,13 @@ public:
|
||||
bool protectNotes() const;
|
||||
// bool autoEnableVisualHiding() const;
|
||||
QImage customIcon(const Uuid& uuid) const;
|
||||
QPixmap customIconPixmap(const Uuid& uuid) const;
|
||||
QPixmap customIconScaledPixmap(const Uuid& uuid) const;
|
||||
bool containsCustomIcon(const Uuid& uuid) const;
|
||||
QHash<Uuid, QImage> customIcons() const;
|
||||
QList<Uuid> customIconsOrder() const;
|
||||
bool recycleBinEnabled() const;
|
||||
QHash<Uuid, QPixmap> customIconsScaledPixmaps() const;
|
||||
Group* recycleBin();
|
||||
const Group* recycleBin() const;
|
||||
QDateTime recycleBinChanged() const;
|
||||
@@ -153,6 +157,8 @@ private:
|
||||
MetadataData m_data;
|
||||
|
||||
QHash<Uuid, QImage> m_customIcons;
|
||||
mutable QHash<Uuid, QPixmapCache::Key> m_customIconCacheKeys;
|
||||
mutable QHash<Uuid, QPixmapCache::Key> m_customIconScaledCacheKeys;
|
||||
QList<Uuid> m_customIconsOrder;
|
||||
|
||||
QPointer<Group> m_recycleBin;
|
||||
|
||||
@@ -45,11 +45,11 @@ QString PasswordGenerator::generatePassword() const
|
||||
{
|
||||
Q_ASSERT(isValid());
|
||||
|
||||
QVector<PasswordGroup> groups = passwordGroups();
|
||||
const QVector<PasswordGroup> groups = passwordGroups();
|
||||
|
||||
QVector<QChar> passwordChars;
|
||||
Q_FOREACH (const PasswordGroup& group, groups) {
|
||||
Q_FOREACH (QChar ch, group) {
|
||||
for (const PasswordGroup& group : groups) {
|
||||
for (QChar ch : group) {
|
||||
passwordChars.append(ch);
|
||||
}
|
||||
}
|
||||
@@ -89,6 +89,22 @@ QString PasswordGenerator::generatePassword() const
|
||||
return password;
|
||||
}
|
||||
|
||||
int PasswordGenerator::getbits() const
|
||||
{
|
||||
QVector<PasswordGroup> groups = passwordGroups();
|
||||
|
||||
int bits = 0;
|
||||
QVector<QChar> passwordChars;
|
||||
Q_FOREACH (const PasswordGroup& group, groups) {
|
||||
bits += group.size();
|
||||
}
|
||||
|
||||
bits *= m_length;
|
||||
|
||||
return bits;
|
||||
}
|
||||
|
||||
|
||||
bool PasswordGenerator::isValid() const
|
||||
{
|
||||
if (m_classes == 0) {
|
||||
|
||||
@@ -22,8 +22,6 @@
|
||||
#include <QString>
|
||||
#include <QVector>
|
||||
|
||||
#include "core/Global.h"
|
||||
|
||||
typedef QVector<QChar> PasswordGroup;
|
||||
|
||||
class PasswordGenerator
|
||||
@@ -55,6 +53,7 @@ public:
|
||||
bool isValid() const;
|
||||
|
||||
QString generatePassword() const;
|
||||
int getbits() const;
|
||||
|
||||
private:
|
||||
QVector<PasswordGroup> passwordGroups() const;
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
|
||||
#include "SignalMultiplexer.h"
|
||||
|
||||
#include "core/Global.h"
|
||||
|
||||
SignalMultiplexer::SignalMultiplexer()
|
||||
{
|
||||
}
|
||||
@@ -24,7 +26,7 @@ SignalMultiplexer::SignalMultiplexer()
|
||||
SignalMultiplexer::~SignalMultiplexer()
|
||||
{
|
||||
// disconnect all connections
|
||||
setCurrentObject(Q_NULLPTR);
|
||||
setCurrentObject(nullptr);
|
||||
}
|
||||
|
||||
QObject* SignalMultiplexer::currentObject() const
|
||||
@@ -45,7 +47,7 @@ void SignalMultiplexer::setCurrentObject(QObject* object)
|
||||
}
|
||||
|
||||
if (m_currentObject) {
|
||||
Q_FOREACH (const Connection& con, m_connections) {
|
||||
for (const Connection& con : asConst(m_connections)) {
|
||||
disconnect(con);
|
||||
}
|
||||
}
|
||||
@@ -53,7 +55,7 @@ void SignalMultiplexer::setCurrentObject(QObject* object)
|
||||
m_currentObject = object;
|
||||
|
||||
if (object) {
|
||||
Q_FOREACH (const Connection& con, m_connections) {
|
||||
for (const Connection& con : asConst(m_connections)) {
|
||||
connect(con);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,8 +21,6 @@
|
||||
#include <QObject>
|
||||
#include <QPointer>
|
||||
|
||||
#include "core/Global.h"
|
||||
|
||||
class SignalMultiplexer
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -23,7 +23,7 @@ TimeInfo::TimeInfo()
|
||||
: m_expires(false)
|
||||
, m_usageCount(0)
|
||||
{
|
||||
QDateTime now = Tools::currentDateTimeUtc();
|
||||
QDateTime now = QDateTime::currentDateTimeUtc();
|
||||
m_lastModificationTime = now;
|
||||
m_creationTime = now;
|
||||
m_lastAccessTime = now;
|
||||
|
||||
@@ -23,11 +23,7 @@
|
||||
#include <QLocale>
|
||||
#include <QStringList>
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(4, 7, 0)
|
||||
#include <QElapsedTimer>
|
||||
#else
|
||||
#include <QTime>
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
#include <windows.h> // for Sleep(), SetDllDirectoryA() and SetSearchPathMode()
|
||||
@@ -75,7 +71,9 @@ bool hasChild(const QObject* parent, const QObject* child)
|
||||
if (!parent || !child) {
|
||||
return false;
|
||||
}
|
||||
Q_FOREACH (QObject* c, parent->children()) {
|
||||
|
||||
const QObjectList children = parent->children();
|
||||
for (QObject* c : children) {
|
||||
if (child == c || hasChild(c, child)) {
|
||||
return true;
|
||||
}
|
||||
@@ -122,21 +120,12 @@ bool readAllFromDevice(QIODevice* device, QByteArray& data)
|
||||
}
|
||||
}
|
||||
|
||||
QDateTime currentDateTimeUtc()
|
||||
{
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(4, 7, 0)
|
||||
return QDateTime::currentDateTimeUtc();
|
||||
#else
|
||||
return QDateTime::currentDateTime().toUTC();
|
||||
#endif
|
||||
}
|
||||
|
||||
QString imageReaderFilter()
|
||||
{
|
||||
QList<QByteArray> formats = QImageReader::supportedImageFormats();
|
||||
const QList<QByteArray> formats = QImageReader::supportedImageFormats();
|
||||
QStringList formatsStringList;
|
||||
|
||||
Q_FOREACH (const QByteArray& format, formats) {
|
||||
for (const QByteArray& format : formats) {
|
||||
for (int i = 0; i < format.size(); i++) {
|
||||
if (!QChar(format.at(i)).isLetterOrNumber()) {
|
||||
continue;
|
||||
@@ -151,7 +140,7 @@ QString imageReaderFilter()
|
||||
|
||||
bool isHex(const QByteArray& ba)
|
||||
{
|
||||
Q_FOREACH (char c, ba) {
|
||||
for (char c : ba) {
|
||||
if ( !( (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F') ) ) {
|
||||
return false;
|
||||
}
|
||||
@@ -184,7 +173,7 @@ void sleep(int ms)
|
||||
timespec ts;
|
||||
ts.tv_sec = ms / 1000;
|
||||
ts.tv_nsec = (ms % 1000) * 1000 * 1000;
|
||||
nanosleep(&ts, Q_NULLPTR);
|
||||
nanosleep(&ts, nullptr);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -196,11 +185,7 @@ void wait(int ms)
|
||||
return;
|
||||
}
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(4, 7, 0)
|
||||
QElapsedTimer timer;
|
||||
#else
|
||||
QTime timer;
|
||||
#endif
|
||||
timer.start();
|
||||
|
||||
if (ms <= 50) {
|
||||
@@ -215,23 +200,10 @@ void wait(int ms)
|
||||
QCoreApplication::processEvents(QEventLoop::AllEvents, timeLeft);
|
||||
sleep(10);
|
||||
}
|
||||
} while (timer.elapsed() < ms);
|
||||
} while (!timer.hasExpired(ms));
|
||||
}
|
||||
}
|
||||
|
||||
QString platform()
|
||||
{
|
||||
#if defined(Q_WS_X11)
|
||||
return "x11";
|
||||
#elif defined(Q_WS_MAC)
|
||||
return "mac";
|
||||
#elif defined(Q_WS_WIN)
|
||||
return "win";
|
||||
#else
|
||||
return QString();
|
||||
#endif
|
||||
}
|
||||
|
||||
void disableCoreDumps()
|
||||
{
|
||||
// default to true
|
||||
|
||||
@@ -18,11 +18,13 @@
|
||||
#ifndef KEEPASSX_TOOLS_H
|
||||
#define KEEPASSX_TOOLS_H
|
||||
|
||||
#include "core/Global.h"
|
||||
|
||||
#include <QDateTime>
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
|
||||
#include "core/Global.h"
|
||||
#include <algorithm>
|
||||
|
||||
class QIODevice;
|
||||
|
||||
@@ -32,16 +34,27 @@ QString humanReadableFileSize(qint64 bytes);
|
||||
bool hasChild(const QObject* parent, const QObject* child);
|
||||
bool readFromDevice(QIODevice* device, QByteArray& data, int size = 16384);
|
||||
bool readAllFromDevice(QIODevice* device, QByteArray& data);
|
||||
QDateTime currentDateTimeUtc();
|
||||
QString imageReaderFilter();
|
||||
bool isHex(const QByteArray& ba);
|
||||
bool isBase64(const QByteArray& ba);
|
||||
void sleep(int ms);
|
||||
void wait(int ms);
|
||||
QString platform();
|
||||
void disableCoreDumps();
|
||||
void setupSearchPaths();
|
||||
|
||||
template <typename RandomAccessIterator, typename T>
|
||||
RandomAccessIterator binaryFind(RandomAccessIterator begin, RandomAccessIterator end, const T& value)
|
||||
{
|
||||
RandomAccessIterator it = std::lower_bound(begin, end, value);
|
||||
|
||||
if ((it == end) || (value < *it)) {
|
||||
return end;
|
||||
}
|
||||
else {
|
||||
return it;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace Tools
|
||||
|
||||
#endif // KEEPASSX_TOOLS_H
|
||||
|
||||
@@ -49,18 +49,20 @@ void Translator::installTranslator()
|
||||
|
||||
QList<QPair<QString, QString> > Translator::availableLanguages()
|
||||
{
|
||||
QStringList paths;
|
||||
const QStringList paths = {
|
||||
#ifdef QT_DEBUG
|
||||
paths.append(QString("%1/share/translations").arg(KEEPASSX_BINARY_DIR));
|
||||
QString("%1/share/translations").arg(KEEPASSX_BINARY_DIR),
|
||||
#endif
|
||||
paths.append(filePath()->dataPath("translations"));
|
||||
filePath()->dataPath("translations")
|
||||
};
|
||||
|
||||
QList<QPair<QString, QString> > languages;
|
||||
languages.append(QPair<QString, QString>("system", "System default"));
|
||||
|
||||
QRegExp regExp("keepassx_([a-zA-Z_]+)\\.qm", Qt::CaseInsensitive, QRegExp::RegExp2);
|
||||
Q_FOREACH (const QString& path, paths) {
|
||||
Q_FOREACH (const QString& filename, QDir(path).entryList()) {
|
||||
for (const QString& path : paths) {
|
||||
const QStringList fileList = QDir(path).entryList();
|
||||
for (const QString& filename : fileList) {
|
||||
if (regExp.exactMatch(filename)) {
|
||||
QString langcode = regExp.cap(1);
|
||||
if (langcode == "en_plurals") {
|
||||
@@ -85,13 +87,14 @@ QList<QPair<QString, QString> > Translator::availableLanguages()
|
||||
|
||||
bool Translator::installTranslator(const QString& language)
|
||||
{
|
||||
QStringList paths;
|
||||
const QStringList paths = {
|
||||
#ifdef QT_DEBUG
|
||||
paths.append(QString("%1/share/translations").arg(KEEPASSX_BINARY_DIR));
|
||||
QString("%1/share/translations").arg(KEEPASSX_BINARY_DIR),
|
||||
#endif
|
||||
paths.append(filePath()->dataPath("translations"));
|
||||
filePath()->dataPath("translations")
|
||||
};
|
||||
|
||||
Q_FOREACH (const QString& path, paths) {
|
||||
for (const QString& path : paths) {
|
||||
if (installTranslator(language, path)) {
|
||||
return true;
|
||||
}
|
||||
@@ -116,7 +119,7 @@ bool Translator::installTranslator(const QString& language, const QString& path)
|
||||
bool Translator::installQtTranslator(const QString& language)
|
||||
{
|
||||
QTranslator* qtTranslator = new QTranslator(qApp);
|
||||
if (qtTranslator->load(QString("%1/qt_%2").arg(QLibraryInfo::location(QLibraryInfo::TranslationsPath), language))) {
|
||||
if (qtTranslator->load(QString("%1/qtbase_%2").arg(QLibraryInfo::location(QLibraryInfo::TranslationsPath), language))) {
|
||||
QCoreApplication::installTranslator(qtTranslator);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -89,6 +89,12 @@ Uuid Uuid::fromBase64(const QString& str)
|
||||
return Uuid(data);
|
||||
}
|
||||
|
||||
Uuid Uuid::fromHex(const QString& str)
|
||||
{
|
||||
QByteArray data = QByteArray::fromHex(str.toLatin1());
|
||||
return Uuid(data);
|
||||
}
|
||||
|
||||
uint qHash(const Uuid& key)
|
||||
{
|
||||
return qHash(key.toByteArray());
|
||||
|
||||
@@ -37,6 +37,7 @@ public:
|
||||
bool operator!=(const Uuid& other) const;
|
||||
static const int Length;
|
||||
static Uuid fromBase64(const QString& str);
|
||||
static Uuid fromHex(const QString& str);
|
||||
|
||||
private:
|
||||
QByteArray m_data;
|
||||
|
||||
@@ -1,305 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2013 Laszlo Papp <lpapp@kde.org>
|
||||
** Copyright (C) 2013 David Faure <faure@kde.org>
|
||||
** Contact: http://www.qt-project.org/legal
|
||||
**
|
||||
** This file is part of the QtCore module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and Digia. For licensing terms and
|
||||
** conditions see http://qt.digia.com/licensing. For further information
|
||||
** use the contact form at http://qt.digia.com/contact-us.
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||
** General Public License version 2.1 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||||
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Digia gives you certain additional
|
||||
** rights. These rights are described in the Digia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3.0 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.GPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU General Public License version 3.0 requirements will be
|
||||
** met: http://www.gnu.org/copyleft/gpl.html.
|
||||
**
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include "qcommandlineoption.h"
|
||||
|
||||
#include <QSet>
|
||||
|
||||
class QCommandLineOptionPrivate : public QSharedData
|
||||
{
|
||||
public:
|
||||
inline QCommandLineOptionPrivate()
|
||||
{ }
|
||||
|
||||
void setNames(const QStringList &nameList);
|
||||
|
||||
//! The list of names used for this option.
|
||||
QStringList names;
|
||||
|
||||
//! The documentation name for the value, if one is expected
|
||||
//! Example: "-o <file>" means valueName == "file"
|
||||
QString valueName;
|
||||
|
||||
//! The description used for this option.
|
||||
QString description;
|
||||
|
||||
//! The list of default values used for this option.
|
||||
QStringList defaultValues;
|
||||
};
|
||||
|
||||
/*!
|
||||
\since 5.2
|
||||
\class QCommandLineOption
|
||||
\brief The QCommandLineOption class defines a possible command-line option.
|
||||
\inmodule QtCore
|
||||
\ingroup shared
|
||||
\ingroup tools
|
||||
|
||||
This class is used to describe an option on the command line. It allows
|
||||
different ways of defining the same option with multiple aliases possible.
|
||||
It is also used to describe how the option is used - it may be a flag (e.g. \c{-v})
|
||||
or take an argument (e.g. \c{-o file}).
|
||||
|
||||
Examples:
|
||||
\snippet code/src_corelib_tools_qcommandlineoption.cpp 0
|
||||
|
||||
\sa QCommandLineParser
|
||||
*/
|
||||
|
||||
/*!
|
||||
Constructs a command line option object with the given arguments.
|
||||
|
||||
The name of the option is set to \a name.
|
||||
The name can be either short or long. If the name is one character in
|
||||
length, it is considered a short name. Option names must not be empty,
|
||||
must not start with a dash or a slash character, must not contain a \c{=}
|
||||
and cannot be repeated.
|
||||
|
||||
The description is set to \a description. It is customary to add a "."
|
||||
at the end of the description.
|
||||
|
||||
In addition, the \a valueName can be set if the option expects a value.
|
||||
The default value for the option is set to \a defaultValue.
|
||||
|
||||
\sa setDescription(), setValueName(), setDefaultValues()
|
||||
*/
|
||||
QCommandLineOption::QCommandLineOption(const QString &name, const QString &description,
|
||||
const QString &valueName,
|
||||
const QString &defaultValue)
|
||||
: d(new QCommandLineOptionPrivate)
|
||||
{
|
||||
d->setNames(QStringList(name));
|
||||
setValueName(valueName);
|
||||
setDescription(description);
|
||||
setDefaultValue(defaultValue);
|
||||
}
|
||||
|
||||
/*!
|
||||
Constructs a command line option object with the given arguments.
|
||||
|
||||
This overload allows to set multiple names for the option, for instance
|
||||
\c{o} and \c{output}.
|
||||
|
||||
The names of the option are set to \a names.
|
||||
The names can be either short or long. Any name in the list that is one
|
||||
character in length is a short name. Option names must not be empty,
|
||||
must not start with a dash or a slash character, must not contain a \c{=}
|
||||
and cannot be repeated.
|
||||
|
||||
The description is set to \a description. It is customary to add a "."
|
||||
at the end of the description.
|
||||
|
||||
In addition, the \a valueName can be set if the option expects a value.
|
||||
The default value for the option is set to \a defaultValue.
|
||||
|
||||
\sa setDescription(), setValueName(), setDefaultValues()
|
||||
*/
|
||||
QCommandLineOption::QCommandLineOption(const QStringList &names, const QString &description,
|
||||
const QString &valueName,
|
||||
const QString &defaultValue)
|
||||
: d(new QCommandLineOptionPrivate)
|
||||
{
|
||||
d->setNames(names);
|
||||
setValueName(valueName);
|
||||
setDescription(description);
|
||||
setDefaultValue(defaultValue);
|
||||
}
|
||||
|
||||
/*!
|
||||
Constructs a QCommandLineOption object that is a copy of the QCommandLineOption
|
||||
object \a other.
|
||||
|
||||
\sa operator=()
|
||||
*/
|
||||
QCommandLineOption::QCommandLineOption(const QCommandLineOption &other)
|
||||
: d(other.d)
|
||||
{
|
||||
}
|
||||
|
||||
/*!
|
||||
Destroys the command line option object.
|
||||
*/
|
||||
QCommandLineOption::~QCommandLineOption()
|
||||
{
|
||||
}
|
||||
|
||||
/*!
|
||||
Makes a copy of the \a other object and assigns it to this QCommandLineOption
|
||||
object.
|
||||
*/
|
||||
QCommandLineOption &QCommandLineOption::operator=(const QCommandLineOption &other)
|
||||
{
|
||||
d = other.d;
|
||||
return *this;
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the names set for this option.
|
||||
*/
|
||||
QStringList QCommandLineOption::names() const
|
||||
{
|
||||
return d->names;
|
||||
}
|
||||
|
||||
void QCommandLineOptionPrivate::setNames(const QStringList &nameList)
|
||||
{
|
||||
QStringList newNames;
|
||||
if (nameList.isEmpty())
|
||||
qWarning("QCommandLineOption: Options must have at least one name");
|
||||
Q_FOREACH (const QString &name, nameList) {
|
||||
if (name.isEmpty()) {
|
||||
qWarning("QCommandLineOption: Option names cannot be empty");
|
||||
} else {
|
||||
const QChar c = name.at(0);
|
||||
if (c == QLatin1Char('-'))
|
||||
qWarning("QCommandLineOption: Option names cannot start with a '-'");
|
||||
else if (c == QLatin1Char('/'))
|
||||
qWarning("QCommandLineOption: Option names cannot start with a '/'");
|
||||
else if (name.contains(QLatin1Char('=')))
|
||||
qWarning("QCommandLineOption: Option names cannot contain a '='");
|
||||
else
|
||||
newNames.append(name);
|
||||
}
|
||||
}
|
||||
// commit
|
||||
names = newNames;
|
||||
}
|
||||
|
||||
/*!
|
||||
Sets the name of the expected value, for the documentation, to \a valueName.
|
||||
|
||||
Options without a value assigned have a boolean-like behavior:
|
||||
either the user specifies --option or they don't.
|
||||
|
||||
Options with a value assigned need to set a name for the expected value,
|
||||
for the documentation of the option in the help output. An option with names \c{o} and \c{output},
|
||||
and a value name of \c{file} will appear as \c{-o, --output <file>}.
|
||||
|
||||
Call QCommandLineParser::argument() if you expect the option to be present
|
||||
only once, and QCommandLineParser::arguments() if you expect that option
|
||||
to be present multiple times.
|
||||
|
||||
\sa valueName()
|
||||
*/
|
||||
void QCommandLineOption::setValueName(const QString &valueName)
|
||||
{
|
||||
d->valueName = valueName;
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the name of the expected value.
|
||||
|
||||
If empty, the option doesn't take a value.
|
||||
|
||||
\sa setValueName()
|
||||
*/
|
||||
QString QCommandLineOption::valueName() const
|
||||
{
|
||||
return d->valueName;
|
||||
}
|
||||
|
||||
/*!
|
||||
Sets the description used for this option to \a description.
|
||||
|
||||
It is customary to add a "." at the end of the description.
|
||||
|
||||
The description is used by QCommandLineParser::showHelp().
|
||||
|
||||
\sa description()
|
||||
*/
|
||||
void QCommandLineOption::setDescription(const QString &description)
|
||||
{
|
||||
d->description = description;
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the description set for this option.
|
||||
|
||||
\sa setDescription()
|
||||
*/
|
||||
QString QCommandLineOption::description() const
|
||||
{
|
||||
return d->description;
|
||||
}
|
||||
|
||||
/*!
|
||||
Sets the default value used for this option to \a defaultValue.
|
||||
|
||||
The default value is used if the user of the application does not specify
|
||||
the option on the command line.
|
||||
|
||||
If \a defaultValue is empty, the option has no default values.
|
||||
|
||||
\sa defaultValues() setDefaultValues()
|
||||
*/
|
||||
void QCommandLineOption::setDefaultValue(const QString &defaultValue)
|
||||
{
|
||||
QStringList newDefaultValues;
|
||||
if (!defaultValue.isEmpty()) {
|
||||
newDefaultValues << defaultValue;
|
||||
}
|
||||
// commit:
|
||||
d->defaultValues = newDefaultValues;
|
||||
}
|
||||
|
||||
/*!
|
||||
Sets the list of default values used for this option to \a defaultValues.
|
||||
|
||||
The default values are used if the user of the application does not specify
|
||||
the option on the command line.
|
||||
|
||||
\sa defaultValues() setDefaultValue()
|
||||
*/
|
||||
void QCommandLineOption::setDefaultValues(const QStringList &defaultValues)
|
||||
{
|
||||
d->defaultValues = defaultValues;
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the default values set for this option.
|
||||
|
||||
\sa setDefaultValues()
|
||||
*/
|
||||
QStringList QCommandLineOption::defaultValues() const
|
||||
{
|
||||
return d->defaultValues;
|
||||
}
|
||||
@@ -1,81 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2013 Laszlo Papp <lpapp@kde.org>
|
||||
** Contact: http://www.qt-project.org/legal
|
||||
**
|
||||
** This file is part of the QtCore module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and Digia. For licensing terms and
|
||||
** conditions see http://qt.digia.com/licensing. For further information
|
||||
** use the contact form at http://qt.digia.com/contact-us.
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||
** General Public License version 2.1 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||||
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Digia gives you certain additional
|
||||
** rights. These rights are described in the Digia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3.0 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.GPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU General Public License version 3.0 requirements will be
|
||||
** met: http://www.gnu.org/copyleft/gpl.html.
|
||||
**
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef QCOMMANDLINEOPTION_H
|
||||
#define QCOMMANDLINEOPTION_H
|
||||
|
||||
#include <QStringList>
|
||||
#include <QSharedData>
|
||||
|
||||
class QCommandLineOptionPrivate;
|
||||
|
||||
class QCommandLineOption
|
||||
{
|
||||
public:
|
||||
explicit QCommandLineOption(const QString &name, const QString &description = QString(),
|
||||
const QString &valueName = QString(),
|
||||
const QString &defaultValue = QString());
|
||||
explicit QCommandLineOption(const QStringList &names, const QString &description = QString(),
|
||||
const QString &valueName = QString(),
|
||||
const QString &defaultValue = QString());
|
||||
QCommandLineOption(const QCommandLineOption &other);
|
||||
|
||||
~QCommandLineOption();
|
||||
|
||||
QCommandLineOption &operator=(const QCommandLineOption &other);
|
||||
|
||||
QStringList names() const;
|
||||
|
||||
void setValueName(const QString &name);
|
||||
QString valueName() const;
|
||||
|
||||
void setDescription(const QString &description);
|
||||
QString description() const;
|
||||
|
||||
void setDefaultValue(const QString &defaultValue);
|
||||
void setDefaultValues(const QStringList &defaultValues);
|
||||
QStringList defaultValues() const;
|
||||
|
||||
private:
|
||||
QSharedDataPointer<QCommandLineOptionPrivate> d;
|
||||
};
|
||||
|
||||
#endif // QCOMMANDLINEOPTION_H
|
||||
@@ -1,944 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2013 Laszlo Papp <lpapp@kde.org>
|
||||
** Copyright (C) 2013 David Faure <faure@kde.org>
|
||||
** Contact: http://www.qt-project.org/legal
|
||||
**
|
||||
** This file is part of the QtCore module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and Digia. For licensing terms and
|
||||
** conditions see http://qt.digia.com/licensing. For further information
|
||||
** use the contact form at http://qt.digia.com/contact-us.
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||
** General Public License version 2.1 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||||
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Digia gives you certain additional
|
||||
** rights. These rights are described in the Digia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3.0 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.GPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU General Public License version 3.0 requirements will be
|
||||
** met: http://www.gnu.org/copyleft/gpl.html.
|
||||
**
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include "qcommandlineparser.h"
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QHash>
|
||||
#include <QVector>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
typedef QHash<QString, int> NameHash_t;
|
||||
|
||||
class QCommandLineParserPrivate
|
||||
{
|
||||
public:
|
||||
inline QCommandLineParserPrivate()
|
||||
: singleDashWordOptionMode(QCommandLineParser::ParseAsCompactedShortOptions),
|
||||
builtinVersionOption(false),
|
||||
builtinHelpOption(false),
|
||||
needsParsing(true)
|
||||
{ }
|
||||
|
||||
bool parse(const QStringList &args);
|
||||
void checkParsed(const char *method);
|
||||
QStringList aliases(const QString &name) const;
|
||||
QString helpText() const;
|
||||
bool registerFoundOption(const QString &optionName);
|
||||
bool parseOptionValue(const QString &optionName, const QString &argument,
|
||||
QStringList::const_iterator *argumentIterator,
|
||||
QStringList::const_iterator argsEnd);
|
||||
|
||||
//! Error text set when parse() returns false
|
||||
QString errorText;
|
||||
|
||||
//! The command line options used for parsing
|
||||
QList<QCommandLineOption> commandLineOptionList;
|
||||
|
||||
//! Hash mapping option names to their offsets in commandLineOptionList and optionArgumentList.
|
||||
NameHash_t nameHash;
|
||||
|
||||
//! Option values found (only for options with a value)
|
||||
QHash<int, QStringList> optionValuesHash;
|
||||
|
||||
//! Names of options found on the command line.
|
||||
QStringList optionNames;
|
||||
|
||||
//! Arguments which did not belong to any option.
|
||||
QStringList positionalArgumentList;
|
||||
|
||||
//! Names of options which were unknown.
|
||||
QStringList unknownOptionNames;
|
||||
|
||||
//! Application description
|
||||
QString description;
|
||||
|
||||
//! Documentation for positional arguments
|
||||
struct PositionalArgumentDefinition
|
||||
{
|
||||
QString name;
|
||||
QString description;
|
||||
QString syntax;
|
||||
};
|
||||
QVector<PositionalArgumentDefinition> positionalArgumentDefinitions;
|
||||
|
||||
//! The parsing mode for "-abc"
|
||||
QCommandLineParser::SingleDashWordOptionMode singleDashWordOptionMode;
|
||||
|
||||
//! Whether addVersionOption was called
|
||||
bool builtinVersionOption;
|
||||
|
||||
//! Whether addHelpOption was called
|
||||
bool builtinHelpOption;
|
||||
|
||||
//! True if parse() needs to be called
|
||||
bool needsParsing;
|
||||
};
|
||||
|
||||
QStringList QCommandLineParserPrivate::aliases(const QString &optionName) const
|
||||
{
|
||||
const NameHash_t::const_iterator it = nameHash.find(optionName);
|
||||
if (it == nameHash.end()) {
|
||||
qWarning("QCommandLineParser: option not defined: \"%s\"", qPrintable(optionName));
|
||||
return QStringList();
|
||||
}
|
||||
return commandLineOptionList.at(*it).names();
|
||||
}
|
||||
|
||||
/*!
|
||||
\since 5.2
|
||||
\class QCommandLineParser
|
||||
\inmodule QtCore
|
||||
\ingroup tools
|
||||
|
||||
\brief The QCommandLineParser class provides a means for handling the
|
||||
command line options.
|
||||
|
||||
QCoreApplication provides the command-line arguments as a simple list of strings.
|
||||
QCommandLineParser provides the ability to define a set of options, parse the
|
||||
command-line arguments, and store which options have actually been used, as
|
||||
well as option values.
|
||||
|
||||
Any argument that isn't an option (i.e. doesn't start with a \c{-}) is stored
|
||||
as a "positional argument".
|
||||
|
||||
The parser handles short names, long names, more than one name for the same
|
||||
option, and option values.
|
||||
|
||||
Options on the command line are recognized as starting with a single or
|
||||
double \c{-} character(s).
|
||||
The option \c{-} (single dash alone) is a special case, often meaning standard
|
||||
input, and not treated as an option. The parser will treat everything after the
|
||||
option \c{--} (double dash) as positional arguments.
|
||||
|
||||
Short options are single letters. The option \c{v} would be specified by
|
||||
passing \c{-v} on the command line. In the default parsing mode, short options
|
||||
can be written in a compact form, for instance \c{-abc} is equivalent to \c{-a -b -c}.
|
||||
The parsing mode for can be set to ParseAsLongOptions, in which case \c{-abc}
|
||||
will be parsed as the long option \c{abc}.
|
||||
|
||||
Long options are more than one letter long and cannot be compacted together.
|
||||
The long option \c{verbose} would be passed as \c{--verbose} or \c{-verbose}.
|
||||
|
||||
Passing values to options can be done using the assignment operator: \c{-v=value}
|
||||
\c{--verbose=value}, or a space: \c{-v value} \c{--verbose value}, i.e. the next
|
||||
argument is used as value (even if it starts with a \c{-}).
|
||||
|
||||
The parser does not support optional values - if an option is set to
|
||||
require a value, one must be present. If such an option is placed last
|
||||
and has no value, the option will be treated as if it had not been
|
||||
specified.
|
||||
|
||||
The parser does not automatically support negating or disabling long options
|
||||
by using the format \c{--disable-option} or \c{--no-option}. However, it is
|
||||
possible to handle this case explicitly by making an option with \c{no-option}
|
||||
as one of its names, and handling the option explicitly.
|
||||
|
||||
Example:
|
||||
\snippet code/src_corelib_tools_qcommandlineparser_main.cpp 0
|
||||
|
||||
Known limitation: the parsing of Qt options inside QCoreApplication and subclasses
|
||||
happens before QCommandLineParser exists, so it can't take it into account. This
|
||||
means any option value that looks like a builtin Qt option, will be treated by
|
||||
QCoreApplication as a builtin Qt option. Example: \c{--profile -reverse} will
|
||||
lead to QGuiApplication seeing the -reverse option set, and removing it from
|
||||
QCoreApplication::arguments() before QCommandLineParser defines the \c{profile}
|
||||
option and parses the command line.
|
||||
|
||||
\sa QCommandLineOption, QCoreApplication
|
||||
*/
|
||||
|
||||
/*!
|
||||
Constructs a command line parser object.
|
||||
*/
|
||||
QCommandLineParser::QCommandLineParser()
|
||||
: d(new QCommandLineParserPrivate)
|
||||
{
|
||||
}
|
||||
|
||||
/*!
|
||||
Destroys the command line parser object.
|
||||
*/
|
||||
QCommandLineParser::~QCommandLineParser()
|
||||
{
|
||||
delete d;
|
||||
}
|
||||
|
||||
/*!
|
||||
\enum QCommandLineParser::SingleDashWordOptionMode
|
||||
|
||||
This enum describes the way the parser interprets command-line
|
||||
options that use a single dash followed by multiple letters, as as \c{-abc}.
|
||||
|
||||
\value ParseAsCompactedShortOptions \c{-abc} is interpreted as \c{-a -b -c},
|
||||
i.e. as three short options that have been compacted on the command-line,
|
||||
if none of the options take a value. If \c{a} takes a value, then it
|
||||
is interpreted as \c{-a bc}, i.e. the short option \c{a} followed by the value \c{bc}.
|
||||
This is typically used in tools that behave like compilers, in order
|
||||
to handle options such as \c{-DDEFINE=VALUE} or \c{-I/include/path}.
|
||||
This is the default parsing mode. New applications are recommended to
|
||||
use this mode.
|
||||
|
||||
\value ParseAsLongOptions \c{-abc} is interpreted as \c{--abc},
|
||||
i.e. as the long option named \c{abc}. This is how Qt's own tools
|
||||
(uic, rcc...) have always been parsing arguments. This mode should be
|
||||
used for preserving compatibility in applications that were parsing
|
||||
arguments in such a way.
|
||||
|
||||
\sa setSingleDashWordOptionMode()
|
||||
*/
|
||||
|
||||
/*!
|
||||
Sets the parsing mode to \a singleDashWordOptionMode.
|
||||
This must be called before process() or parse().
|
||||
*/
|
||||
void QCommandLineParser::setSingleDashWordOptionMode(QCommandLineParser::SingleDashWordOptionMode singleDashWordOptionMode)
|
||||
{
|
||||
d->singleDashWordOptionMode = singleDashWordOptionMode;
|
||||
}
|
||||
|
||||
/*!
|
||||
Adds the option \a option to look for while parsing.
|
||||
|
||||
Returns \c true if adding the option was successful; otherwise returns \c false.
|
||||
|
||||
Adding the option fails if there is no name attached to the option, or
|
||||
the option has a name that clashes with an option name added before.
|
||||
*/
|
||||
bool QCommandLineParser::addOption(const QCommandLineOption &option)
|
||||
{
|
||||
QStringList optionNames = option.names();
|
||||
|
||||
if (!optionNames.isEmpty()) {
|
||||
Q_FOREACH (const QString &name, optionNames) {
|
||||
if (d->nameHash.contains(name))
|
||||
return false;
|
||||
}
|
||||
|
||||
d->commandLineOptionList.append(option);
|
||||
|
||||
const int offset = d->commandLineOptionList.size() - 1;
|
||||
Q_FOREACH (const QString &name, optionNames)
|
||||
d->nameHash.insert(name, offset);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*!
|
||||
Adds the \c{-v} / \c{--version} option, which displays the version string of the application.
|
||||
|
||||
This option is handled automatically by QCommandLineParser.
|
||||
|
||||
You can set the actual version string by using QCoreApplication::setApplicationVersion().
|
||||
|
||||
Returns the option instance, which can be used to call isSet().
|
||||
*/
|
||||
QCommandLineOption QCommandLineParser::addVersionOption()
|
||||
{
|
||||
QCommandLineOption opt(QStringList() << "v" << "version", tr("Displays version information."));
|
||||
addOption(opt);
|
||||
d->builtinVersionOption = true;
|
||||
return opt;
|
||||
}
|
||||
|
||||
/*!
|
||||
Adds the help option (\c{-h}, \c{--help} and \c{-?} on Windows)
|
||||
This option is handled automatically by QCommandLineParser.
|
||||
|
||||
Remember to use setApplicationDescription to set the application description,
|
||||
which will be displayed when this option is used.
|
||||
|
||||
Example:
|
||||
\snippet code/src_corelib_tools_qcommandlineparser_main.cpp 0
|
||||
|
||||
Returns the option instance, which can be used to call isSet().
|
||||
*/
|
||||
QCommandLineOption QCommandLineParser::addHelpOption()
|
||||
{
|
||||
QCommandLineOption opt(QStringList()
|
||||
#ifdef Q_OS_WIN
|
||||
<< "?"
|
||||
#endif
|
||||
<< "h"
|
||||
<< "help", tr("Displays this help."));
|
||||
addOption(opt);
|
||||
d->builtinHelpOption = true;
|
||||
return opt;
|
||||
}
|
||||
|
||||
/*!
|
||||
Sets the application \a description shown by helpText().
|
||||
*/
|
||||
void QCommandLineParser::setApplicationDescription(const QString &description)
|
||||
{
|
||||
d->description = description;
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the application description set in setApplicationDescription().
|
||||
*/
|
||||
QString QCommandLineParser::applicationDescription() const
|
||||
{
|
||||
return d->description;
|
||||
}
|
||||
|
||||
/*!
|
||||
Defines an additional argument to the application, for the benefit of the help text.
|
||||
|
||||
The argument \a name and \a description will appear under the \c{Arguments:} section
|
||||
of the help. If \a syntax is specified, it will be appended to the Usage line, otherwise
|
||||
the \a name will be appended.
|
||||
|
||||
Example:
|
||||
\snippet code/src_corelib_tools_qcommandlineparser.cpp 2
|
||||
|
||||
\sa addHelpOption(), helpText()
|
||||
*/
|
||||
void QCommandLineParser::addPositionalArgument(const QString &name, const QString &description, const QString &syntax)
|
||||
{
|
||||
QCommandLineParserPrivate::PositionalArgumentDefinition arg;
|
||||
arg.name = name;
|
||||
arg.description = description;
|
||||
arg.syntax = syntax.isEmpty() ? name : syntax;
|
||||
d->positionalArgumentDefinitions.append(arg);
|
||||
}
|
||||
|
||||
/*!
|
||||
Clears the definitions of additional arguments from the help text.
|
||||
|
||||
This is only needed for the special case of tools which support multiple commands
|
||||
with different options. Once the actual command has been identified, the options
|
||||
for this command can be defined, and the help text for the command can be adjusted
|
||||
accordingly.
|
||||
|
||||
Example:
|
||||
\snippet code/src_corelib_tools_qcommandlineparser.cpp 3
|
||||
*/
|
||||
void QCommandLineParser::clearPositionalArguments()
|
||||
{
|
||||
d->positionalArgumentDefinitions.clear();
|
||||
}
|
||||
|
||||
/*!
|
||||
Parses the command line \a arguments.
|
||||
|
||||
Most programs don't need to call this, a simple call to process() is enough.
|
||||
|
||||
parse() is more low-level, and only does the parsing. The application will have to
|
||||
take care of the error handling, using errorText() if parse() returns \c false.
|
||||
This can be useful for instance to show a graphical error message in graphical programs.
|
||||
|
||||
Calling parse() instead of process() can also be useful in order to ignore unknown
|
||||
options temporarily, because more option definitions will be provided later on
|
||||
(depending on one of the arguments), before calling process().
|
||||
|
||||
Don't forget that \a arguments must start with the name of the executable (ignored, though).
|
||||
|
||||
Returns \c false in case of a parse error (unknown option or missing value); returns \c true otherwise.
|
||||
|
||||
\sa process()
|
||||
*/
|
||||
bool QCommandLineParser::parse(const QStringList &arguments)
|
||||
{
|
||||
return d->parse(arguments);
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns a translated error text for the user.
|
||||
This should only be called when parse() returns \c false.
|
||||
*/
|
||||
QString QCommandLineParser::errorText() const
|
||||
{
|
||||
if (!d->errorText.isEmpty())
|
||||
return d->errorText;
|
||||
if (d->unknownOptionNames.count() == 1)
|
||||
return tr("Unknown option '%1'.").arg(d->unknownOptionNames.first());
|
||||
if (d->unknownOptionNames.count() > 1)
|
||||
return tr("Unknown options: %1.").arg(d->unknownOptionNames.join(", "));
|
||||
return QString();
|
||||
}
|
||||
|
||||
/*!
|
||||
Processes the command line \a arguments.
|
||||
|
||||
In addition to parsing the options (like parse()), this function also handles the builtin
|
||||
options and handles errors.
|
||||
|
||||
The builtin options are \c{--version} if addVersionOption was called and \c{--help} if addHelpOption was called.
|
||||
|
||||
When invoking one of these options, or when an error happens (for instance an unknown option was
|
||||
passed), the current process will then stop, using the exit() function.
|
||||
|
||||
\sa QCoreApplication::arguments(), parse()
|
||||
*/
|
||||
void QCommandLineParser::process(const QStringList &arguments)
|
||||
{
|
||||
if (!d->parse(arguments)) {
|
||||
fprintf(stderr, "%s\n", qPrintable(errorText()));
|
||||
::exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (d->builtinVersionOption && isSet("version")) {
|
||||
printf("%s %s\n", qPrintable(QCoreApplication::applicationName()), qPrintable(QCoreApplication::applicationVersion()));
|
||||
::exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
if (d->builtinHelpOption && isSet("help"))
|
||||
showHelp(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
/*!
|
||||
\overload
|
||||
|
||||
The command line is obtained from the QCoreApplication instance \a app.
|
||||
*/
|
||||
void QCommandLineParser::process(const QCoreApplication &app)
|
||||
{
|
||||
// QCoreApplication::arguments() is static, but the app instance must exist so we require it as parameter
|
||||
Q_UNUSED(app);
|
||||
process(QCoreApplication::arguments());
|
||||
}
|
||||
|
||||
void QCommandLineParserPrivate::checkParsed(const char *method)
|
||||
{
|
||||
if (needsParsing)
|
||||
qWarning("QCommandLineParser: call process() or parse() before %s", method);
|
||||
}
|
||||
|
||||
/*!
|
||||
\internal
|
||||
Looks up the option \a optionName (found on the command line) and register it as found.
|
||||
Returns \c true on success.
|
||||
*/
|
||||
bool QCommandLineParserPrivate::registerFoundOption(const QString &optionName)
|
||||
{
|
||||
if (nameHash.contains(optionName)) {
|
||||
optionNames.append(optionName);
|
||||
return true;
|
||||
} else {
|
||||
unknownOptionNames.append(optionName);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
\internal
|
||||
\brief Parse the value for a given option, if it was defined to expect one.
|
||||
|
||||
The value is taken from the next argument, or after the equal sign in \a argument.
|
||||
|
||||
\param optionName the short option name
|
||||
\param argument the argument from the command line currently parsed. Only used for -k=value parsing.
|
||||
\param argumentIterator iterator to the currently parsed argument. Incremented if the next argument contains the value.
|
||||
\param argsEnd args.end(), to check if ++argumentIterator goes out of bounds
|
||||
Returns \c true on success.
|
||||
*/
|
||||
bool QCommandLineParserPrivate::parseOptionValue(const QString &optionName, const QString &argument,
|
||||
QStringList::const_iterator *argumentIterator, QStringList::const_iterator argsEnd)
|
||||
{
|
||||
const QLatin1Char assignChar('=');
|
||||
const NameHash_t::const_iterator nameHashIt = nameHash.constFind(optionName);
|
||||
if (nameHashIt != nameHash.constEnd()) {
|
||||
const int assignPos = argument.indexOf(assignChar);
|
||||
const NameHash_t::mapped_type optionOffset = *nameHashIt;
|
||||
const bool withValue = !commandLineOptionList.at(optionOffset).valueName().isEmpty();
|
||||
if (withValue) {
|
||||
if (assignPos == -1) {
|
||||
++(*argumentIterator);
|
||||
if (*argumentIterator == argsEnd) {
|
||||
errorText = QCommandLineParser::tr("Missing value after '%1'.").arg(argument);
|
||||
return false;
|
||||
}
|
||||
optionValuesHash[optionOffset].append(*(*argumentIterator));
|
||||
} else {
|
||||
optionValuesHash[optionOffset].append(argument.mid(assignPos + 1));
|
||||
}
|
||||
} else {
|
||||
if (assignPos != -1) {
|
||||
errorText = QCommandLineParser::tr("Unexpected value after '%1'.").arg(argument.left(assignPos));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/*!
|
||||
\internal
|
||||
|
||||
Parse the list of arguments \a args, and fills in
|
||||
optionNames, optionValuesHash, unknownOptionNames, positionalArguments, and errorText.
|
||||
|
||||
Any results from a previous parse operation are removed.
|
||||
|
||||
The parser will not look for further options once it encounters the option
|
||||
\c{--}; this does not include when \c{--} follows an option that requires a value.
|
||||
*/
|
||||
bool QCommandLineParserPrivate::parse(const QStringList &args)
|
||||
{
|
||||
needsParsing = false;
|
||||
bool error = false;
|
||||
|
||||
const QString doubleDashString("--");
|
||||
const QLatin1Char dashChar('-');
|
||||
const QLatin1Char assignChar('=');
|
||||
|
||||
bool doubleDashFound = false;
|
||||
errorText.clear();
|
||||
positionalArgumentList.clear();
|
||||
optionNames.clear();
|
||||
unknownOptionNames.clear();
|
||||
optionValuesHash.clear();
|
||||
|
||||
if (args.isEmpty()) {
|
||||
qWarning("QCommandLineParser: argument list cannot be empty, it should contain at least the executable name");
|
||||
return false;
|
||||
}
|
||||
|
||||
QStringList::const_iterator argumentIterator = args.begin();
|
||||
++argumentIterator; // skip executable name
|
||||
|
||||
for (; argumentIterator != args.end() ; ++argumentIterator) {
|
||||
QString argument = *argumentIterator;
|
||||
|
||||
if (doubleDashFound) {
|
||||
positionalArgumentList.append(argument);
|
||||
} else if (argument.startsWith(doubleDashString)) {
|
||||
if (argument.length() > 2) {
|
||||
QString optionName = argument.mid(2).section(assignChar, 0, 0);
|
||||
if (registerFoundOption(optionName)) {
|
||||
if (!parseOptionValue(optionName, argument, &argumentIterator, args.end()))
|
||||
error = true;
|
||||
} else {
|
||||
error = true;
|
||||
}
|
||||
} else {
|
||||
doubleDashFound = true;
|
||||
}
|
||||
} else if (argument.startsWith(dashChar)) {
|
||||
if (argument.size() == 1) { // single dash ("stdin")
|
||||
positionalArgumentList.append(argument);
|
||||
continue;
|
||||
}
|
||||
switch (singleDashWordOptionMode) {
|
||||
case QCommandLineParser::ParseAsCompactedShortOptions:
|
||||
{
|
||||
QString optionName;
|
||||
bool valueFound = false;
|
||||
for (int pos = 1 ; pos < argument.size(); ++pos) {
|
||||
optionName = argument.mid(pos, 1);
|
||||
if (!registerFoundOption(optionName)) {
|
||||
error = true;
|
||||
} else {
|
||||
const NameHash_t::const_iterator nameHashIt = nameHash.constFind(optionName);
|
||||
Q_ASSERT(nameHashIt != nameHash.constEnd()); // checked by registerFoundOption
|
||||
const NameHash_t::mapped_type optionOffset = *nameHashIt;
|
||||
const bool withValue = !commandLineOptionList.at(optionOffset).valueName().isEmpty();
|
||||
if (withValue) {
|
||||
if (pos + 1 < argument.size()) {
|
||||
if (argument.at(pos + 1) == assignChar)
|
||||
++pos;
|
||||
optionValuesHash[optionOffset].append(argument.mid(pos + 1));
|
||||
valueFound = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (pos + 1 < argument.size() && argument.at(pos + 1) == assignChar)
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!valueFound && !parseOptionValue(optionName, argument, &argumentIterator, args.end()))
|
||||
error = true;
|
||||
break;
|
||||
}
|
||||
case QCommandLineParser::ParseAsLongOptions:
|
||||
{
|
||||
const QString optionName = argument.mid(1).section(assignChar, 0, 0);
|
||||
if (registerFoundOption(optionName)) {
|
||||
if (!parseOptionValue(optionName, argument, &argumentIterator, args.end()))
|
||||
error = true;
|
||||
} else {
|
||||
error = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
positionalArgumentList.append(argument);
|
||||
}
|
||||
if (argumentIterator == args.end())
|
||||
break;
|
||||
}
|
||||
return !error;
|
||||
}
|
||||
|
||||
/*!
|
||||
Checks whether the option \a name was passed to the application.
|
||||
|
||||
Returns \c true if the option \a name was set, false otherwise.
|
||||
|
||||
The name provided can be any long or short name of any option that was
|
||||
added with \c addOption(). All the options names are treated as being
|
||||
equivalent. If the name is not recognized or that option was not present,
|
||||
false is returned.
|
||||
|
||||
Example:
|
||||
\snippet code/src_corelib_tools_qcommandlineparser.cpp 0
|
||||
*/
|
||||
|
||||
bool QCommandLineParser::isSet(const QString &name) const
|
||||
{
|
||||
d->checkParsed("isSet");
|
||||
if (d->optionNames.contains(name))
|
||||
return true;
|
||||
const QStringList aliases = d->aliases(name);
|
||||
Q_FOREACH (const QString &optionName, d->optionNames) {
|
||||
if (aliases.contains(optionName))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the option value found for the given option name \a optionName, or
|
||||
an empty string if not found.
|
||||
|
||||
The name provided can be any long or short name of any option that was
|
||||
added with \c addOption(). All the option names are treated as being
|
||||
equivalent. If the name is not recognized or that option was not present, an
|
||||
empty string is returned.
|
||||
|
||||
For options found by the parser, the last value found for
|
||||
that option is returned. If the option wasn't specified on the command line,
|
||||
the default value is returned.
|
||||
|
||||
An empty string is returned if the option does not take a value.
|
||||
|
||||
\sa values(), QCommandLineOption::setDefaultValue(), QCommandLineOption::setDefaultValues()
|
||||
*/
|
||||
|
||||
QString QCommandLineParser::value(const QString &optionName) const
|
||||
{
|
||||
d->checkParsed("value");
|
||||
const QStringList valueList = values(optionName);
|
||||
|
||||
if (!valueList.isEmpty())
|
||||
return valueList.last();
|
||||
|
||||
return QString();
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns a list of option values found for the given option name \a
|
||||
optionName, or an empty list if not found.
|
||||
|
||||
The name provided can be any long or short name of any option that was
|
||||
added with \c addOption(). All the options names are treated as being
|
||||
equivalent. If the name is not recognized or that option was not present, an
|
||||
empty list is returned.
|
||||
|
||||
For options found by the parser, the list will contain an entry for
|
||||
each time the option was encountered by the parser. If the option wasn't
|
||||
specified on the command line, the default values are returned.
|
||||
|
||||
An empty list is returned if the option does not take a value.
|
||||
|
||||
\sa value(), QCommandLineOption::setDefaultValue(), QCommandLineOption::setDefaultValues()
|
||||
*/
|
||||
|
||||
QStringList QCommandLineParser::values(const QString &optionName) const
|
||||
{
|
||||
d->checkParsed("values");
|
||||
const NameHash_t::const_iterator it = d->nameHash.constFind(optionName);
|
||||
if (it != d->nameHash.constEnd()) {
|
||||
const int optionOffset = *it;
|
||||
QStringList values = d->optionValuesHash.value(optionOffset);
|
||||
if (values.isEmpty())
|
||||
values = d->commandLineOptionList.at(optionOffset).defaultValues();
|
||||
return values;
|
||||
}
|
||||
|
||||
qWarning("QCommandLineParser: option not defined: \"%s\"", qPrintable(optionName));
|
||||
return QStringList();
|
||||
}
|
||||
|
||||
/*!
|
||||
\overload
|
||||
Checks whether the \a option was passed to the application.
|
||||
|
||||
Returns \c true if the \a option was set, false otherwise.
|
||||
|
||||
This is the recommended way to check for options with no values.
|
||||
|
||||
Example:
|
||||
\snippet code/src_corelib_tools_qcommandlineparser.cpp 1
|
||||
*/
|
||||
bool QCommandLineParser::isSet(const QCommandLineOption &option) const
|
||||
{
|
||||
// option.names() might be empty if the constructor failed
|
||||
return !option.names().isEmpty() && isSet(option.names().first());
|
||||
}
|
||||
|
||||
/*!
|
||||
\overload
|
||||
Returns the option value found for the given \a option, or
|
||||
an empty string if not found.
|
||||
|
||||
For options found by the parser, the last value found for
|
||||
that option is returned. If the option wasn't specified on the command line,
|
||||
the default value is returned.
|
||||
|
||||
An empty string is returned if the option does not take a value.
|
||||
|
||||
\sa values(), QCommandLineOption::setDefaultValue(), QCommandLineOption::setDefaultValues()
|
||||
*/
|
||||
QString QCommandLineParser::value(const QCommandLineOption &option) const
|
||||
{
|
||||
return value(option.names().first());
|
||||
}
|
||||
|
||||
/*!
|
||||
\overload
|
||||
Returns a list of option values found for the given \a option,
|
||||
or an empty list if not found.
|
||||
|
||||
For options found by the parser, the list will contain an entry for
|
||||
each time the option was encountered by the parser. If the option wasn't
|
||||
specified on the command line, the default values are returned.
|
||||
|
||||
An empty list is returned if the option does not take a value.
|
||||
|
||||
\sa value(), QCommandLineOption::setDefaultValue(), QCommandLineOption::setDefaultValues()
|
||||
*/
|
||||
QStringList QCommandLineParser::values(const QCommandLineOption &option) const
|
||||
{
|
||||
return values(option.names().first());
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns a list of positional arguments.
|
||||
|
||||
These are all of the arguments that were not recognized as part of an
|
||||
option.
|
||||
*/
|
||||
|
||||
QStringList QCommandLineParser::positionalArguments() const
|
||||
{
|
||||
d->checkParsed("positionalArguments");
|
||||
return d->positionalArgumentList;
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns a list of option names that were found.
|
||||
|
||||
This returns a list of all the recognized option names found by the
|
||||
parser, in the order in which they were found. For any long options
|
||||
that were in the form {--option=value}, the value part will have been
|
||||
dropped.
|
||||
|
||||
The names in this list do not include the preceding dash characters.
|
||||
Names may appear more than once in this list if they were encountered
|
||||
more than once by the parser.
|
||||
|
||||
Any entry in the list can be used with \c value() or with
|
||||
\c values() to get any relevant option values.
|
||||
*/
|
||||
|
||||
QStringList QCommandLineParser::optionNames() const
|
||||
{
|
||||
d->checkParsed("optionNames");
|
||||
return d->optionNames;
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns a list of unknown option names.
|
||||
|
||||
This list will include both long an short name options that were not
|
||||
recognized. For any long options that were in the form {--option=value},
|
||||
the value part will have been dropped and only the long name is added.
|
||||
|
||||
The names in this list do not include the preceding dash characters.
|
||||
Names may appear more than once in this list if they were encountered
|
||||
more than once by the parser.
|
||||
|
||||
\sa optionNames()
|
||||
*/
|
||||
|
||||
QStringList QCommandLineParser::unknownOptionNames() const
|
||||
{
|
||||
d->checkParsed("unknownOptionNames");
|
||||
return d->unknownOptionNames;
|
||||
}
|
||||
|
||||
/*!
|
||||
Displays the help information, and exits the application.
|
||||
This is automatically triggered by the --help option, but can also
|
||||
be used to display the help when the user is not invoking the
|
||||
application correctly.
|
||||
The exit code is set to \a exitCode. It should be set to 0 if the
|
||||
user requested to see the help, and to any other value in case of
|
||||
an error.
|
||||
|
||||
\sa helpText()
|
||||
*/
|
||||
void QCommandLineParser::showHelp(int exitCode)
|
||||
{
|
||||
fprintf(stdout, "%s", qPrintable(d->helpText()));
|
||||
::exit(exitCode);
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns a string containing the complete help information.
|
||||
|
||||
\sa showHelp()
|
||||
*/
|
||||
QString QCommandLineParser::helpText() const
|
||||
{
|
||||
return d->helpText();
|
||||
}
|
||||
|
||||
static QString wrapText(const QString &names, int longestOptionNameString, const QString &description)
|
||||
{
|
||||
const QLatin1Char nl('\n');
|
||||
QString text = QString(" ") + names.leftJustified(longestOptionNameString) + QLatin1Char(' ');
|
||||
const int indent = text.length();
|
||||
int lineStart = 0;
|
||||
int lastBreakable = -1;
|
||||
const int max = 79 - indent;
|
||||
int x = 0;
|
||||
const int len = description.length();
|
||||
|
||||
for (int i = 0; i < len; ++i) {
|
||||
++x;
|
||||
const QChar c = description.at(i);
|
||||
if (c.isSpace())
|
||||
lastBreakable = i;
|
||||
|
||||
int breakAt = -1;
|
||||
int nextLineStart = -1;
|
||||
if (x > max && lastBreakable != -1) {
|
||||
// time to break and we know where
|
||||
breakAt = lastBreakable;
|
||||
nextLineStart = lastBreakable + 1;
|
||||
} else if ((x > max - 1 && lastBreakable == -1) || i == len - 1) {
|
||||
// time to break but found nowhere [-> break here], or end of last line
|
||||
breakAt = i + 1;
|
||||
nextLineStart = breakAt;
|
||||
} else if (c == nl) {
|
||||
// forced break
|
||||
breakAt = i;
|
||||
nextLineStart = i + 1;
|
||||
}
|
||||
|
||||
if (breakAt != -1) {
|
||||
const int numChars = breakAt - lineStart;
|
||||
//qDebug() << "breakAt=" << description.at(breakAt) << "breakAtSpace=" << breakAtSpace << lineStart << "to" << breakAt << description.mid(lineStart, numChars);
|
||||
if (lineStart > 0)
|
||||
text += QString(indent, QLatin1Char(' '));
|
||||
text += description.mid(lineStart, numChars) + nl;
|
||||
x = 0;
|
||||
lastBreakable = -1;
|
||||
lineStart = nextLineStart;
|
||||
if (lineStart < len && description.at(lineStart).isSpace())
|
||||
++lineStart; // don't start a line with a space
|
||||
i = lineStart;
|
||||
}
|
||||
}
|
||||
|
||||
return text;
|
||||
}
|
||||
|
||||
QString QCommandLineParserPrivate::helpText() const
|
||||
{
|
||||
const QLatin1Char nl('\n');
|
||||
QString text;
|
||||
const QString exeName = QCoreApplication::instance()->arguments().first();
|
||||
QString usage = exeName;
|
||||
if (!commandLineOptionList.isEmpty()) {
|
||||
usage += QLatin1Char(' ');
|
||||
usage += QCommandLineParser::tr("[options]");
|
||||
}
|
||||
Q_FOREACH (const PositionalArgumentDefinition &arg, positionalArgumentDefinitions) {
|
||||
usage += QLatin1Char(' ');
|
||||
usage += arg.syntax;
|
||||
}
|
||||
text += QCommandLineParser::tr("Usage: %1").arg(usage) + nl;
|
||||
if (!description.isEmpty())
|
||||
text += description + nl;
|
||||
text += nl;
|
||||
if (!commandLineOptionList.isEmpty())
|
||||
text += QCommandLineParser::tr("Options:") + nl;
|
||||
QStringList optionNameList;
|
||||
int longestOptionNameString = 0;
|
||||
Q_FOREACH (const QCommandLineOption &option, commandLineOptionList) {
|
||||
QStringList optionNames;
|
||||
Q_FOREACH (const QString &optionName, option.names()) {
|
||||
if (optionName.length() == 1)
|
||||
optionNames.append(QLatin1Char('-') + optionName);
|
||||
else
|
||||
optionNames.append(QString("--") + optionName);
|
||||
}
|
||||
QString optionNamesString = optionNames.join(", ");
|
||||
if (!option.valueName().isEmpty())
|
||||
optionNamesString += QString(" <") + option.valueName() + QLatin1Char('>');
|
||||
optionNameList.append(optionNamesString);
|
||||
longestOptionNameString = qMax(longestOptionNameString, optionNamesString.length());
|
||||
}
|
||||
++longestOptionNameString;
|
||||
for (int i = 0; i < commandLineOptionList.count(); ++i) {
|
||||
const QCommandLineOption &option = commandLineOptionList.at(i);
|
||||
text += wrapText(optionNameList.at(i), longestOptionNameString, option.description());
|
||||
}
|
||||
if (!positionalArgumentDefinitions.isEmpty()) {
|
||||
if (!commandLineOptionList.isEmpty())
|
||||
text += nl;
|
||||
text += QCommandLineParser::tr("Arguments:") + nl;
|
||||
Q_FOREACH (const PositionalArgumentDefinition &arg, positionalArgumentDefinitions) {
|
||||
text += wrapText(arg.name, longestOptionNameString, arg.description);
|
||||
}
|
||||
}
|
||||
return text;
|
||||
}
|
||||
@@ -1,102 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2013 Laszlo Papp <lpapp@kde.org>
|
||||
** Contact: http://www.qt-project.org/legal
|
||||
**
|
||||
** This file is part of the QtCore module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and Digia. For licensing terms and
|
||||
** conditions see http://qt.digia.com/licensing. For further information
|
||||
** use the contact form at http://qt.digia.com/contact-us.
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||
** General Public License version 2.1 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||||
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Digia gives you certain additional
|
||||
** rights. These rights are described in the Digia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3.0 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.GPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU General Public License version 3.0 requirements will be
|
||||
** met: http://www.gnu.org/copyleft/gpl.html.
|
||||
**
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef QCOMMANDLINEPARSER_H
|
||||
#define QCOMMANDLINEPARSER_H
|
||||
|
||||
#include <QStringList>
|
||||
#include <QCoreApplication>
|
||||
|
||||
#include "qcommandlineoption.h"
|
||||
|
||||
class QCommandLineParserPrivate;
|
||||
class QCoreApplication;
|
||||
|
||||
class QCommandLineParser
|
||||
{
|
||||
Q_DECLARE_TR_FUNCTIONS(QCommandLineParser)
|
||||
public:
|
||||
QCommandLineParser();
|
||||
~QCommandLineParser();
|
||||
|
||||
enum SingleDashWordOptionMode {
|
||||
ParseAsCompactedShortOptions,
|
||||
ParseAsLongOptions
|
||||
};
|
||||
void setSingleDashWordOptionMode(SingleDashWordOptionMode parsingMode);
|
||||
|
||||
bool addOption(const QCommandLineOption &commandLineOption);
|
||||
|
||||
QCommandLineOption addVersionOption();
|
||||
QCommandLineOption addHelpOption();
|
||||
void setApplicationDescription(const QString &description);
|
||||
QString applicationDescription() const;
|
||||
void addPositionalArgument(const QString &name, const QString &description, const QString &syntax = QString());
|
||||
void clearPositionalArguments();
|
||||
|
||||
void process(const QStringList &arguments);
|
||||
void process(const QCoreApplication &app);
|
||||
|
||||
bool parse(const QStringList &arguments);
|
||||
QString errorText() const;
|
||||
|
||||
bool isSet(const QString &name) const;
|
||||
QString value(const QString &name) const;
|
||||
QStringList values(const QString &name) const;
|
||||
|
||||
bool isSet(const QCommandLineOption &option) const;
|
||||
QString value(const QCommandLineOption &option) const;
|
||||
QStringList values(const QCommandLineOption &option) const;
|
||||
|
||||
QStringList positionalArguments() const;
|
||||
QStringList optionNames() const;
|
||||
QStringList unknownOptionNames() const;
|
||||
|
||||
void showHelp(int exitCode = 0);
|
||||
QString helpText() const;
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(QCommandLineParser)
|
||||
|
||||
QCommandLineParserPrivate * const d;
|
||||
};
|
||||
|
||||
#endif // QCOMMANDLINEPARSER_H
|
||||
@@ -1,344 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2013 David Faure <faure+bluesystems@kde.org>
|
||||
** Contact: http://www.qt-project.org/legal
|
||||
**
|
||||
** This file is part of the QtCore module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL21$
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and Digia. For licensing terms and
|
||||
** conditions see http://qt.digia.com/licensing. For further information
|
||||
** use the contact form at http://qt.digia.com/contact-us.
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||
** General Public License version 2.1 or version 3 as published by the Free
|
||||
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
|
||||
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
|
||||
** following information to ensure the GNU Lesser General Public License
|
||||
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
|
||||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Digia gives you certain additional
|
||||
** rights. These rights are described in the Digia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include "qlockfile.h"
|
||||
#include "qlockfile_p.h"
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(4, 7, 0)
|
||||
# include <QElapsedTimer>
|
||||
#else
|
||||
# include <QTime>
|
||||
#endif
|
||||
#include <QDateTime>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
/*!
|
||||
\class QLockFile
|
||||
\inmodule QtCore
|
||||
\brief The QLockFile class provides locking between processes using a file.
|
||||
\since 5.1
|
||||
|
||||
A lock file can be used to prevent multiple processes from accessing concurrently
|
||||
the same resource. For instance, a configuration file on disk, or a socket, a port,
|
||||
a region of shared memory...
|
||||
|
||||
Serialization is only guaranteed if all processes that access the shared resource
|
||||
use QLockFile, with the same file path.
|
||||
|
||||
QLockFile supports two use cases:
|
||||
to protect a resource for a short-term operation (e.g. verifying if a configuration
|
||||
file has changed before saving new settings), and for long-lived protection of a
|
||||
resource (e.g. a document opened by a user in an editor) for an indefinite amount of time.
|
||||
|
||||
When protecting for a short-term operation, it is acceptable to call lock() and wait
|
||||
until any running operation finishes.
|
||||
When protecting a resource over a long time, however, the application should always
|
||||
call setStaleLockTime(0) and then tryLock() with a short timeout, in order to
|
||||
warn the user that the resource is locked.
|
||||
|
||||
If the process holding the lock crashes, the lock file stays on disk and can prevent
|
||||
any other process from accessing the shared resource, ever. For this reason, QLockFile
|
||||
tries to detect such a "stale" lock file, based on the process ID written into the file,
|
||||
and (in case that process ID got reused meanwhile), on the last modification time of
|
||||
the lock file (30s by default, for the use case of a short-lived operation).
|
||||
If the lock file is found to be stale, it will be deleted.
|
||||
|
||||
For the use case of protecting a resource over a long time, you should therefore call
|
||||
setStaleLockTime(0), and when tryLock() returns LockFailedError, inform the user
|
||||
that the document is locked, possibly using getLockInfo() for more details.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\enum QLockFile::LockError
|
||||
|
||||
This enum describes the result of the last call to lock() or tryLock().
|
||||
|
||||
\value NoError The lock was acquired successfully.
|
||||
\value LockFailedError The lock could not be acquired because another process holds it.
|
||||
\value PermissionError The lock file could not be created, for lack of permissions
|
||||
in the parent directory.
|
||||
\value UnknownError Another error happened, for instance a full partition
|
||||
prevented writing out the lock file.
|
||||
*/
|
||||
|
||||
/*!
|
||||
Constructs a new lock file object.
|
||||
The object is created in an unlocked state.
|
||||
When calling lock() or tryLock(), a lock file named \a fileName will be created,
|
||||
if it doesn't already exist.
|
||||
|
||||
\sa lock(), unlock()
|
||||
*/
|
||||
QLockFile::QLockFile(const QString &fileName)
|
||||
: d_ptr(new QLockFilePrivate(fileName))
|
||||
{
|
||||
}
|
||||
|
||||
/*!
|
||||
Destroys the lock file object.
|
||||
If the lock was acquired, this will release the lock, by deleting the lock file.
|
||||
*/
|
||||
QLockFile::~QLockFile()
|
||||
{
|
||||
unlock();
|
||||
}
|
||||
|
||||
/*!
|
||||
Sets \a staleLockTime to be the time in milliseconds after which
|
||||
a lock file is considered stale.
|
||||
The default value is 30000, i.e. 30 seconds.
|
||||
If your application typically keeps the file locked for more than 30 seconds
|
||||
(for instance while saving megabytes of data for 2 minutes), you should set
|
||||
a bigger value using setStaleLockTime().
|
||||
|
||||
The value of \a staleLockTime is used by lock() and tryLock() in order
|
||||
to determine when an existing lock file is considered stale, i.e. left over
|
||||
by a crashed process. This is useful for the case where the PID got reused
|
||||
meanwhile, so the only way to detect a stale lock file is by the fact that
|
||||
it has been around for a long time.
|
||||
|
||||
\sa staleLockTime()
|
||||
*/
|
||||
void QLockFile::setStaleLockTime(int staleLockTime)
|
||||
{
|
||||
Q_D(QLockFile);
|
||||
d->staleLockTime = staleLockTime;
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the time in milliseconds after which
|
||||
a lock file is considered stale.
|
||||
|
||||
\sa setStaleLockTime()
|
||||
*/
|
||||
int QLockFile::staleLockTime() const
|
||||
{
|
||||
Q_D(const QLockFile);
|
||||
return d->staleLockTime;
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns \c true if the lock was acquired by this QLockFile instance,
|
||||
otherwise returns \c false.
|
||||
|
||||
\sa lock(), unlock(), tryLock()
|
||||
*/
|
||||
bool QLockFile::isLocked() const
|
||||
{
|
||||
Q_D(const QLockFile);
|
||||
return d->isLocked;
|
||||
}
|
||||
|
||||
/*!
|
||||
Creates the lock file.
|
||||
|
||||
If another process (or another thread) has created the lock file already,
|
||||
this function will block until that process (or thread) releases it.
|
||||
|
||||
Calling this function multiple times on the same lock from the same
|
||||
thread without unlocking first is not allowed. This function will
|
||||
\e dead-lock when the file is locked recursively.
|
||||
|
||||
Returns \c true if the lock was acquired, false if it could not be acquired
|
||||
due to an unrecoverable error, such as no permissions in the parent directory.
|
||||
|
||||
\sa unlock(), tryLock()
|
||||
*/
|
||||
bool QLockFile::lock()
|
||||
{
|
||||
return tryLock(-1);
|
||||
}
|
||||
|
||||
/*!
|
||||
Attempts to create the lock file. This function returns \c true if the
|
||||
lock was obtained; otherwise it returns \c false. If another process (or
|
||||
another thread) has created the lock file already, this function will
|
||||
wait for at most \a timeout milliseconds for the lock file to become
|
||||
available.
|
||||
|
||||
Note: Passing a negative number as the \a timeout is equivalent to
|
||||
calling lock(), i.e. this function will wait forever until the lock
|
||||
file can be locked if \a timeout is negative.
|
||||
|
||||
If the lock was obtained, it must be released with unlock()
|
||||
before another process (or thread) can successfully lock it.
|
||||
|
||||
Calling this function multiple times on the same lock from the same
|
||||
thread without unlocking first is not allowed, this function will
|
||||
\e always return false when attempting to lock the file recursively.
|
||||
|
||||
\sa lock(), unlock()
|
||||
*/
|
||||
bool QLockFile::tryLock(int timeout)
|
||||
{
|
||||
Q_D(QLockFile);
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(4, 7, 0)
|
||||
QElapsedTimer timer;
|
||||
#else
|
||||
QTime timer;
|
||||
#endif
|
||||
if (timeout > 0)
|
||||
timer.start();
|
||||
int sleepTime = 100;
|
||||
Q_FOREVER {
|
||||
d->lockError = d->tryLock_sys();
|
||||
switch (d->lockError) {
|
||||
case NoError:
|
||||
d->isLocked = true;
|
||||
return true;
|
||||
case PermissionError:
|
||||
case UnknownError:
|
||||
return false;
|
||||
case LockFailedError:
|
||||
if (!d->isLocked && d->isApparentlyStale()) {
|
||||
// Stale lock from another thread/process
|
||||
// Ensure two processes don't remove it at the same time
|
||||
QLockFile rmlock(d->fileName + QLatin1String(".rmlock"));
|
||||
if (rmlock.tryLock()) {
|
||||
if (d->isApparentlyStale() && d->removeStaleLock())
|
||||
continue;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (timeout == 0 || (timeout > 0 && (timer.elapsed() > timeout)))
|
||||
return false;
|
||||
QLockFileThread::msleep(sleepTime);
|
||||
if (sleepTime < 5 * 1000)
|
||||
sleepTime *= 2;
|
||||
}
|
||||
// not reached
|
||||
return false;
|
||||
}
|
||||
|
||||
/*!
|
||||
\fn void QLockFile::unlock()
|
||||
Releases the lock, by deleting the lock file.
|
||||
|
||||
Calling unlock() without locking the file first, does nothing.
|
||||
|
||||
\sa lock(), tryLock()
|
||||
*/
|
||||
|
||||
/*!
|
||||
Retrieves information about the current owner of the lock file.
|
||||
|
||||
If tryLock() returns \c false, and error() returns LockFailedError,
|
||||
this function can be called to find out more information about the existing
|
||||
lock file:
|
||||
\list
|
||||
\li the PID of the application (returned in \a pid)
|
||||
\li the \a hostname it's running on (useful in case of networked filesystems),
|
||||
\li the name of the application which created it (returned in \a appname),
|
||||
\endlist
|
||||
|
||||
Note that tryLock() automatically deleted the file if there is no
|
||||
running application with this PID, so LockFailedError can only happen if there is
|
||||
an application with this PID (it could be unrelated though).
|
||||
|
||||
This can be used to inform users about the existing lock file and give them
|
||||
the choice to delete it. After removing the file using removeStaleLockFile(),
|
||||
the application can call tryLock() again.
|
||||
|
||||
This function returns \c true if the information could be successfully retrieved, false
|
||||
if the lock file doesn't exist or doesn't contain the expected data.
|
||||
This can happen if the lock file was deleted between the time where tryLock() failed
|
||||
and the call to this function. Simply call tryLock() again if this happens.
|
||||
*/
|
||||
bool QLockFile::getLockInfo(qint64 *pid, QString *hostname, QString *appname) const
|
||||
{
|
||||
Q_D(const QLockFile);
|
||||
return d->getLockInfo(pid, hostname, appname);
|
||||
}
|
||||
|
||||
bool QLockFilePrivate::getLockInfo(qint64 *pid, QString *hostname, QString *appname) const
|
||||
{
|
||||
QFile reader(fileName);
|
||||
if (!reader.open(QIODevice::ReadOnly))
|
||||
return false;
|
||||
|
||||
QByteArray pidLine = reader.readLine();
|
||||
pidLine.chop(1);
|
||||
QByteArray appNameLine = reader.readLine();
|
||||
appNameLine.chop(1);
|
||||
QByteArray hostNameLine = reader.readLine();
|
||||
hostNameLine.chop(1);
|
||||
if (pidLine.isEmpty())
|
||||
return false;
|
||||
|
||||
qint64 thePid = pidLine.toLongLong();
|
||||
if (pid)
|
||||
*pid = thePid;
|
||||
if (appname)
|
||||
*appname = QString::fromUtf8(appNameLine);
|
||||
if (hostname)
|
||||
*hostname = QString::fromUtf8(hostNameLine);
|
||||
return thePid > 0;
|
||||
}
|
||||
|
||||
/*!
|
||||
Attempts to forcefully remove an existing lock file.
|
||||
|
||||
Calling this is not recommended when protecting a short-lived operation: QLockFile
|
||||
already takes care of removing lock files after they are older than staleLockTime().
|
||||
|
||||
This method should only be called when protecting a resource for a long time, i.e.
|
||||
with staleLockTime(0), and after tryLock() returned LockFailedError, and the user
|
||||
agreed on removing the lock file.
|
||||
|
||||
Returns \c true on success, false if the lock file couldn't be removed. This happens
|
||||
on Windows, when the application owning the lock is still running.
|
||||
*/
|
||||
bool QLockFile::removeStaleLockFile()
|
||||
{
|
||||
Q_D(QLockFile);
|
||||
if (d->isLocked) {
|
||||
qWarning("removeStaleLockFile can only be called when not holding the lock");
|
||||
return false;
|
||||
}
|
||||
return d->removeStaleLock();
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the lock file error status.
|
||||
|
||||
If tryLock() returns \c false, this function can be called to find out
|
||||
the reason why the locking failed.
|
||||
*/
|
||||
QLockFile::LockError QLockFile::error() const
|
||||
{
|
||||
Q_D(const QLockFile);
|
||||
return d->lockError;
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
@@ -1,79 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2013 David Faure <faure+bluesystems@kde.org>
|
||||
** Contact: http://www.qt-project.org/legal
|
||||
**
|
||||
** This file is part of the QtCore module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL21$
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and Digia. For licensing terms and
|
||||
** conditions see http://qt.digia.com/licensing. For further information
|
||||
** use the contact form at http://qt.digia.com/contact-us.
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||
** General Public License version 2.1 or version 3 as published by the Free
|
||||
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
|
||||
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
|
||||
** following information to ensure the GNU Lesser General Public License
|
||||
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
|
||||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Digia gives you certain additional
|
||||
** rights. These rights are described in the Digia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef QLOCKFILE_H
|
||||
#define QLOCKFILE_H
|
||||
|
||||
#include <QString>
|
||||
#include <QScopedPointer>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class QLockFilePrivate;
|
||||
|
||||
class QLockFile
|
||||
{
|
||||
public:
|
||||
QLockFile(const QString &fileName);
|
||||
~QLockFile();
|
||||
|
||||
bool lock();
|
||||
bool tryLock(int timeout = 0);
|
||||
void unlock();
|
||||
|
||||
void setStaleLockTime(int);
|
||||
int staleLockTime() const;
|
||||
|
||||
bool isLocked() const;
|
||||
bool getLockInfo(qint64 *pid, QString *hostname, QString *appname) const;
|
||||
bool removeStaleLockFile();
|
||||
|
||||
enum LockError {
|
||||
NoError = 0,
|
||||
LockFailedError = 1,
|
||||
PermissionError = 2,
|
||||
UnknownError = 3
|
||||
};
|
||||
LockError error() const;
|
||||
|
||||
protected:
|
||||
QScopedPointer<QLockFilePrivate> d_ptr;
|
||||
|
||||
private:
|
||||
Q_DECLARE_PRIVATE(QLockFile)
|
||||
Q_DISABLE_COPY(QLockFile)
|
||||
};
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // QLOCKFILE_H
|
||||
@@ -1,101 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2013 David Faure <faure+bluesystems@kde.org>
|
||||
** Contact: http://www.qt-project.org/legal
|
||||
**
|
||||
** This file is part of the QtCore module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL21$
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and Digia. For licensing terms and
|
||||
** conditions see http://qt.digia.com/licensing. For further information
|
||||
** use the contact form at http://qt.digia.com/contact-us.
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||
** General Public License version 2.1 or version 3 as published by the Free
|
||||
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
|
||||
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
|
||||
** following information to ensure the GNU Lesser General Public License
|
||||
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
|
||||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Digia gives you certain additional
|
||||
** rights. These rights are described in the Digia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef QLOCKFILE_P_H
|
||||
#define QLOCKFILE_P_H
|
||||
|
||||
//
|
||||
// W A R N I N G
|
||||
// -------------
|
||||
//
|
||||
// This file is not part of the Qt API. It exists purely as an
|
||||
// implementation detail. This header file may change from version to
|
||||
// version without notice, or even be removed.
|
||||
//
|
||||
// We mean it.
|
||||
//
|
||||
|
||||
#include "qlockfile.h"
|
||||
|
||||
#include <QFile>
|
||||
#include <QThread>
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
#include <qt_windows.h>
|
||||
#endif
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class QLockFileThread : public QThread
|
||||
{
|
||||
public:
|
||||
static void msleep(unsigned long msecs) { QThread::msleep(msecs); }
|
||||
};
|
||||
|
||||
class QLockFilePrivate
|
||||
{
|
||||
public:
|
||||
QLockFilePrivate(const QString &fn)
|
||||
: fileName(fn),
|
||||
#ifdef Q_OS_WIN
|
||||
fileHandle(INVALID_HANDLE_VALUE),
|
||||
#else
|
||||
fileHandle(-1),
|
||||
#endif
|
||||
staleLockTime(30 * 1000), // 30 seconds
|
||||
lockError(QLockFile::NoError),
|
||||
isLocked(false)
|
||||
{
|
||||
}
|
||||
QLockFile::LockError tryLock_sys();
|
||||
bool removeStaleLock();
|
||||
bool getLockInfo(qint64 *pid, QString *hostname, QString *appname) const;
|
||||
// Returns \c true if the lock belongs to dead PID, or is old.
|
||||
// The attempt to delete it will tell us if it was really stale or not, though.
|
||||
bool isApparentlyStale() const;
|
||||
static QString processNameByPid(qint64 pid);
|
||||
|
||||
QString fileName;
|
||||
#ifdef Q_OS_WIN
|
||||
Qt::HANDLE fileHandle;
|
||||
#else
|
||||
int fileHandle;
|
||||
#endif
|
||||
int staleLockTime; // "int milliseconds" is big enough for 24 days
|
||||
QLockFile::LockError lockError;
|
||||
bool isLocked;
|
||||
};
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif /* QLOCKFILE_P_H */
|
||||
@@ -1,244 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2013 David Faure <faure+bluesystems@kde.org>
|
||||
** Copyright (C) 2015 The Qt Company Ltd.
|
||||
** Contact: http://www.qt-project.org/legal
|
||||
**
|
||||
** This file is part of the QtCore module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL21$
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and Digia. For licensing terms and
|
||||
** conditions see http://qt.digia.com/licensing. For further information
|
||||
** use the contact form at http://qt.digia.com/contact-us.
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||
** General Public License version 2.1 or version 3 as published by the Free
|
||||
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
|
||||
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
|
||||
** following information to ensure the GNU Lesser General Public License
|
||||
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
|
||||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Digia gives you certain additional
|
||||
** rights. These rights are described in the Digia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include "qlockfile_p.h"
|
||||
|
||||
#include <QTemporaryFile>
|
||||
#include <QCoreApplication>
|
||||
#include <QFileInfo>
|
||||
#include <QDebug>
|
||||
#include <QDateTime>
|
||||
|
||||
#include <sys/file.h> // flock
|
||||
#include <sys/types.h> // kill
|
||||
#include <signal.h> // kill
|
||||
#include <unistd.h> // gethostname
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
#if defined(Q_OS_MAC)
|
||||
# include <libproc.h>
|
||||
#elif defined(Q_OS_LINUX)
|
||||
# include <unistd.h>
|
||||
# include <cstdio>
|
||||
#endif
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
#define EINTR_LOOP(var, cmd) \
|
||||
do { \
|
||||
var = cmd; \
|
||||
} while (var == -1 && errno == EINTR)
|
||||
|
||||
// don't call QT_OPEN or ::open
|
||||
// call qt_safe_open
|
||||
static inline int qt_safe_open(const char *pathname, int flags, mode_t mode = 0777)
|
||||
{
|
||||
#ifdef O_CLOEXEC
|
||||
flags |= O_CLOEXEC;
|
||||
#endif
|
||||
int fd;
|
||||
EINTR_LOOP(fd, ::open(pathname, flags, mode));
|
||||
|
||||
// unknown flags are ignored, so we have no way of verifying if
|
||||
// O_CLOEXEC was accepted
|
||||
if (fd != -1)
|
||||
::fcntl(fd, F_SETFD, FD_CLOEXEC);
|
||||
return fd;
|
||||
}
|
||||
|
||||
static inline qint64 qt_safe_write(int fd, const void *data, qint64 len)
|
||||
{
|
||||
qint64 ret = 0;
|
||||
EINTR_LOOP(ret, ::write(fd, data, len));
|
||||
return ret;
|
||||
}
|
||||
|
||||
static QByteArray localHostName() // from QHostInfo::localHostName(), modified to return a QByteArray
|
||||
{
|
||||
QByteArray hostName(512, Qt::Uninitialized);
|
||||
if (gethostname(hostName.data(), hostName.size()) == -1)
|
||||
return QByteArray();
|
||||
hostName.truncate(strlen(hostName.data()));
|
||||
return hostName;
|
||||
}
|
||||
|
||||
// ### merge into qt_safe_write?
|
||||
static qint64 qt_write_loop(int fd, const char *data, qint64 len)
|
||||
{
|
||||
qint64 pos = 0;
|
||||
while (pos < len) {
|
||||
const qint64 ret = qt_safe_write(fd, data + pos, len - pos);
|
||||
if (ret == -1) // e.g. partition full
|
||||
return pos;
|
||||
pos += ret;
|
||||
}
|
||||
return pos;
|
||||
}
|
||||
|
||||
static bool setNativeLocks(int fd)
|
||||
{
|
||||
#if defined(LOCK_EX) && defined(LOCK_NB)
|
||||
if (flock(fd, LOCK_EX | LOCK_NB) == -1) // other threads, and other processes on a local fs
|
||||
return false;
|
||||
#endif
|
||||
struct flock flockData;
|
||||
flockData.l_type = F_WRLCK;
|
||||
flockData.l_whence = SEEK_SET;
|
||||
flockData.l_start = 0;
|
||||
flockData.l_len = 0; // 0 = entire file
|
||||
flockData.l_pid = getpid();
|
||||
if (fcntl(fd, F_SETLK, &flockData) == -1) // for networked filesystems
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
QLockFile::LockError QLockFilePrivate::tryLock_sys()
|
||||
{
|
||||
// Assemble data, to write in a single call to write
|
||||
// (otherwise we'd have to check every write call)
|
||||
// Use operator% from the fast builder to avoid multiple memory allocations.
|
||||
QByteArray fileData = QByteArray::number(QCoreApplication::applicationPid()) + '\n'
|
||||
+ QCoreApplication::applicationName().toUtf8() + '\n'
|
||||
+ localHostName() + '\n';
|
||||
|
||||
const QByteArray lockFileName = QFile::encodeName(fileName);
|
||||
const int fd = qt_safe_open(lockFileName.constData(), O_WRONLY | O_CREAT | O_EXCL, 0644);
|
||||
if (fd < 0) {
|
||||
switch (errno) {
|
||||
case EEXIST:
|
||||
return QLockFile::LockFailedError;
|
||||
case EACCES:
|
||||
case EROFS:
|
||||
return QLockFile::PermissionError;
|
||||
default:
|
||||
return QLockFile::UnknownError;
|
||||
}
|
||||
}
|
||||
// Ensure nobody else can delete the file while we have it
|
||||
if (!setNativeLocks(fd))
|
||||
qWarning() << "setNativeLocks failed:" << strerror(errno);
|
||||
|
||||
if (qt_write_loop(fd, fileData.constData(), fileData.size()) < fileData.size()) {
|
||||
close(fd);
|
||||
if (!QFile::remove(fileName))
|
||||
qWarning("QLockFile: Could not remove our own lock file %s.", qPrintable(fileName));
|
||||
return QLockFile::UnknownError; // partition full
|
||||
}
|
||||
|
||||
// We hold the lock, continue.
|
||||
fileHandle = fd;
|
||||
|
||||
return QLockFile::NoError;
|
||||
}
|
||||
|
||||
bool QLockFilePrivate::removeStaleLock()
|
||||
{
|
||||
const QByteArray lockFileName = QFile::encodeName(fileName);
|
||||
const int fd = qt_safe_open(lockFileName.constData(), O_WRONLY, 0644);
|
||||
if (fd < 0) // gone already?
|
||||
return false;
|
||||
#ifdef Q_OS_MAC
|
||||
// ugly workaround: ignore setNativeLocks() result on Mac since it's broken there
|
||||
setNativeLocks(fd);
|
||||
bool success = (::unlink(lockFileName) == 0);
|
||||
#else
|
||||
bool success = setNativeLocks(fd) && (::unlink(lockFileName) == 0);
|
||||
#endif
|
||||
close(fd);
|
||||
return success;
|
||||
}
|
||||
|
||||
bool QLockFilePrivate::isApparentlyStale() const
|
||||
{
|
||||
qint64 pid;
|
||||
QString hostname, appname;
|
||||
if (getLockInfo(&pid, &hostname, &appname)) {
|
||||
if (hostname.isEmpty() || hostname == QString::fromLocal8Bit(localHostName())) {
|
||||
if (::kill(pid, 0) == -1 && errno == ESRCH)
|
||||
return true; // PID doesn't exist anymore
|
||||
const QString processName = processNameByPid(pid);
|
||||
if (!processName.isEmpty()) {
|
||||
QFileInfo fi(appname);
|
||||
if (fi.isSymLink())
|
||||
fi.setFile(fi.symLinkTarget());
|
||||
if (processName.toLower() != fi.fileName().toLower())
|
||||
return true; // PID got reused by a different application.
|
||||
}
|
||||
}
|
||||
}
|
||||
const qint64 age = QFileInfo(fileName).lastModified().secsTo(QDateTime::currentDateTime()) * 1000;
|
||||
return staleLockTime > 0 && age > staleLockTime;
|
||||
}
|
||||
|
||||
QString QLockFilePrivate::processNameByPid(qint64 pid)
|
||||
{
|
||||
#if defined(Q_OS_MAC)
|
||||
char name[1024];
|
||||
proc_name(pid, name, sizeof(name) / sizeof(char));
|
||||
return QFile::decodeName(name);
|
||||
#elif defined(Q_OS_LINUX)
|
||||
if (!QFile::exists(QString("/proc/version")))
|
||||
return QString();
|
||||
char exePath[64];
|
||||
char buf[PATH_MAX + 1];
|
||||
sprintf(exePath, "/proc/%lld/exe", pid);
|
||||
size_t len = static_cast<size_t>(readlink(exePath, buf, sizeof(buf)));
|
||||
if (len >= sizeof(buf)) {
|
||||
// The pid is gone. Return some invalid process name to fail the test.
|
||||
return QString("/ERROR/");
|
||||
}
|
||||
buf[len] = 0;
|
||||
return QFileInfo(QFile::decodeName(buf)).fileName();
|
||||
#else
|
||||
return QString();
|
||||
#endif
|
||||
}
|
||||
|
||||
void QLockFile::unlock()
|
||||
{
|
||||
Q_D(QLockFile);
|
||||
if (!d->isLocked)
|
||||
return;
|
||||
close(d->fileHandle);
|
||||
d->fileHandle = -1;
|
||||
if (!QFile::remove(d->fileName)) {
|
||||
qWarning() << "Could not remove our own lock file" << d->fileName << "maybe permissions changed meanwhile?";
|
||||
// This is bad because other users of this lock file will now have to wait for the stale-lock-timeout...
|
||||
}
|
||||
d->lockError = QLockFile::NoError;
|
||||
d->isLocked = false;
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
@@ -1,227 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2013 David Faure <faure+bluesystems@kde.org>
|
||||
** Copyright (C) 2015 The Qt Company Ltd.
|
||||
** Contact: http://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the QtCore module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL21$
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see http://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at http://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||
** General Public License version 2.1 or version 3 as published by the Free
|
||||
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
|
||||
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
|
||||
** following information to ensure the GNU Lesser General Public License
|
||||
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
|
||||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** As a special exception, The Qt Company gives you certain additional
|
||||
** rights. These rights are described in The Qt Company LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef _UNICODE
|
||||
#define _UNICODE
|
||||
#endif
|
||||
|
||||
#ifndef UNICODE
|
||||
#define UNICODE
|
||||
#endif
|
||||
|
||||
#include "qlockfile_p.h"
|
||||
|
||||
#include <qt_windows.h>
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QDir>
|
||||
#include <QFileInfo>
|
||||
#include <QDateTime>
|
||||
#include <QDebug>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
static inline QByteArray localHostName()
|
||||
{
|
||||
return qgetenv("COMPUTERNAME");
|
||||
}
|
||||
|
||||
static inline bool fileExists(const wchar_t *fileName)
|
||||
{
|
||||
WIN32_FILE_ATTRIBUTE_DATA data;
|
||||
return GetFileAttributesEx(fileName, GetFileExInfoStandard, &data);
|
||||
}
|
||||
|
||||
QLockFile::LockError QLockFilePrivate::tryLock_sys()
|
||||
{
|
||||
const ushort* nativePath = QDir::toNativeSeparators(fileName).utf16();
|
||||
// When writing, allow others to read.
|
||||
// When reading, QFile will allow others to read and write, all good.
|
||||
// Adding FILE_SHARE_DELETE would allow forceful deletion of stale files,
|
||||
// but Windows doesn't allow recreating it while this handle is open anyway,
|
||||
// so this would only create confusion (can't lock, but no lock file to read from).
|
||||
const DWORD dwShareMode = FILE_SHARE_READ;
|
||||
#ifndef Q_OS_WINRT
|
||||
SECURITY_ATTRIBUTES securityAtts = { sizeof(SECURITY_ATTRIBUTES), NULL, FALSE };
|
||||
HANDLE fh = CreateFile((const wchar_t*)nativePath,
|
||||
GENERIC_WRITE,
|
||||
dwShareMode,
|
||||
&securityAtts,
|
||||
CREATE_NEW, // error if already exists
|
||||
FILE_ATTRIBUTE_NORMAL,
|
||||
NULL);
|
||||
#else // !Q_OS_WINRT
|
||||
HANDLE fh = CreateFile2((const wchar_t*)nativePath,
|
||||
GENERIC_WRITE,
|
||||
dwShareMode,
|
||||
CREATE_NEW, // error if already exists
|
||||
NULL);
|
||||
#endif // Q_OS_WINRT
|
||||
if (fh == INVALID_HANDLE_VALUE) {
|
||||
const DWORD lastError = GetLastError();
|
||||
switch (lastError) {
|
||||
case ERROR_SHARING_VIOLATION:
|
||||
case ERROR_ALREADY_EXISTS:
|
||||
case ERROR_FILE_EXISTS:
|
||||
return QLockFile::LockFailedError;
|
||||
case ERROR_ACCESS_DENIED:
|
||||
// readonly file, or file still in use by another process.
|
||||
// Assume the latter if the file exists, since we don't create it readonly.
|
||||
return fileExists((const wchar_t*)nativePath)
|
||||
? QLockFile::LockFailedError
|
||||
: QLockFile::PermissionError;
|
||||
default:
|
||||
qWarning() << "Got unexpected locking error" << lastError;
|
||||
return QLockFile::UnknownError;
|
||||
}
|
||||
}
|
||||
|
||||
// We hold the lock, continue.
|
||||
fileHandle = fh;
|
||||
// Assemble data, to write in a single call to write
|
||||
// (otherwise we'd have to check every write call)
|
||||
QByteArray fileData;
|
||||
fileData += QByteArray::number(QCoreApplication::applicationPid());
|
||||
fileData += '\n';
|
||||
fileData += QCoreApplication::applicationName().toUtf8();
|
||||
fileData += '\n';
|
||||
fileData += localHostName();
|
||||
fileData += '\n';
|
||||
DWORD bytesWritten = 0;
|
||||
QLockFile::LockError error = QLockFile::NoError;
|
||||
if (!WriteFile(fh, fileData.constData(), fileData.size(), &bytesWritten, NULL) || !FlushFileBuffers(fh))
|
||||
error = QLockFile::UnknownError; // partition full
|
||||
return error;
|
||||
}
|
||||
|
||||
bool QLockFilePrivate::removeStaleLock()
|
||||
{
|
||||
// QFile::remove fails on Windows if the other process is still using the file, so it's not stale.
|
||||
return QFile::remove(fileName);
|
||||
}
|
||||
|
||||
bool QLockFilePrivate::isApparentlyStale() const
|
||||
{
|
||||
qint64 pid;
|
||||
QString hostname, appname;
|
||||
|
||||
// On WinRT there seems to be no way of obtaining information about other
|
||||
// processes due to sandboxing
|
||||
#ifndef Q_OS_WINRT
|
||||
if (getLockInfo(&pid, &hostname, &appname)) {
|
||||
if (hostname.isEmpty() || hostname == QString::fromLocal8Bit(localHostName())) {
|
||||
HANDLE procHandle = ::OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, pid);
|
||||
if (!procHandle)
|
||||
return true;
|
||||
// We got a handle but check if process is still alive
|
||||
DWORD dwR = ::WaitForSingleObject(procHandle, 0);
|
||||
::CloseHandle(procHandle);
|
||||
if (dwR == WAIT_TIMEOUT)
|
||||
return true;
|
||||
const QString processName = processNameByPid(pid);
|
||||
if (!processName.isEmpty() && processName != appname)
|
||||
return true; // PID got reused by a different application.
|
||||
}
|
||||
}
|
||||
#else // !Q_OS_WINRT
|
||||
Q_UNUSED(pid);
|
||||
Q_UNUSED(hostname);
|
||||
Q_UNUSED(appname);
|
||||
#endif // Q_OS_WINRT
|
||||
const qint64 age = QFileInfo(fileName).lastModified().msecsTo(QDateTime::currentDateTime());
|
||||
return staleLockTime > 0 && age > staleLockTime;
|
||||
}
|
||||
|
||||
QString QLockFilePrivate::processNameByPid(qint64 pid)
|
||||
{
|
||||
#if !defined(Q_OS_WINRT) && !defined(Q_OS_WINCE)
|
||||
typedef DWORD (WINAPI *GetModuleFileNameExFunc)(HANDLE, HMODULE, LPTSTR, DWORD);
|
||||
|
||||
HMODULE hPsapi = LoadLibraryA("psapi");
|
||||
if (!hPsapi)
|
||||
return QString();
|
||||
|
||||
GetModuleFileNameExFunc qGetModuleFileNameEx
|
||||
= (GetModuleFileNameExFunc)GetProcAddress(hPsapi, "GetModuleFileNameExW");
|
||||
if (!qGetModuleFileNameEx) {
|
||||
FreeLibrary(hPsapi);
|
||||
return QString();
|
||||
}
|
||||
|
||||
HANDLE hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, DWORD(pid));
|
||||
if (!hProcess) {
|
||||
FreeLibrary(hPsapi);
|
||||
return QString();
|
||||
}
|
||||
wchar_t buf[MAX_PATH];
|
||||
const DWORD length = qGetModuleFileNameEx(hProcess, NULL, buf, sizeof(buf) / sizeof(wchar_t));
|
||||
CloseHandle(hProcess);
|
||||
FreeLibrary(hPsapi);
|
||||
if (!length)
|
||||
return QString();
|
||||
QString name = QString::fromWCharArray(buf, length);
|
||||
int i = name.lastIndexOf(QLatin1Char('\\'));
|
||||
if (i >= 0)
|
||||
name.remove(0, i + 1);
|
||||
i = name.lastIndexOf(QLatin1Char('.'));
|
||||
if (i >= 0)
|
||||
name.truncate(i);
|
||||
return name;
|
||||
#else
|
||||
Q_UNUSED(pid);
|
||||
return QString();
|
||||
#endif
|
||||
}
|
||||
|
||||
void QLockFile::unlock()
|
||||
{
|
||||
Q_D(QLockFile);
|
||||
if (!d->isLocked)
|
||||
return;
|
||||
CloseHandle(d->fileHandle);
|
||||
int attempts = 0;
|
||||
static const int maxAttempts = 500; // 500ms
|
||||
while (!QFile::remove(d->fileName) && ++attempts < maxAttempts) {
|
||||
// Someone is reading the lock file right now (on Windows this prevents deleting it).
|
||||
QLockFileThread::msleep(1);
|
||||
}
|
||||
if (attempts == maxAttempts) {
|
||||
qWarning() << "Could not remove our own lock file" << d->fileName << ". Either other users of the lock file are reading it constantly for 500 ms, or we (no longer) have permissions to delete the file";
|
||||
// This is bad because other users of this lock file will now have to wait for the stale-lock-timeout...
|
||||
}
|
||||
d->lockError = QLockFile::NoError;
|
||||
d->isLocked = false;
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
@@ -1,452 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
|
||||
** Contact: http://www.qt-project.org/
|
||||
**
|
||||
** This file is part of the QtCore module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** GNU Lesser General Public License Usage
|
||||
** This file may be used under the terms of the GNU Lesser General Public
|
||||
** License version 2.1 as published by the Free Software Foundation and
|
||||
** appearing in the file LICENSE.LGPL included in the packaging of this
|
||||
** file. Please review the following information to ensure the GNU Lesser
|
||||
** General Public License version 2.1 requirements will be met:
|
||||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Nokia gives you certain additional
|
||||
** rights. These rights are described in the Nokia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU General
|
||||
** Public License version 3.0 as published by the Free Software Foundation
|
||||
** and appearing in the file LICENSE.GPL included in the packaging of this
|
||||
** file. Please review the following information to ensure the GNU General
|
||||
** Public License version 3.0 requirements will be met:
|
||||
** http://www.gnu.org/copyleft/gpl.html.
|
||||
**
|
||||
** Other Usage
|
||||
** Alternatively, this file may be used in accordance with the terms and
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include "qsavefile.h"
|
||||
#include "qsavefile_p.h"
|
||||
|
||||
#include <QAbstractFileEngine>
|
||||
#include <QFileInfo>
|
||||
#include <QTemporaryFile>
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
# include <windows.h>
|
||||
#else
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
QSaveFilePrivate::QSaveFilePrivate()
|
||||
: tempFile(0), error(QFile::NoError)
|
||||
{
|
||||
}
|
||||
|
||||
QSaveFilePrivate::~QSaveFilePrivate()
|
||||
{
|
||||
}
|
||||
|
||||
/*!
|
||||
\class QSaveFile
|
||||
\brief The QSaveFile class provides an interface for safely writing to files.
|
||||
|
||||
\ingroup io
|
||||
|
||||
\reentrant
|
||||
|
||||
QSaveFile is an I/O device for writing text and binary files, without losing
|
||||
existing data if the writing operation fails.
|
||||
|
||||
While writing, the contents will be written to a temporary file, and if
|
||||
no error happened, commit() will move it to the final file. This ensures that
|
||||
no data at the final file is lost in case an error happens while writing,
|
||||
and no partially-written file is ever present at the final location. Always
|
||||
use QSaveFile when saving entire documents to disk.
|
||||
|
||||
QSaveFile automatically detects errors while writing, such as the full partition
|
||||
situation, where write() cannot write all the bytes. It will remember that
|
||||
an error happened, and will discard the temporary file in commit().
|
||||
|
||||
Much like with QFile, the file is opened with open(). Data is usually read
|
||||
and written using QDataStream or QTextStream, but you can also call the
|
||||
QIODevice-inherited functions read(), readLine(), readAll(), write().
|
||||
|
||||
Unlike QFile, calling close() is not allowed. commit() replaces it. If commit()
|
||||
was not called and the QSaveFile instance is destroyed, the temporary file is
|
||||
discarded.
|
||||
|
||||
\sa QTextStream, QDataStream, QFileInfo, QDir, QFile, QTemporaryFile
|
||||
*/
|
||||
|
||||
/*!
|
||||
\internal
|
||||
*/
|
||||
QSaveFile::QSaveFile()
|
||||
: QIODevice(), d_ptr(new QSaveFilePrivate)
|
||||
{
|
||||
}
|
||||
/*!
|
||||
Constructs a new file object with the given \a parent.
|
||||
*/
|
||||
QSaveFile::QSaveFile(QObject *parent)
|
||||
: QIODevice(parent), d_ptr(new QSaveFilePrivate)
|
||||
{
|
||||
}
|
||||
/*!
|
||||
Constructs a new file object to represent the file with the given \a name.
|
||||
*/
|
||||
QSaveFile::QSaveFile(const QString &name)
|
||||
: QIODevice(0), d_ptr(new QSaveFilePrivate)
|
||||
{
|
||||
Q_D(QSaveFile);
|
||||
d->fileName = name;
|
||||
}
|
||||
/*!
|
||||
Constructs a new file object with the given \a parent to represent the
|
||||
file with the specified \a name.
|
||||
*/
|
||||
QSaveFile::QSaveFile(const QString &name, QObject *parent)
|
||||
: QIODevice(parent), d_ptr(new QSaveFilePrivate)
|
||||
{
|
||||
Q_D(QSaveFile);
|
||||
d->fileName = name;
|
||||
}
|
||||
|
||||
/*!
|
||||
Destroys the file object, discarding the saved contents unless commit() was called.
|
||||
*/
|
||||
QSaveFile::~QSaveFile()
|
||||
{
|
||||
Q_D(QSaveFile);
|
||||
if (d->tempFile) {
|
||||
d->tempFile->setAutoRemove(true);
|
||||
delete d->tempFile;
|
||||
}
|
||||
QIODevice::close();
|
||||
delete d;
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns false since temporary files support random access.
|
||||
|
||||
\sa QIODevice::isSequential()
|
||||
*/
|
||||
bool QSaveFile::isSequential() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the file error status.
|
||||
|
||||
The I/O device status returns an error code. For example, if open()
|
||||
returns false, or a read/write operation returns -1, this function can
|
||||
be called to find out the reason why the operation failed.
|
||||
|
||||
Unlike QFile which clears the error on the next operation, QSaveFile remembers
|
||||
the error until the file is closed, in order to discard the file contents in close().
|
||||
|
||||
\sa unsetError()
|
||||
*/
|
||||
|
||||
QFile::FileError QSaveFile::error() const
|
||||
{
|
||||
return d_func()->error;
|
||||
}
|
||||
|
||||
/*!
|
||||
Sets the file's error to QFile::NoError.
|
||||
|
||||
This will make QSaveFile forget that an error happened during saving, so you
|
||||
probably don't want to call this, unless you're really sure that you want to
|
||||
save the file anyway.
|
||||
|
||||
\sa error()
|
||||
*/
|
||||
void QSaveFile::unsetError()
|
||||
{
|
||||
d_func()->error = QFile::NoError;
|
||||
setErrorString(QString());
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the name set by setFileName() or to the QSaveFile
|
||||
constructor.
|
||||
|
||||
\sa setFileName()
|
||||
*/
|
||||
QString QSaveFile::fileName() const
|
||||
{
|
||||
return d_func()->fileName;
|
||||
}
|
||||
|
||||
/*!
|
||||
Sets the \a name of the file. The name can have no path, a
|
||||
relative path, or an absolute path.
|
||||
|
||||
\sa QFile::setFileName(), fileName()
|
||||
*/
|
||||
void QSaveFile::setFileName(const QString &name)
|
||||
{
|
||||
d_func()->fileName = name;
|
||||
}
|
||||
|
||||
/*!
|
||||
Opens the file using OpenMode \a mode, returning true if successful;
|
||||
otherwise false.
|
||||
|
||||
Important: the \a mode must be QIODevice::WriteOnly.
|
||||
It may also have additional flags, such as QIODevice::Text and QIODevice::Unbuffered.
|
||||
|
||||
QIODevice::ReadWrite and QIODevice::Append are not supported at the moment.
|
||||
|
||||
\sa QIODevice::OpenMode, setFileName()
|
||||
*/
|
||||
bool QSaveFile::open(OpenMode mode)
|
||||
{
|
||||
Q_D(QSaveFile);
|
||||
if (isOpen()) {
|
||||
qWarning("QSaveFile::open: File (%s) already open", qPrintable(fileName()));
|
||||
return false;
|
||||
}
|
||||
unsetError();
|
||||
if ((mode & (ReadOnly | WriteOnly)) == 0) {
|
||||
qWarning("QSaveFile::open: Open mode not specified");
|
||||
return false;
|
||||
}
|
||||
// In the future we could implement Append and ReadWrite by copying from the existing file to the temp file...
|
||||
if ((mode & ReadOnly) || (mode & Append)) {
|
||||
qWarning("QSaveFile::open: Unsupported open mode %d", int(mode));
|
||||
return false;
|
||||
}
|
||||
|
||||
// check if existing file is writable
|
||||
QFileInfo existingFile(d->fileName);
|
||||
if (existingFile.exists() && !existingFile.isWritable()) {
|
||||
d->error = QFile::WriteError;
|
||||
setErrorString(QSaveFile::tr("Existing file %1 is not writable").arg(d->fileName));
|
||||
return false;
|
||||
}
|
||||
d->tempFile = new QTemporaryFile;
|
||||
d->tempFile->setAutoRemove(false);
|
||||
d->tempFile->setFileTemplate(d->fileName);
|
||||
if (!d->tempFile->open()) {
|
||||
d->error = d->tempFile->error();
|
||||
setErrorString(d->tempFile->errorString());
|
||||
delete d->tempFile;
|
||||
d->tempFile = 0;
|
||||
return false;
|
||||
}
|
||||
QIODevice::open(mode);
|
||||
if (existingFile.exists())
|
||||
d->tempFile->setPermissions(existingFile.permissions());
|
||||
return true;
|
||||
}
|
||||
|
||||
/*!
|
||||
\reimp
|
||||
Cannot be called.
|
||||
Call commit() instead.
|
||||
*/
|
||||
void QSaveFile::close()
|
||||
{
|
||||
qFatal("QSaveFile::close called");
|
||||
}
|
||||
|
||||
/*
|
||||
Commits the changes to disk, if all previous writes were successful.
|
||||
|
||||
It is mandatory to call this at the end of the saving operation, otherwise the file will be
|
||||
discarded.
|
||||
|
||||
If an error happened during writing, deletes the temporary file and returns false.
|
||||
Otherwise, renames it to the final fileName and returns true on success.
|
||||
Finally, closes the device.
|
||||
|
||||
\sa cancelWriting()
|
||||
*/
|
||||
bool QSaveFile::commit()
|
||||
{
|
||||
Q_D(QSaveFile);
|
||||
if (!d->tempFile)
|
||||
return false;
|
||||
if (!isOpen()) {
|
||||
qWarning("QSaveFile::commit: File (%s) is not open", qPrintable(fileName()));
|
||||
return false;
|
||||
}
|
||||
flush();
|
||||
#ifdef Q_OS_WIN
|
||||
FlushFileBuffers(reinterpret_cast<HANDLE>(handle()));
|
||||
#elif defined(_POSIX_SYNCHRONIZED_IO) && _POSIX_SYNCHRONIZED_IO > 0
|
||||
fdatasync(d->tempFile->handle());
|
||||
#else
|
||||
fsync(d->tempFile->handle());
|
||||
#endif
|
||||
QIODevice::close();
|
||||
if (d->error != QFile::NoError) {
|
||||
d->tempFile->remove();
|
||||
unsetError();
|
||||
delete d->tempFile;
|
||||
d->tempFile = 0;
|
||||
return false;
|
||||
}
|
||||
d->tempFile->close();
|
||||
#ifdef Q_OS_WIN
|
||||
// On Windows QAbstractFileEngine::rename() fails if the the target exists,
|
||||
// so we have to rename the target.
|
||||
// Ideally the winapi ReplaceFile() method should be used.
|
||||
QString bakname = d->fileName + "~";
|
||||
QFile::remove(bakname);
|
||||
QFile::rename(d->fileName, bakname);
|
||||
#endif
|
||||
QAbstractFileEngine* fileEngine = d->tempFile->fileEngine();
|
||||
Q_ASSERT(fileEngine);
|
||||
if (!fileEngine->rename(d->fileName)) {
|
||||
d->error = fileEngine->error();
|
||||
setErrorString(fileEngine->errorString());
|
||||
d->tempFile->remove();
|
||||
delete d->tempFile;
|
||||
d->tempFile = 0;
|
||||
#ifdef Q_OS_WIN
|
||||
QFile::rename(bakname, d->fileName);
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
delete d->tempFile;
|
||||
d->tempFile = 0;
|
||||
#ifdef Q_OS_WIN
|
||||
QFile::remove(bakname);
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
/*!
|
||||
Sets an error code so that commit() discards the temporary file.
|
||||
|
||||
Further write operations are possible after calling this method, but none
|
||||
of it will have any effect, the written file will be discarded.
|
||||
|
||||
\sa commit()
|
||||
*/
|
||||
void QSaveFile::cancelWriting()
|
||||
{
|
||||
if (!isOpen())
|
||||
return;
|
||||
d_func()->error = QFile::WriteError;
|
||||
setErrorString(QSaveFile::tr("Writing canceled by application"));
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the size of the file.
|
||||
\sa QFile::size()
|
||||
*/
|
||||
qint64 QSaveFile::size() const
|
||||
{
|
||||
Q_D(const QSaveFile);
|
||||
return d->tempFile ? d->tempFile->size() : qint64(-1);
|
||||
}
|
||||
|
||||
/*!
|
||||
\reimp
|
||||
*/
|
||||
qint64 QSaveFile::pos() const
|
||||
{
|
||||
Q_D(const QSaveFile);
|
||||
return d->tempFile ? d->tempFile->pos() : qint64(-1);
|
||||
}
|
||||
|
||||
/*!
|
||||
\reimp
|
||||
*/
|
||||
bool QSaveFile::seek(qint64 offset)
|
||||
{
|
||||
Q_D(QSaveFile);
|
||||
return d->tempFile ? d->tempFile->seek(offset) : false;
|
||||
}
|
||||
|
||||
/*!
|
||||
\reimp
|
||||
*/
|
||||
bool QSaveFile::atEnd() const
|
||||
{
|
||||
Q_D(const QSaveFile);
|
||||
return d->tempFile ? d->tempFile->atEnd() : true;
|
||||
}
|
||||
|
||||
/*!
|
||||
Flushes any buffered data to the file. Returns true if successful;
|
||||
otherwise returns false.
|
||||
*/
|
||||
bool QSaveFile::flush()
|
||||
{
|
||||
Q_D(QSaveFile);
|
||||
if (d->tempFile) {
|
||||
if (!d->tempFile->flush()) {
|
||||
d->error = d->tempFile->error();
|
||||
setErrorString(d->tempFile->errorString());
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the file handle of the temporary file.
|
||||
|
||||
\sa QFile::handle()
|
||||
*/
|
||||
int QSaveFile::handle() const
|
||||
{
|
||||
Q_D(const QSaveFile);
|
||||
return d->tempFile ? d->tempFile->handle() : -1;
|
||||
}
|
||||
|
||||
/*!
|
||||
\reimp
|
||||
*/
|
||||
qint64 QSaveFile::readData(char *data, qint64 maxlen)
|
||||
{
|
||||
Q_D(QSaveFile);
|
||||
return d->tempFile ? d->tempFile->read(data, maxlen) : -1;
|
||||
}
|
||||
|
||||
/*!
|
||||
\reimp
|
||||
*/
|
||||
qint64 QSaveFile::writeData(const char *data, qint64 len)
|
||||
{
|
||||
Q_D(QSaveFile);
|
||||
if (!d->tempFile)
|
||||
return -1;
|
||||
const qint64 written = d->tempFile->write(data, len);
|
||||
if (written != len) {
|
||||
d->error = QFile::WriteError;
|
||||
setErrorString(QSaveFile::tr("Partial write. Partition full?"));
|
||||
}
|
||||
return written;
|
||||
}
|
||||
|
||||
/*!
|
||||
\reimp
|
||||
*/
|
||||
qint64 QSaveFile::readLineData(char *data, qint64 maxlen)
|
||||
{
|
||||
Q_D(QSaveFile);
|
||||
return d->tempFile ? d->tempFile->readLine(data, maxlen) : -1;
|
||||
}
|
||||
@@ -1,105 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
|
||||
** Contact: http://www.qt-project.org/
|
||||
**
|
||||
** This file is part of the QtCore module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** GNU Lesser General Public License Usage
|
||||
** This file may be used under the terms of the GNU Lesser General Public
|
||||
** License version 2.1 as published by the Free Software Foundation and
|
||||
** appearing in the file LICENSE.LGPL included in the packaging of this
|
||||
** file. Please review the following information to ensure the GNU Lesser
|
||||
** General Public License version 2.1 requirements will be met:
|
||||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Nokia gives you certain additional
|
||||
** rights. These rights are described in the Nokia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU General
|
||||
** Public License version 3.0 as published by the Free Software Foundation
|
||||
** and appearing in the file LICENSE.GPL included in the packaging of this
|
||||
** file. Please review the following information to ensure the GNU General
|
||||
** Public License version 3.0 requirements will be met:
|
||||
** http://www.gnu.org/copyleft/gpl.html.
|
||||
**
|
||||
** Other Usage
|
||||
** Alternatively, this file may be used in accordance with the terms and
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef QSAVEFILE_H
|
||||
#define QSAVEFILE_H
|
||||
|
||||
#include <QFile>
|
||||
#include <QString>
|
||||
|
||||
#ifdef open
|
||||
#error qsavefile.h must be included before any header file that defines open
|
||||
#endif
|
||||
|
||||
class QAbstractFileEngine;
|
||||
class QSaveFilePrivate;
|
||||
|
||||
class QSaveFile : public QIODevice
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_DECLARE_PRIVATE(QSaveFile)
|
||||
|
||||
public:
|
||||
|
||||
QSaveFile();
|
||||
explicit QSaveFile(const QString &name);
|
||||
explicit QSaveFile(QObject *parent);
|
||||
QSaveFile(const QString &name, QObject *parent);
|
||||
~QSaveFile();
|
||||
|
||||
QFile::FileError error() const;
|
||||
void unsetError();
|
||||
|
||||
QString fileName() const;
|
||||
void setFileName(const QString &name);
|
||||
|
||||
bool isSequential() const;
|
||||
|
||||
virtual bool open(OpenMode flags);
|
||||
bool commit();
|
||||
|
||||
void cancelWriting();
|
||||
|
||||
qint64 size() const;
|
||||
qint64 pos() const;
|
||||
bool seek(qint64 offset);
|
||||
bool atEnd() const;
|
||||
bool flush();
|
||||
|
||||
bool resize(qint64 sz);
|
||||
|
||||
int handle() const;
|
||||
|
||||
protected:
|
||||
qint64 readData(char *data, qint64 maxlen);
|
||||
qint64 writeData(const char *data, qint64 len);
|
||||
qint64 readLineData(char *data, qint64 maxlen);
|
||||
|
||||
private:
|
||||
virtual void close();
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(QSaveFile)
|
||||
|
||||
QSaveFilePrivate* const d_ptr;
|
||||
};
|
||||
|
||||
#endif // QSAVEFILE_H
|
||||
@@ -1,71 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
|
||||
** Contact: http://www.qt-project.org/
|
||||
**
|
||||
** This file is part of the QtCore module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** GNU Lesser General Public License Usage
|
||||
** This file may be used under the terms of the GNU Lesser General Public
|
||||
** License version 2.1 as published by the Free Software Foundation and
|
||||
** appearing in the file LICENSE.LGPL included in the packaging of this
|
||||
** file. Please review the following information to ensure the GNU Lesser
|
||||
** General Public License version 2.1 requirements will be met:
|
||||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Nokia gives you certain additional
|
||||
** rights. These rights are described in the Nokia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU General
|
||||
** Public License version 3.0 as published by the Free Software Foundation
|
||||
** and appearing in the file LICENSE.GPL included in the packaging of this
|
||||
** file. Please review the following information to ensure the GNU General
|
||||
** Public License version 3.0 requirements will be met:
|
||||
** http://www.gnu.org/copyleft/gpl.html.
|
||||
**
|
||||
** Other Usage
|
||||
** Alternatively, this file may be used in accordance with the terms and
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef QSAVEFILE_P_H
|
||||
#define QSAVEFILE_P_H
|
||||
|
||||
//
|
||||
// W A R N I N G
|
||||
// -------------
|
||||
//
|
||||
// This file is not part of the Qt API. It exists purely as an
|
||||
// implementation detail. This header file may change from version to
|
||||
// version without notice, or even be removed.
|
||||
//
|
||||
// We mean it.
|
||||
//
|
||||
|
||||
#include <QTemporaryFile>
|
||||
|
||||
class QSaveFilePrivate
|
||||
{
|
||||
public:
|
||||
QSaveFilePrivate();
|
||||
~QSaveFilePrivate();
|
||||
|
||||
QString fileName;
|
||||
QTemporaryFile *tempFile;
|
||||
|
||||
QFile::FileError error;
|
||||
};
|
||||
|
||||
#endif // QSAVEFILE_P_H
|
||||
|
||||
@@ -29,43 +29,6 @@ bool Crypto::m_initalized(false);
|
||||
QString Crypto::m_errorStr;
|
||||
QString Crypto::m_backendVersion;
|
||||
|
||||
#if !defined(GCRYPT_VERSION_NUMBER) || (GCRYPT_VERSION_NUMBER < 0x010600)
|
||||
static int gcry_qt_mutex_init(void** p_sys)
|
||||
{
|
||||
*p_sys = new QMutex();
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int gcry_qt_mutex_destroy(void** p_sys)
|
||||
{
|
||||
delete reinterpret_cast<QMutex*>(*p_sys);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int gcry_qt_mutex_lock(void** p_sys)
|
||||
{
|
||||
reinterpret_cast<QMutex*>(*p_sys)->lock();
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int gcry_qt_mutex_unlock(void** p_sys)
|
||||
{
|
||||
reinterpret_cast<QMutex*>(*p_sys)->unlock();
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct gcry_thread_cbs gcry_threads_qt =
|
||||
{
|
||||
GCRY_THREAD_OPTION_USER,
|
||||
0,
|
||||
gcry_qt_mutex_init,
|
||||
gcry_qt_mutex_destroy,
|
||||
gcry_qt_mutex_lock,
|
||||
gcry_qt_mutex_unlock,
|
||||
0, 0, 0, 0, 0, 0, 0, 0
|
||||
};
|
||||
#endif
|
||||
|
||||
Crypto::Crypto()
|
||||
{
|
||||
}
|
||||
@@ -77,10 +40,6 @@ bool Crypto::init()
|
||||
return true;
|
||||
}
|
||||
|
||||
// libgcrypt >= 1.6 doesn't allow custom thread callbacks anymore.
|
||||
#if !defined(GCRYPT_VERSION_NUMBER) || (GCRYPT_VERSION_NUMBER < 0x010600)
|
||||
gcry_control(GCRYCTL_SET_THREAD_CBS, &gcry_threads_qt);
|
||||
#endif
|
||||
m_backendVersion = QString::fromLocal8Bit(gcry_check_version(0));
|
||||
gcry_control(GCRYCTL_INITIALIZATION_FINISHED, 0);
|
||||
|
||||
@@ -121,23 +80,21 @@ bool Crypto::backendSelfTest()
|
||||
|
||||
bool Crypto::checkAlgorithms()
|
||||
{
|
||||
if (gcry_cipher_algo_info(GCRY_CIPHER_AES256, GCRYCTL_TEST_ALGO, Q_NULLPTR, Q_NULLPTR) != 0) {
|
||||
if (gcry_cipher_algo_info(GCRY_CIPHER_AES256, GCRYCTL_TEST_ALGO, nullptr, nullptr) != 0) {
|
||||
m_errorStr = "GCRY_CIPHER_AES256 not found.";
|
||||
qWarning("Crypto::checkAlgorithms: %s", qPrintable(m_errorStr));
|
||||
return false;
|
||||
}
|
||||
if (gcry_cipher_algo_info(GCRY_CIPHER_TWOFISH, GCRYCTL_TEST_ALGO, Q_NULLPTR, Q_NULLPTR) != 0) {
|
||||
if (gcry_cipher_algo_info(GCRY_CIPHER_TWOFISH, GCRYCTL_TEST_ALGO, nullptr, nullptr) != 0) {
|
||||
m_errorStr = "GCRY_CIPHER_TWOFISH not found.";
|
||||
qWarning("Crypto::checkAlgorithms: %s", qPrintable(m_errorStr));
|
||||
return false;
|
||||
}
|
||||
#ifdef GCRYPT_HAS_SALSA20
|
||||
if (gcry_cipher_algo_info(GCRY_CIPHER_SALSA20, GCRYCTL_TEST_ALGO, Q_NULLPTR, Q_NULLPTR) != 0) {
|
||||
if (gcry_cipher_algo_info(GCRY_CIPHER_SALSA20, GCRYCTL_TEST_ALGO, nullptr, nullptr) != 0) {
|
||||
m_errorStr = "GCRY_CIPHER_SALSA20 not found.";
|
||||
qWarning("Crypto::checkAlgorithms: %s", qPrintable(m_errorStr));
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
if (gcry_md_test_algo(GCRY_MD_SHA256) != 0) {
|
||||
m_errorStr = "GCRY_MD_SHA256 not found.";
|
||||
qWarning("Crypto::checkAlgorithms: %s", qPrintable(m_errorStr));
|
||||
|
||||
@@ -20,8 +20,6 @@
|
||||
|
||||
#include <QString>
|
||||
|
||||
#include "core/Global.h"
|
||||
|
||||
class Crypto
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -19,15 +19,16 @@
|
||||
|
||||
#include <gcrypt.h>
|
||||
|
||||
#include "core/Global.h"
|
||||
#include "crypto/Crypto.h"
|
||||
|
||||
class RandomBackendGcrypt : public RandomBackend
|
||||
{
|
||||
public:
|
||||
void randomize(void* data, int len) Q_DECL_OVERRIDE;
|
||||
void randomize(void* data, int len) override;
|
||||
};
|
||||
|
||||
Random* Random::m_instance(Q_NULLPTR);
|
||||
Random* Random::m_instance(nullptr);
|
||||
|
||||
void Random::randomize(QByteArray& ba)
|
||||
{
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
|
||||
#include "config-keepassx.h"
|
||||
#include "crypto/SymmetricCipherGcrypt.h"
|
||||
#include "crypto/SymmetricCipherSalsa20.h"
|
||||
|
||||
SymmetricCipher::SymmetricCipher(SymmetricCipher::Algorithm algo, SymmetricCipher::Mode mode,
|
||||
SymmetricCipher::Direction direction)
|
||||
@@ -61,19 +60,12 @@ SymmetricCipherBackend* SymmetricCipher::createBackend(SymmetricCipher::Algorith
|
||||
switch (algo) {
|
||||
case SymmetricCipher::Aes256:
|
||||
case SymmetricCipher::Twofish:
|
||||
#if defined(GCRYPT_HAS_SALSA20)
|
||||
case SymmetricCipher::Salsa20:
|
||||
#endif
|
||||
return new SymmetricCipherGcrypt(algo, mode, direction);
|
||||
|
||||
#if !defined(GCRYPT_HAS_SALSA20)
|
||||
case SymmetricCipher::Salsa20:
|
||||
return new SymmetricCipherSalsa20(algo, mode, direction);
|
||||
#endif
|
||||
|
||||
default:
|
||||
Q_ASSERT(false);
|
||||
return Q_NULLPTR;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
#include <QScopedPointer>
|
||||
#include <QString>
|
||||
|
||||
#include "core/Global.h"
|
||||
#include "crypto/SymmetricCipherBackend.h"
|
||||
|
||||
class SymmetricCipher
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
SymmetricCipherGcrypt::SymmetricCipherGcrypt(SymmetricCipher::Algorithm algo, SymmetricCipher::Mode mode,
|
||||
SymmetricCipher::Direction direction)
|
||||
: m_ctx(Q_NULLPTR)
|
||||
: m_ctx(nullptr)
|
||||
, m_algo(gcryptAlgo(algo))
|
||||
, m_mode(gcryptMode(mode))
|
||||
, m_direction(direction)
|
||||
@@ -44,10 +44,8 @@ int SymmetricCipherGcrypt::gcryptAlgo(SymmetricCipher::Algorithm algo)
|
||||
case SymmetricCipher::Twofish:
|
||||
return GCRY_CIPHER_TWOFISH;
|
||||
|
||||
#ifdef GCRYPT_HAS_SALSA20
|
||||
case SymmetricCipher::Salsa20:
|
||||
return GCRY_CIPHER_SALSA20;
|
||||
#endif
|
||||
|
||||
default:
|
||||
Q_ASSERT(false);
|
||||
@@ -95,7 +93,7 @@ bool SymmetricCipherGcrypt::init()
|
||||
}
|
||||
|
||||
size_t blockSizeT;
|
||||
error = gcry_cipher_algo_info(m_algo, GCRYCTL_GET_BLKLEN, Q_NULLPTR, &blockSizeT);
|
||||
error = gcry_cipher_algo_info(m_algo, GCRYCTL_GET_BLKLEN, nullptr, &blockSizeT);
|
||||
if (error != 0) {
|
||||
setErrorString(error);
|
||||
return false;
|
||||
@@ -163,10 +161,10 @@ bool SymmetricCipherGcrypt::processInPlace(QByteArray& data)
|
||||
gcry_error_t error;
|
||||
|
||||
if (m_direction == SymmetricCipher::Decrypt) {
|
||||
error = gcry_cipher_decrypt(m_ctx, data.data(), data.size(), Q_NULLPTR, 0);
|
||||
error = gcry_cipher_decrypt(m_ctx, data.data(), data.size(), nullptr, 0);
|
||||
}
|
||||
else {
|
||||
error = gcry_cipher_encrypt(m_ctx, data.data(), data.size(), Q_NULLPTR, 0);
|
||||
error = gcry_cipher_encrypt(m_ctx, data.data(), data.size(), nullptr, 0);
|
||||
}
|
||||
|
||||
if (error != 0) {
|
||||
@@ -188,7 +186,7 @@ bool SymmetricCipherGcrypt::processInPlace(QByteArray& data, quint64 rounds)
|
||||
|
||||
if (m_direction == SymmetricCipher::Decrypt) {
|
||||
for (quint64 i = 0; i != rounds; ++i) {
|
||||
error = gcry_cipher_decrypt(m_ctx, rawData, size, Q_NULLPTR, 0);
|
||||
error = gcry_cipher_decrypt(m_ctx, rawData, size, nullptr, 0);
|
||||
|
||||
if (error != 0) {
|
||||
setErrorString(error);
|
||||
@@ -198,7 +196,7 @@ bool SymmetricCipherGcrypt::processInPlace(QByteArray& data, quint64 rounds)
|
||||
}
|
||||
else {
|
||||
for (quint64 i = 0; i != rounds; ++i) {
|
||||
error = gcry_cipher_encrypt(m_ctx, rawData, size, Q_NULLPTR, 0);
|
||||
error = gcry_cipher_encrypt(m_ctx, rawData, size, nullptr, 0);
|
||||
|
||||
if (error != 0) {
|
||||
setErrorString(error);
|
||||
|
||||
@@ -1,260 +0,0 @@
|
||||
/* ecrypt-config.h */
|
||||
|
||||
/* *** Normally, it should not be necessary to edit this file. *** */
|
||||
|
||||
#ifndef ECRYPT_CONFIG
|
||||
#define ECRYPT_CONFIG
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
/* Guess the endianness of the target architecture. */
|
||||
|
||||
#include <QtGlobal>
|
||||
|
||||
#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN
|
||||
#define ECRYPT_LITTLE_ENDIAN
|
||||
#elif Q_BYTE_ORDER == Q_BIG_ENDIAN
|
||||
#define ECRYPT_BIG_ENDIAN
|
||||
#else
|
||||
#define ECRYPT_UNKNOWN
|
||||
#endif
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
/*
|
||||
* Find minimal-width types to store 8-bit, 16-bit, 32-bit, and 64-bit
|
||||
* integers.
|
||||
*
|
||||
* Note: to enable 64-bit types on 32-bit compilers, it might be
|
||||
* necessary to switch from ISO C90 mode to ISO C99 mode (e.g., gcc
|
||||
* -std=c99), or to allow compiler-specific extensions.
|
||||
*/
|
||||
|
||||
#include <limits.h>
|
||||
|
||||
/* --- check char --- */
|
||||
|
||||
#if (UCHAR_MAX / 0xFU > 0xFU)
|
||||
#ifndef I8T
|
||||
#define I8T char
|
||||
#define U8C(v) (v##U)
|
||||
|
||||
#if (UCHAR_MAX == 0xFFU)
|
||||
#define ECRYPT_I8T_IS_BYTE
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#if (UCHAR_MAX / 0xFFU > 0xFFU)
|
||||
#ifndef I16T
|
||||
#define I16T char
|
||||
#define U16C(v) (v##U)
|
||||
#endif
|
||||
|
||||
#if (UCHAR_MAX / 0xFFFFU > 0xFFFFU)
|
||||
#ifndef I32T
|
||||
#define I32T char
|
||||
#define U32C(v) (v##U)
|
||||
#endif
|
||||
|
||||
#if (UCHAR_MAX / 0xFFFFFFFFU > 0xFFFFFFFFU)
|
||||
#ifndef I64T
|
||||
#define I64T char
|
||||
#define U64C(v) (v##U)
|
||||
#define ECRYPT_NATIVE64
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* --- check short --- */
|
||||
|
||||
#if (USHRT_MAX / 0xFU > 0xFU)
|
||||
#ifndef I8T
|
||||
#define I8T short
|
||||
#define U8C(v) (v##U)
|
||||
|
||||
#if (USHRT_MAX == 0xFFU)
|
||||
#define ECRYPT_I8T_IS_BYTE
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#if (USHRT_MAX / 0xFFU > 0xFFU)
|
||||
#ifndef I16T
|
||||
#define I16T short
|
||||
#define U16C(v) (v##U)
|
||||
#endif
|
||||
|
||||
#if (USHRT_MAX / 0xFFFFU > 0xFFFFU)
|
||||
#ifndef I32T
|
||||
#define I32T short
|
||||
#define U32C(v) (v##U)
|
||||
#endif
|
||||
|
||||
#if (USHRT_MAX / 0xFFFFFFFFU > 0xFFFFFFFFU)
|
||||
#ifndef I64T
|
||||
#define I64T short
|
||||
#define U64C(v) (v##U)
|
||||
#define ECRYPT_NATIVE64
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* --- check int --- */
|
||||
|
||||
#if (UINT_MAX / 0xFU > 0xFU)
|
||||
#ifndef I8T
|
||||
#define I8T int
|
||||
#define U8C(v) (v##U)
|
||||
|
||||
#if (ULONG_MAX == 0xFFU)
|
||||
#define ECRYPT_I8T_IS_BYTE
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#if (UINT_MAX / 0xFFU > 0xFFU)
|
||||
#ifndef I16T
|
||||
#define I16T int
|
||||
#define U16C(v) (v##U)
|
||||
#endif
|
||||
|
||||
#if (UINT_MAX / 0xFFFFU > 0xFFFFU)
|
||||
#ifndef I32T
|
||||
#define I32T int
|
||||
#define U32C(v) (v##U)
|
||||
#endif
|
||||
|
||||
#if (UINT_MAX / 0xFFFFFFFFU > 0xFFFFFFFFU)
|
||||
#ifndef I64T
|
||||
#define I64T int
|
||||
#define U64C(v) (v##U)
|
||||
#define ECRYPT_NATIVE64
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* --- check long --- */
|
||||
|
||||
#if (ULONG_MAX / 0xFUL > 0xFUL)
|
||||
#ifndef I8T
|
||||
#define I8T long
|
||||
#define U8C(v) (v##UL)
|
||||
|
||||
#if (ULONG_MAX == 0xFFUL)
|
||||
#define ECRYPT_I8T_IS_BYTE
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#if (ULONG_MAX / 0xFFUL > 0xFFUL)
|
||||
#ifndef I16T
|
||||
#define I16T long
|
||||
#define U16C(v) (v##UL)
|
||||
#endif
|
||||
|
||||
#if (ULONG_MAX / 0xFFFFUL > 0xFFFFUL)
|
||||
#ifndef I32T
|
||||
#define I32T long
|
||||
#define U32C(v) (v##UL)
|
||||
#endif
|
||||
|
||||
#if (ULONG_MAX / 0xFFFFFFFFUL > 0xFFFFFFFFUL)
|
||||
#ifndef I64T
|
||||
#define I64T long
|
||||
#define U64C(v) (v##UL)
|
||||
#define ECRYPT_NATIVE64
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* --- check long long --- */
|
||||
|
||||
#ifdef ULLONG_MAX
|
||||
|
||||
#if (ULLONG_MAX / 0xFULL > 0xFULL)
|
||||
#ifndef I8T
|
||||
#define I8T long long
|
||||
#define U8C(v) (v##ULL)
|
||||
|
||||
#if (ULLONG_MAX == 0xFFULL)
|
||||
#define ECRYPT_I8T_IS_BYTE
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#if (ULLONG_MAX / 0xFFULL > 0xFFULL)
|
||||
#ifndef I16T
|
||||
#define I16T long long
|
||||
#define U16C(v) (v##ULL)
|
||||
#endif
|
||||
|
||||
#if (ULLONG_MAX / 0xFFFFULL > 0xFFFFULL)
|
||||
#ifndef I32T
|
||||
#define I32T long long
|
||||
#define U32C(v) (v##ULL)
|
||||
#endif
|
||||
|
||||
#if (ULLONG_MAX / 0xFFFFFFFFULL > 0xFFFFFFFFULL)
|
||||
#ifndef I64T
|
||||
#define I64T long long
|
||||
#define U64C(v) (v##ULL)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
/* --- check __int64 --- */
|
||||
|
||||
#if !defined(__STDC__) && defined(_UI64_MAX)
|
||||
|
||||
#ifndef I64T
|
||||
#define I64T __int64
|
||||
#define U64C(v) (v##ui64)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
/* find the largest type on this platform (used for alignment) */
|
||||
|
||||
#if defined(__SSE__) || (defined(_MSC_VER) && (_MSC_VER >= 1300))
|
||||
|
||||
#include <xmmintrin.h>
|
||||
#define MAXT __m128
|
||||
|
||||
#elif defined(__MMX__)
|
||||
|
||||
#include <mmintrin.h>
|
||||
#define MAXT __m64
|
||||
|
||||
#elif defined(__ALTIVEC__)
|
||||
|
||||
#define MAXT __vector int
|
||||
|
||||
#else
|
||||
|
||||
#define MAXT long
|
||||
|
||||
#endif
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
#endif
|
||||
@@ -1,49 +0,0 @@
|
||||
/* ecrypt-machine.h */
|
||||
|
||||
/*
|
||||
* This file is included by 'ecrypt-portable.h'. It allows to override
|
||||
* the default macros for specific platforms. Please carefully check
|
||||
* the machine code generated by your compiler (with optimisations
|
||||
* turned on) before deciding to edit this file.
|
||||
*/
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
#if (defined(ECRYPT_DEFAULT_ROT) && !defined(ECRYPT_MACHINE_ROT))
|
||||
|
||||
#define ECRYPT_MACHINE_ROT
|
||||
|
||||
#if (defined(WIN32) && defined(_MSC_VER))
|
||||
|
||||
#undef ROTL32
|
||||
#undef ROTR32
|
||||
#undef ROTL64
|
||||
#undef ROTR64
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#pragma intrinsic(_lrotl) /* compile rotations "inline" */
|
||||
#pragma intrinsic(_lrotr)
|
||||
|
||||
#define ROTL32(v, n) _lrotl(v, n)
|
||||
#define ROTR32(v, n) _lrotr(v, n)
|
||||
#define ROTL64(v, n) _rotl64(v, n)
|
||||
#define ROTR64(v, n) _rotr64(v, n)
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
#if (defined(ECRYPT_DEFAULT_SWAP) && !defined(ECRYPT_MACHINE_SWAP))
|
||||
|
||||
#define ECRYPT_MACHINE_SWAP
|
||||
|
||||
/*
|
||||
* If you want to overwrite the default swap macros, put it here. And so on.
|
||||
*/
|
||||
|
||||
#endif
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user