Compare commits

...

236 Commits

Author SHA1 Message Date
Jonathan White
e19559fe81 Merge pull request #29 from Manko10/develop
Update link to new upstream repository for pull requests
2016-10-05 18:51:34 -04:00
Janek Bevendorff
7dd30d4db1 Update link to new upstream repository for pull requests 2016-10-05 18:21:26 +02:00
Jonathan White
9b8b7b490a Merge branch 'keepassx_203' into develop 2016-10-02 21:51:08 -04:00
Felix Geyer
5ec9d0685d Finalize changelog. 2016-10-02 21:50:15 -04:00
Felix Geyer
004c412501 Update translations. 2016-10-02 21:50:15 -04:00
Felix Geyer
f05caf7623 Prepare for 2.0.3 release. 2016-10-02 21:50:15 -04:00
Jonathan White
7d165f133a Merge branch 'keepassx_master' into develop 2016-10-02 21:49:24 -04:00
Felix Geyer
fff9e7ac46 Convert Q_FOREACH loops to C++11 for loops.
Q_FOREACH will de deprecated soon.
2016-10-02 21:45:55 -04:00
Felix Geyer
ad834f0f58 Merge branch '2.0' 2016-10-02 21:45:55 -04:00
Felix Geyer
8a50ee8b22 Close database without asking when unmodified.
Don't ask for confirmation when closing/locking a database and
- it's in edit entry mode
- there haven't been any modifications

Refs #511
2016-10-02 21:45:54 -04:00
Felix Geyer
cf8186312a Refactor parts of EditEntryWidget::saveEntry() into updateEntryData(). 2016-10-02 21:45:54 -04:00
Felix Geyer
8f87b5cfd4 Split EditWidgetIcons::save() into state() and reset(). 2016-10-02 21:45:54 -04:00
Felix Geyer
61ce733c6f Make Entry::endUpdate() return whether the entry has been modified. 2016-10-02 21:45:54 -04:00
Felix Geyer
c78822f6e6 Merge branch '2.0' 2016-10-02 21:45:54 -04:00
Felix Geyer
a10a30f390 Fix name of Qt translation file.
In Qt5 it's qtbase_<lang> instead of qt_<lang>
2016-10-02 21:44:33 -04:00
Felix Geyer
7c7014d951 Drop obsolete GCRYPT_HAS_SALSA20 ifdef. 2016-10-02 21:44:33 -04:00
Jonathan White
dee331d52d Fixed Travis CI build process 2016-10-02 21:30:17 -04:00
Jonathan
2146392a2f Merge pull request #8 from daniellandau/save-with-ctrl-return
Save entry with ctrl+return keyboard shortcut
2016-10-02 10:10:33 -04:00
Jonathan White
e011a6eb25 Fixed typo from merge 2016-10-02 10:02:54 -04:00
Jonathan White
5eadd10612 Merge remote-tracking branch 'origin/keepassx_merge' 2016-09-29 22:37:45 -04:00
Felix Geyer
c2a80ce570 Remember auto-type window size.
Resize columns once when the entry list is set.

Based on https://github.com/keepassx/keepassx/pull/158

Closes #478
2016-09-29 22:08:37 -04:00
Felix Geyer
3415073051 Display an error message when opening the database fails.
Closes #462
2016-09-29 22:08:29 -04:00
Felix Geyer
ba68e0a4a1 Show proper error message when key is wrong for .kdb files. 2016-09-29 22:08:20 -04:00
Felix Geyer
8a7e98820a Fix typo.
# Conflicts:
#	src/format/KeePass2Reader.cpp
2016-09-29 22:08:10 -04:00
Felix Geyer
d61e4d69b5 Update optional dependencies in the README.
# Conflicts:
#	README.md
2016-09-29 22:05:32 -04:00
Felix Geyer
9b8912c483 Print libXtst instead of libXtest in the feature summary.
The protocol is called XTEST but the library libxtst.

Closes #440

# Conflicts:
#	src/autotype/CMakeLists.txt
2016-09-29 21:58:56 -04:00
Felix Geyer
878995366a Ask the user before moving an entry to the recycle bin.
Closes #447
2016-09-02 12:00:12 +02:00
Felix Geyer
1635a5211f Pass entryFlags to clone() when recursing into sub-groups.
Based on https://github.com/keepassx/keepassx/pull/178 by Mois Moshev <mois@monomon.me>

Closes #525
2016-09-02 11:47:22 +02:00
Felix Geyer
595b1011dd Refresh fileInfo after creating the file.
Fixes canonicalFilePath() returning an empty string.
2016-09-02 11:35:39 +02:00
Felix Geyer
9bb291235d Fix monospace font on Windows.
Closes #424
2016-09-02 11:35:39 +02:00
Felix Geyer
7d4ef0b8d0 Generate new password whenever the generator widget is opened.
Closes #414
2016-09-02 11:35:39 +02:00
Florian Geyer
8d16522d39 Repair UUID of inconsistent history items.
Closes #130
2016-08-03 23:48:40 +02:00
Felix Geyer
cd1192b409 Allow deleting the recycle bin.
Closes #46
2016-08-03 23:45:04 +02:00
Felix Geyer
bf2fd63131 Fix crash when deleting parent group of recycle bin.
In these cases delete the group instead of trying to move it to the recycle bin.

Closes #520
2016-08-03 23:27:02 +02:00
Daniel Landau
029da87346 Save and exit entry editing with Ctrl+Return
When the cursor is on most fields, you can use Return to end editing and
save, but on the Notes field Return just changes the line. This commit
adds a shortcut to the whole widget to save with Ctrl+Return, so that
saving and exiting is quick even when editing notes.
2016-08-02 16:10:54 +03:00
Felix Geyer
9532bedd7d Update min. length for password generator.
Update the minimum length for the password generator depending on the chosen
options.

Closes #420
2016-07-31 22:07:47 +02:00
Felix Geyer
e9c8363b70 Save to canonical file path so we don't overwrite symlinks.
When saving a database we previously replaced symlinks with a regular file.

Closes #442
2016-07-31 18:29:43 +02:00
Felix Geyer
fb57ed2bcd Add proper error handling when QSaveFile::open() fails.
Based on pull request by Valeriy <jazzvoid@gmail.com>

