summaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorJiri Novak <j.novak@netsystem.cz>2016-12-12 21:13:34 +0100
committerAnders Broman <a.broman58@gmail.com>2016-12-14 05:38:51 +0000
commitda06f7c8b5e49d288114db619c7e365cf1a7a649 (patch)
tree68d37fb33047243f7539e3cf34ee5c02d0fe267b /ui
parente6dcb061b57f081e4803b804f221d328914eee56 (diff)
downloadwireshark-da06f7c8b5e49d288114db619c7e365cf1a7a649.tar.gz
RTP Stream Analysis: save Audio allows any filename extension
Format of file selected by user is derived from save dialog format selection, not from filename as before. Bug: 13240 Change-Id: Id6e159d97e4f26c25b3d2d98d43041d8617cc737 Reviewed-on: https://code.wireshark.org/review/19240 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'ui')
-rw-r--r--ui/qt/rtp_analysis_dialog.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/ui/qt/rtp_analysis_dialog.cpp b/ui/qt/rtp_analysis_dialog.cpp
index 2bac1f183e..de6aae3f30 100644
--- a/ui/qt/rtp_analysis_dialog.cpp
+++ b/ui/qt/rtp_analysis_dialog.cpp
@@ -1066,9 +1066,13 @@ void RtpAnalysisDialog::saveAudio(RtpAnalysisDialog::StreamDirection direction)
break;
}
- QString ext_filter = tr("Sun Audio (*.au)");
+ QString ext_filter = "";
+ QString ext_filter_au = tr("Sun Audio (*.au)");
+ QString ext_filter_raw = tr("Raw (*.raw)");
+ ext_filter.append(ext_filter_au);
if (direction != dir_both_) {
- ext_filter.append(tr(";;Raw (*.raw)"));
+ ext_filter.append(";;");
+ ext_filter.append(ext_filter_raw);
}
QString sel_filter;
QString file_path = QFileDialog::getSaveFileName(
@@ -1078,9 +1082,9 @@ void RtpAnalysisDialog::saveAudio(RtpAnalysisDialog::StreamDirection direction)
if (file_path.isEmpty()) return;
int save_format = save_audio_none_;
- if (file_path.endsWith(".au")) {
+ if (0 == QString::compare(sel_filter, ext_filter_au)) {
save_format = save_audio_au_;
- } else if (file_path.endsWith(".raw")) {
+ } else if (0 == QString::compare(sel_filter, ext_filter_raw)) {
save_format = save_audio_raw_;
}