Commit Graph

70 Commits

Author SHA1 Message Date
Carlo Teubner
c70ebe6dce Fix memory leaks (mostly) in tests (#3922)
This makes most tests run successfully with asan.

The GUI tests still have a bunch of leaks, some from library code, and
some that look real but which I didn't immediately manage to figure out.

* TestOpVaultReader: use QSharedPointer
2019-12-21 09:25:17 -05:00
asapelkin
98badfb4a2 some cppcheck and clang-tidy fixies 2019-11-01 22:53:28 -04:00
Mark Hakansson
a876b3b72f Prompt to delete recycle bin when disabling it
Fixes #3365

Add prompt to delete the recycle bin when disabling it. If the user chooses not to delete it, the recycle bin will be suffixed with "(old)" and the icon changed to the default group icon.

Also moved recycle bin creation within the database class where it belongs.
2019-10-20 17:58:15 -04:00
Matthias Drexler
f85642741d Autocomplete usernames based on most frequent in database
* Fixes #3126
* Limit autocompletion to the top ten used usernames
- Load common usernames when database is opened
- Transition from QLineEdit to QComboBox for usernames
- Dropdown menu of the combobox lets user choose a common username
- Common usernames are autocompleted via inline completion
- Common usernames are sorted by frequency (first) and name (second)
2019-06-23 22:22:57 -04:00
Matthias Drexler
bb8377ae6a Allow setting group icons to children groups/entries (#3273)
* Add combo menu button to apply an icon to children

- allow more options to apply icons (child groups, child entries)
- extend tests in TestGroup (applying icons for groups/entries only)
- prevent blue folder icon being set for entries (on entry creation only)

* Do not show the combo menu button for entries
2019-06-19 10:02:07 -04:00
Balazs Gyurak
05c11d1b7c CLI: Add 'flatten' option to the 'ls' command (#3276)
* Fixes #925 
* Add 'flatten' option to CLI ls command
* Add test for Group::hierarchy() and man page for ls --flatten
* Rename group sort test to align with others
2019-06-18 20:42:19 -04:00
Balazs Gyurak
09181fab13 Add group sorting feature
* Enabling sorting of groups and their children in ascending and descending direction
2019-06-18 18:51:38 -04:00
Jonathan White
fb5faf0ff5
Ran make format 2019-03-19 18:56:17 -04:00
Aetf
e60f4278f7 Fix group signals (#2670)
* Fix group not emitting signals when modified through copyDataFrom
* Fix Group::GroupData equals wrongly compares timeInfo
2019-02-01 17:03:28 -05:00
Sami Vänttinen
891f67a1cd Select group when adding credentials from browser extension (#2637) 2019-01-30 09:48:22 -05:00
Jonathan White
fa687f246e
Fix issues with group functions (#2410) 2018-10-30 08:42:35 -04:00
Janek Bevendorff
bea31f9bcc Rename TestClock to MockClock and move it to the mock directory 2018-10-19 21:49:55 +02:00
Jonathan White
c1e9f45df9 Introduce synchronize merge method
* Create history-based merging that keeps older data in history instead of discarding or deleting it
* Extract merge logic into the Merger class
* Allows special merge behavior
* Improve handling of deletion and changes on groups
* Enable basic change tracking while merging
* Prevent unintended timestamp changes while merging
* Handle differences in timestamp precision
* Introduce comparison operators to allow for more sophisticated comparisons (ignore special properties, ...)
* Introduce Clock class to handle datetime across the app

Merge Strategies:
* Default (use inherited/fallback method)
* Duplicate (duplicate conflicting nodes, apply all deletions)
* KeepLocal (use local values, but apply all deletions)
* KeepRemote (use remote values, but apply all deletions)
* KeepNewer (merge history only)
* Synchronize (merge history, newest value stays on top, apply all deletions)
2018-09-30 09:36:39 -04:00
pasdam
ad4423d226
Replaced Uuid with QUuid 2018-07-06 22:23:49 -04:00
Louis-Bertrand Varin
8324d03f0a Formatting the code. 2018-03-31 16:01:30 -04:00
Janek Bevendorff
7a6850d5fe Move useful QTest template specializations to global header file
Fix KDBX test linker errors on Windows
2018-01-24 13:32:37 +01:00
Jonathan White
0141fa2f1c
Correct memory leaks in TestGroup.cpp 2017-12-12 23:46:25 -05:00
Jonathan White
28ad6ed552 Merge branch 'master' into develop 2017-12-11 21:10:25 -05:00
Michal Kaptur
0ff75e7a88 Fixed memory leaks in non-gui tests
Fixed 2 memory leaks in production code and a few in testcases. As a
result leak_check_at_exit ASAN option does not need to turned off for
non-gui tests.
Smart pointers should be used elsewhere for consistency, but the sooner
this fixes are delivered, the lesser memory leaks are introduced.
2017-11-27 23:36:09 +01:00
Louis-Bertrand Varin
f25c23c051 Adding tests for Group::clone 2017-11-21 14:24:24 -05:00
louib
6e1fd0694f CLI : basic entry manipulation commands. (#919)
* CLI : basic entry manipulation commands.

* Code review.
2017-09-06 09:14:41 -04:00
louib
1220b7d501 Feature : Update entries across groups when merging (#807)
* Feature : Update entries across groups when merging

* Styling
2017-09-05 10:28:47 -04:00
louib
b2107b5e27 Adding Locate command. (#829)
* Adding Locate command.

* Adding group searching in locate
2017-08-05 12:20:26 -04:00
louib
3b23e68540 Refactoring : Introducing Command class for CLI commands (#778) 2017-07-17 15:16:53 -04:00
louib
48ea024d7e Adding support for listing a group. (#652)
* Adding support for listing a group.

* added findGroupByPath

* Removing useless asserts.

* Code review.
2017-06-21 17:34:49 -04:00
thez3ro
a53b111182
Update and fix copyright headers 2017-06-14 15:54:43 +02:00
Louis-Bertrand Varin
eeafe77614 Find entry by title. 2017-05-21 13:51:16 -04:00
louib
54ad927044 Moving print group in Group class. (#586) 2017-05-21 13:05:44 -04:00
louib
a2e82dc883 Feature : clip command (#578) 2017-05-19 14:04:11 -04:00
Jonathan White
e25cd9ba48 Add Merge database utility function (#47)
Thank you to @TheZ3ro and @monomon for there major contributions to this PR!
2016-11-07 22:37:42 -05:00
Josef Vitu
ad36ec4dfd
Fix tests 2016-10-28 18:51:09 +02:00
Felix Geyer
ad834f0f58 Merge branch '2.0' 2016-10-02 21:45:55 -04: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
c8ae31a248 Remove backported Qt5 test macros. 2015-09-23 22:21:21 +02:00
Felix Geyer
0d6117bf4c Do some basic self-checks when initializing the crypto backend. 2014-06-15 11:17:40 +02:00
Florian Geyer
77af79498c Move QTEST_GUILESS_MAIN statements before test cases. 2014-05-16 12:32:52 +02:00
Florian Geyer
204cd8d971 Move exporter to separate class. 2014-05-16 12:07:22 +02:00
Florian Geyer
8bf4826003 Move search into separate class. 2014-05-15 23:50:40 +02:00
Felix Geyer
98c821df05 Add Group::exportToDb(). 2013-11-22 13:36:46 +01:00
Felix Geyer
f2dfef8c41 Add flags to Entry::clone() for customized cloning. 2013-11-22 13:32:13 +01:00
Felix Geyer
6504b6f2bd Drop Qt module name from include statements.
This is a preparation to be able to build KeePassX against Qt 5.
2013-10-03 15:18:16 +02:00
Felix Geyer
5786e2620a Add unit test for Metadata::copyCustomIcons(). 2013-04-07 19:38:18 +02:00
Felix Geyer
bee570c3cf Add Group::clone().
Move all the data we want to clone into a GroupData struct.
2013-04-04 21:48:55 +02:00
Felix Geyer
c7593a3047 Stop suppressing signals in Group dtor.
That way we emit entry/group removed signals.

Move cleanupParent() call to the bottom so we
maintain the group tree structure for objects that
connect to those signals.
2013-03-24 14:00:23 +01:00
Florian Geyer
92bf7c94d0 Whitespace separated search terms are AND concatenated. 2012-10-21 21:09:27 +02:00
Felix Geyer
6b13d18137 Rename KEEPASSX_QTEST_CORE_MAIN to QTEST_GUILESS_MAIN which is available in Qt 5. 2012-07-25 12:18:16 +02:00
Felix Geyer
33b4cd8636 Don't add new entries to EntryModel when in search mode.
Only allow moving entries from one group to the other.
2012-07-21 22:21:49 +02:00
Florian Geyer
60e65bec35 Add search test. 2012-05-13 19:21:23 +02:00
Felix Geyer
de4b90cdf1 Copy custom icons when moved to another database.
Closes #9
2012-04-27 11:22:02 +02:00
Florian Geyer
93c231ec2b Extend group test. 2012-04-25 19:41:46 +02:00