Closes #450
2016-07-31 17:07:31 +02:00
Felix Geyer
57ec558396 Detect image format solely on content.
Otherwise reading fails if the file extension is wrong.

Closes #512
2016-07-31 15:36:29 +02:00
Felix Geyer
6e2de1cd79 Display proper error message when reading an icon fails.
Refs #512
2016-07-31 14:44:45 +02:00
Felix Geyer
8ace3ab7f2 Don't consider windows with WithdrawnState as top level windows.
Fixes many bogus windows in auto-type window list when using gnome-shell.
2016-07-31 14:44:45 +02:00
Felix Geyer
18e4dca6c9 Explicitly include QFile in TestKeePass2Writer.
Closes #452
2016-07-31 14:44:45 +02:00
Jonathan White
99bb5d33f2 Incorporated fix for IPV6 remote server 2016-07-07 19:32:31 -04:00
Felix Geyer
d4ed4f9325 Remember auto-type window size.
Resize columns once when the entry list is set.

Based on https://github.com/keepassx/keepassx/pull/158

Closes #478
2016-05-25 16:55:06 +02:00
Jonathan White
bb2e1ee8da Revert "Fix IPv6 support and warn when binding fails"
Yikes this fix doesn't compile.
2016-05-24 02:21:17 -04:00
Jonathan White
51bfbc964e Fix IPv6 support and warn when binding fails
Thanks to @eugenesan
2016-05-24 02:12:33 -04:00
Felix Geyer
48eca3e11f Display an error message when opening the database fails.
Closes #462
2016-05-20 16:49:32 +02:00
Felix Geyer
57c1a0f4b6 Show proper error message when key is wrong for .kdb files. 2016-04-09 16:09:53 +02:00
Felix Geyer
bde4d63fdb Fix typo. 2016-04-09 16:02:49 +02:00
Jonathan White
cbb1269b39 Merge from eugenesan/keepassx to implement 1.8.4.1 improvements 2016-04-03 10:49:00 -04:00
Jonathan White
175167b311 Temporary fix for new keepasshttp version
Updates internal version number to prevent warnings on browser plugins. Does not implement host change protocol added in this version.
2016-03-26 09:09:35 -04:00
Jonathan White
029052fa18 Updated readme 2016-03-14 21:19:34 -04:00
Jonathan White
a454469949 Fixed test cases not building 2016-03-14 21:17:18 -04:00
Jonathan
0562ed720b Merge pull request #1 from liangwang/master
update header file for Qt5
2016-03-14 21:12:48 -04:00
Liang Wang
cbe8a9649c update header file for Qt5 2016-03-14 11:34:21 -04:00
Jonathan White
f48fdc1d71 Updated Readme 2016-02-28 11:00:05 -05:00
Jonathan White
7f7753a004 Fixed various Qt5 changes in the http code 2016-02-28 10:52:02 -05:00
Jonathan White
aba4fa94be Merge remote-tracking branch 'keepassx/master'
# Conflicts:
#	README.md
#	share/translations/keepassx_de.ts
#	src/CMakeLists.txt
#	src/gui/MainWindow.h
2016-02-27 19:11:09 -05:00
Felix Geyer
4eea7c8297 Remove KEEPASSX_EXPORT attribute from Tools::binaryFind().
It's an inline function. Declaring it as KEEPASSX_EXPORT breaks
building on Windows.

Closes #373
2016-02-13 11:54:54 +01:00
Felix Geyer
4867d26f7d Update optional dependencies in the README. 2016-02-13 11:24:11 +01:00
Felix Geyer
9bd3ab717e Print libXtst instead of libXtest in the feature summary.
The protocol is called XTEST but the library libxtst.

Closes #440
2016-02-13 11:13:15 +01:00
Felix Geyer
d6d92ce90a Merge branch '2.0' 2016-02-08 18:13:29 +01:00
Felix Geyer
3679b21701 Fix typo in changelog. 2016-02-02 01:22:48 +01:00
Felix Geyer
49f58b4ed8 Prepare 2.0.2 release. 2016-02-02 01:21:39 +01:00
Felix Geyer
235361faf4 Explicitly cast char constant to QChar. 2016-02-02 00:57:28 +01:00
Felix Geyer
208b803fbe Fix KeePass2Repair to retain multi-byte UTF-8 chars.
Since char is (often) unsigned the ch < 0x20 check matched all
multi-byte encoded UTF-8 chars.
2016-02-02 00:41:16 +01:00
Felix Geyer
8a92cec03f Keep valid surrogate pairs in stripInvalidXml10Chars(). 2016-02-02 00:38:58 +01:00
Felix Geyer
00f068b93e Fix typo in changelog. 2016-01-31 20:00:44 +01:00
Felix Geyer
654353e26b Update translations. 2016-01-31 19:03:25 +01:00
Felix Geyer
d670ef2638 Prepare for 2.0.1 release. 2016-01-31 18:49:35 +01:00
Felix Geyer
aff935b3c7 Properly handle a missing key filename. 2016-01-31 17:08:50 +01:00
Felix Geyer
107c0673c7 Make sure we don't write negative icon ids into the database. 2016-01-31 17:06:51 +01:00
Felix Geyer
c14d04b3e8 Fix crash when icon id is larger than INT_MAX.
In these cases icon id was interpreted as a negative number.
The QList access with a negative index resulted in a crash.
2016-01-31 16:44:34 +01:00
Felix Geyer
7a017041bf Allow opening databases that have no password and keyfile.
Closes #391
2016-01-31 16:17:24 +01:00
Felix Geyer
bfae81ec70 Use C++11 keyword directly in new methods. 2016-01-29 17:25:32 +01:00
Felix Geyer
71d4cb781d Merge branch '2.0' 2016-01-29 17:22:37 +01:00
Felix Geyer
eb56bd8973 Add repair functionality to strip invalid XML chars.
Refs #392
2016-01-28 23:07:04 +01:00
Felix Geyer
93585aded7 Always display scaled custom icons.
Closes #322
2016-01-26 22:44:38 +01:00
Felix Geyer
38245aa2a9 Add iconScaledPixmap() convenience functions. 2016-01-24 20:12:33 +01:00
Felix Geyer
1f33e6f044 Add Metadata::customIconScaledPixmap(). 2016-01-24 20:12:33 +01:00
Felix Geyer
4752adf9d3 Move pixmap caching to Metadata. 2016-01-24 20:12:21 +01:00
Felix Geyer
2d741afe3e Strip invalid XML chars when writing databases.
These characters are unprintable or just plain invalid.
QXmlStreamReader throws and error when reading XML documents with such chars.

