diff options
author | Will Thompson <will.thompson@collabora.co.uk> | 2013-01-16 14:47:30 +0000 |
---|---|---|
committer | Will Thompson <will.thompson@collabora.co.uk> | 2013-01-16 14:50:47 +0000 |
commit | 2332f4c6c6445616672617b587addc7211d3e99a (patch) | |
tree | 7717c69e6454c3b11d987ede75116562b5e88a2a /telepathy-logger/log-store-empathy-internal.h | |
parent | 586e2c4b847e8c39a01b648ab24e4cbd44dae67d (diff) | |
download | telepathy-logger-2332f4c6c6445616672617b587addc7211d3e99a.tar.gz |
Split legacy Empathy log reader into its own class
My commit eaefb26 introduced a regression: by assuming that any class
that implements add_event is writable, logs were being written to the
legacy Empathy location.
By splitting the legacy location handling into a subclass, we can
override add_event to un-implement it and make the subclass read-only,
as well as removing special cases from the XML store itself.
Thanks to Debarshi Ray for catching this!
Diffstat (limited to 'telepathy-logger/log-store-empathy-internal.h')
-rw-r--r-- | telepathy-logger/log-store-empathy-internal.h | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/telepathy-logger/log-store-empathy-internal.h b/telepathy-logger/log-store-empathy-internal.h new file mode 100644 index 0000000..8022445 --- /dev/null +++ b/telepathy-logger/log-store-empathy-internal.h @@ -0,0 +1,53 @@ +/* + * Copyright © 2013 Collabora Ltd. + * + * 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 TPL_LOG_STORE_EMPATHY_H +#define TPL_LOG_STORE_EMPATHY_H + +#include "log-store-xml-internal.h" + +typedef struct _TplLogStoreEmpathy TplLogStoreEmpathy; +typedef struct _TplLogStoreEmpathyClass TplLogStoreEmpathyClass; + +struct _TplLogStoreEmpathyClass { + TplLogStoreXmlClass parent_class; +}; + +struct _TplLogStoreEmpathy { + TplLogStoreXml parent; +}; + +GType _tpl_log_store_empathy_get_type (void); + +/* TYPE MACROS */ +#define TPL_TYPE_LOG_STORE_EMPATHY \ + (_tpl_log_store_empathy_get_type ()) +#define TPL_LOG_STORE_EMPATHY(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), TPL_TYPE_LOG_STORE_EMPATHY, TplLogStoreEmpathy)) +#define TPL_LOG_STORE_EMPATHY_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), TPL_TYPE_LOG_STORE_EMPATHY,\ + TplLogStoreEmpathyClass)) +#define TPL_IS_LOG_STORE_EMPATHY(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), TPL_TYPE_LOG_STORE_EMPATHY)) +#define TPL_IS_LOG_STORE_EMPATHY_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE((klass), TPL_TYPE_LOG_STORE_EMPATHY)) +#define TPL_LOG_STORE_EMPATHY_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS ((obj), TPL_TYPE_LOG_STORE_EMPATHY, \ + TplLogStoreEmpathyClass)) + +#endif /* TPL_LOG_STORE_EMPATHY_H */ |