Changeset 391:3327e78ca8ea in SMSSender


Ignore:
Timestamp:
Apr 30, 2014 2:26:47 PM (4 years ago)
Author:
Sämy Zehnder <saemy.zehnder@…>
Branch:
separation-frontend-backend
Message:
  • Adds some workarounds for lupdate to interpret our projects correctly. Translations from base were included in the gui ts-files and vice versa.
  • Generalizes the check for frontend-definitions in the DEFINES variable.
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • additional_installs.pri

    r350 r391  
    99
    1010for(header, ADDITIONAL_INSTALLS) {
    11     path = $${ADDITIONAL_INSTALLS_BASE}/$${dirname(header)}
     11    path = $${ADDITIONAL_INSTALLS_BASE}/$$dirname(header)
    1212    eval(install_$${path}.files += $$header)
    1313    eval(install_$${path}.path = $$path)
    1414    eval(INSTALLS *= install_$${path})
     15
     16    unset(path)
    1517}
     18
     19# Workaround for lupdate that keeps the values of a variable around and appends
     20# new values to it even in the case of an assignment (foo = "" becomes foo += "")
     21unset(ADDITIONAL_INSTALLS)
     22unset(ADDITIONAL_INSTALLS_BASE)
  • smssender-gui.pri

    r368 r391  
    1 # TODO: check for any FRONTEND_ definition
    2 contains(DEFINES, FRONTEND_CLI) {
    3     error("FRONTEND_CLI is defined in FRONTEND_GUI environment.")
     1# Checks for any FRONTEND_xxx definitions.
     2definedFrontends = $$find(DEFINES, FRONTEND_.*)
     3!isEmpty(definedFrontends) {
     4    error("The following frontends are defined but must not: " $$definedFrontends)
    45}
    56
  • smssender.prf

    r364 r391  
    1212        export($$var)
    1313        export(IMPORT_BASE_BACKUP_$${var})
     14
     15        clear(value)
    1416    }
    1517}
     
    1719    # Changes the path in the file-variables and applies the backup from before.
    1820    variables = $$fileVariables()
     21
    1922    for(var, variables) {
     23        # Reads the backup and the actual value into variables.
     24        eval(value = $$join($$var, " ../", ../))
    2025        eval(value_bak = $$join(IMPORT_BASE_BACKUP_$${var}, " "))
    21         eval(value = $$join($$var, " ../", ../) $$value_bak)
    22         eval($$var = $$value)
    23         eval($${var}_BASE = $$value)
     26
     27        !isLupdate {
     28            # Combines them.
     29            eval($$var = $$value $$value_bak)
     30            eval($${var}_BASE = $$value)
     31            export($${var}_BASE)
     32        } else {
     33            # lupdate runs through all conditional scopes.
     34            # Removes any value set to variables in the previous scope.
     35            unset($$var)
     36            unset($${var}_BASE)
     37
     38            # Reverts the include by setting the variables to the old values.
     39            eval($$var = $$value_bak)
     40        }
     41
    2442        export($$var)
    25         export($${var}_BASE)
     43
     44        # Workaround for lupdate that keeps the values of a variable around and
     45        # appends new values to it even in the case of an assignment (foo = ""
     46        # becomes foo += "")
     47        unset(value)
     48        unset(value_bak)
    2649    }
     50
     51    unset(variables)
    2752}
Note: See TracChangeset for help on using the changeset viewer.