• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepim API Reference
  • KDE Home
  • Contact Us
 

blogilo

  • sources
  • kde-4.12
  • kdepim
  • blogilo
  • src
backend.cpp
Go to the documentation of this file.
1 /*
2  This file is part of Blogilo, A KDE Blogging Client
3 
4  Copyright (C) 2008-2010 Mehrdad Momeny <mehrdad.momeny@gmail.com>
5  Copyright (C) 2008-2010 Golnaz Nilieh <g382nilieh@gmail.com>
6 
7  This program is free software; you can redistribute it and/or
8  modify it under the terms of the GNU General Public License as
9  published by the Free Software Foundation; either version 2 of
10  the License or (at your option) version 3 or any later version
11  accepted by the membership of KDE e.V. (or its successor approved
12  by the membership of KDE e.V.), which shall act as a proxy
13  defined in Section 14 of version 3 of the license.
14 
15 
16  This program is distributed in the hope that it will be useful,
17  but WITHOUT ANY WARRANTY; without even the implied warranty of
18  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  GNU General Public License for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with this program; if not, see http://www.gnu.org/licenses/
23 */
24 
25 #include "backend.h"
26 #include "bilboblog.h"
27 #include "bilbopost.h"
28 #include "bilbomedia.h"
29 #include "dbman.h"
30 #include "settings.h"
31 
32 #include <kurl.h>
33 #include <kblog/blogger1.h>
34 #include <kblog/gdata.h>
35 #include <kblog/metaweblog.h>
36 #include <kblog/movabletype.h>
37 #include <kblog/wordpressbuggy.h>
38 #include <kblog/blogmedia.h>
39 #include <kdebug.h>
40 #include <KDE/KLocale>
41 
42 #include <kio/netaccess.h>
43 #include <kio/job.h>
44 
45 const QRegExp splitRX(QLatin1String("((<hr/?>)?<!--split-->)"));
46 
47 class Backend::Private
48 {
49 public:
50  Private()
51  :kBlog(0), bBlog(0), categoryListNotSet(false)
52  {}
53  KBlog::Blog *kBlog;
54  BilboBlog *bBlog;
55  QList<Category> mCreatePostCategories;
56  QMap<QString, KBlog::BlogPost *> mSetPostCategoriesMap;
57  QMap<KBlog::BlogPost *, BilboPost::Status> mSubmitPostStatusMap;
58  QMap<KBlog::BlogMedia *, BilboMedia *> mPublishMediaMap;
59  bool categoryListNotSet;
60 };
61 
62 Backend::Backend( int blog_id, QObject* parent )
63  : QObject( parent ), d(new Private)
64 {
65  kDebug() << "with blog id: " << blog_id;
66  d->bBlog = DBMan::self()->blog( blog_id );
67  d->kBlog = d->bBlog->blogBackend();
68 
69  connect( d->kBlog, SIGNAL(error(KBlog::Blog::ErrorType,QString)),
70  this, SLOT(error(KBlog::Blog::ErrorType,QString)) );
71  connect( d->kBlog, SIGNAL(errorPost(KBlog::Blog::ErrorType,QString,KBlog::BlogPost*)),
72  this, SLOT(error(KBlog::Blog::ErrorType,QString)) );
73  connect( d->kBlog, SIGNAL( errorComment( KBlog::Blog::ErrorType, const QString &, KBlog::BlogPost*,
74  KBlog::BlogComment* ) ),
75  this, SLOT(error(KBlog::Blog::ErrorType,QString)) );
76  connect( d->kBlog, SIGNAL(errorMedia(KBlog::Blog::ErrorType,QString,KBlog::BlogMedia*)),
77  this, SLOT(error(KBlog::Blog::ErrorType,QString)) );
78 }
79 
80 Backend::~Backend()
81 {
82  kDebug();
83  delete d;
84 }
85 
86 void Backend::getCategoryListFromServer()
87 {
88  kDebug() << "Blog Id: " << d->bBlog->id();
89  if ( d->bBlog->api() == BilboBlog::METAWEBLOG_API ||
90  d->bBlog->api() == BilboBlog::MOVABLETYPE_API ||
91  d->bBlog->api() == BilboBlog::WORDPRESSBUGGY_API ) {
92  KBlog::MetaWeblog *tmp = static_cast<KBlog::MetaWeblog*>( d->kBlog );
93  connect( tmp, SIGNAL(listedCategories(QList<QMap<QString,QString> >)),
94  this, SLOT(categoriesListed(QList<QMap<QString,QString> >)) );
95  tmp->listCategories();
96  } else {
97  error( KBlog::Blog::NotSupported, i18n( "Blog API doesn't support getting Category list." ) );
98  }
99 }
100 
101 void Backend::categoriesListed( const QList< QMap < QString , QString > > & categories )
102 {
103  kDebug() << "Blog Id: " << d->bBlog->id();
104  DBMan::self()->clearCategories( d->bBlog->id() );
105 
106  const int categoriesCount(categories.count());
107  for ( int i = 0; i < categoriesCount; ++i ) {
108  const QMap<QString, QString> &category = categories.at( i );
109 
110  const QString name = category.value( QLatin1String("name"), QString() );
111  const QString description = category.value( QLatin1String("description"), QString() );
112  const QString htmlUrl = category.value( QLatin1String("htmlUrl"), QString() );
113  const QString rssUrl = category.value( QLatin1String("rssUrl"), QString() );
114  QString categoryId = category.value( QLatin1String("categoryId"), QString() );
115  const QString parentId = category.value( QLatin1String("parentId"), QString() );
116 
117  if(categoryId.isEmpty()) {
118  categoryId = QString::number(i);
119  }
120 
121  DBMan::self()->addCategory( name, description, htmlUrl, rssUrl, categoryId, parentId, d->bBlog->id() );
122  }
123  kDebug() << "Emitting sigCategoryListFetched...";
124  Q_EMIT sigCategoryListFetched( d->bBlog->id() );
125 }
126 
127 void Backend::getEntriesListFromServer( int count )
128 {
129  kDebug() << "Blog Id: " << d->bBlog->id();
130  connect( d->kBlog, SIGNAL(listedRecentPosts(QList<KBlog::BlogPost>)),
131  this, SLOT(entriesListed(QList<KBlog::BlogPost>)) );
132  d->kBlog->listRecentPosts( count );
133 }
134 
135 void Backend::entriesListed( const QList< KBlog::BlogPost > & posts )
136 {
137  kDebug() << "Blog Id: " << d->bBlog->id();
138 // DBMan::self()->clearPosts( d->bBlog->id() );
139 
140  const int postCount(posts.count());
141  for ( int i = 0; i < postCount; ++i ) {
142  BilboPost tempPost( posts.at(i) );
143  if(Settings::changeNToBreak()) {
144  tempPost.setContent( tempPost.content().replace( QLatin1Char('\n'), QLatin1String("<br/>") ) );
145  tempPost.setAdditionalContent( tempPost.additionalContent().replace( QLatin1Char('\n'), QLatin1String("<br/>") ) );
146  }
147  DBMan::self()->addPost( tempPost, d->bBlog->id() );
148  }
149  kDebug() << "Emitting sigEntriesListFetched ...";
150  Q_EMIT sigEntriesListFetched( d->bBlog->id() );
151 }
152 
153 void Backend::publishPost( BilboPost* post )
154 {
155  kDebug() << "Blog Id: " << d->bBlog->id();
156 // BilboPost tmpPost = post;
157  if( Settings::addPoweredBy() ) {
158  QString poweredStr = QLatin1String("<p>=-=-=-=-=<br/>"
159  "<i>Powered by <b><a href='http://blogilo.gnufolks.org/'>Blogilo</a></b></i></p>");
160  post->setContent(post->content() + poweredStr);
161  }
162  preparePost( post );
163  connect( d->kBlog, SIGNAL(createdPost(KBlog::BlogPost*)),
164  this, SLOT(postPublished(KBlog::BlogPost*)) );
165  d->kBlog->createPost( post );
166 }
167 
168 void Backend::postPublished( KBlog::BlogPost *post )
169 {
170  kDebug() << "Blog Id: " << d->bBlog->id();
171  if ( post->status() == KBlog::BlogPost::Error ) {
172  kDebug() << "Publishing/Modifying Failed";
173  const QString tmp( i18n( "Publishing/Modifying post failed: %1", post->error() ) );
174  kDebug() << "Emitting sigError...";
175  Q_EMIT sigError( tmp );
176  return;
177  }
178  kDebug()<<"isPrivate: "<<post->isPrivate();
179  if(post->isPrivate() && d->bBlog->api() == BilboBlog::GDATA_API){
180  //GData do not support fetching drafts!
181  savePostInDbAndEmitResult(post);
182  return;
183  }
184  d->mSubmitPostStatusMap[ post ] = post->status();
185  connect( d->kBlog, SIGNAL(fetchedPost(KBlog::BlogPost*)),
186  this, SLOT(savePostInDbAndEmitResult(KBlog::BlogPost*)) );
187  d->kBlog->fetchPost( post );
188 }
189 
190 void Backend::uploadMedia( BilboMedia * media )
191 {
192  kDebug() << "Blog Id: " << d->bBlog->id();
193  QString tmp;
194  switch ( d->bBlog->api() ) {
195  case BilboBlog::BLOGGER1_API:
196  case BilboBlog::GDATA_API:
197  kDebug() << "The Blogger1 and GData API type doesn't support uploading Media files.";
198  tmp = i18n( "Uploading media failed: Your Blog API does not support uploading media objects.");
199  kDebug() << "Emitting sigError...";
200  Q_EMIT sigMediaError( tmp, media );
201  return;
202  case BilboBlog::METAWEBLOG_API:
203  case BilboBlog::MOVABLETYPE_API:
204  case BilboBlog::WORDPRESSBUGGY_API:
205  KBlog::BlogMedia *m = new KBlog::BlogMedia() ;
206  KBlog::MetaWeblog *MWBlog = qobject_cast<KBlog::MetaWeblog*>( d->kBlog );
207 
208  m->setMimetype( media->mimeType() );
209 
210  QByteArray data;
211  KIO::TransferJob *job = KIO::get( media->localUrl(), KIO::Reload, KIO::HideProgressInfo);
212  if( !KIO::NetAccess::synchronousRun(job, 0, &data) ){
213  kError()<<"Job error: " << job->errorString();
214  tmp = i18n( "Uploading media failed: Cannot read the media file, please check if it exists. Path: %1", media->localUrl().pathOrUrl() );
215  kDebug() << "Emitting sigError...";
216  Q_EMIT sigMediaError( tmp, media );
217  }
218 
219  if ( data.count() == 0 ) {
220  kError() << "Cannot read the media file, please check if it exists.";
221  tmp = i18n( "Uploading media failed: Cannot read the media file, please check if it exists. Path: %1", media->localUrl().pathOrUrl() );
222  kDebug() << "Emitting sigError...";
223  Q_EMIT sigMediaError( tmp, media );
224  delete m;
225  return;
226  }
227 
228  m->setData( data );
229  m->setName( media->name() );
230 
231  media->setCheckSum( qChecksum( data.data(), data.count() ) );
232 
233  if ( media->checksum() == 0 ) {
234  kError() << "Media file checksum is zero";
235  tmp = i18n( "Uploading media failed: Media file checksum is zero, please check file path. Path: %1",
236  media->localUrl().pathOrUrl() );
237  kDebug() << "Emitting sigError...";
238  Q_EMIT sigMediaError( tmp, media );
239  delete m;
240  return;
241  }
242 
243  if ( !MWBlog ) {
244  kError() << "MWBlog is NULL: casting has not worked, this should NEVER happen, has the gui allowed using GDATA?";
245  tmp = i18n( "INTERNAL ERROR: MWBlog is NULL: casting has not worked, this should NEVER happen." );
246  kDebug() << "Emitting sigError...";
247  Q_EMIT sigError( tmp );
248  delete m;
249  return;
250  }
251  d->mPublishMediaMap[ m ] = media;
252  connect( MWBlog, SIGNAL(createdMedia(KBlog::BlogMedia*)), this, SLOT(mediaUploaded(KBlog::BlogMedia*)) );
253  connect( MWBlog, SIGNAL(errorMedia(KBlog::Blog::ErrorType,QString,KBlog::BlogMedia*)),
254  this, SLOT(slotMediaError(KBlog::Blog::ErrorType,QString,KBlog::BlogMedia*)) );
255  MWBlog->createMedia( m );
256  return;
257  }
258  kError() << "Api type isn't set correctly!";
259  tmp = i18n( "API type is not set correctly." );
260  Q_EMIT sigError( tmp );
261 }
262 
263 void Backend::mediaUploaded( KBlog::BlogMedia * media )
264 {
265  kDebug() << "Blog Id: " << d->bBlog->id() << "Media: "<<media->url();
266  if(!media){
267  kError()<<"ERROR! Media returned from KBlog is NULL!";
268  return;
269  }
270  BilboMedia * m = d->mPublishMediaMap.value( media );
271  if(!m){
272  kError()<<"ERROR! Media returned from KBlog doesn't exist on the Map! Url is:"
273  << media->url();
274  return;
275  }
276  d->mPublishMediaMap.remove( media );
277  if ( media->status() == KBlog::BlogMedia::Error ) {
278  kError() << "Upload error! with this message: " << media->error();
279  const QString tmp( i18n( "Uploading media failed: %1", media->error() ) );
280  kDebug() << "Emitting sigMediaError ...";
281  Q_EMIT sigMediaError( tmp, m );
282  return;
283  }
284  quint16 newChecksum = qChecksum( media->data().data(), media->data().count() );
285  if ( newChecksum != m->checksum() ) {
286  kError() << "Check sum error: checksum of sent file: " << m->checksum() <<
287  " Checksum of received file: " << newChecksum << "Error: " << media->error() << endl;
288  const QString tmp( i18n( "Uploading media failed: Checksum error. Returned error: %1",
289  media->error() ) );
290  kDebug() << "Emitting sigMediaError ...";
291  Q_EMIT sigMediaError( tmp, m );
292  return;
293  }
294  m->setRemoteUrl( QUrl( media->url().url() ).toString() );
295  m->setUploaded( true );
296  kDebug() << "Emitting sigMediaUploaded...";
297  Q_EMIT sigMediaUploaded( m );
298 }
299 
300 void Backend::modifyPost( BilboPost* post )
301 {
302  kDebug() << "Blog Id: " << d->bBlog->id();
303 // BilboPost tmpPost = post;
304  preparePost( post );
305  connect( d->kBlog, SIGNAL(modifiedPost(KBlog::BlogPost*)),
306  this, SLOT(postPublished(KBlog::BlogPost*)) );
307  d->kBlog->modifyPost( post );
308 }
309 
310 void Backend::removePost( BilboPost* post )
311 {
312  kDebug() << "Blog Id: " << d->bBlog->id();
313 
314 // KBlog::BlogPost *bp = post.toKBlogPost();
315  connect( d->kBlog, SIGNAL(removedPost(KBlog::BlogPost*)),
316  this, SLOT(slotPostRemoved(KBlog::BlogPost*)) );
317  d->kBlog->removePost( post );
318 }
319 
320 void Backend::slotPostRemoved( KBlog::BlogPost *post )
321 {
322  if(!post) {
323  kDebug()<<"post returned from server is NULL";
324  return;
325  }
326  if( !DBMan::self()->removePost(d->bBlog->id(), post->postId()) ) {
327  kDebug()<<"cannot remove post from database, error: "<<DBMan::self()->lastErrorText();
328  }
329  emit sigPostRemoved(d->bBlog->id(), BilboPost(*post));
330 }
331 
332 void Backend::fetchPost( BilboPost* post )
333 {
334 // KBlog::BlogPost *bp = post.toKBlogPost();
335  connect( d->kBlog, SIGNAL(fetchedPost(KBlog::BlogPost*)),
336  this, SLOT(slotPostFetched(KBlog::BlogPost*)) );
337  d->kBlog->fetchPost( post );
338 }
339 
340 void Backend::slotPostFetched( KBlog::BlogPost *post )
341 {
342  emit sigPostFetched( new BilboPost(*post) );
343 // delete post;
344 }
345 
346 void Backend::error( KBlog::Blog::ErrorType type, const QString & errorMessage )
347 {
348  kDebug() << "Blog Id: " << d->bBlog->id();
349  QString errType = errorTypeToString( type );
350  errType += errorMessage;
351  kDebug() << errType;
352  kDebug() << "Emitting sigError";
353  Q_EMIT sigError( errType );
354 }
355 
356 void Backend::slotMediaError( KBlog::Blog::ErrorType type, const QString & errorMessage,
357  KBlog::BlogMedia * media )
358 {
359  kDebug();
360  QString errType = errorTypeToString( type );
361  errType += errorMessage;
362  kDebug() << errType;
363  kDebug() << "Emitting sigMediaError ...";
364  emit sigMediaError( errorMessage, d->mPublishMediaMap[ media ] );
365  d->mPublishMediaMap.remove( media );
366 }
367 
368 QString Backend::errorTypeToString( KBlog::Blog::ErrorType type )
369 {
370  QString errType;
371  switch ( type ) {
372  case KBlog::Blog::XmlRpc:
373  errType = i18n( "Server (XMLRPC) error: " );
374  break;
375  case KBlog::Blog::Atom:
376  errType = i18n( "Server (Atom) error: " );
377  break;
378  case KBlog::Blog::ParsingError:
379  errType = i18n( "Parsing error: " );
380  break;
381  case KBlog::Blog::AuthenticationError:
382  errType = i18n( "Authentication error: " );
383  break;
384  case KBlog::Blog::NotSupported:
385  errType = i18n( "Not supported error: " );
386  break;
387  default:
388  errType = i18n( "Unknown error: " );
389  };
390  return errType;
391 }
392 
393 void Backend::savePostInDbAndEmitResult( KBlog::BlogPost *post )
394 {
395  if(!post) {
396  kError()<<"ERROR: post is NULL ";
397  Q_EMIT sigError( i18n("post is NULL") );
398  return;
399  }
400  kDebug()<<"isPrivate: "<<post->isPrivate();
401  BilboPost *pp = new BilboPost( *post );
402  int post_id;
403  if( d->mSubmitPostStatusMap[ post ] == KBlog::BlogPost::Modified) {
404  post_id = DBMan::self()->editPost( *pp, d->bBlog->id() );
405  } else {
406  post_id = DBMan::self()->addPost( *pp, d->bBlog->id() );
407  }
408  d->mSubmitPostStatusMap.remove(post);
409  if ( post_id != -1 ) {
410  pp->setPrivate( post->isPrivate() );
411  pp->setId( post_id );
412  kDebug() << "Emitting sigPostPublished ...";
413  Q_EMIT sigPostPublished( d->bBlog->id(), pp );
414  }
415  // TODO crashes stylegetter on GData. Somehow the post gets deleted before
416  // slotFetchedPost as it seems. Don't get all the pointer copies done here.
417  //delete post;
418 }
419 
420 KBlog::BlogPost* Backend::preparePost( KBlog::BlogPost* post )
421 {
422  QString content = post->content();
423  QString html1;
424  int i = 0;
425  int found = content.indexOf(QLatin1String("<pre>"), i, Qt::CaseInsensitive);
426  while ( found != -1 )
427  {
428  html1 += content.mid( i, found-i).remove(QLatin1Char('\n'));
429  i = found;
430  found = content.indexOf(QLatin1String("</pre>"), i, Qt::CaseInsensitive);
431  if ( found != -1 ) {
432  html1 += content.mid( i, found+5-i);
433  i = found + 5;
434  found = content.indexOf(QLatin1String("<pre>"), i, Qt::CaseInsensitive);
435  } else {
436  html1 += content.mid( i, content.length()-i );
437  i = -1;
438  }
439  }
440  if ( i != -1 )
441  html1 += content.mid( i, content.length()-i).remove(QLatin1Char('\n'));
442  post->setContent( html1 );
443 
444  content = post->additionalContent();
445  QString html2 = QString();
446  i= 0;
447  found = content.indexOf(QLatin1String("<pre>"), i, Qt::CaseInsensitive);
448  while ( found != -1 )
449  {
450  html2 += content.mid( i, found-i).remove(QLatin1Char('\n'));
451  i = found;
452  found = content.indexOf(QLatin1String("</pre>"), i, Qt::CaseInsensitive);
453  if ( found != -1 ) {
454  html2 += content.mid( i, found+5-i);
455  i = found + 5;
456  found = content.indexOf(QLatin1String("<pre>"), i, Qt::CaseInsensitive);
457  } else {
458  html2 += content.mid( i, content.length()-i );
459  i = -1;
460  }
461  }
462  if ( i != -1 )
463  html2 += content.mid( i, content.length()-i).remove(QLatin1Char('\n'));
464  post->setAdditionalContent( html2 );
465 
466  //the following two lines are replaced by the above code, because '\n' characters shouldn't
467  //be omitted inside <pre> blocks.
468 
469  //post.setContent( post.content().remove('\n') );
470  //post.setAdditionalContent( post.additionalContent().remove( '\n' ) );
471  if ( d->bBlog->api() == BilboBlog::MOVABLETYPE_API || d->bBlog->api() == BilboBlog::WORDPRESSBUGGY_API ) {
472  QStringList content = post->content().split(splitRX);
473  if( content.count() == 2 ) {
474  post->setContent(content.at(0));
475  post->setAdditionalContent( content.at(1) );
476  }
477  }
478  // if( d->bBlog->api() == BilboBlog::MOVABLETYPE_API && post.categoryList().count() > 0 ) {
479  // mCreatePostCategories = post.categoryList();
480  // categoryListNotSet = true;
481  // }
482  return post;//.toKBlogPost();
483 }
484 
485 #include "backend.moc"
DBMan::clearCategories
bool clearCategories(int blog_id)
Definition: dbman.cpp:559
BilboBlog::METAWEBLOG_API
Definition: bilboblog.h:45
Backend::postPublished
void postPublished(KBlog::BlogPost *post)
Definition: backend.cpp:168
Backend::slotPostFetched
void slotPostFetched(KBlog::BlogPost *post)
Definition: backend.cpp:340
BilboMedia::setCheckSum
void setCheckSum(quint16 sum)
Definition: bilbomedia.cpp:160
DBMan::lastErrorText
QString lastErrorText() const
Definition: dbman.cpp:100
Backend::publishPost
void publishPost(BilboPost *post)
Use this to publish a post to server.
Definition: backend.cpp:153
Backend::sigCategoryListFetched
void sigCategoryListFetched(int blog_id)
emit when a categoriesListed() Done and Categories added to DB
DBMan::self
static DBMan * self()
Retrieve the instance of DataBase Manager.
Definition: dbman.cpp:107
BilboMedia::name
QString name() const
Definition: bilbomedia.cpp:125
BilboPost
Definition of a blog post! it's implemented to decrease dependency to KBlog :)
Definition: bilbopost.h:41
QObject
Backend::sigError
void sigError(const QString &errorMessage)
this signal emitted when an error occurred on current transaction.
Backend::sigMediaError
void sigMediaError(const QString &errorMessage, BilboMedia *media)
DBMan::blog
BilboBlog * blog(int blog_id)
QString as Title, and int as blog_id.
Definition: dbman.cpp:851
BilboBlog::WORDPRESSBUGGY_API
Definition: bilboblog.h:45
bilbopost.h
BilboMedia::setRemoteUrl
void setRemoteUrl(const KUrl &url)
Definition: bilbomedia.cpp:110
Backend::error
void error(KBlog::Blog::ErrorType type, const QString &errorMessage)
Definition: backend.cpp:346
Backend::fetchPost
void fetchPost(BilboPost *post)
Fetch a blog post from the server with a specific ID.
Definition: backend.cpp:332
BilboBlog
Blog definition class!
Definition: bilboblog.h:40
Backend::slotPostRemoved
void slotPostRemoved(KBlog::BlogPost *post)
Definition: backend.cpp:320
Backend::sigEntriesListFetched
void sigEntriesListFetched(int blog_id)
emit when a entriesListed() Done and Entries added to DB
DBMan::addCategory
int addCategory(const QString &name, const QString &description, const QString &htmlUrl, const QString &rssUrl, const QString &categoryId, const QString &parentId, int blog_id)
Category:
Definition: dbman.cpp:537
Backend::removePost
void removePost(BilboPost *post)
Remove an existing post from server.
Definition: backend.cpp:310
splitRX
const QRegExp splitRX(QLatin1String("((<hr/?>)?<!--split-->)"))
Backend::sigPostFetched
void sigPostFetched(BilboPost *post)
bilbomedia.h
BilboBlog::GDATA_API
Definition: bilboblog.h:45
Settings::addPoweredBy
static bool addPoweredBy()
Get addPoweredBy.
Definition: settings.h:127
BilboPost::setId
void setId(const int)
Definition: bilbopost.cpp:82
BilboMedia::setUploaded
void setUploaded(bool uploaded)
Definition: bilbomedia.cpp:90
bilboblog.h
Backend::mediaUploaded
void mediaUploaded(KBlog::BlogMedia *media)
Definition: backend.cpp:263
Backend::modifyPost
void modifyPost(BilboPost *post)
Modify an existing post.
Definition: backend.cpp:300
Backend::getEntriesListFromServer
void getEntriesListFromServer(int count)
retrieve latest posts from server
Definition: backend.cpp:127
DBMan::editPost
bool editPost(const BilboPost &post, int blog_id)
Definition: dbman.cpp:431
Backend::uploadMedia
void uploadMedia(BilboMedia *media)
Upload a new Media object e.g.
Definition: backend.cpp:190
BilboMedia::localUrl
KUrl localUrl() const
Definition: bilbomedia.cpp:95
BilboMedia
Definition: bilbomedia.h:38
dbman.h
DBMan::addPost
int addPost(const BilboPost &post, int blog_id)
Post:
Definition: dbman.cpp:364
BilboMedia::checksum
quint16 checksum() const
Definition: bilbomedia.cpp:155
BilboMedia::mimeType
QString mimeType() const
Definition: bilbomedia.cpp:115
settings.h
Backend::slotMediaError
void slotMediaError(KBlog::Blog::ErrorType type, const QString &errorMessage, KBlog::BlogMedia *media)
Definition: backend.cpp:356
Settings::changeNToBreak
static bool changeNToBreak()
Get changeNToBreak.
Definition: settings.h:167
description
static const char description[]
Definition: main.cpp:33
Backend::getCategoryListFromServer
void getCategoryListFromServer()
Request to Fetch categories list from server.
Definition: backend.cpp:86
Backend::savePostInDbAndEmitResult
void savePostInDbAndEmitResult(KBlog::BlogPost *post)
This function is called after a post published fine, to insert it to DB and emit sigPostPublished.
Definition: backend.cpp:393
Backend::sigMediaUploaded
void sigMediaUploaded(BilboMedia *media)
This signal is emitted when a media has been uploaded to the server.
Backend::sigPostRemoved
void sigPostRemoved(int blog_id, const BilboPost &post)
this signal is emitted when a post removed successfully.
BilboBlog::BLOGGER1_API
Definition: bilboblog.h:45
backend.h
Backend::entriesListed
void entriesListed(const QList< KBlog::BlogPost > &posts)
Definition: backend.cpp:135
Backend::Backend
Backend(int blog_id, QObject *parent=0)
Definition: backend.cpp:62
BilboBlog::MOVABLETYPE_API
Definition: bilboblog.h:45
Backend::~Backend
~Backend()
Definition: backend.cpp:80
Backend::sigPostPublished
void sigPostPublished(int blog_id, BilboPost *post)
This signal is emitted when a post published/modified and added/edited to Database.
Backend::categoriesListed
void categoriesListed(const QList< QMap< QString, QString > > &categories)
Definition: backend.cpp:101
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:55:44 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

blogilo

Skip menu "blogilo"
  • Main Page
  • Namespace List
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal