Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 940498 | Differences between
and this patch

Collapse All | Expand All

(-)a/src/hints/HintsToPot.cpp (-1 / +1 lines)
Lines 9-15 Link Here
9
9
10
bool write_to_pot(boost::filesystem::path path, const std::vector<std::pair<std::string, std::string>>& data)
10
bool write_to_pot(boost::filesystem::path path, const std::vector<std::pair<std::string, std::string>>& data)
11
{
11
{
12
	boost::filesystem::ofstream file(std::move(path), std::ios_base::app);
12
	boost::nowide::ofstream file(path.string(), std::ios_base::app);
13
	for (const auto& element : data)
13
	for (const auto& element : data)
14
	{
14
	{
15
		//Example of .pot element 
15
		//Example of .pot element 
(-)a/src/libslic3r/AppConfig.hpp (+1 lines)
Lines 5-10 Link Here
5
#include <map>
5
#include <map>
6
#include <string>
6
#include <string>
7
7
8
#include <boost/filesystem/path.hpp>
8
#include <boost/algorithm/string/trim_all.hpp>
9
#include <boost/algorithm/string/trim_all.hpp>
9
10
10
#include "libslic3r/Config.hpp"
11
#include "libslic3r/Config.hpp"
(-)a/src/libslic3r/LocalesUtils.cpp (+1 lines)
Lines 1-3 Link Here
1
#include <boost/lexical_cast.hpp>
1
#include "LocalesUtils.hpp"
2
#include "LocalesUtils.hpp"
2
3
3
#ifdef _WIN32
4
#ifdef _WIN32
(-)a/src/libslic3r/Preset.cpp (-1 / +1 lines)
Lines 84-90 ConfigFileType guess_config_file_type(const ptree &tree) Link Here
84
VendorProfile VendorProfile::from_ini(const boost::filesystem::path &path, bool load_all)
84
VendorProfile VendorProfile::from_ini(const boost::filesystem::path &path, bool load_all)
85
{
85
{
86
    ptree tree;
86
    ptree tree;
87
    boost::filesystem::ifstream ifs(path);
87
    boost::nowide::ifstream ifs(path.string());
88
    boost::property_tree::read_ini(ifs, tree);
88
    boost::property_tree::read_ini(ifs, tree);
89
    return VendorProfile::from_ini(tree, path, load_all);
89
    return VendorProfile::from_ini(tree, path, load_all);
90
}
90
}
(-)a/src/libslic3r/Utils.hpp (+1 lines)
Lines 7-12 Link Here
7
#include <type_traits>
7
#include <type_traits>
8
#include <system_error>
8
#include <system_error>
9
9
10
#include <boost/filesystem.hpp>
10
#include <boost/system/error_code.hpp>
11
#include <boost/system/error_code.hpp>
11
12
12
#include "libslic3r.h"
13
#include "libslic3r.h"
(-)a/src/slic3r/GUI/CreateMMUTiledCanvas.cpp (+5 lines)
Lines 18-23 Link Here
18
#include <wx/notebook.h>
18
#include <wx/notebook.h>
19
#include "Notebook.hpp"
19
#include "Notebook.hpp"
20
20
21
#include <boost/filesystem.hpp>
22
#include <boost/property_tree/ptree.hpp>
23
#include <boost/property_tree/ini_parser.hpp>
24
#include <boost/log/trivial.hpp>
25
21
#include "MainFrame.hpp"
26
#include "MainFrame.hpp"
22
#include "wxExtensions.hpp"
27
#include "wxExtensions.hpp"
23
28
(-)a/src/slic3r/GUI/DesktopIntegrationDialog.cpp (-1 / +2 lines)
Lines 14-19 Link Here
14
#include <boost/log/trivial.hpp>
14
#include <boost/log/trivial.hpp>
15
#include <boost/dll/runtime_symbol_info.hpp>
15
#include <boost/dll/runtime_symbol_info.hpp>
16
#include <boost/algorithm/string/replace.hpp>
16
#include <boost/algorithm/string/replace.hpp>
17
#include <boost/nowide/fstream.hpp>
17
18
18
#include <wx/filename.h>
19
#include <wx/filename.h>
19
#include <wx/stattext.h>
20
#include <wx/stattext.h>
Lines 503-506 DesktopIntegrationDialog::~DesktopIntegrationDialog() Link Here
503
504
504
} // namespace GUI
505
} // namespace GUI
505
} // namespace Slic3r
506
} // namespace Slic3r
506
#endif // __linux__
507
#endif // __linux__
(-)a/src/slic3r/GUI/FreeCADDialog.cpp (-2 / +3 lines)
Lines 38-43 Link Here
38
#include <boost/log/trivial.hpp>
38
#include <boost/log/trivial.hpp>
39
#include <boost/property_tree/ptree.hpp>
39
#include <boost/property_tree/ptree.hpp>
40
#include <boost/property_tree/json_parser.hpp>
40
#include <boost/property_tree/json_parser.hpp>
41
#include <boost/nowide/fstream.hpp>
41
42
42
// hack for process.hpp : it uses pid_t to set it as alias of int, but vc_x64_lib (wx thingy) as a '#define pid_t int'
43
// hack for process.hpp : it uses pid_t to set it as alias of int, but vc_x64_lib (wx thingy) as a '#define pid_t int'
43
// and so boost/process has a line 'typedef int int'instead of 'typedef int pid_t' that makes it crash
44
// and so boost/process has a line 'typedef int int'instead of 'typedef int pid_t' that makes it crash
Lines 322-328 bool FreeCADDialog::load_text_from_file(const boost::filesystem::path &path) { Link Here
322
        try {
323
        try {
323
            std::locale loc = boost::locale::generator()("en_US.UTF-8");
324
            std::locale loc = boost::locale::generator()("en_US.UTF-8");
324
            // Open the stream to 'lock' the file.
325
            // Open the stream to 'lock' the file.
325
            boost::filesystem::ifstream in;
326
            boost::nowide::ifstream in;
326
            in.imbue(loc);
327
            in.imbue(loc);
327
            in.open(path);
328
            in.open(path);
328
            // Obtain the size of the file.
329
            // Obtain the size of the file.
Lines 369-375 bool FreeCADDialog::write_text_in_file(const wxString &towrite, const boost::fil Link Here
369
        boost::filesystem::create_directories(file.parent_path());
370
        boost::filesystem::create_directories(file.parent_path());
370
        std::locale loc = boost::locale::generator()("en_US.UTF-8");
371
        std::locale loc = boost::locale::generator()("en_US.UTF-8");
371
        // Open the stream to 'lock' the file.
372
        // Open the stream to 'lock' the file.
372
        boost::filesystem::ofstream out;
373
        boost::nowide::ofstream out;
373
        out.imbue(loc);
374
        out.imbue(loc);
374
        out.open(file);
375
        out.open(file);
375
        out << towrite;
376
        out << towrite;
(-)a/src/slic3r/GUI/GUI_App.cpp (+1 lines)
Lines 19-24 Link Here
19
#include <boost/lexical_cast.hpp>
19
#include <boost/lexical_cast.hpp>
20
#include <boost/log/trivial.hpp>
20
#include <boost/log/trivial.hpp>
21
#include <boost/nowide/convert.hpp>
21
#include <boost/nowide/convert.hpp>
22
#include <boost/nowide/fstream.hpp>
22
23
23
#include <wx/stdpaths.h>
24
#include <wx/stdpaths.h>
24
#include <wx/imagpng.h>
25
#include <wx/imagpng.h>
(-)a/src/slic3r/GUI/HintNotification.cpp (-3 / +5 lines)
Lines 14-25 Link Here
14
#include "libslic3r/Config.hpp"
14
#include "libslic3r/Config.hpp"
15
#include "libslic3r/PrintConfig.hpp"
15
#include "libslic3r/PrintConfig.hpp"
16
16
17
#include <map>
18
17
#include <boost/algorithm/string/replace.hpp>
19
#include <boost/algorithm/string/replace.hpp>
18
#include <boost/filesystem.hpp>
20
#include <boost/filesystem.hpp>
19
#include <boost/nowide/fstream.hpp>
21
#include <boost/nowide/fstream.hpp>
20
#include <boost/log/trivial.hpp>
22
#include <boost/log/trivial.hpp>
21
#include <boost/property_tree/ini_parser.hpp>
23
#include <boost/property_tree/ini_parser.hpp>
22
#include <map>
24
23
#include <cereal/archives/binary.hpp>
25
#include <cereal/archives/binary.hpp>
24
#include <cereal/types/string.hpp>
26
#include <cereal/types/string.hpp>
25
#include <cereal/types/vector.hpp>
27
#include <cereal/types/vector.hpp>
Lines 65-71 inline void push_style_color(ImGuiCol idx, const ImVec4& col, bool fading_out, f Link Here
65
67
66
void write_used_binary(const std::vector<std::string>& ids)
68
void write_used_binary(const std::vector<std::string>& ids)
67
{
69
{
68
	boost::filesystem::ofstream file((boost::filesystem::path(data_dir()) / "cache" / "hints.cereal"), std::ios::binary);
70
	boost::nowide::ofstream file((boost::filesystem::path(data_dir()) / "cache" / "hints.cereal").string(), std::ios::binary);
69
	cereal::BinaryOutputArchive archive(file);
71
	cereal::BinaryOutputArchive archive(file);
70
		HintsCerealData cd { ids };
72
		HintsCerealData cd { ids };
71
	try
73
	try
Lines 84-90 void read_used_binary(std::vector<std::string>& ids) Link Here
84
		BOOST_LOG_TRIVIAL(warning) << "Failed to load to hints.cereal. File does not exists. " << path.string();
86
		BOOST_LOG_TRIVIAL(warning) << "Failed to load to hints.cereal. File does not exists. " << path.string();
85
		return;
87
		return;
86
	}
88
	}
87
	boost::filesystem::ifstream file(path);
89
	boost::nowide::ifstream file(path.string());
88
	cereal::BinaryInputArchive archive(file);
90
	cereal::BinaryInputArchive archive(file);
89
	HintsCerealData cd;
91
	HintsCerealData cd;
90
	try
92
	try
(-)a/src/slic3r/GUI/PrintHostDialogs.cpp (-5 / +5 lines)
Lines 81-88 PrintHostSendDialog::PrintHostSendDialog(const fs::path &path, PrintHostPostUplo Link Here
81
    if (size_t extension_start = recent_path.find_last_of('.'); extension_start != std::string::npos)
81
    if (size_t extension_start = recent_path.find_last_of('.'); extension_start != std::string::npos)
82
        m_valid_suffix = recent_path.substr(extension_start);
82
        m_valid_suffix = recent_path.substr(extension_start);
83
    // .gcode suffix control
83
    // .gcode suffix control
84
    auto validate_path = [this](const wxString &path) -> bool {
84
    auto validate_path = [this](const std::wstring &path) -> bool {
85
        if (! path.Lower().EndsWith(m_valid_suffix.Lower())) {
85
        if (! wxString(path).Lower().EndsWith(m_valid_suffix.Lower())) {
86
            MessageDialog msg_wingow(this, wxString::Format(_L("Upload filename doesn't end with \"%s\". Do you wish to continue?"), m_valid_suffix), wxString(SLIC3R_APP_NAME), wxYES | wxNO);
86
            MessageDialog msg_wingow(this, wxString::Format(_L("Upload filename doesn't end with \"%s\". Do you wish to continue?"), m_valid_suffix), wxString(SLIC3R_APP_NAME), wxYES | wxNO);
87
            if (msg_wingow.ShowModal() == wxID_NO)
87
            if (msg_wingow.ShowModal() == wxID_NO)
88
                return false;
88
                return false;
Lines 92-98 PrintHostSendDialog::PrintHostSendDialog(const fs::path &path, PrintHostPostUplo Link Here
92
92
93
    auto* btn_ok = add_button(wxID_OK, true, _L("Upload"));
93
    auto* btn_ok = add_button(wxID_OK, true, _L("Upload"));
94
    btn_ok->Bind(wxEVT_BUTTON, [this, validate_path](wxCommandEvent&) {
94
    btn_ok->Bind(wxEVT_BUTTON, [this, validate_path](wxCommandEvent&) {
95
        if (validate_path(txt_filename->GetValue())) {
95
        if (validate_path(txt_filename->GetValue().ToStdWstring())) {
96
            post_upload_action = PrintHostPostUploadAction::None;
96
            post_upload_action = PrintHostPostUploadAction::None;
97
            EndDialog(wxID_OK);
97
            EndDialog(wxID_OK);
98
        }
98
        }
Lines 102-108 PrintHostSendDialog::PrintHostSendDialog(const fs::path &path, PrintHostPostUplo Link Here
102
    if (post_actions.has(PrintHostPostUploadAction::StartPrint)) {
102
    if (post_actions.has(PrintHostPostUploadAction::StartPrint)) {
103
        auto* btn_print = add_button(wxID_YES, false, _L("Upload and Print"));
103
        auto* btn_print = add_button(wxID_YES, false, _L("Upload and Print"));
104
        btn_print->Bind(wxEVT_BUTTON, [this, validate_path](wxCommandEvent&) {
104
        btn_print->Bind(wxEVT_BUTTON, [this, validate_path](wxCommandEvent&) {
105
            if (validate_path(txt_filename->GetValue())) {
105
            if (validate_path(txt_filename->GetValue().ToStdWstring())) {
106
                post_upload_action = PrintHostPostUploadAction::StartPrint;
106
                post_upload_action = PrintHostPostUploadAction::StartPrint;
107
                EndDialog(wxID_OK);
107
                EndDialog(wxID_OK);
108
            }
108
            }
Lines 113-119 PrintHostSendDialog::PrintHostSendDialog(const fs::path &path, PrintHostPostUplo Link Here
113
        // Using wxID_MORE as a button identifier to be different from the other buttons, wxID_MORE has no other meaning here.
113
        // Using wxID_MORE as a button identifier to be different from the other buttons, wxID_MORE has no other meaning here.
114
        auto* btn_simulate = add_button(wxID_MORE, false, _L("Upload and Simulate"));
114
        auto* btn_simulate = add_button(wxID_MORE, false, _L("Upload and Simulate"));
115
        btn_simulate->Bind(wxEVT_BUTTON, [this, validate_path](wxCommandEvent&) {
115
        btn_simulate->Bind(wxEVT_BUTTON, [this, validate_path](wxCommandEvent&) {
116
            if (validate_path(txt_filename->GetValue())) {
116
            if (validate_path(txt_filename->GetValue().ToStdWstring())) {
117
                post_upload_action = PrintHostPostUploadAction::StartSimulation;
117
                post_upload_action = PrintHostPostUploadAction::StartSimulation;
118
                EndDialog(wxID_OK);
118
                EndDialog(wxID_OK);
119
            }        
119
            }        
(-)a/src/slic3r/GUI/ScriptExecutor.cpp (+7 lines)
Lines 4-9 Link Here
4
#include "Tab.hpp"
4
#include "Tab.hpp"
5
#include "libslic3r/PresetBundle.hpp"
5
#include "libslic3r/PresetBundle.hpp"
6
#include "libslic3r/Print.hpp"
6
#include "libslic3r/Print.hpp"
7
#include <boost/log/trivial.hpp>
8
#include <boost/lexical_cast.hpp>
9
#include <boost/algorithm/string/trim_all.hpp>
10
#include <boost/algorithm/string/erase.hpp>
11
#include <boost/algorithm/string/split.hpp>
12
#include <boost/filesystem.hpp>
13
#include <boost/filesystem/string_file.hpp>
7
14
8
#include <string>
15
#include <string>
9
16
(-)a/src/slic3r/GUI/Tab.cpp (-1 / +1 lines)
Lines 1701-1707 std::vector<Slic3r::GUI::PageShp> Tab::create_pages(std::string setting_type_nam Link Here
1701
1703
1702
    //read file
1704
    //read file
1703
    //std::ifstream filestream(ui_layout_file.c_str());
1705
    //std::ifstream filestream(ui_layout_file.c_str());
1704
    boost::filesystem::ifstream filestream(ui_layout_file);
1706
    boost::nowide::ifstream filestream(ui_layout_file);
1705
    std::string full_line;
1707
    std::string full_line;
1706
    while (std::getline(filestream, full_line)) {
1708
    while (std::getline(filestream, full_line)) {
1707
        //remove spaces
1709
        //remove spaces
(-)a/src/slic3r/Utils/Http.cpp (-1 / +2 lines)
Lines 11-16 Link Here
11
#include <boost/filesystem.hpp>
11
#include <boost/filesystem.hpp>
12
#include <boost/format.hpp>
12
#include <boost/format.hpp>
13
#include <boost/log/trivial.hpp>
13
#include <boost/log/trivial.hpp>
14
#include <boost/nowide/fstream.hpp>
14
15
15
#include <curl/curl.h>
16
#include <curl/curl.h>
16
17
Lines 52-58 namespace Slic3r { Link Here
52
						% error;
53
						% error;
53
			})
54
			})
54
			.on_complete([&](std::string body, unsigned /* http_status */) {
55
			.on_complete([&](std::string body, unsigned /* http_status */) {
55
				boost::filesystem::fstream file(tmp_path, std::ios::out | std::ios::binary | std::ios::trunc);
56
				boost::nowide::fstream file(tmp_path, std::ios::out | std::ios::binary | std::ios::trunc);
56
				file.write(body.c_str(), body.size());
57
				file.write(body.c_str(), body.size());
57
				file.close();
58
				file.close();
58
				boost::filesystem::rename(tmp_path, target_path);
59
				boost::filesystem::rename(tmp_path, target_path);

Return to bug 940498