up2Date API Documentation


Welcome to the up2Date. This document will walk you through the setting and variables need to make the up2Date application update API work with your project.

Required:

Optional:

Configuration:

The first thing you need to configure is the database settings. The MySql script below will create the table needed by up2Date as well as the columns needs by up2Date.

CREATE TABLE `check_version` ( `id` int(11) NOT NULL AUTO_INCREMENT, `project_name` varchar(20) COLLATE utf8_unicode_ci NOT NULL, `current` varchar(50) COLLATE utf8_unicode_ci NOT NULL, `description` varchar(5000) COLLATE utf8_unicode_ci NOT NULL, `url` varchar(100) COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

Breakdown of the database columns:

  • id
  • project_name
  • current
  • description
  • url
  • The (id) filed is just an auto incremental filed and does not need any input.

    The (project_name) filed is used to distinguish one project from another. This will be useful if your running multiple projects. (This filed is checked by the up2Date)

    The (current) filed is used to hold you applications version. An example would be 1.0.0.0. (This filed is checked by the up2Date)

    The (description) filed is presented to the end user if an update is found. Use this filed to tell your user what's included in the new version or whatever you see fit.

    The (url) filed hold the URL used to download your update. You must specify the http:// in the url or the url class will not be able to distinguish the protocol. And the download will fail with an error.

    Once the database is setup and basic information entered you are ready to test the system with the up2Date test application included with the api.

    There are two constants that need to be entered in the up2Date.cpp for each project you use it for. The constants are below.

    const QString dbappName = "Your_project_id";

    const QString longName = "Your_project_long_name";

    The dbappName is pulled from the database under the "project_name" column. This is used to ensure the correct project is being checked for an update. So if they don't match up2Date will report no update is available.

    To configure these setting look in the up2Date.cpp file for the section marked ***** Change Me *****

    The final part of the configuration is setting your porjects version. up2Date has a signal/slot mechinisum called sendV(QString) This needs to be connected to the form that is calling the up2Date form with a slot called receiveV(QString)

    A sample of the code is below.

    u2d = new up2Date(this);

    u2d->setModal(true);

    u2d->show();

    const QString v = "1.0.0.0";

    connect(this, SIGNAL(sendV(QString)), u2d, SLOT(receiveV(QString)));

    emit sendV(v);

    The next file that needs to be modified is the dbWorker.cpp. This file holds the database connection string information. Below is the section of the doWork function that holds the values. Again please look for the ***** Change Me ***** keywords in the code.

    db.setHostName("Your_MYSQL_Host");

    db.setDatabaseName("Your_Database_Name");

    db.setUserName("Your_Database_User_Name");

    db.setPassword("Your_Database_User_Password");

    Bugs and Known Issues:

    up2Date is currently BETA. If you find an issue or would like to suggest a feature. Please log it at my bug site here




    up2Date is the copyright © 2016 Sean Patti Projects. All rights reserved.