Permalink
Browse files

Serialize window handles using JsonSerializer

  • Loading branch information...
1 parent c0e896b commit 17158b7bc5436ee2b9cb0eaf03f46f7e9b49919c @mhoran mhoran committed Dec 29, 2012
Showing with 6 additions and 5 deletions.
  1. +6 −5 src/GetWindowHandles.cpp
View
@@ -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.