~ci-train-bot/ubuntu-download-manager/ubuntu-download-manager-ubuntu-yakkety-landing-057

« back to all changes in this revision

Viewing changes to src/downloads/priv/ubuntu/downloads/file_download.cpp

  • Committer: Bileto Bot
  • Author(s): Michael Sheldon
  • Date: 2016-09-09 11:47:50 UTC
  • mfrom: (370.1.2 translation-support)
  • Revision ID: ci-train-bot@canonical.com-20160909114750-899k9wtsrib6c7uq
Make user visible strings translatable (LP: #1618892)

Approved by: system-apps-ci-bot

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
#include <QStringList>
33
33
#include <QSslError>
34
34
 
 
35
#include <ubuntu/transfers/i18n.h>
35
36
#include <ubuntu/transfers/metadata.h>
36
37
#include <ubuntu/transfers/system/dbus_connection.h>
37
38
#include <ubuntu/transfers/system/hash_algorithm.h>
207
208
    // check that the algorithm is correct if the hash is not empty
208
209
    if (!_hash.isEmpty() && !HashAlgorithm::isValidAlgo(algo)) {
209
210
        setIsValid(false);
210
 
        setLastError(QString("Invalid hash algorithm: '%1'").arg(algo));
 
211
        setLastError(QString(_("Invalid hash algorithm: '%1'")).arg(algo));
211
212
    }
212
213
}
213
214
 
860
861
    // ensure that the download is valid
861
862
    if (!_url.isValid()) {
862
863
        setIsValid(false);
863
 
        setLastError(QString("Invalid URL: '%1'").arg(_url.toString()));
 
864
        setLastError(QString(_("Invalid URL: '%1'")).arg(_url.toString()));
864
865
    }
865
866
 
866
867
    // ensure that if we are going to deflate the download that the hash is set
870
871
            && _metadata[Metadata::DEFLATE_KEY].toBool()) {
871
872
        setIsValid(false);
872
873
        setLastError(QString(
873
 
            "Downloads that are set to be deflated cannot have a hash: '%1'").arg(
 
874
            _("Downloads that are set to be deflated cannot have a hash: '%1'")).arg(
874
875
                _hash));
875
876
    }
876
877
}
961
962
        // raise an error
962
963
        if (QFile::exists(_filePath)) {
963
964
            setIsValid(false);
964
 
            setLastError(QString("File already exists at: '%1'").arg(
 
965
            setLastError(QString(_("File already exists at: '%2'")).arg(
965
966
                _filePath));
966
967
        }
967
968
    } else {