[SCM] ktp-common-internals packaging branch, master, updated. debian/15.12.1-2-1839-gf0635e9
Maximiliano Curia
maxy at moszumanska.debian.org
Mon May 9 09:08:29 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-common-internals.git;a=commitdiff;h=8058aca
The following commit has been merged in the master branch:
commit 8058aca25568c2d13adfe287f737f8cec0aa0ace
Author: Aleix Pol <aleixpol at kde.org>
Date: Wed Oct 29 13:50:59 2014 +0100
Port away from some kdelibs4support
REVIEW: 120860
---
KTp/Declarative/pinned-contacts-model.cpp | 2 --
KTp/Declarative/telepathy-manager.cpp | 4 ++--
KTp/Logger/log-manager.cpp | 1 -
KTp/Models/presence-model.cpp | 4 ++--
KTp/core.cpp | 5 ++---
KTp/error-dictionary.cpp | 1 -
KTp/logs-importer-private.cpp | 9 ++++-----
KTp/message-filter-config-manager.cpp | 1 -
KTp/message-processor.cpp | 6 ++----
KTp/wallet-interface.cpp | 7 +++----
kpeople/datasourceplugin/im-persons-data-source.cpp | 10 ++++++----
kpeople/uiplugins/chatplugin/kpeople_chat_plugin.cpp | 7 +++----
otr-proxy/KTpProxy/otr-config.cpp | 9 +++++----
13 files changed, 29 insertions(+), 37 deletions(-)
diff --git a/KTp/Declarative/pinned-contacts-model.cpp b/KTp/Declarative/pinned-contacts-model.cpp
index e972bee..155624f 100644
--- a/KTp/Declarative/pinned-contacts-model.cpp
+++ b/KTp/Declarative/pinned-contacts-model.cpp
@@ -29,10 +29,8 @@
#include <TelepathyQt/ContactManager>
#include <TelepathyQt/PendingContacts>
-#include <KGlobal>
#include <KComponentData>
#include <KConfigGroup>
-#include <KStandardDirs>
#include <KDebug>
#include "KTp/presence.h"
diff --git a/KTp/Declarative/telepathy-manager.cpp b/KTp/Declarative/telepathy-manager.cpp
index 1f7fafa..0eef901 100644
--- a/KTp/Declarative/telepathy-manager.cpp
+++ b/KTp/Declarative/telepathy-manager.cpp
@@ -164,12 +164,12 @@ Tp::PendingOperation* TelepathyManager::startFileTransfer(const Tp::AccountPtr &
bool TelepathyManager::canDial() const
{
- return !KStandardDirs::findExe(QLatin1String("ktp-dialout-ui")).isEmpty();
+ return !QStandardPaths::findExecutable(QLatin1String("ktp-dialout-ui")).isEmpty();
}
bool TelepathyManager::canSendFiles() const
{
- return !KStandardDirs::findExe(QLatin1String("ktp-send-file")).isEmpty();
+ return !QStandardPaths::findExecutable(QLatin1String("ktp-send-file")).isEmpty();
}
void TelepathyManager::openDialUi() const
diff --git a/KTp/Logger/log-manager.cpp b/KTp/Logger/log-manager.cpp
index 7ce4a12..dc399d9 100644
--- a/KTp/Logger/log-manager.cpp
+++ b/KTp/Logger/log-manager.cpp
@@ -27,7 +27,6 @@
#include "pending-logger-entities-impl.h"
#include "pending-logger-search-impl.h"
-#include <KGlobal>
#include <KService>
#include <KServiceTypeTrader>
#include <KPluginInfo>
diff --git a/KTp/Models/presence-model.cpp b/KTp/Models/presence-model.cpp
index b916ca5..58e9733 100644
--- a/KTp/Models/presence-model.cpp
+++ b/KTp/Models/presence-model.cpp
@@ -22,13 +22,13 @@
#include <QString>
#include <QFont>
+#include <QFontDatabase>
#include <QtDBus/QtDBus>
#include <KDE/KIcon>
#include <KDE/KLocalizedString>
#include <KDE/KConfig>
#include <KDE/KConfigGroup>
-#include <KDE/KGlobalSettings>
#include <KDE/KDebug>
namespace KTp
@@ -92,7 +92,7 @@ QVariant PresenceModel::data(const QModelIndex &index, int role) const
case Qt::FontRole:
if (presence.statusMessage().isEmpty()) {
- QFont font = KGlobalSettings::generalFont();
+ QFont font = QFontDatabase::systemFont(QFontDatabase::GeneralFont);
font.setBold(true);
return font;
} else {
diff --git a/KTp/core.cpp b/KTp/core.cpp
index 1888b35..ac36ced 100644
--- a/KTp/core.cpp
+++ b/KTp/core.cpp
@@ -25,8 +25,7 @@
#include <QDBusReply>
#endif
-#include <KGlobal>
-
+#include <QtGlobal>
#include <TelepathyQt/AccountManager>
#include <KTp/global-contact-manager.h>
#include "contact-factory.h"
@@ -74,7 +73,7 @@ CorePrivate::CorePrivate()
m_channelFactory = Tp::ChannelFactory::create(QDBusConnection::sessionBus());
}
-K_GLOBAL_STATIC(CorePrivate, s_instance)
+Q_GLOBAL_STATIC(CorePrivate, s_instance)
bool KTp::kpeopleEnabled()
{
diff --git a/KTp/error-dictionary.cpp b/KTp/error-dictionary.cpp
index a6179d3..7785bd1 100644
--- a/KTp/error-dictionary.cpp
+++ b/KTp/error-dictionary.cpp
@@ -24,7 +24,6 @@
#include <TelepathyQt/Constants>
#include <KLocalizedString>
-#include <KGlobal>
#include <KLocale>
#include <KDebug>
diff --git a/KTp/logs-importer-private.cpp b/KTp/logs-importer-private.cpp
index 74e6f46..1f222c0 100644
--- a/KTp/logs-importer-private.cpp
+++ b/KTp/logs-importer-private.cpp
@@ -21,8 +21,8 @@
#include <KLocalizedString>
#include <KDebug>
-#include <KStandardDirs>
#include <KTimeZone>
+#include <QStandardPaths>
using namespace KTp;
@@ -134,8 +134,8 @@ QStringList LogsImporter::Private::findKopeteLogs(const QString &accountId) cons
return files;
}
- QDir dir(KStandardDirs::locateLocal("data", QLatin1String("kopete/logs/") +
- protocol + QDir::separator() + kopeteAccountId));
+ QDir dir(QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1String("/kopete/logs/") +
+ protocol + QLatin1Char('/') + kopeteAccountId);
if (dir.exists()) {
QFileInfoList entries = dir.entryInfoList(QStringList() << QLatin1String("*.xml"), QDir::Files | QDir::NoDotAndDotDot | QDir::Readable);
@@ -171,8 +171,7 @@ void LogsImporter::Private::saveKTpDocument()
.arg(m_month, 2, 10, QLatin1Char('0'))
.arg(m_day, 2, 10, QLatin1Char('0'));
- KStandardDirs dirs;
- QString path = dirs.localxdgdatadir() + QDir::separator() + QLatin1String("TpLogger") + QDir::separator() + QLatin1String("logs");
+ QString path = QStandardPaths::writableLocation(QStandardPaths::DataLocation) + QLatin1String("/TpLogger/logs");
if (m_isMUCLog) {
path += QDir::separator() + QLatin1String("chatrooms");
diff --git a/KTp/message-filter-config-manager.cpp b/KTp/message-filter-config-manager.cpp
index 1224ac6..bca93e0 100644
--- a/KTp/message-filter-config-manager.cpp
+++ b/KTp/message-filter-config-manager.cpp
@@ -22,7 +22,6 @@
#include <QMutex>
#include <QSet>
-#include <KGlobal>
#include <KDebug>
#include <KServiceTypeTrader>
diff --git a/KTp/message-processor.cpp b/KTp/message-processor.cpp
index b461ef8..517d54d 100644
--- a/KTp/message-processor.cpp
+++ b/KTp/message-processor.cpp
@@ -29,8 +29,6 @@
#include <KService>
#include <KServiceTypeTrader>
#include <KPluginFactory>
-#include <KGlobal>
-#include <KDE/KStandardDirs>
using namespace KTp;
@@ -167,12 +165,12 @@ QString MessageProcessor::header()
QString out(QLatin1String("
<!-- The following scripts and stylesheets are injected here by the plugins -->
"));
Q_FOREACH(const QString &script, scripts) {
out = out % QLatin1String(" <script type=\"text/javascript\" src=\"")
- % KGlobal::dirs()->findResource("data", script)
+ % QStandardPaths::locate(QStandardPaths::GenericDataLocation, script)
% QLatin1String("\"></script>
");
}
Q_FOREACH(const QString &stylesheet, stylesheets) {
out = out % QLatin1String(" <link rel=\"stylesheet\" type=\"text/css\" href=\"")
- % KGlobal::dirs()->findResource("data", stylesheet)
+ % QStandardPaths::locate(QStandardPaths::GenericDataLocation, stylesheet)
% QLatin1String("\" />
");
}
diff --git a/KTp/wallet-interface.cpp b/KTp/wallet-interface.cpp
index 575cdf1..06a2dfa 100644
--- a/KTp/wallet-interface.cpp
+++ b/KTp/wallet-interface.cpp
@@ -22,7 +22,6 @@
#include "pending-wallet.h"
#include <KDebug>
-#include <KGlobal>
class KTp::WalletInterfacePrivate : public QObject
@@ -73,10 +72,10 @@ WalletInterfacePrivate::WalletInterfacePrivate() :
KTp::PendingWallet* WalletInterface::openWallet()
{
- K_GLOBAL_STATIC(KTp::WalletInterface, s_instance);
+ static KTp::WalletInterface s_instance;
- s_instance->d->ensureWalletIsReady();
- return new PendingWallet(s_instance);
+ s_instance.d->ensureWalletIsReady();
+ return new PendingWallet(&s_instance);
}
void WalletInterfacePrivate::onWalletOpened(bool success)
diff --git a/kpeople/datasourceplugin/im-persons-data-source.cpp b/kpeople/datasourceplugin/im-persons-data-source.cpp
index a005de9..54e7c39 100644
--- a/kpeople/datasourceplugin/im-persons-data-source.cpp
+++ b/kpeople/datasourceplugin/im-persons-data-source.cpp
@@ -36,8 +36,6 @@
#include <KDE/KABC/Addressee>
#include <KDebug>
-#include <KGlobal>
-#include <KStandardDirs>
#include <KPluginFactory>
#include <KPluginLoader>
@@ -102,8 +100,12 @@ KTpAllContacts::~KTpAllContacts()
void KTpAllContacts::loadCache()
{
QSqlDatabase db = QSqlDatabase::addDatabase(QLatin1String("QSQLITE"), QLatin1String("ktpCache"));
- db.setDatabaseName(KGlobal::dirs()->locateLocal("data", QLatin1String("ktp/cache.db")));
- db.open();
+ QString path = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1String("/ktp");
+ QDir().mkpath(path);
+ db.setDatabaseName(path+QStringLiteral("/cache.db"));
+ if (!db.open()) {
+ qWarning() << "couldn't open database" << db.databaseName();
+ }
QSqlQuery query(db);
query.exec(QLatin1String("SELECT groupName FROM groups ORDER BY groupId;"));
diff --git a/kpeople/uiplugins/chatplugin/kpeople_chat_plugin.cpp b/kpeople/uiplugins/chatplugin/kpeople_chat_plugin.cpp
index f87253d..49716e6 100644
--- a/kpeople/uiplugins/chatplugin/kpeople_chat_plugin.cpp
+++ b/kpeople/uiplugins/chatplugin/kpeople_chat_plugin.cpp
@@ -26,10 +26,9 @@
#include <QVBoxLayout>
#include <QScrollArea>
#include <KLocalizedString>
-#include <KGlobal>
#include <KABC/Addressee>
#include <KPluginFactory>
-#include <KLocale>
+#include <KLocalizedString>
#include <KTp/core.h>
#include <KTp/Logger/log-manager.h>
@@ -141,13 +140,13 @@ void ChatWidgetFactory::onEventsFinished(KTp::PendingLoggerOperation *pendingOpe
QStandardItem *messageRow = new QStandardItem();
messageRow->setData(message.senderAlias(), ChatListviewDelegate::senderAliasRole);
messageRow->setData(message.mainMessagePart(), ChatListviewDelegate::messageRole);
- messageRow->setData(KGlobal::locale()->formatDateTime(message.time(), KLocale::FancyShortDate), ChatListviewDelegate::messageTimeRole);
+ messageRow->setData(QLocale().toString(message.time(), QLocale::ShortFormat), ChatListviewDelegate::messageTimeRole);
m_model->appendRow(messageRow);
} else {
QStandardItem *messageRow = new QStandardItem();
messageRow->setData(QLatin1String("Me"), ChatListviewDelegate::senderAliasRole);
messageRow->setData(message.mainMessagePart(), ChatListviewDelegate::messageRole);
- messageRow->setData(KGlobal::locale()->formatDateTime(message.time(), KLocale::FancyShortDate), ChatListviewDelegate::messageTimeRole);
+ messageRow->setData(QLocale().toString(message.time(), QLocale::ShortFormat), ChatListviewDelegate::messageTimeRole);
m_model->appendRow(messageRow);
}
}
diff --git a/otr-proxy/KTpProxy/otr-config.cpp b/otr-proxy/KTpProxy/otr-config.cpp
index c969172..28c316c 100644
--- a/otr-proxy/KTpProxy/otr-config.cpp
+++ b/otr-proxy/KTpProxy/otr-config.cpp
@@ -20,10 +20,9 @@
#include "otr-config.h"
#include "ktp-proxy-config.h"
-#include <KGlobal>
-#include <KStandardDirs>
-
+#include <QStandardPaths>
#include <QLatin1String>
+#include <QDir>
namespace OTR
{
@@ -34,7 +33,9 @@ namespace OTR
QString Config::saveLocation()
{
- return KGlobal::dirs()->saveLocation("data", QLatin1String("ktelepathy/ktp-proxy/"), true);
+ QString path = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QStringLiteral("/ktelepathy/ktp-proxy/");
+ QDir().mkpath(path);
+ return path;
}
OtrlPolicy Config::getPolicy() const
--
ktp-common-internals packaging
More information about the pkg-kde-commits
mailing list