Index: sources/device/DeviceController.cpp =================================================================== diff -u -r4fc7cdc599de191e91296623ec783542b7a3c7b8 -rf3fa6fc6db9af49b39a22ca6584bd388caec407c --- sources/device/DeviceController.cpp (.../DeviceController.cpp) (revision 4fc7cdc599de191e91296623ec783542b7a3c7b8) +++ sources/device/DeviceController.cpp (.../DeviceController.cpp) (revision f3fa6fc6db9af49b39a22ca6584bd388caec407c) @@ -693,7 +693,6 @@ // Update UI with a response MDeviceCryptSetupResponse model; - model._data.isExited = false; model._data.mAccepted = false; model._data.mMessage = tr("Encrypted Partition %1 started.").arg(_deviceCryptSetupRequest._data.mCommand); emit didAttributeResponse(model.data()); @@ -712,7 +711,6 @@ // any other checking is done by UI Software at the moment this script is called. // The only thing matters is the pared device info in text and it will be empty string if error happens. MDeviceCryptSetupResponse model; - model._data.isExited = true; // Indicate that request completed QByteArray deviceInfo; if ( vStatus ) vExitCode = Device::DeviceError::eDevice_Scripts_Error_Status; Index: sources/device/DeviceModels.h =================================================================== diff -u -r4fc7cdc599de191e91296623ec783542b7a3c7b8 -rf3fa6fc6db9af49b39a22ca6584bd388caec407c --- sources/device/DeviceModels.h (.../DeviceModels.h) (revision 4fc7cdc599de191e91296623ec783542b7a3c7b8) +++ sources/device/DeviceModels.h (.../DeviceModels.h) (revision f3fa6fc6db9af49b39a22ca6584bd388caec407c) @@ -237,7 +237,6 @@ class MDeviceCryptSetupResponse : public MDeviceResponseBase { public: struct Data : MDeviceResponseBase::Data { - bool isExited = false; } _data; QVariantList parameters ( ) const override { return { }; } QString infoText ( ) const override { return QString("DeviceCryptSetup"); } Index: sources/device/DeviceView.cpp =================================================================== diff -u -r4fc7cdc599de191e91296623ec783542b7a3c7b8 -rf3fa6fc6db9af49b39a22ca6584bd388caec407c --- sources/device/DeviceView.cpp (.../DeviceView.cpp) (revision 4fc7cdc599de191e91296623ec783542b7a3c7b8) +++ sources/device/DeviceView.cpp (.../DeviceView.cpp) (revision f3fa6fc6db9af49b39a22ca6584bd388caec407c) @@ -95,8 +95,9 @@ accepted(vData.mAccepted); reason (vData.mReason ); - cryptSetupEnabled (vData.isExited && !isCompleteResponse(vData)); - isCryptSetupComplete(vData.isExited ); + // Only set to enable if request failed with a reason reported, disable otherwise + //DEBUG qDebug()<< "accepted " << vData.mAccepted << " reason "<< vData.mReason; + cryptSetupEnabled (!vData.mAccepted && vData.mReason != 0); // has to be the last one response(true); Index: sources/device/DeviceView.h =================================================================== diff -u -r4fc7cdc599de191e91296623ec783542b7a3c7b8 -rf3fa6fc6db9af49b39a22ca6584bd388caec407c --- sources/device/DeviceView.h (.../DeviceView.h) (revision 4fc7cdc599de191e91296623ec783542b7a3c7b8) +++ sources/device/DeviceView.h (.../DeviceView.h) (revision f3fa6fc6db9af49b39a22ca6584bd388caec407c) @@ -49,7 +49,6 @@ ATTRIBUTE ( QString , cryptSetup , "", CryptSetup ) PROPERTY ( bool , cryptSetupEnabled , true ) - PROPERTY ( bool , isCryptSetupComplete, false ) ATTRIBUTE ( bool , rootSSHAccess , false, RootSSHAccess ) Index: sources/gui/qml/pages/settings/SettingsManufacturingSetup.qml =================================================================== diff -u -r4fc7cdc599de191e91296623ec783542b7a3c7b8 -rf3fa6fc6db9af49b39a22ca6584bd388caec407c --- sources/gui/qml/pages/settings/SettingsManufacturingSetup.qml (.../SettingsManufacturingSetup.qml) (revision 4fc7cdc599de191e91296623ec783542b7a3c7b8) +++ sources/gui/qml/pages/settings/SettingsManufacturingSetup.qml (.../SettingsManufacturingSetup.qml) (revision f3fa6fc6db9af49b39a22ca6584bd388caec407c) @@ -27,7 +27,7 @@ */ UserConfirmation { id: _root message : vDevice.cryptSetupEnabled ? qsTr("Do you want to perform the %1?").arg(title.toLowerCase()) - : (vDevice.isCryptSetupComplete ? qsTr("Device Configuration Completed") : qsTr("Please wait ...")) + : qsTr("Please wait ...") itemIndex : SettingsStack.DeviceConfiguration notificationText: vDevice.status Index: sources/storage/FileHandler.cpp =================================================================== diff -u -r4fc7cdc599de191e91296623ec783542b7a3c7b8 -rf3fa6fc6db9af49b39a22ca6584bd388caec407c --- sources/storage/FileHandler.cpp (.../FileHandler.cpp) (revision 4fc7cdc599de191e91296623ec783542b7a3c7b8) +++ sources/storage/FileHandler.cpp (.../FileHandler.cpp) (revision f3fa6fc6db9af49b39a22ca6584bd388caec407c) @@ -318,36 +318,7 @@ return ok; } -/*! - * \brief FileHandler::isDirSame - * \details Compare the two folder's content - * \param vDir1 - directory path 1 - * \param vDir2 - directory path 2 - * \return true if the two directories are the same, false otherwise - */ -bool FileHandler::isDirSame(const QString &vDir1, const QString &vDir2) -{ - // disabled coco begin validated: This needs user interaction to check the file system - // has been tested manually since currently it is the only place it has been used. - bool isSame = false; - QString cmd = "diff"; - QStringList arguments; - arguments << vDir1 << vDir2; - QProcess diffProcess; - diffProcess.start(cmd, arguments); - - bool processCompleted = diffProcess.waitForFinished(); - if ( processCompleted ) - { - QString output = diffProcess.readAll(); - isSame = output.isEmpty(); // non empty indicate difference exists - //DEBUG: qDebug()<< output << output.isEmpty(); - } - - return isSame; -} - /*! * \brief FileHandler::find * \details The function to find files. Index: sources/storage/FileHandler.h =================================================================== diff -u -r4fc7cdc599de191e91296623ec783542b7a3c7b8 -rf3fa6fc6db9af49b39a22ca6584bd388caec407c --- sources/storage/FileHandler.h (.../FileHandler.h) (revision 4fc7cdc599de191e91296623ec783542b7a3c7b8) +++ sources/storage/FileHandler.h (.../FileHandler.h) (revision f3fa6fc6db9af49b39a22ca6584bd388caec407c) @@ -71,7 +71,6 @@ static bool isMounted (const QString &vPath, bool *vIsReadOnly = nullptr); static bool tmpUsable (); - static bool isDirSame (const QString &vDir1, const QString &vDir2); static QFileInfoList find(const QString &vPath, QStringList vNameFilters, quint8 vRetainPercent); static QFileInfoList find(const QString &vPath, QStringList vNameFilters); Index: sources/storage/Settings.cpp =================================================================== diff -u -r4fc7cdc599de191e91296623ec783542b7a3c7b8 -rf3fa6fc6db9af49b39a22ca6584bd388caec407c --- sources/storage/Settings.cpp (.../Settings.cpp) (revision 4fc7cdc599de191e91296623ec783542b7a3c7b8) +++ sources/storage/Settings.cpp (.../Settings.cpp) (revision f3fa6fc6db9af49b39a22ca6584bd388caec407c) @@ -254,7 +254,6 @@ QString sub = src + dir; if ( ! lstExclude.contains( sub ) ) { if ( FileHandler ::copyFolder (sub, dst )) { err = Settings_Error::eError_MkDir ; msg = errorMessage(err, dir); LOG_DEBUG(msg); goto lOut; } - if ( !FileHandler ::isDirSame (sub, dst+dir)) { err = Settings_Error::eError_POST ; msg = errorMessage(err, dir); LOG_DEBUG(msg+"_cmp"); goto lOut;} } if ( FileHandler ::removeFolder (sub )) { err = Settings_Error::eError_POST ; msg = errorMessage(err, dir); LOG_DEBUG(msg); goto lOut; } }