comparison ui/mainwindow.cpp @ 479:a8d56a2846a8

Fill the internal list of previously unselcted certificates when saving in settings.
author Raimund Renkert <rrenkert@intevation.de>
date Thu, 24 Apr 2014 12:01:34 +0200
parents 1ce835c40eb7
children 242f2bf5417e
comparison
equal deleted inserted replaced
474:bcae22d57e67 479:a8d56a2846a8
655 mSettings.endGroup(); 655 mSettings.endGroup();
656 } 656 }
657 657
658 bool MainWindow::saveUnselectedCertificates() 658 bool MainWindow::saveUnselectedCertificates()
659 { 659 {
660 mPreviouslyUnselected.clear();
660 mSettings.beginGroup("unselected"); 661 mSettings.beginGroup("unselected");
661 mSettings.remove(""); /* Clears old choices */ 662 mSettings.remove(""); /* Clears old choices */
662 for (int i = 0; i < mCertListWidget->count(); i++) { 663 for (int i = 0; i < mCertListWidget->count(); i++) {
663 QListWidgetItem *item = mCertListWidget->item(i); 664 QListWidgetItem *item = mCertListWidget->item(i);
664 if (item->checkState() != Qt::Checked && 665 if (item->checkState() != Qt::Checked &&
665 (item->flags() & Qt::ItemIsUserCheckable)) { 666 (item->flags() & Qt::ItemIsUserCheckable)) {
666 mSettings.setValue(QString::fromLatin1("cert%1").arg(i), 667 QString key = QString::fromLatin1("cert%1").arg(i);
667 item->data(CertificateItemDelegate::DataRole).value<Certificate>().base64Line()); 668 QString value =
669 item->data(CertificateItemDelegate::DataRole).value<Certificate>().base64Line();
670 mSettings.setValue(key, value);
671 mPreviouslyUnselected << value;
668 } 672 }
669 } 673 }
670 mSettings.endGroup(); 674 mSettings.endGroup();
671 mSettings.sync(); 675 mSettings.sync();
672 return mSettings.status() == QSettings::NoError; 676 return mSettings.status() == QSettings::NoError;

http://wald.intevation.org/projects/trustbridge/