Skip to content

Commit

Permalink
Remove obsolete code related to Qt5
Browse files Browse the repository at this point in the history
* Remove bundling of openssl1.1
* Remove obsolete compile flags
* Remove use of obsolete RimCommandObject
* Use QColor::isValidColorName
QColor::isValidColor is deprecated in Qt 6.6, QColor::isValidColorName was introduced in 6.4

* Make sure debug DLLs are copied when required
* Remove Qt5 from AppFwk
* Remove obsolete copy of Qt  DLLs
  • Loading branch information
magnesj authored Oct 7, 2024
1 parent c759905 commit ca4a7b9
Show file tree
Hide file tree
Showing 40 changed files with 198 additions and 1,194 deletions.
11 changes: 2 additions & 9 deletions ApplicationExeCode/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -197,13 +197,6 @@ if(MSVC)

set(BUILD_FLAGS_FOR_MSVC "/wd4190 /wd4100 /wd4127 /wd4245 /wd4005")

if(CMAKE_CXX_COMPILER_VERSION LESS_EQUAL 19.14)
# The following warning is generated over 800 times from a qwt header only
# using VS2015 Disabling temporarily warning C4505 'function' : unreferenced
# local function has been removed
set(BUILD_FLAGS_FOR_MSVC "${BUILD_FLAGS_FOR_MSVC} /wd4505")
endif()

