Skip to content

Commit

Permalink
refactor(window/dialog): clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
jwerle committed Nov 16, 2023
1 parent ef8b98b commit 708f0a3
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions src/window/dialog.cc
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ namespace SSC {
);

if (FAILED(result)) {
debug("ERR: CoInitializeEx() failed in 'openDialog()'");
debug("ERR: CoInitializeEx() failed in 'showFileSystemPicker()'");
return paths;
}

Expand All @@ -533,7 +533,7 @@ namespace SSC {
);

if (FAILED(result)) {
debug("ERR: CoCreateInstance() failed in 'openDialog()'");
debug("ERR: CoCreateInstance() failed in 'showFileSystemPicker()'");
CoUninitialize();
return paths;
}
Expand All @@ -546,7 +546,7 @@ namespace SSC {
);

if (FAILED(result)) {
debug("ERR: CoCreateInstance() failed in 'openDialog()'");
debug("ERR: CoCreateInstance() failed in 'showFileSystemPicker()'");
CoUninitialize();
return paths;
}
Expand All @@ -559,7 +559,7 @@ namespace SSC {
}

if (FAILED(result)) {
debug("ERR: IFileDialog::GetOptions() failed in 'openDialog()'");
debug("ERR: IFileDialog::GetOptions() failed in 'showFileSystemPicker()'");
CoUninitialize();
return paths;
}
Expand All @@ -572,7 +572,7 @@ namespace SSC {
}

if (FAILED(result)) {
debug("ERR: IFileDialog::SetOptions(FOS_PICKFOLDERS) failed in 'openDialog()'");
debug("ERR: IFileDialog::SetOptions(FOS_PICKFOLDERS) failed in 'showFileSystemPicker()'");
CoUninitialize();
return paths;
}
Expand All @@ -582,7 +582,7 @@ namespace SSC {
result = dialog.open->SetOptions(dialogOptions | FOS_ALLOWMULTISELECT);

if (FAILED(result)) {
debug("ERR: IFileDialog::SetOptions(FOS_ALLOWMULTISELECT) failed in 'openDialog()'");
debug("ERR: IFileDialog::SetOptions(FOS_ALLOWMULTISELECT) failed in 'showFileSystemPicker()'");
CoUninitialize();
return paths;
}
Expand All @@ -600,7 +600,7 @@ namespace SSC {
);

if (FAILED(result)) {
debug("ERR: SHCreateItemFromParsingName() failed in 'openDialog()'");
debug("ERR: SHCreateItemFromParsingName() failed in 'showFileSystemPicker()'");
CoUninitialize();
return paths;
}
Expand All @@ -612,7 +612,7 @@ namespace SSC {
}

if (FAILED(result)) {
debug("ERR: IFileDialog::SetDefaultFolder() failed in 'openDialog()'");
debug("ERR: IFileDialog::SetDefaultFolder() failed in 'showFileSystemPicker()'");
CoUninitialize();
return paths;
}
Expand All @@ -630,7 +630,7 @@ namespace SSC {
}

if (FAILED(result)) {
debug("ERR: IFileDialog::SetTitle() failed in 'openDialog()'");
debug("ERR: IFileDialog::SetTitle() failed in 'showFileSystemPicker()'");
CoUninitialize();
return paths;
}
Expand All @@ -648,7 +648,7 @@ namespace SSC {
}

if (FAILED(result)) {
debug("ERR: IFileDialog::SetFileName() failed in 'openDialog()'");
debug("ERR: IFileDialog::SetFileName() failed in 'showFileSystemPicker()'");
CoUninitialize();
return paths;
}
Expand All @@ -661,7 +661,7 @@ namespace SSC {
}

if (FAILED(result)) {
debug("ERR: IFileDialog::Show() failed in 'openDialog()'");
debug("ERR: IFileDialog::Show() failed in 'showFileSystemPicker()'");
CoUninitialize();
return paths;
}
Expand All @@ -670,22 +670,22 @@ namespace SSC {
result = dialog.save->GetResult(&saveResult);

if (FAILED(result)) {
debug("ERR: IFileDialog::GetResult() failed in 'openDialog()'");
debug("ERR: IFileDialog::GetResult() failed in 'showFileSystemPicker()'");
CoUninitialize();
return paths;
}
} else {
result = dialog.open->GetResults(&openResults);

if (FAILED(result)) {
debug("ERR: IFileDialog::GetResults() failed in 'openDialog()'");
debug("ERR: IFileDialog::GetResults() failed in 'showFileSystemPicker()'");
CoUninitialize();
return paths;
}
}

if (FAILED(result)) {
debug("ERR: IFileDialog::Show() failed in 'openDialog()'");
debug("ERR: IFileDialog::Show() failed in 'showFileSystemPicker()'");
CoUninitialize();
return paths;
}
Expand All @@ -696,7 +696,7 @@ namespace SSC {
result = saveResult->GetDisplayName(SIGDN_DESKTOPABSOLUTEPARSING, &buf);

if (FAILED(result)) {
debug("ERR: IShellItem::GetDisplayName() failed in 'openDialog()'");
debug("ERR: IShellItem::GetDisplayName() failed in 'showFileSystemPicker()'");
CoUninitialize();
return paths;
}
Expand All @@ -709,7 +709,7 @@ namespace SSC {
openResults->GetCount(&totalResults);

if (FAILED(result)) {
debug("ERR: IShellItemArray::GetCount() failed in 'openDialog()'");
debug("ERR: IShellItemArray::GetCount() failed in 'showFileSystemPicker()'");
CoUninitialize();
return paths;
}
Expand All @@ -721,15 +721,15 @@ namespace SSC {
result = openResults->GetItemAt(i, &path);

if (FAILED(result)) {
debug("ERR: IShellItemArray::GetItemAt() failed in 'openDialog()'");
debug("ERR: IShellItemArray::GetItemAt() failed in 'showFileSystemPicker()'");
CoUninitialize();
return paths;
}

result = path->GetDisplayName(SIGDN_DESKTOPABSOLUTEPARSING, &buf);

if (FAILED(result)) {
debug("ERR: IShellItem::GetDisplayName() failed in 'openDialog()'");
debug("ERR: IShellItem::GetDisplayName() failed in 'showFileSystemPicker()'");
CoUninitialize();
return paths;
}
Expand Down

0 comments on commit 708f0a3

Please sign in to comment.