comparison ui/listupdatedialog.cpp @ 128:95d35ec93bbe

Supply the cinst process with checked items not with selected ones
author Andre Heinecke <aheinecke@intevation.de>
date Mon, 24 Mar 2014 10:18:31 +0000
parents 04dcc0fb1eca
children 39b7930fbca9
comparison
equal deleted inserted replaced
127:04dcc0fb1eca 128:95d35ec93bbe
41 qWarning() << "Invalid certificate in list"; 41 qWarning() << "Invalid certificate in list";
42 continue; 42 continue;
43 } 43 }
44 QListWidgetItem* item = new QListWidgetItem(cert.shortDescription()); 44 QListWidgetItem* item = new QListWidgetItem(cert.shortDescription());
45 item->setFlags(item->flags() | Qt::ItemIsUserCheckable); 45 item->setFlags(item->flags() | Qt::ItemIsUserCheckable);
46 item->setData(Qt::ToolTipRole, cert.details());
47 item->setData(Qt::UserRole, cert.base64Line());
46 item->setCheckState(Qt::Checked); 48 item->setCheckState(Qt::Checked);
47 mRemoveListWidget->addItem(item); 49 mRemoveListWidget->addItem(item);
48 } 50 }
49 51
50 /* The install group */ 52 /* The install group */
97 if (installerProcess.state() == QProcess::NotRunning) { 99 if (installerProcess.state() == QProcess::NotRunning) {
98 qWarning() << "Failed to start installer Process."; 100 qWarning() << "Failed to start installer Process.";
99 /* TODO ERROR message for the user */ 101 /* TODO ERROR message for the user */
100 return; 102 return;
101 } 103 }
104
102 installerProcess.write("-----BEGIN CERTIFICATE LIST-----\r\n"); 105 installerProcess.write("-----BEGIN CERTIFICATE LIST-----\r\n");
103 installerProcess.write(mCertificateList.rawData().toLatin1()); 106 installerProcess.write(mCertificateList.rawData().toLatin1());
104 installerProcess.write("-----END CERTIFICATE LIST-----\r\n"); 107 installerProcess.write("-----END CERTIFICATE LIST-----\r\n");
105 108
106 QList<QListWidgetItem *> selectedItems = mInstallListWidget->selectedItems(); 109 /* Items to install */
107 selectedItems << mRemoveListWidget->selectedItems(); 110 for (int i = 0; i < mInstallListWidget->count(); i++) {
111 QListWidgetItem *item = mInstallListWidget->item(i);
112 if (!item->checkState() == Qt::Checked) {
113 continue;
114 }
115 installerProcess.write(item->data(Qt::UserRole).toString().toLatin1());
116 installerProcess.write("\r\n");
117 }
108 118
109 foreach (const QListWidgetItem * item, selectedItems) { 119 /* Items to remove */
120 for (int i = 0; i < mRemoveListWidget->count(); i++) {
121 QListWidgetItem *item = mRemoveListWidget->item(i);
122 if (!item->checkState() == Qt::Checked) {
123 continue;
124 }
110 installerProcess.write(item->data(Qt::UserRole).toString().toLatin1()); 125 installerProcess.write(item->data(Qt::UserRole).toString().toLatin1());
111 installerProcess.write("\r\n"); 126 installerProcess.write("\r\n");
112 } 127 }
113 128
114 installerProcess.closeWriteChannel(); 129 installerProcess.closeWriteChannel();

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