aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Vrátil <[email protected]>2015-08-16 15:08:08 +0200
committerDan Vrátil <[email protected]>2015-08-16 15:15:49 +0200
commitfed3f49ccac779c8bfbde4e535589330cf717381 (patch)
tree3d83d83fb72c06c2a97678fa53c47ac40d2e7c21
parent576335a46f9402c1fa17216c5e9a18f28ad863b6 (diff)
Port away from KDateTime to QDateTime, remove KDELibs4Support
We still need KDateTime on one place to convert to/from KCalCore::Journal, once that is ported away from KDELibs4Support, KBlog will be free of it too.
-rw-r--r--CMakeLists.txt3
-rw-r--r--autotests/CMakeLists.txt5
-rw-r--r--autotests/data.h2
-rw-r--r--autotests/testblogcomment.cpp22
-rw-r--r--autotests/testblogger1.cpp16
-rw-r--r--autotests/testblogpost.cpp17
-rw-r--r--autotests/testgdata.cpp24
-rw-r--r--autotests/testlivejournal.cpp12
-rw-r--r--autotests/testmetaweblog.cpp20
-rw-r--r--autotests/testmovabletype.cpp20
-rw-r--r--autotests/testwordpressbuggy.cpp12
-rw-r--r--src/CMakeLists.txt3
-rw-r--r--src/blog.cpp9
-rw-r--r--src/blog.h6
-rw-r--r--src/blog_config.h.cmake1
-rw-r--r--src/blog_p.h5
-rw-r--r--src/blogcomment.cpp11
-rw-r--r--src/blogcomment.h10
-rw-r--r--src/blogcomment_p.h6
-rw-r--r--src/blogger1.cpp8
-rw-r--r--src/blogpost.cpp15
-rw-r--r--src/blogpost.h10
-rw-r--r--src/blogpost_p.h6
-rw-r--r--src/gdata.cpp67
-rw-r--r--src/gdata.h12
-rw-r--r--src/livejournal.cpp7
-rw-r--r--src/metaweblog.cpp15
-rw-r--r--src/movabletype.cpp13
-rw-r--r--src/wordpressbuggy.cpp6
29 files changed, 169 insertions, 194 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8ea3488..500c863 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -17,7 +17,7 @@ include(KDECMakeSettings)
include(KDEFrameworkCompilerSettings)
set(KF5_VERSION "5.12.0")
-set(KBLOG_LIB_VERSION "4.79.0")
+set(KBLOG_LIB_VERSION "4.80.0")
set(CALENDARCORE_LIB_VERSION "4.79.0")
set(SYNDICATION_LIB_VERSION "4.79.0")
set(XMLRPCCLIENT_LIB_VERSION "4.79.0")
@@ -28,7 +28,6 @@ ecm_setup_version(${KBLOG_LIB_VERSION} VARIABLE_PREFIX KBLOG
########### Find packages ###########
find_package(KF5CoreAddons ${KF5_VERSION} CONFIG REQUIRED)
-find_package(KF5KDELibs4Support ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5KIO ${KF5_VERSION} CONFIG REQUIRED)
find_package(Qt5WebKitWidgets ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE)
diff --git a/autotests/CMakeLists.txt b/autotests/CMakeLists.txt
index 0909342..6804215 100644
--- a/autotests/CMakeLists.txt
+++ b/autotests/CMakeLists.txt
@@ -4,7 +4,10 @@ find_package(Qt5Test CONFIG REQUIRED)
########### next target ###############
-ecm_add_tests( testblogcomment.cpp testblogger1.cpp testgdata.cpp testmetaweblog.cpp testmovabletype.cpp testwordpressbuggy.cpp testblogpost.cpp testblogmedia.cpp NAME_PREFIX "kblog-" LINK_LIBRARIES KF5Blog Qt5::Test)
+ecm_add_tests(testblogcomment.cpp testblogger1.cpp testgdata.cpp testmetaweblog.cpp testmovabletype.cpp testwordpressbuggy.cpp testblogpost.cpp testblogmedia.cpp
+ NAME_PREFIX "kblog-"
+ LINK_LIBRARIES KF5Blog Qt5::Test
+)
# ########### next target ###############
diff --git a/autotests/data.h b/autotests/data.h
index 19c3a1a..30335ab 100644
--- a/autotests/data.h
+++ b/autotests/data.h
@@ -25,7 +25,7 @@
#include <QtCore/QString>
#include <QtCore/QStringList>
#include <QUrl>
-#include <ktimezone.h>
+#include <QTimeZone>
#include <QtCore/QDateTime>
QUrl mUrl(QLatin1String("http://kblogunittests.wordpress.com/xmlrpc.php"));
diff --git a/autotests/testblogcomment.cpp b/autotests/testblogcomment.cpp
index 9256143..2baaba2 100644
--- a/autotests/testblogcomment.cpp
+++ b/autotests/testblogcomment.cpp
@@ -19,13 +19,13 @@
Boston, MA 02110-1301, USA.
*/
-#include <QtTest>
-#include <QtCore>
+#include <QtTest/QTest>
-#include <qtest.h>
#include "kblog/blogcomment.h"
-#include "qurl.h"
-#include "kdatetime.h"
+
+#include <QString>
+#include <QUrl>
+#include <QDateTime>
Q_DECLARE_METATYPE(KBlog::BlogComment::Status)
@@ -51,8 +51,8 @@ void testBlogComment::testValidity_data()
QTest::addColumn<QUrl>("url");
QTest::addColumn<BlogComment::Status>("status");
QTest::addColumn<QString>("error");
- QTest::addColumn<KDateTime>("creationDateTime");
- QTest::addColumn<KDateTime>("modificationDateTime");
+ QTest::addColumn<QDateTime>("creationDateTime");
+ QTest::addColumn<QDateTime>("modificationDateTime");
QTest::newRow("SimpleTest")
<< QString::fromLatin1("ABC123")
@@ -63,8 +63,8 @@ void testBlogComment::testValidity_data()
<< QUrl(QLatin1String("http://my.link/in/outer/space/fancy/ABC123"))
<< BlogComment::New
<< QString::fromLatin1("Error")
- << KDateTime(QDateTime::currentDateTime())
- << KDateTime(QDateTime::currentDateTime());
+ << QDateTime::currentDateTime()
+ << QDateTime::currentDateTime();
}
void testBlogComment::testValidity()
@@ -79,8 +79,8 @@ void testBlogComment::testValidity()
QFETCH(QUrl, url);
QFETCH(BlogComment::Status, status);
QFETCH(QString, error);
- QFETCH(KDateTime, creationDateTime);
- QFETCH(KDateTime, modificationDateTime);
+ QFETCH(QDateTime, creationDateTime);
+ QFETCH(QDateTime, modificationDateTime);
p.setCommentId(commentId);
p.setTitle(title);
diff --git a/autotests/testblogger1.cpp b/autotests/testblogger1.cpp
index 3a3389e..ef52c9c 100644
--- a/autotests/testblogger1.cpp
+++ b/autotests/testblogger1.cpp
@@ -27,8 +27,8 @@
#include <qtest.h>
#include <QTimer>
#include <unistd.h>
-#include <ktimezone.h>
-#include <kdatetime.h>
+#include <QDateTime>
+#include <QTimeZone>
#define TIMEOUT 10000
#define GLOBALTIMEOUT 70000
@@ -116,9 +116,9 @@ void TestBlogger1::dumpPost(const BlogPost *post)
break;
};
qDebug() << "# creationDateTime(UTC): "
- << post->creationDateTime().toUtc().toString();
+ << post->creationDateTime().toUTC().toString();
qDebug() << "# modificationDateTime(UTC): "
- << post->modificationDateTime().toUtc().toString();
+ << post->modificationDateTime().toUTC().toString();
qDebug() << "###########################";
}
@@ -307,7 +307,7 @@ void TestBlogger1::testValidity()
// no need to delete later ;-):
b = new Blogger1(QUrl(QLatin1String("http://wrong.url.org/somegateway")));
QVERIFY(b->url() == QUrl(QLatin1String("http://wrong.url.org/somegateway")));
- KTimeZone mTimeZone(KTimeZone(QLatin1String("UTC")));
+ QTimeZone mTimeZone("UTC");
b->setUrl(mUrl);
b->setUsername(mUsername);
b->setPassword(mPassword);
@@ -318,13 +318,13 @@ void TestBlogger1::testValidity()
QVERIFY(b->username() == mUsername);
QVERIFY(b->password() == mPassword);
QVERIFY(b->interfaceName() == QLatin1String("Blogger 1.0"));
- QVERIFY(b->timeZone().name() == mTimeZone.name());
+ QVERIFY(b->timeZone().id() == mTimeZone.id());
}
void TestBlogger1::testNetwork()
{
- KDateTime mCDateTime(mCreationDateTime);
- KDateTime mMDateTime(mModificationDateTime);
+ QDateTime mCDateTime(mCreationDateTime);
+ QDateTime mMDateTime(mModificationDateTime);
p = new BlogPost(); // no need to delete later ;-)
p->setTitle(mTitle);
p->setContent(mContent);
diff --git a/autotests/testblogpost.cpp b/autotests/testblogpost.cpp
index 8650b2c..decaaef 100644
--- a/autotests/testblogpost.cpp
+++ b/autotests/testblogpost.cpp
@@ -19,12 +19,9 @@
Boston, MA 02110-1301, USA.
*/
-#include <QtTest>
-#include <QtCore>
+#include <QTest>
-#include <qtest.h>
#include "kblog/blogpost.h"
-#include "kdatetime.h"
Q_DECLARE_METATYPE(KBlog::BlogPost::Status)
@@ -57,8 +54,8 @@ void testBlogPost::testValidity_data()
QTest::addColumn<QString>("mood");
QTest::addColumn<QString>("music");
QTest::addColumn<QStringList>("categories");
- QTest::addColumn<KDateTime>("creationDateTime");
- QTest::addColumn<KDateTime>("modificationDateTime");
+ QTest::addColumn<QDateTime>("creationDateTime");
+ QTest::addColumn<QDateTime>("modificationDateTime");
QTest::addColumn<BlogPost::Status>("status");
QTest::addColumn<QString>("error");
@@ -77,8 +74,8 @@ void testBlogPost::testValidity_data()
<< QStringList(QLatin1String("Tags")) //<< url
<< QString::fromLatin1("Mood") << QString::fromLatin1("Music")
<< QStringList(QLatin1String("Category"))
- << KDateTime(QDateTime::currentDateTime())
- << KDateTime(QDateTime::currentDateTime())
+ << QDateTime::currentDateTime()
+ << QDateTime::currentDateTime()
<< BlogPost::New
<< QString::fromLatin1("Error");
}
@@ -102,8 +99,8 @@ void testBlogPost::testValidity()
QFETCH(QString, mood);
QFETCH(QString, music);
QFETCH(QStringList, categories);
- QFETCH(KDateTime, creationDateTime);
- QFETCH(KDateTime, modificationDateTime);
+ QFETCH(QDateTime, creationDateTime);
+ QFETCH(QDateTime, modificationDateTime);
QFETCH(BlogPost::Status, status);
QFETCH(QString, error);
p.setPostId(postId);
diff --git a/autotests/testgdata.cpp b/autotests/testgdata.cpp
index 35ceecb..ee19fc1 100644
--- a/autotests/testgdata.cpp
+++ b/autotests/testgdata.cpp
@@ -25,12 +25,12 @@
#include "kblog/blogpost.h"
#include "kblog/blogcomment.h"
-#include <qtest.h>
+#include <QTest>
+#include <QTimer>
+#include <QDateTime>
+#include <QTimeZone>
#include <unistd.h>
-#include <ktimezone.h>
-#include <kdatetime.h>
-#include <QTimer>
#define TIMEOUT 10000
#define GLOBALTIMEOUT 70000
@@ -124,9 +124,9 @@ void TestGData::dumpPost(const BlogPost *post)
break;
};
qDebug() << "# creationDateTime(UTC): "
- << post->creationDateTime().toUtc().toString();
+ << post->creationDateTime().toUTC().toString();
qDebug() << "# modificationDateTime(UTC): "
- << post->modificationDateTime().toUtc().toString();
+ << post->modificationDateTime().toUTC().toString();
qDebug() << "###########################";
}
@@ -158,9 +158,9 @@ void TestGData::dumpComment(const BlogComment *comment)
break;
};
qDebug() << "# creationDateTime(UTC): "
- << comment->creationDateTime().toUtc().toString();
+ << comment->creationDateTime().toUTC().toString();
qDebug() << "# modificationDateTime(UTC): "
- << comment->modificationDateTime().toUtc().toString();
+ << comment->modificationDateTime().toUTC().toString();
qDebug() << "###########################";
}
@@ -388,7 +388,7 @@ void TestGData::testValidity()
b->setProfileId(QLatin1String("11235141638164909615"));
b->setPassword(QLatin1String("Wo ist Hans?"));
b->setBlogId(QLatin1String("4662848212819772532"));
- b->setTimeZone(KTimeZone(QLatin1String("UTC")));
+ b->setTimeZone(QTimeZone("UTC"));
QVERIFY(b->url() == QUrl(QLatin1String("http://blogger2test.blogspot.com")));
QVERIFY(b->blogId() == QLatin1String("4662848212819772532"));
QVERIFY(b->fullName() == QLatin1String("Santa Claus"));
@@ -396,13 +396,13 @@ void TestGData::testValidity()
QVERIFY(b->profileId() == QLatin1String("11235141638164909615"));
QVERIFY(b->password() == QLatin1String("Wo ist Hans?"));
QVERIFY(b->interfaceName() == QLatin1String("Google Blogger Data"));
- QVERIFY(b->timeZone().name() == QLatin1String("UTC"));
+ QVERIFY(b->timeZone().id() == "UTC");
}
void TestGData::testNetwork()
{
- KDateTime mCDateTime(mCreationDateTime);
- KDateTime mMDateTime(mModificationDateTime);
+ QDateTime mCDateTime(mCreationDateTime);
+ QDateTime mMDateTime(mModificationDateTime);
p = new BlogPost(); // no need to delete later ;-)
p->setTitle(mTitle);
p->setContent(mContent);
diff --git a/autotests/testlivejournal.cpp b/autotests/testlivejournal.cpp
index a022dae..3652b5b 100644
--- a/autotests/testlivejournal.cpp
+++ b/autotests/testlivejournal.cpp
@@ -24,11 +24,11 @@
#include "kblog/livejournal.h"
#include "kblog/blogpost.h"
-#include <qtest.h>
+#include <QTest>
+#include <QDateTime>
+#include <QTimeZone>
#include <unistd.h>
-#include <ktimezone.h>
-#include <kdatetime.h>
#define TIMEOUT 10000
#define GLOBALTIMEOUT 70000
@@ -288,7 +288,7 @@ void TestLiveJournal::testValidity()
// no need to delete later ;-):
b = new LiveJournal(QUrl("http://wrong.url.org/somegateway"));
QVERIFY(b->url() == QUrl("http://wrong.url.org/somegateway"));
- KTimeZone mTimeZone(KTimeZone("UTC"));
+ QTimeZone mTimeZone("UTC");
b->setUrl(mUrl);
b->setUsername(mUsername);
b->setPassword(mPassword);
@@ -304,8 +304,8 @@ void TestLiveJournal::testValidity()
void TestLiveJournal::testNetwork()
{
- KDateTime mCDateTime(mCreationDateTime);
- KDateTime mMDateTime(mModificationDateTime);
+ QDateTime mCDateTime(mCreationDateTime);
+ QDateTime mMDateTime(mModificationDateTime);
p = new BlogPost(); // no need to delete later ;-)
p->setTitle(mTitle);
p->setContent(mContent);
diff --git a/autotests/testmetaweblog.cpp b/autotests/testmetaweblog.cpp
index 8cb35c5..265fdcb 100644
--- a/autotests/testmetaweblog.cpp
+++ b/autotests/testmetaweblog.cpp
@@ -25,12 +25,12 @@
#include "kblog/blogpost.h"
#include "kblog/blogmedia.h"
-#include <qtest.h>
+#include <QTest>
+#include <QDateTime>
+#include <QTimeZone>
+#include <QTimer>
#include <unistd.h>
-#include <ktimezone.h>
-#include <kdatetime.h>
-#include <QTimer>
#define TIMEOUT 1000
#define GLOBALTIMEOUT 70000
@@ -121,9 +121,9 @@ void TestMetaWeblog::dumpPost(const BlogPost *post)
break;
};
qDebug() << "# creationDateTime(UTC): "
- << post->creationDateTime().toUtc().toString();
+ << post->creationDateTime().toUTC().toString();
qDebug() << "# modificationDateTime(UTC): "
- << post->modificationDateTime().toUtc().toString();
+ << post->modificationDateTime().toUTC().toString();
qDebug() << "###########################";
}
@@ -335,7 +335,7 @@ void TestMetaWeblog::testValidity()
// no need to delete later ;-):
b = new MetaWeblog(QUrl(QLatin1String("http://wrong.url.org/somegateway")));
QVERIFY(b->url() == QUrl(QLatin1String("http://wrong.url.org/somegateway")));
- KTimeZone mTimeZone(KTimeZone(QLatin1String("UTC")));
+ QTimeZone mTimeZone("UTC");
b->setUrl(mUrl);
b->setUsername(mUsername);
b->setPassword(mPassword);
@@ -346,13 +346,13 @@ void TestMetaWeblog::testValidity()
QVERIFY(b->username() == mUsername);
QVERIFY(b->password() == mPassword);
QVERIFY(b->interfaceName() == QLatin1String("MetaWeblog"));
- QVERIFY(b->timeZone().name() == mTimeZone.name());
+ QVERIFY(b->timeZone().id() == mTimeZone.id());
}
void TestMetaWeblog::testNetwork()
{
- KDateTime mCDateTime(mCreationDateTime);
- KDateTime mMDateTime(mModificationDateTime);
+ QDateTime mCDateTime(mCreationDateTime);
+ QDateTime mMDateTime(mModificationDateTime);
p = new BlogPost(); // no need to delete later ;-)
p->setTitle(mTitle);
p->setContent(mContent);
diff --git a/autotests/testmovabletype.cpp b/autotests/testmovabletype.cpp
index 894bc9c..22fb140 100644
--- a/autotests/testmovabletype.cpp
+++ b/autotests/testmovabletype.cpp
@@ -25,12 +25,12 @@
#include "kblog/blogpost.h"
#include "kblog/blogmedia.h"
-#include <qtest.h>
+#include <QTest>
+#include <QDateTime>
+#include <QTimeZone>
+#include <QTimer>
#include <unistd.h>
-#include <ktimezone.h>
-#include <kdatetime.h>
-#include <QTimer>
#define TIMEOUT 10000
#define GLOBALTIMEOUT 70000
@@ -127,9 +127,9 @@ void TestMovableType::dumpPost(const BlogPost *post)
break;
};
qDebug() << "# creationDateTime(UTC): "
- << post->creationDateTime().toUtc().toString();
+ << post->creationDateTime().toUTC().toString();
qDebug() << "# modificationDateTime(UTC): "
- << post->modificationDateTime().toUtc().toString();
+ << post->modificationDateTime().toUTC().toString();
qDebug() << "###########################";
}
@@ -341,7 +341,7 @@ void TestMovableType::testValidity()
// no need to delete later ;-):
b = new MovableType(QUrl(QLatin1String("http://wrong.url.org/somegateway")));
QVERIFY(b->url() == QUrl(QLatin1String("http://wrong.url.org/somegateway")));
- KTimeZone mTimeZone(KTimeZone(QLatin1String("UTC")));
+ QTimeZone mTimeZone("UTC");
b->setUrl(mUrl);
b->setUsername(mUsername);
b->setPassword(mPassword);
@@ -352,13 +352,13 @@ void TestMovableType::testValidity()
QVERIFY(b->username() == mUsername);
QVERIFY(b->password() == mPassword);
QVERIFY(b->interfaceName() == QLatin1String("Movable Type"));
- QVERIFY(b->timeZone().name() == mTimeZone.name());
+ QVERIFY(b->timeZone().id() == mTimeZone.id());
}
void TestMovableType::testNetwork()
{
- KDateTime mCDateTime(mCreationDateTime);
- KDateTime mMDateTime(mModificationDateTime);
+ QDateTime mCDateTime(mCreationDateTime);
+ QDateTime mMDateTime(mModificationDateTime);
p = new BlogPost(); // no need to delete later ;-)
p->setTitle(mTitle);
p->setContent(mContent);
diff --git a/autotests/testwordpressbuggy.cpp b/autotests/testwordpressbuggy.cpp
index 3c7cadf..426bede 100644
--- a/autotests/testwordpressbuggy.cpp
+++ b/autotests/testwordpressbuggy.cpp
@@ -126,9 +126,9 @@ void TestWordpressBuggy::dumpPost(const BlogPost *post)
break;
};
qDebug() << "# creationDateTime(UTC): "
- << post->creationDateTime().toUtc().toString();
+ << post->creationDateTime().toUTC().toString();
qDebug() << "# modificationDateTime(UTC): "
- << post->modificationDateTime().toUtc().toString();
+ << post->modificationDateTime().toUTC().toString();
qDebug() << "###########################";
}
@@ -340,7 +340,7 @@ void TestWordpressBuggy::testValidity()
// no need to delete later ;-):
b = new WordpressBuggy(QUrl(QLatin1String("http://wrong.url.org/somegateway")));
QVERIFY(b->url() == QUrl(QLatin1String("http://wrong.url.org/somegateway")));
- KTimeZone mTimeZone(KTimeZone(QLatin1String("UTC")));
+ QTimeZone mTimeZone("UTC");
b->setUrl(mUrl);
b->setUsername(mUsername);
b->setPassword(mPassword);
@@ -351,13 +351,13 @@ void TestWordpressBuggy::testValidity()
QVERIFY(b->username() == mUsername);
QVERIFY(b->password() == mPassword);
QVERIFY(b->interfaceName() == QLatin1String("Movable Type"));
- QVERIFY(b->timeZone().name() == mTimeZone.name());
+ QVERIFY(b->timeZone().id() == mTimeZone.id());
}
void TestWordpressBuggy::testNetwork()
{
- KDateTime mCDateTime(mCreationDateTime);
- KDateTime mMDateTime(mModificationDateTime);
+ QDateTime mCDateTime(mCreationDateTime);
+ QDateTime mMDateTime(mModificationDateTime);
p = new BlogPost(); // no need to delete later ;-)
p->setTitle(mTitle);
p->setContent(mContent);
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 3a8d8d4..7f9bb99 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -19,6 +19,8 @@ if( KF5GAPI_FOUND )
endif()
+configure_file(blog_config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/blog_config.h @ONLY)
+
add_library(KF5Blog ${kblog_SRCS})
generate_export_header(KF5Blog BASE_NAME kblog)
@@ -31,7 +33,6 @@ target_include_directories(KF5Blog PUBLIC "$<BUILD_INTERFACE:${KBlog_SOURCE_DIR}
target_link_libraries(KF5Blog
PUBLIC
KF5::Syndication
- KF5::KDELibs4Support
KF5::CalendarCore
PRIVATE
KF5::XmlRpcClient
diff --git a/src/blog.cpp b/src/blog.cpp
index d7cb82e..83cc73e 100644
--- a/src/blog.cpp
+++ b/src/blog.cpp
@@ -24,8 +24,7 @@
#include "blog.h"
#include "blog_p.h"
#include "blogpost_p.h"
-
-#include <kdeversion.h>
+#include "blog_config.h"
#include "kblog_debug.h"
@@ -72,7 +71,7 @@ void Blog::setUserAgent(const QString &applicationName,
} else {
userAgent = QStringLiteral("KDE-KBlog/");
}
- userAgent += QLatin1String(KDE_VERSION_STRING);
+ userAgent += QStringLiteral(KDEPIMLIBS_VERSION);
d->mUserAgent = userAgent;
}
@@ -124,13 +123,13 @@ QUrl Blog::url() const
return d->mUrl;
}
-void Blog::setTimeZone(const KTimeZone &tz)
+void Blog::setTimeZone(const QTimeZone &tz)
{
Q_D(Blog);
d->mTimeZone = tz;
}
-KTimeZone Blog::timeZone()
+QTimeZone Blog::timeZone()
{
Q_D(const Blog);
return d->mTimeZone;
diff --git a/src/blog.h b/src/blog.h
index 2d2c876..0e09053 100644
--- a/src/blog.h
+++ b/src/blog.h
@@ -30,7 +30,7 @@
template <class T, class S> class QMap;
-class KTimeZone;
+class QTimeZone;
class QUrl;
/**
@@ -194,14 +194,14 @@ public:
@param timeZone the time zone of the server.
@see timeZone()
*/
- virtual void setTimeZone(const KTimeZone &timeZone);
+ virtual void setTimeZone(const QTimeZone &timeZone);
/**
Get the time zone of the blog's server.
@see void setTimeZone()
*/
- KTimeZone timeZone();
+ QTimeZone timeZone();
/**
List a number of recent posts from the server.
diff --git a/src/blog_config.h.cmake b/src/blog_config.h.cmake
new file mode 100644
index 0000000..c8d743e
--- /dev/null
+++ b/src/blog_config.h.cmake
@@ -0,0 +1 @@
+#define KDEPIMLIBS_VERSION "@[email protected]"
diff --git a/src/blog_p.h b/src/blog_p.h
index 1666fe3..aa27799 100644
--- a/src/blog_p.h
+++ b/src/blog_p.h
@@ -25,8 +25,9 @@
#include "blog.h"
-#include <KTimeZone>
+#include <QTimeZone>
#include <QUrl>
+
#include <kxmlrpcclient/client.h>
namespace KBlog
@@ -43,7 +44,7 @@ public:
QString mPassword;
QString mUserAgent;
QUrl mUrl;
- KTimeZone mTimeZone;
+ QTimeZone mTimeZone;
Q_DECLARE_PUBLIC(Blog)
};
diff --git a/src/blogcomment.cpp b/src/blogcomment.cpp
index 74f6461..5ba001c 100644
--- a/src/blogcomment.cpp
+++ b/src/blogcomment.cpp
@@ -23,9 +23,6 @@
#include "blogcomment.h"
#include "blogcomment_p.h"
-#include <KDateTime>
-#include <QUrl>
-
namespace KBlog
{
@@ -118,22 +115,22 @@ void BlogComment::setUrl(const QUrl &url)
d_ptr->mUrl = url;
}
-KDateTime BlogComment::modificationDateTime() const
+QDateTime BlogComment::modificationDateTime() const
{
return d_ptr->mModificationDateTime;
}
-void BlogComment::setModificationDateTime(const KDateTime &datetime)
+void BlogComment::setModificationDateTime(const QDateTime &datetime)
{
d_ptr->mModificationDateTime = datetime;
}
-KDateTime BlogComment::creationDateTime() const
+QDateTime BlogComment::creationDateTime() const
{
return d_ptr->mCreationDateTime;
}
-void BlogComment::setCreationDateTime(const KDateTime &datetime)
+void BlogComment::setCreationDateTime(const QDateTime &datetime)
{
d_ptr->mCreationDateTime = datetime;
}
diff --git a/src/blogcomment.h b/src/blogcomment.h
index 6f788be..2fecbcc 100644
--- a/src/blogcomment.h
+++ b/src/blogcomment.h
@@ -28,7 +28,7 @@
#include <QtCore/QString>
#include <QtCore/QtAlgorithms>
-class KDateTime;
+class QDateTime;
class QUrl;
namespace KBlog
@@ -170,7 +170,7 @@ public:
@see setModificationDateTime( const KDateTime& )
*/
- KDateTime modificationDateTime() const;
+ QDateTime modificationDateTime() const;
/**
Sets the modification date-time.
@@ -178,7 +178,7 @@ public:
@see modificationDateTime( const KDateTime& )
*/
- void setModificationDateTime(const KDateTime &datetime);
+ void setModificationDateTime(const QDateTime &datetime);
/**
Returns the creation date-time.
@@ -186,7 +186,7 @@ public:
@see setCreationDateTime( const KDateTime& )
*/
- KDateTime creationDateTime() const;
+ QDateTime creationDateTime() const;
/**
Sets the creation date-time.
@@ -194,7 +194,7 @@ public:
@see creationDateTime()
*/
- void setCreationDateTime(const KDateTime &datetime);
+ void setCreationDateTime(const QDateTime &datetime);
/**
The enumartion of the different post status, reflecting the status changes
diff --git a/src/blogcomment_p.h b/src/blogcomment_p.h
index 078b36e..7416e32 100644
--- a/src/blogcomment_p.h
+++ b/src/blogcomment_p.h
@@ -25,7 +25,7 @@
#include "blogcomment.h"
-#include <KDateTime>
+#include <QDateTime>
#include <QUrl>
namespace KBlog
@@ -43,8 +43,8 @@ public:
QUrl mUrl;
QString mError;
BlogComment::Status mStatus;
- KDateTime mModificationDateTime;
- KDateTime mCreationDateTime;
+ QDateTime mModificationDateTime;
+ QDateTime mCreationDateTime;
};
} // namespace KBlog
diff --git a/src/blogger1.cpp b/src/blogger1.cpp
index 7ecc244..90b3baa 100644
--- a/src/blogger1.cpp
+++ b/src/blogger1.cpp
@@ -469,13 +469,13 @@ bool Blogger1Private::readPostFromMap(
qCDebug(KBLOG_LOG) << endl << "Keys:" << mapkeys.join(QStringLiteral(", "));
qCDebug(KBLOG_LOG) << endl;
- KDateTime dt(postInfo[QStringLiteral("dateCreated")].toDateTime(), KDateTime::UTC);
+ QDateTime dt = postInfo[QStringLiteral("dateCreated")].toDateTime();
if (dt.isValid() && !dt.isNull()) {
- post->setCreationDateTime(dt.toLocalZone());
+ post->setCreationDateTime(dt.toLocalTime());
}
- dt = KDateTime(postInfo[QStringLiteral("lastModified")].toDateTime(), KDateTime::UTC);
+ dt = postInfo[QStringLiteral("lastModified")].toDateTime();
if (dt.isValid() && !dt.isNull()) {
- post->setModificationDateTime(dt.toLocalZone());
+ post->setModificationDateTime(dt.toLocalTime());
}
post->setPostId(postInfo[QStringLiteral("postid")].toString().isEmpty() ? postInfo[QStringLiteral("postId")].toString() :
postInfo[QStringLiteral("postid")].toString());
diff --git a/src/blogpost.cpp b/src/blogpost.cpp
index 863d272..155d62c 100644
--- a/src/blogpost.cpp
+++ b/src/blogpost.cpp
@@ -25,9 +25,6 @@
#include "blog.h"
-#include <KDateTime>
-#include <QUrl>
-
#include <QStringList>
namespace KBlog
@@ -84,7 +81,7 @@ BlogPost::BlogPost(const KCalCore::Journal::Ptr &journal)
d_ptr->mContent = journal->description();
}
d_ptr->mCategories = journal->categories();
- d_ptr->mCreationDateTime = journal->dtStart();
+ d_ptr->mCreationDateTime = journal->dtStart().dateTime();
}
// BlogPost::BlogPost( const KCal::Journal &journal, BlogPostPrivate &dd )
@@ -119,7 +116,7 @@ KCalCore::Journal::Ptr BlogPost::journal(const Blog &blog) const
journal->setSummary(d_ptr->mTitle);
journal->setCategories(d_ptr->mCategories);
journal->setDescription(d_ptr->mContent, true);
- journal->setDtStart(d_ptr->mCreationDateTime);
+ journal->setDtStart(KDateTime(d_ptr->mCreationDateTime));
journal->setCustomProperty("KBLOG", "URL", url);
journal->setCustomProperty("KBLOG", "USER", blog.username());
journal->setCustomProperty("KBLOG", "BLOG", blogId);
@@ -306,22 +303,22 @@ void BlogPost::setCategories(const QStringList &categories)
d_ptr->mCategories = categories;
}
-KDateTime BlogPost::creationDateTime() const
+QDateTime BlogPost::creationDateTime() const
{
return d_ptr->mCreationDateTime;
}
-void BlogPost::setCreationDateTime(const KDateTime &datetime)
+void BlogPost::setCreationDateTime(const QDateTime &datetime)
{
d_ptr->mCreationDateTime = datetime;
}
-KDateTime BlogPost::modificationDateTime() const
+QDateTime BlogPost::modificationDateTime() const
{
return d_ptr->mModificationDateTime;
}
-void BlogPost::setModificationDateTime(const KDateTime &datetime)
+void BlogPost::setModificationDateTime(const QDateTime &datetime)
{
d_ptr->mModificationDateTime = datetime;
}
diff --git a/src/blogpost.h b/src/blogpost.h
index 639fab8..88d5a43 100644
--- a/src/blogpost.h
+++ b/src/blogpost.h
@@ -31,7 +31,7 @@
class QStringList;
-class KDateTime;
+class QDateTime;
class QUrl;
namespace KBlog
@@ -356,7 +356,7 @@ public:
@see setCreationDateTime()
*/
- KDateTime creationDateTime() const;
+ QDateTime creationDateTime() const;
/**
Sets the creation time. This is used by most Blogs and is generally
@@ -365,7 +365,7 @@ public:
@see creationTime()
*/
- void setCreationDateTime(const KDateTime &datetime);
+ void setCreationDateTime(const QDateTime &datetime);
/**
Returns the modification date time.
@@ -373,7 +373,7 @@ public:
@see setModificationDateTime(), creationDateTime()
*/
- KDateTime modificationDateTime() const;
+ QDateTime modificationDateTime() const;
/**
Sets the modification time.
@@ -381,7 +381,7 @@ public:
@see modificationTime(), setCreationDateTime()
*/
- void setModificationDateTime(const KDateTime &datetime);
+ void setModificationDateTime(const QDateTime &datetime);
/**
The enumartion of the different post status, reflecting the status changes
diff --git a/src/blogpost_p.h b/src/blogpost_p.h
index 368f841..6da03b5 100644
--- a/src/blogpost_p.h
+++ b/src/blogpost_p.h
@@ -26,7 +26,7 @@
#include "blogpost.h"
#include <QtCore/QStringList>
-#include <kdatetime.h>
+#include <QDateTime>
#include <QUrl>
namespace KBlog
@@ -53,8 +53,8 @@ public:
bool mTrackBackAllowed;
QUrl mLink, mPermaLink;
BlogPost::Status mStatus;
- KDateTime mCreationDateTime;
- KDateTime mModificationDateTime;
+ QDateTime mCreationDateTime;
+ QDateTime mModificationDateTime;
QString cleanRichText(QString richText) const;
};
diff --git a/src/gdata.cpp b/src/gdata.cpp
index 7d93068..566d86b 100644
--- a/src/gdata.cpp
+++ b/src/gdata.cpp
@@ -28,11 +28,9 @@
#include <syndication/item.h>
#include <syndication/category.h>
-#include <kio/netaccess.h>
#include <kio/job.h>
#include "kblog_debug.h"
#include <KLocalizedString>
-#include <KDateTime>
#include <QUrl>
#include <QByteArray>
@@ -108,8 +106,8 @@ void GData::listBlogs()
}
void GData::listRecentPosts(const QStringList &labels, int number,
- const KDateTime &upMinTime, const KDateTime &upMaxTime,
- const KDateTime &pubMinTime, const KDateTime &pubMaxTime)
+ const QDateTime &upMinTime, const QDateTime &upMaxTime,
+ const QDateTime &pubMinTime, const QDateTime &pubMaxTime)
{
qCDebug(KBLOG_LOG);
Q_D(GData);
@@ -121,19 +119,19 @@ void GData::listRecentPosts(const QStringList &labels, int number,
QUrl url(urlString);
if (!upMinTime.isNull()) {
- url.addQueryItem(QStringLiteral("updated-min"), upMinTime.toString());
+ url.addQueryItem(QStringLiteral("updated-min"), upMinTime.toUTC().toString(QStringLiteral("yyyy-MM-ddTHH:mm:ssZ")));
}
if (!upMaxTime.isNull()) {
- url.addQueryItem(QStringLiteral("updated-max"), upMaxTime.toString());
+ url.addQueryItem(QStringLiteral("updated-max"), upMaxTime.toUTC().toString(QStringLiteral("yyyy-MM-ddTHH:mm:ssZ")));
}
if (!pubMinTime.isNull()) {
- url.addQueryItem(QStringLiteral("published-min"), pubMinTime.toString());
+ url.addQueryItem(QStringLiteral("published-min"), pubMinTime.toUTC().toString(QStringLiteral("yyyy-MM-ddTHH:mm:ssZ")));
}
if (!pubMaxTime.isNull()) {
- url.addQueryItem(QStringLiteral("published-max"), pubMaxTime.toString());
+ url.addQueryItem(QStringLiteral("published-max"), pubMaxTime.toUTC().toString(QStringLiteral("yyyy-MM-ddTHH:mm:ssZ")));
}
Syndication::Loader *loader = Syndication::Loader::create();
@@ -484,8 +482,13 @@ bool GDataPrivate::authenticate()
if (!mAuthenticationTime.isValid() ||
QDateTime::currentDateTime().toTime_t() - mAuthenticationTime.toTime_t() > TIMEOUT ||
mAuthenticationString.isEmpty()) {
- KIO::Job *job = KIO::http_post(authGateway, QByteArray(), KIO::HideProgressInfo);
- if (KIO::NetAccess::synchronousRun(job, (QWidget *)Q_NULLPTR, &data, &authGateway)) {
+ KIO::TransferJob *job = KIO::http_post(authGateway, QByteArray(), KIO::HideProgressInfo);
+ QObject::connect(job, &KIO::TransferJob::data,
+ q, [&data](KIO::Job *, const QByteArray &newdata) {
+ data.reserve(data.size() + newdata.size());
+ qMemCopy(data.data() + data.size(), newdata.data(), newdata.size());
+ });
+ if (job->exec()) {
QRegExp rx(QStringLiteral("Auth=(.+)"));
if (rx.indexIn(QLatin1String(data)) != -1) {
qCDebug(KBLOG_LOG) << "RegExp got authentication string:" << rx.cap(1);
@@ -604,12 +607,8 @@ void GDataPrivate::slotListComments(Syndication::Loader *loader,
comment.setTitle((*it)->title());
comment.setContent((*it)->content());
// FIXME: assuming UTC for now
- comment.setCreationDateTime(
- KDateTime(QDateTime::fromTime_t((*it)->datePublished()),
- KDateTime::Spec::UTC()));
- comment.setModificationDateTime(
- KDateTime(QDateTime::fromTime_t((*it)->dateUpdated()),
- KDateTime::Spec::UTC()));
+ comment.setCreationDateTime(QDateTime::fromTime_t((*it)->datePublished()));
+ comment.setModificationDateTime(QDateTime::fromTime_t((*it)->dateUpdated()));
commentList.append(comment);
}
qCDebug(KBLOG_LOG) << "Emitting listedComments()";
@@ -651,12 +650,8 @@ void GDataPrivate::slotListAllComments(Syndication::Loader *loader,
comment.setTitle((*it)->title());
comment.setContent((*it)->content());
// FIXME: assuming UTC for now
- comment.setCreationDateTime(
- KDateTime(QDateTime::fromTime_t((*it)->datePublished()),
- KDateTime::Spec::UTC()));
- comment.setModificationDateTime(
- KDateTime(QDateTime::fromTime_t((*it)->dateUpdated()),
- KDateTime::Spec::UTC()));
+ comment.setCreationDateTime(QDateTime::fromTime_t((*it)->datePublished()));
+ comment.setModificationDateTime(QDateTime::fromTime_t((*it)->dateUpdated()));
commentList.append(comment);
}
qCDebug(KBLOG_LOG) << "Emitting listedAllComments()";
@@ -716,12 +711,8 @@ void GDataPrivate::slotListRecentPosts(Syndication::Loader *loader,
}
post.setTags(labels);
// FIXME: assuming UTC for now
- post.setCreationDateTime(
- KDateTime(QDateTime::fromTime_t((*it)->datePublished()),
- KDateTime::Spec::UTC()).toLocalZone());
- post.setModificationDateTime(
- KDateTime(QDateTime::fromTime_t((*it)->dateUpdated()),
- KDateTime::Spec::UTC()).toLocalZone());
+ post.setCreationDateTime(QDateTime::fromTime_t((*it)->datePublished()));
+ post.setModificationDateTime(QDateTime::fromTime_t((*it)->dateUpdated()));
post.setStatus(BlogPost::Fetched);
postList.append(post);
if (number-- == 0) {
@@ -768,12 +759,8 @@ void GDataPrivate::slotFetchPost(Syndication::Loader *loader,
post->setContent((*it)->content());
post->setStatus(BlogPost::Fetched);
post->setLink(QUrl((*it)->link()));
- post->setCreationDateTime(
- KDateTime(QDateTime::fromTime_t((*it)->datePublished()),
- KDateTime::Spec::UTC()).toLocalZone());
- post->setModificationDateTime(
- KDateTime(QDateTime::fromTime_t((*it)->dateUpdated()),
- KDateTime::Spec::UTC()).toLocalZone());
+ post->setCreationDateTime(QDateTime::fromTime_t((*it)->datePublished()).toLocalTime());
+ post->setModificationDateTime(QDateTime::fromTime_t((*it)->dateUpdated()).toLocalTime());
qCDebug(KBLOG_LOG) << "Emitting fetchedPost( postId=" << postId << ");";
success = true;
emit q->fetchedPost(post);
@@ -836,8 +823,8 @@ void GDataPrivate::slotCreatePost(KJob *job)
qCDebug(KBLOG_LOG) << "QRegExp rx( '<updated>(.+)</updated>' ) matches" << rxUp.cap(1);
post->setPostId(rxId.cap(1));
- post->setCreationDateTime(KDateTime().fromString(rxPub.cap(1)).toLocalZone());
- post->setModificationDateTime(KDateTime().fromString(rxUp.cap(1)));
+ post->setCreationDateTime(QDateTime::fromString(rxPub.cap(1)));
+ post->setModificationDateTime(QDateTime::fromString(rxUp.cap(1)));
post->setStatus(BlogPost::Created);
qCDebug(KBLOG_LOG) << "Emitting createdPost()";
emit q->createdPost(post);
@@ -889,8 +876,8 @@ void GDataPrivate::slotModifyPost(KJob *job)
}
qCDebug(KBLOG_LOG) << "QRegExp rx( '<updated>(.+)</updated>' ) matches" << rxUp.cap(1);
post->setPostId(rxId.cap(1));
- post->setCreationDateTime(KDateTime().fromString(rxPub.cap(1)));
- post->setModificationDateTime(KDateTime().fromString(rxUp.cap(1)));
+ post->setCreationDateTime(QDateTime::fromString(rxPub.cap(1)));
+ post->setModificationDateTime(QDateTime::fromString(rxUp.cap(1)));
post->setStatus(BlogPost::Modified);
emit q->modifiedPost(post);
}
@@ -970,8 +957,8 @@ void GDataPrivate::slotCreateComment(KJob *job)
}
qCDebug(KBLOG_LOG) << "QRegExp rx( '<updated>(.+)</updated>' ) matches" << rxUp.cap(1);
comment->setCommentId(rxId.cap(1));
- comment->setCreationDateTime(KDateTime().fromString(rxPub.cap(1)));
- comment->setModificationDateTime(KDateTime().fromString(rxUp.cap(1)));
+ comment->setCreationDateTime(QDateTime::fromString(rxPub.cap(1)));
+ comment->setModificationDateTime(QDateTime::fromString(rxUp.cap(1)));
comment->setStatus(BlogComment::Created);
qCDebug(KBLOG_LOG) << "Emitting createdComment()";
emit q->createdComment(post, comment);
diff --git a/src/gdata.h b/src/gdata.h
index 53ac982..418704b 100644
--- a/src/gdata.h
+++ b/src/gdata.h
@@ -23,9 +23,9 @@
#define KBLOG_GDATA_H
#include <blog.h>
-#include <kdatetime.h>
-#include <QtCore/QStringList>
+#include <QDateTime>
+#include <QStringList>
class QUrl;
@@ -176,10 +176,10 @@ public:
@see void fetchPost( KBlog::BlogPost* )
*/
virtual void listRecentPosts(const QStringList &label = QStringList(), int number = 0,
- const KDateTime &upMinTime = KDateTime(),
- const KDateTime &upMaxTime = KDateTime(),
- const KDateTime &pubMinTime = KDateTime(),
- const KDateTime &pubMaxTime = KDateTime());
+ const QDateTime &upMinTime = QDateTime(),
+ const QDateTime &upMaxTime = QDateTime(),
+ const QDateTime &pubMinTime = QDateTime(),
+ const QDateTime &pubMaxTime = QDateTime());
/**
Fetch the Post with a specific id.
diff --git a/src/livejournal.cpp b/src/livejournal.cpp
index 4ace803..639e3d5 100644
--- a/src/livejournal.cpp
+++ b/src/livejournal.cpp
@@ -28,7 +28,6 @@
#include "kblog_debug.h"
#include <KLocalizedString>
-#include <KDateTime>
using namespace KBlog;
@@ -95,7 +94,7 @@ void LiveJournal::createPost(KBlog::BlogPost *post)
map.insert("event", post->content()); // Insert the post's content into the struct.
map.insert("subject", post->title()); // Insert the post's subject into the struct.
// TODO map.insert( "allowmask", post->categories() ); // We want to use the allowmask to use categories/tags
- KDateTime date = post->creationDateTime(); // Get the date of the post's creation
+ const QDateTime date = post->creationDateTime(); // Get the date of the post's creation
int year = date.toString("%Y").toInt(); // Get the year from the date using a format string and converting string to an integer
int month = date.toString("%m").toInt(); // Get the month from the date using a format string and converting string to an integer
int day = date.toString("%d").toInt(); // Get the day from the date using a format string and converting string to an integer
@@ -199,7 +198,7 @@ void LiveJournal::modifyPost(KBlog::BlogPost *post)
map.insert("event", post->content()); // Insert the post's content into the struct.
map.insert("subject", post->title()); // Insert the post's subject into the struct.
// TODO map.insert( "allowmask", post->categories() ); // We want to use the allowmask to use categories/tags
- KDateTime date = post->creationDateTime(); // Get the date of the post's creation
+ const QDateTime date = post->creationDateTime(); // Get the date of the post's creation
int year = date.toString("%Y").toInt(); // Get the year from the date using a format string and converting string to an integer
int month = date.toString("%m").toInt(); // Get the month from the date using a format string and converting string to an integer
int day = date.toString("%d").toInt(); // Get the day from the date using a format string and converting string to an integer
@@ -230,7 +229,7 @@ void LiveJournal::removePost(KBlog::BlogPost *post)
map.insert("event", QString()); // Insert no content into the struct to delete the post.
map.insert("subject", post->title()); // Insert the post's subject into the struct.
// TODO map.insert( "allowmask", post->categories() );
- KDateTime date = post->creationDateTime(); // Get the date of the post's creation
+ const QDateTime date = post->creationDateTime(); // Get the date of the post's creation
int year = date.toString("%Y").toInt(); // Get the year from the date using a format string and converting string to an integer
int month = date.toString("%m").toInt(); // Get the month from the date using a format string and converting string to an integer
int day = date.toString("%d").toInt(); // Get the day from the date using a format string and converting string to an integer
diff --git a/src/metaweblog.cpp b/src/metaweblog.cpp
index 4c60bfc..db85445 100644
--- a/src/metaweblog.cpp
+++ b/src/metaweblog.cpp
@@ -29,7 +29,6 @@
#include <kxmlrpcclient/client.h>
#include "kblog_debug.h"
#include <KLocalizedString>
-#include <KDateTime>
#include <QtCore/QFile>
#include <QtCore/QDataStream>
@@ -275,16 +274,14 @@ bool MetaWeblogPrivate::readPostFromMap(BlogPost *post,
qCDebug(KBLOG_LOG) << endl << "Keys:" << mapkeys.join(QStringLiteral(", "));
qCDebug(KBLOG_LOG) << endl;
- KDateTime dt =
- KDateTime(postInfo[QStringLiteral("dateCreated")].toDateTime(), KDateTime::UTC);
+ QDateTime dt = postInfo[QStringLiteral("dateCreated")].toDateTime();
if (dt.isValid() && !dt.isNull()) {
- post->setCreationDateTime(dt.toLocalZone());
+ post->setCreationDateTime(dt.toLocalTime());
}
- dt =
- KDateTime(postInfo[QStringLiteral("lastModified")].toDateTime(), KDateTime::UTC);
+ dt = postInfo[QStringLiteral("lastModified")].toDateTime();
if (dt.isValid() && !dt.isNull()) {
- post->setModificationDateTime(dt.toLocalZone());
+ post->setModificationDateTime(dt.toLocalTime());
}
post->setPostId(postInfo[QStringLiteral("postid")].toString().isEmpty() ? postInfo[QStringLiteral("postId")].toString() :
@@ -312,8 +309,8 @@ bool MetaWeblogPrivate::readArgsFromPost(QList<QVariant> *args, const BlogPost &
map[QStringLiteral("categories")] = post.categories();
map[QStringLiteral("description")] = post.content();
map[QStringLiteral("title")] = post.title();
- map[QStringLiteral("lastModified")] = post.modificationDateTime().dateTime().toUTC();
- map[QStringLiteral("dateCreated")] = post.creationDateTime().dateTime().toUTC();
+ map[QStringLiteral("lastModified")] = post.modificationDateTime().toUTC();
+ map[QStringLiteral("dateCreated")] = post.creationDateTime().toUTC();
*args << map;
*args << QVariant(!post.isPrivate());
return true;
diff --git a/src/movabletype.cpp b/src/movabletype.cpp
index 0ae90fc..684a83a 100644
--- a/src/movabletype.cpp
+++ b/src/movabletype.cpp
@@ -30,7 +30,6 @@
#include "kblog_debug.h"
#include <KLocalizedString>
-#include <KDateTime>
#include <QtCore/QStringList>
@@ -464,16 +463,14 @@ bool MovableTypePrivate::readPostFromMap(BlogPost *post, const QMap<QString, QVa
qCDebug(KBLOG_LOG) << endl << "Keys:" << mapkeys.join(QStringLiteral(", "));
qCDebug(KBLOG_LOG) << endl;
- KDateTime dt =
- KDateTime(postInfo[QStringLiteral("dateCreated")].toDateTime(), KDateTime::UTC);
+ QDateTime dt = postInfo[QStringLiteral("dateCreated")].toDateTime();
if (dt.isValid() && !dt.isNull()) {
- post->setCreationDateTime(dt.toLocalZone());
+ post->setCreationDateTime(dt.toLocalTime());
}
- dt =
- KDateTime(postInfo[QStringLiteral("lastModified")].toDateTime(), KDateTime::UTC);
+ dt = postInfo[QStringLiteral("lastModified")].toDateTime();
if (dt.isValid() && !dt.isNull()) {
- post->setModificationDateTime(dt.toLocalZone());
+ post->setModificationDateTime(dt.toLocalTime());
}
post->setPostId(postInfo[QStringLiteral("postid")].toString().isEmpty() ? postInfo[QStringLiteral("postId")].toString() :
@@ -571,7 +568,7 @@ bool MovableTypePrivate::readArgsFromPost(QList<QVariant> *args, const BlogPost
map[QStringLiteral("mt_text_more")] = post.additionalContent();
}
map[QStringLiteral("title")] = post.title();
- map[QStringLiteral("dateCreated")] = post.creationDateTime().dateTime().toUTC();
+ map[QStringLiteral("dateCreated")] = post.creationDateTime().toUTC();
map[QStringLiteral("mt_allow_comments")] = (int)post.isCommentAllowed();
map[QStringLiteral("mt_allow_pings")] = (int)post.isTrackBackAllowed();
map[QStringLiteral("mt_excerpt")] = post.summary();
diff --git a/src/wordpressbuggy.cpp b/src/wordpressbuggy.cpp
index 6ea14ff..4c98995 100644
--- a/src/wordpressbuggy.cpp
+++ b/src/wordpressbuggy.cpp
@@ -108,7 +108,7 @@ void WordpressBuggy::createPost(KBlog::BlogPost *post)
xmlMarkup += QStringLiteral("<name>dateCreated</name>");
xmlMarkup += QStringLiteral("<value><dateTime.iso8601>") +
- post->creationDateTime().dateTime().toUTC().toString(QStringLiteral("yyyyMMddThh:mm:ss")) +
+ post->creationDateTime().toUTC().toString(QStringLiteral("yyyyMMddThh:mm:ss")) +
QStringLiteral("</dateTime.iso8601></value>");
xmlMarkup += QStringLiteral("</member><member>");
xmlMarkup += QStringLiteral("<name>mt_allow_comments</name>");
@@ -209,12 +209,12 @@ void WordpressBuggy::modifyPost(KBlog::BlogPost *post)
xmlMarkup += QStringLiteral("<name>lastModified</name>");
xmlMarkup += QStringLiteral("<value><dateTime.iso8601>") +
- post->modificationDateTime().dateTime().toUTC().toString(QStringLiteral("yyyyMMddThh:mm:ss")) +
+ post->modificationDateTime().toUTC().toString(QStringLiteral("yyyyMMddThh:mm:ss")) +
QStringLiteral("</dateTime.iso8601></value>");
xmlMarkup += QStringLiteral("</member><member>");
xmlMarkup += QStringLiteral("<name>dateCreated</name>");
xmlMarkup += QStringLiteral("<value><dateTime.iso8601>") +
- post->creationDateTime().dateTime().toUTC().toString(QStringLiteral("yyyyMMddThh:mm:ss")) +
+ post->creationDateTime().toUTC().toString(QStringLiteral("yyyyMMddThh:mm:ss")) +
QStringLiteral("</dateTime.iso8601></value>");
xmlMarkup += QStringLiteral("</member><member>");
xmlMarkup += QStringLiteral("<name>mt_allow_comments</name>");