summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--Makefile14
-rw-r--r--development/performance/opie-performance.control1
-rw-r--r--noncore/multimedia/powerchord/opie-powerchord.control1
-rw-r--r--noncore/settings/networksettings2/opietooth2/OTMainGUI.ui393
-rw-r--r--noncore/settings/networksettings2/opietooth2/Opietooth.cpp32
-rw-r--r--noncore/settings/networksettings2/opietooth2/Opietooth.h31
-rw-r--r--noncore/settings/networksettings2/opietooth2/opietooth2.pro2
-rw-r--r--noncore/settings/packagemanager/opackagemanager.cpp7
8 files changed, 352 insertions, 129 deletions
diff --git a/Makefile b/Makefile
index a1fc32c..89c3470 100644
--- a/Makefile
+++ b/Makefile
@@ -1,136 +1,150 @@
#!/usr/bin/make -f
export TOPDIR:=$(OPIEDIR)
include $(TOPDIR)/Vars.make
ifneq ($(wildcard $(TOPDIR)/Vars.local),)
include $(TOPDIR)/Vars.local
endif
noconfig_targets := xconfig menuconfig config oldconfig randconfig \
defconfig allyesconfig allnoconfig allmodconfig \
clean-configs $(TOPDIR)/scripts/subst $(TOPDIR)/scripts/filesubst \
ipks
configs += $(TOPDIR)/core/applets/config.in $(TOPDIR)/core/apps/config.in $(TOPDIR)/core/multimedia/config.in $(TOPDIR)/core/pim/config.in $(TOPDIR)/core/pim/today/plugins/config.in $(TOPDIR)/core/settings/config.in $(TOPDIR)/development/config.in $(TOPDIR)/inputmethods/config.in $(TOPDIR)/noncore/applets/config.in $(TOPDIR)/noncore/apps/opie-console/test/config.in $(TOPDIR)/noncore/apps/config.in $(TOPDIR)/noncore/comm/config.in $(TOPDIR)/noncore/decorations/config.in $(TOPDIR)/noncore/games/config.in $(TOPDIR)/noncore/graphics/config.in $(TOPDIR)/noncore/multimedia/config.in $(TOPDIR)/noncore/net/config.in $(TOPDIR)/noncore/net/opietooth/config.in $(TOPDIR)/noncore/settings/config.in $(TOPDIR)/noncore/styles/config.in $(TOPDIR)/noncore/tools/config.in $(TOPDIR)/noncore/todayplugins/config.in $(TOPDIR)/examples/config.in $(TOPDIR)/noncore/securityplugins/config.in
# $(TOPDIR)/.config depends on .depends.cfgs, as it depends on $(configs)
# in order to have a full set of config.in files.
# .depends depends on $(TOPDIR)/.config
# everything else depends on .depends, to ensure the dependencies are
# intact.
#
# NOTE: The order in which things happen in this makefile is
# -critical-. Do not rearrange this!
all : $(TOPDIR)/.config
#
# The IPK creation is a very slow process. If you want to only create some
# IPKs, e.g. the ones in library, then do
# make ipks IPK_START=library
# and then only the *.control files in this directory will be processed
ipks: $(OPIEDIR)/scripts/subst $(OPIEDIR)/scripts/filesubst FORCE $(TOPDIR)/.config
@find $(OPIEDIR)/$(IPK_START) -type f -name \*.control | ( for ctrl in `cat`; do \
prerm=`echo $${ctrl/.control/.prerm}`; \
preinst=`echo $${ctrl/.control/.preinst}`; \
postrm=`echo $${ctrl/.control/.postrm}`; \
postinst=`echo $${ctrl/.control/.postinst}`; \
echo "Building ipk of $$ctrl"; \
cd $(OPIEDIR); $(OPIEDIR)/scripts/mkipkg --subst=$(OPIEDIR)/scripts/subst --filesubst=$(OPIEDIR)/scripts/filesubst --control=$$ctrl --prerm=$$prerm --preinst=$$preinst --postrm=$$postrm --postinst=$$postinst --strip=$(STRIP) $(OPIEDIR); \
done )
ipks-mt: $(OPIEDIR)/scripts/subst $(OPIEDIR)/scripts/filesubst FORCE $(TOPDIR)/.config
@> $(OPIEDIR)/AllThreadedPackages
@find $(OPIEDIR)/ -type f -name \*.control | grep -v -- "-mt" | while read ctrl ; do \
grep "Package[ ]*:" $${ctrl} | sed "s+Package[ ]*:[ ]*++"; \
done | sort | uniq >> $(OPIEDIR)/AllThreadedPackages
@find $(OPIEDIR)/ -type f -name \*.control | while read ctrl ; do \
echo "Converting $$ctrl to -mt package"; \
nctrl=`$(OPIEDIR)/scripts/tothreaded $$ctrl $(OPIEDIR)/AllThreadedPackages`; \
echo "Building ipk of $$ctrl"; \
[ -n $$nctrl ] && cd $(OPIEDIR) && $(OPIEDIR)/scripts/mkipkg --subst=$(OPIEDIR)/scripts/subst --filesubst=$(OPIEDIR)/scripts/filesubst --control=$$nctrl --prerm=$${nctrl/-mt.control/.prerm} --preinst=$${nctrl/-mt.control/.preinst} --postrm=$${nctrl/-mt.control/.postrm} --postinst=$${nctrl/-mt.control/.postinst} --strip=$(STRIP) $(OPIEDIR); \
done
@rm -f $(OPIEDIR)/AllThreadedPackages
FORCE:
$(TOPDIR)/.config : $(TOPDIR)/.depends.cfgs
all menuconfig xconfig oldconfig config randconfig allyesconfig allnoconfig defconfig : $(TOPDIR)/.depends.cfgs
clean-configs :
@echo "Wiping generated config.in files..."
@-rm -f $(configs)
ifneq ($(wildcard $(TOPDIR)/.depends.cfgs),)
include $(TOPDIR)/.depends.cfgs
endif
all menuconfig xconfig oldconfig config randconfig allyesconfig allnoconfig defconfig : $(configs)
$(TOPDIR)/.config: $(TOPDIR)/.depends.cfgs $(configs)
$(call descend,scripts/kconfig,conf)
@if [ ! -e $@ ]; then \
cp $(TOPDIR)/def-configs/opie $@; \
fi
@$(MAKE) -C scripts/kconfig conf
./scripts/kconfig/conf -s ./config.in
export
ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
export include-config := 1
-include $(TOPDIR)/.config
-include $(TOPDIR)/.depends
endif
-include $(TOPDIR)/.config.cmd
SUBDIRS = $(subdir-y)
all clean install ipk: $(SUBDIRS)
lupdate lrelease:
@for i in $(SUBDIRS); do $(MAKE) -C $$i $@; done
opie-lupdate opie-lrelease messages:
@for i in $(SUBDIRS); do $(MAKE) -C $$i $@; done;
# from kde
qtmessages:
cd $(QTDIR)/src ; \
sed -e "s,#define,," xml/qxml.cpp > qxml_clean.cpp ;\
find . -name "*.cpp" | grep -v moc_ > list ;\
for file in qfiledialog qcolordialog qprintdialog \
qurloperator qftp qhttp qlocal qerrormessage; do \
grep -v $$file list > list.new && mv list.new list ;\
done ;\
xgettext -C -ktr -kQT_TRANSLATE_NOOP -n `cat list` -o $(OPIEDIR)/qt-messages.pot
ifndef CONFIG_TARGET_OE
$(subdir-y) : $(if $(CONFIG_LIBQPE),$(QTDIR)/stamp-headers $(OPIEDIR)/stamp-headers) \
$(if $(CONFIG_LIBQPE-X11),$(QTDIR)/stamp-headers-x11 $(OPIEDIR)/stamp-headers-x11 ) \
$(TOPDIR)/library/custom.h
else
$(subdir-y) : $(if $(CONFIG_LIBQPE),$(OPIEDIR)/stamp-headers) $(TOPDIR)/library/custom.h
endif
clean : $(TOPDIR)/.config
make -C bin clean
make -C lib clean
make -C plugins clean
apidox :
doc/generate_apidox
mrproper : clean-configs
find . -name ".moc"|xargs rm -rf
find . -name ".obj"|xargs rm -rf
find lib -name "lib*.*"|xargs rm -f
find plugins -name "lib*.*"|xargs rm -f
find . -name "*.pro"|xargs touch
include $(TOPDIR)/Rules.make
+
+# to speed up (avoid include/generation of packaging rules)
+ifneq ($(filter package%,$(MAKECMDGOALS)),)
+
+# packaging requested
+
+$(TOPDIR)/Package.make :
+ @echo "Generating packaging rules"
+ @$(TOPDIR)/scripts/GeneratePackageMake > $(TOPDIR)/Package.make
+
+# load rules to make packages
+-include $(TOPDIR)/Package.make
+
+endif
diff --git a/development/performance/opie-performance.control b/development/performance/opie-performance.control
index 194b378..21c3433 100644
--- a/development/performance/opie-performance.control
+++ b/development/performance/opie-performance.control
@@ -1,10 +1,11 @@
+Package: opie-performance
Files: plugins/applications/libperformance.so* bin/performance apps/Applications/performance.desktop
Priority: optional
Section: opie/other
Maintainer: Trolltech (www.trolltech.com)
Architecture: $CPU_ARCH
Arch: $DEVICE_ARCH
Version: $QPE_VERSION$EXTRAVERSION
Depends: opie-taskbar
Description: Graphics performance tester
Graphics performance tester for Qtopia.
diff --git a/noncore/multimedia/powerchord/opie-powerchord.control b/noncore/multimedia/powerchord/opie-powerchord.control
index 4b5bc88..490e8a2 100644
--- a/noncore/multimedia/powerchord/opie-powerchord.control
+++ b/noncore/multimedia/powerchord/opie-powerchord.control
@@ -1,10 +1,11 @@
+Package: opie-powercord
Files: plugins/applications/libpowerchord.so* bin/powerchord apps/Applications/powerchord.desktop pics/powerchord share/powerchord
Priority: optional
Section: opie/multimedia
Maintainer: Camilo Mesias <camilo@mesias.co.uk>, ljp <lpotter@trolltech.com>
Architecture: arm
Version: $QPE_VERSION$EXTRAVERSION
Depends: task-opie-minimal
Description: Guitar Chord generator application
Allows naming of chords using base note and key. Fretboard diagrams are
produced illustrating ways to play the chord.
diff --git a/noncore/settings/networksettings2/opietooth2/OTMainGUI.ui b/noncore/settings/networksettings2/opietooth2/OTMainGUI.ui
index d9038ae..5bce0e1 100644
--- a/noncore/settings/networksettings2/opietooth2/OTMainGUI.ui
+++ b/noncore/settings/networksettings2/opietooth2/OTMainGUI.ui
@@ -1,668 +1,811 @@
<!DOCTYPE UI><UI>
<class>OTMainGUI</class>
<widget>
<class>QWidget</class>
<property stdset="1">
<name>name</name>
<cstring>OTMainGUI</cstring>
</property>
<property stdset="1">
<name>geometry</name>
<rect>
<x>0</x>
<y>0</y>
- <width>257</width>
- <height>296</height>
+ <width>225</width>
+ <height>334</height>
</rect>
</property>
<property stdset="1">
<name>caption</name>
<string>Bluetooth Manager</string>
</property>
<property>
<name>layoutMargin</name>
</property>
<property>
<name>layoutSpacing</name>
</property>
<vbox>
<property stdset="1">
<name>margin</name>
<number>3</number>
</property>
<property stdset="1">
<name>spacing</name>
<number>0</number>
</property>
- <spacer>
- <property>
- <name>name</name>
- <cstring>Spacer20</cstring>
- </property>
- <property stdset="1">
- <name>orientation</name>
- <enum>Vertical</enum>
- </property>
- <property stdset="1">
- <name>sizeType</name>
- <enum>Expanding</enum>
- </property>
- <property>
- <name>sizeHint</name>
- <size>
- <width>20</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
<widget>
<class>QLayoutWidget</class>
<property stdset="1">
<name>name</name>
<cstring>Layout7</cstring>
</property>
<hbox>
<property stdset="1">
<name>margin</name>
<number>0</number>
</property>
<property stdset="1">
<name>spacing</name>
<number>6</number>
</property>
<widget>
<class>QPushButton</class>
<property stdset="1">
<name>name</name>
<cstring>ManageLocalHW_But</cstring>
</property>
<property stdset="1">
<name>text</name>
<string>Local Bluetooth hardware</string>
</property>
</widget>
<spacer>
<property>
<name>name</name>
<cstring>Spacer9_2</cstring>
</property>
<property stdset="1">
<name>orientation</name>
<enum>Horizontal</enum>
</property>
<property stdset="1">
<name>sizeType</name>
<enum>Expanding</enum>
</property>
<property>
<name>sizeHint</name>
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</hbox>
</widget>
<spacer>
<property>
<name>name</name>
<cstring>Spacer20_3</cstring>
</property>
<property stdset="1">
<name>orientation</name>
<enum>Vertical</enum>
</property>
<property stdset="1">
<name>sizeType</name>
<enum>Expanding</enum>
</property>
<property>
<name>sizeHint</name>
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
<widget>
<class>QLayoutWidget</class>
<property stdset="1">
<name>name</name>
<cstring>Layout2</cstring>
</property>
<hbox>
<property stdset="1">
<name>margin</name>
<number>0</number>
</property>
<property stdset="1">
<name>spacing</name>
<number>6</number>
</property>
<spacer>
<property>
<name>name</name>
<cstring>Spacer7</cstring>
</property>
<property stdset="1">
<name>orientation</name>
<enum>Horizontal</enum>
</property>
<property stdset="1">
<name>sizeType</name>
<enum>Fixed</enum>
</property>
<property>
<name>sizeHint</name>
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
<widget>
<class>QLabel</class>
<property stdset="1">
<name>name</name>
<cstring>TextLabel1</cstring>
</property>
<property stdset="1">
<name>sizePolicy</name>
<sizepolicy>
<hsizetype>7</hsizetype>
<vsizetype>1</vsizetype>
</sizepolicy>
</property>
<property stdset="1">
<name>text</name>
- <string>Select to manage your local Bluetooth hardware</string>
+ <string>Manage your local Bluetooth hardware</string>
</property>
<property stdset="1">
<name>alignment</name>
<set>WordBreak|AlignVCenter|AlignLeft</set>
</property>
<property>
<name>wordwrap</name>
</property>
</widget>
</hbox>
</widget>
<spacer>
<property>
<name>name</name>
<cstring>Spacer20_2</cstring>
</property>
<property stdset="1">
<name>orientation</name>
<enum>Vertical</enum>
</property>
<property stdset="1">
<name>sizeType</name>
<enum>Expanding</enum>
</property>
<property>
<name>sizeHint</name>
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
<widget>
<class>QLayoutWidget</class>
<property stdset="1">
<name>name</name>
<cstring>Layout8</cstring>
</property>
<hbox>
<property stdset="1">
<name>margin</name>
<number>0</number>
</property>
<property stdset="1">
<name>spacing</name>
<number>6</number>
</property>
<widget>
<class>QPushButton</class>
<property stdset="1">
<name>name</name>
<cstring>Scan_But</cstring>
</property>
<property stdset="1">
<name>text</name>
<string>Scan Neighbourhood</string>
</property>
</widget>
<spacer>
<property>
<name>name</name>
<cstring>Spacer9</cstring>
</property>
<property stdset="1">
<name>orientation</name>
<enum>Horizontal</enum>
</property>
<property stdset="1">
<name>sizeType</name>
<enum>Expanding</enum>
</property>
<property>
<name>sizeHint</name>
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</hbox>
</widget>
<spacer>
<property>
<name>name</name>
<cstring>Spacer20_4</cstring>
</property>
<property stdset="1">
<name>orientation</name>
<enum>Vertical</enum>
</property>
<property stdset="1">
<name>sizeType</name>
<enum>Expanding</enum>
</property>
<property>
<name>sizeHint</name>
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
<widget>
<class>QLayoutWidget</class>
<property stdset="1">
<name>name</name>
- <cstring>Layout10</cstring>
+ <cstring>Layout13</cstring>
+ </property>
+ <hbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <spacer>
+ <property>
+ <name>name</name>
+ <cstring>Spacer7_2_2</cstring>
+ </property>
+ <property stdset="1">
+ <name>orientation</name>
+ <enum>Horizontal</enum>
+ </property>
+ <property stdset="1">
+ <name>sizeType</name>
+ <enum>Fixed</enum>
+ </property>
+ <property>
+ <name>sizeHint</name>
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget>
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel5</cstring>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>1</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Use device :</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QComboBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>DeviceList_CB</cstring>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ </sizepolicy>
+ </property>
+ </widget>
+ <spacer>
+ <property>
+ <name>name</name>
+ <cstring>Spacer16</cstring>
+ </property>
+ <property stdset="1">
+ <name>orientation</name>
+ <enum>Horizontal</enum>
+ </property>
+ <property stdset="1">
+ <name>sizeType</name>
+ <enum>Expanding</enum>
+ </property>
+ <property>
+ <name>sizeHint</name>
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </hbox>
+ </widget>
+ <widget>
+ <class>QLayoutWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Layout15</cstring>
</property>
<hbox>
<property stdset="1">
<name>margin</name>
<number>0</number>
</property>
<property stdset="1">
<name>spacing</name>
<number>6</number>
</property>
<spacer>
<property>
<name>name</name>
<cstring>Spacer7_2</cstring>
</property>
<property stdset="1">
<name>orientation</name>
<enum>Horizontal</enum>
</property>
<property stdset="1">
<name>sizeType</name>
<enum>Fixed</enum>
</property>
<property>
<name>sizeHint</name>
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
<widget>
- <class>QLayoutWidget</class>
+ <class>QLabel</class>
<property stdset="1">
<name>name</name>
- <cstring>Layout9</cstring>
- </property>
- <grid>
- <property stdset="1">
- <name>margin</name>
- <number>0</number>
- </property>
- <property stdset="1">
- <name>spacing</name>
- <number>6</number>
- </property>
- <widget row="0" column="1" >
- <class>QComboBox</class>
- <property stdset="1">
- <name>name</name>
- <cstring>DeviceList_CB</cstring>
- </property>
- <property stdset="1">
- <name>sizePolicy</name>
- <sizepolicy>
- <hsizetype>7</hsizetype>
- <vsizetype>0</vsizetype>
- </sizepolicy>
- </property>
- </widget>
- <spacer row="0" column="2" >
- <property>
- <name>name</name>
- <cstring>Spacer16</cstring>
- </property>
- <property stdset="1">
- <name>orientation</name>
- <enum>Horizontal</enum>
- </property>
- <property stdset="1">
- <name>sizeType</name>
- <enum>Expanding</enum>
- </property>
- <property>
- <name>sizeHint</name>
- <size>
- <width>20</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- <widget row="1" column="0" rowspan="1" colspan="3" >
- <class>QLabel</class>
- <property stdset="1">
- <name>name</name>
- <cstring>TextLabel1_2</cstring>
- </property>
- <property stdset="1">
- <name>sizePolicy</name>
- <sizepolicy>
- <hsizetype>7</hsizetype>
- <vsizetype>1</vsizetype>
- </sizepolicy>
- </property>
- <property stdset="1">
- <name>text</name>
- <string>Select to scan the bluetooth network for reachable devices using the selected local device</string>
- </property>
- <property stdset="1">
- <name>alignment</name>
- <set>WordBreak|AlignVCenter|AlignLeft</set>
- </property>
- <property>
- <name>wordwrap</name>
- </property>
- </widget>
- <widget row="0" column="0" >
- <class>QLabel</class>
- <property stdset="1">
- <name>name</name>
- <cstring>TextLabel5</cstring>
- </property>
- <property stdset="1">
- <name>sizePolicy</name>
- <sizepolicy>
- <hsizetype>0</hsizetype>
- <vsizetype>1</vsizetype>
- </sizepolicy>
- </property>
- <property stdset="1">
- <name>text</name>
- <string>Use device :</string>
- </property>
- </widget>
- </grid>
+ <cstring>TextLabel1_2</cstring>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>5</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>San the bluetooth network neighbourhood using the selected local device</string>
+ </property>
+ <property stdset="1">
+ <name>alignment</name>
+ <set>WordBreak|AlignVCenter|AlignLeft</set>
+ </property>
+ <property>
+ <name>wordwrap</name>
+ </property>
</widget>
</hbox>
</widget>
<spacer>
<property>
<name>name</name>
<cstring>Spacer20_2_2</cstring>
</property>
<property stdset="1">
<name>orientation</name>
<enum>Vertical</enum>
</property>
<property stdset="1">
<name>sizeType</name>
<enum>Expanding</enum>
</property>
<property>
<name>sizeHint</name>
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
<widget>
<class>QLayoutWidget</class>
<property stdset="1">
<name>name</name>
<cstring>Layout9</cstring>
</property>
<hbox>
<property stdset="1">
<name>margin</name>
<number>0</number>
</property>
<property stdset="1">
<name>spacing</name>
<number>6</number>
</property>
<widget>
<class>QPushButton</class>
<property stdset="1">
<name>name</name>
<cstring>Pairing_But</cstring>
</property>
<property stdset="1">
<name>text</name>
<string>Manage Pairing</string>
</property>
</widget>
<spacer>
<property>
<name>name</name>
<cstring>Spacer9_3</cstring>
</property>
<property stdset="1">
<name>orientation</name>
<enum>Horizontal</enum>
</property>
<property stdset="1">
<name>sizeType</name>
<enum>Expanding</enum>
</property>
<property>
<name>sizeHint</name>
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</hbox>
</widget>
<spacer>
<property>
<name>name</name>
<cstring>Spacer20_5</cstring>
</property>
<property stdset="1">
<name>orientation</name>
<enum>Vertical</enum>
</property>
<property stdset="1">
<name>sizeType</name>
<enum>Expanding</enum>
</property>
<property>
<name>sizeHint</name>
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
<widget>
<class>QLayoutWidget</class>
<property stdset="1">
<name>name</name>
<cstring>Layout6</cstring>
</property>
<hbox>
<property stdset="1">
<name>margin</name>
<number>0</number>
</property>
<property stdset="1">
<name>spacing</name>
<number>6</number>
</property>
<spacer>
<property>
<name>name</name>
<cstring>Spacer7_3</cstring>
</property>
<property stdset="1">
<name>orientation</name>
<enum>Horizontal</enum>
</property>
<property stdset="1">
<name>sizeType</name>
<enum>Fixed</enum>
</property>
<property>
<name>sizeHint</name>
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
<widget>
<class>QLabel</class>
<property stdset="1">
<name>name</name>
<cstring>TextLabel1_2_2</cstring>
</property>
<property stdset="1">
<name>sizePolicy</name>
<sizepolicy>
<hsizetype>7</hsizetype>
<vsizetype>1</vsizetype>
</sizepolicy>
</property>
<property stdset="1">
<name>text</name>
- <string>Select to manage all pairings known on the local device to any remote device regardless if it is currently reachable or not</string>
+ <string>Manage device pairings to or from the local device</string>
</property>
<property stdset="1">
<name>alignment</name>
<set>WordBreak|AlignVCenter|AlignLeft</set>
</property>
<property>
<name>wordwrap</name>
</property>
</widget>
</hbox>
</widget>
<spacer>
<property>
<name>name</name>
<cstring>Spacer20_2_2_2</cstring>
</property>
<property stdset="1">
<name>orientation</name>
<enum>Vertical</enum>
</property>
<property stdset="1">
<name>sizeType</name>
<enum>Expanding</enum>
</property>
<property>
<name>sizeHint</name>
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
<widget>
<class>QLayoutWidget</class>
<property stdset="1">
<name>name</name>
- <cstring>Layout2</cstring>
+ <cstring>Layout9_2</cstring>
</property>
<hbox>
<property stdset="1">
<name>margin</name>
<number>0</number>
</property>
<property stdset="1">
<name>spacing</name>
<number>6</number>
</property>
<widget>
- <class>QCheckBox</class>
+ <class>QPushButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>BTSniffing_But</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Sniffing</string>
+ </property>
+ </widget>
+ <spacer>
+ <property>
+ <name>name</name>
+ <cstring>Spacer9_3_2</cstring>
+ </property>
+ <property stdset="1">
+ <name>orientation</name>
+ <enum>Horizontal</enum>
+ </property>
+ <property stdset="1">
+ <name>sizeType</name>
+ <enum>Expanding</enum>
+ </property>
+ <property>
+ <name>sizeHint</name>
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </hbox>
+ </widget>
+ <widget>
+ <class>QLayoutWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Layout6_2</cstring>
+ </property>
+ <hbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <spacer>
+ <property>
+ <name>name</name>
+ <cstring>Spacer7_3_2</cstring>
+ </property>
+ <property stdset="1">
+ <name>orientation</name>
+ <enum>Horizontal</enum>
+ </property>
+ <property stdset="1">
+ <name>sizeType</name>
+ <enum>Fixed</enum>
+ </property>
+ <property>
+ <name>sizeHint</name>
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget>
+ <class>QLabel</class>
<property stdset="1">
<name>name</name>
- <cstring>EnableTracing_CB</cstring>
+ <cstring>TextLabel1_2_2_2</cstring>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>1</vsizetype>
+ </sizepolicy>
</property>
<property stdset="1">
<name>text</name>
- <string>Trace Bluetooth</string>
+ <string>Sniff the bluetooth network</string>
+ </property>
+ <property stdset="1">
+ <name>alignment</name>
+ <set>WordBreak|AlignVCenter|AlignLeft</set>
+ </property>
+ <property>
+ <name>wordwrap</name>
</property>
</widget>
+ </hbox>
+ </widget>
+ <spacer>
+ <property>
+ <name>name</name>
+ <cstring>Spacer20_2_2_2_3</cstring>
+ </property>
+ <property stdset="1">
+ <name>orientation</name>
+ <enum>Vertical</enum>
+ </property>
+ <property stdset="1">
+ <name>sizeType</name>
+ <enum>Expanding</enum>
+ </property>
+ <property>
+ <name>sizeHint</name>
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget>
+ <class>QLayoutWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Layout11</cstring>
+ </property>
+ <hbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <spacer>
+ <property>
+ <name>name</name>
+ <cstring>Spacer21</cstring>
+ </property>
+ <property stdset="1">
+ <name>orientation</name>
+ <enum>Horizontal</enum>
+ </property>
+ <property stdset="1">
+ <name>sizeType</name>
+ <enum>Expanding</enum>
+ </property>
+ <property>
+ <name>sizeHint</name>
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
<widget>
<class>QCheckBox</class>
<property stdset="1">
<name>name</name>
<cstring>MustBeEnabled_CB</cstring>
</property>
<property stdset="1">
<name>text</name>
<string>Bluetooth Enabled</string>
</property>
</widget>
</hbox>
</widget>
</vbox>
</widget>
<connections>
<connection>
<sender>ManageLocalHW_But</sender>
<signal>clicked()</signal>
<receiver>OTMainGUI</receiver>
<slot>SLOT_Manage()</slot>
</connection>
<connection>
<sender>Scan_But</sender>
<signal>clicked()</signal>
<receiver>OTMainGUI</receiver>
<slot>SLOT_Scan()</slot>
</connection>
<connection>
<sender>MustBeEnabled_CB</sender>
<signal>toggled(bool)</signal>
<receiver>OTMainGUI</receiver>
<slot>SLOT_EnableBluetooth(bool)</slot>
</connection>
<connection>
<sender>Pairing_But</sender>
<signal>clicked()</signal>
<receiver>OTMainGUI</receiver>
<slot>SLOT_Pairing()</slot>
</connection>
<connection>
- <sender>EnableTracing_CB</sender>
- <signal>toggled(bool)</signal>
+ <sender>BTSniffing_But</sender>
+ <signal>clicked()</signal>
<receiver>OTMainGUI</receiver>
- <slot>SLOT_EnableTracing( bool )</slot>
+ <slot>SLOT_Sniffing()</slot>
</connection>
<slot access="public">SLOT_EnableBluetooth(bool)</slot>
+ <slot access="public">SLOT_Sniffing()</slot>
<slot access="public">SLOT_Manage()</slot>
<slot access="public">SLOT_Pairing()</slot>
<slot access="public">SLOT_Scan()</slot>
- <slot access="public">SLOT_EnableTracing( bool )</slot>
</connections>
</UI>
diff --git a/noncore/settings/networksettings2/opietooth2/Opietooth.cpp b/noncore/settings/networksettings2/opietooth2/Opietooth.cpp
index 8ea3a48..2d4885c 100644
--- a/noncore/settings/networksettings2/opietooth2/Opietooth.cpp
+++ b/noncore/settings/networksettings2/opietooth2/Opietooth.cpp
@@ -1,1005 +1,1037 @@
#include <opie2/odebug.h>
#include <opie2/oledbox.h>
using namespace Opie::Core;
using namespace Opie::Ui;
#include <qpe/resource.h>
#include <qcheckbox.h>
#include <qgroupbox.h>
#include <qlabel.h>
#include <qprogressbar.h>
#include <qheader.h>
#include <qmessagebox.h>
#include <qapplication.h>
#include <qlistbox.h>
#include <qdialog.h>
#include <qlayout.h>
#include <qcombobox.h>
#include <qlabel.h>
#include <qlistview.h>
#include <qpushbutton.h>
#include <Opietooth.h>
#include <OTDriver.h>
#include <OTPeer.h>
#include <OTGateway.h>
#include <OTSDPAttribute.h>
#include <OTSDPService.h>
#include <OTInquiry.h>
using namespace Opietooth2;
namespace Opietooth2 {
class PeerLVI : public QListViewItem {
public :
PeerLVI( OTPeer * P, QListView * it ) : QListViewItem (it) {
Peer = P;
}
~PeerLVI( void ) {
}
inline OTPeer * peer( void )
{ return Peer; }
private :
OTPeer * Peer;
};
class ChannelLVI : public QListViewItem {
public :
ChannelLVI( int Ch, QListViewItem * it ) : QListViewItem (it) {
Channel = Ch;
}
~ChannelLVI( void ) {
}
inline int channel( void )
{ return Channel; }
private :
int Channel;
};
class DriverLVI : public QListViewItem {
public :
DriverLVI( OTDriver * P, QListView * it ) : QListViewItem (it) {
Driver = P;
}
~DriverLVI( void ) {
}
inline OTDriver * driver( void )
{ return Driver; }
private :
OTDriver * Driver;
};
class LinkKeyLVI : public QListViewItem {
public :
LinkKeyLVI( int Ch, QListView * it ) : QListViewItem (it) {
LinkKey = Ch;
}
~LinkKeyLVI( void ) {
}
inline int index( void )
{ return LinkKey; }
private :
int LinkKey;
};
};
//
//
//
//
//
+OTSniffing::OTSniffing( QWidget * parent ) : OTSniffGUI( parent ) {
+
+ OT = OTGateway::getOTGateway();
+
+}
+
+OTSniffing::~OTSniffing() {
+}
+
+void OTSniffing::SLOT_Trace( void ) {
+}
+
+void OTSniffing::SLOT_ClearLog( void ) {
+}
+
+//
+//
+//
+//
+//
+
OTPairing::OTPairing( QWidget * parent, OTIcons * _IC ) :
OTPairingGUI( parent ) {
OT = OTGateway::getOTGateway();
Icons = (_IC ) ? _IC : new OTIcons();
MyIcons = (_IC == 0 );
// unpairing can only be done if bluetooth is disabled
Unpair_But->setEnabled( ! OT->isEnabled() );
if( ! OT->isEnabled() ) {
Unpair_LBL->hide();
} else {
Unpair_LBL->show();
}
// open linkkey file and load pairs
LinkKeyArray Keys = OT->getLinkKeys();
LinkKeyLVI * it;
OTPeer * P;
OTDriver * D;
for( unsigned int i = 0 ;
i < Keys.count();
i ++ ) {
it = new LinkKeyLVI( i, Pairs_LV );
P = 0;
D = OT->findDriver( Keys[i].from() );
if( D ) {
it->setText( 0, D->devname() );
// we are source
P = OT->findPeer( Keys[i].to() );
if( P ) {
// put name
it->setText( 1, P->name() );
} else {
// unknown
it->setText( 1, Keys[i].to().toString() );
}
// and put address as sub
QListViewItem * Sub = new QListViewItem( it );
Sub->setText( 0, D->address().toString() );
Sub->setText( 1, Keys[i].to().toString() );
} else {
// perhaps we are destination
D = OT->findDriver( Keys[i].to() );
if( D ) {
it->setText( 1, D->devname() );
// we are source
P = OT->findPeer( Keys[i].from() );
if( P ) {
// put name
it->setText( 0, P->name() );
} else {
// unknown
it->setText( 0, Keys[i].from().toString() );
}
// and put address as sub
QListViewItem * Sub = new QListViewItem( it );
Sub->setText( 0, Keys[i].from().toString() );
Sub->setText( 1, D->address().toString() );
} else {
// nor source nor destination -> unknown
it->setText( 0, Keys[i].from().toString() );
it->setText( 1, Keys[i].to().toString() );
}
}
}
}
OTPairing::~OTPairing() {
if( MyIcons )
delete Icons;
OTGateway::releaseOTGateway();
}
void OTPairing::SLOT_Unpair( ) {
// find selected pair
QListViewItem * it = Pairs_LV->firstChild();
while( it ) {
if( it->isSelected() ) {
// confirm ?
if( QMessageBox::warning(0,
tr("Break pairing"),
tr("Sure ?"),
tr("Yes, break"),
tr("No, don't break") ) == 0 ) {
LinkKeyLVI * KPIt = (LinkKeyLVI *)it;
// break
OT->removeLinkKey( KPIt->index() );
delete KPIt;
}
return;
}
it= it->nextSibling();
}
}
//
//
//
//
//
OTScan::OTScan( QWidget * parent, OTIcons * _IC ) :
OTScanGUI( parent ), Filter() {
OT = OTGateway::getOTGateway();
Icons = (_IC ) ? _IC : new OTIcons();
MyIcons = (_IC == 0 );
DetectedPeers_LV->header()->hide();
Current = 0;
SelectedPeer = 0;
SelectedChannel = 0;
StrengthTimer = new QTimer( this );
connect( StrengthTimer,
SIGNAL( timeout()),
this,
SLOT( SLOT_UpdateStrength())
);
connect( OT,
SIGNAL( detectedPeer( OTPeer *, bool )),
this,
SLOT( SLOT_NewPeer( OTPeer *, bool ))
);
connect( OT,
SIGNAL( finishedDetecting()),
this,
SLOT( SLOT_FinishedDetecting())
);
// populate with peers we already know about
const PeerVector & P = OT->peers();
for( unsigned int i = 0;
i < P.count();
i ++ ) {
SLOT_NewPeer( P[i], TRUE );
}
// populate State fram
{ QHBoxLayout * H =new QHBoxLayout( State_Frm );
Paired_Led = new OLedBox( green, State_Frm );
QLabel * L1 = new QLabel( tr( "Paired" ), State_Frm );
H->addWidget( Paired_Led );
H->addWidget( L1 );
H->addStretch( 1 );
}
}
OTScan::~OTScan() {
if( MyIcons )
delete Icons;
OTGateway::releaseOTGateway();
// send all peers that we do not care about states
QListViewItem * Lit = DetectedPeers_LV->firstChild();
while( Lit ) {
((PeerLVI *)Lit)->peer()->stopFindingOutState( );
Lit = Lit->nextSibling();
}
}
// static scan dialog function
int OTScan::getDevice( OTPeer *& Peer,
int & Channel,
OTGateway * OT,
const UUIDVector & Filter,
QWidget* Parent ) {
bool IsUp = 0;
unsigned int i;
// check if bluetooth is up
OTDriverList & DL = OT->getDriverList();
for( i = 0;
i < DL.count();
i ++ ) {
if( DL[i]->isUp() ) {
// one device that is up found
IsUp = 1;
break;
}
}
// use this driver
OT->setScanWith( OT->driver(i) );
// create dialog
QDialog * Dlg = new QDialog( Parent, 0, TRUE );
QVBoxLayout * V = new QVBoxLayout( Dlg );
OTScan * Scn = new OTScan( Dlg );
connect( Scn,
SIGNAL( selected() ),
Dlg,
SLOT( accept() )
);
if( Filter ) {
Scn->setScanFilter( Filter );
}
V->addWidget( Scn );
Dlg->setCaption( tr("Scan Neighbourhood" ) );
Dlg->showMaximized();
int rv = Dlg->exec();
if( rv == QDialog::Accepted ) {
// get peer
Peer = Scn->selectedPeer();
if( Peer == 0 ) {
// no peer selected
rv = QDialog::Rejected;
} else {
Channel = Scn->selectedChannel();
}
}
delete Dlg;
return rv;
}
void OTScan::setScanFilter( const UUIDVector & V ) {
Filter = V;
}
void OTScan::resetScanFilter( void ) {
Filter.truncate(0);
}
void OTScan::SLOT_DoScan( bool DoIt ) {
if( DoIt ) {
OT->scanNeighbourhood();
} else {
OT->stopScanOfNeighbourhood();
}
scanMode( DoIt );
}
// double clicked on a device
void OTScan::SLOT_Selected( QListViewItem * it ) {
if( ! it )
return;
if( Filter.count() > 0 ) {
// filter on service
if( it->depth() == 0 ) {
// select a service and not a device
return;
}
// store result
SelectedPeer = ((PeerLVI *)it->parent())->peer();
SelectedChannel = ((ChannelLVI *)it)->channel();
} else {
// click on device
if( it->depth() != 0 ) {
return;
}
SelectedPeer = ((PeerLVI *)it)->peer();
SelectedChannel = 0;
}
owarn << "Selected " << SelectedPeer->address().toString() <<
" Channel " << SelectedChannel << oendl;
emit selected();
}
void OTScan::SLOT_FinishedDetecting( ) {
scanMode( false );
}
void OTScan::SLOT_CleanupOld( ) {
// iterate over all peers and find those that
// are down and have no pairing info
OTPeer * TheP;
const LinkKeyArray & Keys = OT->getLinkKeys();
QListViewItem * Lit = DetectedPeers_LV->firstChild();
while( Lit ) {
TheP = ((PeerLVI *)Lit)->peer();
if( TheP->state() == OTPeer::Peer_Down ) {
unsigned int k;
// what about linkkeys ?
for( k = 0; k < Keys.count(); k ++ ) {
if( TheP->address() == Keys[k].to() ||
TheP->address() == Keys[k].from()
) {
// part of linkkey
owarn << "LINKKEY " << TheP->address().toString() << oendl;
break;
}
}
if( k == Keys.count() ) {
owarn << "RM LINKKEY " << TheP->address().toString() << oendl;
// not found -> remember to remove this peer
QListViewItem * Nit;
OT->removePeer( TheP );
Nit = Lit->nextSibling();
delete Lit;
Lit = Nit;
continue;
}
} else {
owarn << "NODOWN " << TheP->address().toString() << oendl;
}
Lit = Lit->nextSibling();
}
}
void OTScan::SLOT_NewPeer( OTPeer * P, bool IsNew ){
PeerLVI * it = 0;
if( IsNew ) {
it = new PeerLVI( P, DetectedPeers_LV );
} else {
// find peer in table
QListViewItem * Lit = DetectedPeers_LV->firstChild();
while( Lit ) {
if( ((PeerLVI *)Lit)->peer() == P ) {
// this item
it = (PeerLVI *)Lit;
break;
}
Lit = Lit->nextSibling();
}
if( ! it ) {
owarn << "Should not occur" << oendl;
return;
}
}
// update/show info
it->setText( 0, P->name() );
it->setPixmap(0, Icons->deviceIcon(
OT->deviceTypeToName( P->deviceClass() ) ) );
// tell peer to report its state async
connect( P,
SIGNAL( peerStateReport( OTPeer *)),
this,
SLOT( SLOT_PeerState( OTPeer *))
);
if( IsNew ) {
// find state
refreshState( (PeerLVI *)it, 1 );
} else {
// update staet
SLOT_PeerState( P );
}
}
void OTScan::SLOT_PeerState( OTPeer * P ) {
PeerLVI * it = (PeerLVI *)DetectedPeers_LV->firstChild();
while( it ) {
if( it->peer() == P ) {
break;
}
it = (PeerLVI * )it->nextSibling();
}
if( ! it )
return;
switch( P->state() ) {
case OTPeer::Peer_Unknown :
case OTPeer::Peer_Down :
it->setPixmap( 1, 0 );
break;
case OTPeer::Peer_Up :
it->setPixmap( 1, Icons->loadPixmap(
( P->connectedTo() ) ? "connected" : "notconnected" ) );
if( it == Current && ! StrengthTimer->isActive() ) {
// start showing strength
StrengthTimer->start( 1000, FALSE );
SLOT_UpdateStrength();
}
break;
}
}
void OTScan::SLOT_RefreshState( void ) {
QListViewItem * it = DetectedPeers_LV->firstChild();
while( it ) {
if( it->isSelected() ) {
break;
}
it = it->nextSibling();
}
if( ! it )
return;
refreshState( (PeerLVI *)it, 1 );
}
void OTScan::refreshState( PeerLVI * it, bool Force ) {
it->setPixmap( 1, Icons->loadPixmap( "find" ) );
it->peer()->findOutState( 30, Force );
}
void OTScan::SLOT_Show( QListViewItem * it ) {
if( ! it || it->depth() > 0 )
return;
QString S;
Current = (PeerLVI *)it;
Strength_PB->setProgress( 0 ); // reset
Address_LBL->setText( Current->peer()->address().toString() );
Peer_GB->setTitle( Current->peer()->name() );
const LinkKeyArray & Keys = OT->getLinkKeys();
Paired_Led->setOn( FALSE );
for( unsigned int i = 0;
i < Keys.count();
i ++ ) {
if( Current->peer()->address() == Keys[i].to() ) {
Paired_Led->setOn( TRUE );
break;
}
}
if( Current->peer()->state() == OTPeer::Peer_Up ) {
RefreshServices_But->setEnabled( TRUE );
StrengthTimer->start( 1000, FALSE );
SLOT_UpdateStrength();
} else {
RefreshServices_But->setEnabled( FALSE );
}
}
void OTScan::SLOT_UpdateStrength( void ) {
OTDriver * D = Current->peer()->connectedTo();
if( D ) {
long Q = D->getLinkQuality( Current->peer()->address() );
Strength_PB->setProgress( Q );
if( ! Q ) {
// no quality
Strength_PB->setEnabled( TRUE );
StrengthTimer->stop();
}
} else {
Strength_PB->setEnabled( FALSE );
Strength_PB->setProgress( 0 );
// no point in continuing
StrengthTimer->stop();
}
}
void OTScan::SLOT_RefreshServices( void ) {
QListViewItem * it = DetectedPeers_LV->firstChild();
while( it ) {
if( it->isSelected() ) {
break;
}
it = it->nextSibling();
}
if( ! it )
return;
QString S;
PeerLVI * PI = (PeerLVI *)it;
scanMode( true );
qApp->processEvents(0);
ServiceVector & V = PI->peer()->services();
while( PI->firstChild() ) {
// remove children
delete PI->firstChild();
}
for( unsigned int i = 0 ;
i < V.count();
i ++ ) {
QString S;
S = V[i]->name();
if( S.isEmpty() ) {
continue;
}
{ QListViewItem * SIt;
UUIDVector UIDV;
QPixmap Pm;
bool Done = 0;
bool R;
short ID;
SIt = 0;
UIDV = V[i]->classIDList();
// first all UUID ! 1200 12ff (Genericprofiles)
for( unsigned int j = 0;
j < UIDV.count();
j ++ ) {
if( Filter.count() ) {
bool FilterOut = 1;
// filter out if not in list
for( unsigned int ff = 0;
ff < Filter.count();
ff ++ ) {
if( UIDV[j] == Filter[ff] ) {
FilterOut = 0;
break;
}
}
if( FilterOut ) {
// not in filter list
continue;
}
} // else show
ID = UIDV[j].toShort();
if( ID < 0x1200 || ID > 0x12ff ) {
// use this profile
if( R ) {
unsigned int ch;
bool has;
has = V[i]->rfcommChannel( ch );
SIt = new ChannelLVI( (has) ? (int)ch : -1 , PI );
SIt->setText(0, V[i]->name() );
Pm = Icons->serviceIcon( ID, R );
SIt->setPixmap(0, Pm );
Done = 1;
break;
}
}
}
if( ! Done ) {
// check other range too
for( unsigned int j = 0;
j < UIDV.count();
j ++ ) {
if( Filter.count() ) {
bool FilterOut = 1;
// filter out if not in list
for( unsigned int ff = 0;
ff < Filter.count();
ff ++ ) {
if( UIDV[j] == Filter[ff] ) {
FilterOut = 0;
break;
}
}
if( FilterOut ) {
// not in filter list
continue;
}
} // else show
ID = UIDV[j].toShort();
if( ID >= 0x1200 && ID <= 0x12ff ) {
// use this profile
unsigned int ch;
bool has;
has = V[i]->rfcommChannel( ch );
SIt = new ChannelLVI( (has) ? (int)ch : -1 , PI );
SIt->setText(0, V[i]->name() );
Pm = Icons->serviceIcon( ID, R );
SIt->setPixmap(0, Pm );
break;
}
}
}
}
}
scanMode( false );
}
void OTScan::scanMode( bool M ) {
// avoid infinite loop because it triggers DoScan
Detect_But->blockSignals( TRUE );
Detect_But->setOn( M );
Detect_But->setText( (M) ? tr("Scanning") : tr("Scan") );
Detect_But->blockSignals( FALSE );
}
//
//
//
//
//
OTManage::OTManage( QWidget * parent, OTIcons * _IC ) :
OTManageGUI( parent ) {
OT = OTGateway::getOTGateway();
Icons = (_IC ) ? _IC : new OTIcons();
MyIcons = (_IC == 0 );
AllDrivers_LV->setSorting(-1);
connect( OT,
SIGNAL( driverListChanged() ),
this,
SLOT( SLOT_DriverListChanged() )
);
connect( OT,
SIGNAL( stateChange( OTDriver *, bool ) ),
this,
SLOT( SLOT_StateChange( OTDriver *, bool ) )
);
SLOT_DriverListChanged();
AllDrivers_LV->header()->hide();
}
OTManage::~OTManage() {
if( MyIcons )
delete Icons;
OTGateway::releaseOTGateway();
}
void OTManage::SLOT_ShowDriver( QListViewItem * It ) {
if( It == 0 || It->depth() > 0 )
// not toplevel
return;
DriverLVI * it = (DriverLVI *) It;
DriverIsUp_CB->setChecked( it->driver()->isUp() );
}
void OTManage::SLOT_UpDriver( bool Up ) {
QListViewItem * it = AllDrivers_LV->firstChild();
while( it ) {
if( it->isSelected() ) {
OTDriver * D = ((DriverLVI *)it)->driver();
owarn << "UP driver " << D->devname() << oendl;
// this
D->setUp( Up );
return;
}
it = it->nextSibling();
}
}
void OTManage::SLOT_StateChange( OTDriver * D, bool Up ) {
QListViewItem * it = AllDrivers_LV->firstChild();
while( it ) {
if( ((DriverLVI *)it)->driver() == D ) {
it->setPixmap( 0,
Icons->loadPixmap( ( Up ) ? "bluezon" : "bluezoff" ) );
return;
}
it = it->nextSibling();
}
}
void OTManage::SLOT_DriverListChanged( ) {
DriverLVI * It;
QListViewItem * Sub;
QListViewItem * First = 0;
OTDriver* D;
OTDriverList & DL = OT->getDriverList();
AllDrivers_LV->clear();
for( unsigned int i = 0;
i < DL.count();
i ++ ) {
D = DL[i];
It = new DriverLVI( D, AllDrivers_LV );
if( ! First )
First = It;
It->setText( 0, D->devname() );
It->setPixmap( 0,
Icons->loadPixmap( (D->isUp()) ?
"bluezon" : "bluezoff" ) );
Sub = new QListViewItem( It );
Sub->setText( 0, tr( "Name" ) );
Sub->setText( 1, D->name() );
Sub = new QListViewItem( It );
Sub->setText( 0, tr( "Address" ) );
Sub->setText( 1, D->address().toString() );
Sub = new QListViewItem( It );
Sub->setText( 0, tr( "Revision" ) );
Sub->setText( 1, D->revision() );
Sub = new QListViewItem( It );
Sub->setText( 0, tr( "Manufacturer" ) );
Sub->setText( 1, D->manufacturer() );
QString Service, Device;
D->getClass( Service, Device );
Sub = new QListViewItem( It );
Sub->setText( 0, tr( "Service classes" ) );
Sub->setText( 1, Service );
Sub = new QListViewItem( It );
Sub->setText( 0, tr( "Device class" ) );
Sub->setText( 1, Device );
}
if( DL.count() ) {
AllDrivers_LV->setCurrentItem( First );
DriverIsUp_CB->setEnabled( TRUE );
} else {
DriverIsUp_CB->setChecked( FALSE );
DriverIsUp_CB->setEnabled( FALSE );
}
}
void OTManage::SLOT_SetRefreshTimer( int v ) {
OT->setRefreshTimer( v * 1000 );
}
//
//
//
//
//
OTMain::OTMain( QWidget * parent ) : OTMainGUI( parent ) {
Icons = new OTIcons();
+ SnifWindow = 0;
OT = OTGateway::getOTGateway();
connect( OT,
SIGNAL( deviceEnabled( bool ) ),
this,
SLOT( SLOT_DeviceIsEnabled( bool ) )
);
connect( OT,
SIGNAL( driverListChanged() ),
this,
SLOT( SLOT_DriverListChanged() )
);
connect( OT,
SIGNAL( stateChange( OTDriver *, bool ) ),
this,
SLOT( SLOT_StateChange( OTDriver *, bool ) )
);
if( ! OT->needsEnabling() ) {
MustBeEnabled_CB->hide();
} else {
// detect current state
MustBeEnabled_CB->setChecked(
OT->isEnabled() );
}
SLOT_DriverListChanged();
}
OTMain::~OTMain() {
OTGateway::releaseOTGateway();
delete Icons;
}
void OTMain::SLOT_DriverListChanged() {
OTDriver * D;
OTDriverList & DL = OT->getDriverList();
DeviceList_CB->clear();
for( unsigned int i = 0;
i < DL.count();
i ++ ) {
D = DL[i];
DeviceList_CB->insertItem(
Icons->loadPixmap( (D->isUp()) ?
"bluezon" : "bluezoff" ),
D->devname() );
if( D == OT->scanWith() ) {
DeviceList_CB->setCurrentItem( i );
}
}
Scan_But->setEnabled( OT->getDriverList().count() > 0 );
DeviceList_CB->setEnabled( OT->getDriverList().count() > 0 );
}
void OTMain::SLOT_EnableBluetooth( bool Up ) {
OT->SLOT_SetEnabled( Up );
}
void OTMain::SLOT_DeviceIsEnabled( bool Up ) {
MustBeEnabled_CB->blockSignals( TRUE );
MustBeEnabled_CB->setChecked( Up );
MustBeEnabled_CB->blockSignals( FALSE );
}
void OTMain::SLOT_Manage( void ) {
QDialog * Dlg = new QDialog( this, 0, TRUE );
QVBoxLayout * V = new QVBoxLayout( Dlg );
OTManage * Mng = new OTManage( Dlg, Icons );
V->addWidget( Mng );
Dlg->setCaption( tr("Manage local devices" ) );
Dlg->showMaximized();
Dlg->exec();
delete Dlg;
}
void OTMain::SLOT_Scan( void ) {
OTDriverList & DL = OT->getDriverList();
for( unsigned int i = 0;
i < DL.count();
i ++ ) {
if( DL[i]->isUp() &&
DL[i]->devname() == DeviceList_CB->currentText()
) {
QDialog * Dlg = new QDialog( this, 0, TRUE );
QVBoxLayout * V = new QVBoxLayout( Dlg );
OTScan * Scn = new OTScan( Dlg, Icons );
OT->setScanWith( OT->driver(i) );
V->addWidget( Scn );
Dlg->setCaption( tr("Scan Neighbourhood" ) );
Dlg->showMaximized();
Dlg->exec();
delete Dlg;
return;
}
}
}
void OTMain::SLOT_StateChange( OTDriver * D, bool Up ) {
for( int i = 0;
i < DeviceList_CB->count();
i ++ ) {
if( DeviceList_CB->text(i) == D->devname() ) {
DeviceList_CB->changeItem(
Icons->loadPixmap( (Up) ? "bluezon" : "bluezoff" ),
D->devname(),
i );
return;
}
}
}
void OTMain::SLOT_Pairing( void ) {
QDialog * Dlg = new QDialog( this, 0, TRUE );
QVBoxLayout * V = new QVBoxLayout( Dlg );
OTPairing * Pair = new OTPairing( Dlg, Icons );
V->addWidget( Pair );
Dlg->showMaximized();
Dlg->setCaption( tr("Manage pairing" ) );
Dlg->exec();
delete Dlg;
}
+
+void OTMain::SLOT_Sniffing( void ) {
+
+ if( SnifWindow == 0 ) {
+ SnifWindow = new OTSniffing( this );
+ }
+
+ SnifWindow->showMaximized();
+ SnifWindow->show();
+}
diff --git a/noncore/settings/networksettings2/opietooth2/Opietooth.h b/noncore/settings/networksettings2/opietooth2/Opietooth.h
index 16a22d6..211ae65 100644
--- a/noncore/settings/networksettings2/opietooth2/Opietooth.h
+++ b/noncore/settings/networksettings2/opietooth2/Opietooth.h
@@ -1,194 +1,223 @@
#ifndef OPIETOOTH_H
#define OPIETOOTH_H
#include <OTIcons.h>
-#include <OTPairingGUI.h>
namespace Opie { namespace Ui { class OLedBox; }; };
+#include <OTSniffGUI.h>
namespace Opietooth2 {
class OTGateway;
class OTDriver;
class OTInquiry;
class OTPeer;
class PeerLVI;
+class OTSniffing : public OTSniffGUI {
+
+ Q_OBJECT
+
+public :
+
+ OTSniffing( QWidget * parent );
+ ~OTSniffing();
+
+private slots :
+
+ void SLOT_Trace( void );
+ void SLOT_ClearLog( void );
+
+signals :
+
+protected :
+
+private :
+
+ OTGateway * OT;
+};
+};
+
+#include <OTPairingGUI.h>
+
+namespace Opietooth2 {
class OTPairing : public OTPairingGUI {
Q_OBJECT
public :
OTPairing( QWidget * parent,
OTIcons * _Ic = 0 );
~OTPairing();
private slots :
void SLOT_Unpair( void );
signals :
protected :
private :
bool MyIcons;
OTIcons * Icons;
OTGateway * OT;
};
};
#include <OTScanGUI.h>
namespace Opietooth2 {
class OTGateway;
class OTDriver;
class OTInquiry;
class OTPeer;
class OTScan : public OTScanGUI {
Q_OBJECT
public :
OTScan( QWidget * parent,
OTIcons * _Ic = 0 );
~OTScan();
// static function to return a device and a channel
static int getDevice( OTPeer *& Peer,
int & Channel,
OTGateway * OT,
const UUIDVector & Filter = 0,
QWidget* Parent = 0);
// show only services that match any of the filter
void setScanFilter( const UUIDVector & Filter );
void resetScanFilter( void );
inline OTPeer * selectedPeer( void )
{ return SelectedPeer; }
inline int selectedChannel( void )
{ return SelectedChannel; }
public slots :
private slots :
void SLOT_DoScan( bool );
void SLOT_NewPeer( OTPeer *, bool );
void SLOT_FinishedDetecting();
void SLOT_Show( QListViewItem *);
void SLOT_RefreshServices( void );
void SLOT_RefreshState( void );
void SLOT_CleanupOld( void );
void SLOT_UpdateStrength( void );
void SLOT_PeerState( OTPeer * );
void SLOT_Selected( QListViewItem * );
signals :
void selected( void );
protected :
private :
void refreshState( PeerLVI *, bool );
void scanMode( bool );
// load scanned devices
bool MyIcons;
OTIcons * Icons;
OTGateway * OT;
OTInquiry * Scanning;
UUIDVector Filter;
Opie::Ui::OLedBox * Paired_Led;
QTimer * StrengthTimer;
PeerLVI * Current;
OTPeer * SelectedPeer;
int SelectedChannel;
};
};
#include <OTManageGUI.h>
namespace Opietooth2 {
class OTManage : public OTManageGUI {
Q_OBJECT
public :
OTManage( QWidget * parent,
OTIcons * _IC = 0 );
~OTManage();
public slots :
private slots :
void SLOT_ShowDriver( QListViewItem * );
void SLOT_UpDriver( bool );
void SLOT_StateChange( OTDriver * , bool );
void SLOT_DriverListChanged();
void SLOT_SetRefreshTimer( int );
signals :
protected :
private :
// load scanned devices
bool MyIcons;
OTIcons * Icons;
OTGateway * OT;
OTInquiry * Scanning;
};
};
#include <OTMainGUI.h>
namespace Opietooth2 {
class OTMain : public OTMainGUI {
Q_OBJECT
public :
OTMain( QWidget * parent );
~OTMain();
public slots :
private slots :
void SLOT_Pairing( void );
void SLOT_Manage( void );
+ void SLOT_Sniffing( void );
void SLOT_Scan( void );
void SLOT_EnableBluetooth( bool );
void SLOT_DriverListChanged();
void SLOT_DeviceIsEnabled( bool );
void SLOT_StateChange( OTDriver * , bool );
signals :
protected :
private :
// load scanned devices
OTIcons * Icons;
OTGateway * OT;
+ OTSniffing * SnifWindow;
};
};
#endif
diff --git a/noncore/settings/networksettings2/opietooth2/opietooth2.pro b/noncore/settings/networksettings2/opietooth2/opietooth2.pro
index 590b656..cfb527d 100644
--- a/noncore/settings/networksettings2/opietooth2/opietooth2.pro
+++ b/noncore/settings/networksettings2/opietooth2/opietooth2.pro
@@ -1,37 +1,37 @@
TEMPLATE = lib
CONFIG += qt warn_on release
#CONFIG += qt warn_on debug
DESTDIR = $(OPIEDIR)/lib$(PROJMAK)
HEADERS = OTDevice.h \
OTDriver.h \
OTGateway.h \
OTHCISocket.h \
OTInquiry.h \
OTDeviceAddress.h \
OTIcons.h \
OTUUID.h \
OTSDPAttribute.h \
OTSDPService.h \
OTPeer.h \
Opietooth.h
SOURCES = OTDevice.cpp \
OTDriver.cpp \
OTDriverList.cpp \
OTHCISocket.cpp \
OTInquiry.cpp \
OTDeviceAddress.cpp \
OTUUID.cpp \
OTSDPAttribute.cpp \
OTSDPService.cpp \
OTIcons.cpp \
OTPeer.cpp \
OTGateway.cpp \
Opietooth.cpp
INCLUDEPATH += $(OPIEDIR)/include
DEPENDPATH += $(OPIEDIR)/include
LIBS += -lqpe -lopiecore2 -lbluetooth
-INTERFACES = OTMainGUI.ui OTScanGUI.ui OTManageGUI.ui OTPairingGUI.ui
+INTERFACES = OTMainGUI.ui OTSniffGUI.ui OTScanGUI.ui OTManageGUI.ui OTPairingGUI.ui
TARGET = opietooth2
VERSION = 1.0.0
include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/settings/packagemanager/opackagemanager.cpp b/noncore/settings/packagemanager/opackagemanager.cpp
index c9fdec1..ac16954 100644
--- a/noncore/settings/packagemanager/opackagemanager.cpp
+++ b/noncore/settings/packagemanager/opackagemanager.cpp
@@ -1,394 +1,397 @@
/*
This file is part of the Opie Project
Copyright (c) 2003 Dan Williams <drw@handhelds.org>
=.
.=l.
.>+-=
_;:, .> :=|. This program is free software; you can
.> <`_, > . <= redistribute it and/or modify it under
:`=1 )Y*s>-.-- : the terms of the GNU Library General Public
.="- .-=="i, .._ License as published by the Free Software
- . .-<_> .<> Foundation; either version 2 of the License,
._= =} : or (at your option) any later version.
.%`+i> _;_.
.i_,=:_. -<s. This program is distributed in the hope that
+ . -:. = it will be useful, but WITHOUT ANY WARRANTY;
: .. .:, . . . without even the implied warranty of
=_ + =;=|` MERCHANTABILITY or FITNESS FOR A
_.=:. : :=>`: PARTICULAR PURPOSE. See the GNU
..}^=.= = ; Library General Public License for more
++= -. .` .: details.
: = ...= . :.=-
-. .:....=;==+<; You should have received a copy of the GNU
-_. . . )=. = Library General Public License along with
-- :-=` this library; see the file COPYING.LIB.
If not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include "opackagemanager.h"
#include "oipkgconfigdlg.h"
#include <qpe/qpeapplication.h>
#include <ctype.h>
OPackageManager::OPackageManager( Config *config, QObject *parent, const char *name )
: QObject( parent, name )
, m_config( config )
, m_ipkg( m_config, this )
, m_packages( 9973 )
, m_categories()
{
m_packages.setAutoDelete( true );
}
void OPackageManager::loadAvailablePackages()
{
m_packages.clear();
OConfItemList *serverList = m_ipkg.servers();
if ( serverList )
{
// Initialize status messaging
emit initStatus( serverList->count() );
int serverCount = 0;
bool categoryAdded = false;
for ( OConfItemListIterator serverIt( *serverList ); serverIt.current(); ++serverIt )
{
OConfItem *server = serverIt.current();
// Process server only if it is active
if ( server->active() )
{
// Update status
QString status = tr( "Reading available packages:\n\t" );
status.append( server->name() );
emit statusText( status );
++serverCount;
emit statusBar( serverCount );
qApp->processEvents();
OPackageList *packageList = m_ipkg.availablePackages( server->name() );
if ( packageList )
{
for ( OPackageListIterator packageIt( *packageList ); packageIt.current(); ++packageIt )
{
OPackage *package = packageIt.current();
// Load package info
- if ( !m_packages.find( package->name() ) )
+ if ( !m_packages.find( package->name() ) ) {
+ printf( "ADD AVAILABLE '%s'\n", package->name().latin1());
m_packages.insert( package->name(), package );
- else
+ } else
{
// If new package is newer version, replace existing package
OPackage *currPackage = m_packages[package->name()];
if ( compareVersions( package->version(), currPackage->version() ) == 1 )
m_packages.replace( package->name(), package );
}
// Add category to list if it doesn't already exist
if ( m_categories.grep( package->category() ).isEmpty() )
{
m_categories << package->category();
categoryAdded = true;
}
}
}
}
}
delete serverList;
// Sort category list if categories were added
if ( categoryAdded )
m_categories.sort();
}
}
void OPackageManager::loadInstalledPackages()
{
OConfItemList *destList = m_ipkg.destinations();
if ( destList )
{
// Initialize status messaging
emit initStatus( destList->count() );
int destCount = 0;
bool categoryAdded = false;
for ( OConfItemListIterator destIt( *destList ); destIt.current(); ++destIt )
{
OConfItem *destination = destIt.current();
// Process destination only if it is active
if ( destination->active() )
{
// Update status
QString status = tr( "Reading installed packages:\n\t" );
status.append( destination->name() );
emit statusText( status );
++destCount;
emit statusBar( destCount );
qApp->processEvents();
+ printf( "DESGTINATION %s\n", destination->name().latin1());
OPackageList *packageList = m_ipkg.installedPackages( destination->name(),
destination->value() );
if ( packageList )
{
for ( OPackageListIterator packageIt( *packageList ); packageIt.current(); ++packageIt )
{
OPackage *package = packageIt.current();
OPackage *currPackage = m_packages[package->name()];
if ( currPackage )
{
// Package is in a current feed, update installed version, destination
currPackage->setVersionInstalled( package->versionInstalled() );
currPackage->setDestination( package->destination() );
delete package;
}
else
{
// Package isn't in a current feed, add to list
+ printf( "ADD INSTALLED '%s'\n", package->name().latin1());
m_packages.insert( package->name(), package );
// Add category to list if it doesn't already exist
if ( m_categories.grep( package->category() ).isEmpty() )
{
m_categories << package->category();
categoryAdded = true;
}
}
}
}
}
}
delete destList;
// Sort category list if categories were added
if ( categoryAdded )
m_categories.sort();
}
}
OPackageList *OPackageManager::packages()
{
// TODO - look to see if list is loaded, if not, load available & installed
OPackageList *pl = new OPackageList;
for ( QDictIterator<OPackage> packageIt( m_packages ); packageIt.current(); ++packageIt )
pl->append( packageIt.current() );
return pl;
}
OPackageList *OPackageManager::filterPackages( const QString &name,const QString &server,
const QString &destination, Status status, const QString &category )
{
// TODO - look to see if list is loaded, if not, load available & installed
OPackageList *pl = new OPackageList;
for ( QDictIterator<OPackage> packageIt( m_packages ); packageIt.current(); ++packageIt )
{
OPackage *package = packageIt.current();
bool nameMatch = ( name.isNull() || package->name().contains( name ) );
bool serverMatch = ( server.isNull() || package->source() == server );
bool destinationMatch = ( destination.isNull() || package->destination() == destination );
bool statusMatch;
switch ( status )
{
case All : statusMatch = true;
break;
case NotInstalled : statusMatch = package->versionInstalled().isNull();
break;
case Installed : statusMatch = !package->versionInstalled().isNull();
break;
case Updated : statusMatch = ( !package->versionInstalled().isNull() &&
compareVersions( package->version(), package->versionInstalled() ) == 1 );
break;
default : statusMatch = true;
break;
};
bool categoryMatch = ( category.isNull() || package->category() == category );
if ( nameMatch && serverMatch && destinationMatch && statusMatch && categoryMatch )
pl->append( packageIt.current() );
}
return pl;
}
QStringList OPackageManager::servers()
{
QStringList sl;
OConfItemList *serverList = m_ipkg.servers();
if ( serverList )
{
for ( OConfItemListIterator serverIt( *serverList ); serverIt.current(); ++serverIt )
{
OConfItem *server = serverIt.current();
// Add only active servers
if ( server->active() )
sl << server->name();
}
}
return sl;
}
QStringList OPackageManager::destinations()
{
QStringList dl;
OConfItemList *destList = m_ipkg.destinations();
if ( destList )
{
for ( OConfItemListIterator destIt( *destList ); destIt.current(); ++destIt )
{
OConfItem *destination = destIt.current();
// Add only active destinations
if ( destination->active() )
dl << destination->name();
}
}
return dl;
}
OConfItem *OPackageManager::findConfItem( OConfItem::Type type, const QString &name )
{
return m_ipkg.findConfItem( type, name );
}
OPackage *OPackageManager::findPackage( const QString &name )
{
return m_packages[ name ];
}
int OPackageManager::compareVersions( const QString &ver1, const QString &ver2 )
{
// TODO - should this be in OIpkg???
int epoch1, epoch2;
QString version1, revision1;
QString version2, revision2;
parseVersion( ver1, &epoch1, &version1, &revision1 );
parseVersion( ver2, &epoch2, &version2, &revision2 );
if ( epoch1 > epoch2 )
return 1;
else if ( epoch1 < epoch2 )
return -1;
int r = verrevcmp( version1.latin1(), version2.latin1() );
if (r)
return r;
r = verrevcmp( revision1.latin1(), revision2.latin1() );
return r;
}
bool OPackageManager::configureDlg( bool installOptions )
{
OIpkgConfigDlg dlg( &m_ipkg, installOptions, static_cast<QWidget *>(parent()) );
return ( QPEApplication::execDialog( &dlg ) == QDialog::Accepted );
}
void OPackageManager::saveSettings()
{
m_ipkg.saveSettings();
}
bool OPackageManager::executeCommand( OPackage::Command command, const QStringList &packages,
const QString &destination, const QObject *receiver,
const char *slotOutput, bool rawOutput )
{
return m_ipkg.executeCommand( command, packages, destination, receiver, slotOutput, rawOutput );
}
void OPackageManager::parseVersion( const QString &verstr, int *epoch, QString *version,
QString *revision )
{
*epoch = 0;
*revision = QString::null;
// Version string is in the format "ee:vv-rv", where ee=epoch, vv=version, rv=revision
// Get epoch
int colonpos = verstr.find( ':' );
if ( colonpos > -1 )
{
*epoch = verstr.left( colonpos ).toInt();
}
// Get version and revision
int hyphenpos = verstr.find( '-', colonpos + 1 );
int verlen = verstr.length();
if ( hyphenpos > -1 )
{
*version = verstr.mid( colonpos + 1, hyphenpos - colonpos - 1 );
*revision = verstr.right( verlen - hyphenpos - 1 );
}
else
{
*version = verstr.right( verlen - colonpos );
}
}
/*
* libdpkg - Debian packaging suite library routines
* vercmp.c - comparison of version numbers
*
* Copyright (C) 1995 Ian Jackson <iwj10@cus.cam.ac.uk>
*/
int OPackageManager::verrevcmp( const char *val, const char *ref )
{
int vc, rc;
long vl, rl;
const char *vp, *rp;
const char *vsep, *rsep;
if (!val) val= "";
if (!ref) ref= "";
for (;;) {
vp= val; while (*vp && !isdigit(*vp)) vp++;
rp= ref; while (*rp && !isdigit(*rp)) rp++;
for (;;) {
vc= (val == vp) ? 0 : *val++;
rc= (ref == rp) ? 0 : *ref++;
if (!rc && !vc) break;
if (vc && !isalpha(vc)) vc += 256; /* assumes ASCII character set */
if (rc && !isalpha(rc)) rc += 256;
if (vc != rc) return vc - rc;
}
val= vp;
ref= rp;
vl=0; if (isdigit(*vp)) vl= strtol(val,(char**)&val,10);
rl=0; if (isdigit(*rp)) rl= strtol(ref,(char**)&ref,10);
if (vl != rl) return vl - rl;
vc = *val;
rc = *ref;
vsep = strchr(".-", vc);
rsep = strchr(".-", rc);
if (vsep && !rsep) return -1;
if (!vsep && rsep) return +1;
if (!*val && !*ref) return 0;
if (!*val) return -1;
if (!*ref) return +1;
}
}