Merged the hostap_2.6 updates, and the Leap of Faith work, from the hostap_update...
[mech_eap.git] / libeap / wpa_supplicant / wpa_gui-qt4 / scanresultsitem.cpp
diff --git a/libeap/wpa_supplicant/wpa_gui-qt4/scanresultsitem.cpp b/libeap/wpa_supplicant/wpa_gui-qt4/scanresultsitem.cpp
new file mode 100644 (file)
index 0000000..9cd937c
--- /dev/null
@@ -0,0 +1,18 @@
+/*
+ * wpa_gui - ScanResultsItem class
+ * Copyright (c) 2015, Adrian Nowicki <adinowicki@gmail.com>
+ *
+ * This software may be distributed under the terms of the BSD license.
+ * See README for more details.
+ */
+
+#include "scanresultsitem.h"
+
+bool ScanResultsItem::operator< (const QTreeWidgetItem &other) const
+{
+       int sortCol = treeWidget()->sortColumn();
+       if (sortCol == 2 || sortCol == 3) {
+               return text(sortCol).toInt() < other.text(sortCol).toInt();
+       }
+       return text(sortCol) < other.text(sortCol);
+}