Revert "Copy selected lines from Packet List view for existing formats."

This reverts commit 13c5960a2c.

Based on the features that needs integration of "multi-selection" (which this change introduced), it seems that there will be fair amount time and code changes required in packet_list.cpp and possibly other files.
I am reverting this change from the master branch so that people can still continue to use features with single-selection.
Meanwhile, Stig B and others ready to test can import this change to verify which features are missing integration and/or integrated correctly. Once the feature set integration is complete and there is fair amount of approval from all of you, the core committers can decide on it.

Change-Id: I106fd3c54350dd0fd85fc44743e7f5321cb04110
Reviewed-on: https://code.wireshark.org/review/33454
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Arvind Dalvi 2019-06-04 01:05:46 +00:00 committed by Anders Broman
parent ee1dd899d0
commit 2331675eb5
1 changed files with 23 additions and 32 deletions

View File

@ -278,8 +278,6 @@ PacketList::PacketList(QWidget *parent) :
this, SIGNAL(showProtocolPreferences(QString)));
connect(&proto_prefs_menu_, SIGNAL(editProtocolPreference(preference*,pref_module*)),
this, SIGNAL(editProtocolPreference(preference*,pref_module*)));
setSelectionMode(ExtendedSelection);
}
void PacketList::colorsChanged()
@ -1611,39 +1609,32 @@ void PacketList::copySummary()
int copy_type = ca->data().toInt(&ok);
if (!ok) return;
QString copy_text;
QModelIndexList selectedRows = selectionModel()->selectedRows();
qSort(selectedRows);
foreach(QModelIndex index, selectedRows) {
QStringList col_parts;
int row = index.row();
for (int col = 0; col < packet_list_model_->columnCount(); col++) {
if (get_column_visible(col)) {
col_parts << packet_list_model_->data(packet_list_model_->index(row, col), Qt::DisplayRole).toString();
}
}
switch (copy_type) {
case copy_summary_csv_:
copy_text += "\"";
copy_text += col_parts.join("\",\"");
copy_text += "\"";
copy_text += "\n";
break;
case copy_summary_yaml_:
copy_text += "----\n";
copy_text += QString("# Packet %1 from %2\n").arg(row).arg(cap_file_->filename);
copy_text += "- ";
copy_text += col_parts.join("\n- ");
copy_text += "\n";
break;
case copy_summary_text_:
default:
copy_text += col_parts.join("\t");
copy_text += "\n";
QStringList col_parts;
int row = currentIndex().row();
for (int col = 0; col < packet_list_model_->columnCount(); col++) {
if (get_column_visible(col)) {
col_parts << packet_list_model_->data(packet_list_model_->index(row, col), Qt::DisplayRole).toString();
}
}
QString copy_text;
switch (copy_type) {
case copy_summary_csv_:
copy_text = "\"";
copy_text += col_parts.join("\",\"");
copy_text += "\"";
break;
case copy_summary_yaml_:
copy_text = "----\n";
copy_text += QString("# Packet %1 from %2\n").arg(row).arg(cap_file_->filename);
copy_text += "- ";
copy_text += col_parts.join("\n- ");
copy_text += "\n";
break;
case copy_summary_text_:
default:
copy_text = col_parts.join("\t");
}
wsApp->clipboard()->setText(copy_text);
}