From 8de52b3f069fde3b1bfb86061bdaf9f4c31d73e4 Mon Sep 17 00:00:00 2001 From: Vadim Kurland Date: Wed, 16 Feb 2011 15:49:02 -0800 Subject: [PATCH] fixes #2093 build failed because function QStringList::removeDuplicates() is only available in Qt 4.5 --- src/pflib/OSConfigurator_bsd_interfaces.cpp | 15 ++++++++++++++- test/pf/objects-for-regression-tests.fwb | 15 ++++++++++++--- test/pf/pf_cluster_4_rc.conf.local | 2 +- 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/src/pflib/OSConfigurator_bsd_interfaces.cpp b/src/pflib/OSConfigurator_bsd_interfaces.cpp index 0679039e7..56061d7b3 100644 --- a/src/pflib/OSConfigurator_bsd_interfaces.cpp +++ b/src/pflib/OSConfigurator_bsd_interfaces.cpp @@ -286,10 +286,23 @@ string OSConfigurator_bsd::configureInterfaces() // sort interfaces by name all_names.sort(); + // remove duplicates. We get duplicates in all_names when an // interface appears twice, once as a bridge port and another time as // vlan parent interface - all_names.removeDuplicates(); + // + // Note that QStringList::removeDuplicates() is only available in Qt 4.5 + // all_names.removeDuplicates(); + + QStringList deduplicated_names; + QString prev; + foreach(QString name, all_names) + { + if (name != prev) deduplicated_names << name; + prev = name; + } + all_names = deduplicated_names; + ipv6_names.sort(); intf_names.sort(); diff --git a/test/pf/objects-for-regression-tests.fwb b/test/pf/objects-for-regression-tests.fwb index b99c47a87..23f15ee4e 100644 --- a/test/pf/objects-for-regression-tests.fwb +++ b/test/pf/objects-for-regression-tests.fwb @@ -22589,7 +22589,7 @@ - + @@ -22627,13 +22627,22 @@ + + + + + + + + + @@ -22673,7 +22682,7 @@ - + @@ -22683,7 +22692,7 @@ - + diff --git a/test/pf/pf_cluster_4_rc.conf.local b/test/pf/pf_cluster_4_rc.conf.local index 8cef65cb2..0746f971f 100755 --- a/test/pf/pf_cluster_4_rc.conf.local +++ b/test/pf/pf_cluster_4_rc.conf.local @@ -3,7 +3,7 @@ # # Firewall Builder fwb_pf v4.2.0.3479 # -# Generated Wed Feb 16 15:16:52 2011 PST by vadim +# Generated Wed Feb 16 15:46:54 2011 PST by vadim # # files: * pf_cluster_4_rc.conf.local /etc/pf_cluster_4_rc.conf.local # files: pf_cluster_4_pf.conf /etc/pf_cluster_4_pf.conf