diff --git a/org.kde.spacebar.desktop b/org.kde.spacebar.desktop index c3a35e2..8ea80e2 100644 --- a/org.kde.spacebar.desktop +++ b/org.kde.spacebar.desktop @@ -1,9 +1,9 @@ [Desktop Entry] Name=Spacebar Comment=Instant Messenger Version=1.0 Exec=spacebar -Icon=org.kde.spectacle +Icon=org.kde.spacebar Type=Application Terminal=false Categories=Qt;KDE; diff --git a/src/ktp-plugins/ktp-logger-plugin/mobile-logger-pending-dates.h b/src/ktp-plugins/ktp-logger-plugin/mobile-logger-pending-dates.h index f1ce4f8..f55263e 100644 --- a/src/ktp-plugins/ktp-logger-plugin/mobile-logger-pending-dates.h +++ b/src/ktp-plugins/ktp-logger-plugin/mobile-logger-pending-dates.h @@ -1,39 +1,39 @@ /* * Copyright (C) 2016 Martin Klapetek #include #include class MobileLoggerPendingDates : public KTp::PendingLoggerDates { Q_OBJECT public: explicit MobileLoggerPendingDates(const Tp::AccountPtr &account, const KTp::LogEntity &entity, - QObject *parent = 0); + QObject *parent = nullptr); }; #endif diff --git a/src/ktp-plugins/ktp-logger-plugin/mobile-logger-pending-entities.h b/src/ktp-plugins/ktp-logger-plugin/mobile-logger-pending-entities.h index 87550d1..2085096 100644 --- a/src/ktp-plugins/ktp-logger-plugin/mobile-logger-pending-entities.h +++ b/src/ktp-plugins/ktp-logger-plugin/mobile-logger-pending-entities.h @@ -1,35 +1,35 @@ /* * Copyright (C) 2016 Martin Klapetek * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifndef KTP_MOBILELOGGERPENDINGENTITIES_H #define KTP_MOBILELOGGERPENDINGENTITIES_H #include class MobileLoggerPendingEntities : public KTp::PendingLoggerEntities { Q_OBJECT public: explicit MobileLoggerPendingEntities(const Tp::AccountPtr &account, - QObject *parent = 0); + QObject *parent = nullptr); }; #endif // KTP_MOBILELOGGERPENDINGENTITIES_H diff --git a/src/ktp-plugins/ktp-logger-plugin/mobile-logger-pending-logs.h b/src/ktp-plugins/ktp-logger-plugin/mobile-logger-pending-logs.h index d594a33..a5c2143 100644 --- a/src/ktp-plugins/ktp-logger-plugin/mobile-logger-pending-logs.h +++ b/src/ktp-plugins/ktp-logger-plugin/mobile-logger-pending-logs.h @@ -1,36 +1,36 @@ /* * Copyright (C) 2016 Martin Klapetek * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifndef KTP_MOBILELOGGERPENDINGLOGS_H #define KTP_MOBILELOGGERPENDINGLOGS_H #include class MobileLoggerPendingLogs : public KTp::PendingLoggerLogs { Q_OBJECT public: explicit MobileLoggerPendingLogs(const Tp::AccountPtr &account, const KTp::LogEntity &entity, const QDate &date, - QObject *parent = 0); + QObject *parent = nullptr); }; #endif // KTP_MOBILELOGGERPENDINGLOGS_H diff --git a/src/ktp-plugins/ktp-logger-plugin/mobile-logger.cpp b/src/ktp-plugins/ktp-logger-plugin/mobile-logger.cpp index 83572eb..8843a6b 100644 --- a/src/ktp-plugins/ktp-logger-plugin/mobile-logger.cpp +++ b/src/ktp-plugins/ktp-logger-plugin/mobile-logger.cpp @@ -1,100 +1,100 @@ /* * Copyright (C) 2016 Martin Klapetek #include #include #include class A : public KTp::PendingLoggerSearch { Q_OBJECT public: - A(const QString &term, QObject *parent = 0) : KTp::PendingLoggerSearch(term, parent) + A(const QString &term, QObject *parent = nullptr) : KTp::PendingLoggerSearch(term, parent) { } }; KTp::MobileLoggerPlugin::MobileLoggerPlugin(QObject *parent, const QVariantList &) : KTp::AbstractLoggerPlugin(parent) { const QString dbLocation = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QStringLiteral("/ktp-mobile-logger/"); QSqlDatabase db = QSqlDatabase::addDatabase(QStringLiteral("QSQLITE")); db.setDatabaseName(dbLocation + QStringLiteral("history.db3")); qDebug() << dbLocation << db.open(); } KTp::MobileLoggerPlugin::~MobileLoggerPlugin() { } KTp::PendingLoggerDates* KTp::MobileLoggerPlugin::queryDates(const Tp::AccountPtr &account, const KTp::LogEntity &entity) { return new MobileLoggerPendingDates(account, entity, this); } KTp::PendingLoggerLogs* KTp::MobileLoggerPlugin::queryLogs(const Tp::AccountPtr &account, const KTp::LogEntity &entity, const QDate &date) { return new MobileLoggerPendingLogs(account, entity, date, this); } KTp::PendingLoggerEntities* KTp::MobileLoggerPlugin::queryEntities(const Tp::AccountPtr &account) { return new MobileLoggerPendingEntities(account, this); } bool KTp::MobileLoggerPlugin::handlesAccount(const Tp::AccountPtr &account) { return true; } void KTp::MobileLoggerPlugin::clearAccountLogs(const Tp::AccountPtr &account) { } void KTp::MobileLoggerPlugin::clearContactLogs(const Tp::AccountPtr &account, const KTp::LogEntity &entity) { } KTp::PendingLoggerSearch* KTp::MobileLoggerPlugin::search(const QString &term) { return new A(term); } bool KTp::MobileLoggerPlugin::logsExist(const Tp::AccountPtr &account, const KTp::LogEntity &contact) { return true; } K_PLUGIN_FACTORY(MobileLoggerPluginFactory, registerPlugin();) #include "mobile-logger.moc" diff --git a/src/ktp-plugins/ktp-logger-plugin/mobile-logger.h b/src/ktp-plugins/ktp-logger-plugin/mobile-logger.h index ae0b5e4..490e3f5 100644 --- a/src/ktp-plugins/ktp-logger-plugin/mobile-logger.h +++ b/src/ktp-plugins/ktp-logger-plugin/mobile-logger.h @@ -1,160 +1,160 @@ /* * Copyright (C) 2016 Martin Klapetek #include #include namespace KTp { class PendingLoggerDates; class PendingLoggerLogs; class PendingLoggerEntities; class PendingLoggerSearch; class LogEntity; class MobileLoggerPlugin : public AbstractLoggerPlugin { Q_OBJECT public: /** * Constructor. */ explicit MobileLoggerPlugin(QObject *parent, const QVariantList &); /** * Destructor. */ - virtual ~MobileLoggerPlugin(); + ~MobileLoggerPlugin() override; /** * Queries all available plugins that handle given @p account for list of dates * with logs of user's chat with @p entity. * * @param account Account to query * @param entity Entity * @return Returns KTp::PendingLoggerDates operation that will emit finished() * signal when all backends are finished. */ - virtual KTp::PendingLoggerDates* queryDates(const Tp::AccountPtr &account, + KTp::PendingLoggerDates* queryDates(const Tp::AccountPtr &account, const KTp::LogEntity &entity) Q_DECL_OVERRIDE; /** * Queries all available plugins that handle given @p account for list of * logs of chats with @p entity. * * @param account Account to query * @param entity Entity whose logs should be retrieved * @param date Specific date for which to retrieve logs * @return Returns KTp::PendingLoggerLogs operation that will emit finished() * signal when all backends are finished. */ - virtual KTp::PendingLoggerLogs* queryLogs(const Tp::AccountPtr &account, + KTp::PendingLoggerLogs* queryLogs(const Tp::AccountPtr &account, const KTp::LogEntity &entity, const QDate &date) Q_DECL_OVERRIDE; /** * Queries all available plugins that handle given @p account for list of * entities for which they have conversation logs. * * @param account Account to query * @return Returns KTp::PendingLoggerEntities operation that will emit finished() * signal when all backends are finished. */ - virtual KTp::PendingLoggerEntities* queryEntities(const Tp::AccountPtr &account) Q_DECL_OVERRIDE; + KTp::PendingLoggerEntities* queryEntities(const Tp::AccountPtr &account) Q_DECL_OVERRIDE; /** * Returnes whether plugin handles logs for given @p account. * * For example, a dedicated Facebook plugin will handle only accounts that * represent Facebook accounts, therefore it makes no sense to query it for * logs from GTalk account for instance. * * By default this method returns true, which means that plugin supports any * kind of account. */ - virtual bool handlesAccount(const Tp::AccountPtr &account) Q_DECL_OVERRIDE; + bool handlesAccount(const Tp::AccountPtr &account) Q_DECL_OVERRIDE; /** * Removes all logs for given @p account from all available plugins that * handle it. * * @param account Account of which to remove logs */ - virtual void clearAccountLogs(const Tp::AccountPtr &account) Q_DECL_OVERRIDE; + void clearAccountLogs(const Tp::AccountPtr &account) Q_DECL_OVERRIDE; /** * Removes all logs for given @p entity from all available plugins that * handle the @p account. * * @param account Account to query * @param entity Entity whose logs to remove */ - virtual void clearContactLogs(const Tp::AccountPtr &account, + void clearContactLogs(const Tp::AccountPtr &account, const KTp::LogEntity &entity) Q_DECL_OVERRIDE; /** * Searches all logs for given @p term. * * @param term Term to search * @return Returns KTp::PendingLoggerSearch operation that will emit finished() * when all results are available */ - virtual KTp::PendingLoggerSearch* search(const QString &term) Q_DECL_OVERRIDE; + KTp::PendingLoggerSearch* search(const QString &term) Q_DECL_OVERRIDE; /** * Sets a new Tp::AccountManager to be used by the plugin. * * The @p accountManager is expected to be in ready state. * * @param accountManager An Tp::AccountManager in the ready state. */ // virtual void setAccountManager(const Tp::AccountManagerPtr &accountManager) Q_DECL_OVERRIDE; /** * Returns the set Tp::AccountManager or an empty pointer if none was set. */ // virtual Tp::AccountManagerPtr accountManager() const Q_DECL_OVERRIDE; /** * Checks whether there are any logs for given @p account and @p contact. * * For easy use this method is synchronous and can block for a while in case * of a slower plugin. * * @param account Account to query * @param contact Contact to query * @return Returns whether there are any logs for given person */ - virtual bool logsExist(const Tp::AccountPtr &account, const KTp::LogEntity &contact) Q_DECL_OVERRIDE; + bool logsExist(const Tp::AccountPtr &account, const KTp::LogEntity &contact) Q_DECL_OVERRIDE; private: // class Private; // Private * const d; }; } // namespace KTp #endif diff --git a/src/ktp-plugins/mobile-logger/channel-watcher.h b/src/ktp-plugins/mobile-logger/channel-watcher.h index 5563966..623d3cb 100644 --- a/src/ktp-plugins/mobile-logger/channel-watcher.h +++ b/src/ktp-plugins/mobile-logger/channel-watcher.h @@ -1,79 +1,79 @@ /* * Copyright (C) 2013 David Edmundson * Copyright (C) 2016 Martin Klapetek * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef KTP_CHANNEL_WATCHER_H #define KTP_CHANNEL_WATCHER_H #include #include #include #include #include #include #include #include #include #include class StorageMessage { public: int id; QDateTime messageDateTime; QDateTime deliveredDateTime; uint accountObjectPathId; uint targetContactId; QString message; QString messageToken; bool isIncoming; bool isDelivered; uint type; }; class ChannelWatcher : public QObject, public Tp::RefCounted { Q_OBJECT public: - ChannelWatcher(const Tp::TextChannelPtr &channel, const QString &accountObjectPath, QObject *parent = 0); - ~ChannelWatcher(); + ChannelWatcher(const Tp::TextChannelPtr &channel, const QString &accountObjectPath, QObject *parent = nullptr); + ~ChannelWatcher() override; Q_SIGNALS: void invalidated(); private Q_SLOTS: void onMessageReceived(const Tp::ReceivedMessage &message); void onMessageSent(const Tp::Message &message); private: void storeContactInfo(); void storeAccountInfo(); void storeMessage(const StorageMessage &message); Tp::TextChannelPtr m_channel; QString m_accountObjectPath; QSqlDatabase m_db; uint m_contactDbId; uint m_accountDbId; }; typedef Tp::SharedPtr ChannelWatcherPtr; #endif diff --git a/src/ktp-plugins/mobile-logger/text-channel-observer.h b/src/ktp-plugins/mobile-logger/text-channel-observer.h index f74b55e..0efd857 100644 --- a/src/ktp-plugins/mobile-logger/text-channel-observer.h +++ b/src/ktp-plugins/mobile-logger/text-channel-observer.h @@ -1,57 +1,57 @@ /* * Copyright (C) 2013 David Edmundson * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef KTP_TEXT_CHANNEL_OBSERVER_H #define KTP_TEXT_CHANNEL_OBSERVER_H #include #include #include #include "channel-watcher.h" namespace KTp { class TextChannelObserver : public QObject, public Tp::AbstractClientObserver { Q_OBJECT public: - explicit TextChannelObserver(QObject *parent = 0); - virtual ~TextChannelObserver(); + explicit TextChannelObserver(QObject *parent = nullptr); + ~TextChannelObserver() override; - virtual void observeChannels(const Tp::MethodInvocationContextPtr<> &context, + void observeChannels(const Tp::MethodInvocationContextPtr<> &context, const Tp::AccountPtr &account, const Tp::ConnectionPtr &connection, const QList &channels, const Tp::ChannelDispatchOperationPtr &dispatchOperation, const QList &requestsSatisfied, - const Tp::AbstractClientObserver::ObserverInfo &observerInfo); + const Tp::AbstractClientObserver::ObserverInfo &observerInfo) override; private Q_SLOTS: void onChannelInvalidated(); private: class Private; Private *d; }; } #endif // KTP_TEXT_CHANNEL_OBSERVER_H