Closes #392
2016-01-24 17:20:16 +01:00
Florian Geyer
5e6b17aba4 Disable password generator button when showing entry in history mode.
Closes #422
2016-01-22 22:55:28 +01:00
Florian Geyer
c51098e2cf Flush temporary file before opening attachment.
Closes #390
2015-12-16 21:38:20 +01:00
Felix Geyer
ecfbf72a57 Merge branch '2.0' 2015-12-15 21:05:00 +01:00
Felix Geyer
0c36c40a5d Make TestGui work with offscreen QPA.
For some reason hasFocus() returns true here.
Use isVisible() instead as it's a stronger check anyway.
2015-11-01 13:37:03 +01:00
Felix Geyer
6337e673f9 travis-ci: Restore accidentally removed cmake args. 2015-10-15 20:58:00 +02:00
Felix Geyer
e800892cc1 travis-ci: Install xvfb package to run the gui tests. 2015-10-15 20:56:39 +02:00
Felix Geyer
a21e893749 travis-ci: Switch to the Ubuntu trusty image. 2015-10-15 20:28:50 +02:00
Felix Geyer
dff3fc0572 Coding style fixes. 2015-10-15 18:02:31 +02:00
Felix Geyer
5de0ec94e0 Stop using deprecated methods from QtAlgorithms. 2015-10-13 22:52:07 +02:00
Felix Geyer
a408b01111 Add WITH_DEV_BUILD mode.
It disables/warns about deprecated methods.
2015-10-13 22:51:31 +02:00
Felix Geyer
6e45cf0dab Use C++11 keywords directly. 2015-10-11 10:47:30 +02:00
Felix Geyer
dc7b6623a9 Merge branch '2.0' 2015-10-11 10:44:30 +02:00
Frank Nießen
9484af5329 Minimize-On-Startup: call configuredMinimizeWindow() function of MainWindow to hide it after database is unlocked 2015-10-08 20:30:03 +02:00
Frank Nießen
3cf1a16398 Minimize-On-Startup: add function to minimize mainwindow if all four tray settings are true 2015-10-08 19:25:42 +02:00
Frank Nießen
0f0af12353 Minimize-On-Startup: get and set new setting from/to config object 2015-10-08 19:09:58 +02:00
Frank Nießen
7cb9a4ee4a Minimize-On-Startup: translation (de) for new checkbox in ui 2015-10-08 19:09:58 +02:00
Frank Nießen
28a1eb86da Minimize-On-Startup: new checkbox in ui 2015-10-08 19:09:41 +02:00
Frank Nießen
86f12d9e83 cleaner handling of TrayIconEnabled 2015-10-08 16:27:29 +02:00
Frank Nießen
539f86fd0b respect setting of parent checkboxes for minimizeToTray 2015-10-08 15:13:22 +02:00
Frank Nießen
c93b12ff05 better handling and display for systray checkbox buttons 2015-10-06 21:12:59 +02:00
Frank Nießen
319edca870 add translation for new checkbox button 2015-10-06 21:11:51 +02:00
Felix Geyer
5a59287927 Revert "travis-ci: Restore some sanity."
This reverts commit 20726ae75c.

The packages fail to install, probably conflict with some other
installed packages.
I can't be bothered to debug this. Let's hope Travis CI updates
the build environment to something more usable soon.
2015-09-27 23:20:27 +02:00
Felix Geyer
20726ae75c travis-ci: Restore some sanity. 2015-09-26 11:48:31 +02:00
Felix Geyer
3b2a39fd38 Merge branch '2.0' 2015-09-26 11:44:27 +02:00
Felix Geyer
c8ae31a248 Remove backported Qt5 test macros. 2015-09-23 22:21:21 +02:00
Florian Geyer
66a01e4fef Better output of translation file paths in cmake message. 2015-09-23 20:15:09 +02:00
Felix Geyer
d559db4fb1 Merge branch '2.0' 2015-09-21 23:23:51 +02:00
Felix Geyer
6f5871434d Update required version of build-dependencies.
Refs #350
2015-09-19 11:28:03 +02:00
Felix Geyer
685f249fd0 Merge remote-tracking branch 'github/pr/128'
https://github.com/keepassx/keepassx/pull/128
2015-09-19 11:22:17 +02:00
Nairolf21
26ccd577b5 Update dependencies to build KeepassX 2015-09-18 01:13:53 -07:00
Felix Geyer
5a13402b51 Activate window in TestGui.
It doesn't seem to get the focus automatically when run inside Xvfb.
QTRY_VERIFY(searchEdit->hasFocus()) failed as a result of this.
2015-09-12 23:12:17 +02:00
Felix Geyer
82aa02a980 travis-ci: Switch to Qt 5.4.2 ppa. 2015-09-12 21:46:15 +02:00
Felix Geyer
3dd98deecc Use QStandardPaths::DataLocation instead of AppDataLocation.
AppDataLocation is only available in Qt >= 5.4.
2015-09-12 18:41:48 +02:00
Felix Geyer
2e23fb203a Pass -std=c++11 to the C++ compiler unconditionally.
All supported compiler should understand it.
2015-09-12 16:16:18 +02:00
Felix Geyer
625e9a2547 Make TestGui agnostic to added "&" in tab title.
Fixes tests on OS X / Qt 5.5.0.
2015-09-12 15:48:38 +02:00
Felix Geyer
aab2b7df1c travis-ci: Remove conflicting libgcrypt11-dev package. 2015-09-12 15:43:18 +02:00
Felix Geyer
31bd44bec5 travis-ci: Output test failures on OS X. 2015-09-12 15:39:21 +02:00
Felix Geyer
11532b603a travis-ci: Use more force. 2015-09-12 15:38:48 +02:00
Felix Geyer
523c88b80d travis-ci: Install libgcrypt from Ubuntu 14.04.
This is getting really ugly but we need libgcrypt >= 1.6.
2015-09-12 15:31:24 +02:00
Felix Geyer
7cf1bb7e38 travis-ci: Pass Qt5 installation path to cmake. 2015-09-12 15:26:45 +02:00
Felix Geyer
eb9fdb43c1 travis-ci: install and use gcc 4.7.
gcc 4.6 doesn't support all C++11 feature we need.
2015-09-12 15:24:42 +02:00
Felix Geyer
0362f45547 Don't try to install homebrew packages that are already there.
brew install <existing package> returns an error code.
2015-09-12 14:43:37 +02:00
Felix Geyer
31f55fdb26 Install cmake binaries provided by upstream.
cmake 2.8.7 in Ubuntu 12.04 is too old.
2015-09-12 14:34:59 +02:00
Felix Geyer
26928a63e8 Try to work around travis providing an ancient build environment. 2015-09-12 14:12:27 +02:00
Paultergeist
abacec5787 Fixed compile error on Mac 2015-09-12 14:00:53 +02:00
Benjamin Robin
d84af2def0 Fix the open recent database menu.
With at least Qt 5.5 the action text is automatically modified from
/home/ben/db.kdbx to /&home/ben/db.kdbx

