Index: sources/view/VRxProfiles.cpp =================================================================== diff -u -rb4d8fe6f11b7cdf0c631b3ab35ba36f18e0d7bc4 -readfcc99876849e52370db5dde4c4c42d4dbc76f --- sources/view/VRxProfiles.cpp (.../VRxProfiles.cpp) (revision b4d8fe6f11b7cdf0c631b3ab35ba36f18e0d7bc4) +++ sources/view/VRxProfiles.cpp (.../VRxProfiles.cpp) (revision eadfcc99876849e52370db5dde4c4c42d4dbc76f) @@ -36,6 +36,7 @@ _rxProfilesModels(this) { connect (this, SIGNAL(didRxProfileList()), &_RxProfilesController, SLOT(doInitRxProfiles())); + connect (this, SIGNAL(didDeleteRxProfile(const QString &)), &_RxProfilesController, SLOT(doDeleteRxProfile(const QString &))); ACTION_METHOD_BRIDGE_CONNECTION(RxProfileList, _RxProfilesController, QList) @@ -68,9 +69,9 @@ emit didRxProfileList(); } -void VRxProfiles::doSave(const QStringList &vRxModel) +void VRxProfiles::doDeleteRxProfile(const QString &vRxProfileName) { - qDebug() << vRxModel; + emit didDeleteRxProfile(vRxProfileName) ; } /** @@ -92,13 +93,15 @@ emit modelChanged(); } -//void VRxProfiles::onRxProfileList(const QFileInfoList &vRxProfiles) -//{ -// qDebug() << "-meow-" << vRxProfiles; -// QStringList fileNames; -// for (const QFileInfo fileInfo:vRxProfiles){ -// fileNames << fileInfo.baseName().replace("_", " "); -// } -// rxProfilesList(fileNames); -// qDebug() << _rxProfilesList; -//} +bool VRxProfiles::doValidateProfileName(const QString &name) +{ + for (int row = 0; row < rxProfiles()->rowCount(); ++row) { + QModelIndex idx = rxProfiles()->index(row, 0); + if (rxProfiles()->data(idx, eDataRole_ProfileName).toString() == name + && (! _RxProfilesController.isEditMode(name) )) { + return false; + } + } + return true; +} +