174 changes: 100 additions & 74 deletions i18n/qgis_de.ts

Large diffs are not rendered by default.

10 changes: 7 additions & 3 deletions images/icons/mac/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@

FILE (GLOB ICONS *.icns)
INSTALL (FILES ${ICONS}
DESTINATION ${CMAKE_INSTALL_PREFIX}/../Resources)
IF (WITH_DESKTOP)
FILE (GLOB ICONS *.icns)
INSTALL (FILES ${ICONS}
DESTINATION ${CMAKE_INSTALL_PREFIX}/../Resources)

ADD_SUBDIRECTORY(browser)
ENDIF (WITH_DESKTOP)
6 changes: 6 additions & 0 deletions images/icons/mac/browser/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

FILE (GLOB ICONS *.icns)
INSTALL (FILES ${ICONS}
DESTINATION "${CMAKE_INSTALL_PREFIX}/${QGIS_BIN_DIR}/QGIS Browser.app/Contents/Resources")
# create alias now, so alias file gets correct icon
INSTALL (CODE "EXECUTE_PROCESS(COMMAND osascript -e \"tell application \\\"Finder\\\" to make alias file to POSIX file \\\"$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/${QGIS_BIN_DIR}/QGIS Browser.app\\\" at POSIX file \\\"$ENV{DESTDIR}${QGIS_INSTALL_PREFIX}/\\\"\")")
Binary file added images/icons/mac/browser/qgisb.icns
Binary file not shown.
23 changes: 21 additions & 2 deletions mac/app.info.plist.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundleSignature</key>
<string>QGIS</string>
<key>CFBundleGetInfoString</key>
<string>${QGIS_APP_NAME} ${COMPLETE_VERSION}-${RELEASE_NAME} (${REVISION}), © 2002-2011 QGIS Development Team</string>
<string>${QGIS_APP_NAME} ${COMPLETE_VERSION}-${RELEASE_NAME} (${REVISION}), © 2002-2012 QGIS Development Team</string>
<key>CFBundleShortVersionString</key>
<string>${COMPLETE_VERSION}</string>
<key>CFBundleVersion</key>
Expand Down Expand Up @@ -185,33 +185,52 @@
<key>CFBundleLocalizations</key>
<array>
<string>en</string>
<string>af</string>
<string>ar</string>
<string>bg</string>
<string>ca_ES</string>
<string>cs_CZ</string>
<string>da_DK</string>
<string>de</string>
<string>el_GR</string>
<string>es</string>
<string>fa</string>
<string>fi</string>
<string>fr</string>
<string>gl_ES</string>
<string>he</string>
<string>hr_HR</string>
<string>hu</string>
<string>id</string>
<string>is</string>
<string>it</string>
<string>ja</string>
<string>ka_GE</string>
<string>ko_KR</string>
<string>lo</string>
<string>lt</string>
<string>lv</string>
<string>ka</string>
<string>mn</string>
<string>nl</string>
<string>no</string>
<string>pl_PL</string>
<string>pt_BR</string>
<string>pt_PT</string>
<string>ro</string>
<string>ru</string>
<string>sk</string>
<string>sl_SI</string>
<string>sq_AL</string>
<string>sr_CS-Latn</string>
<string>sv</string>
<string>ta</string>
<string>th</string>
<string>tr</string>
<string>uk</string>
<string>vi</string>
<string>xh</string>
<string>zh_CN</string>
<string>zh_TW</string>
</array>
</dict>
</plist>
80 changes: 80 additions & 0 deletions mac/browser.info.plist.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleName</key>
<string>QGIS Browser</string>
<key>CFBundleIdentifier</key>
<string>org.qgis.qgis</string>
<key>CFBundleExecutable</key>
<string>QGIS Browser</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>QGSB</string>
<key>CFBundleGetInfoString</key>
<string>${QGIS_APP_NAME} Browser ${COMPLETE_VERSION}-${RELEASE_NAME} (${REVISION}), © 2002-2012 QGIS Development Team</string>
<key>CFBundleShortVersionString</key>
<string>${COMPLETE_VERSION}</string>
<key>CFBundleVersion</key>
<string>${COMPLETE_VERSION} (${REVISION})</string>
<key>CFBundleIconFile</key>
<string>qgisb.icns</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CSResourcesFileMapped</key>
<true/>
<key>CFBundleLocalizations</key>
<array>
<string>en</string>
<string>af</string>
<string>ar</string>
<string>bg</string>
<string>ca_ES</string>
<string>cs_CZ</string>
<string>da_DK</string>
<string>de</string>
<string>el_GR</string>
<string>es</string>
<string>fa</string>
<string>fi</string>
<string>fr</string>
<string>gl_ES</string>
<string>he</string>
<string>hr_HR</string>
<string>hu</string>
<string>id</string>
<string>is</string>
<string>it</string>
<string>ja</string>
<string>ka_GE</string>
<string>ko_KR</string>
<string>lo</string>
<string>lt</string>
<string>lv</string>
<string>mn</string>
<string>nl</string>
<string>no</string>
<string>pl_PL</string>
<string>pt_BR</string>
<string>pt_PT</string>
<string>ro</string>
<string>ru</string>
<string>sk</string>
<string>sl_SI</string>
<string>sq_AL</string>
<string>sr_CS-Latn</string>
<string>sv</string>
<string>ta</string>
<string>th</string>
<string>tr</string>
<string>uk</string>
<string>vi</string>
<string>xh</string>
<string>zh_CN</string>
<string>zh_TW</string>
</array>
</dict>
</plist>
2 changes: 1 addition & 1 deletion mac/cmake/1qt.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ IF (NOT EXISTS "${QLIBDIR}/libqwt.dylib")
ENDIF ()
GET_INSTALL_NAME ("@QWT_LIBRARY@" "libqwt" QWT_CHG)
IF (QWT_CHG)
INSTALLNAMETOOL_CHANGE ("${QWT_CHG}" "${ATEXECUTABLE}/@QGIS_LIB_SUBDIR@/libqwt.dylib" "${QAPPDIR}/@QGIS_APP_NAME@")
UPDATEQGISPATHS (${QWT_CHG} libqwt.dylib)
ENDIF (QWT_CHG)

# PyQt
Expand Down
11 changes: 11 additions & 0 deletions resources/function_help/$now-de_DE
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<h3>Funktion $now</h3>
Ergibt aktuelles Datum und Zeit

<h4>Syntax</h4>
<pre>$now</pre>

