The Birdfont Source Code


All Repositories / birdfont.git / commit – RSS feed

Fix drive letter problems in Windows paths

These changes was commited to the Birdfont repository Fri, 17 Oct 2014 18:03:14 +0000.

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git
author Johan Mattsson <johan.mattsson.m@gmail.com>
Fri, 17 Oct 2014 18:03:14 +0000 (20:03 +0200)
committer Johan Mattsson <johan.mattsson.m@gmail.com>
Fri, 17 Oct 2014 18:03:14 +0000 (20:03 +0200)
commit 6d02671a1d038ecae3d053cad3fca76c7ffabc4a
tree 0ba2da0c089134020400c4e4ba479fa0630b1c79
parent ae7e78b0cb7a9baca70db8fa98fdecbcc030a2b1
Fix drive letter problems in Windows paths

libbirdfont/FileDialogTab.vala
libbirdfont/Font.vala
--- a/libbirdfont/FileDialogTab.vala +++ b/libbirdfont/FileDialogTab.vala @@ -225,12 +225,12 @@ selected = ""; - foreach (string file in directories) { + foreach (string d in directories) { if (s++ >= scroll) { y += 18 * MainWindow.units; if (y - 10 * MainWindow.units <= ey <= y + 5 * MainWindow.units) { - selected = file; + selected = d; dir = true; } } @@ -253,8 +253,13 @@ if (selected == "..") { propagate_files ((!)((!)current_dir.get_parent ()).get_path ()); } else { - f = get_child (current_dir, selected); - propagate_files ((!) f.get_path ()); + + if (selected.index_of (":\\") != -1) { + propagate_files (selected); + } else { + f = get_child (current_dir, selected); + propagate_files ((!) f.get_path ()); + } } } }
--- a/libbirdfont/Font.vala +++ b/libbirdfont/Font.vala @@ -243,7 +243,11 @@ } else { p = p.substring (0, i); } - + + if (p.index_of (":") != -1 && p.char_count () == 2) { + p += "\\"; + } + return p; }