Commit 2c06d4a9 authored by Pierre Kim's avatar Pierre Kim

Fix non-latin directory bug

parent 727ff414
......@@ -25,7 +25,7 @@ CommandLineParser::CommandLineParser(QObject* _parent) : QObject(_parent), m_par
"add-priority-node and seed-node are ignored"), tr("node")),
m_seedNodeOption("seed-node", tr("Connect to a node to retrieve peer addresses, and disconnect"), tr("node")),
m_hideMyPortOption("hide-my-port", tr("Do not announce yourself as peerlist candidate")),
m_dataDirOption("data-dir", tr("Specify data directory"), tr("directory"), QString::fromStdString(Tools::getDefaultDataDirectory())),
m_dataDirOption("data-dir", tr("Specify data directory"), tr("directory"), QString::fromStdWString(Tools::getDefaultDataDirectoryW())),
m_minimized("minimized", tr("Run application in minimized mode")) {
m_parser.setApplicationDescription(tr("ManateeCoin wallet"));
m_parser.addHelpOption();
......
......@@ -218,7 +218,7 @@ void NodeAdapter::deinit() {
CryptoNote::CoreConfig NodeAdapter::makeCoreConfig() const {
CryptoNote::CoreConfig config;
boost::program_options::variables_map options;
boost::any dataDir = Settings::instance().getDataDir().absolutePath().toStdString();
boost::any dataDir = std::string(Settings::instance().getDataDir().absolutePath().toLocal8Bit().data());
options.insert(std::make_pair("data-dir", boost::program_options::variable_value(dataDir, false)));
config.init(options);
return config;
......@@ -231,7 +231,7 @@ CryptoNote::NetNodeConfig NodeAdapter::makeNetNodeConfig() const {
boost::any p2pBindPort = static_cast<uint16_t>(Settings::instance().getP2pBindPort());
boost::any p2pExternalPort = static_cast<uint16_t>(Settings::instance().getP2pExternalPort());
boost::any p2pAllowLocalIp = Settings::instance().hasAllowLocalIpOption();
boost::any dataDir = Settings::instance().getDataDir().absolutePath().toStdString();
boost::any dataDir = std::string(Settings::instance().getDataDir().absolutePath().toLocal8Bit().data());
boost::any hideMyPort = Settings::instance().hasHideMyPortOption();
options.insert(std::make_pair("p2p-bind-ip", boost::program_options::variable_value(p2pBindIp, false)));
options.insert(std::make_pair("p2p-bind-port", boost::program_options::variable_value(p2pBindPort, false)));
......
......@@ -385,7 +385,11 @@ void WalletAdapter::unlock() {
bool WalletAdapter::openFile(const QString& _file, bool _readOnly) {
lock();
#ifdef Q_OS_WIN
m_file.open(_file.toStdWString(), std::ios::binary | (_readOnly ? std::ios::in : (std::ios::out | std::ios::trunc)));
#else
m_file.open(_file.toStdString(), std::ios::binary | (_readOnly ? std::ios::in : (std::ios::out | std::ios::trunc)));
#endif
if (!m_file.is_open()) {
unlock();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment