<!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>[2379] 2013/b0unc3/trunk/assets: final 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/2379">2379</a></dd>
<dt>Author</dt> <dd>b0unc3</dd>
<dt>Date</dt> <dd>2013-09-24 17:30:45 +0000 (Tue, 24 Sep 2013)</dd>
</dl>
<h3>Log Message</h3>
<pre>final sources </pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#2013b0unc3trunkassetseditcommentqml">2013/b0unc3/trunk/assets/editcomment.qml</a></li>
<li><a href="#2013b0unc3trunkassetseditpostqml">2013/b0unc3/trunk/assets/editpost.qml</a></li>
<li><a href="#2013b0unc3trunkassetsmainqml">2013/b0unc3/trunk/assets/main.qml</a></li>
<li><a href="#2013b0unc3trunkassetsmakePostqml">2013/b0unc3/trunk/assets/makePost.qml</a></li>
<li><a href="#2013b0unc3trunkassetspostslistqml">2013/b0unc3/trunk/assets/postslist.qml</a></li>
<li><a href="#2013b0unc3trunkassetsshowPostqml">2013/b0unc3/trunk/assets/showPost.qml</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#2013b0unc3trunkassetspageslistqml">2013/b0unc3/trunk/assets/pageslist.qml</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="2013b0unc3trunkassetseditcommentqml"></a>
<div class="modfile"><h4>Modified: 2013/b0unc3/trunk/assets/editcomment.qml (2378 => 2379)</h4>
<pre class="diff"><span>
<span class="info">--- 2013/b0unc3/trunk/assets/editcomment.qml 2013-09-23 20:49:20 UTC (rev 2378)
+++ 2013/b0unc3/trunk/assets/editcomment.qml 2013-09-24 17:30:45 UTC (rev 2379)
</span><span class="lines">@@ -100,10 +100,11 @@
</span><span class="cx"> text: (ec_cinfos) ? ec_cinfos.author_url : ""
</span><span class="cx"> }
</span><span class="cx"> Label {
</span><del>- text: qsTr("content")
</del><ins>+ text: qsTr("Content")
</ins><span class="cx"> }
</span><span class="cx"> TextArea {
</span><span class="cx"> id: ccontent
</span><ins>+ minHeight: 150
</ins><span class="cx"> preferredHeight: 200
</span><span class="cx"> text: (ec_cinfos) ? ec_cinfos.content : ""
</span><span class="cx"> }
</span></span></pre></div>
<a id="2013b0unc3trunkassetseditpostqml"></a>
<div class="modfile"><h4>Modified: 2013/b0unc3/trunk/assets/editpost.qml (2378 => 2379)</h4>
<pre class="diff"><span>
<span class="info">--- 2013/b0unc3/trunk/assets/editpost.qml 2013-09-23 20:49:20 UTC (rev 2378)
+++ 2013/b0unc3/trunk/assets/editpost.qml 2013-09-24 17:30:45 UTC (rev 2379)
</span><span class="lines">@@ -6,11 +6,13 @@
</span><span class="cx"> property string post_id;
</span><span class="cx"> property variant pinfos
</span><span class="cx">
</span><del>- property bool post_showpage: false
</del><ins>+ property bool post_showpage;
</ins><span class="cx">
</span><span class="cx"> onPost_idChanged: {
</span><del>- wpu.getPost(post_id);
- wpu.dataReady_getPost.connect(ep.ep_onDataReady);
</del><ins>+ wpu.getPost(ep.post_showpage, post_id);
+ if ( ep.post_showpage )
+ wpu.dataReady_getPage.connect(ep.ep_onDataReady);
+ else wpu.dataReady_getPost.connect(ep.ep_onDataReady);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> function ep_onDataReady() {
</span><span class="lines">@@ -49,8 +51,10 @@
</span><span class="cx"> {
</span><span class="cx"> ci_ep.body = "Editing post\nPlease wait...";
</span><span class="cx"> ci_ep.open();
</span><del>- wpu.editPost(ep.post_id,ptitle.text,pcontent.text,pstate.selectedValue, pformat.selectedValue);
- wpu.dataReady_editPost.connect(ep.ep_onDataReady);
</del><ins>+ wpu.editPost(ep.post_showpage, ep.post_id,ptitle.text,pcontent.text,pstate.selectedValue, pformat.selectedValue);
+ if ( ep.post_showpage )
+ wpu.dataReady_editPage.connect(ep.ep_onDataReady);
+ else wpu.dataReady_editPost.connect(ep.ep_onDataReady);
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="lines">@@ -91,7 +95,7 @@
</span><span class="cx">
</span><span class="cx"> TextField {
</span><span class="cx"> id: ptitle
</span><del>- text: pinfos.post_title
</del><ins>+ text: (pinfos) ? pinfos.post_title : ""
</ins><span class="cx"> }
</span><span class="cx"> TextArea {
</span><span class="cx"> id: pcontent
</span></span></pre></div>
<a id="2013b0unc3trunkassetsmainqml"></a>
<div class="modfile"><h4>Modified: 2013/b0unc3/trunk/assets/main.qml (2378 => 2379)</h4>
<pre class="diff"><span>
<span class="info">--- 2013/b0unc3/trunk/assets/main.qml 2013-09-23 20:49:20 UTC (rev 2378)
+++ 2013/b0unc3/trunk/assets/main.qml 2013-09-24 17:30:45 UTC (rev 2379)
</span><span class="lines">@@ -34,6 +34,10 @@
</span><span class="cx"> source: "postslist.qml"
</span><span class="cx"> },
</span><span class="cx"> ComponentDefinition {
</span><ins>+ id: pagesList
+ source: "postslist.qml"
+ },
+ ComponentDefinition {
</ins><span class="cx"> id: loginPage
</span><span class="cx"> source: "Login.qml"
</span><span class="cx"> },
</span><span class="lines">@@ -44,10 +48,6 @@
</span><span class="cx"> ComponentDefinition {
</span><span class="cx"> id: commentsList
</span><span class="cx"> source: "commentslist.qml"
</span><del>- },
- ComponentDefinition {
- id: pagesList
- source: "pageslist.qml"
</del><span class="cx"> }
</span><span class="cx"> ]
</span><span class="cx">
</span><span class="lines">@@ -61,7 +61,8 @@
</span><span class="cx"> tabbedPane.peekEnabled = true;
</span><span class="cx">
</span><span class="cx"> var newPage = postsList.createObject();
</span><del>- navpostpane.push(newPage);
</del><ins>+ newPage.post_showpage = false;
+ navpostpane.push(newPage);
</ins><span class="cx"> newPage.post_loadData();
</span><span class="cx"> } else console.log("no info registered");
</span><span class="cx"> }
</span><span class="lines">@@ -94,6 +95,7 @@
</span><span class="cx"> tabbedPane.peekEnabled = true;
</span><span class="cx">
</span><span class="cx"> var newPage = postsList.createObject();
</span><ins>+ newPage.post_showpage = false;
</ins><span class="cx"> navpostpane.push(newPage);
</span><span class="cx"> newPage.post_loadData();
</span><span class="cx">
</span><span class="lines">@@ -107,8 +109,11 @@
</span><span class="cx">
</span><span class="cx"> NavigationPane {
</span><span class="cx"> id: navpostpane
</span><ins>+
+
</ins><span class="cx">
</span><span class="cx"> onPopTransitionEnded: {
</span><ins>+
</ins><span class="cx"> if ( page )
</span><span class="cx"> page.destroy();
</span><span class="cx">
</span><span class="lines">@@ -116,9 +121,10 @@
</span><span class="cx"> console.log("first page is here ");
</span><span class="cx"> navpostpane.firstPage.post_restoreItems()
</span><span class="cx"> } else {
</span><del>- var p = postsList.createObject();
- navpostpane.push(p);
- p.post_loadData();
</del><ins>+ var post_ = postsList.createObject();
+ post_.post_showpage = false;
+ navpostpane.push(post_);
+ post_.post_loadData();
</ins><span class="cx">
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="lines">@@ -126,18 +132,27 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> onTriggered: {
</span><ins>+ if (navpagepane.count() > 0) {
+ for (var i = 0; i < navpagepane.count(); i ++)
+ navpagepane.remove(navpostpane.at(i));
+ }
+ if ( navpagepane.top ) {
+ navpagepane.remove(navpagepane.top);
+ }
</ins><span class="cx"> if (navpostpane.count() == 0) {
</span><del>- var newPage = postsList.createObject();
- navpostpane.push(newPage);
- newPage.post_loadData();
</del><ins>+ var newPage_post_ = postsList.createObject();
+ newPage_post_.post_showpage = false;
+ navpostpane.push(newPage_post_);
+ newPage_post_.post_loadData();
</ins><span class="cx"> } else {
</span><span class="cx"> if ( navpostpane.firstPage )
</span><span class="cx"> {
</span><span class="cx"> navpostpane.firstPage.post_loadData();
</span><span class="cx"> } else {
</span><del>- var p = postsList.createObject();
- navpostpane.push(p);
- p.post_loadData();
</del><ins>+ var post_p = postsList.createObject();
+ navpostpane.push(post_p);
+ post_p.post_showpage = false;
+ post_p.post_loadData();
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -168,6 +183,14 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> onTriggered: {
</span><ins>+ if (navpostpane.count() > 0) {
+ for (var i = 0; i < navpostpane.count(); i ++)
+ navpostpane.remove(navpostpane.at(i));
+ }
+ if ( navpostpane.top )
+ {
+ navpostpane.remove(navpostpane.top);
+ }
</ins><span class="cx"> if ( navcommentspane.count() == 0 )
</span><span class="cx"> {
</span><span class="cx"> var newPage = commentsList.createObject();
</span><span class="lines">@@ -187,35 +210,49 @@
</span><span class="cx"> id: navpagepane
</span><span class="cx">
</span><span class="cx"> onPopTransitionEnded: {
</span><del>- if (page) page.destroy();
</del><ins>+ if (page)
+ page.destroy();
</ins><span class="cx">
</span><span class="cx"> if (navpagepane.firstPage) {
</span><span class="cx"> navpagepane.firstPage.post_restoreItems()
</span><span class="cx"> } else {
</span><del>- var p = postsList.createObject();
- p.post_showpage = true;
- navpagepane.push(p);
- p.post_loadData();
</del><ins>+ var page_p = pagesList.createObject();
+ page_p.post_showpage = true;
+ navpagepane.push(page_p);
+ page_p.post_loadData();
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> onTriggered: {
</span><ins>+ if ( navpostpane.count() > 0)
+ {
+ console.log("removing pages")
+ for ( var i=0; i<navpostpane.count(); i++ )
+ {
+ console.log("removing page at " + i);
+ navpostpane.remove(navpostpane.at(i));
+ }
+
+ }
+ if (navpostpane.top) {
+ navpostpane.remove(navpostpane.top);
+ }
</ins><span class="cx"> if (navpagepane.count() == 0) {
</span><del>- var newPage = postsList.createObject();
- newPage.post_showpage = true;
- navpagepane.push(newPage);
- newPage.post_loadData();
</del><ins>+ var page_newPage = pagesList.createObject();
+ page_newPage.post_showpage = true;
+ navpagepane.push(page_newPage);
+ page_newPage.post_loadData();
</ins><span class="cx"> } else { //}if ( navpostpane.firstPage ){
</span><span class="cx"> if (navpagepane.firstPage) {
</span><span class="cx"> navpagepane.firstPage.post_loadData();
</span><span class="cx"> } else {
</span><del>- var p = postsList.createObject();
- p.post_showpage = true;
- navpagepane.push(p);
</del><ins>+ var page_p2 = pagesList.createObject();
+ page_p2.post_showpage = true;
+ navpagepane.push(page_p2);
</ins><span class="cx"> //p.restoreItems()
</span><del>- p.post_loadData();
</del><ins>+ page_p2.post_loadData();
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="2013b0unc3trunkassetsmakePostqml"></a>
<div class="modfile"><h4>Modified: 2013/b0unc3/trunk/assets/makePost.qml (2378 => 2379)</h4>
<pre class="diff"><span>
<span class="info">--- 2013/b0unc3/trunk/assets/makePost.qml 2013-09-23 20:49:20 UTC (rev 2378)
+++ 2013/b0unc3/trunk/assets/makePost.qml 2013-09-24 17:30:45 UTC (rev 2379)
</span><span class="lines">@@ -11,7 +11,7 @@
</span><span class="cx"> Page {
</span><span class="cx"> id: mp_mpp
</span><span class="cx">
</span><del>- property bool post_showpage: false
</del><ins>+ property bool post_showpage;
</ins><span class="cx">
</span><span class="cx"> attachedObjects: [
</span><span class="cx"> CustomIndicator {
</span><span class="lines">@@ -44,10 +44,17 @@
</span><span class="cx"> ActionBar.placement: ActionBarPlacement.OnBar
</span><span class="cx">
</span><span class="cx"> onTriggered: {
</span><del>- mp_ci.body = "Creating the new post\nplaease wait...";
</del><ins>+ console.log("1) saving on = " + mp_mpp.post_showpage);
+ mp_ci.body = "Creating the new " +((mp_mpp.post_showpage) ? "page" : "post") + "\nplaease wait...";
+ console.log("2) saving on = " + mp_mpp.post_showpage);
</ins><span class="cx"> mp_ci.open();
</span><del>- wpu.makePost(post_showpage, posttitle.text, postcontent.text.trim(), ((posttype.selectedValue) ? posttype.selectedValue : "" ) , poststatus.selectedValue);
- wpu.dataReady_newPost.connect(mp_mpp.mp_onDataReady);
</del><ins>+ console.log("3) saving on = " + mp_mpp.post_showpage);
+ wpu.makePost(mp_mpp.post_showpage, posttitle.text, postcontent.text.trim(), ((posttype.selectedValue) ? posttype.selectedValue : "" ) , poststatus.selectedValue);
+ console.log("4) saving on = " + mp_mpp.post_showpage);
+ if ( mp_mpp.post_showpage )
+ wpu.dataReady_newPage.connect(mp_mpp.mp_onDataReady);
+ else wpu.dataReady_newPost.connect(mp_mpp.mp_onDataReady);
+ console.log("5) saving on = " + mp_mpp.post_showpage);
</ins><span class="cx"> }
</span><span class="cx"> },
</span><span class="cx"> ActionItem {
</span></span></pre></div>
<a id="2013b0unc3trunkassetspageslistqml"></a>
<div class="delfile"><h4>Deleted: 2013/b0unc3/trunk/assets/pageslist.qml (2378 => 2379)</h4>
<pre class="diff"><span>
<span class="info">--- 2013/b0unc3/trunk/assets/pageslist.qml 2013-09-23 20:49:20 UTC (rev 2378)
+++ 2013/b0unc3/trunk/assets/pageslist.qml 2013-09-24 17:30:45 UTC (rev 2379)
</span><span class="lines">@@ -1,169 +0,0 @@
</span><del>-/*
- * pageslist.qml
- *
- * Author: Daniele (b0unc3) Maio
- */
-
-import bb.cascades 1.0
-import bb.system 1.0
-
-Page {
- id: plp
-
- function init()
- {
- if ( !pslind.running )
- pslind.start();
-
- if ( pListView.dataModel )
- pListView.setDataModel(null);
-
- wpu.getPosts(true);
- wpu.dataReady_getPosts.connect(plp.onDataReady);
- }
-
- function onDataReady() {
- var a = wpu.getRes();
-
- if (a["ERROR"]) {
- // myQmlToast.show();
- console.log("ERRORE");
- // wpu.resetRes();
- } else if ( a['delpost'] ) {
- if (a["delpost"] == 1) {
- deldialog.cancel();
- pslind.stop();
- } else console.log("fail to delete the page!");
- } else {
- pListView.setDataModel(wpu.setModel("mystr"));
- pslind.stop();
- }
-
- }
-
- titleBar: TitleBar {
- title: "Pages"
- }
-
- 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
-
- onTriggered: {
- plp.init();
- }
- }
- ]
-
- attachedObjects: [
- SystemDialog {
- property string paid
- id: delDialog
- title: qsTr("DELETE PAGE")
- body: qsTr("Are you sure to delete this page?")
- confirmButton.label: qsTr("Yes")
- confirmButton.enabled: true
- cancelButton.label: qsTr("Cancel")
- cancelButton.enabled: true
- onFinished: {
- var x = result;
- if (x == SystemUiResult.ConfirmButtonSelection) {
- delprog.body = "Deleting comment\nPlease wait...";
- delprog.open();
- pslind.start();
- wpu.deletePost(paid);
- wpu.dataReady_delPost.connect(cp.onDataReady);
- } else if (x == SystemUiResult.CancelButtonSelection) {
- console.log("cancel");
- }
- }
- }
- ]
-
- content: Container {
- layout: DockLayout {
- }
-
- ActivityIndicator {
- id: pslind
- horizontalAlignment: HorizontalAlignment.Center
- verticalAlignment: VerticalAlignment.Center
-
- preferredHeight: 500
- preferredWidth: 500
-
- running: true
- }
-
- Container {
- layout: StackLayout {
- }
-
- ListView {
- id: pListView
-
- function deletePage(id)
- {
- delDialog.paid = id
- delDialog.show();
- }
-
- listItemComponents: [
- ListItemComponent {
- type: "item"
- id: listItemContainer
-
- StandardListItem {
- id: psli
-
- textFormat: TextFormat.Html
- title: ListItemData.post_title
- description: ListItemData.post_date
- status: ListItemData.post_status
- imageSpaceReserved: false
-
- contextActions: [
- ActionSet {
- title: ListItemData.title
- ActionItem {
- title: "Edit"
- imageSource: "asset:///images/edit.png";
- onTriggered: {
-
- }
- }
- DeleteActionItem {
- title: "Delete"
-
- onTriggered: {
- psli.ListItem.view.deletePage(psli.ListItem.page_id);
- }
-
- }
- }
- ]
- }
- }
- ]
- onTriggered: {
- var selectedItem = pListView.dataModel.data(indexPath);
- }
- } // end of pListView
- }
- }
-
- onCreationCompleted: {
- if (! pListView.dataModel)
- plp.init();
-
- }
-}
</del></span></pre></div>
<a id="2013b0unc3trunkassetspostslistqml"></a>
<div class="modfile"><h4>Modified: 2013/b0unc3/trunk/assets/postslist.qml (2378 => 2379)</h4>
<pre class="diff"><span>
<span class="info">--- 2013/b0unc3/trunk/assets/postslist.qml 2013-09-23 20:49:20 UTC (rev 2378)
+++ 2013/b0unc3/trunk/assets/postslist.qml 2013-09-24 17:30:45 UTC (rev 2379)
</span><span class="lines">@@ -10,11 +10,12 @@
</span><span class="cx"> Page {
</span><span class="cx"> id: post_plp
</span><span class="cx">
</span><del>- property bool post_showpage: false
</del><ins>+ property bool post_showpage;
</ins><span class="cx"> property variant post_savemodel;
</span><span class="cx">
</span><span class="cx"> function post_restoreItems()
</span><span class="cx"> {
</span><ins>+ console.log("RESTIORE IMTEMS!" );
</ins><span class="cx"> if ( post_savemodel )
</span><span class="cx"> {
</span><span class="cx"> post_plListView.setDataModel(null);
</span><span class="lines">@@ -25,29 +26,40 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> function post_loadData() {
</span><ins>+ console.log(" -- INF loadData()");
</ins><span class="cx"> if (post_plListView.dataModel) //plListView.dataModel.clear();
</span><span class="cx"> post_plListView.setDataModel(null);
</span><span class="cx">
</span><span class="cx"> post_plind.start();
</span><del>- wpu.getPosts(post_showpage);
- wpu.dataReady_getPosts.connect(post_plp.post_onDataReady);
</del><ins>+ console.log("loading data -> " + post_plp.post_showpage);
+ wpu.getPosts(post_plp.post_showpage);
+ if ( post_plp.post_showpage )
+ wpu.dataReady_getPages.connect(post_plp.post_onDataReady);
+ else wpu.dataReady_getPosts.connect(post_plp.post_onDataReady);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> function post_onDataReady(val) {
</span><ins>+ var d = new Date();
+
+ console.log("herer =>" + d);
</ins><span class="cx"> var post_pa = wpu.getRes();
</span><span class="cx">
</span><span class="cx"> if (post_pa["ERROR"]) {
</span><ins>+ console.log(post_showpage);
</ins><span class="cx"> //myQmlToast.show();
</span><span class="cx"> console.log("ERRORE");
</span><span class="cx"> // wpu.resetRes();
</span><span class="cx"> } else if (post_pa["delpost"]) {
</span><ins>+ console.log("delpost = " + post_showpage);
</ins><span class="cx"> if (post_pa["delpost"] == 1) {
</span><ins>+ console.log("delpost 1 = " + post_showpage);
</ins><span class="cx"> post_delDialog.cancel();
</span><span class="cx"> post_ci_pl.close();
</span><span class="cx"> post_plp.post_loadData();
</span><span class="cx"> } else console.log("delete fail");
</span><span class="cx">
</span><span class="cx"> } else {
</span><ins>+ console.log("POSTSLIST else - " + post_showpage);
</ins><span class="cx"> post_plListView.setDataModel(wpu.setModel("post_mystr"));
</span><span class="cx"> post_plind.stop();
</span><span class="cx"> }
</span><span class="lines">@@ -74,12 +86,6 @@
</span><span class="cx"> CustomIndicator {
</span><span class="cx"> id: post_ci_pl
</span><span class="cx"> },
</span><del>- SystemProgressToast { //<--to be removed?
- id: post_delprog
- progress: -1
- body: qsTr("Deleting post, please wait")
- state: SystemUiProgressState.Active
- },
</del><span class="cx"> SystemDialog {
</span><span class="cx"> property string ptitle
</span><span class="cx"> property string pid
</span><span class="lines">@@ -94,12 +100,13 @@
</span><span class="cx"> cancelButton.enabled: true
</span><span class="cx"> onFinished: {
</span><span class="cx"> var x = result;
</span><del>- console.log(post_delDialog.error);
</del><span class="cx"> if (x == SystemUiResult.ConfirmButtonSelection) {
</span><span class="cx"> post_ci_pl.body = "Deleting post \"" + ptitle + "\" \nPlease wait...";
</span><span class="cx"> post_ci_pl.open();
</span><del>- wpu.deletePost(pid);
- wpu.dataReady_delPost.connect(post_plp.post_onDataReady);
</del><ins>+ wpu.deletePost(post_plp.post_showpage,pid);
+ if ( post_plp.post_showpage )
+ wpu.dataReady_delPage.connect(post_plp.post_onDataReady);
+ else wpu.dataReady_delPost.connect(post_plp.post_onDataReady);
</ins><span class="cx"> } else if (x == SystemUiResult.CancelButtonSelection) {
</span><span class="cx"> console.log("cancel");
</span><span class="cx"> }
</span></span></pre></div>
<a id="2013b0unc3trunkassetsshowPostqml"></a>
<div class="modfile"><h4>Modified: 2013/b0unc3/trunk/assets/showPost.qml (2378 => 2379)</h4>
<pre class="diff"><span>
<span class="info">--- 2013/b0unc3/trunk/assets/showPost.qml 2013-09-23 20:49:20 UTC (rev 2378)
+++ 2013/b0unc3/trunk/assets/showPost.qml 2013-09-24 17:30:45 UTC (rev 2379)
</span><span class="lines">@@ -14,12 +14,14 @@
</span><span class="cx"> property alias sp_apostid: sp.sp_postid
</span><span class="cx"> property variant sp_myObj
</span><span class="cx">
</span><del>- property bool post_show_page: false
</del><ins>+ property bool post_show_page;
</ins><span class="cx"> property bool show_img: false
</span><span class="cx">
</span><span class="cx"> onSp_postidChanged: {
</span><del>- wpu.getPost(sp.sp_postid);
- wpu.dataReady_getPost.connect(sp.sp_onDataReady);
</del><ins>+ wpu.getPost(sp.post_show_page, sp.sp_postid);
+ if ( sp.post_show_page )
+ wpu.dataReady_getPage.connect(sp.sp_onDataReady);
+ else wpu.dataReady_getPost.connect(sp.sp_onDataReady);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> function sp_onDataReady() {
</span></span></pre>
</div>
</div>
</body>
</html>