<h4>Argumente</h4>
Keine

<h4>Beispiel</h4>
<pre>$now &rarr; 2012-07-22T13:24:57</pre>
12 changes: 12 additions & 0 deletions resources/function_help/$now-en_US
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<h3>$now function</h3>
Returns the current date and time

<h4>Syntax</h4>
<pre>$now</pre>

<h4>Arguments</h4>
None

<h4>Example</h4>
<pre>$now &rarr; 2012-07-22T13:24:57</pre>

28 changes: 28 additions & 0 deletions resources/function_help/CASE ELSE-de_DE
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<h3>CASE Ausdruck</h3>
Ist ein bedingter Ausdruck mit dem mehrere AusdrĂĽcken ausgewertet und ein
Ergebnis zurĂĽckgegeben werden kann.

<h4>Syntax</h4>
<pre>
CASE
WHEN <i>bedingung</i> THEN <i>ergebnis</i>
[ ...n ]
[ ELSE <i>ergebnis</i> ]
END
</pre>
[ ] markiert optionale Komponenten

<h4>Argumente</h4>
<!-- List args for functions here-->
<i> WHEN bedingung</i> - Der Bedingungsausdruck. <br>
<i> THEN ergebnis</i> - Wenn die <i>bedingung</i> True ergibt, wird der Ausdruck <i>ergebnis</i> ausgewertet und zurĂĽckgegeben. <br>
<i> ELSE ergebnis</i> - Wenn keine der Bedingungen erfĂĽllt ist, wird der Ausdruck <i>ergebnis</i> ausgewertet und zurĂĽckgegeben. <br>

<h4>Beispiel</h4>
<!-- Show example of function.-->
<pre>
CASE
WHEN <i>"column" IS NULL</i> THEN <i>'Leer'</i>
ELSE <i>"column"</i>
END
</pre>
28 changes: 28 additions & 0 deletions resources/function_help/CASE ELSE-en_US
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<h3>CASE expression</h3>
A conditional expression that can be used to evaluate multiple expressions and
return a result.

<h4>Syntax</h4>
<pre>
CASE
WHEN <i>condition</i> THEN <i>result</i>
[ ...n ]
[ ELSE <i>result</i> ]
END
</pre>
[ ] marks optional components

<h4>Arguments</h4>
<!-- List args for functions here-->
<i> WHEN condition</i> - The condition expression to evaluate. <br>
<i> THEN result</i> - If <i>condition</i> evaluates to True then <i>result</i> is evaluated and returned. <br>
<i> ELSE result</i> - If none of the above conditions evaluated to True then <i>result</i> is evaluated and returned. <br>

<h4>Example</h4>
<!-- Show example of function.-->
<pre>
CASE
WHEN <i>"column" IS NULL</i> THEN <i>'None'</i>
ELSE <i>"column"</i>
END
</pre>
27 changes: 27 additions & 0 deletions resources/function_help/CASE-de_DE
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<h3>CASE Ausdruck</h3>
Ist ein bedingter Ausdruck mit dem mehrere AusdrĂĽcken ausgewertet und ein
Ergebnis zurĂĽckgegeben werden kann.

<h4>Syntax</h4>
<pre>
CASE
WHEN <i>bedingung</i> THEN <i>ergebnis</i>
[ ...n ]
[ ELSE <i>ergebnis</i> ]
END
</pre>
[ ] markiert optionale Komponenten

<h4>Argumente</h4>
<!-- List args for functions here-->
<i> WHEN bedingung</i> - Der Bedingungsausdruck. <br>
<i> THEN ergebnis</i> - Wenn die <i>bedingung</i> True ergibt, wird der Ausdruck <i>ergebnis</i> ausgewertet und zurĂĽckgegeben. <br>
<i> ELSE ergebnis</i> - Wenn keine der Bedingungen erfĂĽllt ist, wird der Ausdruck <i>ergebnis</i> ausgewertet und zurĂĽckgegeben. <br>

<h4>Beispiel</h4>
<!-- Show example of function.-->
<pre>
CASE
WHEN <i>"column" IS NULL</i> THEN <i>'Leer'</i>
END
</pre>
27 changes: 27 additions & 0 deletions resources/function_help/CASE-en_US
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<h3>CASE expression</h3>
A conditional expression that can be used to evaluate multiple expressions and
return a result.

<h4>Syntax</h4>
<pre>
CASE
WHEN <i>condition</i> THEN <i>result</i>
[ ...n ]
[ ELSE <i>result</i> ]
END
</pre>
[ ] marks optional components

<h4>Arguments</h4>
<!-- List args for functions here-->
<i> WHEN condition</i> - The condition expression to evaluate. <br>
<i> THEN result</i> - If <i>condition</i> evaluates to True then <i>result</i> is evaluated and returned. <br>
<i> ELSE result</i> - If none of the above conditions evaluated to True then <i>result</i> is evaluated and returned. <br>

<h4>Example</h4>
<!-- Show example of function.-->
<pre>
CASE
WHEN <i>"column" IS NULL</i> THEN <i>'None'</i>
END
</pre>
1 change: 0 additions & 1 deletion resources/function_help/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
FILE(GLOB HELP_FILES *-*)

INSTALL(FILES ${HELP_FILES} DESTINATION ${QGIS_DATA_DIR}/resources/function_help)

2 changes: 2 additions & 0 deletions resources/function_help/Date and Time-de_DE
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<h3>Datum- und Zeitgruppe</h3>
Diese Gruppe enthält Funktion zur Verarbeitung von Daten und Zeiten.
2 changes: 2 additions & 0 deletions resources/function_help/Date and Time-en_US
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<h3>Date and Time Group</h3>
This group contains functions for handling date and time data.
29 changes: 29 additions & 0 deletions resources/function_help/age-de_DE
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<h3>Funktion age()</h3>
Gibt den Unterschied zwischen zwei Daten zurĂĽck.
<br><br>
Der Unterschied wird als <code>Intervall</code> zurĂĽckgegeben
und muĂź mit folgenden Funktionen weiterverarbeitet werde, um
sinnvolle Informationen zu erhalten:
><code>year</code>
<li><code>month</code>
<li><code>week</code>
<li><code>day</code>
<li><code>hour</code>
<li><code>minute</code>
<li><code>second</code>
</ul>
<h4>Syntax</h4>
<code>age(zeichenkette,zeichenkette)</code><br>
<code>age(datetime,datetime)</code><br>
<code>age(zeichenkette,datetime)</code><br>
<code>age(datetime,zeichenkette)</code><br>

