<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[2245] 2013/b0unc3/trunk: latest sources </title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://gsoc.trac.wordpress.org/changeset/2245">2245</a></dd>
<dt>Author</dt> <dd>b0unc3</dd>
<dt>Date</dt> <dd>2013-08-28 17:52:14 +0000 (Wed, 28 Aug 2013)</dd>
</dl>
<h3>Log Message</h3>
<pre>latest sources </pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#2013b0unc3trunkassetsassetsindex">2013/b0unc3/trunk/assets/.assets.index</a></li>
<li><a href="#2013b0unc3trunkassetsblogslistqml">2013/b0unc3/trunk/assets/blogslist.qml</a></li>
<li><a href="#2013b0unc3trunkassetsmainqml">2013/b0unc3/trunk/assets/main.qml</a></li>
<li><a href="#2013b0unc3trunkbardescriptorxml">2013/b0unc3/trunk/bar-descriptor.xml</a></li>
<li><a href="#2013b0unc3trunksrcWPUtilscpp">2013/b0unc3/trunk/src/WPUtils.cpp</a></li>
<li><a href="#2013b0unc3trunksrcWPUtilsh">2013/b0unc3/trunk/src/WPUtils.h</a></li>
<li><a href="#2013b0unc3trunktranslationswp_bb10ts">2013/b0unc3/trunk/translations/wp_bb10.ts</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#2013b0unc3trunkassetsCustomDialogCategoriesqml">2013/b0unc3/trunk/assets/CustomDialogCategories.qml</a></li>
<li><a href="#2013b0unc3trunkassetsLoginqml">2013/b0unc3/trunk/assets/Login.qml</a></li>
<li><a href="#2013b0unc3trunkassetscommentslistqml">2013/b0unc3/trunk/assets/commentslist.qml</a></li>
<li>2013/b0unc3/trunk/assets/images/</li>
<li><a href="#2013b0unc3trunkassetsimagesaddpng">2013/b0unc3/trunk/assets/images/add.png</a></li>
<li><a href="#2013b0unc3trunkassetsimagespostspng">2013/b0unc3/trunk/assets/images/posts.png</a></li>
<li><a href="#2013b0unc3trunkassetsimagesrefreshpng">2013/b0unc3/trunk/assets/images/refresh.png</a></li>
<li><a href="#2013b0unc3trunkassetsimagessavepng">2013/b0unc3/trunk/assets/images/save.png</a></li>
<li><a href="#2013b0unc3trunkassetsimageswplogopng">2013/b0unc3/trunk/assets/images/wplogo.png</a></li>
<li><a href="#2013b0unc3trunkassetsmakePostqml">2013/b0unc3/trunk/assets/makePost.qml</a></li>
<li><a href="#2013b0unc3trunkassetspageslistqml">2013/b0unc3/trunk/assets/pageslist.qml</a></li>
<li><a href="#2013b0unc3trunkassetsshowPostqml">2013/b0unc3/trunk/assets/showPost.qml</a></li>
<li><a href="#2013b0unc3trunktestxml">2013/b0unc3/trunk/test.xml</a></li>
<li><a href="#2013b0unc3trunkwp_bb10bar">2013/b0unc3/trunk/wp_bb10.bar</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="2013b0unc3trunkassetsassetsindex"></a>
<div class="modfile"><h4>Modified: 2013/b0unc3/trunk/assets/.assets.index (2244 => 2245)</h4>
<pre class="diff"><span>
<span class="info">--- 2013/b0unc3/trunk/assets/.assets.index 2013-08-28 06:43:06 UTC (rev 2244)
+++ 2013/b0unc3/trunk/assets/.assets.index 2013-08-28 17:52:14 UTC (rev 2245)
</span><span class="lines">@@ -1,7 +1,17 @@
</span><span class="cx"> 1
</span><del>-5
-bl.qml
</del><ins>+15
+pageslist.qml
</ins><span class="cx"> blogslist.qml
</span><ins>+CustomDialogCategories.qml
+commentslist.qml
+showPost.qml
+makePost.qml
+images/wplogo.png
+images/add.png
+images/refresh.png
+images/save.png
+images/posts.png
</ins><span class="cx"> main.qml
</span><ins>+Login.qml
</ins><span class="cx"> wplogo.png
</span><del>-test.xml
</del><ins>+posts.png
</ins></span></pre></div>
<a id="2013b0unc3trunkassetsCustomDialogCategoriesqml"></a>
<div class="addfile"><h4>Added: 2013/b0unc3/trunk/assets/CustomDialogCategories.qml (0 => 2245)</h4>
<pre class="diff"><span>
<span class="info">--- 2013/b0unc3/trunk/assets/CustomDialogCategories.qml (rev 0)
+++ 2013/b0unc3/trunk/assets/CustomDialogCategories.qml 2013-08-28 17:52:14 UTC (rev 2245)
</span><span class="lines">@@ -0,0 +1,68 @@
</span><ins>+import bb.cascades 1.0
+
+Dialog {
+ id: cdcp
+
+ property variant cats;
+
+ function onDataReady(val)
+ {
+ cats = wpu.getRes();
+ /* not work? */
+ for (var event in cats) {
+ var dataCopy = cats[event]
+
+ for (var key in dataCopy) {
+ //console.log("dataCopy[key] = " + dataCopy[key]);
+ }
+ // console.log("event = " + event);
+ if ( event == "name" ) {
+ // console.log("add name " + cats[event]);
+ var option = optionControlDefinition.createObject();
+ option.text = cats[event]
+ dropDown.add(option)
+ }
+ }
+
+ cdcind.stop();
+ }
+
+ attachedObjects: [
+ ComponentDefinition {
+ id: optionControlDefinition
+ Option {
+ }
+ }
+ ]
+
+ Container {
+ horizontalAlignment: HorizontalAlignment.Center
+ verticalAlignment: VerticalAlignment.Center
+
+ background: Color.create(0.0, 0.0, 0.0, 0.5)
+
+ layout: StackLayout {}
+
+ DropDown {
+ Option {
+ text: cats.name //<--?
+ }
+ }
+
+ Divider {
+
+ }
+ Button {
+ horizontalAlignment: HorizontalAlignment.Center
+ text: qsTr("Done");
+ onClicked: {
+ customdialogcat.close();
+ }
+ }
+ }
+
+ onCreationCompleted: {
+ wpu.getCategories();
+ wpu.dataReady.connect(cdcp.onDataReady);
+ }
+}
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="2013b0unc3trunkassetsLoginqml"></a>
<div class="addfile"><h4>Added: 2013/b0unc3/trunk/assets/Login.qml (0 => 2245)</h4>
<pre class="diff"><span>
<span class="info">--- 2013/b0unc3/trunk/assets/Login.qml (rev 0)
+++ 2013/b0unc3/trunk/assets/Login.qml 2013-08-28 17:52:14 UTC (rev 2245)
</span><span class="lines">@@ -0,0 +1,149 @@
</span><ins>+// Default empty project template
+import bb.cascades 1.0
+import bb.system 1.0
+
+
+
+Page {
+ id: lp
+
+ actionBarVisibility: ChromeVisibility.Hidden
+
+ attachedObjects: [
+ ComponentDefinition {
+ id: pageDefinition
+ source: "blogslist.qml"
+ },
+ SystemToast {
+ id: myQmlToast
+ body: "Unable to register account\nPlease try again."
+ button.label: "Ok"
+ button.enabled: true
+ }
+
+ ]
+
+ function onDataReady(val) {
+ var a = wpu.getRes();
+
+ if (a["ERROR"]) {
+ myQmlToast.show();
+ usr.text = '';
+ pwd.text = '';
+ blgd.text = '';
+ myIndicator.stop();
+ // wpu.resetRes();
+ } else {
+ wpu.setUsername(usr.text);
+ wpu.setPassword(pwd.text);
+
+ var newPage = pageDefinition.createObject();
+ newPage.bl_xml = val;
+
+ myIndicator.stop();
+ navigationPane.push(newPage);
+ }
+
+ }
+
+ Container {
+ layout: DockLayout { }
+
+
+ ActivityIndicator {
+ id: myIndicator
+ horizontalAlignment: HorizontalAlignment.Center
+ verticalAlignment: VerticalAlignment.Center
+
+ preferredHeight: 500
+ preferredWidth: 500
+ }
+
+ Container {
+ layout: StackLayout {
+ }
+
+ Container {
+ verticalAlignment: VerticalAlignment.Top
+ horizontalAlignment: HorizontalAlignment.Center
+ layout: DockLayout {
+ }
+
+ //header - logo
+ ImageView {
+
+ imageSource: "asset:///wplogo.png"
+ }
+ }
+ Container {
+ verticalAlignment: VerticalAlignment.Center
+ horizontalAlignment: HorizontalAlignment.Center
+ layout: StackLayout {
+ }
+
+ topPadding: 50
+ leftPadding: 50
+ rightPadding: 50
+ bottomPadding: 50
+
+ Label {
+ text: "Username"
+ }
+
+ TextField {
+ id: usr
+ clearButtonVisible: true
+ hintText: "username"
+ }
+
+ Label {
+ topMargin: 50
+ text: "Password"
+ }
+
+ TextField {
+ id: pwd
+ inputMode: TextFieldInputMode.Password
+
+ hintText: "YouRpAsSwOrD"
+ }
+
+ Label {
+ topMargin: 50
+ text: "Blog Address"
+ }
+
+ TextField {
+ id: blgd
+
+ hintText: "leave empty if unsure"
+
+ }
+ }
+ Container {
+ verticalAlignment: VerticalAlignment.Bottom
+ horizontalAlignment: HorizontalAlignment.Center
+ layout: StackLayout {
+ }
+
+ topPadding: 50
+ //bottomPadding: 25//50
+ Button {
+ text: "Sign In"
+
+ onClicked: {
+ if (usr.text && pwd.text) {
+ myIndicator.start();
+ wpu.getBlogs(usr.text, pwd.text, blgd.text);
+ wpu.dataReady.connect(lp.onDataReady);
+ } else {; /*** TODO ***/
+ }
+ }
+
+ }
+ }
+ }
+ }
+}
+
+
</ins></span></pre></div>
<a id="2013b0unc3trunkassetsblogslistqml"></a>
<div class="modfile"><h4>Modified: 2013/b0unc3/trunk/assets/blogslist.qml (2244 => 2245)</h4>
<pre class="diff"><span>
<span class="info">--- 2013/b0unc3/trunk/assets/blogslist.qml 2013-08-28 06:43:06 UTC (rev 2244)
+++ 2013/b0unc3/trunk/assets/blogslist.qml 2013-08-28 17:52:14 UTC (rev 2245)
</span><span class="lines">@@ -1,80 +1,83 @@
</span><span class="cx"> import bb.cascades 1.0
</span><span class="cx"> import bb.data 1.0
</span><ins>+import bb.system 1.0
</ins><span class="cx">
</span><span class="cx"> Page {
</span><span class="cx"> id: blp
</span><ins>+
+ actionBarVisibility: ChromeVisibility.Hidden
+
+ property string blogid: ""
+ property string blogurl: ""
+
</ins><span class="cx"> property string mystr;
</span><del>- property alias bl_xml: blp.mystr;
- property GroupDataModel dm: { };
- /* unused */
-
- onMystrChanged: {
- console.log("my str = " + mystr);
- listView.setDataModel(wpu.setModel(mystr));
- }
-
- content: Container {
- layout: DockLayout {}
-
- ListView {
- id: listView
- listItemComponents: [
-
- ListItemComponent {
- type: "item"
- Container {
- layout: StackLayout {
- orientation: LayoutOrientation.LeftToRight
- }
- CheckBox {
- verticalAlignment: VerticalAlignment.Center
- horizontalAlignment: HorizontalAlignment.Center
- checked: false //ListItemData.checked
- }
- Container {
- layout: StackLayout {
- orientation: LayoutOrientation.TopToBottom
- }
- topPadding: 25
- leftMargin: 10
-
-
- Label {
- text: ListItemData.blogName;//["url"].value
- textFormat: TextFormat.Html
-
- textStyle {
- base: SystemDefaults.TextStyles.TitleText
- fontWeight: FontWeight.Bold
- }
- }
- Label {
- text: ListItemData.url
-
- textStyle {
- base: SystemDefaults.TextStyles.SubtitleText
- fontWeight: FontWeight.Normal
- }
- }
- }
- } // end of Container
- } // end of second ListItemComponent
- ] // end of listItemComponents list
- } // end of ListView
-
- Button {
- bottomMargin: 50
- verticalAlignment: VerticalAlignment.Bottom
- horizontalAlignment: HorizontalAlignment.Center
- text: "Done"
- }
- } // end of Container
-
-
-
- onCreationCompleted: {
- console.log("here");
-
- //dataSource.load();
- }
-}
</del><ins>+ property alias bl_xml: blp.mystr
+
+ actions: [
+ MultiSelectActionItem {
+ multiSelectHandler: listView.multiSelectHandler
+ }
+ ]
+
+ attachedObjects: [
+ SystemToast {
+ id: myQmlToast
+ body: "Unable to register account\nPlease try again."
+ button.label: "Ok"
+ button.enabled: true
+ }
+
+ ]
+
+ function moveOn()
+ {
+ navigationPane.pop();
+ }
+
+ onMystrChanged: {
+ listView.setDataModel(wpu.setModel(mystr));
+ }
+
+ content: Container {
+ layout: DockLayout {}
+
+ ListView {
+ id: listView
+
+ listItemComponents: [
+ ListItemComponent {
+ type: "item"
+ StandardListItem {
+ imageSpaceReserved: false
+ textFormat: TextFormat.Html
+ title: ListItemData.blogName
+ description: ListItemData.url
+
+ } // end of second ListItemComponent
+ } // end standardlistitem
+ ] // end of listItemComponents list
+
+ onTriggered: {
+ var selectedItem = listView.dataModel.data(indexPath);
+ blogid = selectedItem.blogid;
+ blogurl = selectedItem.xmlrpc;
+ }
+ } // end of ListView
+
+ Button {
+ bottomMargin: 50
+ verticalAlignment: VerticalAlignment.Bottom
+ horizontalAlignment: HorizontalAlignment.Center
+ text: "Done"
+ onClicked: {
+ if ( blogid && blogurl )
+ {
+ wpu.setBlogsInfo(blogid, blogurl);
+ moveOn();
+ }
+ }
+ }
+ } // end of Container
+
+
+}
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="2013b0unc3trunkassetscommentslistqml"></a>
<div class="addfile"><h4>Added: 2013/b0unc3/trunk/assets/commentslist.qml (0 => 2245)</h4>
<pre class="diff"><span>
<span class="info">--- 2013/b0unc3/trunk/assets/commentslist.qml (rev 0)
+++ 2013/b0unc3/trunk/assets/commentslist.qml 2013-08-28 17:52:14 UTC (rev 2245)
</span><span class="lines">@@ -0,0 +1,137 @@
</span><ins>+import bb.cascades 1.0
+import bb.data 1.0
+import bb.system 1.0
+
+Page {
+ id: plp
+
+ property string mystr
+ property alias bl_xml: plp.mystr
+
+ function onDataReady(val) {
+ console.log("val = " + val);
+ var a = wpu.getRes();
+
+ if (a["ERROR"]) {
+ //myQmlToast.show(); <- TBD
+ console.log("ERRORE");
+ // wpu.resetRes();
+ } else {
+ bl_xml = val;
+ clind.stop();
+ }
+
+ }
+
+ onMystrChanged: {
+ plListView.setDataModel(wpu.setModel(mystr));
+ }
+
+ titleBar: TitleBar {
+ title: "Comments"
+ }
+
+ actions: [
+ ActionItem {
+ title: "New"
+ imageSource: "asset:///images/add.png"
+ ActionBar.placement: ActionBarPlacement.InOverflow
+
+ },
+ ActionItem {
+ title: "Refresh"
+ imageSource: "asset:///images/refresh.png"
+
+ ActionBar.placement: ActionBarPlacement.InOverflow
+ }
+ ]
+
+ content: Container {
+ layout: DockLayout {
+ }
+
+ ActivityIndicator {
+ id: clind
+ horizontalAlignment: HorizontalAlignment.Center
+ verticalAlignment: VerticalAlignment.Center
+
+ preferredHeight: 500
+ preferredWidth: 500
+
+ running: true
+ }
+
+ Container {
+ layout: StackLayout { }
+
+ ListView {
+ id: plListView
+ listItemComponents: [
+ /**** FIXME **/
+ ListItemComponent {
+ type: "item"
+ Container {
+ layout: StackLayout {
+ orientation: LayoutOrientation.TopToBottom
+ }
+
+ topPadding: 10
+ bottomPadding: 10
+ leftPadding: 10
+ rightPadding: 10
+
+ Container {
+ layout: StackLayout {
+ }
+
+ Label {
+ horizontalAlignment: HorizontalAlignment.Left
+ verticalAlignment: VerticalAlignment.Center
+ text: ListItemData.author
+ textFormat: TextFormat.Html
+ multiline: true
+
+ textStyle {
+ base: SystemDefaults.TextStyles.TitleText
+ fontWeight: FontWeight.Bold
+ }
+ }
+ Label {
+ text: ListItemData.author_url
+ }
+ Label {
+ text: ListItemData.post_title
+ }
+ Label {
+ text: ListItemData.content
+ textStyle {
+ base: SystemDefaults.TextStyles.BodyText
+ fontWeight: FontWeight.Bold
+ }
+ }
+ Label {
+ text: ListItemData.status
+ }
+ }
+ }
+
+ }
+ ]
+ onTriggered: {
+ var selectedItem = plListView.dataModel.data(indexPath);
+ /*
+ * blogid = selectedItem.blogid;
+ * blogurl = selectedItem.url;
+ * textField.text = selectedItem.status;*/
+
+ }
+ } // end of plListView
+ }
+ }
+
+
+ onCreationCompleted: {
+ wpu.getComments();
+ wpu.dataReady.connect(plp.onDataReady);
+ }
+}
</ins></span></pre></div>
<a id="2013b0unc3trunkassetsimagesaddpng"></a>
<div class="binary"><h4>Added: 2013/b0unc3/trunk/assets/images/add.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Index: 2013/b0unc3/trunk/assets/images/add.png
</span><span class="cx">===================================================================
</span><del>--- 2013/b0unc3/trunk/assets/images/add.png 2013-08-28 06:43:06 UTC (rev 2244)
</del><ins>+++ 2013/b0unc3/trunk/assets/images/add.png 2013-08-28 17:52:14 UTC (rev 2245)
</ins><span class="cx">Property changes on: 2013/b0unc3/trunk/assets/images/add.png
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+application/octet-stream
</ins><span class="cx">\ No newline at end of property
</span><a id="2013b0unc3trunkassetsimagespostspng"></a>
<div class="binary"><h4>Added: 2013/b0unc3/trunk/assets/images/posts.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Index: 2013/b0unc3/trunk/assets/images/posts.png
</span><span class="cx">===================================================================
</span><del>--- 2013/b0unc3/trunk/assets/images/posts.png 2013-08-28 06:43:06 UTC (rev 2244)
</del><ins>+++ 2013/b0unc3/trunk/assets/images/posts.png 2013-08-28 17:52:14 UTC (rev 2245)
</ins><span class="cx">Property changes on: 2013/b0unc3/trunk/assets/images/posts.png
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+application/octet-stream
</ins><span class="cx">\ No newline at end of property
</span><a id="2013b0unc3trunkassetsimagesrefreshpng"></a>
<div class="binary"><h4>Added: 2013/b0unc3/trunk/assets/images/refresh.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Index: 2013/b0unc3/trunk/assets/images/refresh.png
</span><span class="cx">===================================================================
</span><del>--- 2013/b0unc3/trunk/assets/images/refresh.png 2013-08-28 06:43:06 UTC (rev 2244)
</del><ins>+++ 2013/b0unc3/trunk/assets/images/refresh.png 2013-08-28 17:52:14 UTC (rev 2245)
</ins><span class="cx">Property changes on: 2013/b0unc3/trunk/assets/images/refresh.png
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+application/octet-stream
</ins><span class="cx">\ No newline at end of property
</span><a id="2013b0unc3trunkassetsimagessavepng"></a>
<div class="binary"><h4>Added: 2013/b0unc3/trunk/assets/images/save.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Index: 2013/b0unc3/trunk/assets/images/save.png
</span><span class="cx">===================================================================
</span><del>--- 2013/b0unc3/trunk/assets/images/save.png 2013-08-28 06:43:06 UTC (rev 2244)
</del><ins>+++ 2013/b0unc3/trunk/assets/images/save.png 2013-08-28 17:52:14 UTC (rev 2245)
</ins><span class="cx">Property changes on: 2013/b0unc3/trunk/assets/images/save.png
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+application/octet-stream
</ins><span class="cx">\ No newline at end of property
</span><a id="2013b0unc3trunkassetsimageswplogopng"></a>
<div class="binary"><h4>Added: 2013/b0unc3/trunk/assets/images/wplogo.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Index: 2013/b0unc3/trunk/assets/images/wplogo.png
</span><span class="cx">===================================================================
</span><del>--- 2013/b0unc3/trunk/assets/images/wplogo.png 2013-08-28 06:43:06 UTC (rev 2244)
</del><ins>+++ 2013/b0unc3/trunk/assets/images/wplogo.png 2013-08-28 17:52:14 UTC (rev 2245)
</ins><span class="cx">Property changes on: 2013/b0unc3/trunk/assets/images/wplogo.png
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+application/octet-stream
</ins><span class="cx">\ No newline at end of property
</span><a id="2013b0unc3trunkassetsmainqml"></a>
<div class="modfile"><h4>Modified: 2013/b0unc3/trunk/assets/main.qml (2244 => 2245)</h4>
<pre class="diff"><span>
<span class="info">--- 2013/b0unc3/trunk/assets/main.qml 2013-08-28 06:43:06 UTC (rev 2244)
+++ 2013/b0unc3/trunk/assets/main.qml 2013-08-28 17:52:14 UTC (rev 2245)
</span><span class="lines">@@ -1,132 +1,232 @@
</span><del>-// Default empty project template
</del><span class="cx"> import bb.cascades 1.0
</span><span class="cx"> import bb.system 1.0
</span><span class="cx">
</span><del>-NavigationPane {
- id: navpane
- backButtonsVisible: false
</del><ins>+TabbedPane {
+ id: tabbedPane
+ showTabsOnActionBar: false
+ peekEnabled: false
</ins><span class="cx">
</span><span class="cx">
</span><del>-
</del><span class="cx"> attachedObjects: [
</span><span class="cx"> ComponentDefinition {
</span><del>- id: pageDefinition
</del><ins>+ id: loginPage
+ source: "Login.qml"
+ },
+ ComponentDefinition {
+ id: blogsList
</ins><span class="cx"> source: "blogslist.qml"
</span><span class="cx"> },
</span><del>- SystemToast {
- id: myQmlToast
- body: "Unable to register account\nPlease try again."
- button.label: "Ok"
- button.enabled: true
- }
-
</del><ins>+ ComponentDefinition {
+ id: commentsList
+ source: "commentslist.qml"
+ },
+ ComponentDefinition {
+ id: pagesList
+ source: "pageslist.qml"
+ }
</ins><span class="cx"> ]
</span><del>-
-
- Page {
- id: mainPage
-
- function onDataReady(val)
- {
- var a = wpu.getRes();
-
- if ( a["ERROR"] )
- {
- myQmlToast.show();
- usr.text = '';
- pwd.text = '';
- blgd.text = '';
- wpu.resetRes();
- } else {
- var newPage = pageDefinition.createObject();
- newPage.bl_xml = val;
- navpane.push(newPage);//, { bl_xml: val });
</del><ins>+ Tab {
+ id: loginregisterTab
+ NavigationPane {
+ id: navigationPane
+ peekEnabled: false
+
+ onCreationCompleted: {
+ var page = loginPage.createObject();
+ navigationPane.push(page);
</ins><span class="cx"> }
</span><del>-
</del><ins>+
+ onPopTransitionEnded: {
+ page.destroy();
+ plp.loadData();
+
+ tabbedPane.activeTab = postTab;
+
+ tabbedPane.remove(loginregisterTab);
+ tabbedPane.showTabsOnActionBar = false;
+ tabbedPane.peekEnabled = true;
+
+ }
</ins><span class="cx"> }
</span><ins>+ }
+ Tab {
+ id: postTab
+ title: qsTr("Posts")
</ins><span class="cx">
</span><del>- Container {
- layout: StackLayout { }
</del><ins>+ NavigationPane {
+ id: navpostpane
</ins><span class="cx">
</span><del>- Container {
- verticalAlignment: VerticalAlignment.Top
- horizontalAlignment: HorizontalAlignment.Center
- layout: DockLayout {}
</del><ins>+ Page {
+ id: plp
</ins><span class="cx">
</span><del>- //header - logo
- ImageView {
</del><ins>+ property string mystr
+ property alias bl_xml: plp.mystr
+
+ function loadData() {
+ if ( plListView.dataModel )
+plListView.dataModel.clear();
</ins><span class="cx">
</span><del>- imageSource: "asset:///wplogo.png"
</del><ins>+ plind.start();
+ console.log("*()*(*)(*)(*)*(*)*()*(*)*(*)*))))))))-->here we are");
+ wpu.getPosts();
+ wpu.dataReady.connect(plp.onDataReady);
</ins><span class="cx"> }
</span><del>- }
- Container {
- verticalAlignment: VerticalAlignment.Center
- horizontalAlignment: HorizontalAlignment.Center
- layout: StackLayout { }
</del><span class="cx">
</span><del>- topPadding: 50
- leftPadding: 50
- rightPadding: 50
- bottomPadding: 50
</del><ins>+ function onDataReady(val) {
+ var a = wpu.getRes();
+
+ if (a["ERROR"]) {
+ //myQmlToast.show();
+ console.log("ERRORE");
+ // wpu.resetRes();
+ } else {
+ bl_xml = val;
+ plind.stop();
+ }
</ins><span class="cx">
</span><del>- Label {
- // horizontalAlignment: HorizontalAlignment.Left
- text: "Username"
</del><span class="cx"> }
</span><span class="cx">
</span><del>- TextField {
- id: usr
- // horizontalAlignment: HorizontalAlignment.Right
- clearButtonVisible: true
- hintText: "username"
</del><ins>+ onMystrChanged: {
+ plListView.setDataModel(wpu.setModel(mystr));
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-
- Label {
- topMargin: 50
- text: "Password"
</del><ins>+ titleBar: TitleBar {
+ title: "Posts"
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- TextField {
- id: pwd
- inputMode: TextFieldInputMode.Password
-
- hintText: "YouRpAsSwOrD"
</del><ins>+ attachedObjects: [
+ ComponentDefinition {
+ id: showPost
+ source: "showPost.qml"
+ },
+ ComponentDefinition {
+ id: makePost
+ source: "makePost.qml"
+ }
+ ]
</ins><span class="cx">
</span><del>- }
</del><ins>+ actions: [
+ ActionItem {
+ title: "New"
+ imageSource: "asset:///images/add.png"
+ ActionBar.placement: ActionBarPlacement.InOverflow
+
+ onTriggered: {
+ var newPage = makePost.createObject();
+ navpostpane.push(newPage);
+ }
+ },
+ ActionItem {
+ title: "Refresh"
+ imageSource: "asset:///images/refresh.png"
+
+ ActionBar.placement: ActionBarPlacement.InOverflow
+
+ onTriggered: {
+ plp.loadData();
+ }
+ }
+ ]
</ins><span class="cx">
</span><del>- Label {
- topMargin: 50
- text: "Blog Address"
- }
-
- TextField {
- id: blgd
</del><ins>+ content: Container {
+ layout: DockLayout {
+ }
</ins><span class="cx">
</span><del>- hintText: "leave empty if unsure"
-
- }
- }
- Container {
- verticalAlignment: VerticalAlignment.Bottom
- horizontalAlignment: HorizontalAlignment.Center
- layout: StackLayout { }
-
- topPadding: 50
- //bottomPadding: 25//50
- Button {
- text: "Sign In"
</del><ins>+ ActivityIndicator {
+ id: plind
+ horizontalAlignment: HorizontalAlignment.Center
+ verticalAlignment: VerticalAlignment.Center
+
+ preferredHeight: 500
+ preferredWidth: 500
+
+ running: true
+ }
</ins><span class="cx">
</span><del>- onClicked: {
- if ( usr.text && pwd.text )
- {
- wpu.getBlogs(usr.text,pwd.text,blgd.text);
- wpu.dataReady.connect(mainPage.onDataReady);
- } else { ; /*TODO*/ }
</del><ins>+ Container {
+ layout: StackLayout { }
+
+ ListView {
+ id: plListView
+
+ listItemComponents: [
+ ListItemComponent {
+ type: "item"
+ id: listItemContainer
+
+ StandardListItem {
+ textFormat: TextFormat.Html
+ title: ListItemData.post_title
+ description: ListItemData.post_date
+ status: ListItemData.post_status
+ imageSpaceReserved: false
+
+ contextActions: [
+ ActionSet {
+ title: "Test"
+ ActionItem {
+ title: "Edit"
+ onTriggered: {
+
+ //console.log("edit post id = " + ListItemData.post_id);
+ }
+ }
+ DeleteActionItem {
+ title: "Delete"
+
+ }
+ }
+ ]
+ }
+ }
+ ]
+ onTriggered: {
+ var selectedItem = plListView.dataModel.data(indexPath);
+ var newPage = showPost.createObject();
+ // console.log("wrk post_id = " + selectedItem.post_id);
+ newPage.apostid = selectedItem.post_id;
+ navpostpane.push(newPage);
+ }
+ } // end of plListView
+
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> }
</span><ins>+
+ onPopTransitionEnded: {
+ plp.loadData();
+ }
</ins><span class="cx"> }
</span><ins>+
+
+ onTriggered: {
+ plp.loadData();
+ }
</ins><span class="cx"> }
</span><del>-}
</del><ins>+
+ Tab {
+ id: commentsTab
+ title: qsTr("Comments")
+
+ onTriggered: {
+ var newPage = commentsList.createObject();
+ commentsTab.setContent(newPage);
+ tabbedPane.activeTab = commentsTab;
+ }
+ }
+ Tab {
+ id: pagesTab
+ title: qsTr("Pages")
+
+ onTriggered: {
+ var newPage = pagesList.createObject();
+ pagesTab.setContent(newPage);
+ tabbedPane.activeTab = pagesTab;
+ }
+ }
+ onCreationCompleted: {
+ OrientationSupport.supportedDisplayOrientation = SupportedDisplayOrientation.All;
+ }
+}
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="2013b0unc3trunkassetsmakePostqml"></a>
<div class="addfile"><h4>Added: 2013/b0unc3/trunk/assets/makePost.qml (0 => 2245)</h4>
<pre class="diff"><span>
<span class="info">--- 2013/b0unc3/trunk/assets/makePost.qml (rev 0)
+++ 2013/b0unc3/trunk/assets/makePost.qml 2013-08-28 17:52:14 UTC (rev 2245)
</span><span class="lines">@@ -0,0 +1,141 @@
</span><ins>+import bb.cascades 1.0
+import bb.system 1.0
+
+Page {
+ id: mpp
+
+ actionBarVisibility: ChromeVisibility.Visible
+
+ attachedObjects: [
+ CustomDialogCategories {
+ id: customdialogcat
+ /* not sure */
+ onOpened: {
+ customDialogPage.actionBarVisibility = ChromeVisibility.Hidden
+ }
+ onClosed: {
+ customDialogPage.actionBarVisibility = ChromeVisibility.Default
+ }
+ },
+ SystemProgressToast {
+ id: spt
+ progress: -1
+ body: qsTr("Creating the new post, please wait");
+ }
+ ]
+
+ actions: [
+ ActionItem {
+ title: "Save"
+ imageSource: "asset:///images/save.png"
+ ActionBar.placement: ActionBarPlacement.OnBar
+
+ onTriggered: {
+ spt.show();
+ wpu.makePost(posttitle.text, postcontent.text, posttype.selectedValue, posttags.text, poststatus.selectedValue);
+ wpu.dataReady.connect(mpp.onDataReady);
+ }
+ }
+ ]
+
+ function onDataReady(val)
+ {
+ var a = wpu.getRes();
+
+// console.log("forse = " + a['newpostid']);
+ if ( a['newpostid'] )
+ {
+ spt.cancel();
+ navpostpane.pop();
+ } else console.log("wrg : smtg wrong"); /* TODO */
+ }
+
+
+ titleBar: TitleBar {
+ title: qsTr("New Post");
+ }
+
+ content: Container {
+ layout: StackLayout { }
+
+ TextField {
+ horizontalAlignment: HorizontalAlignment.Fill
+ id: posttitle
+
+ hintText: qsTr("Post Title");
+ }
+
+ TextArea {
+ id: postcontent
+ editable: true
+ hintText: qsTr("Post Content");
+
+ minHeight: 150
+ preferredHeight: 400
+ }
+
+ TextField {
+ horizontalAlignment: HorizontalAlignment.Fill
+ id: posttags
+ hintText: qsTr("Post tags (Separate tags with commas)");
+ }
+
+ Divider {
+
+ }
+
+ Button {
+ text: qsTr("Categories")
+
+ onClicked: {
+ customdialogcat.open();
+ }
+ }
+
+ DropDown {
+ id: poststatus
+ title: qsTr("Status");
+ Option {
+ text: qsTr("Public");
+ value: "public"
+ selected: true
+ }
+ Option {
+ text: qsTr("Private");
+ value: "private"
+ }
+ }
+
+ DropDown {
+ id: posttype
+ title: qsTr("Format");
+
+ Option {
+ text: qsTr("Standard");
+ value: "post"
+ selected: true
+ }
+ Option {
+ text: qsTr("Aside");
+ value: "aside"
+ }
+ Option {
+ text: qsTr("Image");
+ value: "image"
+ }
+ Option {
+ text: qsTr("Video");
+ value: "video"
+ }
+ Option {
+ text: qsTr("Quote");
+ value: "quote"
+ }
+ Option {
+ text: qsTr("Link");
+ value: "link"
+ }
+ }
+
+ }
+}
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="2013b0unc3trunkassetspageslistqml"></a>
<div class="addfile"><h4>Added: 2013/b0unc3/trunk/assets/pageslist.qml (0 => 2245)</h4>
<pre class="diff"><span>
<span class="info">--- 2013/b0unc3/trunk/assets/pageslist.qml (rev 0)
+++ 2013/b0unc3/trunk/assets/pageslist.qml 2013-08-28 17:52:14 UTC (rev 2245)
</span><span class="lines">@@ -0,0 +1,125 @@
</span><ins>+import bb.cascades 1.0
+import bb.data 1.0
+import bb.system 1.0
+
+Page {
+ id: plp
+
+ property string mystr
+ property alias bl_xml: plp.mystr
+
+ function onDataReady(val) {
+ var a = wpu.getRes();
+
+ if (a["ERROR"]) {
+ // myQmlToast.show();
+ console.log("ERRORE");
+ // wpu.resetRes();
+ } else {
+ bl_xml = val;
+ pslind.stop();
+ }
+
+ }
+
+ onMystrChanged: {
+ plListView.setDataModel(wpu.setModel(mystr));
+ }
+
+ titleBar: TitleBar {
+ title: "Comments"
+ }
+
+ actions: [
+ ActionItem {
+ title: "New"
+ imageSource: "asset:///images/add.png"
+ ActionBar.placement: ActionBarPlacement.InOverflow
+
+ },
+ ActionItem {
+ title: "Refresh"
+ imageSource: "asset:///images/refresh.png"
+
+ ActionBar.placement: ActionBarPlacement.InOverflow
+ }
+ ]
+
+ content: Container {
+ layout: DockLayout {
+ }
+
+ ActivityIndicator {
+ id: pslind
+ horizontalAlignment: HorizontalAlignment.Center
+ verticalAlignment: VerticalAlignment.Center
+
+ preferredHeight: 500
+ preferredWidth: 500
+
+ running: true
+ }
+
+ Container {
+ layout: StackLayout { }
+
+ ListView {
+ id: plListView
+
+ listItemComponents: [
+ ListItemComponent {
+ type: "item"
+ Container {
+ layout: StackLayout {
+ orientation: LayoutOrientation.TopToBottom
+ }
+
+ topPadding: 10
+ bottomPadding: 10
+ leftPadding: 10
+ rightPadding: 10
+
+ Container {
+ layout: StackLayout {
+ }
+
+ Label {
+ horizontalAlignment: HorizontalAlignment.Left
+ verticalAlignment: VerticalAlignment.Center
+ text: ListItemData.wp_author
+ textFormat: TextFormat.Html
+ multiline: true
+
+ textStyle {
+ base: SystemDefaults.TextStyles.TitleText
+ fontWeight: FontWeight.Bold
+ }
+ }
+ Label {
+ text: ListItemData.title
+ }
+ Label {
+ text: ListItemData.pages_status
+ }
+
+ Label {
+ text: ListItemData.page_status
+ }
+ }
+ }
+
+ }
+ ]
+ onTriggered: {
+ var selectedItem = plListView.dataModel.data(indexPath);
+
+ }
+ } // end of plListView
+ }
+ }
+
+ onCreationCompleted: {
+ wpu.getPages();
+ wpu.dataReady.connect(plp.onDataReady);
+ }
+}
</ins></span></pre></div>
<a id="2013b0unc3trunkassetsshowPostqml"></a>
<div class="addfile"><h4>Added: 2013/b0unc3/trunk/assets/showPost.qml (0 => 2245)</h4>
<pre class="diff"><span>
<span class="info">--- 2013/b0unc3/trunk/assets/showPost.qml (rev 0)
+++ 2013/b0unc3/trunk/assets/showPost.qml 2013-08-28 17:52:14 UTC (rev 2245)
</span><span class="lines">@@ -0,0 +1,89 @@
</span><ins>+import bb.cascades 1.0
+import bb.data 1.0
+import bb.system 1.0
+
+Page {
+
+ id: sp
+
+ property string postid
+ property alias apostid: sp.postid
+ property variant myObj
+
+ onPostidChanged: {
+ //console.log("postid changed" + sp.postid);
+ wpu.getPost(sp.postid);
+ wpu.dataReady.connect(sp.onDataReady);
+ }
+
+ function onDataReady(val) {
+ //aspe`
+ myObj = wpu.getRes();
+ console.log("myObj contains " + myObj);
+ for (var event in myObj) {
+ var dataCopy = myObj[event]
+ }
+ // console.log("going to set title = " + myObj["post_title"]);
+ spind.stop();
+ }
+
+ actionBarVisibility: ChromeVisibility.Visible
+
+
+
+ titleBar: TitleBar {
+ title: "Post : " + myObj.post_title
+ }
+ content: Container {
+ layout: DockLayout { }
+
+ ActivityIndicator {
+ id: spind
+ horizontalAlignment: HorizontalAlignment.Center
+ verticalAlignment: VerticalAlignment.Center
+
+ preferredHeight: 500
+ preferredWidth: 500
+
+ running: true
+ }
+
+ Container {
+ layout: StackLayout { }
+
+ ScrollView {
+ id: scrollView
+ scrollViewProperties {
+ scrollMode: ScrollMode.Both
+ pinchToZoomEnabled: true
+ maxContentScale: 5
+ minContentScale: 1
+ }
+
+ layoutProperties: StackLayoutProperties {
+ spaceQuota: 1.0
+ }
+
+ Container {
+ background: Color.LightGray
+
+ /* alternative?!?!? */
+ WebView {
+ id: webView
+ html: "<html><p style=\"font-family: 'Verdena'; font-size: 55px;\">" + myObj.post_content + "</p></html>"
+
+
+ onMinContentScaleChanged: {
+ scrollView.scrollViewProperties.minContentScale = minContentScale;
+ }
+
+ onMaxContentScaleChanged: {
+ scrollView.scrollViewProperties.maxContentScale = maxContentScale;
+ }
+ } // end WebView
+ } // end container
+ } // end ScrollView
+
+ }
+ }
+}
</ins></span></pre></div>
<a id="2013b0unc3trunkbardescriptorxml"></a>
<div class="modfile"><h4>Modified: 2013/b0unc3/trunk/bar-descriptor.xml (2244 => 2245)</h4>
<pre class="diff"><span>
<span class="info">--- 2013/b0unc3/trunk/bar-descriptor.xml 2013-08-28 06:43:06 UTC (rev 2244)
+++ 2013/b0unc3/trunk/bar-descriptor.xml 2013-08-28 17:52:14 UTC (rev 2245)
</span><span class="lines">@@ -96,8 +96,10 @@
</span><span class="cx"> <include name="*.qm"/>
</span><span class="cx"> </asset>
</span><span class="cx">
</span><del>- <asset path="assets/wplogo.png">assets/wplogo.png</asset>
</del><span class="cx">
</span><ins>+ <asset path="assets/images/wplogo.png">assets/wplogo.png</asset>
+ <!-- <asset path="assets/images/rotate.png">assets/refresh.png</asset> -->
+ <asset path="assets/images/posts.png">assets/posts.png</asset>
</ins><span class="cx">
</span><span class="cx"> <!-- Request permission to execute native code. Required for native applications. -->
</span><span class="cx"> <permission system="true">run_native</permission>
</span></span></pre></div>
<a id="2013b0unc3trunksrcWPUtilscpp"></a>
<div class="modfile"><h4>Modified: 2013/b0unc3/trunk/src/WPUtils.cpp (2244 => 2245)</h4>
<pre class="diff"><span>
<span class="info">--- 2013/b0unc3/trunk/src/WPUtils.cpp 2013-08-28 06:43:06 UTC (rev 2244)
+++ 2013/b0unc3/trunk/src/WPUtils.cpp 2013-08-28 17:52:14 UTC (rev 2245)
</span><span class="lines">@@ -7,13 +7,75 @@
</span><span class="cx">
</span><span class="cx"> #include "WPUtils.h"
</span><span class="cx">
</span><ins>+WPUtils::~WPUtils() {
+ // TODO Auto-generated destructor stub
+}
</ins><span class="cx">
</span><ins>+void WPUtils::makePost(QString title, QString content, QVariant type, QString tags, QVariant status)
+{
</ins><span class="cx">
</span><del>-using namespace bb::data;
-using namespace bb::cascades;
</del><ins>+ qDebug() << "make new post title " << title << "content" << content << "type = " << type.toString() << "tags = " << tags << " status = " << status.toString();
+ QXmlStreamWriter sw(&_xml);
</ins><span class="cx">
</span><del>-WPUtils::~WPUtils() {
- // TODO Auto-generated destructor stub
</del><ins>+ sw.setAutoFormatting(true);
+ sw.writeStartDocument();
+
+ sw.writeStartElement("methodCall");
+ sw.writeTextElement("methodName", "wp.newPost");
+ sw.writeStartElement("params");
+ sw.writeStartElement("param");
+ sw.writeCharacters("blog_id");
+ sw.writeTextElement("value", _blogid);
+ sw.writeEndElement();
+ sw.writeStartElement("param");
+ sw.writeCharacters("username");
+ sw.writeTextElement("value", _username);
+ sw.writeEndElement();
+ sw.writeStartElement("param");
+ sw.writeCharacters("password");
+ sw.writeTextElement("value", _password);
+ sw.writeEndElement();
+ sw.writeStartElement("struct");
+ sw.writeStartElement("member");
+ sw.writeTextElement("name", "post_type");
+ sw.writeTextElement("value", type.toString());
+ sw.writeEndElement();
+ sw.writeStartElement("member");
+ sw.writeTextElement("name", "post_status");
+ sw.writeTextElement("value", status.toString());
+ sw.writeEndElement();
+ sw.writeStartElement("member");
+ sw.writeTextElement("name", "post_title");
+ sw.writeTextElement("value", title);
+ sw.writeEndElement();
+ sw.writeStartElement("member");
+ sw.writeTextElement("name", "post_content");
+ sw.writeTextElement("value", content);
+ sw.writeEndElement();
+ sw.writeEndElement();
+ sw.writeEndElement();
+ sw.writeEndElement();
+ sw.writeEndDocument();
+
+
+ qDebug() << "post xml : " << _xml << " on " << _endpoint;
+
+ QNetworkAccessManager *manager = new QNetworkAccessManager();
+
+ QObject::connect(manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(replyFinished(QNetworkReply*)));
+
+ QUrl url;
+
+
+ url.setUrl(_endpoint);
+ QNetworkRequest request(url);
+ int cmd = 0;
+ request.setAttribute(QNetworkRequest::Attribute(QNetworkRequest::User + 1), QVariant((int) cmd)); /* not sure */
+ request.setRawHeader("User-Agent", "wp-bb10/0.0.1");
+ request.setHeader(QNetworkRequest::ContentTypeHeader, "text/xml");
+
+
+ manager->post(request,_xml);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WPUtils::getBlogs(QString u, QString p, QString blog_address)
</span><span class="lines">@@ -80,73 +142,486 @@
</span><span class="cx">
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void WPUtils::setBlogsInfo(QString bid, QString burl)
+{
+ _blogid = bid;
+ _endpoint = burl;
+}
+
+void WPUtils::getCategories()
+{
+ QDomDocument doc;
+ QDomProcessingInstruction init = doc.createProcessingInstruction("xml version=\"1.0\"", "encoding=\"UTF-8\"");
+ QDomElement mc = doc.createElement("methodCall");
+ QDomElement mn = doc.createElement("methodName");
+ QDomText mnt = doc.createTextNode("wp.getTerms");
+ QDomElement ps = doc.createElement("params");
+ QDomElement p1 = doc.createElement("param");
+ QDomText p1t = doc.createTextNode("blogid");
+ QDomElement v1 = doc.createElement("value");
+ QDomText v1t = doc.createTextNode(_blogid);
+ QDomElement p2 = doc.createElement("param");
+ QDomText p2t = doc.createTextNode("username");
+ QDomElement v2 = doc.createElement("value");
+ QDomText v2t = doc.createTextNode(_username);
+ QDomElement p3 = doc.createElement("param");
+ QDomText p3t = doc.createTextNode("password");
+ QDomElement v3 = doc.createElement("value");
+ QDomText v3t = doc.createTextNode(_password);
+ QDomElement p4 = doc.createElement("param");
+ QDomText p4t = doc.createTextNode("taxonomy");
+ QDomElement v4 = doc.createElement("value");
+ QDomText v4t = doc.createTextNode("category");
+
+ doc.appendChild(init);
+ doc.appendChild(mc);
+ mc.appendChild(mn);
+ mn.appendChild(mnt);
+ mc.appendChild(ps);
+
+ ps.appendChild(p1);
+ p1.appendChild(p1t);
+ p1.appendChild(v1);
+ v1.appendChild(v1t);
+
+ ps.appendChild(p2);
+ p2.appendChild(p2t);
+ p2.appendChild(v2);
+ v2.appendChild(v2t);
+
+ ps.appendChild(p3);
+ p3.appendChild(p3t);
+ p3.appendChild(v3);
+ v3.appendChild(v3t);
+
+ ps.appendChild(p4);
+ p4.appendChild(p4t);
+ p4.appendChild(v4);
+ v4.appendChild(v4t);
+
+
+
+ _xml = doc.toString().toUtf8();
+ qDebug() << "post xml : " << _xml << " on " << _endpoint;
+
+ QNetworkAccessManager *manager = new QNetworkAccessManager();
+
+ QObject::connect(manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(replyFinished(QNetworkReply*)));
+
+ QUrl url;
+
+
+ url.setUrl(_endpoint);
+ QNetworkRequest request(url);
+ int cmd = 0;
+ request.setAttribute(QNetworkRequest::Attribute(QNetworkRequest::User + 1), QVariant((int) cmd)); /* not sure */
+ request.setRawHeader("User-Agent", "wp-bb10/0.0.1");
+ request.setHeader(QNetworkRequest::ContentTypeHeader, "text/xml");
+
+
+ manager->post(request,_xml);
+
+}
+
+void WPUtils::getPost(QString pid)
+{
+
+ qDebug() << "fetching post id = " << pid;
+ /* alternative ? */
+ QDomDocument doc;
+ QDomProcessingInstruction init = doc.createProcessingInstruction("xml version=\"1.0\"", "encoding=\"UTF-8\"");
+ QDomElement mc = doc.createElement("methodCall");
+ QDomElement mn = doc.createElement("methodName");
+ QDomText mnt = doc.createTextNode("wp.getPost");
+ QDomElement ps = doc.createElement("params");
+ QDomElement p1 = doc.createElement("param");
+ QDomText p1t = doc.createTextNode("blogid");
+ QDomElement v1 = doc.createElement("value");
+ QDomText v1t = doc.createTextNode(_blogid);
+ QDomElement p2 = doc.createElement("param");
+ QDomText p2t = doc.createTextNode("username");
+ QDomElement v2 = doc.createElement("value");
+ QDomText v2t = doc.createTextNode(_username);
+ QDomElement p3 = doc.createElement("param");
+ QDomText p3t = doc.createTextNode("password");
+ QDomElement v3 = doc.createElement("value");
+ QDomText v3t = doc.createTextNode(_password);
+ QDomElement p4 = doc.createElement("param");
+ QDomText p4t = doc.createTextNode("post_id");
+ QDomElement v4 = doc.createElement("value");
+ QDomText v4t = doc.createTextNode(pid);
+
+ doc.appendChild(init);
+ doc.appendChild(mc);
+ mc.appendChild(mn);
+ mn.appendChild(mnt);
+ mc.appendChild(ps);
+
+ ps.appendChild(p1);
+ p1.appendChild(p1t);
+ p1.appendChild(v1);
+ v1.appendChild(v1t);
+
+ ps.appendChild(p2);
+ p2.appendChild(p2t);
+ p2.appendChild(v2);
+ v2.appendChild(v2t);
+
+ ps.appendChild(p3);
+ p3.appendChild(p3t);
+ p3.appendChild(v3);
+ v3.appendChild(v3t);
+
+ ps.appendChild(p4);
+ p4.appendChild(p4t);
+ p4.appendChild(v4);
+ v4.appendChild(v4t);
+
+
+
+ _xml = doc.toString().toUtf8();
+ qDebug() << "post xml : " << _xml << " on " << _endpoint;
+
+ QNetworkAccessManager *manager = new QNetworkAccessManager();
+
+ QObject::connect(manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(replyFinished(QNetworkReply*)));
+
+ QUrl url;
+
+
+ url.setUrl(_endpoint);
+ QNetworkRequest request(url);
+ int cmd = 0;
+ request.setAttribute(QNetworkRequest::Attribute(QNetworkRequest::User + 1), QVariant((int) cmd)); /* not sure */
+ request.setRawHeader("User-Agent", "wp-bb10/0.0.1");
+ request.setHeader(QNetworkRequest::ContentTypeHeader, "text/xml");
+
+
+ manager->post(request,_xml);
+
+}
+
+
+
+void WPUtils::getPages()
+{
+ //_blogid = bid;
+
+ //_endpoint = burl;//.append("xmlrpc.php");
+ QDomDocument doc;
+ QDomProcessingInstruction init = doc.createProcessingInstruction("xml version=\"1.0\"", "encoding=\"UTF-8\"");
+ QDomElement mc = doc.createElement("methodCall");
+ QDomElement mn = doc.createElement("methodName");
+ QDomText mnt = doc.createTextNode("wp.getPages");
+ QDomElement ps = doc.createElement("params");
+ QDomElement p1 = doc.createElement("param");
+ QDomText p1t = doc.createTextNode("blogid");
+ QDomElement v1 = doc.createElement("value");
+ QDomText v1t = doc.createTextNode(_blogid);
+ QDomElement p2 = doc.createElement("param");
+ QDomText p2t = doc.createTextNode("username");
+ QDomElement v2 = doc.createElement("value");
+ QDomText v2t = doc.createTextNode(_username);
+ QDomElement p3 = doc.createElement("param");
+ QDomText p3t = doc.createTextNode("password");
+ QDomElement v3 = doc.createElement("value");
+ QDomText v3t = doc.createTextNode(_password);
+
+ doc.appendChild(init);
+ doc.appendChild(mc);
+ mc.appendChild(mn);
+ mn.appendChild(mnt);
+ mc.appendChild(ps);
+
+ ps.appendChild(p1);
+ p1.appendChild(p1t);
+ p1.appendChild(v1);
+ v1.appendChild(v1t);
+
+ ps.appendChild(p2);
+ p2.appendChild(p2t);
+ p2.appendChild(v2);
+ v2.appendChild(v2t);
+
+ ps.appendChild(p3);
+ p3.appendChild(p3t);
+ p3.appendChild(v3);
+ v3.appendChild(v3t);
+
+
+ _xml = doc.toString().toUtf8();
+ qDebug() << "post xml : " << _xml << " on " << _endpoint;
+
+ QNetworkAccessManager *manager = new QNetworkAccessManager();
+
+ QObject::connect(manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(replyFinished(QNetworkReply*)));
+
+ QUrl url;
+
+
+ url.setUrl(_endpoint);
+ QNetworkRequest request(url);
+ int cmd = 0;
+ request.setAttribute(QNetworkRequest::Attribute(QNetworkRequest::User + 1), QVariant((int) cmd)); /* not sure */
+ request.setRawHeader("User-Agent", "wp-bb10/0.0.1");
+ request.setHeader(QNetworkRequest::ContentTypeHeader, "text/xml");
+
+
+ manager->post(request,_xml);
+
+
+}
+
+void WPUtils::getComments()
+{
+ //_blogid = bid;
+
+ //_endpoint = burl;//.append("xmlrpc.php");
+ QDomDocument doc;
+ QDomProcessingInstruction init = doc.createProcessingInstruction("xml version=\"1.0\"", "encoding=\"UTF-8\"");
+ QDomElement mc = doc.createElement("methodCall");
+ QDomElement mn = doc.createElement("methodName");
+ QDomText mnt = doc.createTextNode("wp.getComments");
+ QDomElement ps = doc.createElement("params");
+ QDomElement p1 = doc.createElement("param");
+ QDomText p1t = doc.createTextNode("blogid");
+ QDomElement v1 = doc.createElement("value");
+ QDomText v1t = doc.createTextNode(_blogid);
+ QDomElement p2 = doc.createElement("param");
+ QDomText p2t = doc.createTextNode("username");
+ QDomElement v2 = doc.createElement("value");
+ QDomText v2t = doc.createTextNode(_username);
+ QDomElement p3 = doc.createElement("param");
+ QDomText p3t = doc.createTextNode("password");
+ QDomElement v3 = doc.createElement("value");
+ QDomText v3t = doc.createTextNode(_password);
+
+ doc.appendChild(init);
+ doc.appendChild(mc);
+ mc.appendChild(mn);
+ mn.appendChild(mnt);
+ mc.appendChild(ps);
+
+ ps.appendChild(p1);
+ p1.appendChild(p1t);
+ p1.appendChild(v1);
+ v1.appendChild(v1t);
+
+ ps.appendChild(p2);
+ p2.appendChild(p2t);
+ p2.appendChild(v2);
+ v2.appendChild(v2t);
+
+ ps.appendChild(p3);
+ p3.appendChild(p3t);
+ p3.appendChild(v3);
+ v3.appendChild(v3t);
+
+
+ _xml = doc.toString().toUtf8();
+ qDebug() << "post xml : " << _xml << " on " << _endpoint;
+
+ QNetworkAccessManager *manager = new QNetworkAccessManager();
+
+ QObject::connect(manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(replyFinished(QNetworkReply*)));
+
+ QUrl url;
+
+
+ url.setUrl(_endpoint);
+ QNetworkRequest request(url);
+ int cmd = 0;
+ request.setAttribute(QNetworkRequest::Attribute(QNetworkRequest::User + 1), QVariant((int) cmd)); /* not sure */
+ request.setRawHeader("User-Agent", "wp-bb10/0.0.1");
+ request.setHeader(QNetworkRequest::ContentTypeHeader, "text/xml");
+
+
+ manager->post(request,_xml);
+
+
+}
+
+void WPUtils::getPosts()
+{
+ //_blogid = bid;
+
+ //_endpoint = burl;//.append("xmlrpc.php");
+ QDomDocument doc;
+ QDomProcessingInstruction init = doc.createProcessingInstruction("xml version=\"1.0\"", "encoding=\"UTF-8\"");
+ QDomElement mc = doc.createElement("methodCall");
+ QDomElement mn = doc.createElement("methodName");
+ QDomText mnt = doc.createTextNode("wp.getPosts");
+ QDomElement ps = doc.createElement("params");
+ QDomElement p1 = doc.createElement("param");
+ QDomText p1t = doc.createTextNode("blogid");
+ QDomElement v1 = doc.createElement("value");
+ QDomText v1t = doc.createTextNode(_blogid);
+ QDomElement p2 = doc.createElement("param");
+ QDomText p2t = doc.createTextNode("username");
+ QDomElement v2 = doc.createElement("value");
+ QDomText v2t = doc.createTextNode(_username);
+ QDomElement p3 = doc.createElement("param");
+ QDomText p3t = doc.createTextNode("password");
+ QDomElement v3 = doc.createElement("value");
+ QDomText v3t = doc.createTextNode(_password);
+
+ doc.appendChild(init);
+ doc.appendChild(mc);
+ mc.appendChild(mn);
+ mn.appendChild(mnt);
+ mc.appendChild(ps);
+
+ ps.appendChild(p1);
+ p1.appendChild(p1t);
+ p1.appendChild(v1);
+ v1.appendChild(v1t);
+
+ ps.appendChild(p2);
+ p2.appendChild(p2t);
+ p2.appendChild(v2);
+ v2.appendChild(v2t);
+
+ ps.appendChild(p3);
+ p3.appendChild(p3t);
+ p3.appendChild(v3);
+ v3.appendChild(v3t);
+
+
+ _xml = doc.toString().toUtf8();
+ qDebug() << "post xml : " << _xml << " on " << _endpoint;
+
+ QNetworkAccessManager *manager = new QNetworkAccessManager();
+
+ QObject::connect(manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(replyFinished(QNetworkReply*)));
+
+ QUrl url;
+
+
+ url.setUrl(_endpoint);
+ QNetworkRequest request(url);
+ int cmd = 0;
+ request.setAttribute(QNetworkRequest::Attribute(QNetworkRequest::User + 1), QVariant((int) cmd)); /* not sure */
+ request.setRawHeader("User-Agent", "wp-bb10/0.0.1");
+ request.setHeader(QNetworkRequest::ContentTypeHeader, "text/xml");
+
+
+ manager->post(request,_xml);
+
+
+}
+
</ins><span class="cx"> void WPUtils::replyFinished(QNetworkReply *rep)
</span><span class="cx"> {
</span><ins>+ QVariantMap _res_bck;
+ model = new GroupDataModel();
+ model->setGrouping(ItemGrouping::None);
</ins><span class="cx">
</span><ins>+ if ( model && !model->isEmpty() )
+ model->clear();
+
+ if ( !res.isEmpty() )
+ res.clear();
+
+
</ins><span class="cx"> QByteArray ret = rep->readAll();
</span><del>- qDebug() << "reading " << ret; //rep->readAll();
</del><ins>+ if ( !ret.isEmpty() )
+ qDebug() << "reading " << ret; //rep->readAll();
+ else qDebug() << "ret empty -> error handling /*TODO*/";
</ins><span class="cx">
</span><span class="cx"> QString _current_name = "";
</span><span class="cx">
</span><span class="cx"> QXmlStreamReader xml(ret);
</span><span class="cx">
</span><ins>+ int _struct_counter = 0;
+
</ins><span class="cx"> while(!xml.atEnd() && !xml.hasError()) {
</span><span class="cx"> QXmlStreamReader::TokenType token = xml.readNext();
</span><del>- if(token == QXmlStreamReader::StartElement) {
- if ( xml.name() == "fault" ) {
- qDebug() << "errorifying";
- res.insert("ERROR", "ERROR");
- xml.raiseError("ERROR");
- }
- if(xml.name() == "name") {
- xml.readNext();
- if(xml.tokenType() == QXmlStreamReader::Characters) {
- qDebug() << "set current name t o " << _current_name;
- _current_name = xml.text().toString();
- }
- //continue;
- } else if ( xml.name() == "value" && !_current_name.isEmpty() ) {
</del><ins>+ if ( token == QXmlStreamReader::StartElement )
+ {
+ if ( xml.name().toString() == "struct" )
+ {
+ _struct_counter++;
+ //qDebug() << "+++++++++++++ increased struct counter to " << QString::number(_temp_struct_counter);
+ } else if ( xml.name().toString() == "name" )
+ {
</ins><span class="cx"> token = xml.readNext();
</span><ins>+ //qDebug() << "save name = " << xml.text().toString();
+ _current_name = xml.text().toString();
+ } else if ( xml.name().toString() == "value" && !_current_name.isEmpty() )
+ {
</ins><span class="cx"> token = xml.readNext();
</span><del>- if ( xml.tokenType() == QXmlStreamReader::Characters )
</del><ins>+ if ( xml.name().toString() == "string" || xml.name().toString() == "boolean" || xml.name().toString() == "dateTime.iso8601" )
</ins><span class="cx"> {
</span><del>- qDebug() << "save name = " << _current_name << " text = " << xml.text().toString();
- res.insert(_current_name, xml.text().toString());
</del><ins>+ token = xml.readNext();
+ if ( _current_name == "post_date" || _current_name == "date_created_gmt" )
+ {
+ /* is this insane?! */
+ QString theDate = xml.text().toString(); //"20130503T14:48:55";
+ QString y = theDate.mid(0,4);
+ QString m = theDate.mid(4,2);
+ QString d = theDate.mid(6,2);
+ QString build = y + "-" + m + "-" + d + "" + theDate.mid(8,theDate.size());
+ /** TBC **/
+
+ const QDateTime t2(QDateTime::fromString(build, Qt::ISODate));
+ QString s = t2.toString();
+ QStringList ret = s.split(" ");
+ QString pt = ret[2] + "/" + ret[1] + "/" + ret[4] + " " + ret[3];
+
+ res[_current_name] = pt;
+ } else res[_current_name] = xml.text().toString();
+
</ins><span class="cx"> _current_name = "";
</span><ins>+ } else _current_name = "";
+ } else if ( xml.name().toString() == "string" )
+ {
+ /* newpost workaround */
+ token = xml.readNext();
+ res["newpostid"] = xml.text().toString();
+ model->insert(res);
+ _res_bck.unite(res);
+ res.clear();
+ }
+
+
+ } else if ( token == QXmlStreamReader::EndElement )
+ {
+ if ( xml.name().toString() == "struct" )
+ {
+ _struct_counter--;
+ //qDebug() << "------------- decreased struct counter to " << QString::number(_temp_struct_counter);
+
+ if ( _struct_counter == 0 )
+ {
+ //qDebug() << "**END** inserting " << res;
+ if ( !res.isEmpty() )
+ {
+ model->insert(res);
+ _res_bck.unite(res);
+ res.clear();
+ } else qDebug() << "*+*+*+*+*+*+*+* ouch! res is empty!! =====DO SMTG======";
+
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ res = _res_bck;
</ins><span class="cx">
</span><del>- qDebug() << "map = " << res << "tot = " << res.count();
</del><ins>+ //qDebug() << "map = " << res << "tot = " << res.count();
</ins><span class="cx">
</span><del>-
</del><span class="cx"> emit dataReady(ret);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-bb::cascades::GroupDataModel* WPUtils::setModel(QByteArray a)
</del><ins>+/* no need to pass a qbytearray, model filled in the replyFinished */
+bb::cascades::GroupDataModel * WPUtils::setModel(QByteArray a)
</ins><span class="cx"> {
</span><ins>+ /*
</ins><span class="cx"> qDebug() << "workgin on " << a;
</span><ins>+ qDebug() << "adding " << res;
+ */
+ return model;
</ins><span class="cx">
</span><del>- bb::cascades::GroupDataModel *model = new GroupDataModel(QStringList() << "name" );/* TO BE CHECKED */
-
- /*
- * keep it in mind
-
- XmlDataAccess xda;
- QVariant list = xda.loadFromBuffer(a, "/methodResponse/params/param/value/array/data/value/struct/member");///param/value/array/data/value/struct/member");
- if (xda.hasError()) {
- qDebug() << "error = " << xda.error().errorMessage().toAscii();
- } else {
- qDebug() << "list len = " << list.toMap();
- }
- */
- model->setGrouping(ItemGrouping::None);
- qDebug() << "INSERT = " << res;
- model->insert(res);
-
- return model;
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> QString WPUtils::sanitize(QString burl)
</span><span class="lines">@@ -174,8 +649,8 @@
</span><span class="cx"> QString WPUtils::searchEndPoint(QString url) // WP_FindEndPoint(QString url)
</span><span class="cx"> {
</span><span class="cx"> _url = sanitize(url);
</span><del>-/*
- * not here , but somewhere esle TBD
</del><ins>+ /*
+ * not here , but somewhere esle TBD
</ins><span class="cx"> QUrl t(_url);
</span><span class="cx"> if ( !t.isValid() )
</span><span class="cx"> {
</span></span></pre></div>
<a id="2013b0unc3trunksrcWPUtilsh"></a>
<div class="modfile"><h4>Modified: 2013/b0unc3/trunk/src/WPUtils.h (2244 => 2245)</h4>
<pre class="diff"><span>
<span class="info">--- 2013/b0unc3/trunk/src/WPUtils.h 2013-08-28 06:43:06 UTC (rev 2244)
+++ 2013/b0unc3/trunk/src/WPUtils.h 2013-08-28 17:52:14 UTC (rev 2245)
</span><span class="lines">@@ -17,11 +17,13 @@
</span><span class="cx"> #include <qnetworkrequest.h>
</span><span class="cx">
</span><span class="cx"> #include <QUrl>
</span><ins>+/* TO BE ROMEVED, USE QXml* */
</ins><span class="cx"> #include <QDomDocument>
</span><span class="cx"> #include <QDomElement>
</span><span class="cx"> #include <QDomText>
</span><span class="cx">
</span><span class="cx"> #include <QtXml/QXmlStreamReader>
</span><ins>+#include <QXmlStreamWriter>
</ins><span class="cx">
</span><span class="cx"> #include <QByteArray>
</span><span class="cx"> #include <QVariant>
</span><span class="lines">@@ -38,35 +40,58 @@
</span><span class="cx"> #include <QMetaType>
</span><span class="cx"> #include <QtScript>
</span><span class="cx">
</span><del>-#include <bb/data/XmlDataAccess>
-#include <bb/cascades/ListView>
-#include <bb/cascades/DataModel>
</del><ins>+#include <bb/data/XmlDataAccess> //?
+#include <bb/cascades/ListView> //?
+#include <bb/cascades/DataModel> //?
</ins><span class="cx"> #include <bb/cascades/GroupDataModel>
</span><ins>+#include <bb/cascades/QListDataModel> //?
</ins><span class="cx">
</span><ins>+using namespace bb::data;
+using namespace bb::cascades; //?
+
+
</ins><span class="cx"> class WPUtils: public QObject {
</span><span class="cx"> Q_OBJECT
</span><span class="cx">
</span><span class="cx"> public:
</span><del>- QMap<QString,QVariant> res;
</del><ins>+ QVariantMap res;
+ bb::cascades::GroupDataModel *model;
+
+
</ins><span class="cx"> WPUtils(QObject *parent = 0) { }
</span><span class="cx"> virtual ~WPUtils();
</span><span class="cx">
</span><ins>+ Q_INVOKABLE void getBlogs(QString, QString, QString);
+ Q_INVOKABLE void getPosts();
+ Q_INVOKABLE void setBlogsInfo(QString,QString);
+ Q_INVOKABLE void getComments();
+ Q_INVOKABLE void getPages();
+ Q_INVOKABLE void getPost(QString);
+ Q_INVOKABLE void getCategories();
+ Q_INVOKABLE void makePost(QString, QString, QVariant, QString, QVariant);
</ins><span class="cx">
</span><del>- Q_INVOKABLE void getBlogs(QString, QString, QString);
- Q_INVOKABLE bb::cascades::GroupDataModel * setModel(QByteArray);
</del><ins>+ Q_INVOKABLE bb::cascades::GroupDataModel *setModel(QByteArray); /* should be getModel, since the model is setted in another func */
</ins><span class="cx"> QString searchEndPoint(QString);
</span><ins>+
+ /* maybe temporary */
</ins><span class="cx"> Q_INVOKABLE QMap<QString, QVariant> getRes() { return res; }
</span><span class="cx"> Q_INVOKABLE void resetRes() { res.clear(); }
</span><ins>+ Q_INVOKABLE void setUsername(QString u) { _username = u; }
+ Q_INVOKABLE void setPassword(QString p) { _password = p; }
</ins><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> QString _endpoint;
</span><span class="cx"> QString _url;
</span><span class="cx"> QEventLoop _loop;
</span><span class="cx"> QByteArray _xml;
</span><ins>+ QString _username;
+ QString _password;
+ QString _blogid;
</ins><span class="cx">
</span><span class="cx"> QString sanitize(QString);
</span><span class="cx"> bool validate(QString);
</span><del>-signals:
</del><ins>+
+ signals:
</ins><span class="cx"> void dataReady(QByteArray); //QVariant);//QString);
</span><span class="cx">
</span><span class="cx"> private slots:
</span></span></pre></div>
<a id="2013b0unc3trunktestxml"></a>
<div class="addfile"><h4>Added: 2013/b0unc3/trunk/test.xml (0 => 2245)</h4>
<pre class="diff"><span>
<span class="info">--- 2013/b0unc3/trunk/test.xml (rev 0)
+++ 2013/b0unc3/trunk/test.xml 2013-08-28 17:52:14 UTC (rev 2245)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+<?xml version="1.0" encoding="UTF-8"?>
+<methodResponse>
+ <params>
+ <param>
+ <value>
+ <array><data>
+ <value><struct>
+ <member><name>isAdmin</name><value><boolean>1</boolean></value></member>
+ <member><name>url</name><value><string>https://bouncelab.wordpress.com/</string></value></member>
+ <member><name>blogid</name><value><string>51280592</string></value></member>
+ <member><name>blogName</name><value><string>b0unc3&#039;s Blog</string></value></member>
+ <member><name>xmlrpc</name><value><string>https://bouncelab.wordpress.com/xmlrpc.php</string></value></member>
+</struct></value>
+</data></array>
+ </value>
+ </param>
+ </params>
+</methodResponse>
</ins></span></pre></div>
<a id="2013b0unc3trunktranslationswp_bb10ts"></a>
<div class="modfile"><h4>Modified: 2013/b0unc3/trunk/translations/wp_bb10.ts (2244 => 2245)</h4>
<pre class="diff"><span>
<span class="info">--- 2013/b0unc3/trunk/translations/wp_bb10.ts 2013-08-28 06:43:06 UTC (rev 2244)
+++ 2013/b0unc3/trunk/translations/wp_bb10.ts 2013-08-28 17:52:14 UTC (rev 2245)
</span><span class="lines">@@ -1,4 +1,93 @@
</span><span class="cx"> <?xml version="1.0" encoding="utf-8"?>
</span><span class="cx"> <!DOCTYPE TS>
</span><span class="cx"> <TS version="2.0">
</span><ins>+<context>
+ <name>CustomDialogCategories</name>
+ <message>
+ <source>Done</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>main</name>
+ <message>
+ <source>Posts</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Comments</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Pages</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>makePost</name>
+ <message>
+ <source>Post Title</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Post Content</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Categories</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Status</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Public</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Private</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Format</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Standard</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Aside</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Image</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Video</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Quote</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Link</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>New Post</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Creating the new post, please wait</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Post tags (Separate tags with commas)</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
</ins><span class="cx"> </TS>
</span></span></pre></div>
<a id="2013b0unc3trunkwp_bb10bar"></a>
<div class="binary"><h4>Added: 2013/b0unc3/trunk/wp_bb10.bar</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Index: 2013/b0unc3/trunk/wp_bb10.bar
</span><span class="cx">===================================================================
</span><del>--- 2013/b0unc3/trunk/wp_bb10.bar 2013-08-28 06:43:06 UTC (rev 2244)
</del><ins>+++ 2013/b0unc3/trunk/wp_bb10.bar 2013-08-28 17:52:14 UTC (rev 2245)
</ins><span class="cx">Property changes on: 2013/b0unc3/trunk/wp_bb10.bar
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+application/octet-stream
</ins><span class="cx">\ No newline at end of property
</span></div>
</body>
</html>