message(STATUS "BUILD_FLAGS_FOR_MSVC ${BUILD_FLAGS_FOR_MSVC}")
set_target_properties(
ResInsight PROPERTIES COMPILE_FLAGS ${BUILD_FLAGS_FOR_MSVC}
Expand Down Expand Up @@ -444,8 +437,8 @@ if(RESINSIGHT_PRIVATE_INSTALL)
add_custom_command(
TARGET ResInsight
POST_BUILD
COMMAND ${WINDEPLOYQT_EXECUTABLE} $<TARGET_FILE:ResInsight> --release
--no-translations
COMMAND ${WINDEPLOYQT_EXECUTABLE} $<TARGET_FILE:ResInsight>
"$<IF:$<CONFIG:Debug>,--debug,--release>" --no-translations
COMMENT
"Running windeployqt to deploy Qt dependencies to the build folder, required by install()"
)
Expand Down
89 changes: 0 additions & 89 deletions ApplicationLibCode/Application/RiaApplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@

#include "Rim2dIntersectionViewCollection.h"
#include "RimCellFilterCollection.h"
#include "RimCommandObject.h"
#include "RimCommandRouter.h"
#include "RimCompletionTemplateCollection.h"
#include "RimEclipseCaseCollection.h"
Expand Down Expand Up @@ -789,18 +788,6 @@ bool RiaApplication::loadProject( const QString& projectFileName, ProjectLoadAct
// Default behavior for scripts is to use current active view for data read/write
onProjectOpened();

// Loop over command objects and execute them
for ( size_t i = 0; i < m_project->commandObjects.size(); i++ )
{
m_commandQueue.push_back( m_project->commandObjects[i] );
}

// Lock the command queue
m_commandQueueLock.lock();

// Execute command objects, and release the mutex when the queue is empty
executeCommandObjects();

// Recalculate the results from grid property calculations.
// Has to be done late since the results are filtered by view cell visibility
for ( auto gridCalculation : m_project->gridCalculationCollection()->sortedGridCalculations() )
Expand Down Expand Up @@ -883,7 +870,6 @@ void RiaApplication::closeProject()
onProjectBeingClosed();

m_project->close();
m_commandQueue.clear();

RiaWellNameComparer::clearCache();

Expand Down Expand Up @@ -1383,81 +1369,6 @@ void RiaApplication::executeCommandFile( const QString& commandFile )
RicfCommandFileExecutor::instance()->executeCommands( in );
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiaApplication::addCommandObject( RimCommandObject* commandObject )
{
m_commandQueue.push_back( commandObject );
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiaApplication::executeCommandObjects()
{
{
auto currentCommandQueue = m_commandQueue;
for ( auto command : currentCommandQueue )
{
if ( !command->isAsyncronous() )
{
command->redo();
m_commandQueue.remove( command );
}
}
}

if ( !m_commandQueue.empty() )
{
auto it = m_commandQueue.begin();
if ( it->notNull() )
{
RimCommandObject* first = *it;
first->redo();
}
m_commandQueue.pop_front();
}
else
{
// Unlock the command queue lock when the command queue is empty
// Required to lock the mutex before unlocking to avoid undefined behavior
m_commandQueueLock.tryLock();
m_commandQueueLock.unlock();
}
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiaApplication::waitUntilCommandObjectsHasBeenProcessed()
{
auto start = std::chrono::system_clock::now();
const double timeoutThreshold = 5.0;

// Wait until all command objects have completed
bool mutexLockedSuccessfully = m_commandQueueLock.tryLock();

while ( !mutexLockedSuccessfully )
{
invokeProcessEvents();

mutexLockedSuccessfully = m_commandQueueLock.tryLock();

std::chrono::duration<double> elapsed_seconds = std::chrono::system_clock::now() - start;
if ( timeoutThreshold < elapsed_seconds.count() )
{
// This can happen if the octave plugins fails to execute during regression testing.

RiaLogging::warning(
QString( "Timeout waiting for command objects to complete, timeout set to %1 seconds." ).arg( timeoutThreshold ) );
break;
}
}

m_commandQueueLock.unlock();
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
Expand Down
7 changes: 0 additions & 7 deletions ApplicationLibCode/Application/RiaApplication.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ class RiaSocketServer;

class RigEclipseCaseData;

class RimCommandObject;
class RimCommandRouter;
class RimEclipseCase;
class RimEclipseView;
Expand Down Expand Up @@ -180,9 +179,6 @@ class RiaApplication
QVariant cacheDataObject( const QString& key ) const;

void executeCommandFile( const QString& commandFile );
void addCommandObject( RimCommandObject* commandObject );
void executeCommandObjects();
void waitUntilCommandObjectsHasBeenProcessed();

const QString startDir() const;
void setStartDir( const QString& startDir );
Expand Down Expand Up @@ -253,9 +249,6 @@ class RiaApplication
QString m_commandLineHelpText;
QMap<QString, QVariant> m_sessionCache; // Session cache used to store username/passwords per session

std::list<caf::PdmPointer<RimCommandObject>> m_commandQueue;
QMutex m_commandQueueLock;

bool m_runningWorkerProcess;

private:
Expand Down
4 changes: 0 additions & 4 deletions ApplicationLibCode/Application/RiaGuiApplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
#include "RimAnnotationCollection.h"
#include "RimAnnotationInViewCollection.h"
#include "RimAnnotationTextAppearance.h"
#include "RimCommandObject.h"
#include "RimEclipseCaseCollection.h"
#include "RimEclipseView.h"
#include "RimFlowPlotCollection.h"
Expand Down Expand Up @@ -1574,9 +1573,6 @@ void RiaGuiApplication::slotWorkerProcessFinished( int exitCode, QProcess::ExitS
}
m_workerProcess = nullptr;

// Always make sure the command objects are executed before any return statement
executeCommandObjects();

// Either the work process crashed or was aborted by the user
if ( exitStatus == QProcess::CrashExit )
{
Expand Down
1 change: 0 additions & 1 deletion ApplicationLibCode/Application/RiaGuiApplication.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ class RiaSocketServer;

class RigEclipseCaseData;

class RimCommandObject;
class RimEclipseCase;
class RimEclipseView;
class RimGridView;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,6 @@ void RiaRegressionTestRunner::runRegressionTest()

app->loadProject( testCaseFolder.filePath( projectFileName ), RiaApplication::ProjectLoadAction::PLA_NONE, projectModifier.p() );

// Wait until all command objects have completed
app->waitUntilCommandObjectsHasBeenProcessed();

QString fullPathGeneratedFolder = testCaseFolder.absoluteFilePath( generatedFolderName );
if ( regressionTestConfig.exportSnapshots3dViews )
{
Expand Down
7 changes: 0 additions & 7 deletions ApplicationLibCode/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -277,13 +277,6 @@ if(MSVC)

message(STATUS "CMAKE_CXX_COMPILER_VERSION ${CMAKE_CXX_COMPILER_VERSION}")

if(CMAKE_CXX_COMPILER_VERSION LESS_EQUAL 19.14)
# The following warning is generated over 800 times from a qwt header only
# using VS2015 Disabling temporarily warning C4505 'function' : unreferenced
# local function has been removed
set(BUILD_FLAGS_FOR_MSVC "${BUILD_FLAGS_FOR_MSVC} /wd4505")
endif()

if(CMAKE_CXX_COMPILER_VERSION GREATER_EQUAL 19.38)
# https://github.com/OPM/ResInsight/issues/10844
set(BUILD_FLAGS_FOR_MSVC "${BUILD_FLAGS_FOR_MSVC} /wd4996")
Expand Down
7 changes: 0 additions & 7 deletions ApplicationLibCode/Commands/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,6 @@ if(MSVC)

set(BUILD_FLAGS_FOR_MSVC "/W3 /wd4190 /wd4100 /wd4127")

if(CMAKE_CXX_COMPILER_VERSION LESS_EQUAL 19.14)
# The following warning is generated over 800 times from a qwt header only
# using VS2015 Disabling temporarily warning C4505 'function' : unreferenced
# local function has been removed
set(BUILD_FLAGS_FOR_MSVC "${BUILD_FLAGS_FOR_MSVC} /wd4505")
endif()

if(CMAKE_CXX_COMPILER_VERSION GREATER_EQUAL 19.38)
# https://github.com/OPM/ResInsight/issues/10844
set(BUILD_FLAGS_FOR_MSVC "${BUILD_FLAGS_FOR_MSVC} /wd4996")
Expand Down
6 changes: 3 additions & 3 deletions ApplicationLibCode/FileInterface/RifColorLegendData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ cvf::ref<RigFormationNames> RifColorLegendData::readLyrFormationNameFile( const
// extract last word which may contain formation color
QString colorWord = RiaTextStringTools::splitSkipEmptyParts( numberString ).last();

if ( QColor::isValidColor( colorWord ) ) numberString.remove( colorWord ); // remove color if present as last word on line
if ( QColor::isValidColorName( colorWord ) ) numberString.remove( colorWord ); // remove color if present as last word on line

// extract words containing formation number(s)
QStringList numberWords = RiaTextStringTools::splitSkipEmptyParts( numberString, QRegExp( "-" ) );
Expand All @@ -110,7 +110,7 @@ cvf::ref<RigFormationNames> RifColorLegendData::readLyrFormationNameFile( const
startK = tmp < endK ? tmp : endK;
endK = tmp > endK ? tmp : endK;

if ( QColor::isValidColor( colorWord ) ) // formation color present at end of line
if ( QColor::isValidColorName( colorWord ) ) // formation color present at end of line
{
cvf::Color3f formationColor;

Expand All @@ -133,7 +133,7 @@ cvf::ref<RigFormationNames> RifColorLegendData::readLyrFormationNameFile( const
continue;
}

if ( QColor::isValidColor( colorWord ) ) // formation color present at end of line
if ( QColor::isValidColorName( colorWord ) ) // formation color present at end of line
{
cvf::Color3f formationColor;

Expand Down
2 changes: 0 additions & 2 deletions ApplicationLibCode/ProjectDataModel/CMakeLists_files.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ set(SOURCE_GROUP_HEADER_FILES
${CMAKE_CURRENT_LIST_DIR}/RimReservoirCellResultsStorage.h
${CMAKE_CURRENT_LIST_DIR}/RimEclipseStatisticsCaseEvaluator.h
${CMAKE_CURRENT_LIST_DIR}/RimMimeData.h
${CMAKE_CURRENT_LIST_DIR}/RimCommandObject.h
${CMAKE_CURRENT_LIST_DIR}/RimTools.h
${CMAKE_CURRENT_LIST_DIR}/RimFormationNames.h
${CMAKE_CURRENT_LIST_DIR}/RimFormationNamesCollection.h
Expand Down Expand Up @@ -168,7 +167,6 @@ set(SOURCE_GROUP_SOURCE_FILES
${CMAKE_CURRENT_LIST_DIR}/RimReservoirCellResultsStorage.cpp
${CMAKE_CURRENT_LIST_DIR}/RimEclipseStatisticsCaseEvaluator.cpp
${CMAKE_CURRENT_LIST_DIR}/RimMimeData.cpp
${CMAKE_CURRENT_LIST_DIR}/RimCommandObject.cpp
${CMAKE_CURRENT_LIST_DIR}/RimTools.cpp
${CMAKE_CURRENT_LIST_DIR}/RimFormationNames.cpp
${CMAKE_CURRENT_LIST_DIR}/RimFormationNamesCollection.cpp
Expand Down
Loading

0 comments on commit ca4a7b9

Please sign in to comment.