Skip to content

Commit 6ee8d58

Browse files
committed
dialogs
1 parent d3415ca commit 6ee8d58

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/gui/dialogs/painter_image.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,13 @@ void PainterImageDialog::done(const int r)
115115

116116
std::optional<std::string> path_string;
117117

118-
if (path_type_ == PainterImagePathType::DIRECTORY)
118+
switch (path_type_)
119+
{
120+
case PainterImagePathType::NONE:
121+
{
122+
break;
123+
}
124+
case PainterImagePathType::DIRECTORY:
119125
{
120126
path_string = ui_.line_edit_path->text().toStdString();
121127
const std::filesystem::path path = path_from_utf8(*path_string);
@@ -125,8 +131,9 @@ void PainterImageDialog::done(const int r)
125131
dialogs::message_critical(msg);
126132
return;
127133
}
134+
break;
128135
}
129-
else if (path_type_ == PainterImagePathType::FILE)
136+
case PainterImagePathType::FILE:
130137
{
131138
path_string = ui_.line_edit_path->text().toStdString();
132139
const std::filesystem::path path = path_from_utf8(*path_string);
@@ -136,6 +143,8 @@ void PainterImageDialog::done(const int r)
136143
dialogs::message_critical(msg);
137144
return;
138145
}
146+
break;
147+
}
139148
}
140149

141150
parameters_.emplace();

0 commit comments

Comments
 (0)