X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=src%2Fvicar-utils%2Fsrc%2Fmain.cpp;fp=src%2Fvicar-utils%2Fsrc%2Fmain.cpp;h=0000000000000000000000000000000000000000;hb=38440679f13b8dc528a9aff93cbf4935011fdb22;hp=6bf01a71e7273904e68bdc5fba3b3f933ca1f3d2;hpb=89f0017e6a73945ea83247472a6fa07d6ee536b5;p=vicar diff --git a/src/vicar-utils/src/main.cpp b/src/vicar-utils/src/main.cpp deleted file mode 100755 index 6bf01a7..0000000 --- a/src/vicar-utils/src/main.cpp +++ /dev/null @@ -1,92 +0,0 @@ -/* -@version: 0.6 -@author: Sudheer K. -@license: GNU General Public License -*/ - -#include "telepathyutility.h" -#include "databaseutility.h" -#include "vicarprofiletypes.h" -#include "connectioninterfacerequeststypes.h" -#include -#include - -int main(int argc, char *argv[]) -{ - qDBusRegisterMetaType(); - //From Connection Interface Requests - qDBusRegisterMetaType(); - qDBusRegisterMetaType(); - qDBusRegisterMetaType(); - qDBusRegisterMetaType(); - //From Vicar Profile Types - //qDBusRegisterMetaType(); - //qDBusRegisterMetaType(); - - TelepathyUtility *tpUtility = new TelepathyUtility(); - DatabaseUtility *databaseUtility = new DatabaseUtility(); - - if (argc > 1 && argv[1]){ - QString instruction = QString(argv[1]); - if (instruction == "INSTALL"){ - //Check if Account already exists - if (!tpUtility->accountExists()){ - qDebug() << "VICaR account not found. Creating .."; - bool result = tpUtility->createAccount(); - if (!result) exit(1); - } - else{ - qDebug() << "VICaR account found."; - } - } - else if (instruction == "REMOVE"){ - bool result = tpUtility->deleteAccount(); - if (!result) exit(2); - } - - else if (instruction == "CREATEDB"){ - bool result = databaseUtility->openDatabase(); - if (!result){ - qDebug() <<"Error creating profiles database. " - <lastError(); - exit(3); - } - qDebug() << "VICaR profiles database opened."; - - if (!databaseUtility->tableExists("profiles")){ - qDebug() << "Creating VICaR profiles table.."; - result = databaseUtility->createProfilesTable(); - if (!result){ - qDebug() <<"Error creating profiles table. " - <lastError(); - exit(4); - } - } - else{ - qDebug()<<"Profiles table exists"; - } - databaseUtility->closeDatabase(); - } - else if (instruction == "DROPDB"){ - bool result = databaseUtility->deleteDatabase(); - if (!result){ - qDebug() <<"Error deleting profiles database. " - <lastError(); - exit(5); - } - qDebug() << "VICaR profiles database deleted."; - } - else if (instruction == "ACCOUNTSTATUS"){ - QString status = tpUtility->getAccountStatus(); - qDebug() << "Account Status is "<< status; - } - else if (instruction == "TESTING"){ - tpUtility->callNumberWithRing(argv[2]); - } - } - - delete (tpUtility); - delete (databaseUtility); - tpUtility = 0; - databaseUtility = 0; -}