diff -r bab96b7ed1a4 -r f39ed5e045e0 phoneuis/bubblemanager2/tsrc/bubbletest2/bubbletester.cpp --- a/phoneuis/bubblemanager2/tsrc/bubbletest2/bubbletester.cpp Tue Jun 15 14:14:38 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,141 +0,0 @@ -/*! -* Copyright (c) 2009 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: Animated icon. -* -*/ - -#include - -#include "bubbletester.h" - - -BubbleTester::BubbleTester() : mLocalSocket(new QLocalSocket()) -{ -} - -BubbleTester::~BubbleTester() -{ - mLocalSocket->disconnectFromServer(); - delete mLocalSocket; -} - -bool BubbleTester::connectToServer() -{ - mLocalSocket->connectToServer("bubbletestserver"); - - // This logic needs to be improved - bool success = mLocalSocket->waitForConnected(500); - - qDebug() << "Socket Connect status: " << success; - - if (success) { - connect(mLocalSocket, SIGNAL(readyRead()), this, SLOT(readData())); - } - - return success; -} - -void BubbleTester::readData() -{ - QByteArray inputByteArray = mLocalSocket->readAll(); - QDataStream inputDataStream(inputByteArray); - QString textDocument; - inputDataStream >> textDocument; - - QString errorStr; - int errorLine; - int errorColumn; - - if (!mDomDocument.setContent(textDocument, true, &errorStr, &errorLine, - &errorColumn)) { - qDebug() << "Cannot read tester data!"; - } else { - emit dataChanged(); - } -} - -QList BubbleTester::bubbles() -{ - QDomNodeList list = mDomDocument.elementsByTagName("bubble"); - - QList testBubbles; - - for (int i=0; i