Skip to content

Commit

Permalink
#92 : Small refactorings
Browse files Browse the repository at this point in the history
  • Loading branch information
clechasseur committed Jan 18, 2020
1 parent fb02d23 commit a64596f
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 4 deletions.
3 changes: 3 additions & 0 deletions PathCopyCopy/src/PluginPipelineElements.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -362,8 +362,11 @@ namespace PCC
{
bool valid = false;
if (p_pPluginProvider != nullptr) {
// Try finding the plugin we need.
const auto spPlugin = p_pPluginProvider->GetPlugin(m_PluginId);
if (spPlugin != nullptr) {
// To be valid, plugin either has to not be a pipeline plugin
// OR it needs to be one and have a valid pipeline.
const auto* const pPipelinePlugin = dynamic_cast<PCC::Plugins::PipelinePlugin*>(spPlugin.get());
valid = pPipelinePlugin == nullptr || pPipelinePlugin->GetPipeline(&p_rsSeenPluginIds) != nullptr;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace PathCopyCopy.Settings.UI.UserControls
public partial class FindReplacePipelineElementUserControl : PipelineElementUserControl
{
/// Element we're configuring.
private FindReplacePipelineElement element;
private readonly FindReplacePipelineElement element;

/// <summary>
/// Constructor.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace PathCopyCopy.Settings.UI.UserControls
public partial class PathsSeparatorPipelineElementUserControl : PipelineElementUserControl
{
/// Element we're configuring.
private PathsSeparatorPipelineElement element;
private readonly PathsSeparatorPipelineElement element;

/// <summary>
/// Constructor.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace PathCopyCopy.Settings.UI.UserControls
public partial class PipelineElementWithExecutableUserControl : PipelineElementUserControl
{
/// Element we're configuring.
private PipelineElementWithExecutable element;
private readonly PipelineElementWithExecutable element;

/// <summary>
/// Constructor.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ public partial class PluginPreviewUserControl : UserControl
/// Plugin we're currently previewing.
private Plugin plugin;

#pragma warning disable IDE0044 // Add readonly modifier
/// Object used to access user settings.
private UserSettings settings;
#pragma warning restore IDE0044 // Add readonly modifier

/// <summary>
/// Plugin to preview. Change this to update the preview displayed.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace PathCopyCopy.Settings.UI.UserControls
public partial class RegexPipelineElementUserControl : PipelineElementUserControl
{
/// Element we're configuring.
private RegexPipelineElement element;
private readonly RegexPipelineElement element;

/// <summary>
/// Constructor.
Expand Down

0 comments on commit a64596f

Please sign in to comment.