Esempio n. 1
0
bool FvUpdater::CheckForUpdates(bool silentAsMuchAsItCouldGet)
{
	if (m_feedURL.isEmpty()) {
		qCritical() << "Please set feed URL via setFeedURL() before calling CheckForUpdates().";
		return false;
	}

	m_silentAsMuchAsItCouldGet = silentAsMuchAsItCouldGet;

	// Check if application's organization name and domain are set, fail otherwise
	// (nowhere to store QSettings to)
	if (QApplication::organizationName().isEmpty()) {
		qCritical() << "QApplication::organizationName is not set. Please do that.";
		return false;
	}
	if (QApplication::organizationDomain().isEmpty()) {
		qCritical() << "QApplication::organizationDomain is not set. Please do that.";
		return false;
	}

	// Set application name / version is not set yet
	if (QApplication::applicationName().isEmpty()) {
		QString appName = QString::fromUtf8(FV_APP_NAME);
		qWarning() << "QApplication::applicationName is not set, setting it to '" << appName << "'";
		QApplication::setApplicationName(appName);
	}
	if (QApplication::applicationVersion().isEmpty()) {
		QString appVersion = QString::fromUtf8(FV_APP_VERSION);
		qWarning() << "QApplication::applicationVersion is not set, setting it to '" << appVersion << "'";
		QApplication::setApplicationVersion(appVersion);
	}

	cancelDownloadFeed();
	m_httpRequestAborted = false;
	startDownloadFeed(m_feedURL);

	return true;
}
Esempio n. 2
0
bool FvUpdater::CheckForUpdates(bool silentAsMuchAsItCouldGet)
{
	if (m_feedURL.isEmpty()) {
		qCritical() << "Please set feed URL via setFeedURL() before calling CheckForUpdates().";
		return false;
	}

	m_silentAsMuchAsItCouldGet = silentAsMuchAsItCouldGet;

	// Check if application's organization name and domain are set, fail otherwise
	// (nowhere to store QSettings to)
	if (QCoreApplication::organizationName().isEmpty()) {
		qCritical() << "QCoreApplication::organizationName is not set. Please do that.";
		return false;
	}
	if (QCoreApplication::organizationDomain().isEmpty()) {
		qCritical() << "QCoreApplication::organizationDomain is not set. Please do that.";
		return false;
	}

	if(QCoreApplication::applicationName().isEmpty()) {
		qCritical() << "QCoreApplication::applicationName is not set. Please do that.";
		return false;
	}

	// Set application version is not set yet
	if (QCoreApplication::applicationVersion().isEmpty()) {
		qCritical() << "QCoreApplication::applicationVersion is not set. Please do that.";
		return false;
	}

	cancelDownloadFeed();
	m_httpRequestAborted = false;
	startDownloadFeed(m_feedURL);

	return true;
}
Esempio n. 3
0
bool QUPDUpdater::checkForUpdates(bool silentMode)
{
    bool canCheck = true;
    if (_feedURL.isEmpty()) {
        qCritical() << "Please set feed URL via setFeedURL() before calling CheckForUpdates().";
        canCheck = false;
    } else if (QApplication::organizationName().isEmpty()) {
        qCritical() << "QApplication::organizationName is not set. Please do that.";
        canCheck = false;
    } else if (QApplication::organizationDomain().isEmpty()) {
        qCritical() << "QApplication::organizationDomain is not set. Please do that.";
        canCheck = false;
    }

    if (canCheck) {
        _silentMode = silentMode;
        // Set application name / version is not set yet
        if (QApplication::applicationName().isEmpty()) {
            QString appName = qApp->applicationName();
            qWarning() << "QApplication::applicationName is not set, setting it to '" << appName << "'";
            QApplication::setApplicationName(appName);
        }

        if (QApplication::applicationVersion().isEmpty()) {
            QString appVersion = qApp->applicationVersion();
            qWarning() << "QApplication::applicationVersion is not set, setting it to '" << appVersion << "'";
            QApplication::setApplicationVersion(appVersion);
        }

        cancelDownloadFeed();
        _feedHttpRequestAborted = false;
        startDownloadFeed();
        canCheck = true;
    }

    return canCheck;
}