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

Collapse All | Expand All

(-)file_not_specified_in_diff (-6 / +10 lines)
Line  Link Here
0
-- a/src/slic3r/GUI/Tab.cpp
0
++ b/src/slic3r/GUI/Tab.cpp
Lines 34-43 Link Here
34
#include <boost/algorithm/string/trim.hpp>
34
#include <boost/algorithm/string/trim.hpp>
35
#include <boost/filesystem.hpp>
35
#include <boost/filesystem.hpp>
36
#include <boost/filesystem/path.hpp>
36
#include <boost/filesystem/path.hpp>
37
#include <boost/lexical_cast.hpp>
37
#include <boost/lexical_cast.hpp>
38
38
39
#include <boost/nowide/fstream.hpp>
40
39
#include "wxExtensions.hpp"
41
#include "wxExtensions.hpp"
40
#include "PresetComboBoxes.hpp"
42
#include "PresetComboBoxes.hpp"
41
#include <wx/wupdlock.h>
43
#include <wx/wupdlock.h>
42
44
43
#include <libslic3r/GCodeWriter.hpp>
45
#include <libslic3r/GCodeWriter.hpp>
Lines 1564-1574 bool Tab::create_pages(std::string setti Link Here
1564
    int height = 0;
1566
    int height = 0;
1565
    bool logs = false;
1567
    bool logs = false;
1566
1568
1567
    //read file
1569
    //read file
1568
    //std::ifstream filestream(ui_layout_file.c_str());
1570
    //std::ifstream filestream(ui_layout_file.c_str());
1569
    boost::filesystem::ifstream filestream(ui_layout_file);
1571
    boost::nowide::ifstream filestream(ui_layout_file);
1570
    std::string full_line;
1572
    std::string full_line;
1571
    while (std::getline(filestream, full_line)) {
1573
    while (std::getline(filestream, full_line)) {
1572
        //remove spaces
1574
        //remove spaces
1573
        boost::algorithm::trim(full_line);
1575
        boost::algorithm::trim(full_line);
1574
        if (full_line.size() < 4 || full_line[0] == '#') continue;
1576
        if (full_line.size() < 4 || full_line[0] == '#') continue;
1575
-- a/src/slic3r/GUI/FreeCADDialog.cpp
1577
++ b/src/slic3r/GUI/FreeCADDialog.cpp
Lines 36-45 Link Here
36
#include <boost/iostreams/filtering_stream.hpp>
36
#include <boost/iostreams/filtering_stream.hpp>
37
#include <boost/log/trivial.hpp>
37
#include <boost/log/trivial.hpp>
38
#include <boost/property_tree/ptree.hpp>
38
#include <boost/property_tree/ptree.hpp>
39
#include <boost/property_tree/json_parser.hpp>
39
#include <boost/property_tree/json_parser.hpp>
40
40
41
#include <boost/nowide/fstream.hpp>
42
41
// 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'
42
// 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
43
// note: don't put it in a header, as it can create problems. Here it's safe enough to be used, as it's just applied for the process.hpp file and this source code.
45
// note: don't put it in a header, as it can create problems. Here it's safe enough to be used, as it's just applied for the process.hpp file and this source code.
44
#define pid_t pid_t
46
#define pid_t pid_t
45
#include <boost/process.hpp>
47
#include <boost/process.hpp>
Lines 90-100 namespace GUI { Link Here
90
                % url
92
                % url
91
                % http_status
93
                % http_status
92
                % error;
94
                % error;
93
        })
95
        })
94
            .on_complete([&](std::string body, unsigned /* http_status */) {
96
            .on_complete([&](std::string body, unsigned /* http_status */) {
95
            boost::filesystem::fstream file(tmp_path, std::ios::out | std::ios::binary | std::ios::trunc);
97
            boost::nowide::fstream file(tmp_path, std::ios::out | std::ios::binary | std::ios::trunc);
96
            file.write(body.c_str(), body.size());
98
            file.write(body.c_str(), body.size());
97
            file.close();
99
            file.close();
98
            boost::filesystem::rename(tmp_path, target_path);
100
            boost::filesystem::rename(tmp_path, target_path);
99
            res = true;
101
            res = true;
100
        })
102
        })
Lines 352-362 void FreeCADDialog::load_script(wxComman Link Here
352
bool FreeCADDialog::load_text_from_file(const boost::filesystem::path &path) {
354
bool FreeCADDialog::load_text_from_file(const boost::filesystem::path &path) {
353
    if (boost::filesystem::exists(path)) {
355
    if (boost::filesystem::exists(path)) {
354
        try {
356
        try {
355
            std::locale loc = boost::locale::generator()("en_US.UTF-8");
357
            std::locale loc = boost::locale::generator()("en_US.UTF-8");
356
            // Open the stream to 'lock' the file.
358
            // Open the stream to 'lock' the file.
357
            boost::filesystem::ifstream in;
359
            boost::nowide::ifstream in;
358
            in.imbue(loc);
360
            in.imbue(loc);
359
            in.open(path);
361
            in.open(path);
360
            // Obtain the size of the file.
362
            // Obtain the size of the file.
361
            const uintmax_t sz = boost::filesystem::file_size(path);
363
            const uintmax_t sz = boost::filesystem::file_size(path);
362
            // Create a buffer.
364
            // Create a buffer.
Lines 399-409 bool FreeCADDialog::write_text_in_file(c Link Here
399
    try {
401
    try {
400
        //add text if the saved file exist
402
        //add text if the saved file exist
401
        boost::filesystem::create_directories(file.parent_path());
403
        boost::filesystem::create_directories(file.parent_path());
402
        std::locale loc = boost::locale::generator()("en_US.UTF-8");
404
        std::locale loc = boost::locale::generator()("en_US.UTF-8");
403
        // Open the stream to 'lock' the file.
405
        // Open the stream to 'lock' the file.
404
        boost::filesystem::ofstream out;
406
        boost::nowide::ofstream out;
405
        out.imbue(loc);
407
        out.imbue(loc);
406
        out.open(file);
408
        out.open(file);
407
        out << towrite;
409
        out << towrite;
408
        out.close();
410
        out.close();
409
    }
411
    }

Return to bug 834547