Asserts if QString parameters are empty
This commit is contained in:
parent
6733abfc2e
commit
2acfd26494
@ -90,55 +90,50 @@ bool QSimpleUpdater::newerVersionAvailable() const {
|
|||||||
return m_new_version_available;
|
return m_new_version_available;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QSimpleUpdater::setDownloadUrl(const QString &url) {
|
|
||||||
// Change the download URL if the issued URL is valid
|
// Change the download URL if the issued URL is valid
|
||||||
|
void QSimpleUpdater::setDownloadUrl(const QString &url) {
|
||||||
|
Q_ASSERT(!url.isEmpty());
|
||||||
|
|
||||||
if (!url.isEmpty()) {
|
if (!url.isEmpty()) {
|
||||||
m_download_url.setUrl(url);
|
m_download_url.setUrl(url);
|
||||||
}
|
} else {
|
||||||
|
|
||||||
// The issued URL is ilegal, so we warn the user
|
|
||||||
else {
|
|
||||||
qWarning() << "QSimpleUpdater: input URL cannot be empty!";
|
qWarning() << "QSimpleUpdater: input URL cannot be empty!";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void QSimpleUpdater::setReferenceUrl(const QString &url) {
|
|
||||||
// Change the reference URL if the issued URL is valid
|
// Change the reference URL if the issued URL is valid
|
||||||
|
void QSimpleUpdater::setReferenceUrl(const QString &url) {
|
||||||
|
Q_ASSERT(!url.isEmpty());
|
||||||
|
|
||||||
if (!url.isEmpty()) {
|
if (!url.isEmpty()) {
|
||||||
m_reference_url.setUrl(url);
|
m_reference_url.setUrl(url);
|
||||||
}
|
} else {
|
||||||
|
|
||||||
// The issued URL is ilegal, so we warn the user
|
|
||||||
else {
|
|
||||||
qWarning() << "QSimpleUpdater: input URL cannot be empty!";
|
qWarning() << "QSimpleUpdater: input URL cannot be empty!";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void QSimpleUpdater::setChangelogUrl(const QString &url) {
|
|
||||||
// Change the changelog URL if the issued URL is valid
|
// Change the changelog URL if the issued URL is valid
|
||||||
|
void QSimpleUpdater::setChangelogUrl(const QString &url) {
|
||||||
|
Q_ASSERT(!url.isEmpty());
|
||||||
|
|
||||||
if (!url.isEmpty()) {
|
if (!url.isEmpty()) {
|
||||||
m_changelog_url.setUrl(url);
|
m_changelog_url.setUrl(url);
|
||||||
}
|
} else {
|
||||||
|
|
||||||
// The issued URL is ilegal, so we warn the user
|
|
||||||
else {
|
|
||||||
qWarning() << "QSimpleUpdater: input URL cannot be empty!";
|
qWarning() << "QSimpleUpdater: input URL cannot be empty!";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void QSimpleUpdater::setApplicationVersion(const QString &version) {
|
|
||||||
// Change the installed application version if the issued string is valid
|
// Change the installed application version if the issued string is valid
|
||||||
|
void QSimpleUpdater::setApplicationVersion(const QString &version) {
|
||||||
|
Q_ASSERT(!version.isEmpty());
|
||||||
|
|
||||||
if (!version.isEmpty()) {
|
if (!version.isEmpty()) {
|
||||||
m_installed_version = version;
|
m_installed_version = version;
|
||||||
}
|
} else {
|
||||||
|
|
||||||
// The application version cannot be empty, so we warn the user
|
|
||||||
else {
|
|
||||||
qWarning() << "QSimpleUpdater: input string cannot be empty!";
|
qWarning() << "QSimpleUpdater: input string cannot be empty!";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void QSimpleUpdater::checkDownloadedVersion(QNetworkReply *reply) {
|
void QSimpleUpdater::checkDownloadedVersion(QNetworkReply *reply) {
|
||||||
bool _new_update = false;
|
bool _new_update = false;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user