Skycoder42
7 years ago
No known key found for this signature in database
GPG Key ID: 8E01AD9EF0578D2B
4 changed files with
15 additions and
5 deletions
-
src/mvvmcore/settingsviewmodel.cpp
-
tests/auto/mvvmcore/settingsconfigloader/invalidDocument.xml
-
tests/auto/mvvmcore/settingsconfigloader/settingsconfigloader.pro
-
tests/auto/mvvmcore/settingsconfigloader/tst_settingsconfigloader.cpp
|
|
@ -2,7 +2,6 @@ |
|
|
|
#include "settingsviewmodel_p.h" |
|
|
|
#include "coreapp.h" |
|
|
|
#include "qtmvvm_logging_p.h" |
|
|
|
#include "settingssetuploader_p.h" |
|
|
|
#include "qsettingsaccessor.h" |
|
|
|
|
|
|
|
using namespace QtMvvm; |
|
|
@ -121,10 +120,9 @@ void QtMvvm::SettingsViewModel::setAccessor(ISettingsAccessor *accessor) |
|
|
|
this, &SettingsViewModel::valueChanged); |
|
|
|
disconnect(d->accessor, &ISettingsAccessor::entryRemoved, |
|
|
|
this, &SettingsViewModel::valueChanged); |
|
|
|
if(d->accessor->parent() == this) |
|
|
|
d->accessor->deleteLater(); |
|
|
|
} |
|
|
|
|
|
|
|
if(d->accessor->parent() == this) |
|
|
|
d->accessor->deleteLater(); |
|
|
|
d->accessor = accessor; |
|
|
|
|
|
|
|
if(d->accessor) { |
|
|
|
|
|
@ -0,0 +1,5 @@ |
|
|
|
<?xml version="1.0" encoding="UTF-8"?> |
|
|
|
<SettingsConfig> |
|
|
|
<Category/> |
|
|
|
<Section/> |
|
|
|
</SettingsConfig> |
|
|
@ -32,4 +32,5 @@ DISTFILES += \ |
|
|
|
includeDocument_section.xml \ |
|
|
|
includeDocument_group.xml \ |
|
|
|
includeDocument_entry.xml \ |
|
|
|
includeDocument_filtered.xml |
|
|
|
includeDocument_filtered.xml \ |
|
|
|
invalidDocument.xml |
|
|
|
|
|
@ -107,6 +107,12 @@ void SettingsConfigLoaderTest::testConfigLoader_data() |
|
|
|
<< QStringList{} |
|
|
|
<< true |
|
|
|
<< createIncludesSetup(); |
|
|
|
|
|
|
|
QTest::newRow("invalidDocument") << QStringLiteral(SRCDIR "/invalidDocument.xml") |
|
|
|
<< QStringLiteral("dummy") |
|
|
|
<< QStringList{} |
|
|
|
<< false |
|
|
|
<< Setup{}; |
|
|
|
} |
|
|
|
|
|
|
|
void SettingsConfigLoaderTest::testConfigLoader() |
|
|
|