diff options
| author | Carl Hetherington <cth@carlh.net> | 2019-09-29 23:28:57 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2019-09-29 23:28:57 +0200 |
| commit | ab0e8cdcafdcb83096012380f674b8280474e851 (patch) | |
| tree | b89df2d9abcbf15e1a113db8ea3024aadc41edaa /src/wx | |
| parent | 9a6d5d07edef459e6e7ac1708f32c34981d6cd05 (diff) | |
Improve OpenFileError so that it doesn't say "opening for read"v2.15.20
in one case where it should say "opening for read/write".
Also add some unit tests for ReelWriter.
Diffstat (limited to 'src/wx')
| -rw-r--r-- | src/wx/config_dialog.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/wx/config_dialog.cc b/src/wx/config_dialog.cc index a6b299bcb..98a1a1a8e 100644 --- a/src/wx/config_dialog.cc +++ b/src/wx/config_dialog.cc @@ -579,7 +579,7 @@ CertificateChainEditor::export_certificate () boost::filesystem::path path (wx_to_std(d->GetPath())); FILE* f = fopen_boost (path, "w"); if (!f) { - throw OpenFileError (path, errno, false); + throw OpenFileError (path, errno, OpenFileError::WRITE); } string const s = j->certificate (true); @@ -601,7 +601,7 @@ CertificateChainEditor::export_chain () boost::filesystem::path path (wx_to_std(d->GetPath())); FILE* f = fopen_boost (path, "w"); if (!f) { - throw OpenFileError (path, errno, false); + throw OpenFileError (path, errno, OpenFileError::WRITE); } string const s = _get()->chain(); @@ -775,7 +775,7 @@ CertificateChainEditor::export_private_key () boost::filesystem::path path (wx_to_std(d->GetPath())); FILE* f = fopen_boost (path, "w"); if (!f) { - throw OpenFileError (path, errno, false); + throw OpenFileError (path, errno, OpenFileError::WRITE); } string const s = _get()->key().get (); @@ -868,7 +868,7 @@ KeysPage::export_decryption_chain_and_key () boost::filesystem::path path (wx_to_std(d->GetPath())); FILE* f = fopen_boost (path, "w"); if (!f) { - throw OpenFileError (path, errno, false); + throw OpenFileError (path, errno, OpenFileError::WRITE); } string const chain = Config::instance()->decryption_chain()->chain(); @@ -903,7 +903,7 @@ KeysPage::import_decryption_chain_and_key () FILE* f = fopen_boost (wx_to_std (d->GetPath ()), "r"); if (!f) { - throw OpenFileError (wx_to_std (d->GetPath ()), errno, false); + throw OpenFileError (wx_to_std (d->GetPath ()), errno, OpenFileError::WRITE); } string current; @@ -955,7 +955,7 @@ KeysPage::export_decryption_certificate () boost::filesystem::path path (wx_to_std(d->GetPath())); FILE* f = fopen_boost (path, "w"); if (!f) { - throw OpenFileError (path, errno, false); + throw OpenFileError (path, errno, OpenFileError::WRITE); } string const s = Config::instance()->decryption_chain()->leaf().certificate (true); |
