Skip to content

Commit

Permalink
Serialize window handles using JsonSerializer
Browse files Browse the repository at this point in the history
  • Loading branch information
mhoran committed Jan 3, 2013
1 parent c0e896b commit 17158b7
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/GetWindowHandles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,20 @@
#include "WebPageManager.h"
#include "CommandFactory.h"
#include "WebPage.h"
#include "JsonSerializer.h"
#include <QStringList>

GetWindowHandles::GetWindowHandles(WebPageManager *manager, QStringList &arguments, QObject *parent) : SocketCommand(manager, arguments, parent) {
}

void GetWindowHandles::start() {
QString handles = "[";
QStringList stringList;
QVariantList handles;

foreach(WebPage *page, manager()->pages())
stringList.append("\"" + page->uuid() + "\"");
handles << page->uuid();

handles += stringList.join(",") + "]";
JsonSerializer serializer;
QString json = serializer.serialize(handles);

emitFinished(true, handles);
emitFinished(true, json);
}

0 comments on commit 17158b7

Please sign in to comment.