<h4>Argumente</h4>
<code>zeichenkette</code> - ist string. Eine Zeichenkette in Datumsformat. <br>
<code>datetime</code> - ist date oder datetime. Eine Datums oder eine Zeit.

<h4>Beispiel</h4>
<!-- Show example of function.-->
<code>age('2012-05-12','2012-05-2') &rarr; Intervall</code><br>
<code>day</code> benutzen um die Anzahl der Tage zur bestimmen<br>
<code>day(age('2012-05-12','2012-05-2')) &rarr; 10</code><br>
32 changes: 32 additions & 0 deletions resources/function_help/age-en_US
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<h3>age() function</h3>
Returns the difference between two dates.
<br><br>
The difference is returned as a <code>Interval</code>
and needs to be used with one of the following functions
in order to extract useful information:
<ul>
<li><code>year</code>
<li><code>month</code>
<li><code>week</code>
<li><code>day</code>
<li><code>hour</code>
<li><code>minute</code>
<li><code>second</code>
</ul>
<h4>Syntax</h4>
<code>age(string,string)</code><br>
<code>age(datetime,datetime)</code><br>
<code>age(string,datetime)</code><br>
<code>age(datetime,string)</code><br>

<h4>Arguments</h4>
<code>string</code> - is string. A string in date format.
<br>
<code>datetime</code> - is date or datetime. A date or datetime type.

<h4>Example</h4>
<!-- Show example of function.-->
<code>age('2012-05-12','2012-05-2') &rarr; Interval</code><br>
use <code>day</code> to extract number of days<br>
<code>day(age('2012-05-12','2012-05-2')) &rarr; 10</code><br>

17 changes: 17 additions & 0 deletions resources/function_help/day-de_DE
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<h3>Funktion day()</h3>
Tag eines Datum oder Anzahl der Tage eines <code>Intervalls</code>.

<h4>Syntax</h4>
<code>day(date)</code><br>
<code>day(Intervall)</code><br>

<h4>Argumente</h4>
<code>date</code> - ist date oder datetime. Das Datum oder die Zeit dessen Tag bestimmt werden soll.
<br>
<code>Interval</code> - ist Interval. Das Interval aus dem die Anzahl der Tage bestimmt werden soll.

<h4>Beispiele</h4>
<!-- Show example of function.-->
<code>day('2012-05-12') &rarr; 12</code><br>
<code>day(tointerval('3 days')) &rarr; 3</code><br>
<code>day(age('2012-01-01','2010-01-01')) &rarr; 730</code><br>
19 changes: 19 additions & 0 deletions resources/function_help/day-en_US
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<h3>day() function</h3>
Extract the day from a date, or the number of days
from a <code>Interval</code>

<h4>Syntax</h4>
<code>day(date)</code><br>
<code>day(Interval)</code><br>

<h4>Arguments</h4>
<code>date</code> - is date or datetime. The date to extract the day from.
<br>
<code>Interval</code> - is Interval. The Interval to return the number of days from.

<h4>Example</h4>
<!-- Show example of function.-->
<code>day('2012-05-12') &rarr; 12</code><br>
<code>day(tointerval('3 days')) &rarr; 3</code><br>
<code>day(age('2012-01-01','2010-01-01')) &rarr; 730</code><br>

20 changes: 20 additions & 0 deletions resources/function_help/hour-de_DE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<h3>Funktion hour()</h3>
Bestimmt die Stunde eines Datums/Zeit oder die Anzahl der Stunden
aus einem <code>Intervall</code>

<h4>Syntax</h4>
<code>hour(datetime)</code><br>
<code>hour(Intervall)</code><br>

<h4>Argumente</h4>
<code>date</code> - ist date oder datetime. Das Datum/die Zeit dessen Stunde bestimmt werden soll.
<br>
<code>Intervall</code> - ist Interval. Das Intervall aus der die Stundenzahl bestimmt werden soll.

<h4>Beispiele</h4>
<!-- Show example of function.-->
<code>hour('2012-07-22T13:24:57') &rarr; 13</code><br>
<code>hour(tointerval('3 hours')) &rarr; 3</code><br>
<code>hour(age('2012-07-22T13:00:00','2012-07-22T10:00:00')) &rarr; 3</code><br>
<code>hour(age('2012-01-01','2010-01-01')) &rarr; 17520</code><br>

20 changes: 20 additions & 0 deletions resources/function_help/hour-en_US
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<h3>hour() function</h3>
Extract the hour from a datetime or time, or the number of hours
from a <code>Interval</code>

<h4>Syntax</h4>
<code>hour(datetime)</code><br>
<code>hour(Interval)</code><br>

<h4>Arguments</h4>
<code>date</code> - is datetime or time. The date to extract the hour from.
<br>
<code>Interval</code> - is Interval. The Interval to return the number of hours from.

<h4>Example</h4>
<!-- Show example of function.-->
<code>hour('2012-07-22T13:24:57') &rarr; 13</code><br>
<code>hour(tointerval('3 hours')) &rarr; 3</code><br>
<code>hour(age('2012-07-22T13:00:00','2012-07-22T10:00:00')) &rarr; 3</code><br>
<code>hour(age('2012-01-01','2010-01-01')) &rarr; 17520</code><br>

15 changes: 15 additions & 0 deletions resources/function_help/left-de_DE
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<h3>Funktion left()</h3>
Ergibt ersten <i>n</i> Zeichen von links.

<h4>Syntax</h4>
<code>left(zeichenkette, laenge)</code><br>

<h4>Argumente</h4>
<code>zeichenkette</code> - ist eine Zeichenkette. Die Zeichenkette.
<br>
<code>laenge</code> - ist eine Zahl. Die Anzahl der zurĂĽckzugebenden Zeichen.

<h4>Beispiel</h4>
<!-- Show example of function.-->
<code>left('Hallo Welt',5) &rarr; 'Hallo'</code><br>

15 changes: 15 additions & 0 deletions resources/function_help/left-en_US
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<h3>left() function</h3>
Returns a substring that contains the <i>n</i> leftmost characters of the string.

<h4>Syntax</h4>
<code>left(string, length)</code><br>

<h4>Arguments</h4>
<code>string</code> - is string. The string.
<br>
<code>length</code> - is int. The number of characters from the left to return.

<h4>Example</h4>
<!-- Show example of function.-->
<code>left('Hello World',5) &rarr; 'Hello'</code><br>