So add the path of the database to the action using setData

Signed-off-by: Benjamin Robin <dev@benjarobin.fr>
2015-09-12 14:00:03 +02:00
Felix Geyer
7fa0eddc5f Make C++11 mandatory. 2015-09-12 13:55:50 +02:00
Felix Geyer
0e85c98d02 Remove backported definitions from Global.h. 2015-09-12 13:51:49 +02:00
Felix Geyer
ae2b27d400 Connect rowsAboutToBeMoved() and rowsMoved() again.
Accidentally removed in 4fcce6f98f3d481514825ebdffc024c36bd5389c
2015-09-12 13:51:49 +02:00
Felix Geyer
7c424e1b85 Merge updated modeltest from Qt 5. 2015-09-12 13:51:49 +02:00
Felix Geyer
ba1ca4ec08 Rename x11 auto-type plugin to xcb.
This matches what QGuiApplication::platformName() returns.
2015-09-12 13:51:49 +02:00
Felix Geyer
20b13a4a2e Ger rid of last Qt 4 version check. 2015-09-12 13:51:49 +02:00
Felix Geyer
460b23b1eb Use QElapsedTimer everywhere. 2015-09-12 13:51:49 +02:00
Felix Geyer
9882f16614 Remove Tools::currentDateTimeUtc(). 2015-09-12 13:51:49 +02:00
Felix Geyer
60daa2b41b Require libgcrypt >= 1.6.0.
Remove our own Salsa20 implementation as libgcrypt ships one
with that version.
2015-09-12 13:51:49 +02:00
Felix Geyer
d81565df55 qttools5-dev-tools is also required for building on Debian. 2015-09-12 13:51:49 +02:00
Felix Geyer
e2ac176d3c Remove second argument of QSKIP call.
Has been removed in Qt 5.
2015-09-12 13:51:49 +02:00
Felix Geyer
ec8c0bb3e7 Setup new build dependencies. 2015-09-12 13:51:49 +02:00
Felix Geyer
b904fe5acd Adapt X11 auto-type plugin to handle xcb instead of xlib events. 2015-09-12 13:51:49 +02:00
Felix Geyer
3b07098731 Port native event filter to Qt 5. 2015-09-12 13:51:49 +02:00
Felix Geyer
03a330a4dd Port Tools::platform() to Qt 5.
The Q_WS_* definitions are gone.
2015-09-12 13:51:49 +02:00
Felix Geyer
6502da549b Fix build failure in AutoTypePlatformX11::SendEvent(). 2015-09-12 13:51:49 +02:00
Felix Geyer
a71e25a8ba Fix GUI tests. 2015-09-12 13:51:49 +02:00
Felix Geyer
9e05f41747 Port to Qt 5 plugin system. 2015-09-12 13:51:49 +02:00
Felix Geyer
208b0f39e6 Adapt to QtConcurrent being a separate module now. 2015-09-12 13:51:49 +02:00
Felix Geyer
5ad9edc3fd QDesktopServices::storageLocation() calls to QStandardPaths. 2015-09-12 13:51:49 +02:00
Felix Geyer
c714fc89f1 Add missing include statements. 2015-09-12 13:51:49 +02:00
Felix Geyer
e3cde7b55e Adapt to setSupportedDragActions() begin removed.
Models have a virtual supportedDragActions() now.
2015-09-12 13:51:49 +02:00
Felix Geyer
5a745da07b Remove QCOmmandLineParser.
It is part of Qt >= 5.2.
2015-09-12 13:51:49 +02:00
Felix Geyer
531018e58d Remove QSaveFile and QLockFile.
They are part of Qt >= 5.1.
2015-09-12 13:51:49 +02:00
Felix Geyer
813c64a055 Port cmake files to Qt 5. 2015-09-12 13:51:49 +02:00
denk-mal
0390c67c4d allow multiple databeses on command line 2015-06-23 11:40:54 +02:00
denk-mal
1f6161132e makr filename parameter as optinal 2015-06-23 11:22:15 +02:00
denk-mal
fc74e16097 add optionsfield to set http port 2015-06-22 14:11:15 +02:00
Frank Nießen
b03f54ffcd remove duplicate 'using namespace KeepassHttpProtocol' 2015-06-21 21:45:18 +02:00
Frank Nießen
26f33a1c12 add fake workaround for the nasty bahvior of QJSON 2015-06-21 21:43:20 +02:00
Frank Nießen
6e8aeea76d set error to response if list is empty (avoid ChromeIPass hanging) (reverted from commit c736ba7059) 2015-06-21 20:46:09 +02:00
denk-mal
c736ba7059 set error to response if list is empty (avoid ChromeIPass hanging) 2015-06-19 13:19:30 +02:00
denk-mal
3eb4b3b208 Sort switch statement to real order (easier code reading ;-) ) 2015-06-19 13:17:28 +02:00
denk-mal
5982763bed implement a (nonperfect) hide-to-tray on win close 2015-06-18 15:23:41 +02:00
denk-mal
6b7f7bb777 disable calls to missing m_cipher.isValid() 2015-06-18 15:22:25 +02:00
denk-mal
5b9338e40e set actual version of keepasshttp (1.8.4.0) 2015-06-18 13:13:50 +02:00
denk-mal
eab4861383 Call Init for request and response object to avoid crashes on first plugin contact 2015-06-18 12:58:28 +02:00
Ivan
4008e6ab58 Fixed compile issue with latest merged changes from upstream 2015-05-22 21:23:21 -07:00
Ivan
a115bbdc6f Merge branch 'master' of https://github.com/keepassx/keepassx 2015-05-22 21:06:32 -07:00
Ivan
33ed4fd7cf Merge branch 'master' of https://github.com/keepassx/keepassx 2015-05-12 11:03:48 -07:00
Ivan
d70ee509b4 Merge branch 'master' of https://github.com/keepassx/keepassx 2015-04-11 15:41:25 -07:00
Ivan
e20968bdfe Merge branch 'master' of https://github.com/keepassx/keepassx 2015-04-04 23:31:12 -07:00
IvanF
9e124e4a75 Removed unused qhttpserver code
Updated README.md
2015-01-30 00:58:52 -08:00
IvanF
db37b7b933 Updated README.md 2015-01-30 00:42:45 -08:00
IvanF
2e94066e50 Fixes to get code to compile with latest upstream. 2015-01-30 00:35:38 -08:00
IvanF
61c6962bf2 Deleted unused and unrelated files
Merged lots of changes from upstream that were missed or ignored
2015-01-30 00:29:01 -08:00
IvanF
9cbdd58af5 Fixed HTTP settings and service start-up 2015-01-30 00:04:27 -08:00
IvanF
eea9d7db97 Added http service start to MainWindow
Added http settings pane to SettingsWidget
Settings are probably broken still
2015-01-29 01:19:15 -08:00
IvanF
235baa3dcc Merge branch 'master' of https://github.com/keepassx/keepassx
Conflicts:
	README.md
	src/core/Config.cpp
	src/gui/DatabaseTabWidget.cpp
	src/gui/DatabaseTabWidget.h
	src/gui/DatabaseWidget.cpp
	src/gui/DatabaseWidget.h
	src/gui/MainWindow.cpp
	src/gui/MainWindow.h
	src/gui/MainWindow.ui
	src/gui/SearchWidget.ui
	src/gui/SettingsWidget.cpp
	src/gui/SettingsWidgetGeneral.ui
