[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdepim/blogilo/src
From: Mehrdad Momeny <mehrdad.momeny () gmail ! com>
Date: 2010-11-05 11:34:57
Message-ID: 20101105113457.E7FD5AC89B () svn ! kde ! org
[Download RAW message or body]
SVN commit 1193272 by momeny:
split tag fix
M +3 -1 backend.cpp
M +5 -1 dbman.cpp
M +4 -4 postentry.cpp
--- trunk/KDE/kdepim/blogilo/src/backend.cpp #1193271:1193272
@@ -42,6 +42,8 @@
#include <kio/job.h>
#include <settings.h>
+const QRegExp splitRX("((<hr>)?<!--split-->)");
+
class Backend::Private
{
public:
@@ -465,7 +467,7 @@
//post.setContent( post.content().remove('\n') );
//post.setAdditionalContent( post.additionalContent().remove( '\n' ) );
if ( d->bBlog->api() == BilboBlog::MOVABLETYPE_API || d->bBlog->api() == \
BilboBlog::WORDPRESSBUGGY_API ) {
- QStringList content = post->content().split("<!--split-->");
+ QStringList content = post->content().split(splitRX);
if( content.count() == 2 ) {
post->setContent(content[0]);
post->setAdditionalContent( content[1] );
--- trunk/KDE/kdepim/blogilo/src/dbman.cpp #1193271:1193272
@@ -648,8 +648,10 @@
}
int postId = -1, localId=-1;
if(post.status() == KBlog::BlogPost::New) {///Post is new!
+ kDebug()<<"Post is new!";
if(post.id() == -1){
///Add new post to temp_post
+ kDebug()<<"Add new post to temp_post";
q.prepare( "INSERT OR REPLACE INTO "+ postTable +" (postid, blog_id, \
author, title, content,\
text_more, c_time, m_time, is_private, is_comment_allowed, \
is_trackback_allowed, link, perma_link,\
summary, slug, tags, status) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, \
?, ?, ?, ?, ?)" ); @@ -680,6 +682,7 @@
}
} else {
///Update post, with id!
+ kDebug()<<"Update post, with id!";
q.prepare( "INSERT OR REPLACE INTO "+ postTable +" (local_id, postid, \
blog_id, author, title,\
content, text_more, c_time, m_time, is_private, is_comment_allowed, \
is_trackback_allowed, link,\ perma_link, summary, slug, tags, status)\
@@ -712,6 +715,7 @@
}
}
} else {///Post is already created at "Post" table and has a valid id, postId \
and blog_id. So, local_id is useless here + kDebug()<<"Post is already created \
at \"Post\" table and has a valid id, postId and blog_id. So, local_id is useless \
here";
q.prepare( "INSERT OR REPLACE INTO "+ postTable +" (id, postid, blog_id, \
author, title,\ content, text_more, c_time, m_time, is_private,\
is_comment_allowed, is_trackback_allowed, link, perma_link, summary, slug, \
tags, status)\ @@ -810,7 +814,7 @@
bool DBMan::removeTempEntry( const BilboPost &post )
{
- kDebug();
+ kDebug()<<post.toString();
QSqlQuery q;
if(post.status() == KBlog::BlogPost::New) {
q.prepare( "DELETE FROM temp_post WHERE local_id=?" );
--- trunk/KDE/kdepim/blogilo/src/postentry.cpp #1193271:1193272
@@ -153,12 +153,12 @@
if(additionalContent.isEmpty()) {
body = content;
} else {
- body = content + "</p><!--split--><p>" + additionalContent;
+ body = content + "<hr><!--split-->" + additionalContent;
d->mCurrentPost.setAdditionalContent(QString());
}
- if(body.isEmpty()){
- body = "<p></p>";//This is because of Bug #387578
- }
+// if(body.isEmpty()){
+// body = "<p></p>";//This is because of Bug #387578
+// }
d->mCurrentPost.setContent( body );
d->editPostWidget->setHtmlContent( body );
d->isPostContentModified = false;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic