# main.cpp

Go to the documentation of this file.

    00001 /*
    00002  * SmartHome server: Base of the system
    00003  *
    00004  * Copyright (C) 2010 Daniel Pisi <dan.pisi@gmail.com>
    00005  *
    00006  * This program is free software; you can redistribute it and/or modify it
    00007  * under the terms of version 2 of the GNU General Public License
    00008  * as published by the Free Software Foundation.
    00009  *
    00010  */
    00011
    00018 #include <QtCore/QCoreApplication>
    00019 #include <QtSql>
    00020 #include "shbase.h"
    00021
    00022 // -----------------------------------------------------------------------------
    00023
    00030 int main(int argc, char *argv[])
    00031 {
    00032     QCoreApplication app(argc, argv);
    00033
    00034     QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL");
    00035     db.setHostName("localhost");
    00036     db.setDatabaseName("mythconverg");
    00037     db.setUserName("mythtv");
    00038     db.setPassword("mythtv");
    00039
    00040     if (!db.open())
    00041     {
    00042         qFatal(app.tr("Unable to establish a database connection.").toLatin1());
    00043         return 1;
    00044     }
    00045
    00046     qDebug("Creating ShBase");
    00047     ShBase *shBase;
    00048     shBase = new ShBase;
    00049
    00050     return app.exec();
    00051 }
    00052 // -----------------------------------------------------------------------------

All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends