Commit f05004c7 authored by hjk's avatar hjk Committed by hjk

valgrind: use native dialog for suppression files.

This loses the "history list" feature.

Task-number: QTCREATORBUG-6466
Change-Id: If3551627a8457853c0dedee7a61b388ff323298d
Reviewed-by: default avatarhjk <qthjk@ovi.com>
parent f5f51b62
......@@ -176,24 +176,20 @@ void ValgrindConfigWidget::updateUi()
void ValgrindConfigWidget::slotAddSuppression()
{
QFileDialog dialog;
dialog.setNameFilter(tr("Valgrind Suppression File (*.supp);;All Files (*)"));
dialog.setAcceptMode(QFileDialog::AcceptOpen);
dialog.setFileMode(QFileDialog::ExistingFiles);
ValgrindGlobalSettings *conf = Analyzer::AnalyzerGlobalSettings::instance()->subConfig<ValgrindGlobalSettings>();
QTC_ASSERT(conf, return);
dialog.setDirectory(conf->lastSuppressionDialogDirectory());
dialog.setHistory(conf->lastSuppressionDialogHistory());
if (dialog.exec() == QDialog::Accepted) {
foreach (const QString &file, dialog.selectedFiles())
QStringList files = QFileDialog::getOpenFileNames(this,
tr("Valgrind Suppression Files"),
conf->lastSuppressionDialogDirectory(),
tr("Valgrind Suppression File (*.supp);;All Files (*)"));
//dialog.setHistory(conf->lastSuppressionDialogHistory());
if (!files.isEmpty()) {
foreach (const QString &file, files)
m_model->appendRow(new QStandardItem(file));
m_settings->addSuppressionFiles(dialog.selectedFiles());
m_settings->addSuppressionFiles(files);
conf->setLastSuppressionDialogDirectory(QFileInfo(files.at(0)).absolutePath());
//conf->setLastSuppressionDialogHistory(dialog.history());
}
conf->setLastSuppressionDialogDirectory(dialog.directory().absolutePath());
conf->setLastSuppressionDialogHistory(dialog.history());
}
void ValgrindConfigWidget::slotSuppressionsAdded(const QStringList &files)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment