-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merge database tool #47
Conversation
the GUI. Add tests.
* Add a MergeMode for Groups, which determines what conflict resolution will do * Default to KeepNewer mode, to be in line with KeePass2 * MergeMode can be inherited * Add tests # Conflicts: # src/core/Group.cpp
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We must convert each Q_FOREACH to C++11 foreach.
And also check that all the UI fields have appropriate names and can be translated
Entry* Group::findEntry(const Uuid& uuid) | ||
{ | ||
Q_ASSERT(!uuid.isNull()); | ||
Q_FOREACH (Entry* entry, m_entries) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to convert Q_FOREACH to C++11 foreach. (Q_FOREACH will be deprecated soon)
void Group::merge(const Group* other) | ||
{ | ||
// merge entries | ||
Q_FOREACH (Entry* entry, other->entries()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same
} | ||
|
||
// merge groups (recursively) | ||
Q_FOREACH (Group* group, other->children()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same
|
||
Group* Group::findChildByName(const QString& name) | ||
{ | ||
Q_FOREACH (Group* group, m_children) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same
if (changedFiles.isEmpty()) | ||
return; | ||
|
||
Q_FOREACH (DatabaseManagerStruct dbStruct, m_dbList) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same
@@ -56,54 +56,80 @@ | |||
</widget> | |||
</item> | |||
<item row="5" column="0"> | |||
<widget class="QLabel" name="label_2"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name of this widget is generic (label_2
) should be something else with sense.
I've proposed a fix for the bugs I've found. |
Any news about this? |
I haven't actually compiled this and tried it out yet. I'll do that today and merge it in. Been really focused on the new search functionality 😉 |
Ok no problem 😉 |
@@ -271,7 +272,7 @@ void DatabaseTabWidget::checkReloadDatabases() | |||
if (changedFiles.isEmpty()) | |||
return; | |||
|
|||
Q_FOREACH (DatabaseManagerStruct dbStruct, m_dbList) { | |||
for (DatabaseManagerStruct dbStruct: asConst(m_dbList)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get a crash here when I try to autoreload a database.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you test if with the Q_FOREACH
works or crash as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Q_FOREACH does not crash.
I got a crash on autoreload, see comment above Also, when it asks if I want to "discard my changes and load new database" if I hit NO it should taint the current database file (ie, add the asterisk) so that it prompts to save on close. |
@droidmonkey for me crash with the following message: Also you are right about the tainting. |
* All gui tests are run on an unaltered starter database * All gui tests are self contained * Removed clearing of Search Widget text when hiding
* Searches are saved between databases * Search is cleared when all databases are closed * Implemented case sensitive and group searching
# Conflicts: # src/gui/MainWindow.cpp
…ture/merge-db-#22 * Reframed gui test case for merging based on fixed tests * Removed considerations for dbwidget search during merge with new search feature
…autoreload a file change.
I fixed all the issues noted, this is ready for a third set of eyes. I would still like to have tests written for the autoreload. |
Do you have rebased the #67 in this PR? (I see commit related to Search) |
Yah I merged the search changes in and there were several conflicts. We should approve search first then this one. |
I intend to add the auto reload tests tonight and merge this in. Last call! |
I am getting crashes all over the place with the autoreload feature. This needs a lot more work before it can be merged. It is a result of using the iterator to go over the db list... my fault |
Have you tried using for and removing the |
Based on my debugging of the autoreload, these crashes occurred prior to the C++ 11 transition. The whole autoreload process needs to be redone in a different manner because it leaves behind a mess in the inner workings of the app. I'm going to excise the auto reload part of this PR and move that code to its own feature branch. There is likely going to need a bit of replumbing in the way databases are loaded and metadata (in the tab widget) moved into proper classes. A lot of information gets out of sync by maintaining it in two different places. |
Nice to know. (Ironically) |
Description
This PR institutes a manner in which to merge an unopened database to the currently open and selected database. Fixes #22.
Motivation and Context
This is an oft-requested feature and has been coded and waiting in the KeePassX repository for several years.
How Has This Been Tested?
Types of changes
New feature (non-breaking change which adds functionality)
Checklist: