mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
* Disable IO for scriptlocations and make sure we save it in preferences when editing * The next valid case Id stuff in initDirectories is irrelevant because it always runs on an empty project
This commit is contained in:
@@ -55,7 +55,6 @@ void RicEditPreferencesFeature::onActionTriggered(bool isChecked)
|
||||
if (propertyDialog.exec() == QDialog::Accepted)
|
||||
{
|
||||
// Write preferences using QSettings and apply them to the application
|
||||
caf::PdmSettings::writeFieldsToApplicationStore(app->preferences());
|
||||
app->applyPreferences(oldPreferences.get());
|
||||
app->applyGuiPreferences(oldPreferences.get());
|
||||
app->updateGrpcServer();
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#include "cvfAssert.h"
|
||||
|
||||
#include <QAction>
|
||||
#include <QStringList>
|
||||
|
||||
CAF_CMD_SOURCE_INIT(RicDeleteScriptPathFeature, "RicDeleteScriptPathFeature");
|
||||
|
||||
@@ -55,18 +56,9 @@ void RicDeleteScriptPathFeature::onActionTriggered(bool isChecked)
|
||||
QString toBeRemoved = scriptCollection->directory;
|
||||
|
||||
QString originalFilePathString = RiaApplication::instance()->preferences()->scriptDirectories();
|
||||
QString filePathString = originalFilePathString.remove(toBeRemoved);
|
||||
|
||||
// Remove duplicate separators
|
||||
QChar separator(';');
|
||||
QString regExpString = QString("%1{1,5}").arg(separator);
|
||||
filePathString.replace(QRegExp(regExpString), separator);
|
||||
|
||||
// Remove separator at end
|
||||
if (filePathString.endsWith(separator))
|
||||
{
|
||||
filePathString = filePathString.left(filePathString.size() - 1);
|
||||
}
|
||||
QStringList allFilePaths = originalFilePathString.split(';');
|
||||
allFilePaths.removeOne(toBeRemoved);
|
||||
QString filePathString = allFilePaths.join(';');
|
||||
|
||||
RiaApplication::instance()->preferences()->scriptDirectories = filePathString;
|
||||
RiaApplication::instance()->applyPreferences();
|
||||
|
||||
Reference in New Issue
Block a user