summaryrefslogtreecommitdiffstats
path: root/src/updates
diff options
context:
space:
mode:
Diffstat (limited to 'src/updates')
-rw-r--r--src/updates/Makefile.am9
-rwxr-xr-xsrc/updates/gwenview_1.4_osdformat.sh43
-rw-r--r--src/updates/gwenview_1.4_osdformat.upd4
-rwxr-xr-xsrc/updates/gwenview_1.4_osdformat_test.sh39
-rw-r--r--src/updates/gwenview_thumbnail_size.sh12
-rw-r--r--src/updates/gwenview_thumbnail_size.upd5
6 files changed, 112 insertions, 0 deletions
diff --git a/src/updates/Makefile.am b/src/updates/Makefile.am
new file mode 100644
index 0000000..c246428
--- /dev/null
+++ b/src/updates/Makefile.am
@@ -0,0 +1,9 @@
+update_DATA = \
+ gwenview_thumbnail_size.upd \
+ gwenview_1.4_osdformat.upd
+
+update_SCRIPTS = \
+ gwenview_thumbnail_size.sh \
+ gwenview_1.4_osdformat.sh
+
+updatedir = $(kde_datadir)/kconf_update
diff --git a/src/updates/gwenview_1.4_osdformat.sh b/src/updates/gwenview_1.4_osdformat.sh
new file mode 100755
index 0000000..6a28550
--- /dev/null
+++ b/src/updates/gwenview_1.4_osdformat.sh
@@ -0,0 +1,43 @@
+#!/bin/sh
+
+# Escape backslashes. Shell sucks.
+sed s'/\\/BACKSLASH/g' | (
+
+osdMode=
+while read line ; do
+ if echo $line | grep '^osd mode' >/dev/null 2>/dev/null ; then
+ osdMode=$(echo $line | sed 's/^.*=//')
+ continue
+ fi
+ if echo $line | grep '^free output format' >/dev/null 2>/dev/null ; then
+ freeOutputFormat=$(echo $line | sed -e 's/^.*=//')
+ continue
+ fi
+ echo $line
+done
+
+case $osdMode in
+ 0)
+ osdFormat=''
+ ;;
+ 1)
+ osdFormat='%p'
+ ;;
+ 2)
+ osdFormat='%c'
+ ;;
+ 3)
+ osdFormat='%p\\n%c'
+ ;;
+ 4)
+ osdFormat="$freeOutputFormat"
+ ;;
+ *)
+ osdFormat=''
+ ;;
+esac
+
+echo osdFormat=$osdFormat
+
+) | sed 's/BACKSLASH/\\/g'
+# Escape backslashes. Shell sucks.
diff --git a/src/updates/gwenview_1.4_osdformat.upd b/src/updates/gwenview_1.4_osdformat.upd
new file mode 100644
index 0000000..52f341d
--- /dev/null
+++ b/src/updates/gwenview_1.4_osdformat.upd
@@ -0,0 +1,4 @@
+Id=osdformat
+File=gwenviewrc
+Group=pixmap widget
+Script=gwenview_1.4_osdformat.sh,sh
diff --git a/src/updates/gwenview_1.4_osdformat_test.sh b/src/updates/gwenview_1.4_osdformat_test.sh
new file mode 100755
index 0000000..ed555d7
--- /dev/null
+++ b/src/updates/gwenview_1.4_osdformat_test.sh
@@ -0,0 +1,39 @@
+#!/bin/sh
+check() {
+ cat > src.txt <<EOF
+$1
+EOF
+ cat > tmp.txt <<EOF
+$2
+EOF
+ sort tmp.txt > wanted.txt
+ ./gwenview_1.4_osdformat.sh < src.txt | sort > dst.txt
+ if diff -uwB --brief wanted.txt dst.txt ; then
+ echo ok
+ else
+ echo "
+--------------
+# From:
+$1
+# To:
+$2
+# Got:
+"
+ cat dst.txt
+ echo "# Wanted:"
+ cat wanted.txt
+ echo "
+--------------
+"
+ fi
+}
+
+check "osd mode=0" "osdFormat="
+check "osd mode=1" "osdFormat=%p"
+check "osd mode=2" "osdFormat=%c"
+check "osd mode=3" "osdFormat=%p\\n%c"
+check "osd mode=3
+something else" "osdFormat=%p\\n%c
+something else"
+check "osd mode=4
+free output format=zog\\nzog" "osdFormat=zog\\nzog"
diff --git a/src/updates/gwenview_thumbnail_size.sh b/src/updates/gwenview_thumbnail_size.sh
new file mode 100644
index 0000000..5e2872b
--- /dev/null
+++ b/src/updates/gwenview_thumbnail_size.sh
@@ -0,0 +1,12 @@
+#! /bin/sh
+while read line; do
+ if echo "$line" | grep '^thumbnail size=small' >/dev/null 2>/dev/null; then
+ echo "thumbnail size=48"
+ elif echo "$line" | grep '^thumbnail size=med' >/dev/null 2>/dev/null; then
+ echo "thumbnail size=96"
+ elif echo "$line" | grep '^thumbnail size=large' >/dev/null 2>/dev/null; then
+ echo "thumbnail size=128"
+ else
+ echo "$line"
+ fi
+done
diff --git a/src/updates/gwenview_thumbnail_size.upd b/src/updates/gwenview_thumbnail_size.upd
new file mode 100644
index 0000000..dea652b
--- /dev/null
+++ b/src/updates/gwenview_thumbnail_size.upd
@@ -0,0 +1,5 @@
+Id=gwenview_thumbnail_size
+File=gwenviewrc
+Group=file widget
+Options=overwrite
+Script=gwenview_thumbnail_size.sh,sh