summaryrefslogtreecommitdiff
path: root/Libraries/LibGUI/GItemView.cpp
diff options
context:
space:
mode:
authorDov Alperin <dzalperin@gmail.com>2020-01-06 18:05:02 -0500
committerAndreas Kling <awesomekling@gmail.com>2020-01-08 15:20:41 +0100
commite0c959ea7ff82abe499d81d54a3dd845c1f2d52d (patch)
tree6801463358c4fb5b657df7f4407c45e4d333b49e /Libraries/LibGUI/GItemView.cpp
parent8ddd053c2a947bce2df4faa3de60bab9cab85420 (diff)
downloadserenity-e0c959ea7ff82abe499d81d54a3dd845c1f2d52d.zip
LibGUI: separate file names with commas in the drag operation text
Diffstat (limited to 'Libraries/LibGUI/GItemView.cpp')
-rw-r--r--Libraries/LibGUI/GItemView.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/Libraries/LibGUI/GItemView.cpp b/Libraries/LibGUI/GItemView.cpp
index 8064b6f7d1..e4fd104400 100644
--- a/Libraries/LibGUI/GItemView.cpp
+++ b/Libraries/LibGUI/GItemView.cpp
@@ -184,10 +184,15 @@ void GItemView::mousemove_event(GMouseEvent& event)
StringBuilder text_builder;
StringBuilder data_builder;
+ int index_iterations = 0;
selection().for_each_index([&](auto& index) {
+ index_iterations++;
auto text_data = model()->data(index);
+ if (index_iterations == 0)
+ text_builder.append(" ");
text_builder.append(text_data.to_string());
- text_builder.append(" ");
+ if (!(index_iterations == selection().size()))
+ text_builder.append(", ");
auto drag_data = model()->data(index, GModel::Role::DragData);
data_builder.append(drag_data.to_string());