Osdu: make sure token is valid before background loading.

This commit is contained in:
Kristian Bendiksen committed 2024-08-14 11:32:07 +02:00
1 parent 2651ca91b6
commit 76a1d43b0e
2 files changed
+21 -2

No files matched your search

@@ -48,6 +48,8 @@ public:
QString server() const;
QString requestTokenBlocking();
public slots:
void requestToken();
void requestFailed( const QAbstractOAuth::Error error );
@@ -61,8 +63,6 @@ private slots:
void accessGranted();
protected:
QString requestTokenBlocking();
static QString constructAuthUrl( const QString& authority );
static QString constructTokenUrl( const QString& authority );
@@ -155,6 +155,25 @@ void RimWellPathCollection::loadDataAndUpdate()
readWellPathFormationFiles();
auto hasOsduData = []( const std::vector<RimWellPath*>& wellPaths ) -> bool
{
for ( RimWellPath* wellPath : wellPaths )
{
if ( dynamic_cast<RimOsduWellPath*>( wellPath ) )
{
return true;
}
}
return false;
};
if ( hasOsduData( allWellPaths() ) )
{
auto osduConnector = RiaApplication::instance()->makeOsduConnector();
osduConnector->requestTokenBlocking();
}
caf::DataLoadController* dataLoadController = caf::DataLoadController::instance();
const QString wellPathGeometryKeyword = "WELL_PATH_GEOMETRY";