4 changes: 2 additions & 2 deletions resources/function_help/length-de_DE
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Liefert die Länge einer Zeichenkette.

<p><h4>Argumente</h4>
<!-- List args for functions here-->
<i> zeichenkette</i> -> ist eine Zeichenkette. Die Zeichenkette deren Länge zu bestimmen ist.</p>
<i> zeichenkette</i> &rarr; ist eine Zeichenkette. Die Zeichenkette deren Länge zu bestimmen ist.</p>

<p><h4>Beispiel</h4>
<!-- Show example of function.-->
length('HALLO') -> 5</p>
length('HALLO') &rarr; 5</p>
4 changes: 2 additions & 2 deletions resources/function_help/length-en_US
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Returns the length of a string.

<p><h4>Arguments</h4>
<!-- List args for functions here-->
<i> string</i> -> is string. The String to count the length of.</p>
<i> string</i> &rarr; is string. The String to count the length of.</p>

<p><h4>Example</h4>
<!-- Show example of function.-->
length('HELLO') -> 5</p>
length('HELLO') &rarr; 5</p>
4 changes: 2 additions & 2 deletions resources/function_help/lower-de_DE
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Wandelt eine Zeichenkette in Kleinbuchstaben um.
lower(<i>zeichenkette</i>)</p>

<p><h4> Argumente</h4>
<i> zeichenkette</i> -> ist eine Zeichenkette. Die Zeichenkette, die in Kleinbuchstaben umzuwandeln ist.</p>
<i> zeichenkette</i> &rarr; ist eine Zeichenkette. Die Zeichenkette, die in Kleinbuchstaben umzuwandeln ist.</p>

<p><h4> Beispiel</h4>
lower('Hallo Welt') -> 'hallo welt'</p>
lower('Hallo Welt') &rarr; 'hallo welt'</p>
4 changes: 2 additions & 2 deletions resources/function_help/lower-en_US
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Converts a string to lower case letters.
lower(<i>string</i>)</p>

<p><h4> Arguments</h4>
<i> string</i> -> is string. The String to convert to lower case.</p>
<i> string</i> &rarr; is string. The String to convert to lower case.</p>

<p><h4> Example</h4>
lower('HELLO World') -> 'hello world'</p>
lower('HELLO World') &rarr; 'hello world'</p>
15 changes: 15 additions & 0 deletions resources/function_help/lpad-de_DE
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<h3>Funktion lpad()</h3>
Ergibt eine mit einem am Ende mit einem Zeichen auf eine bestimmte Länge aufgefüllte Zeichenkette.

<h4>Syntax</h4>
<code>lpad(zeichenkette, laenge, fuellzeichen)</code><br>

<h4>Argumente</h4>
<code>zeichenkette</code> - ist string. Die Zeichenkette.
<br>
<code>laenge</code> - ist int. Die Länge der neuen Zeichenkette.
<br>
<code>fuellzeichen</code> - ist char. Das Zeichen mit dem die Zeichenkette am Ende aufgefĂĽllt werden soll.

<h4>Beispiel</h4>
<code>lpad('Hallo', 10, 'x') &rarr; 'Halloxxxxx'</code><br>
17 changes: 17 additions & 0 deletions resources/function_help/lpad-en_US
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<h3>lpad() function</h3>
Returns a string with supplied width padded
using the fill character.

<h4>Syntax</h4>
<code>lpad(string, length, fill)</code><br>

<h4>Arguments</h4>
<code>string</code> - is string. The string.
<br>
<code>length</code> - is int. The length of the new string.
<br>
<code>fill</code> - is char. The character to padd the remaining space with.

<h4>Example</h4>
<!-- Show example of function.-->
<code>lpad('Hello', 10, 'x') &rarr; 'Helloxxxxx'</code><br>
18 changes: 18 additions & 0 deletions resources/function_help/minute-de_DE
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<h3>Funktion minute()</h3>
Bestimmt die Minute eines Datums/Zeit oder die Anzahl der Minuten
eines <code>Intervalls</code>

<h4>Syntax</h4>
<code>minute(datetime)</code><br>
<code>minute(Intervall)</code><br>

<h4>Argumente</h4>
<code>datetime</code> - ist datetime oder time. Das Datum aus der die Minute bestimmt werden soll.<br>
<code>Interval</code> - is Interval. Das Intervall aus dem die Minutenanzahl bestimmt werden soll.

<h4>Beispiel</h4>
<!-- Show example of function.-->
<code>minute('2012-07-22T13:24:57') &rarr; 24</code><br>
<code>minute(tointerval('3 minutes')) &rarr; 3</code><br>
<code>minute(age('2012-07-22T00:20:00','2012-07-22T00:00:00')) &rarr; 20</code><br>
<code>minute(age('2012-01-01','2010-01-01')) &rarr; 1051200</code><br>
20 changes: 20 additions & 0 deletions resources/function_help/minute-en_US
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<h3>minute() function</h3>
Extract the minute from a datetime or time, or the number of minutes
from a <code>Interval</code>

<h4>Syntax</h4>
<code>minute(datetime)</code><br>
<code>minute(Interval)</code><br>

<h4>Arguments</h4>
<code>date</code> - is datetime or time. The date to extract the minute from.
<br>
<code>Interval</code> - is Interval. The Interval to return the number of minutes from.

<h4>Example</h4>
<!-- Show example of function.-->
<code>minute('2012-07-22T13:24:57') &rarr; 24</code><br>
<code>minute(tointerval('3 minutes')) &rarr; 3</code><br>
<code>minute(age('2012-07-22T00:20:00','2012-07-22T00:00:00')) &rarr; 20</code><br>
<code>minute(age('2012-01-01','2010-01-01')) &rarr; 1051200</code><br>

18 changes: 18 additions & 0 deletions resources/function_help/month-de_DE
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<h3>month() function</h3>
Bestimmt den Monat eines Datums/Zeit oder die Anzahl der Monate
aus einem <code>Intervall</code>

<h4>Syntax</h4>
<code>month(date)</code><br>
<code>month(Intervall)</code><br>

<h4>Argumente</h4>
<code>date</code> - ist date oder datetime. Das Datum aus dem der Monat bestimmt werden soll.<br>
<code>Interval</code> - ist Interval. Das Intervall dessen Monatsanzahl zurĂĽckgegeben werden soll.

