From d780907258a11d49ad43ecc54bc3c2767fb43206 Mon Sep 17 00:00:00 2001 From: Ariel Vina-Rodriguez Date: Tue, 30 Jul 2019 15:48:14 +0200 Subject: [PATCH 1/2] nana master points to nana-demo master --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 82604edf..e81bb117 100644 --- a/.travis.yml +++ b/.travis.yml @@ -44,7 +44,7 @@ matrix: before_install: - cd .. - - git clone --depth=1 --branch=develop https://github.com/qPCR4vir/nana-demo.git nana-demo + - git clone --depth=1 --branch=master https://github.com/qPCR4vir/nana-demo.git nana-demo - export PATH="$HOME/bin:$PATH" - wget --no-check-certificate --no-clobber -O /tmp/tools/cmake https://cmake.org/files/v3.12/cmake-3.12.0-rc3-Linux-x86_64.sh || true - chmod -R +x /tmp/tools From 7c442360ba95b53e241e951960ba0a7faef743ad Mon Sep 17 00:00:00 2001 From: Zaha Mihai <1395028+mihaizh@users.noreply.github.com> Date: Sun, 1 Sep 2019 17:53:23 +0300 Subject: [PATCH 2/2] Fix inconsistency regarding filebox multi_select When only one file is selected, the lpstrFile variable contains only the path to that file, without the parent path before that, thus, the targets vector is empty and the path variable contains the actual path to the file. This is inconsistent with the scenario where multiple files are selected, in which targets contains the file paths and path contains the parent directory path. --- source/gui/filebox.cpp | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/source/gui/filebox.cpp b/source/gui/filebox.cpp index 06dfed84..f2417087 100644 --- a/source/gui/filebox.cpp +++ b/source/gui/filebox.cpp @@ -1516,14 +1516,24 @@ namespace nana path_type parent_path{ str }; str += (len + 1); - - while(*str) + + // if only one file was selected, the ofn.lpstrFile + // is returning only that file, without any parent + if (!*str) { - len = ::wcslen(str); - targets.emplace_back(parent_path / path_type{str}); - str += (len + 1); + targets.emplace_back(parent_path); + impl_->path = parent_path.parent_path().u8string(); + } + else + { + while(*str) + { + len = ::wcslen(str); + targets.emplace_back(parent_path / path_type{str}); + str += (len + 1); + } + impl_->path = parent_path.u8string(); } - impl_->path = parent_path.u8string(); } else {