2 This file is part of Blogilo, A KDE Blogging Client
4 Copyright (C) 2008-2010 Mehrdad Momeny <mehrdad.momeny@gmail.com>
5 Copyright (C) 2008-2010 Golnaz Nilieh <g382nilieh@gmail.com>
7 This program is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License as
9 published by the Free Software Foundation; either version 2 of
10 the License or (at your option) version 3 or any later version
11 accepted by the membership of KDE e.V. (or its successor approved
12 by the membership of KDE e.V.), which shall act as a proxy
13 defined in Section 14 of version 3 of the license.
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, see http://www.gnu.org/licenses/
24 #include "bilbomedia.h"
26 #include "blogilo_debug.h"
30 class Q_DECL_HIDDEN
BilboMedia::Private
51 BilboMedia::BilboMedia(QObject
*parent
)
52 : QObject(parent
), d(new Private
)
57 BilboMedia::~BilboMedia()
62 int BilboMedia::blogId() const
67 void BilboMedia::setBlogId(const int blog_id
)
72 int BilboMedia::mediaId() const
77 void BilboMedia::setMediaId(const int media_id
)
79 d
->mMediaId
= media_id
;
82 bool BilboMedia::isUploaded() const
84 return d
->mIsUploaded
;
87 void BilboMedia::setUploaded(bool uploaded
)
89 d
->mIsUploaded
= uploaded
;
92 QUrl
BilboMedia::localUrl() const
97 void BilboMedia::setLocalUrl(const QUrl
&url
)
102 QUrl
BilboMedia::remoteUrl() const
104 return d
->mRemoteUrl
;
107 void BilboMedia::setRemoteUrl(const QUrl
&url
)
112 QString
BilboMedia::mimeType() const
117 void BilboMedia::setMimeType(const QString
&type
)
122 QString
BilboMedia::name() const
127 void BilboMedia::setName(const QString
&name
)
132 QIcon
BilboMedia::icon() const
136 type
= this->mimeType();
137 if (type
.contains(QStringLiteral("image")) && !this->localUrl().isEmpty()) {
138 iconPic
.load(this->localUrl().toLocalFile());
139 // iconPic.scaled(64, 64, Qt::IgnoreAspectRatio);
140 iconPic
.scaledToHeight(32);
141 if (!iconPic
.isNull()) {
142 return QIcon(iconPic
);
144 qCDebug(BLOGILO_LOG
) << "iconPic is Null";
148 type
.replace(QLatin1Char('/'), QLatin1Char('-'));
152 quint16
BilboMedia::checksum() const
157 void BilboMedia::setCheckSum(quint16 sum
)