<h4>Beispiel</h4>
<!-- Show example of function.-->
<code>month('2012-05-12') &rarr; 05</code><br>
<code>month(tointerval('3 months')) &rarr; 3</code><br>
<code>month(age('2012-01-01','2010-01-01')) &rarr; 4.033...</code><br>

19 changes: 19 additions & 0 deletions resources/function_help/month-en_US
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<h3>month() function</h3>
Extract the month part from a date, or the number of months
from a <code>Interval</code>

<h4>Syntax</h4>
<code>month(date)</code><br>
<code>month(Interval)</code><br>

<h4>Arguments</h4>
<code>date</code> - is date or datetime. The date to extract the month from.
<br>
<code>Interval</code> - is Interval. The Interval to return the number of months from.

<h4>Example</h4>
<!-- Show example of function.-->
<code>month('2012-05-12') &rarr; 05</code><br>
<code>month(tointerval('3 months')) &rarr; 3</code><br>
<code>month(age('2012-01-01','2010-01-01')) &rarr; 4.033...</code><br>

8 changes: 4 additions & 4 deletions resources/function_help/replace-de_DE
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ Liefert eine Zeichenkette in der die angegebene Zeichenkette ersetzt ist.

<p><h4>Argumente</h4>
<!-- List args for functions here-->
<i> zeichenkette</i> -> ist eine Zeichenkette. Die ursprĂĽngliche Zeichenkette.<br>
<i> vorher</i> -> ist eine Zeichenkette. Die zu ersetzende Zeichenkette.<br>
<i> nacher</i> -> ist eine Zeichenkette. Die Zeichenkette durch die <i>vorher</i> ersetzen soll<br></p>
<i> zeichenkette</i> &rarr; ist eine Zeichenkette. Die ursprĂĽngliche Zeichenkette.<br>
<i> vorher</i> &rarr; ist eine Zeichenkette. Die zu ersetzende Zeichenkette.<br>
<i> nacher</i> &rarr; ist eine Zeichenkette. Die Zeichenkette durch die <i>vorher</i> ersetzen soll<br></p>

<p><h4>Beispiel</h4>
<!-- Show example of function.-->
replace('QGIS SHOULD ROCK','SHOULD','DOES') -> 'QGIS DOES ROCK'</p>
replace('QGIS SHOULD ROCK','SHOULD','DOES') &rarr; 'QGIS DOES ROCK'</p>
8 changes: 4 additions & 4 deletions resources/function_help/replace-en_US
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ Returns a string with the the supplied string replaced.

<p><h4>Arguments</h4>
<!-- List args for functions here-->
<i> string</i> -> is string. The start string.<br>
<i> before</i> -> is string. The string to replace.<br>
<i> after</i> -> is string. The string that will replace <i>before</i><br></p>
<i> string</i> &rarr; is string. The start string.<br>
<i> before</i> &rarr; is string. The string to replace.<br>
<i> after</i> &rarr; is string. The string that will replace <i>before</i><br></p>

<p><h4>Example</h4>
<!-- Show example of function.-->
replace('QGIS SHOULD ROCK','SHOULD','DOES') -> 'QGIS DOES ROCK'</p>
replace('QGIS SHOULD ROCK','SHOULD','DOES') &rarr; 'QGIS DOES ROCK'</p>
14 changes: 14 additions & 0 deletions resources/function_help/right-de_DE
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<h3>Funktion right()</h3>
Ergibt letzten <i>n</i> Zeichen von rechts.

<h4>Syntax</h4>
<code>right(zeichenkette,laenge)</code><br>

<h4>Argumente</h4>
<code>string</code> - ist string. Die Zeichenkette.
<br>
<code>laenge</code> - ist int. Die Anzahl der von rechts zurĂĽckzugebenden Zeichen von rechts.

<h4>Beispiel</h4>
<!-- Show example of function.-->
<code>right('Hallo Welt',4) &rarr; 'Welt'</code><br>
15 changes: 15 additions & 0 deletions resources/function_help/right-en_US
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<h3>right() function</h3>
Returns a substring that contains the <i>n</i> rightmost characters of the string.

<h4>Syntax</h4>
<code>right(string, pos)</code><br>

<h4>Arguments</h4>
<code>string</code> - is string. The string.
<br>
<code>length</code> - is int. The numbder of characters from the right to return.

<h4>Example</h4>
<!-- Show example of function.-->
<code>right('Hello World',5) &rarr; 'World'</code><br>

15 changes: 15 additions & 0 deletions resources/function_help/rpad-de_DE
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<h3>Funktion rpad()</h3>
Ergibt eine mit einem am Anfang mit einem Zeichen auf eine bestimmte Länge aufgefüllte Zeichenkette.

<h4>Syntax</h4>
<code>rpad(zeichenkette, laenge, fuellzeichen)</code><br>

<h4>Argumente</h4>
<code>zeichenkette</code> - ist string. Die Zeichenkette. <br>
<code>laenge</code> - ist int. Die Länge der neuen Zeichenkette. <br>
<code>fuellzeichen</code> - ist char. Das Zeichen mit dem die Zeichenkette aufgefĂĽllt werden soll.

<h4>Beispiel</h4>
<!-- Show example of function.-->
<code>rpad('Hallo', 10, 'x') &rarr; 'xxxxxHallo'</code><br>

18 changes: 18 additions & 0 deletions resources/function_help/rpad-en_US
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<h3>rpad() function</h3>
Returns a string with supplied width padded
using the fill character.

<h4>Syntax</h4>
<code>rpad(string, width, fill)</code><br>

<h4>Arguments</h4>
<code>string</code> - is string. The string.
<br>
<code>width</code> - is int. The length of the new string.
<br>
<code>fill</code> - is char. The character to padd the remaining space with.

<h4>Example</h4>
<!-- Show example of function.-->
<code>rpad('Hello', 10, 'x') &rarr; 'xxxxxHello'</code><br>

19 changes: 19 additions & 0 deletions resources/function_help/second-de_DE
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<h3>Funktion second()</h3>
Bestimmt die Sekunde eines Datums/Zeit oder die Anzahl der Sekunden
aus einem <code>Intervall</code>

<h4>Syntax</h4>
<code>second(datetime)</code><br>
<code>second(Intervall)</code><br>

<h4>Argumente</h4>
<code>date</code> - ist datetime oder time. Das Datum dessen Sekunden bestimmt werden sollen.<br>
<code>Intervall</code> - ist Interval. Ergib die Intervalllänge in Sekunden.