2015-01-29 00:17:39 -08:00
IvanF
f04f4302a2 Deleted local qjson, now using system qjson
Modified CmakeLists to require qjson
Replaced non-standard qjson calls with standard ones
2015-01-28 22:42:02 -08:00
Jascha Dachtera
65eb71e645 Merge branch 'master' of https://github.com/keepassx/keepassx 2014-05-02 21:29:12 +02:00
Jascha Dachtera
47e885ddbf Merge branch 'master' of https://github.com/jdachtera/keepassx 2014-04-18 13:59:58 +02:00
Jascha Dachtera
65626f0da2 Merge branch 'master' of https://github.com/keepassx/keepassx
Use SymmetricCipherGcrypt directly in Protocol.cpp to make it work with the latest master
revision.
2014-04-18 13:59:24 +02:00
Jascha Dachtera
8584901f9e Merge branch 'master' of https://github.com/keithbennett/keepassx
Use SymmetricCipherGcrypt directly in Protocol.cpp to make it work with the latest master
revision.
2014-04-18 13:51:45 +02:00
Keith Bennett
e2d446e446 Added back missing copyright notices. 2014-03-24 19:29:11 +00:00
Keith Bennett
54306473f3 Added README.md 2014-03-23 19:25:15 +00:00
Keith Bennett
c7158234dc Removed assert test for indexFromEntry.
When no row is selected, row equals -1. Some operations call
indexFromEntry when there is no row selected and these should
be allowed to succeed.
2014-03-23 19:09:49 +00:00
Keith Bennett
b28cb19ae3 Added keybinding for copy URL 2014-03-23 19:09:48 +00:00
Keith Bennett
86a01b6984 Ensure that external DB changes are always detected.
QFileSystemWatcher seems to reset itself occasionally. This patch
works around the issue by re-applying the QFileSystemWatcher
whenever a change is handled.
2014-03-23 19:09:48 +00:00
Keith Bennett
b432103b82 Return password quality to keepasshttp client. 2014-03-23 19:09:45 +00:00
Keith Bennett
75564c8fb5 Fixed password generation for keepasshttp 2014-03-23 19:09:43 +00:00
Keith Bennett
b87097a7ab Added global autotype support for OSX. 2014-03-23 17:25:40 +00:00
Keith Bennett
6ef5f34070 Split the new association message across multiple lines. 2014-03-23 17:25:40 +00:00
Keith Bennett
b953ea9042 Tidied up layout of the search field. 2014-03-23 17:25:40 +00:00
Keith Bennett
61ada66e3a Updated keepasshttp version number. 2014-03-23 17:25:39 +00:00
Keith Bennett
a9a724714f Stop qsearchfield from swallowing keypresses. 2014-03-23 17:25:39 +00:00
Keith Bennett
612ef0ef9b Fixed a typo. 2014-03-23 17:25:39 +00:00
Keith Bennett
a627870bbb Added a new DatabaseWidget modal state.
Commit d8857bf4 attempted to fix currentMode() while the DB had not
yet been opened. However, the fix meant that the title bar always
displayed the state as being "locked". This change works around the
issue by introducing a new modal state for when the DB is not yet
open.
2014-03-23 17:25:39 +00:00
Keith Bennett
fae4f69b8c Quieten compilation warnings. 2014-03-23 17:25:39 +00:00
Keith Bennett
b27ba03d42 Replaced qhttpserver with libmicrohttp.
The qhttpserver seems to be riddled with memory leaks and was
continuously crashing. I don't know Qt well enough to fix it so
I have replaced it with libmicrohttp. This is not nearly as
elegant but it is much more stable.
2014-03-23 17:25:39 +00:00
Keith Bennett
2cd6787141 Fixed compilation using qjson subtree. 2014-03-22 17:06:08 +00:00
Francois Ferrand
21204971ff re-apply: Cleaner qobject2qvariant(). 2014-03-22 17:06:08 +00:00
Keith Bennett
c570a13a1f Merge commit '5c71260c12798afe3c331d08477bb241acdb78ca' as 'src/http/qjson' 2014-03-22 17:05:45 +00:00
Keith Bennett
5c71260c12 Squashed 'src/http/qjson/' content from commit c6d92ba
git-subtree-dir: src/http/qjson
git-subtree-split: c6d92bada76be2c46dcf6f585f03b2fba47f9da3
2014-03-22 17:05:45 +00:00
Keith Bennett
e105970945 Removed qjson so we can replace it with a subtree. 2014-03-22 17:04:59 +00:00
Keith Bennett
0c33019f93 Fixed building of qocoa subtree. 2014-03-22 17:04:59 +00:00
Keith Bennett
16598a8386 Merge commit 'f52f6e2d44bc3a08a5b2fa281459af8baac68f0d' as 'src/gui/qocoa' 2014-03-22 17:02:43 +00:00
Keith Bennett
f52f6e2d44 Squashed 'src/gui/qocoa/' content from commit ffe23cb
git-subtree-dir: src/gui/qocoa
git-subtree-split: ffe23cbb2f221bc9eacd1de2134c2947fed71c12
2014-03-22 17:02:43 +00:00
Keith Bennett
304cebefe4 Removed qocoa so we can replace it with a subtree. 2014-03-22 17:01:53 +00:00
Keith Bennett
d7a8a43024 Temporary fixup for the password generator. 2014-03-22 17:01:52 +00:00
Keith Bennett
73f91db939 Merged keepassx-http. 2014-03-22 14:49:32 +00:00
Francois Ferrand
41be9e8178 Implement option to search all open databases. 2013-05-02 13:58:01 +02:00
Francois Ferrand
be24872bba Notifications pseudo-code. 2013-05-02 13:58:01 +02:00
Francois Ferrand
db56546871 Filter GetAllLogins entries, to return only entries with an URL. 2013-05-02 13:58:01 +02:00
Francois Ferrand
53b30e267c Fix entry partial matching rules. 2013-05-02 13:58:01 +02:00
Francois Ferrand
8f33c5235b Fix StringField copy. 2013-05-02 13:58:00 +02:00
Francois Ferrand
d8857bf42d Fix currentMode() while DB is not yet open. 2013-05-02 13:58:00 +02:00
Francois Ferrand
a85ac07576 Qocoa compilation fix for MacOS. 2013-05-02 13:58:00 +02:00
Francois Ferrand
d2ab008aa0 Auto-reload settings. 2013-04-30 17:31:08 +02:00
Francois Ferrand
f4ff8b17f7 Use search field for search.
Search options are presented in a context menu on the search field, as well as
links in search header.
2013-04-29 18:05:08 +02:00
Francois Ferrand
d5c8787451 Detect background changes to database file.
This gives the option to reload the database.

