From 36a91d78aa5a556425128a4069803a042975535c Mon Sep 17 00:00:00 2001 From: codestation Date: Sat, 28 Jun 2014 00:26:14 -0430 Subject: [PATCH] Fixed android compilation. Version bump. Fixed file size problem under windows. Updated changelog. --- ChangeLog | 7 + qcma.pro | 9 +- qcma_cli.pro | 2 +- qcma_common.pri | 4 +- rpmbuild/qcma-fedora.spec | 2 +- rpmbuild/qcma-openSUSE.spec | 2 +- src/androidmessage.cpp | 45 ---- src/androidmessage.h | 36 --- src/cmaevent.cpp | 4 +- src/cmaobject.cpp | 1 - src/cmautils.cpp | 9 +- src/forms/backupmanagerform.ui | 405 ++++++++++++++++++++++++--------- src/forms/configwidget.ui | 2 +- src/httpdownloader.cpp | 4 +- src/httpdownloader.h | 4 +- 15 files changed, 326 insertions(+), 210 deletions(-) delete mode 100644 src/androidmessage.cpp delete mode 100644 src/androidmessage.h diff --git a/ChangeLog b/ChangeLog index a5ac386..94cea78 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +qcma (0.3.3) unstable; urgency=low + + * Fixed wrong file sizes under windows. + * Fixed compilation with android toolchain. + + -- codestation Thu, 28 Jun 2014 00:00:00 -0000 + qcma (0.3.2) unstable; urgency=low * Fixed bug with PSP savedata transfer. diff --git a/qcma.pro b/qcma.pro index 6c0c47c..38703d0 100644 --- a/qcma.pro +++ b/qcma.pro @@ -5,10 +5,15 @@ #------------------------------------------------- TEMPLATE = subdirs -SUBDIRS = qcma_gui.pro + +android { + SUBDIRS = qcma_android.pro +} else { + SUBDIRS = qcma_gui.pro +} # Compile the headless binary only on Linux because it depends on dbus -unix:!macx { +unix:!macx:!android { SUBDIRS += qcma_cli.pro } diff --git a/qcma_cli.pro b/qcma_cli.pro index fae77d5..ce02750 100644 --- a/qcma_cli.pro +++ b/qcma_cli.pro @@ -1,6 +1,6 @@ include(qcma_common.pri) -QT += dbus +unix:!macx:QT += dbus TARGET = qcma_cli diff --git a/qcma_common.pri b/qcma_common.pri index 2015618..f5dde8b 100644 --- a/qcma_common.pri +++ b/qcma_common.pri @@ -6,7 +6,7 @@ QT += core network sql -VERSION = 0.3.2 +VERSION = 0.3.3 TEMPLATE = app @@ -51,7 +51,7 @@ OTHER_FILES += \ qcma.rc INCLUDEPATH += src/ - +QT_CONFIG -= no-pkg-config RESOURCES += qcmares.qrc translations.qrc # find packages using pkg-config diff --git a/rpmbuild/qcma-fedora.spec b/rpmbuild/qcma-fedora.spec index 8723759..b1ad9b7 100644 --- a/rpmbuild/qcma-fedora.spec +++ b/rpmbuild/qcma-fedora.spec @@ -6,7 +6,7 @@ Name: qcma Summary: PSVita Content Manager Assistant License: GPL-3.0 Release: 1 -Version: 0.3.2 +Version: 0.3.3 URL: https://github.com/codestation/qcma Source: https://github.com/codestation/qcma.git Group: Productivity/File utilities diff --git a/rpmbuild/qcma-openSUSE.spec b/rpmbuild/qcma-openSUSE.spec index 1b891ae..ea766af 100644 --- a/rpmbuild/qcma-openSUSE.spec +++ b/rpmbuild/qcma-openSUSE.spec @@ -6,7 +6,7 @@ Name: qcma Summary: PSVita Content Manager Assistant License: GPL-3.0 Release: 1 -Version: 0.3.2 +Version: 0.3.3 URL: https://github.com/codestation/qcma Source: https://github.com/codestation/qcma.git Group: Productivity/File utilities diff --git a/src/androidmessage.cpp b/src/androidmessage.cpp deleted file mode 100644 index d0aa014..0000000 --- a/src/androidmessage.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/* - * QCMA: Cross-platform content manager assistant for the PS Vita - * - * Copyright (C) 2013 Codestation - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "androidmessage.h" - -#include - -AndroidMessage::AndroidMessage(QObject *parent) : - QObject(parent) -{ -} - -void AndroidMessage::showToast(const QString &message) -{ - QAndroidJniObject javaMessage = QAndroidJniObject::fromString(message); - QAndroidJniObject::callStaticMethod("com/github/codestation/qcma/QcmaNotification", - "showToast", - "(Ljava/lang/String;)V", - javaMessage.object()); -} - -void AndroidMessage::showDialog(const QString &message) -{ - QAndroidJniObject javaMessage = QAndroidJniObject::fromString(message); - QAndroidJniObject::callStaticMethod("com/github/codestation/qcma/QcmaNotification", - "showDialog", - "(Ljava/lang/String;)V", - javaMessage.object()); -} diff --git a/src/androidmessage.h b/src/androidmessage.h deleted file mode 100644 index 86678e7..0000000 --- a/src/androidmessage.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * QCMA: Cross-platform content manager assistant for the PS Vita - * - * Copyright (C) 2013 Codestation - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef ANDROIDMESSAGE_H -#define ANDROIDMESSAGE_H - -#include - -class AndroidMessage : public QObject -{ - Q_OBJECT -public: - explicit AndroidMessage(QObject *parent = 0); - -public slots: - void showToast(const QString &message); - void showDialog(const QString &message); -}; - -#endif // ANDROIDMESSAGE_H diff --git a/src/cmaevent.cpp b/src/cmaevent.cpp index ae77839..823bcd0 100644 --- a/src/cmaevent.cpp +++ b/src/cmaevent.cpp @@ -452,7 +452,7 @@ void CmaEvent::vitaEventSendObject(vita_event_t *event, int eventId) quint32 handle; do { - unsigned long len = metadata->size; + quint64 len = metadata->size; m_file = new QFile(m_db->getAbsolutePath(metadata->ohfi)); // read the file to send if it's not a directory @@ -477,7 +477,7 @@ void CmaEvent::vitaEventSendObject(vita_event_t *event, int eventId) } // send the data over - qDebug("Sending %s of %lu bytes to device", metadata->name, len); + qDebug("Sending %s of %llu bytes to device", metadata->name, len); qDebug("OHFI %d with handle 0x%08X", metadata->ohfi, parentHandle); VitaMTP_RegisterCancelEventId(eventId); diff --git a/src/cmaobject.cpp b/src/cmaobject.cpp index 0fe18a3..0b2ed4e 100644 --- a/src/cmaobject.cpp +++ b/src/cmaobject.cpp @@ -186,7 +186,6 @@ void CMAObject::updateObjectSize(qint64 size) if(parent) { parent->updateObjectSize(size); } - //FIXME: size should be quint64 metadata.size += size; } diff --git a/src/cmautils.cpp b/src/cmautils.cpp index 1c31d18..6560231 100644 --- a/src/cmautils.cpp +++ b/src/cmautils.cpp @@ -27,14 +27,11 @@ #ifdef Q_OS_WIN32 #include -#else -#ifndef __ANDROID__ -#include -#else +#elif defined Q_OS_ANDROID #include #define statvfs statfs -#define fstatvfs fstatfs -#endif +#else +#include #endif bool getDiskSpace(const QString &dir, quint64 *free, quint64 *total) diff --git a/src/forms/backupmanagerform.ui b/src/forms/backupmanagerform.ui index e66d749..7a6c8a4 100644 --- a/src/forms/backupmanagerform.ui +++ b/src/forms/backupmanagerform.ui @@ -14,117 +14,306 @@ Backup Manager - - - - - - - - Online ID / Username - - - - - - - - - - - - QFormLayout::AllNonFixedFieldsGrow - - - - - Backup Type - - - 2 - - - - - - - - PS Vita Games - - - - - PSP Games - - - - - PSM Games - - - - - PSOne Games - - - - - PSP Savedatas - - - - - Backups - - - - - - - - - - - - 1 + + + + true - + + 0 + + + + Backup Manager + + + + + + 1 + + + + + + + + + + + + Online ID / Username + + + + + + + + + + + + QFormLayout::AllNonFixedFieldsGrow + + + + + Backup Type + + + 2 + + + + + + + + PS Vita Games + + + + + PSP Games + + + + + PSM Games + + + + + PSOne Games + + + + + PSP Savedatas + + + + + Backups + + + + + + + + + + + + + + Backup disk usage + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + FilterLineEdit { color:gray; font-style:italic; } + + + Filter + + + + + + + + + + false + + + Download List + + + + + + + + + + Console + + + + + + + + PS Vita + + + + + PSP + + + + + Other + + + + + + + + Content + + + + + + + + Games + + + + + Demos + + + + + DLC + + + + + Other + + + + + + + + Status + + + + + + + + New + + + + + Downloading + + + + + Completed + + + + + Paused + + + + + + + + + + + + Username: + + + + + + + + + + Password: + + + + + + + QLineEdit::Password + + + + + + + Refresh + + + + + + + + + + + + + + Filter: + + + + + + + + + + Resume All + + + + + + + Pause All + + + + + + + + + - - - - - - Backup disk usage - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - FilterLineEdit { color:gray; font-style:italic; } - - - Filter - - - - - diff --git a/src/forms/configwidget.ui b/src/forms/configwidget.ui index 91df22a..f4b96e6 100644 --- a/src/forms/configwidget.ui +++ b/src/forms/configwidget.ui @@ -7,7 +7,7 @@ 0 0 520 - 437 + 450 diff --git a/src/httpdownloader.cpp b/src/httpdownloader.cpp index ddf4b68..25df53c 100644 --- a/src/httpdownloader.cpp +++ b/src/httpdownloader.cpp @@ -31,8 +31,8 @@ QMutex HTTPDownloader::dataAvailable; QMutex HTTPDownloader::dataRead; char *HTTPDownloader::buffer = NULL; -unsigned long HTTPDownloader::bufferSize = 0; -unsigned long HTTPDownloader::downloadLeft = 0; +qint64 HTTPDownloader::bufferSize = 0; +qint64 HTTPDownloader::downloadLeft = 0; HTTPDownloader::HTTPDownloader(const QString &url, QObject *parent) : QObject(parent), remote_url(url), firstRead(true) diff --git a/src/httpdownloader.h b/src/httpdownloader.h index 2dd585b..8d0014e 100644 --- a/src/httpdownloader.h +++ b/src/httpdownloader.h @@ -58,8 +58,8 @@ private: volatile static qint64 m_contentLength; static char *buffer; - static unsigned long bufferSize; - static unsigned long downloadLeft; + static qint64 bufferSize; + static qint64 downloadLeft; }; #endif // HTTPDOWNLOADER_H