<h4>Beispiele</h4>
<!-- Show example of function.-->
<code>second('2012-07-22T13:24:57') &rarr; 57</code><br>
<code>second(tointerval('3 seconds')) &rarr; 3</code><br>
<code>second(age('2012-07-22T00:20:00','2012-07-22T00:00:00')) &rarr; 1200</code><br>
<code>second(age('2012-01-01','2010-01-01')) &rarr; 63072000</code><br>

20 changes: 20 additions & 0 deletions resources/function_help/second-en_US
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<h3>second() function</h3>
Extract the seconds from a datetime or time, or the number of seconds
from a <code>Interval</code>

<h4>Syntax</h4>
<code>second(datetime)</code><br>
<code>second(Interval)</code><br>

<h4>Arguments</h4>
<code>date</code> - is datetime or time. The date to extract the second from.
<br>
<code>Interval</code> - is Interval. The Interval to return the number of seconds from.

<h4>Example</h4>
<!-- Show example of function.-->
<code>second('2012-07-22T13:24:57') &rarr; 57</code><br>
<code>second(tointerval('3 seconds')) &rarr; 3</code><br>
<code>second(age('2012-07-22T00:20:00','2012-07-22T00:00:00')) &rarr; 1200</code><br>
<code>second(age('2012-01-01','2010-01-01')) &rarr; 63072000</code><br>

8 changes: 4 additions & 4 deletions resources/function_help/substr-de_DE
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ Liefert einen Teil einer Zeichenkette

<p><h4>Argumente</h4>
<!-- List args for functions here-->
<i> zeichenkette</i> -> ist eine Zeichenkette. Die vollständige Zeichenkette.<br>
<i> startpos</i> -> ist eine Zahl. Die Startposition des Teils.<br>
<i> länge</i> -> ist eine Zahl. Die Länge des Teils.<br></p>
<i> zeichenkette</i> &rarr; ist eine Zeichenkette. Die vollständige Zeichenkette.<br>
<i> startpos</i> &rarr; ist eine Zahl. Die Startposition des Teils.<br>
<i> länge</i> &rarr; ist eine Zahl. Die Länge des Teils.<br></p>

<p><h4>Beispiel</h4>
<!-- Show example of function.-->
substr('HELLO WORLD',3,5) -> 'LLO W'</p>
substr('HELLO WORLD',3,5) &rarr; 'LLO W'</p>
8 changes: 4 additions & 4 deletions resources/function_help/substr-en_US
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ Return a part of a string

<p><h4>Arguments</h4>
<!-- List args for functions here-->
<i> string</i> -> is string. The full string.<br>
<i> startpos</i> -> is number. The start position to extract from.<br>
<i> length</i> -> is number. The length of the string to extract.<br></p>
<i> string</i> &rarr; is string. The full string.<br>
<i> startpos</i> &rarr; is number. The start position to extract from.<br>
<i> length</i> &rarr; is number. The length of the string to extract.<br></p>

<p><h4>Example</h4>
<!-- Show example of function.-->
substr('HELLO WORLD',3,5) -> 'LLO W'</p>
substr('HELLO WORLD',3,5) &rarr; 'LLO W'</p>
4 changes: 2 additions & 2 deletions resources/function_help/template
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Converts a string to lower case letters.

<p><h4>Arguments</h4>
<!-- List args for functions here-->
<i> string</i> -> is string. The String to convert to lower case.</p>
<i> string</i> &rarr; is string. The String to convert to lower case.</p>

<p><h4>Example</h4>
<!-- Show example of function.-->
lower('HELLO World') -> 'hello world'</p>
lower('HELLO World') &rarr; 'hello world'</p>
4 changes: 2 additions & 2 deletions resources/function_help/upper-de_DE
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Wandelt eine Zeichenkette in GroĂźbuchstaben.

<p><h4>Argumente</h4>
<!-- List args for functions here-->
<i> zeichenkette</i> -> ist eine Zeichenkette. Die Zeichenkette, die in GroĂźbuchstaben umzuwandeln ist.</p>
<i> zeichenkette</i> &rarr; ist eine Zeichenkette. Die Zeichenkette, die in GroĂźbuchstaben umzuwandeln ist.</p>

<p><h4>Beispiel</h4>
<!-- Show example of function.-->
upper('hello WOrld') -> 'HELLO WORLD'</p>
upper('hello WOrld') &rarr; 'HELLO WORLD'</p>
4 changes: 2 additions & 2 deletions resources/function_help/upper-en_US
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Converts a string to upper case letters.

<p><h4>Arguments</h4>
<!-- List args for functions here-->
<i> string</i> -> is string. The String to convert to upper case.</p>
<i> string</i> &rarr; is string. The String to convert to upper case.</p>

<p><h4>Example</h4>
<!-- Show example of function.-->
upper('hello WOrld') -> 'HELLO WORLD'</p>
upper('hello WOrld') &rarr; 'HELLO WORLD'</p>
19 changes: 19 additions & 0 deletions resources/function_help/week-de_DE
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<h3>Funktion week()</h3>
Bestimmt die Woche eines Datums oder die Anzahl der Wochen
eines <code>Intervalls</code>

<h4>Syntax</h4>
<code>week(date)</code><br>
<code>week(Interval)</code><br>

<h4>Argumente</h4>
<code>date</code> - ist date oder datetime. Das Datum dessen Woche zurĂĽckgegeben werden soll.
<br>
<code>Interval</code> - ist Interval. Das Intervall dessen Länge in Wochen zurückgegeben werden soll.

<h4>Beispiel</h4>
<!-- Show example of function.-->
<code>week('2012-05-12') &rarr; 19</code><br>
<code>week(tointerval('3 weeks')) &rarr; 3</code><br>
<code>week(age('2012-01-01','2010-01-01')) &rarr; 104.285...</code><br>

19 changes: 19 additions & 0 deletions resources/function_help/week-en_US
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<h3>week() function</h3>
Extract the week number from a date, or the number of weeks
from a <code>Interval</code>

<h4>Syntax</h4>
<code>week(date)</code><br>
<code>week(Interval)</code><br>

<h4>Arguments</h4>
<code>date</code> - is date or datetime. The date to extract the week from.
<br>
<code>Interval</code> - is Interval. The Interval to return the number of weeks from.

<h4>Example</h4>
<!-- Show example of function.-->
<code>week('2012-05-12') &rarr; 19</code><br>
<code>week(tointerval('3 weeks')) &rarr; 3</code><br>
<code>week(age('2012-01-01','2010-01-01')) &rarr; 104.285...</code><br>

