Changeset View
Changeset View
Standalone View
Standalone View
src/createavatarjob.cpp
Show All 11 Lines | |||||
12 | * GNU General Public License for more details. * | 12 | * GNU General Public License for more details. * | ||
13 | * * | 13 | * * | ||
14 | * You should have received a copy of the GNU General Public License * | 14 | * You should have received a copy of the GNU General Public License * | ||
15 | * along with this program; if not, write to the Free Software * | 15 | * along with this program; if not, write to the Free Software * | ||
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * | 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * | ||
17 | *************************************************************************************/ | 17 | *************************************************************************************/ | ||
18 | 18 | | |||
19 | #include "createavatarjob.h" | 19 | #include "createavatarjob.h" | ||
20 | #include "user_manager_debug.h" | ||||
20 | 21 | | |||
21 | #include <QImage> | 22 | #include <QImage> | ||
22 | #include "user_manager_debug.h" | 23 | #include <QPixmap> | ||
23 | #include <kio/copyjob.h> | 24 | #include <QTemporaryFile> | ||
24 | #include <KTemporaryFile> | 25 | #include <QtGlobal> | ||
26 | | ||||
27 | #include <KIO/CopyJob> | ||||
25 | #include <KPixmapRegionSelectorDialog> | 28 | #include <KPixmapRegionSelectorDialog> | ||
26 | 29 | | |||
27 | CreateAvatarJob::CreateAvatarJob(QObject* parent) : KJob(parent) | 30 | CreateAvatarJob::CreateAvatarJob(QObject* parent) : KJob(parent) | ||
28 | { | 31 | { | ||
29 | } | 32 | } | ||
30 | 33 | | |||
31 | void CreateAvatarJob::setUrl(const QUrl& url) | 34 | void CreateAvatarJob::setUrl(const QUrl& url) | ||
32 | { | 35 | { | ||
Show All 9 Lines | |||||
42 | { | 45 | { | ||
43 | QMetaObject::invokeMethod(this, "doStart", Qt::QueuedConnection); | 46 | QMetaObject::invokeMethod(this, "doStart", Qt::QueuedConnection); | ||
44 | } | 47 | } | ||
45 | 48 | | |||
46 | void CreateAvatarJob::doStart() | 49 | void CreateAvatarJob::doStart() | ||
47 | { | 50 | { | ||
48 | qCDebug(USER_MANAGER_LOG) << "Starting: " << m_url; | 51 | qCDebug(USER_MANAGER_LOG) << "Starting: " << m_url; | ||
49 | 52 | | |||
50 | KTemporaryFile file; | 53 | QTemporaryFile file; | ||
51 | file.open(); | 54 | file.open(); | ||
52 | m_tmpFile = file.fileName(); | 55 | m_tmpFile = file.fileName(); | ||
53 | file.remove(); | 56 | file.remove(); | ||
54 | 57 | | |||
55 | qCDebug(USER_MANAGER_LOG) << "From: " << m_url << "to: " << m_tmpFile; | 58 | qCDebug(USER_MANAGER_LOG) << "From: " << m_url << "to: " << m_tmpFile; | ||
56 | KIO::CopyJob* job = KIO::copy(m_url, QUrl::fromLocalFile(m_tmpFile), KIO::HideProgressInfo); | 59 | KIO::CopyJob* job = KIO::copy(m_url, QUrl::fromLocalFile(m_tmpFile), KIO::HideProgressInfo); | ||
57 | connect(job, SIGNAL(finished(KJob*)), SLOT(copyDone(KJob*))); | 60 | connect(job, SIGNAL(finished(KJob*)), SLOT(copyDone(KJob*))); | ||
58 | job->setUiDelegate(0); | 61 | job->setUiDelegate(0); | ||
Show All 17 Lines |