Skip to content

Commit

Permalink
Convert paths with string() instead of native()
Browse files Browse the repository at this point in the history
Apparently the latter causes problems with Windows compilers.
  • Loading branch information
vimpostor committed Nov 6, 2023
1 parent 250849b commit 67a813e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Models/path_model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ QVariant PathModel::data(const QModelIndex &index, int role) const {
const auto &p = paths[index.row()];
switch (role) {
case PathRole:
return QString::fromStdString(p.path);
return QString::fromStdString(p.path.string());
case UriRole:
return QString::fromStdString(p.get_uri());
case PrettyRole:
Expand Down
4 changes: 2 additions & 2 deletions src/path.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ std::string Path::get_uri() const {
}

QUrl Path::get_url() const {
return QUrl::fromLocalFile(QString::fromStdString(path.native()));
return QUrl::fromLocalFile(QString::fromStdString(path.string()));
}

std::string Path::pretty_print() const {
std::string result = path.native();
std::string result = path.string();

const auto pwd = Util::pwd() + std::string(1, std::filesystem::path::preferred_separator);
const auto home = Util::home_dir();
Expand Down

0 comments on commit 67a813e

Please sign in to comment.