[gnome-boxes] wizard: Case-insensitive check for file extension
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-boxes] wizard: Case-insensitive check for file extension
- Date: Tue, 14 Apr 2015 13:32:55 +0000 (UTC)
commit 4fa6ef1e37e91890b2df70f842397cae4c9d3c63
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date: Tue Apr 14 14:30:05 2015 +0100
wizard: Case-insensitive check for file extension
File names and extensions could be in any case so lets check files'
extensions in a case-insensitive way.
This fixes out of the box support for latest Windows ISOs that have
filenames in all caps.
https://bugzilla.gnome.org/show_bug.cgi?id=746764
src/wizard.vala | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/wizard.vala b/src/wizard.vala
index abb60db..7c269d7 100644
--- a/src/wizard.vala
+++ b/src/wizard.vala
@@ -277,12 +277,16 @@ private class Boxes.Wizard: Gtk.Stack, Boxes.UI {
var supported = false;
var extensions = InstalledMedia.supported_extensions;
extensions += "iso";
- foreach (var extension in extensions)
- if (path.has_suffix (extension)) {
+ foreach (var extension in extensions) {
+ var path_casefolded = path.casefold ();
+ var extension_casefolded = extension.casefold ();
+
+ if (path_casefolded.has_suffix (extension_casefolded)) {
supported = true;
break;
}
+ }
if (!supported)
throw new Boxes.Error.INVALID (_("Unsupported file"));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]