TODO:
 - Settings for reloadBehavior (ask, reloadUnchanged, ignore)
 - Improve notification, by using a header instead of dialog: nicer, less
intrusive, gives more options to user, and works better when multiple databases
are open.
 - Keep tab order on reload.
2013-04-29 09:11:26 +02:00
Francois Ferrand
850c7c7ecf Option to automatically reopen databases which were last opened. 2013-04-24 13:30:30 +02:00
Francois Ferrand
7ff475977e Favicon download button. 2013-04-22 11:25:01 +02:00
Francois Ferrand
478d30b529 Fix typo. 2013-04-19 17:20:26 +02:00
Francois Ferrand
d6597400de Support IPv6 as well as IPv4. 2013-04-19 11:30:11 +02:00
Francois Ferrand
af394ff65c Settings UI integration. 2013-04-19 11:29:46 +02:00
Francois Ferrand
f6fa6d6563 KeyPassX/Http settings. 2013-04-19 11:29:46 +02:00
Francois Ferrand
fd7a49f4a6 Sort entries. 2013-04-18 17:57:00 +02:00
Francois Ferrand
47d7598e99 Fix confirmation allowing access to all entries. 2013-04-18 17:57:00 +02:00
Francois Ferrand
e2ba754f91 Default icon. 2013-04-18 17:57:00 +02:00
Francois Ferrand
c98aad698a Cleanup reference/pointer declarations. 2013-04-18 17:57:00 +02:00
Francois Ferrand
75f0d132e5 Add removeSharedEncryptionKeys() and removeStoredPermissions() 2013-04-18 17:57:00 +02:00
Francois Ferrand
f82725139a Support "KPH: " extra fields. 2013-04-18 17:57:00 +02:00
Francois Ferrand
b9e58c77af Use splitter in 'Additional attributes'. 2013-04-12 15:18:10 +02:00
Francois Ferrand
ad67eac257 Confirmation dialog to list entries. 2013-04-12 15:17:56 +02:00
Francois Ferrand
eef51f26f0 Cleaner qobject2qvariant(). 2013-04-12 15:17:19 +02:00
Francois Ferrand
ea992bc3e6 Support KeyPassHttp protocol.
Allows using passIfox (firefox) and Chromeipass (chrome).
2013-04-12 15:16:56 +02:00
Francois Ferrand
20f3f23576 Customizable toolbar icon size. 2013-04-11 12:11:33 +02:00
247 changed files with 7587 additions and 6649 deletions

View File

@@ -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

View File

@@ -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)
=========================

View File

@@ -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)

View File

@@ -1,68 +1,35 @@
# KeePassX
# KeePassX v2.0.2 + keepasshttp
![alt text](https://travis-ci.org/keepassxreboot/keepassx.svg?branch=master "Travis-CI Badge")
## 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

View 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)

View File

@@ -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})

View File

@@ -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&apos;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&apos;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í 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>&quot;%1&quot; 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>&quot;%1&quot; 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 &quot;%1&quot; 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 &quot;%1&quot; 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&apos;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 &gt; 'Import KeePass 1 database'.
This is a one-way migration. You won&apos;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>

View File

@@ -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&apos;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 &gt; 'Import KeePass 1 database'.
This is a one-way migration. You won&apos;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 Database &gt; &apos;Importér KeePass 1 database&apos;.
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>

View File

