26 #include <kdatetime.h>
28 #include <QStringList>
30 class BilboPostPrivate
36 bool mModifyTimeStamp;
37 QList<Category> mCategoryList;
41 : KBlog::BlogPost(), d_ptr(new BilboPostPrivate)
43 this->setCreationDateTime( KDateTime::currentLocalDateTime() );
44 this->setModificationDateTime( KDateTime::currentLocalDateTime() );
45 this->setCommentAllowed(
true );
46 this->setPrivate(
false );
47 this->setTrackBackAllowed(
true );
48 d_ptr->mModifyTimeStamp =
false;
51 this->setStatus( KBlog::BlogPost::New );
55 : KBlog::BlogPost( post ), d_ptr(new BilboPostPrivate)
59 d_ptr->mModifyTimeStamp =
false;
63 : KBlog::BlogPost(post), d_ptr(new BilboPostPrivate)
79 return d_ptr->mAuthor;
99 return d_ptr->localId;
112 ret = QLatin1String(
"\n******* Post Info **********");
113 ret += QLatin1String(
"\nID: " ) + postId();
114 ret += QLatin1String(
"\nTitle: " ) + title();
115 ret += QLatin1String(
"\nContent: " ) + content();
116 ret += QLatin1String(
"\nAdditionalContent: ") + additionalContent();
117 ret += QLatin1String(
"\nTags: ") + tags().join( QLatin1String(
","));
118 ret += QLatin1String(
"\nCategories: ") + categories().join( QLatin1String(
",") );
119 ret += QLatin1String(
"\nCreation Date Time: ") + creationDateTime().toString();
120 ret += QLatin1String(
"\nStatus: ") + QString::number(status());
121 ret += QLatin1String(
"\nIsPrivate: ") + QVariant(isPrivate()).toString();
122 ret += QLatin1String(
"\n******* End Post Info ********\n");
128 return d_ptr->mModifyTimeStamp;
133 d_ptr->mModifyTimeStamp = isModify;
138 return d_ptr->mCategoryList;
143 d_ptr->mCategoryList = list;
145 const int count = list.count();
146 for (
int i = 0; i < count; ++i ) {
147 cats.append( list.at(i).name );
149 setCategories( cats );
155 this->setCreationDateTime( postProp.creationDateTime() );
156 this->setModificationDateTime( postProp.modificationDateTime() );
157 this->setLink( postProp.link() );
158 this->setPermaLink( postProp.permaLink() );
159 this->setCategories( postProp.categories() );
161 this->setCommentAllowed( postProp.isCommentAllowed() );
162 this->setTags( postProp.tags() );
163 this->setMood( postProp.mood() );
164 this->setMusic( postProp.music() );
165 this->setSummary( postProp.summary() );
166 this->setTrackBackAllowed( postProp.isTrackBackAllowed() );
169 this->setSlug( postProp.slug() );
174 KBlog::BlogPost other2 = KBlog::BlogPost::operator=(other);
void setAuthor(const QString &)
void setLocalId(const int)
Definition of a blog post! it's implemented to decrease dependency to KBlog :)
void setModifyTimeStamp(bool willModify)
void setProperties(const BilboPost &postProp)
Set all properties of post to new one, instead of Title and Content!
QList< Category > categoryList() const
BilboPost & operator=(const BilboPost &other)
The overloaed = operator.
bool isModifyTimeStamp() const
void setCategoryList(const QList< Category > &list)