diff -r f00a6757af32 -r 5f0182e07bfb homescreenapp/hswidgetuninstaller/src/main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/hswidgetuninstaller/src/main.cpp Tue Aug 31 15:06:34 2010 +0300 @@ -0,0 +1,63 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include +#include +#include +#include +#include +#include +#include + +#include "hswidgetcomponentparser.h" +#include "hswidgetinstallersender.h" +#include "hswidgetcomponentdescriptor.h" + +const char UNINSTALL_WIDGET_FUNCTION_NAME[] = "widgetUninstalled(QVariantHash)"; + +int main(int argc, char *argv[]) +{ + // Initialization + CApaCommandLine* commandLine = 0; + TInt err = CApaCommandLine::GetCommandLineFromProcessEnvironment(commandLine); + QString commandParam((QChar*)commandLine->DocumentName().Ptr(),commandLine->DocumentName().Length()); + qDebug() << "HSWIDGETUNINSTALLER commandParam:" << commandParam; + + QCoreApplication app(argc, argv); + QStringList args = QCoreApplication::arguments(); + + if (commandParam.isEmpty()) { + return -1; + } + + HsWidgetComponentParser componentParser(commandParam); + if ( !componentParser.error() ) { + HsWidgetInstallerSender installerSender; + HsWidgetComponentDescriptor componentDescriptor = componentParser.widgetComponentDescriptor(); + QDir componentDir(commandParam); + componentDir.cdUp(); + QString componentPath = componentDir.path(); + if ( componentDir.exists(componentPath)) { + componentDescriptor.setInstallationPath(componentPath); + } + installerSender.widgetChanged(UNINSTALL_WIDGET_FUNCTION_NAME, componentDescriptor); + } + + qDebug() << "HSWIDGETUNINSTALLER finished"; + + return 0; //app.exec(); +}