@@ -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&apos;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 &quot;master keys&quot; gescheitert</translation>
</message>
<message>
<source>The selected file is an old KeePass 1 database (.kdb).
You can import it by clicking on Database &gt; 'Import KeePass 1 database'.
This is a one-way migration. You won&apos;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 &gt; &apos;KeePass 1 Datenbank importieren&apos;.
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>

View File

@@ -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&apos;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 &quot;%1&quot; 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&apos;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&apos;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&apos;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>

View File

@@ -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&apos;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 &gt; 'Import KeePass 1 database'.
This is a one-way migration. You won&apos;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 &apos;Base de datos&apos; &gt; &apos;Importar base de datos de Keepass 1&apos;.
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>

View File

@@ -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&apos;t open key file</source>
<translation>Impossible d&apos;ouvrir le fichier-clé</translation>
</message>
<message>
<source>Database opened fine. Nothing to do.</source>
<translation>La base de données s&apos;est bien ouverte. Aucune action à effectuer.</translation>
</message>
<message>
<source>Unable to open the database.</source>
<translation>Impossible d&apos;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 é 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&apos;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&apos;enregistrer le fichier attaché:
<translation>Impossible d&apos;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&apos;utilisateur :</translation>
<translation>Nom d&apos;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&apos;utilisateur</translation>
<translation>Nom d&apos;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&apos;est pas une base de donnée KeePass.</translation>
<translation>Ce n&apos;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&apos;est pas une base de donnée KeePass.</translation>
<translation>Ce n&apos;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 &gt; 'Import KeePass 1 database'.
This is a one-way migration. You won&apos;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&apos;importer en cliquant sur &quot;Base de données&quot; &gt; &quot;Importer une base de données KeePass 1&quot;.
Ceci est une migration à sens unique. Vous ne serez plus en mesure d&apos;ouvrir la base de données importée avec l&apos;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&apos;attribut dans le presse-papiers</translation>
<translation>Copier l&apos;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&apos;utilisateur dans le presse-papiers</translation>
<translation>Copier le nom d&apos;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&apos;est produite lors de l&apos;é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&apos;application</translation>
<translation>Paramètres de l&apos;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>

View File

@@ -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&apos;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 &gt; 'Import KeePass 1 database'.
This is a one-way migration. You won&apos;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 &gt; &apos;Impor basis data KeePass 1&apos;.
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>

View File

@@ -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&apos;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>&quot;%1&quot; was modified.
Save changes?</source>
<translation>&quot;%1&quot; è stata modificata.
<translation>&quot;%1&quot; è 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&apos;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&apos;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&apos;altra istanza di KeePassX.
<translation>Il database che stai tentando di salvare è bloccato da un&apos;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&apos;t delete icon!</source>
@@ -694,18 +736,18 @@ Vuoi salvare comunque?</translation>
</message>
<message numerus="yes">
<source>Can&apos;t delete icon. Still used by %n item(s).</source>
<translation><numerusform>Impossibile eliminare l&apos;icona in quanto è in uso da %n voce(i).</numerusform><numerusform>Impossibile eliminare l&apos;icona in quanto è in uso da %n voce(i).</numerusform></translation>
<translation><numerusform>Impossibile eliminare l&apos;icona in quanto è in uso da %n voce.</numerusform><numerusform>Impossibile eliminare l&apos;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 &gt; 'Import KeePass 1 database'.
This is a one-way migration. You won&apos;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 &gt; &apos;Importa database KeePass 1&apos;.
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 &apos;%1&apos;.</source>
@@ -1101,7 +1177,7 @@ Vuoi salvare comunque?</translation>
</message>
<message>
<source>Writing canceled by application</source>
<translation>Scrittura cancellata dall&apos;applicazione</translation>
<translation>Scrittura annullata dall&apos;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&apos;avvio</translation>
<translation>Apri il database precedente all&apos;avvio</translation>
</message>
<message>
<source>Automatically save on exit</source>
<translation>Salvare automaticamente all&apos;uscita</translation>
<translation>Salva automaticamente all&apos;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&apos;icona del gruppo alla creazione di una voce</translation>
<translation>Usa l&apos;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&apos;inattività di</translation>
<translation>Blocca i database dopo un&apos;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>

View File

@@ -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&apos;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&apos;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&apos;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>&quot;%1&quot; is in edit mode.
Discard changes and close anyway?</source>
<translation type="unfinished"/>
<translation>&quot;%1&quot; は現在編集モードです。
変更を破棄して閉じてしまってもよろしいですか?</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 &quot;%1&quot; for good?</source>
<translation type="unfinished"/>
<translation>本当にエントリー &quot;%1&quot; を永遠に消去しますか?</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&apos;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 &gt; 'Import KeePass 1 database'.
This is a one-way migration. You won&apos;t be able to open the imported database with the old KeePassX 0.4 version.</source>
<translation> KeePass 1 (.kdb)
&gt; &apos;KeePass 1 &apos;
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 &apos;%1&apos;.</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>

View File

@@ -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&apos;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 &gt; 'Import KeePass 1 database'.
This is a one-way migration. You won&apos;t be able to open the imported database with the old KeePassX 0.4 version.</source>
<translation> KeePass 1 (.kdb).
&gt; &apos;KeePass 1 &apos; .
, 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>

View File

@@ -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&apos;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&apos;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 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 į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ą 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&apos;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 &gt; 'Import KeePass 1 database'.
This is a one-way migration. You won&apos;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 importuoti, nuspausdami Duomenų bazė &gt; &quot;Importuoti KeePass 1 duomenų bazę&quot;.
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>

View File

@@ -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&apos;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 &gt; 'Import KeePass 1 database'.
This is a one-way migration. You won&apos;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 &gt; &apos;KeePass 1 database importeren&apos;.
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>

View File

@@ -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&apos;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&apos;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 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>&quot;%1&quot; was modified.
Save changes?</source>
<translation>&quot;%1&quot; został zmieniony. Zapisać zmiany ?</translation>
<translation>&quot;%1&quot; 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 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>&quot;%1&quot; is in edit mode.
Discard changes and close anyway?</source>
<translation type="unfinished"/>
<translation>&quot;%1&quot; 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&apos;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 &gt; 'Import KeePass 1 database'.
This is a one-way migration. You won&apos;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ć przez wybranie Baza &gt; &apos;Importuj bazę danych KeePass 1&apos;.
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>