17 changes: 17 additions & 0 deletions resources/function_help/year-de_DE
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<h3>Funktion year()</h3>
Bestimmt das Jahr eines Datums oder die Länge eines <code>Intervals</code> in Jahren.

<h4>Syntax</h4>
<code>year(date)</code><br>
<code>year(Interval)</code><br>

<h4>Argumente</h4>
<code>date</code> - ist date oder datetime. Das Datum dessen Jahr zurĂĽckgegeben werden soll.<br>
<code>Interval</code> - ist Interval. Das Interval dessen Länge in Jahren zurückgegeben werden soll.

<h4>Beispiel</h4>
<!-- Show example of function.-->
<code>year('2012-05-12') &rarr; 2012</code><br>
<code>year(tointerval('3 Years')) &rarr; 3</code><br>
<code>year(age('2012-01-01','2010-01-01')) &rarr; 1.9986..</code><br>

19 changes: 19 additions & 0 deletions resources/function_help/year-en_US
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<h3>year() function</h3>
Extract the year part from a date, or the number of years
from a <code>Interval</code>

<h4>Syntax</h4>
<code>year(date)</code><br>
<code>year(Interval)</code><br>

<h4>Arguments</h4>
<code>date</code> - is date or datetime. The date to extract the year from.
<br>
<code>Interval</code> - is Interval. The Interval to return the number of years from.

<h4>Example</h4>
<!-- Show example of function.-->
<code>year('2012-05-12') &rarr; 2012</code><br>
<code>year(tointerval('3 Years')) &rarr; 3</code><br>
<code>year(age('2012-01-01','2010-01-01')) &rarr; 1.9986..</code><br>

7 changes: 6 additions & 1 deletion src/browser/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ IF(APPLE)
SET_TARGET_PROPERTIES(qbrowser PROPERTIES
INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/${QGIS_LIB_DIR}
INSTALL_RPATH_USE_LINK_PATH true
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_SOURCE_DIR}/mac/browser.info.plist.in"
OUTPUT_NAME "QGIS Browser"
)
ENDIF(APPLE)

Expand All @@ -101,5 +103,8 @@ INSTALL (TARGETS qbrowser
RUNTIME DESTINATION ${QGIS_BIN_DIR}
)
IF (APPLE)
INSTALL (CODE "EXECUTE_PROCESS(COMMAND ln -sfh ../../../${QGIS_FW_SUBDIR} \"$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/${QGIS_BIN_DIR}/qbrowser.app/Contents/Frameworks\")")
INSTALL (CODE "EXECUTE_PROCESS(COMMAND ln -sfh ../../../${QGIS_FW_SUBDIR} \"$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/${QGIS_BIN_DIR}/QGIS Browser.app/Contents/Frameworks\")")
INSTALL (CODE "EXECUTE_PROCESS(COMMAND ln -sfh ../../../../${QGIS_LIB_SUBDIR} \"$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/${QGIS_BIN_DIR}/QGIS Browser.app/Contents/MacOS/lib\")")
INSTALL (CODE "EXECUTE_PROCESS(COMMAND ln -sfh ../../../${QGIS_PLUGIN_SUBDIR}/.. \"$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/${QGIS_BIN_DIR}/QGIS Browser.app/Contents/Plugins\")")
INSTALL (CODE "EXECUTE_PROCESS(COMMAND ln -sfh ../../../${QGIS_DATA_SUBDIR} \"$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/${QGIS_BIN_DIR}/QGIS Browser.app/Contents/Resources\")")
ENDIF (APPLE)
55 changes: 45 additions & 10 deletions src/core/qgsexpression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,36 @@ static QVariant fcnStrpos( const QVariantList& values, QgsFeature* , QgsExpressi
return string.indexOf( QRegExp( getStringValue( values.at( 1 ), parent ) ) );
}

static QVariant fcnRight( const QVariantList& values, QgsFeature* , QgsExpression *parent )
{
QString string = getStringValue( values.at( 0 ), parent );
int pos = getIntValue( values.at( 1 ), parent );
return string.right( pos );
}

static QVariant fcnLeft( const QVariantList& values, QgsFeature* , QgsExpression *parent )
{
QString string = getStringValue( values.at( 0 ), parent );
int pos = getIntValue( values.at( 1 ), parent );
return string.left( pos );
}

static QVariant fcnRPad( const QVariantList& values, QgsFeature* , QgsExpression *parent )
{
QString string = getStringValue( values.at( 0 ), parent );
int length = getIntValue( values.at( 1 ), parent );
QString fill = getStringValue( values.at( 2 ), parent );
return string.rightJustified( length, fill.at( 0 ), true );
}

static QVariant fcnLPad( const QVariantList& values, QgsFeature* , QgsExpression *parent )
{
QString string = getStringValue( values.at( 0 ), parent );
int length = getIntValue( values.at( 1 ), parent );
QString fill = getStringValue( values.at( 2 ), parent );
return string.leftJustified( length, fill.at( 0 ), true );
}

