mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-08 23:23:01 -06:00
#4285 Octave : Rename to absoluteFileName
This commit is contained in:
parent
b8ff8a2de8
commit
fd774bec39
@ -58,7 +58,7 @@ void RicEditScriptFeature::onActionTriggered(bool isChecked)
|
||||
if (!scriptEditor.isEmpty())
|
||||
{
|
||||
QStringList arguments;
|
||||
arguments << calcScript->absolutePath;
|
||||
arguments << calcScript->absoluteFileName;
|
||||
|
||||
QProcess* myProcess = new QProcess(this);
|
||||
myProcess->start(scriptEditor, arguments);
|
||||
|
@ -61,13 +61,13 @@ void RicExecuteScriptFeature::onActionTriggered(bool isChecked)
|
||||
{
|
||||
// TODO: Must rename RimCalcScript::absolutePath to absoluteFileName, as the code below is confusing
|
||||
// absolutePath() is a function in QFileInfo
|
||||
QFileInfo fi(calcScript->absolutePath());
|
||||
QFileInfo fi(calcScript->absoluteFileName());
|
||||
QString octaveFunctionSearchPath = fi.absolutePath();
|
||||
|
||||
QStringList arguments = app->octaveArguments();
|
||||
arguments.append("--path");
|
||||
arguments << octaveFunctionSearchPath;
|
||||
arguments << calcScript->absolutePath();
|
||||
arguments << calcScript->absoluteFileName();
|
||||
|
||||
RiaApplication::instance()->launchProcess(octavePath, arguments);
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ void RicNewScriptFeature::onActionTriggered(bool isChecked)
|
||||
|
||||
if (calcScript)
|
||||
{
|
||||
QFileInfo existingScriptFileInfo(calcScript->absolutePath());
|
||||
QFileInfo existingScriptFileInfo(calcScript->absoluteFileName());
|
||||
fullPathNewScript = existingScriptFileInfo.absolutePath();
|
||||
}
|
||||
else if (scriptColl)
|
||||
|
@ -32,11 +32,11 @@ RimCalcScript::RimCalcScript()
|
||||
{
|
||||
CAF_PDM_InitObject("CalcScript", ":/OctaveScriptFile16x16.png", "Calc Script", "");
|
||||
|
||||
CAF_PDM_InitField(&absolutePath, "AbsolutePath", QString(), "Location", "", "", "");
|
||||
CAF_PDM_InitField(&absoluteFileName, "AbsolutePath", QString(), "Location", "", "", "");
|
||||
CAF_PDM_InitField(&content, "Content", QString(), "Directory", "", "", "");
|
||||
RiaFieldhandleTools::disableWriteAndSetFieldHidden(&content);
|
||||
|
||||
absolutePath.uiCapability()->setUiEditorTypeName(caf::PdmUiFilePathEditor::uiEditorTypeName());
|
||||
absoluteFileName.uiCapability()->setUiEditorTypeName(caf::PdmUiFilePathEditor::uiEditorTypeName());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -33,6 +33,6 @@ public:
|
||||
RimCalcScript();
|
||||
~RimCalcScript() override;
|
||||
|
||||
caf::PdmField<QString> absolutePath;
|
||||
caf::PdmField<QString> absoluteFileName;
|
||||
caf::PdmField<QString> content; // TODO: Obsolete field, can be deleted on next project file revision.
|
||||
};
|
||||
|
@ -165,7 +165,7 @@ void RimCommandFactory::createCommandObjects(const caf::PdmObjectGroup& selected
|
||||
{
|
||||
RimCalcScript* calcScript = dynamic_cast<RimCalcScript*>(pdmObject);
|
||||
|
||||
QFile file(calcScript->absolutePath);
|
||||
QFile file(calcScript->absoluteFileName);
|
||||
if (file.open(QIODevice::ReadOnly | QIODevice::Text))
|
||||
{
|
||||
QTextStream in(&file);
|
||||
|
@ -1058,10 +1058,10 @@ void RimContextCommandBuilder::appendScriptItems(caf::CmdFeatureMenuBuilder& men
|
||||
for (size_t i = 0; i < scriptCollection->calcScripts.size(); i++)
|
||||
{
|
||||
RimCalcScript* calcScript = scriptCollection->calcScripts[i];
|
||||
QFileInfo fi(calcScript->absolutePath());
|
||||
QFileInfo fi(calcScript->absoluteFileName());
|
||||
|
||||
QString menuText = fi.baseName();
|
||||
menuBuilder.addCmdFeatureWithUserData("RicExecuteScriptForCasesFeature", menuText, QVariant(calcScript->absolutePath()));
|
||||
menuBuilder.addCmdFeatureWithUserData("RicExecuteScriptForCasesFeature", menuText, QVariant(calcScript->absoluteFileName()));
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < scriptCollection->subDirectories.size(); i++)
|
||||
|
@ -92,7 +92,7 @@ void RimScriptCollection::readContentFromDisc()
|
||||
if (caf::Utils::fileExists(fileName))
|
||||
{
|
||||
RimCalcScript* calcScript = new RimCalcScript;
|
||||
calcScript->absolutePath = fileName;
|
||||
calcScript->absoluteFileName = fileName;
|
||||
|
||||
QFileInfo fi(fileName);
|
||||
calcScript->setUiName(fi.baseName());
|
||||
|
Loading…
Reference in New Issue
Block a user