View File

@@ -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&apos;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&apos;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>&quot;%1&quot; is in edit mode.
Discard changes and close anyway?</source>
<translation type="unfinished"/>
<translation>&quot;%1&quot; 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&apos;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 &gt; 'Import KeePass 1 database'.
This is a one-way migration. You won&apos;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 &gt; &apos;Importar banco de dados KeePass 1&apos;.
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>

View File

@@ -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&apos;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 &gt; 'Import KeePass 1 database'.
This is a one-way migration. You won&apos;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>

View File

@@ -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&apos;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 &gt; 'Import KeePass 1 database'.
This is a one-way migration. You won&apos;t be able to open the imported database with the old KeePassX 0.4 version.</source>
<translation>Выбранный файл от старой KeePass 1 базы данных (.kdb).
Вы можете импортировать его, нажав на База Данных &gt; &apos;Импорт KeePass 1 базы данных&apos;.
Это одностороннее перемещение. Вы не сможете открыть импортированный базу данных на старой версии 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>

View File

@@ -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&apos;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 &gt; 'Import KeePass 1 database'.
This is a one-way migration. You won&apos;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>

View File

@@ -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&apos;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 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 &gt; 'Import KeePass 1 database'.
This is a one-way migration. You won&apos;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 Databas &gt; 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 r programmet startar</translation>
</message>
<message>
<source>Automatically save on exit</source>
<translation>Spara automatiskt är applikationen anslutas</translation>
<translation>Spara automatiskt r applikationen anslutas</translation>
</message>
<message>
<source>Automatically save after every change</source>

View File

@@ -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&apos;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 &gt; 'Import KeePass 1 database'.
This is a one-way migration. You won&apos;t be able to open the imported database with the old KeePassX 0.4 version.</source>
<translation>Обрано файл сховища попередньої версії KeePass 1 (.kdb).
Ви можете імпортувати його, натиснувши Сховище &gt; &apos;Імпортувати сховище KeePass 1&apos;.
Це односторонній спосіб міграції. Ви не зможете відкрити імпортоване сховище в попередній версії 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>

View File

@@ -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&apos;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>&quot;%1&quot; is in edit mode.
Discard changes and close anyway?</source>
<translation type="unfinished"/>
<translation>正在编辑 &quot;%1&quot; 。
仍然要放弃修改并且关闭吗?</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 &gt; 'Import KeePass 1 database'.
This is a one-way migration. You won&apos;t be able to open the imported database with the old KeePassX 0.4 version.</source>
<translation> KeePass 1 .kdb
&gt; &apos;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>

View File

@@ -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&apos;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 &gt; 'Import KeePass 1 database'.
This is a one-way migration. You won&apos;t be able to open the imported database with the old KeePassX 0.4 version.</source>
<translation> KeePass 1 (.kdb)
&gt; 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>

View File

@@ -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}")

View File

@@ -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;

View File

@@ -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);

View File

@@ -66,7 +66,7 @@ public:
class KEEPASSX_EXPORT AutoTypeClearField : public AutoTypeAction
{
public:
explicit AutoTypeClearField();
AutoTypeClearField();
AutoTypeAction* clone();
void accept(AutoTypeExecutor* executor);
};

View File

@@ -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)

View File

@@ -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();

View File

@@ -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();

View File

@@ -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()

View File

@@ -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);

View File

@@ -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;

View File

@@ -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

View File

@@ -129,5 +129,3 @@ void AutoTypeExecturorTest::execKey(AutoTypeKey* action)
{
m_platform->addActionKey(action);
}
Q_EXPORT_PLUGIN2(keepassx-autotype-test, AutoTypePlatformTest)

View File

@@ -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;

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)

View File

@@ -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

View 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)

View File

@@ -16,6 +16,4 @@
#cmakedefine HAVE_RLIMIT_CORE 1
#cmakedefine HAVE_PT_DENY_ATTACH 1
#cmakedefine GCRYPT_HAS_SALSA20
#endif // KEEPASSX_CONFIG_KEEPASSX_H

View File

@@ -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);

View File

@@ -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()

View File

@@ -21,8 +21,6 @@
#include <QScopedPointer>
#include <QVariant>
#include "core/Global.h"
class QSettings;
class Config : public QObject

View File

@@ -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();

View File

@@ -20,6 +20,7 @@
#include <QDateTime>
#include <QHash>
#include <QObject>
#include "core/Uuid.h"
#include "keys/CompositeKey.h"

View File

@@ -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[] = {

View File

@@ -23,8 +23,6 @@
#include <QPixmapCache>
#include <QVector>
#include "core/Global.h"
class DatabaseIcons
{
public:

View File

@@ -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;
}
}

View File

@@ -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;
};

View File

@@ -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;

View File

@@ -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, "");
}

View File

@@ -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);

View File

@@ -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*>();
}

View File

@@ -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

View File

@@ -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)) {

View File

@@ -22,8 +22,6 @@
#include <QIcon>
#include <QString>
#include "core/Global.h"
class FilePath
{
public:

View File

@@ -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

View File

@@ -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);

View File

@@ -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;

View File

@@ -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();

View File

@@ -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)) {

View File

@@ -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;

View File

@@ -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) {

View File

@@ -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;

View File

@@ -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);
}
}

View File

@@ -21,8 +21,6 @@
#include <QObject>
#include <QPointer>
#include "core/Global.h"
class SignalMultiplexer
{
public:

View File

@@ -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;

View File

@@ -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

View File

@@ -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

View File

@@ -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;
}

View File

@@ -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());

View File

@@ -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;

View File

@@ -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;
}

View File

@@ -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

View File

@@ -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;
}

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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 */

View File

@@ -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

View File

@@ -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

View File

@@ -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;
}

View File

@@ -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

View File

@@ -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

View File

@@ -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));

View File

@@ -20,8 +20,6 @@
#include <QString>
#include "core/Global.h"
class Crypto
{
public:

View File

@@ -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)
{

View File

@@ -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;
}
}

View File

@@ -22,7 +22,6 @@
#include <QScopedPointer>
#include <QString>
#include "core/Global.h"
#include "crypto/SymmetricCipherBackend.h"
class SymmetricCipher

View File

@@ -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);

View File

@@ -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

View File

@@ -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