message: some fixes for github ci build

This commit is contained in:
Dirk-Jan C. Binnema 2022-03-26 20:30:42 +02:00
parent c63755f749
commit 5a28cdfba4
3 changed files with 10 additions and 5 deletions

View File

@ -28,7 +28,7 @@
namespace Mu { namespace Mu {
struct MimeObject; // forward declaration class MimeObject; // forward declaration
class MessagePart { class MessagePart {
public: public:

View File

@ -81,7 +81,7 @@ Message::Message(const std::string& path, const std::string& mdir):
g_strerror(errno)); g_strerror(errno));
if (!S_ISREG(statbuf.st_mode)) if (!S_ISREG(statbuf.st_mode))
throw Error(Error::Code::File, "not a regular file: %s", path); throw Error(Error::Code::File, "not a regular file: %s", path.c_str());
init_gmime(); init_gmime();
if (auto msg{MimeMessage::make_from_file(path)}; !msg) if (auto msg{MimeMessage::make_from_file(path)}; !msg)

View File

@ -50,7 +50,7 @@ public:
* *
* @param obj a gobject. A ref is added. * @param obj a gobject. A ref is added.
*/ */
Object(GObject* &&obj): self_{g_object_ref(obj)} { Object(GObject* &&obj): self_{G_OBJECT(g_object_ref(obj))} {
if (!G_IS_OBJECT(obj)) if (!G_IS_OBJECT(obj))
throw std::runtime_error("not a g-object"); throw std::runtime_error("not a g-object");
} }
@ -80,7 +80,8 @@ public:
if (this != &other) { if (this != &other) {
auto oldself = self_; auto oldself = self_;
self_ = other.self_ ? g_object_ref(other.self_) : nullptr; self_ = other.self_ ?
G_OBJECT(g_object_ref(other.self_)) : nullptr;
if (oldself) if (oldself)
g_object_unref(oldself); g_object_unref(oldself);
} }
@ -137,7 +138,11 @@ private:
mutable GObject *self_{}; mutable GObject *self_{};
}; };
/**
* Thin wrapper around a GMimeOContentType
*
*/
struct MimeContentType: public Object { struct MimeContentType: public Object {
MimeContentType(GMimeContentType *ctype) : Object{G_OBJECT(ctype)} { MimeContentType(GMimeContentType *ctype) : Object{G_OBJECT(ctype)} {