Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
KDE Pim
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Unmaintained
KDE Pim
Commits
88450880
Commit
88450880
authored
Oct 05, 2014
by
Laurent Montel
😁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
astyle-kdelibs
parent
a1e0090f
Changes
59
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
59 changed files
with
2550 additions
and
2592 deletions
+2550
-2592
blogilo/src/addeditblog.cpp
blogilo/src/addeditblog.cpp
+262
-259
blogilo/src/addeditblog.h
blogilo/src/addeditblog.h
+14
-15
blogilo/src/backend.cpp
blogilo/src/backend.cpp
+211
-212
blogilo/src/backend.h
blogilo/src/backend.h
+28
-30
blogilo/src/bilboblog.cpp
blogilo/src/bilboblog.cpp
+64
-65
blogilo/src/bilboblog.h
blogilo/src/bilboblog.h
+13
-14
blogilo/src/bilbomedia.cpp
blogilo/src/bilbomedia.cpp
+17
-19
blogilo/src/bilbomedia.h
blogilo/src/bilbomedia.h
+10
-11
blogilo/src/bilbopost.cpp
blogilo/src/bilbopost.cpp
+49
-50
blogilo/src/bilbopost.h
blogilo/src/bilbopost.h
+10
-12
blogilo/src/blog_p.h
blogilo/src/blog_p.h
+5
-4
blogilo/src/blogger.cpp
blogilo/src/blogger.cpp
+36
-51
blogilo/src/blogger.h
blogilo/src/blogger.h
+12
-15
blogilo/src/blogsettings.cpp
blogilo/src/blogsettings.cpp
+49
-49
blogilo/src/blogsettings.h
blogilo/src/blogsettings.h
+8
-9
blogilo/src/catcheckbox.cpp
blogilo/src/catcheckbox.cpp
+6
-11
blogilo/src/catcheckbox.h
blogilo/src/catcheckbox.h
+4
-5
blogilo/src/category.h
blogilo/src/category.h
+0
-1
blogilo/src/composer/bilbobrowser.cpp
blogilo/src/composer/bilbobrowser.cpp
+54
-55
blogilo/src/composer/bilbobrowser.h
blogilo/src/composer/bilbobrowser.h
+7
-8
blogilo/src/composer/blogilocomposereditor.cpp
blogilo/src/composer/blogilocomposereditor.cpp
+62
-66
blogilo/src/composer/blogilocomposereditor.h
blogilo/src/composer/blogilocomposereditor.h
+5
-5
blogilo/src/composer/blogilocomposerview.cpp
blogilo/src/composer/blogilocomposerview.cpp
+8
-9
blogilo/src/composer/blogilocomposerview.h
blogilo/src/composer/blogilocomposerview.h
+3
-2
blogilo/src/composer/blogilocomposerwidget.cpp
blogilo/src/composer/blogilocomposerwidget.cpp
+2
-1
blogilo/src/composer/blogilocomposerwidget.h
blogilo/src/composer/blogilocomposerwidget.h
+1
-1
blogilo/src/composer/htmleditor.cpp
blogilo/src/composer/htmleditor.cpp
+33
-35
blogilo/src/composer/htmleditor.h
blogilo/src/composer/htmleditor.h
+7
-8
blogilo/src/composer/stylegetter.cpp
blogilo/src/composer/stylegetter.cpp
+83
-87
blogilo/src/composer/stylegetter.h
blogilo/src/composer/stylegetter.h
+11
-14
blogilo/src/configuredialog.cpp
blogilo/src/configuredialog.cpp
+21
-22
blogilo/src/configuredialog.h
blogilo/src/configuredialog.h
+4
-5
blogilo/src/configurestorageservicewidget.cpp
blogilo/src/configurestorageservicewidget.cpp
+4
-5
blogilo/src/configurestorageservicewidget.h
blogilo/src/configurestorageservicewidget.h
+4
-3
blogilo/src/constants.h
blogilo/src/constants.h
+0
-2
blogilo/src/dbman.cpp
blogilo/src/dbman.cpp
+580
-581
blogilo/src/dbman.h
blogilo/src/dbman.h
+39
-40
blogilo/src/entriescountdialog.cpp
blogilo/src/entriescountdialog.cpp
+6
-7
blogilo/src/entriescountdialog.h
blogilo/src/entriescountdialog.h
+1
-2
blogilo/src/global.cpp
blogilo/src/global.cpp
+0
-1
blogilo/src/global.h
blogilo/src/global.h
+0
-1
blogilo/src/main.cpp
blogilo/src/main.cpp
+12
-14
blogilo/src/mainwindow.cpp
blogilo/src/mainwindow.cpp
+241
-232
blogilo/src/mainwindow.h
blogilo/src/mainwindow.h
+22
-22
blogilo/src/postentry.cpp
blogilo/src/postentry.cpp
+137
-135
blogilo/src/postentry.h
blogilo/src/postentry.h
+20
-21
blogilo/src/poststabwidget.cpp
blogilo/src/poststabwidget.cpp
+32
-30
blogilo/src/poststabwidget.h
blogilo/src/poststabwidget.h
+1
-1
blogilo/src/sendtoblogdialog.cpp
blogilo/src/sendtoblogdialog.cpp
+12
-12
blogilo/src/sendtoblogdialog.h
blogilo/src/sendtoblogdialog.h
+2
-3
blogilo/src/storageservice/storageservicemanagersettingsjob.h
...ilo/src/storageservice/storageservicemanagersettingsjob.h
+1
-1
blogilo/src/syncuploader.cpp
blogilo/src/syncuploader.cpp
+16
-16
blogilo/src/syncuploader.h
blogilo/src/syncuploader.h
+6
-7
blogilo/src/toolbox.cpp
blogilo/src/toolbox.cpp
+227
-212
blogilo/src/toolbox.h
blogilo/src/toolbox.h
+19
-21
blogilo/src/uploadmediadialog.cpp
blogilo/src/uploadmediadialog.cpp
+51
-51
blogilo/src/uploadmediadialog.h
blogilo/src/uploadmediadialog.h
+6
-7
blogilo/src/waitwidget.cpp
blogilo/src/waitwidget.cpp
+9
-11
blogilo/src/waitwidget.h
blogilo/src/waitwidget.h
+3
-4
No files found.
blogilo/src/addeditblog.cpp
View file @
88450880
This diff is collapsed.
Click to expand it.
blogilo/src/addeditblog.h
View file @
88450880
...
...
@@ -12,7 +12,6 @@
by the membership of KDE e.V.), which shall act as a proxy
defined in Section 14 of version 3 of the license.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
...
...
@@ -49,40 +48,40 @@ public:
* @param blog_id id of blog we will edit it, for adding a blog this should be "-1"
* @param parent Parent
*/
explicit
AddEditBlog
(
int
blog_id
,
QWidget
*
parent
=
0
,
Qt
::
WindowFlags
flags
=
0
);
explicit
AddEditBlog
(
int
blog_id
,
QWidget
*
parent
=
0
,
Qt
::
WindowFlags
flags
=
0
);
~
AddEditBlog
();
protected
Q_SLOTS
:
virtual
void
slotButtonClicked
(
int
button
);
virtual
void
slotButtonClicked
(
int
button
);
void
enableAutoConfBtn
();
void
enableOkButton
(
const
QString
&
);
void
enableOkButton
(
const
QString
&
);
void
autoConfigure
();
void
fetchBlogId
();
void
fetchedBlogId
(
const
QList
<
QMap
<
QString
,
QString
>
>&
list
);
void
fetchedBlogId
(
const
QList
<
QMap
<
QString
,
QString
>
>
&
list
);
void
handleFetchIDTimeout
();
void
handleFetchAPITimeout
();
void
handleFetchError
(
KBlog
::
Blog
::
ErrorType
type
,
const
QString
&
errorMsg
);
void
handleFetchError
(
KBlog
::
Blog
::
ErrorType
type
,
const
QString
&
errorMsg
);
void
slotReturnPressed
();
void
setSupportedFeatures
(
BilboBlog
::
ApiType
api
);
void
slotComboApiChanged
(
int
index
);
void
setSupportedFeatures
(
BilboBlog
::
ApiType
api
);
void
slotComboApiChanged
(
int
index
);
void
gotHtml
(
KJob
*
);
void
gotXmlRpcTest
(
KJob
*
job
);
void
gotHtml
(
KJob
*
);
void
gotXmlRpcTest
(
KJob
*
job
);
void
bloggerAuthenticated
(
const
QMap
<
QString
,
QString
>&
authData
);
void
bloggerAuthenticated
(
const
QMap
<
QString
,
QString
>
&
authData
);
Q_SIGNALS:
void
sigBlogAdded
(
const
BilboBlog
&
);
void
sigBlogEdited
(
const
BilboBlog
&
);
void
sigBlogAdded
(
const
BilboBlog
&
);
void
sigBlogEdited
(
const
BilboBlog
&
);
private:
void
showWaitWidget
(
QString
text
);
void
showWaitWidget
(
QString
text
);
void
hideWaitWidget
();
class
Private
;
Private
*
const
d
;
Private
*
const
d
;
};
#endif
blogilo/src/backend.cpp
View file @
88450880
This diff is collapsed.
Click to expand it.
blogilo/src/backend.h
View file @
88450880
...
...
@@ -12,7 +12,6 @@
by the membership of KDE e.V.), which shall act as a proxy
defined in Section 14 of version 3 of the license.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
...
...
@@ -33,7 +32,6 @@
#include <QObject>
#include <QMap>
class
BilboMedia
;
/**
Engine of application.
...
...
@@ -46,7 +44,7 @@ class Backend : public QObject
{
Q_OBJECT
public:
explicit
Backend
(
int
blog_id
,
QObject
*
parent
=
0
);
explicit
Backend
(
int
blog_id
,
QObject
*
parent
=
0
);
~
Backend
();
...
...
@@ -62,32 +60,32 @@ public:
* retrieve latest posts from server
* @param count number of post to retrieve.
*/
void
getEntriesListFromServer
(
int
count
);
void
getEntriesListFromServer
(
int
count
);
/**
* Use this to publish a post to server.
* @param post Post to publish.
*/
void
publishPost
(
BilboPost
*
post
);
void
publishPost
(
BilboPost
*
post
);
/**
* Upload a new Media object e.g. image to server.
* @param media Media Object to upload.
*/
void
uploadMedia
(
BilboMedia
*
media
);
void
uploadMedia
(
BilboMedia
*
media
);
/**
* Modify an existing post.
* Note: posiId must sets correctly.
* @param post post to modify.
*/
void
modifyPost
(
BilboPost
*
post
);
void
modifyPost
(
BilboPost
*
post
);
/**
* Remove an existing post from server
* @param post post to remove.
*/
void
removePost
(
BilboPost
*
post
);
void
removePost
(
BilboPost
*
post
);
// void setPostCategories( const QString postId, const QMap<QString, bool> &categoriesList );
...
...
@@ -99,73 +97,73 @@ public:
* @param post a blog post with the ID identifying the blog post to fetch.
* @see sigPostFetched()
*/
void
fetchPost
(
BilboPost
*
post
);
void
fetchPost
(
BilboPost
*
post
);
protected
Q_SLOTS
:
void
categoriesListed
(
const
QList
<
QMap
<
QString
,
QString
>
>
&
categories
);
void
entriesListed
(
const
QList
<
KBlog
::
BlogPost
>
&
posts
);
void
postPublished
(
KBlog
::
BlogPost
*
post
);
void
mediaUploaded
(
KBlog
::
BlogMedia
*
media
);
void
error
(
KBlog
::
Blog
::
ErrorType
type
,
const
QString
&
errorMessage
);
void
slotMediaError
(
KBlog
::
Blog
::
ErrorType
type
,
const
QString
&
errorMessage
,
KBlog
::
BlogMedia
*
media
);
void
categoriesListed
(
const
QList
<
QMap
<
QString
,
QString
>
>
&
categories
);
void
entriesListed
(
const
QList
<
KBlog
::
BlogPost
>
&
posts
);
void
postPublished
(
KBlog
::
BlogPost
*
post
);
void
mediaUploaded
(
KBlog
::
BlogMedia
*
media
);
void
error
(
KBlog
::
Blog
::
ErrorType
type
,
const
QString
&
errorMessage
);
void
slotMediaError
(
KBlog
::
Blog
::
ErrorType
type
,
const
QString
&
errorMessage
,
KBlog
::
BlogMedia
*
media
);
// void postCategoriesSetted( const QString &postId );
void
slotPostRemoved
(
KBlog
::
BlogPost
*
post
);
void
slotPostFetched
(
KBlog
::
BlogPost
*
post
);
void
slotPostRemoved
(
KBlog
::
BlogPost
*
post
);
void
slotPostFetched
(
KBlog
::
BlogPost
*
post
);
/**
* This function is called after a post published fine, to insert it to DB and emit sigPostPublished.
*/
void
savePostInDbAndEmitResult
(
KBlog
::
BlogPost
*
post
);
void
savePostInDbAndEmitResult
(
KBlog
::
BlogPost
*
post
);
void
bloggerAuthenticated
(
const
QMap
<
QString
,
QString
>&
authData
);
void
bloggerAuthenticated
(
const
QMap
<
QString
,
QString
>
&
authData
);
Q_SIGNALS:
/**
* emit when a categoriesListed() Done and Categories added to DB
* @param blog_id id of Blog owner of categories.
*/
void
sigCategoryListFetched
(
int
blog_id
);
void
sigCategoryListFetched
(
int
blog_id
);
/**
* emit when a entriesListed() Done and Entries added to DB
* @param blog_id id of Blog owner of Entries.
*/
void
sigEntriesListFetched
(
int
blog_id
);
void
sigEntriesListFetched
(
int
blog_id
);
/**
* This signal is emitted when a post published/modified and added/edited to Database.
* @param blog_id blog id.
* @param post The post has been saved.
*/
void
sigPostPublished
(
int
blog_id
,
BilboPost
*
post
);
void
sigPostPublished
(
int
blog_id
,
BilboPost
*
post
);
/**
* This signal is emitted when a media has been uploaded to the server.
* @param media Uploaded media Object.
*/
void
sigMediaUploaded
(
BilboMedia
*
media
);
void
sigMediaUploaded
(
BilboMedia
*
media
);
/**
* this signal is emitted when a post removed successfully.
*/
void
sigPostRemoved
(
int
blog_id
,
const
BilboPost
&
post
);
void
sigPostRemoved
(
int
blog_id
,
const
BilboPost
&
post
);
void
sigPostFetched
(
BilboPost
*
post
);
void
sigPostFetched
(
BilboPost
*
post
);
/**
* this signal emitted when an error occurred on current transaction.
* @param type type of error
* @param errorMessage error message.
*/
void
sigError
(
const
QString
&
errorMessage
);
void
sigError
(
const
QString
&
errorMessage
);
void
sigMediaError
(
const
QString
&
errorMessage
,
BilboMedia
*
media
);
void
sigMediaError
(
const
QString
&
errorMessage
,
BilboMedia
*
media
);
private:
KBlog
::
BlogPost
*
preparePost
(
KBlog
::
BlogPost
*
post
);
QString
errorTypeToString
(
KBlog
::
Blog
::
ErrorType
type
);
KBlog
::
BlogPost
*
preparePost
(
KBlog
::
BlogPost
*
post
);
QString
errorTypeToString
(
KBlog
::
Blog
::
ErrorType
type
);
class
Private
;
Private
*
const
d
;
Private
*
const
d
;
};
#endif
blogilo/src/bilboblog.cpp
View file @
88450880
...
...
@@ -12,7 +12,6 @@
by the membership of KDE e.V.), which shall act as a proxy
defined in Section 14 of version 3 of the license.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
...
...
@@ -29,12 +28,11 @@
#include <QApplication>
class
BilboBlog
::
Private
{
public:
Private
()
:
kblog
(
0
)
:
kblog
(
0
)
{}
KUrl
mUrl
;
QString
mBlogUrl
;
...
...
@@ -53,15 +51,15 @@ public:
QMap
<
QString
,
QString
>
mAuthData
;
};
BilboBlog
::
BilboBlog
(
QObject
*
parent
)
:
QObject
(
parent
),
d
(
new
Private
)
BilboBlog
::
BilboBlog
(
QObject
*
parent
)
:
QObject
(
parent
),
d
(
new
Private
)
{
d
->
mError
=
false
;
setApi
(
BLOGGER1_API
);
}
BilboBlog
::
BilboBlog
(
const
BilboBlog
&
blog
)
:
QObject
(
qApp
),
d
(
new
Private
)
BilboBlog
::
BilboBlog
(
const
BilboBlog
&
blog
)
:
QObject
(
qApp
),
d
(
new
Private
)
{
d
->
mUrl
=
blog
.
url
();
d
->
mBlogUrl
=
blog
.
blogUrl
();
...
...
@@ -69,7 +67,7 @@ BilboBlog::BilboBlog( const BilboBlog &blog)
d
->
mUsername
=
blog
.
username
();
d
->
mPassword
=
blog
.
password
();
d
->
mTitle
=
blog
.
title
();
setApi
(
blog
.
api
()
);
setApi
(
blog
.
api
()
);
d
->
mId
=
blog
.
id
();
d
->
mDir
=
blog
.
direction
();
d
->
mLocalDirectory
=
blog
.
localDirectory
();
...
...
@@ -81,32 +79,32 @@ BilboBlog::~BilboBlog()
delete
d
;
}
KBlog
::
Blog
*
BilboBlog
::
blogBackend
()
KBlog
::
Blog
*
BilboBlog
::
blogBackend
()
{
if
(
!
d
->
kblog
)
{
switch
(
api
()
)
{
if
(
!
d
->
kblog
)
{
switch
(
api
()
)
{
case
BilboBlog
::
BLOGGER1_API
:
d
->
kblog
=
new
KBlog
::
Blogger1
(
url
(),
this
);
d
->
kblog
=
new
KBlog
::
Blogger1
(
url
(),
this
);
break
;
case
BilboBlog
::
METAWEBLOG_API
:
d
->
kblog
=
new
KBlog
::
MetaWeblog
(
url
(),
this
);
d
->
kblog
=
new
KBlog
::
MetaWeblog
(
url
(),
this
);
break
;
case
BilboBlog
::
MOVABLETYPE_API
:
d
->
kblog
=
new
KBlog
::
MovableType
(
url
(),
this
);
d
->
kblog
=
new
KBlog
::
MovableType
(
url
(),
this
);
break
;
case
BilboBlog
::
WORDPRESSBUGGY_API
:
d
->
kblog
=
new
KBlog
::
WordpressBuggy
(
url
(),
this
);
d
->
kblog
=
new
KBlog
::
WordpressBuggy
(
url
(),
this
);
break
;
case
BilboBlog
::
BLOGGER_API
:
d
->
kblog
=
new
KBlog
::
Blogger
(
url
(),
this
);
qobject_cast
<
KBlog
::
Blogger
*>
(
d
->
kblog
)
->
setApiKey
(
QLatin1String
(
"508396175529-icqp62q8t6st41gjv1du100fol6renq4.apps.googleusercontent.com"
)
);
qobject_cast
<
KBlog
::
Blogger
*>
(
d
->
kblog
)
->
setSecretKey
(
QLatin1String
(
"JFPDXYmGIuM601vhgVGv0Dlx"
)
);
d
->
kblog
=
new
KBlog
::
Blogger
(
url
(),
this
);
qobject_cast
<
KBlog
::
Blogger
*>
(
d
->
kblog
)
->
setApiKey
(
QLatin1String
(
"508396175529-icqp62q8t6st41gjv1du100fol6renq4.apps.googleusercontent.com"
)
);
qobject_cast
<
KBlog
::
Blogger
*>
(
d
->
kblog
)
->
setSecretKey
(
QLatin1String
(
"JFPDXYmGIuM601vhgVGv0Dlx"
)
);
break
;
}
d
->
kblog
->
setUserAgent
(
QLatin1String
(
APPNAME
),
QLatin1String
(
VERSION
)
);
d
->
kblog
->
setUsername
(
username
()
);
d
->
kblog
->
setPassword
(
password
()
);
d
->
kblog
->
setBlogId
(
blogid
()
);
d
->
kblog
->
setUserAgent
(
QLatin1String
(
APPNAME
),
QLatin1String
(
VERSION
)
);
d
->
kblog
->
setUsername
(
username
()
);
d
->
kblog
->
setPassword
(
password
()
);
d
->
kblog
->
setBlogId
(
blogid
()
);
}
return
d
->
kblog
;
}
...
...
@@ -126,7 +124,7 @@ KUrl BilboBlog::url() const
return
d
->
mUrl
;
}
void
BilboBlog
::
setUrl
(
const
KUrl
&
url
)
void
BilboBlog
::
setUrl
(
const
KUrl
&
url
)
{
d
->
mUrl
=
url
;
}
...
...
@@ -136,7 +134,7 @@ QString BilboBlog::blogid() const
return
d
->
mBlogid
;
}
void
BilboBlog
::
setBlogId
(
const
QString
&
url
)
void
BilboBlog
::
setBlogId
(
const
QString
&
url
)
{
d
->
mBlogid
=
url
;
}
...
...
@@ -146,7 +144,7 @@ QString BilboBlog::username() const
return
d
->
mUsername
;
}
void
BilboBlog
::
setUsername
(
const
QString
&
username
)
void
BilboBlog
::
setUsername
(
const
QString
&
username
)
{
d
->
mUsername
=
username
;
}
...
...
@@ -156,7 +154,7 @@ QString BilboBlog::password() const
return
d
->
mPassword
;
}
void
BilboBlog
::
setPassword
(
const
QString
&
password
)
void
BilboBlog
::
setPassword
(
const
QString
&
password
)
{
d
->
mPassword
=
password
;
}
...
...
@@ -166,7 +164,7 @@ QString BilboBlog::title() const
return
d
->
mTitle
;
}
void
BilboBlog
::
setTitle
(
const
QString
&
title
)
void
BilboBlog
::
setTitle
(
const
QString
&
title
)
{
d
->
mTitle
=
title
;
}
...
...
@@ -176,40 +174,40 @@ BilboBlog::ApiType BilboBlog::api() const
return
d
->
mApi
;
}
void
BilboBlog
::
setApi
(
const
ApiType
api
)
void
BilboBlog
::
setApi
(
const
ApiType
api
)
{
d
->
mApi
=
api
;
switch
(
api
)
{
case
BLOGGER1_API
:
d
->
mSupportedFeatures
[
QLatin1String
(
"uploadMedia"
)]
=
false
;
d
->
mSupportedFeatures
[
QLatin1String
(
"category"
)]
=
false
;
d
->
mSupportedFeatures
[
QLatin1String
(
"tag"
)]
=
false
;
break
;
case
METAWEBLOG_API
:
d
->
mSupportedFeatures
[
QLatin1String
(
"uploadMedia"
)]
=
true
;
d
->
mSupportedFeatures
[
QLatin1String
(
"category"
)]
=
true
;
d
->
mSupportedFeatures
[
QLatin1String
(
"tag"
)]
=
false
;
break
;
case
MOVABLETYPE_API
:
d
->
mSupportedFeatures
[
QLatin1String
(
"uploadMedia"
)]
=
true
;
d
->
mSupportedFeatures
[
QLatin1String
(
"category"
)]
=
true
;
d
->
mSupportedFeatures
[
QLatin1String
(
"tag"
)]
=
true
;
break
;
case
WORDPRESSBUGGY_API
:
d
->
mSupportedFeatures
[
QLatin1String
(
"uploadMedia"
)]
=
true
;
d
->
mSupportedFeatures
[
QLatin1String
(
"category"
)]
=
true
;
d
->
mSupportedFeatures
[
QLatin1String
(
"tag"
)]
=
true
;
break
;
case
BLOGGER_API
:
d
->
mSupportedFeatures
[
QLatin1String
(
"uploadMedia"
)]
=
false
;
d
->
mSupportedFeatures
[
QLatin1String
(
"category"
)]
=
false
;
d
->
mSupportedFeatures
[
QLatin1String
(
"tag"
)]
=
true
;
break
;
default:
d
->
mSupportedFeatures
[
QLatin1String
(
"uploadMedia"
)]
=
false
;
d
->
mSupportedFeatures
[
QLatin1String
(
"category"
)]
=
false
;
d
->
mSupportedFeatures
[
QLatin1String
(
"tag"
)]
=
false
;
break
;
switch
(
api
)
{
case
BLOGGER1_API
:
d
->
mSupportedFeatures
[
QLatin1String
(
"uploadMedia"
)]
=
false
;
d
->
mSupportedFeatures
[
QLatin1String
(
"category"
)]
=
false
;
d
->
mSupportedFeatures
[
QLatin1String
(
"tag"
)]
=
false
;
break
;
case
METAWEBLOG_API
:
d
->
mSupportedFeatures
[
QLatin1String
(
"uploadMedia"
)]
=
true
;
d
->
mSupportedFeatures
[
QLatin1String
(
"category"
)]
=
true
;
d
->
mSupportedFeatures
[
QLatin1String
(
"tag"
)]
=
false
;
break
;
case
MOVABLETYPE_API
:
d
->
mSupportedFeatures
[
QLatin1String
(
"uploadMedia"
)]
=
true
;
d
->
mSupportedFeatures
[
QLatin1String
(
"category"
)]
=
true
;
d
->
mSupportedFeatures
[
QLatin1String
(
"tag"
)]
=
true
;
break
;
case
WORDPRESSBUGGY_API
:
d
->
mSupportedFeatures
[
QLatin1String
(
"uploadMedia"
)]
=
true
;
d
->
mSupportedFeatures
[
QLatin1String
(
"category"
)]
=
true
;
d
->
mSupportedFeatures
[
QLatin1String
(
"tag"
)]
=
true
;
break
;
case
BLOGGER_API
:
d
->
mSupportedFeatures
[
QLatin1String
(
"uploadMedia"
)]
=
false
;
d
->
mSupportedFeatures
[
QLatin1String
(
"category"
)]
=
false
;
d
->
mSupportedFeatures
[
QLatin1String
(
"tag"
)]
=
true
;
break
;
default:
d
->
mSupportedFeatures
[
QLatin1String
(
"uploadMedia"
)]
=
false
;
d
->
mSupportedFeatures
[
QLatin1String
(
"category"
)]
=
false
;
d
->
mSupportedFeatures
[
QLatin1String
(
"tag"
)]
=
false
;
break
;
}
}
...
...
@@ -218,7 +216,7 @@ int BilboBlog::id() const
return
d
->
mId
;
}
void
BilboBlog
::
setId
(
const
int
id
)
void
BilboBlog
::
setId
(
const
int
id
)
{
d
->
mId
=
id
;
}
...
...
@@ -228,7 +226,7 @@ Qt::LayoutDirection BilboBlog::direction() const
return
d
->
mDir
;
}
void
BilboBlog
::
setDirection
(
const
Qt
::
LayoutDirection
dir
)
void
BilboBlog
::
setDirection
(
const
Qt
::
LayoutDirection
dir
)
{
d
->
mDir
=
dir
;
}
...
...
@@ -238,17 +236,18 @@ QString BilboBlog::localDirectory() const
return
d
->
mLocalDirectory
;
}
void
BilboBlog
::
setLocalDirectory
(
const
QString
&
directory
)
void
BilboBlog
::
setLocalDirectory
(
const
QString
&
directory
)
{
d
->
mLocalDirectory
=
directory
;
}
QString
BilboBlog
::
blogUrl
()
const
{
if
(
d
->
mBlogUrl
.
isEmpty
())
if
(
d
->
mBlogUrl
.
isEmpty
())
{
return
d
->
mUrl
.
prettyUrl
();
else
}
else
{
return
d
->
mBlogUrl
;
}
}
void
BilboBlog
::
setBlogUrl
(
const
QString
&
blogUrl
)
...
...
@@ -271,7 +270,7 @@ bool BilboBlog::supportTag() const
return
d
->
mSupportedFeatures
[
QLatin1String
(
"tag"
)];
}
void
BilboBlog
::
setAuthData
(
const
QMap
<
QString
,
QString
>&
authData
)
void
BilboBlog
::
setAuthData
(
const
QMap
<
QString
,
QString
>
&
authData
)
{
d
->
mAuthData
=
authData
;
}
...
...
blogilo/src/bilboblog.h
View file @
88450880
...
...
@@ -12,7 +12,6 @@
by the membership of KDE e.V.), which shall act as a proxy
defined in Section 14 of version 3 of the license.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
...
...
@@ -45,8 +44,8 @@ public:
BLOGGER1_API
=
0
,
METAWEBLOG_API
,
MOVABLETYPE_API
,
WORDPRESSBUGGY_API
,
BLOGGER_API
};
explicit
BilboBlog
(
QObject
*
parent
=
0
);
BilboBlog
(
const
BilboBlog
&
);
explicit
BilboBlog
(
QObject
*
parent
=
0
);
BilboBlog
(
const
BilboBlog
&
);
~
BilboBlog
();
KBlog
::
Blog
*
blogBackend
();
...
...
@@ -58,27 +57,27 @@ public:
* @return url usable for xmlrpc!
*/
KUrl
url
()
const
;
void
setUrl
(
const
KUrl
&
);
void
setUrl
(
const
KUrl
&
);
QString
blogid
()
const
;
void
setBlogId
(
const
QString
&
);
void
setBlogId
(
const
QString
&
);
QString
username
()
const
;
void
setUsername
(
const
QString
&
);
void
setUsername
(
const
QString
&
);
QString
password
()
const
;
void
setPassword
(
const
QString
&
);
void
setPassword
(
const
QString
&
);
QString
title
()
const
;
void
setTitle
(
const
QString
&
);
void
setAuthData
(
const
QMap
<
QString
,
QString
>
&
authData
);
void
setTitle
(
const
QString
&
);
void
setAuthData
(
const
QMap
<
QString
,
QString
>
&
authData
);
QMap
<
QString
,
QString
>
authData
()
const
;
// QString stylePath() const;
// void setStylePath( const QString& );
ApiType
api
()
const
;
void
setApi
(
const
ApiType
);
void
setApi
(
const
ApiType
);
int
id
()
const
;
//id in DB
void
setId
(
const
int
);
void
setId
(
const
int
);
Qt
::
LayoutDirection
direction
()
const
;
void
setDirection
(
const
Qt
::
LayoutDirection
);
void
setDirection
(
const
Qt
::
LayoutDirection
);
QString
localDirectory
()
const
;
void
setLocalDirectory
(
const
QString
&
);
void
setLocalDirectory
(
const
QString
&
);
bool
isError
()
const
;
void
setError
(
bool
isError
);
...
...
@@ -98,7 +97,7 @@ public:
private:
class
Private
;
Private
*
const
d
;
Private
*
const
d
;
};
#endif
blogilo/src/bilbomedia.cpp
View file @
88450880
...
...
@@ -12,7 +12,6 @@
by the membership of KDE e.V.), which shall act as a proxy
defined in Section 14 of version 3 of the license.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
...
...
@@ -49,8 +48,8 @@ public:
QString
mName
;
quint16
mChecksum
;
};
BilboMedia
::
BilboMedia
(
QObject
*
parent
)
:
QObject
(
parent
),
d
(
new
Private
)
BilboMedia
::
BilboMedia
(
QObject
*
parent
)
:
QObject
(
parent
),
d
(
new
Private
)
{
d
->
mChecksum
=
0
;
}
...
...
@@ -65,8 +64,7 @@ int BilboMedia::blogId() const
return
d
->
mBlogId
;
}
void
BilboMedia
::
setBlogId
(
const
int
blog_id
)
void
BilboMedia
::
setBlogId
(
const
int
blog_id
)
{
d
->
mBlogId
=
blog_id
;
}
...
...
@@ -76,7 +74,7 @@ int BilboMedia::mediaId() const
return
d
->
mMediaId
;
}
void
BilboMedia
::
setMediaId
(
const
int
media_id
)
void
BilboMedia
::
setMediaId
(
const
int
media_id
)
{
d
->
mMediaId
=
media_id
;
}
...
...
@@ -86,7 +84,7 @@ bool BilboMedia::isUploaded() const
return
d
->
mIsUploaded
;
}
void
BilboMedia
::
setUploaded
(
bool
uploaded
)
void
BilboMedia
::
setUploaded
(
bool
uploaded
)
{
d
->
mIsUploaded
=
uploaded
;
}
...
...
@@ -96,7 +94,7 @@ KUrl BilboMedia::localUrl() const
return
d
->
mLocalUrl
;
}
void
BilboMedia
::
setLocalUrl
(
const
KUrl
&
url
)
void
BilboMedia
::
setLocalUrl
(
const
KUrl
&
url
)
{
d
->
mLocalUrl
=
url
;
}
...
...
@@ -106,7 +104,7 @@ KUrl BilboMedia::remoteUrl() const