static QVariant fcnNow( const QVariantList&, QgsFeature* , QgsExpression * )
{
return QVariant( QDateTime::currentDateTime() );
Expand Down Expand Up @@ -756,16 +786,16 @@ const QList<QgsExpression::FunctionDef> &QgsExpression::BuiltinFunctions()
<< FunctionDef( "totime", 1, fcnToTime, QObject::tr( "Conversions" ) )
<< FunctionDef( "tointerval", 1, fcnToInterval, QObject::tr( "Conversions" ) )
<< FunctionDef( "coalesce", -1, fcnCoalesce, QObject::tr( "Conversions" ) )
// date/time
<< FunctionDef( "$now", 0, fcnNow, QObject::tr( "Date/Time" ) )
<< FunctionDef( "age", 2, fcnAge, QObject::tr( "Date/Time" ) )
<< FunctionDef( "year", 1, fcnYear, QObject::tr( "Date/Time" ) )
<< FunctionDef( "month", 1, fcnMonth, QObject::tr( "Date/Time" ) )
<< FunctionDef( "week", 1, fcnWeek, QObject::tr( "Date/Time" ) )
<< FunctionDef( "day", 1, fcnDay, QObject::tr( "Date/Time" ) )
<< FunctionDef( "hour", 1, fcnHour, QObject::tr( "Date/Time" ) )
<< FunctionDef( "minute", 1, fcnMinute, QObject::tr( "Date/Time" ) )
<< FunctionDef( "second", 1, fcnSeconds, QObject::tr( "Date/Time" ) )
// Date and Time
<< FunctionDef( "$now", 0, fcnNow, QObject::tr( "Date and Time" ) )
<< FunctionDef( "age", 2, fcnAge, QObject::tr( "Date and Time" ) )
<< FunctionDef( "year", 1, fcnYear, QObject::tr( "Date and Time" ) )
<< FunctionDef( "month", 1, fcnMonth, QObject::tr( "Date and Time" ) )
<< FunctionDef( "week", 1, fcnWeek, QObject::tr( "Date and Time" ) )
<< FunctionDef( "day", 1, fcnDay, QObject::tr( "Date and Time" ) )
<< FunctionDef( "hour", 1, fcnHour, QObject::tr( "Date and Time" ) )
<< FunctionDef( "minute", 1, fcnMinute, QObject::tr( "Date and Time" ) )
<< FunctionDef( "second", 1, fcnSeconds, QObject::tr( "Date and Time" ) )
// string manipulation
<< FunctionDef( "lower", 1, fcnLower, QObject::tr( "String" ) )
<< FunctionDef( "upper", 1, fcnUpper, QObject::tr( "String" ) )
Expand All @@ -775,6 +805,11 @@ const QList<QgsExpression::FunctionDef> &QgsExpression::BuiltinFunctions()
<< FunctionDef( "substr", 3, fcnSubstr, QObject::tr( "String" ) )
<< FunctionDef( "concat", -1, fcnConcat, QObject::tr( "String" ) )
<< FunctionDef( "strpos", 2, fcnStrpos, QObject::tr( "String" ) )
<< FunctionDef( "left", 2, fcnLeft, QObject::tr( "String" ) )
<< FunctionDef( "right", 2, fcnRight, QObject::tr( "String" ) )
<< FunctionDef( "rpad", 3, fcnRPad, QObject::tr( "String" ) )
<< FunctionDef( "lpad", 3, fcnLPad, QObject::tr( "String" ) )

// geometry accessors
<< FunctionDef( "xat", 1, fcnXat, QObject::tr( "Geometry" ), "", true )
<< FunctionDef( "yat", 1, fcnYat, QObject::tr( "Geometry" ), "", true )
Expand Down
20 changes: 10 additions & 10 deletions src/gui/qgsexpressionbuilderwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ QgsExpressionBuilderWidget::QgsExpressionBuilderWidget( QWidget *parent )
registerItem( tr( "Operators" ), "AND", " AND " );
registerItem( tr( "Operators" ), "NOT", " NOT " );

QString casestring = "CASE WHEN condition THEN result END";
QString caseelsestring = "CASE WHEN condition THEN result ELSE result END";
registerItem( tr( "Conditionals" ), "CASE", casestring );
registerItem( tr( "Conditionals" ), "CASE ELSE", caseelsestring );

// Load the functions from the QgsExpression class
int count = QgsExpression::functionCount();
Expand Down Expand Up @@ -380,9 +384,9 @@ void QgsExpressionBuilderWidget::setExpressionState( bool state )
mExpressionValid = state;
}

QString QgsExpressionBuilderWidget::loadFunctionHelp( QgsExpressionItem* functionName )
QString QgsExpressionBuilderWidget::loadFunctionHelp( QgsExpressionItem* expressionItem )
{
if ( functionName == NULL )
if ( expressionItem == NULL )
return "";

// set up the path to the help file
Expand Down Expand Up @@ -410,9 +414,9 @@ QString QgsExpressionBuilderWidget::loadFunctionHelp( QgsExpressionItem* functio
lang = "en_US";
}

QString name = functionName->text();
QString name = expressionItem->text();

if ( functionName->getItemType() == QgsExpressionItem::Field )
if ( expressionItem->getItemType() == QgsExpressionItem::Field )
name = "Field";

QString fullHelpPath = helpFilesPath + name + "-" + lang;
Expand All @@ -434,7 +438,7 @@ QString QgsExpressionBuilderWidget::loadFunctionHelp( QgsExpressionItem* functio
missingError += tr( "It was neither available in your language (%1) nor English." ).arg( lang );

// try en_US next
fullHelpPath = helpFilesPath + functionName->text() + "-en_US";
fullHelpPath = helpFilesPath + name + "-en_US";
file.setFileName( fullHelpPath );
}
}
Expand All @@ -449,11 +453,7 @@ QString QgsExpressionBuilderWidget::loadFunctionHelp( QgsExpressionItem* functio
{
QTextStream in( &file );
in.setCodec( "UTF-8" ); // Help files must be in Utf-8
while ( !in.atEnd() )
{
QString line = in.readLine();
helpContents += line;
}
helpContents = in.readAll();
}

file.close();
Expand Down
6 changes: 5 additions & 1 deletion src/ui/qgswmssourceselectbase.ui
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,11 @@
</widget>
</item>
<item row="2" column="2">
<widget class="QLineEdit" name="mFeatureCount"/>
<widget class="QLineEdit" name="mFeatureCount">
<property name="text">
<string>10</string>
</property>
</widget>
</item>
</layout>
</widget>
Expand Down
6 changes: 6 additions & 0 deletions tests/src/core/testqgsexpression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,12 @@ class TestQgsExpression: public QObject
QTest::newRow( "substr outside" ) << "substr('HeLLo', -5,2)" << false << QVariant( "" );
QTest::newRow( "strpos" ) << "strpos('Hello World','World')" << false << QVariant( 6 );
QTest::newRow( "strpos outside" ) << "strpos('Hello World','blah')" << false << QVariant( -1 );
QTest::newRow( "left" ) << "left('Hello World',5)" << false << QVariant( "Hello" );
QTest::newRow( "right" ) << "right('Hello World', 5)" << false << QVariant( "World" );
QTest::newRow( "rpad" ) << "rpad('Hello', 10, 'x')" << false << QVariant( "xxxxxHello" );
QTest::newRow( "rpad truncate" ) << "rpad('Hello', 4, 'x')" << false << QVariant( "Hell" );
QTest::newRow( "lpad" ) << "lpad('Hello', 10, 'x')" << false << QVariant( "Helloxxxxx" );
QTest::newRow( "lpad truncate" ) << "rpad('Hello', 4, 'x')" << false << QVariant( "Hell" );

// implicit conversions
QTest::newRow( "implicit int->text" ) << "length(123)" << false << QVariant( 3 );
Expand Down