Skip to content

Commit

Permalink
Use struct instead of class
Browse files Browse the repository at this point in the history
  • Loading branch information
magnesj committed Dec 19, 2024
1 parent f190596 commit 2968873
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 29 deletions.
18 changes: 9 additions & 9 deletions ApplicationLibCode/Commands/RicRecursiveFileSearchDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

#include "RiuFileDialogTools.h"
#include "RiuTools.h"
#include "opm/io/eclipse/EclUtil.hpp"

#include <QAbstractItemView>
#include <QAction>
Expand Down Expand Up @@ -269,15 +268,17 @@ RicRecursiveFileSearchDialogResult RicRecursiveFileSearchDialog::runRecursiveSea
RiaStringListSerializer stringListSerializer( fileFilterRegistryKey );
stringListSerializer.addString( dialog.m_fileFilterField->currentText(), maxItemsInRegistry );
}

return { .ok = dialog.result() == QDialog::Accepted,
.files = dialog.m_foundFiles,
.rootDir = dialog.rootDirWithEndSeparator(),
.pathFilter = dialog.pathFilterWithoutStartSeparator(),
.fileNameFilter = dialog.fileNameFilter(),
.fileType = dialog.fileType(),
.groupingMode = dialog.ensembleGroupingMode() };
}

return RicRecursiveFileSearchDialogResult( dialog.result() == QDialog::Accepted,
dialog.m_foundFiles,
dialog.rootDirWithEndSeparator(),
dialog.pathFilterWithoutStartSeparator(),
dialog.fileNameFilter(),
dialog.fileType(),
dialog.ensembleGroupingMode() );
return {};
}

//--------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -1298,7 +1299,6 @@ RiaDefines::FileType RicRecursiveFileSearchDialog::mapSummaryFileType( RicRecurs
return RiaDefines::FileType::STIMPLAN_SUMMARY;
default:
{
CAF_ASSERT( false && "Unsupported file type" );
return RiaDefines::FileType::SMSPEC;
}
}
Expand Down
22 changes: 2 additions & 20 deletions ApplicationLibCode/Commands/RicRecursiveFileSearchDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class QComboBox;
class QCheckBox;
class QTreeView;

class RicRecursiveFileSearchDialogResult;
struct RicRecursiveFileSearchDialogResult;

//==================================================================================================
///
Expand Down Expand Up @@ -180,26 +180,8 @@ private slots:
//==================================================================================================
///
//==================================================================================================
class RicRecursiveFileSearchDialogResult
struct RicRecursiveFileSearchDialogResult
{
public:
RicRecursiveFileSearchDialogResult( bool ok,
const QStringList& files,
const QString& rootDir,
const QString& pathFilter,
const QString& fileNameFilter,
RicRecursiveFileSearchDialog::FileType fileType,
RiaEnsembleNameTools::EnsembleGroupingMode groupingMode )
: ok( ok )
, files( files )
, rootDir( rootDir )
, pathFilter( pathFilter )
, fileNameFilter( fileNameFilter )
, fileType( fileType )
, groupingMode( groupingMode )
{
}

bool ok;
QStringList files;
QString rootDir;
Expand Down

0 comments on commit 2968873

Please sign in to comment.