31 |
31 |
32 #ifdef Q_OS_SYMBIAN |
32 #ifdef Q_OS_SYMBIAN |
33 #include <securitydefs.h> // EValidatedOK, ESignatureInvalid, EDateOutOfRange |
33 #include <securitydefs.h> // EValidatedOK, ESignatureInvalid, EDateOutOfRange |
34 #endif |
34 #endif |
35 |
35 |
36 const QString RootDir = "c:/"; |
36 const QString KTestCertDir = "c:/data/testCerts"; |
37 |
37 |
38 |
38 |
39 UntrustedCertDialogLauncher::UntrustedCertDialogLauncher(int& argc, char* argv[]) |
39 UntrustedCertDialogLauncher::UntrustedCertDialogLauncher(int& argc, char* argv[]) |
40 : HbApplication(argc, argv), mMainWindow(0), mMainView(0) |
40 : HbApplication(argc, argv), mMainWindow(0), mMainView(0) |
41 { |
41 { |
48 HbLabel *certFile = new HbLabel(tr("Certificate file:")); |
48 HbLabel *certFile = new HbLabel(tr("Certificate file:")); |
49 layout->addItem(certFile); |
49 layout->addItem(certFile); |
50 |
50 |
51 mFilesList = new HbComboBox; |
51 mFilesList = new HbComboBox; |
52 mFilesList->setEditable(false); |
52 mFilesList->setEditable(false); |
53 QDir dir(RootDir); |
53 QDir dir(KTestCertDir); |
54 if (dir.exists()) { |
54 if (dir.exists()) { |
55 QFileInfoList list = dir.entryInfoList(QDir::Files); |
55 QFileInfoList list = dir.entryInfoList(QDir::Files); |
56 QListIterator<QFileInfo> iter(list); |
56 QListIterator<QFileInfo> iter(list); |
57 while (iter.hasNext()) { |
57 while (iter.hasNext()) { |
58 const QFileInfo &info(iter.next()); |
58 const QFileInfo &info(iter.next()); |
59 mFilesList->addItem(info.fileName()); |
59 mFilesList->addItem(info.fileName()); |
60 } |
60 } |
61 } |
61 } |
62 layout->addItem(mFilesList); |
62 layout->addItem(mFilesList); |
63 |
63 |
64 mHostName = new HbTextEdit(tr("some.host.name.com")); |
64 mHostName = new HbTextEdit(tr("some.host.com")); |
65 layout->addItem(mHostName); |
65 layout->addItem(mHostName); |
66 |
66 |
67 HbPushButton *button = 0; |
67 HbPushButton *button = 0; |
68 button = new HbPushButton("Open (valid)"); |
68 button = new HbPushButton("Open (valid)"); |
69 connect(button, SIGNAL(clicked()), this, SLOT(activateDialogDateValid())); |
69 connect(button, SIGNAL(clicked()), this, SLOT(activateDialogDateValid())); |
113 { |
113 { |
114 QVariantMap params; |
114 QVariantMap params; |
115 |
115 |
116 QString fileName = mFilesList->currentText(); |
116 QString fileName = mFilesList->currentText(); |
117 QFile file; |
117 QFile file; |
118 QDir::setCurrent(RootDir); |
118 QDir::setCurrent(KTestCertDir); |
119 file.setFileName(fileName); |
119 file.setFileName(fileName); |
120 file.open(QIODevice::ReadOnly); |
120 file.open(QIODevice::ReadOnly); |
121 QByteArray fileContent = file.readAll(); |
121 QByteArray fileContent = file.readAll(); |
122 file.close(); |
122 file.close(); |
123 |
123 |