From 3ec29d3b52181dbe20aacaff6290d40d89703d9c Mon Sep 17 00:00:00 2001 From: Jack Thomasson Date: Tue, 25 Oct 2016 10:18:23 -0600 Subject: [PATCH 1/6] search directory configured via environment use absolute path to database file --- utils/keepassx-kwallet | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/utils/keepassx-kwallet b/utils/keepassx-kwallet index 7fcb0af698..e0cdcda5e5 100755 --- a/utils/keepassx-kwallet +++ b/utils/keepassx-kwallet @@ -1,5 +1,8 @@ #!/bin/bash +### change the path to suit your installation or set KDBX_SEARCH before calling ### +: ${KDBX_SEARCH:=~/.KeePass/*.kdbx} + PROG="$(basename $0)" function daemon_main { @@ -11,8 +14,8 @@ function daemon_main { # fetch KeePass database passwords from kdewallet declare -A DBs - ### change the path to suit your installation ### - for DBPATH in ~/.keepassx/*.kdbx; do + for DBPATH in $KDBX_SEARCH; do + [[ -L "$DBPATH" ]] && DBPATH=$(readlink --canonicalize "$DBPATH") DBs[$DBPATH]=$(qdbus org.kde.kwalletd5 /modules/kwalletd5 org.kde.KWallet.readPassword "$handle" "Passwords" "$DBPATH" "$PROG") done From 6c7c5443d4e13d6155497cc6290148d1a3ffcc57 Mon Sep 17 00:00:00 2001 From: TheZ3ro Date: Wed, 26 Oct 2016 14:19:28 +0200 Subject: [PATCH 2/6] Updated Pull Request Template and Contribute documents * :memo: Update Installation instruction from the Wiki * :memo: Update PR template with emojis :tada: * :memo: Update CONTRIBUTING.md with CodeStyle --- .github/CONTRIBUTING.md | 54 +++++++++++++++- .github/PULL_REQUEST_TEMPLATE.md | 26 ++++---- INSTALL | 105 ++++++++++++++++++++++++++----- README.md | 48 +++----------- 4 files changed, 166 insertions(+), 67 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index e48474b823..f47f0141a5 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -108,7 +108,59 @@ Please join an existing language team or request a new one if there is none. This project follows the [Qt Coding Style](https://wiki.qt.io/Qt_Coding_Style). All submissions are expected to follow this style. -Addendum- Class member variables must start with ```m_``` +In particular Code must follow the following specific rules: + +#### Naming Convention +`lowerCamelCase` + +For names made of only one word, the fist letter is lowercase. +For names made of multiple concatenated words, the first letter is lowercase and each subsequent concatenated word is capitalized. + +#### Indention +For C++ files (.cpp .h): 4 spaces +For Qt-UI files (.ui): 2 spaces + +#### Pointers +```c +int* count; +``` + +#### Braces +```c +if (condition) { + doSomething(); +} + +void ExampleClass::exampleFunction() +{ + doSomething(); +} +``` + +#### Switch statement +```c +switch (a) { +case 1: + doSomething(); + break; + +default: + doSomethingElse(); + break; +} +``` + +#### Member variables +Use prefix: `m_*` + +Example: `m_variable` + +#### GUI Widget names +Widget names must be related to the desired program behaviour. +Preferably end the name with the Widget Classname + +Example: `` + [beginner]:https://github.com/keepassxreboot/keepassx/issues?q=is%3Aopen+is%3Aissue+label%3Abeginner+label%3A%22help+wanted%22+sort%3Acomments-desc diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 4f9ceac420..51436aada3 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -15,17 +15,21 @@ ## Screenshots (if appropriate): ## Types of changes - -- [ ] Bug fix (non-breaking change which fixes an issue) -- [ ] New feature (non-breaking change which adds functionality) -- [ ] Breaking change (fix or feature that would cause existing functionality to change) + + + +- :negative_squared_cross_mark: Bug fix (non-breaking change which fixes an issue) +- :negative_squared_cross_mark: New feature (non-breaking change which adds functionality) +- :negative_squared_cross_mark: Breaking change (fix or feature that would cause existing functionality to change) ## Checklist: - + + -- [ ] My code follows the code style of this project. -- [ ] My change requires a change to the documentation. -- [ ] I have updated the documentation accordingly. -- [ ] I have read the **CONTRIBUTING** document. -- [ ] I have added tests to cover my changes. -- [ ] All new and existing tests passed. + +- :negative_squared_cross_mark: I have read the **CONTRIBUTING** document. [REQUIRED] +- :negative_squared_cross_mark: My code follows the code style of this project. [REQUIRED] +- :negative_squared_cross_mark: All new and existing tests passed. [REQUIRED] +- :negative_squared_cross_mark: My change requires a change to the documentation. +- :negative_squared_cross_mark: I have updated the documentation accordingly. +- :negative_squared_cross_mark: I have added tests to cover my changes. diff --git a/INSTALL b/INSTALL index bde991bbd8..eca9cb47f3 100644 --- a/INSTALL +++ b/INSTALL @@ -1,28 +1,101 @@ -Building: -========= +Install KeePassXR +================= + +This document will guide you across the steps to install KeePassXR. +You can visit the online version of this document a the following link + +https://github.com/keepassxreboot/keepassx/wiki/Install-Instruction-from-Source + + +Build Dependencies +================== + +The following tools must exist within your PATH: + +* make +* cmake (>= 2.8.12) +* g++ (>= 4.7) or clang++ (>= 3.0) + +The following libraries are required: + +* Qt 5 (>= 5.2): qtbase and qttools5 +* libgcrypt (>= 1.6) +* zlib +* libmicrohttpd +* libxi, libxtst, qtx11extras (optional for auto-type on X11) + + +Prepare the Building Environment +================================ + +Building Environment on Linux ==> https://github.com/keepassxreboot/keepassx/wiki/Building-Environment-on-Linux +Building Environment on Windows ==> https://github.com/keepassxreboot/keepassx/wiki/Building-Environment-on-Windows +Building Environment on MacOS ==> https://github.com/keepassxreboot/keepassx/wiki/Building-Environment-on-MacOS + + +Build Steps +=========== + +To compile from source, open a **Terminal (on Linux/MacOS)** or a **MSYS2-MinGW shell (on Windows)**
+**Note:** on Windows make sure you are using a **MINGW shell** by checking the label before the current path + +Navigate to the path you have downloaded KeePassXR and type these commands: + +``` mkdir build cd build -cmake [CMAKE PARAMETERS] .. -make [-jX] +cmake -DWITH_TESTS=OFF +make +``` + +**Note:** If you are on MacOS you must add this parameter to **Cmake**, with the Qt version you have installed
`-DCMAKE_PREFIX_PATH=/usr/local/Cellar/qt5/5.6.2/lib/cmake/` -Common cmake parameters: -======================== +You will have the compiled KeePassXR binary inside the `./build/src/` directory. + +Common cmake parameters +``` -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_BUILD_TYPE= -DWITH_GUI_TESTS=ON +``` -Installing: -=========== -make install [DESTDIR=X] -Create a bundle on Mac: +Installation +============ + +To install this binary execute the following: + +```bash +sudo make install +``` + +You can specify the destination dir with +``` +DESTDIR=X +``` + + +Packaging +========= + +You can create a package to redistribute KeePassXR (zip, deb, rpm, dmg, etc..) +``` make package +``` + + +Testing +======= -Run tests: -========== -make test [CTEST_OUTPUT_ON_FAILURE=1] [ARGS+=-jX] [ARGS+="-E testgui"] +You can perform test on the executable +``` +make test +``` -OS specific instructions: -========================= -https://www.keepassx.org/dev/projects/keepassx/wiki/Install_instructions +Common parameters: +``` +CTEST_OUTPUT_ON_FAILURE=1 +ARGS+=-jX +ARGS+="-E testgui" +``` diff --git a/README.md b/README.md index eeda655efe..fee85865ac 100644 --- a/README.md +++ b/README.md @@ -15,54 +15,24 @@ KeePassHttp implementation has been forked from jdachtera's repository, which in 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.x. -#### Build Dependencies +### Installation -The following tools must exist within your PATH: +Right now KeePassXR does not have a precompiled executable or an installation package.
+So you must install it from its source code. -* make -* cmake (>= 2.8.12) -* g++ (>= 4.7) or clang++ (>= 3.0) +**More detailed instructions are available in the INSTALL file or at the [Wiki page](https://github.com/keepassxreboot/keepassx/wiki/Install-Instruction-from-Source).** -The following libraries are required: +First you must download the KeePassXR source code as ZIP file or with Git. -* Qt 5 (>= 5.2): qtbase and qttools5 -* libgcrypt (>= 1.6) -* zlib -* libmicrohttpd -* libxi, libxtst, qtx11extras (optional for auto-type on X11) - -On Debian/Ubuntu you can install them with: - -```bash -sudo apt-get install build-essential cmake libmicrohttpd-dev libxi-dev libxtst-dev qtbase5-dev libqt5x11extras5-dev qttools5-dev qttools5-dev-tools libgcrypt20-dev zlib1g-dev +Generally you can build and install KeePassXR with the following commands from a Terminal in the KeePassXR folder ``` - -On Fedora/RHEL/CentOS you can install them with: - -```bash -sudo dnf install make automake gcc gcc-c++ cmake libmicrohttpd-devel libXi-devel libXtst-devel qt5-qtbase-devel qt5-qtx11extras qt5-qttools libgcrypt-devel zlib-devel -``` - -#### Build Steps - -To compile from source: - -```bash mkdir build cd build -cmake -DWITH_TESTS=OFF .. -make [-jX] -``` - -You will have the compiled KeePassX binary inside the `./build/src/` directory. - -To install this binary execute the following: - -```bash +cmake -DWITH_TESTS=OFF +make sudo make install ``` -More detailed instructions available in the INSTALL file. ### Clone Repository @@ -80,10 +50,10 @@ To update the project from within the project's folder you can run the following git pull ``` + ### Contributing We're always looking for suggestions to improve our application. If you have a suggestion for improving an existing feature, or would like to suggest a completely new feature for KeePassX Reboot, please use the [Issues](https://github.com/keepassxreboot/keepassx/issues) section or our [Google Groups](https://groups.google.com/forum/#!forum/keepassx-reboot) forum. Please review the [CONTRIBUTING](.github/CONTRIBUTING.md) document for further information. - From 589b6465f8c250a0b49c8972ea5c2e7f262c455f Mon Sep 17 00:00:00 2001 From: thez3ro Date: Thu, 27 Oct 2016 19:28:39 +0200 Subject: [PATCH 3/6] :memo: Update CONTRIBUTING.md with Branch Strategy. close #24 [ci skip] --- .github/CONTRIBUTING.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index f47f0141a5..878119d31b 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -18,8 +18,9 @@ These are just guidelines, not rules. Use your best judgment, and feel free to p * [Translations](#translations) [Styleguides](#styleguides) + * [Git Branch Strategy](#git_branch_strategy) * [Git Commit Messages](#git-commit-messages) - * [C Styleguide](#c-styleguide) + * [Coding Styleguide](#coding-styleguide) ## What should I know before I get started? @@ -76,7 +77,7 @@ Both issue lists are sorted by total number of comments. While not perfect, numb Along with our desire to hear your feedback and suggestions, we're also interested in accepting direct assistance in the form of code. -All pull requests must comply with the above requirements. +All pull requests must comply with the above requirements and with the [Styleguides](#styleguides). ### Translations @@ -85,6 +86,15 @@ Please join an existing language team or request a new one if there is none. ## Styleguides +### Git Branch Strategy + +The Branch Strategy is based on [git-flow-lite](http://nvie.com/posts/a-successful-git-branching-model/). + +* **master** -> always points to the last release published +* **develop** -> points to the next planned release, tested and reviewed code +* **feature/**[name] -> points to brand new feature in codebase, candidate for merge into develop (subject to rebase) + + ### Git Commit Messages * Use the present tense ("Add feature" not "Added feature") From 6c3c0087dd58e8b56336f7e726392b0d5cb72b3d Mon Sep 17 00:00:00 2001 From: Josef Vitu Date: Tue, 25 Oct 2016 15:17:50 +0200 Subject: [PATCH 4/6] :lock: Implement automatic locking when minimizing --- src/core/Config.cpp | 1 + src/gui/MainWindow.cpp | 26 ++++++++++++++++++++------ src/gui/SettingsWidget.cpp | 2 ++ src/gui/SettingsWidgetSecurity.ui | 9 ++++++++- 4 files changed, 31 insertions(+), 7 deletions(-) diff --git a/src/core/Config.cpp b/src/core/Config.cpp index d9c737eb89..bad86a3e25 100644 --- a/src/core/Config.cpp +++ b/src/core/Config.cpp @@ -101,6 +101,7 @@ void Config::init(const QString& fileName) m_defaults.insert("security/clearclipboardtimeout", 10); m_defaults.insert("security/lockdatabaseidle", false); m_defaults.insert("security/lockdatabaseidlesec", 10); + m_defaults.insert("security/lockdatabaseminimize", false); m_defaults.insert("security/passwordscleartext", false); m_defaults.insert("security/autotypeask", true); m_defaults.insert("GUI/Language", "system"); diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index 031a6bc7cd..455d050efc 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -516,6 +516,11 @@ void MainWindow::closeEvent(QCloseEvent* event) { event->ignore(); hide(); + + if (config()->get("security/lockdatabaseminimize").toBool()) { + m_ui->tabWidget->lockDatabases(); + } + return; } @@ -534,12 +539,17 @@ void MainWindow::closeEvent(QCloseEvent* event) void MainWindow::changeEvent(QEvent* event) { - if ((event->type() == QEvent::WindowStateChange) && isMinimized() - && isTrayIconEnabled() && m_trayIcon && m_trayIcon->isVisible() - && config()->get("GUI/MinimizeToTray").toBool()) - { - event->ignore(); - QTimer::singleShot(0, this, SLOT(hide())); + if ((event->type() == QEvent::WindowStateChange) && isMinimized()) { + if (isTrayIconEnabled() && m_trayIcon && m_trayIcon->isVisible() + && config()->get("GUI/MinimizeToTray").toBool()) + { + event->ignore(); + QTimer::singleShot(0, this, SLOT(hide())); + } + + if (config()->get("security/lockdatabaseminimize").toBool()) { + m_ui->tabWidget->lockDatabases(); + } } else { QMainWindow::changeEvent(event); @@ -674,6 +684,10 @@ void MainWindow::toggleWindow() { if ((QApplication::activeWindow() == this) && isVisible() && !isMinimized()) { hide(); + + if (config()->get("security/lockdatabaseminimize").toBool()) { + m_ui->tabWidget->lockDatabases(); + } } else { ensurePolished(); diff --git a/src/gui/SettingsWidget.cpp b/src/gui/SettingsWidget.cpp index e0db813446..79ae0aa6d7 100644 --- a/src/gui/SettingsWidget.cpp +++ b/src/gui/SettingsWidget.cpp @@ -142,6 +142,7 @@ void SettingsWidget::loadSettings() m_secUi->lockDatabaseIdleCheckBox->setChecked(config()->get("security/lockdatabaseidle").toBool()); m_secUi->lockDatabaseIdleSpinBox->setValue(config()->get("security/lockdatabaseidlesec").toInt()); + m_secUi->lockDatabaseMinimizeCheckBox->setChecked(config()->get("security/lockdatabaseminimize").toBool()); m_secUi->passwordCleartextCheckBox->setChecked(config()->get("security/passwordscleartext").toBool()); @@ -185,6 +186,7 @@ void SettingsWidget::saveSettings() config()->set("security/lockdatabaseidle", m_secUi->lockDatabaseIdleCheckBox->isChecked()); config()->set("security/lockdatabaseidlesec", m_secUi->lockDatabaseIdleSpinBox->value()); + config()->set("security/lockdatabaseminimize", m_secUi->lockDatabaseMinimizeCheckBox->isChecked()); config()->set("security/passwordscleartext", m_secUi->passwordCleartextCheckBox->isChecked()); diff --git a/src/gui/SettingsWidgetSecurity.ui b/src/gui/SettingsWidgetSecurity.ui index b52e86238f..cb0da3fda4 100644 --- a/src/gui/SettingsWidgetSecurity.ui +++ b/src/gui/SettingsWidgetSecurity.ui @@ -58,13 +58,20 @@
+ + + Lock databases after minimizing the window + + + + Show passwords in cleartext by default - + Always ask before performing auto-type From 8f3ffdcc2a3723a03edcb465fb3e92d28b965493 Mon Sep 17 00:00:00 2001 From: Josef Vitu Date: Fri, 28 Oct 2016 15:25:57 +0200 Subject: [PATCH 5/6] Fix advanced HTTP settings (close #34) --- src/gui/SettingsWidget.cpp | 4 ---- src/http/HttpSettings.cpp | 2 +- src/http/OptionDialog.cpp | 2 ++ 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/gui/SettingsWidget.cpp b/src/gui/SettingsWidget.cpp index e0db813446..bf40a5faeb 100644 --- a/src/gui/SettingsWidget.cpp +++ b/src/gui/SettingsWidget.cpp @@ -23,10 +23,6 @@ #include "core/Config.h" #include "core/Translator.h" -#include "http/OptionDialog.h" - -#include "http/HttpSettings.h" - class SettingsWidget::ExtraPage { public: diff --git a/src/http/HttpSettings.cpp b/src/http/HttpSettings.cpp index dd0dd00f3e..0d6b6f1f16 100644 --- a/src/http/HttpSettings.cpp +++ b/src/http/HttpSettings.cpp @@ -103,7 +103,7 @@ bool HttpSettings::alwaysAllowUpdate() void HttpSettings::setAlwaysAllowUpdate(bool alwaysAllowUpdate) { - config()->set("Http/AlwaysAllowAccess", alwaysAllowUpdate); + config()->set("Http/AlwaysAllowUpdate", alwaysAllowUpdate); } bool HttpSettings::searchInAllDatabases() diff --git a/src/http/OptionDialog.cpp b/src/http/OptionDialog.cpp index 4d9d1f6c46..e92c6e1a57 100644 --- a/src/http/OptionDialog.cpp +++ b/src/http/OptionDialog.cpp @@ -57,6 +57,7 @@ void OptionDialog::loadSettings() ui->alwaysAllowAccess->setChecked(settings.alwaysAllowAccess()); ui->alwaysAllowUpdate->setChecked(settings.alwaysAllowUpdate()); ui->searchInAllDatabases->setChecked(settings.searchInAllDatabases()); + ui->supportKphFields->setChecked(settings.supportKphFields()); } void OptionDialog::saveSettings() @@ -85,4 +86,5 @@ void OptionDialog::saveSettings() settings.setAlwaysAllowAccess(ui->alwaysAllowAccess->isChecked()); settings.setAlwaysAllowUpdate(ui->alwaysAllowUpdate->isChecked()); settings.setSearchInAllDatabases(ui->searchInAllDatabases->isChecked()); + settings.setSupportKphFields(ui->supportKphFields->isChecked()); } From ad36ec4dfda686f83868c77098b4fe7831f7531e Mon Sep 17 00:00:00 2001 From: Josef Vitu Date: Fri, 28 Oct 2016 18:49:51 +0200 Subject: [PATCH 6/6] Fix tests --- tests/TestCsvExporter.cpp | 2 +- tests/TestCsvExporter.h | 2 +- tests/TestEntry.cpp | 12 ++++++++++-- tests/TestGroup.cpp | 3 +++ tests/TestWildcardMatcher.cpp | 6 ++++++ tests/TestWildcardMatcher.h | 1 + 6 files changed, 22 insertions(+), 4 deletions(-) diff --git a/tests/TestCsvExporter.cpp b/tests/TestCsvExporter.cpp index 1fa6634772..6515c39c2a 100644 --- a/tests/TestCsvExporter.cpp +++ b/tests/TestCsvExporter.cpp @@ -42,7 +42,7 @@ void TestCsvExporter::initTestCase() Crypto::init(); } -void TestCsvExporter::cleanUp() +void TestCsvExporter::cleanup() { delete m_db; delete m_csvExporter; diff --git a/tests/TestCsvExporter.h b/tests/TestCsvExporter.h index c8cc4dc101..a8cfe7f257 100644 --- a/tests/TestCsvExporter.h +++ b/tests/TestCsvExporter.h @@ -34,7 +34,7 @@ class TestCsvExporter : public QObject private Q_SLOTS: void init(); void initTestCase(); - void cleanUp(); + void cleanup(); void testExport(); void testEmptyDatabase(); void testNestedGroups(); diff --git a/tests/TestEntry.cpp b/tests/TestEntry.cpp index 1eaca32434..4d34cf31bb 100644 --- a/tests/TestEntry.cpp +++ b/tests/TestEntry.cpp @@ -79,6 +79,8 @@ void TestEntry::testCopyDataFrom() QCOMPARE(entry2->autoTypeAssociations()->size(), 2); QCOMPARE(entry2->autoTypeAssociations()->get(0).window, QString("1")); QCOMPARE(entry2->autoTypeAssociations()->get(1).window, QString("3")); + + delete entry2; } void TestEntry::testClone() @@ -101,6 +103,7 @@ void TestEntry::testClone() QCOMPARE(entryCloneNone->title(), QString("New Title")); QCOMPARE(entryCloneNone->historyItems().size(), 0); QCOMPARE(entryCloneNone->timeInfo().creationTime(), entryOrg->timeInfo().creationTime()); + delete entryCloneNone; Entry* entryCloneNewUuid = entryOrg->clone(Entry::CloneNewUuid); QVERIFY(entryCloneNewUuid->uuid() != entryOrg->uuid()); @@ -108,17 +111,22 @@ void TestEntry::testClone() QCOMPARE(entryCloneNewUuid->title(), QString("New Title")); QCOMPARE(entryCloneNewUuid->historyItems().size(), 0); QCOMPARE(entryCloneNewUuid->timeInfo().creationTime(), entryOrg->timeInfo().creationTime()); + delete entryCloneNewUuid; Entry* entryCloneResetTime = entryOrg->clone(Entry::CloneResetTimeInfo); - QCOMPARE(entryCloneNone->uuid(), entryOrg->uuid()); + QCOMPARE(entryCloneResetTime->uuid(), entryOrg->uuid()); QCOMPARE(entryCloneResetTime->title(), QString("New Title")); QCOMPARE(entryCloneResetTime->historyItems().size(), 0); QVERIFY(entryCloneResetTime->timeInfo().creationTime() != entryOrg->timeInfo().creationTime()); + delete entryCloneResetTime; Entry* entryCloneHistory = entryOrg->clone(Entry::CloneIncludeHistory); - QCOMPARE(entryCloneNone->uuid(), entryOrg->uuid()); + QCOMPARE(entryCloneHistory->uuid(), entryOrg->uuid()); QCOMPARE(entryCloneHistory->title(), QString("New Title")); QCOMPARE(entryCloneHistory->historyItems().size(), 1); QCOMPARE(entryCloneHistory->historyItems().at(0)->title(), QString("Original Title")); QCOMPARE(entryCloneHistory->timeInfo().creationTime(), entryOrg->timeInfo().creationTime()); + delete entryCloneHistory; + + delete entryOrg; } diff --git a/tests/TestGroup.cpp b/tests/TestGroup.cpp index a923776de3..e271abfc00 100644 --- a/tests/TestGroup.cpp +++ b/tests/TestGroup.cpp @@ -445,4 +445,7 @@ void TestGroup::testCopyCustomIcons() QCOMPARE(metaTarget->customIcon(group1Icon).pixel(0, 0), qRgb(1, 2, 3)); QCOMPARE(metaTarget->customIcon(group2Icon).pixel(0, 0), qRgb(4, 5, 6)); + + delete dbTarget; + delete dbSource; } diff --git a/tests/TestWildcardMatcher.cpp b/tests/TestWildcardMatcher.cpp index dffe1c8540..621dc898ee 100644 --- a/tests/TestWildcardMatcher.cpp +++ b/tests/TestWildcardMatcher.cpp @@ -55,6 +55,7 @@ void TestWildcardMatcher::testMatcher() initMatcher(text); verifyMatchResult(pattern, match); + cleanupMatcher(); } void TestWildcardMatcher::initMatcher(QString text) @@ -62,6 +63,11 @@ void TestWildcardMatcher::initMatcher(QString text) m_matcher = new WildcardMatcher(text); } +void TestWildcardMatcher::cleanupMatcher() +{ + delete m_matcher; +} + void TestWildcardMatcher::verifyMatchResult(QString pattern, bool expected) { if (expected) { diff --git a/tests/TestWildcardMatcher.h b/tests/TestWildcardMatcher.h index a1f8b5f561..c241c7553a 100644 --- a/tests/TestWildcardMatcher.h +++ b/tests/TestWildcardMatcher.h @@ -35,6 +35,7 @@ private Q_SLOTS: static const QString AlternativeText; void initMatcher(QString text); + void cleanupMatcher(); void verifyMatchResult(QString pattern, bool expected); void verifyMatch(QString pattern); void verifyNoMatch(QString pattern);