Enable setting for skip metadata retrieval on database scanning.
Enabled settings for enabling/disabling USB/WiFi monitoring. Make sure to init properly in the db multimedia files copied to the PC. Translate system Qt widgets.
This commit is contained in:
@@ -105,27 +105,27 @@
|
||||
<translation type="obsolete">Agregadas %1 entradas a la base de datos</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/clientmanager.cpp" line="41"/>
|
||||
<location filename="../../src/clientmanager.cpp" line="43"/>
|
||||
<source>Added %1 items to the database</source>
|
||||
<translation>Agregadas %1 entradas a la base de datos</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/clientmanager.cpp" line="43"/>
|
||||
<location filename="../../src/clientmanager.cpp" line="45"/>
|
||||
<source>Database indexing aborted by user</source>
|
||||
<translation>Actualización de la base de datos cancelada por el usuario</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/clientmanager.cpp" line="56"/>
|
||||
<location filename="../../src/clientmanager.cpp" line="58"/>
|
||||
<source>Cannot initialize VitaMTP library</source>
|
||||
<translation>No se pudo inicializar VitaMTP</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/clientmanager.cpp" line="116"/>
|
||||
<location filename="../../src/clientmanager.cpp" line="123"/>
|
||||
<source>Cannot refresh the database while is in use</source>
|
||||
<translation>No se puede actualizar la base de datos mientras se encuentre en uso</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/clientmanager.cpp" line="118"/>
|
||||
<location filename="../../src/clientmanager.cpp" line="125"/>
|
||||
<source>No PS Vita system has been registered</source>
|
||||
<translation>Nigún sistema PS Vita ha sido registrado</translation>
|
||||
</message>
|
||||
@@ -137,8 +137,8 @@
|
||||
<translation type="obsolete">Conectado a </translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/cmaclient.cpp" line="135"/>
|
||||
<location filename="../../src/cmaclient.cpp" line="138"/>
|
||||
<location filename="../../src/cmaclient.cpp" line="141"/>
|
||||
<source>Connected to %1 (PS Vita)</source>
|
||||
<translation>Conectado a %1 (PS Vita)</translation>
|
||||
</message>
|
||||
@@ -236,7 +236,7 @@
|
||||
<message>
|
||||
<location filename="../../src/forms/configwidget.ui" line="230"/>
|
||||
<source><html><head/><body><p align="center"><span style=" font-size:14pt; font-weight:600;">Advanced settings</span></p></body></html></source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation><html><head/><body><p align="center"><span style=" font-size:14pt; font-weight:600;">Ajustes Avanzados</span></p></body></html></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/forms/configwidget.ui" line="237"/>
|
||||
@@ -244,57 +244,57 @@
|
||||
<translation>Modo desconectado</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/forms/configwidget.ui" line="250"/>
|
||||
<location filename="../../src/forms/configwidget.ui" line="247"/>
|
||||
<source>Skip metadata extraction</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Saltar la extracción de metadatos</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/forms/configwidget.ui" line="260"/>
|
||||
<location filename="../../src/forms/configwidget.ui" line="271"/>
|
||||
<source>Update database automatically when files on the PC are changed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation type="unfinished">Actualizar la base de datos automaticamente</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/forms/configwidget.ui" line="270"/>
|
||||
<location filename="../../src/forms/configwidget.ui" line="254"/>
|
||||
<source>Disable USB monitoring</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Deshabilitar monitoreo USB</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/forms/configwidget.ui" line="261"/>
|
||||
<source>Disable Wi-Fi monitoring</source>
|
||||
<translation>Deshabilitar monitoreo WiFi</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/forms/configwidget.ui" line="280"/>
|
||||
<source>Disable Wi-Fi monitoring</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/forms/configwidget.ui" line="289"/>
|
||||
<source>Database backend</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Almacenaje de base de datos</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/forms/configwidget.ui" line="300"/>
|
||||
<location filename="../../src/forms/configwidget.ui" line="291"/>
|
||||
<source>In Memory</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>En memoria</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/forms/configwidget.cpp" line="96"/>
|
||||
<location filename="../../src/forms/configwidget.cpp" line="101"/>
|
||||
<source>Select the folder to be used as a photo source</source>
|
||||
<translation>Seleccione el directorio a ser utilizado como origen de fotos</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/forms/configwidget.cpp" line="101"/>
|
||||
<location filename="../../src/forms/configwidget.cpp" line="106"/>
|
||||
<source>Select the folder to be used as a music source</source>
|
||||
<translation>Seleccione el directorio a ser utilizado como origen de música</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/forms/configwidget.cpp" line="106"/>
|
||||
<location filename="../../src/forms/configwidget.cpp" line="111"/>
|
||||
<source>Select the folder to be used as a video source</source>
|
||||
<translation>Seleccione el directorio a ser utilizado como origen de videos</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/forms/configwidget.cpp" line="111"/>
|
||||
<location filename="../../src/forms/configwidget.cpp" line="116"/>
|
||||
<source>Select the folder to be used to save PS Vita games and backups</source>
|
||||
<translation>Seleccione el directorio a ser utilizado para guardar juegos y respaldos</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/forms/configwidget.cpp" line="116"/>
|
||||
<location filename="../../src/forms/configwidget.cpp" line="121"/>
|
||||
<source>Select the folder to be used to fetch software updates</source>
|
||||
<translation>Seleccione el directorio a ser utilizado para extraer actualizaciones de software</translation>
|
||||
</message>
|
||||
@@ -325,7 +325,7 @@
|
||||
<context>
|
||||
<name>HTTPDownloader</name>
|
||||
<message>
|
||||
<location filename="../../src/httpdownloader.cpp" line="154"/>
|
||||
<location filename="../../src/httpdownloader.cpp" line="153"/>
|
||||
<source>Network error: %1</source>
|
||||
<translation>Error de red: %1</translation>
|
||||
</message>
|
||||
|
@@ -105,27 +105,27 @@
|
||||
<translation type="obsolete">%1個の項目をデータベースに追加しました</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/clientmanager.cpp" line="41"/>
|
||||
<location filename="../../src/clientmanager.cpp" line="43"/>
|
||||
<source>Added %1 items to the database</source>
|
||||
<translation>%1個の項目をデータベースに追加しました</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/clientmanager.cpp" line="43"/>
|
||||
<location filename="../../src/clientmanager.cpp" line="45"/>
|
||||
<source>Database indexing aborted by user</source>
|
||||
<translation>データベース構築がユーザーにより中止されました</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/clientmanager.cpp" line="56"/>
|
||||
<location filename="../../src/clientmanager.cpp" line="58"/>
|
||||
<source>Cannot initialize VitaMTP library</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/clientmanager.cpp" line="116"/>
|
||||
<location filename="../../src/clientmanager.cpp" line="123"/>
|
||||
<source>Cannot refresh the database while is in use</source>
|
||||
<translation>使用中にはデータベースを更新できません</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/clientmanager.cpp" line="118"/>
|
||||
<location filename="../../src/clientmanager.cpp" line="125"/>
|
||||
<source>No PS Vita system has been registered</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
@@ -137,8 +137,8 @@
|
||||
<translation type="obsolete">次のデバイスに接続しました </translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/cmaclient.cpp" line="135"/>
|
||||
<location filename="../../src/cmaclient.cpp" line="138"/>
|
||||
<location filename="../../src/cmaclient.cpp" line="141"/>
|
||||
<source>Connected to %1 (PS Vita)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
@@ -244,57 +244,57 @@
|
||||
<translation>オフラインモード</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/forms/configwidget.ui" line="250"/>
|
||||
<location filename="../../src/forms/configwidget.ui" line="247"/>
|
||||
<source>Skip metadata extraction</source>
|
||||
<translation>メタデータの展開をスキップする</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/forms/configwidget.ui" line="260"/>
|
||||
<location filename="../../src/forms/configwidget.ui" line="271"/>
|
||||
<source>Update database automatically when files on the PC are changed</source>
|
||||
<translation>PCのファイルが変更された際にデータベースを自動的に更新する</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/forms/configwidget.ui" line="270"/>
|
||||
<location filename="../../src/forms/configwidget.ui" line="254"/>
|
||||
<source>Disable USB monitoring</source>
|
||||
<translation>USBの監視を無効にする</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/forms/configwidget.ui" line="280"/>
|
||||
<location filename="../../src/forms/configwidget.ui" line="261"/>
|
||||
<source>Disable Wi-Fi monitoring</source>
|
||||
<translation>Wi-Fiの監視を無効にする</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/forms/configwidget.ui" line="289"/>
|
||||
<location filename="../../src/forms/configwidget.ui" line="280"/>
|
||||
<source>Database backend</source>
|
||||
<translation>データベース保存</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/forms/configwidget.ui" line="300"/>
|
||||
<location filename="../../src/forms/configwidget.ui" line="291"/>
|
||||
<source>In Memory</source>
|
||||
<translation>メモリ内</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/forms/configwidget.cpp" line="96"/>
|
||||
<location filename="../../src/forms/configwidget.cpp" line="101"/>
|
||||
<source>Select the folder to be used as a photo source</source>
|
||||
<translation>フォトの参照先として使用されるフォルダを選択してください</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/forms/configwidget.cpp" line="101"/>
|
||||
<location filename="../../src/forms/configwidget.cpp" line="106"/>
|
||||
<source>Select the folder to be used as a music source</source>
|
||||
<translation>ミュージックの参照先として使用されるフォルダを選択してください</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/forms/configwidget.cpp" line="106"/>
|
||||
<location filename="../../src/forms/configwidget.cpp" line="111"/>
|
||||
<source>Select the folder to be used as a video source</source>
|
||||
<translation>ビデオの参照先として使用されるフォルダを選択してください</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/forms/configwidget.cpp" line="111"/>
|
||||
<location filename="../../src/forms/configwidget.cpp" line="116"/>
|
||||
<source>Select the folder to be used to save PS Vita games and backups</source>
|
||||
<translation>PS Vitaのゲームとバックアップの保存に使用されるフォルダを選択してください</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/forms/configwidget.cpp" line="116"/>
|
||||
<location filename="../../src/forms/configwidget.cpp" line="121"/>
|
||||
<source>Select the folder to be used to fetch software updates</source>
|
||||
<translation>ソフトウェアアップデートの取得に使用されるフォルダを選択してください</translation>
|
||||
</message>
|
||||
@@ -326,7 +326,7 @@
|
||||
<context>
|
||||
<name>HTTPDownloader</name>
|
||||
<message>
|
||||
<location filename="../../src/httpdownloader.cpp" line="154"/>
|
||||
<location filename="../../src/httpdownloader.cpp" line="153"/>
|
||||
<source>Network error: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
@@ -22,6 +22,8 @@
|
||||
#include "utils.h"
|
||||
#include "forms/progressform.h"
|
||||
|
||||
#include <QSettings>
|
||||
|
||||
#include <vitamtp.h>
|
||||
|
||||
ClientManager::ClientManager(QObject *parent) :
|
||||
@@ -59,6 +61,7 @@ void ClientManager::start()
|
||||
|
||||
// initializing database for the first use
|
||||
refreshDatabase();
|
||||
|
||||
CmaEvent::db = &db;
|
||||
connect(&db, SIGNAL(fileAdded(QString)), &progress, SLOT(setFileName(QString)));
|
||||
connect(&db, SIGNAL(directoryAdded(QString)), &progress, SLOT(setDirectoryName(QString)));
|
||||
@@ -68,44 +71,53 @@ void ClientManager::start()
|
||||
thread_count = 0;
|
||||
qDebug("Starting cma threads");
|
||||
CmaClient *client;
|
||||
QSettings settings;
|
||||
|
||||
usb_thread = new QThread();
|
||||
client = new CmaClient();
|
||||
usb_thread->setObjectName("usb_thread");
|
||||
connect(usb_thread, SIGNAL(started()), client, SLOT(connectUsb()));
|
||||
connect(client, SIGNAL(messageSent(QString)), this, SIGNAL(messageSent(QString)));
|
||||
connect(client, SIGNAL(finished()), usb_thread, SLOT(quit()), Qt::DirectConnection);
|
||||
connect(usb_thread, SIGNAL(finished()), usb_thread, SLOT(deleteLater()));
|
||||
connect(usb_thread, SIGNAL(finished()), this, SLOT(threadStopped()));
|
||||
connect(usb_thread, SIGNAL(finished()), client, SLOT(deleteLater()));
|
||||
if(!settings.value("disableUSB", false).toBool()) {
|
||||
usb_thread = new QThread();
|
||||
client = new CmaClient();
|
||||
usb_thread->setObjectName("usb_thread");
|
||||
connect(usb_thread, SIGNAL(started()), client, SLOT(connectUsb()));
|
||||
connect(client, SIGNAL(messageSent(QString)), this, SIGNAL(messageSent(QString)));
|
||||
connect(client, SIGNAL(finished()), usb_thread, SLOT(quit()), Qt::DirectConnection);
|
||||
connect(usb_thread, SIGNAL(finished()), usb_thread, SLOT(deleteLater()));
|
||||
connect(usb_thread, SIGNAL(finished()), this, SLOT(threadStopped()));
|
||||
connect(usb_thread, SIGNAL(finished()), client, SLOT(deleteLater()));
|
||||
|
||||
connect(client, SIGNAL(deviceConnected(QString)), this, SIGNAL(deviceConnected(QString)));
|
||||
connect(client, SIGNAL(deviceDisconnected()), this, SIGNAL(deviceDisconnected()));
|
||||
connect(client, SIGNAL(refreshDatabase()), this, SLOT(refreshDatabase()));
|
||||
connect(client, SIGNAL(deviceConnected(QString)), this, SIGNAL(deviceConnected(QString)));
|
||||
connect(client, SIGNAL(deviceDisconnected()), this, SIGNAL(deviceDisconnected()));
|
||||
connect(client, SIGNAL(refreshDatabase()), this, SLOT(refreshDatabase()));
|
||||
|
||||
client->moveToThread(usb_thread);
|
||||
usb_thread->start();
|
||||
thread_count++;
|
||||
client->moveToThread(usb_thread);
|
||||
usb_thread->start();
|
||||
thread_count++;
|
||||
}
|
||||
|
||||
wireless_thread = new QThread();
|
||||
client = new CmaClient();
|
||||
wireless_thread->setObjectName("wireless_thread");
|
||||
connect(wireless_thread, SIGNAL(started()), client, SLOT(connectWireless()));
|
||||
connect(client, SIGNAL(messageSent(QString)), this, SIGNAL(messageSent(QString)));
|
||||
connect(client, SIGNAL(receivedPin(QString,int)), this, SLOT(showPinDialog(QString,int)));
|
||||
connect(client, SIGNAL(finished()), wireless_thread, SLOT(quit()), Qt::DirectConnection);
|
||||
connect(wireless_thread, SIGNAL(finished()), wireless_thread, SLOT(deleteLater()));
|
||||
connect(wireless_thread, SIGNAL(finished()), this, SLOT(threadStopped()));
|
||||
connect(wireless_thread, SIGNAL(finished()), client, SLOT(deleteLater()));
|
||||
if(!settings.value("disableWireless", false).toBool()) {
|
||||
wireless_thread = new QThread();
|
||||
client = new CmaClient();
|
||||
wireless_thread->setObjectName("wireless_thread");
|
||||
connect(wireless_thread, SIGNAL(started()), client, SLOT(connectWireless()));
|
||||
connect(client, SIGNAL(messageSent(QString)), this, SIGNAL(messageSent(QString)));
|
||||
connect(client, SIGNAL(receivedPin(QString,int)), this, SLOT(showPinDialog(QString,int)));
|
||||
connect(client, SIGNAL(finished()), wireless_thread, SLOT(quit()), Qt::DirectConnection);
|
||||
connect(wireless_thread, SIGNAL(finished()), wireless_thread, SLOT(deleteLater()));
|
||||
connect(wireless_thread, SIGNAL(finished()), this, SLOT(threadStopped()));
|
||||
connect(wireless_thread, SIGNAL(finished()), client, SLOT(deleteLater()));
|
||||
|
||||
connect(client, SIGNAL(pinComplete()), &pinForm, SLOT(hide()));
|
||||
connect(client, SIGNAL(deviceConnected(QString)), this, SIGNAL(deviceConnected(QString)));
|
||||
connect(client, SIGNAL(deviceDisconnected()), this, SIGNAL(deviceDisconnected()));
|
||||
connect(client, SIGNAL(refreshDatabase()), this, SLOT(refreshDatabase()));
|
||||
connect(client, SIGNAL(pinComplete()), &pinForm, SLOT(hide()));
|
||||
connect(client, SIGNAL(deviceConnected(QString)), this, SIGNAL(deviceConnected(QString)));
|
||||
connect(client, SIGNAL(deviceDisconnected()), this, SIGNAL(deviceDisconnected()));
|
||||
connect(client, SIGNAL(refreshDatabase()), this, SLOT(refreshDatabase()));
|
||||
|
||||
client->moveToThread(wireless_thread);
|
||||
wireless_thread->start();
|
||||
thread_count++;
|
||||
client->moveToThread(wireless_thread);
|
||||
wireless_thread->start();
|
||||
thread_count++;
|
||||
}
|
||||
|
||||
if(thread_count == 0) {
|
||||
emit messageSent(tr("You must enable at least USB or Wireless monitoring"));
|
||||
}
|
||||
}
|
||||
|
||||
void ClientManager::refreshDatabase()
|
||||
|
@@ -75,6 +75,7 @@ void CmaClient::connectUsb()
|
||||
}
|
||||
} while(isActive());
|
||||
|
||||
usbwait.unlock();
|
||||
qDebug("Finishing usb_thread");
|
||||
emit finished();
|
||||
}
|
||||
|
@@ -154,7 +154,7 @@ quint16 CmaEvent::processAllObjects(CMAObject *parent, quint32 handle)
|
||||
qDebug("Called %s, handle: %d, parent name: %s", Q_FUNC_INFO, handle, parent->metadata.name);
|
||||
|
||||
char *name;
|
||||
uint64_t size;
|
||||
int fileType = -1;
|
||||
int dataType;
|
||||
|
||||
uint32_t *p_handles;
|
||||
@@ -199,15 +199,26 @@ quint16 CmaEvent::processAllObjects(CMAObject *parent, quint32 handle)
|
||||
delete m_file;
|
||||
return PTP_RC_VITA_Invalid_Permission;
|
||||
} else {
|
||||
// the size gets ignored because we can also get it via info.size()
|
||||
uint64_t size;
|
||||
|
||||
VitaMTP_GetObject_Callback(device, handle, &size, CmaEvent::writeCallback);
|
||||
m_file->close();
|
||||
delete m_file;
|
||||
|
||||
// get the root ohfi type
|
||||
CMAObject *root_obj = parent;
|
||||
while(root_obj->parent) {
|
||||
root_obj = root_obj->parent;
|
||||
}
|
||||
|
||||
fileType = Database::checkFileType(dir.absoluteFilePath(name), root_obj->metadata.ohfi);
|
||||
}
|
||||
}
|
||||
|
||||
QFileInfo info(dir, name);
|
||||
object = new CMAObject(parent);
|
||||
object->initObject(info);
|
||||
object->initObject(info, fileType);
|
||||
object->metadata.handle = handle;
|
||||
db->append(parent->metadata.ohfi, object);
|
||||
free(name);
|
||||
|
@@ -25,6 +25,7 @@
|
||||
#include <QDir>
|
||||
#include <QDateTime>
|
||||
#include <QDebug>
|
||||
#include <QSettings>
|
||||
|
||||
int CMAObject::ohfi_count = OHFI_OFFSET;
|
||||
|
||||
@@ -83,9 +84,10 @@ CMAObject::~CMAObject()
|
||||
void CMAObject::loadSfoMetadata(const QString &path)
|
||||
{
|
||||
QString sfo = QDir(path).absoluteFilePath("PARAM.SFO");
|
||||
bool skipMetadata = QSettings().value("skipMetadata", false).toBool();
|
||||
SfoReader reader;
|
||||
|
||||
if(reader.load(sfo)) {
|
||||
if(!skipMetadata && reader.load(sfo)) {
|
||||
metadata.data.saveData.title = strdup(reader.value("TITLE", ""));
|
||||
//FIXME: disable savedata detail for now
|
||||
//QString detail(reader.value("SAVEDATA_DETAIL", ""));
|
||||
@@ -127,7 +129,9 @@ void CMAObject::loadSfoMetadata(const QString &path)
|
||||
void CMAObject::loadMusicMetadata(const QString &path)
|
||||
{
|
||||
AVDecoder decoder;
|
||||
if(decoder.open(path)) {
|
||||
bool skipMetadata = QSettings().value("skipMetadata", false).toBool();
|
||||
|
||||
if(!skipMetadata && decoder.open(path)) {
|
||||
decoder.getAudioMetadata(metadata);
|
||||
} else {
|
||||
metadata.data.music.album = strdup(parent->metadata.name ? parent->metadata.name : "");
|
||||
@@ -139,7 +143,9 @@ void CMAObject::loadMusicMetadata(const QString &path)
|
||||
void CMAObject::loadVideoMetadata(const QString &path)
|
||||
{
|
||||
AVDecoder decoder;
|
||||
if(decoder.open(path)) {
|
||||
bool skipMetadata = QSettings().value("skipMetadata", false).toBool();
|
||||
|
||||
if(!skipMetadata && decoder.open(path)) {
|
||||
decoder.getVideoMetadata(metadata);
|
||||
} else {
|
||||
metadata.data.video.title = strdup(metadata.name);
|
||||
@@ -151,7 +157,9 @@ void CMAObject::loadVideoMetadata(const QString &path)
|
||||
void CMAObject::loadPhotoMetadata(const QString &path)
|
||||
{
|
||||
QImage img;
|
||||
if(img.load(path)) {
|
||||
bool skipMetadata = QSettings().value("skipMetadata", false).toBool();
|
||||
|
||||
if(!skipMetadata && img.load(path)) {
|
||||
metadata.data.photo.tracks->data.track_photo.width = img.width();
|
||||
metadata.data.photo.tracks->data.track_photo.height = img.height();
|
||||
}
|
||||
@@ -176,6 +184,12 @@ void CMAObject::initObject(const QFileInfo &file, int file_type)
|
||||
metadata.data.saveData.statusType = 1;
|
||||
loadSfoMetadata(file.absoluteFilePath());
|
||||
} else if(MASK_SET(metadata.dataType, Music | File)) {
|
||||
|
||||
if(file_type < 0) {
|
||||
qWarning("Invalid file type for music: %i, setting it to zero", file_type);
|
||||
file_type = 0;
|
||||
}
|
||||
|
||||
metadata.data.music.fileName = strdup(metadata.name);
|
||||
metadata.data.music.fileFormatType = audio_list[file_type].file_format;
|
||||
metadata.data.music.statusType = 1;
|
||||
@@ -195,6 +209,12 @@ void CMAObject::initObject(const QFileInfo &file, int file_type)
|
||||
metadata.data.video.tracks->type = VITA_TRACK_TYPE_VIDEO;
|
||||
loadVideoMetadata(file.absoluteFilePath());
|
||||
} else if(MASK_SET(metadata.dataType, Photo | File)) {
|
||||
|
||||
if(file_type < 0) {
|
||||
qWarning("Invalid file type for photos: %i, setting it to zero", file_type);
|
||||
file_type = 0;
|
||||
}
|
||||
|
||||
metadata.data.photo.fileName = strdup(metadata.name);
|
||||
metadata.data.photo.fileFormatType = photo_list[file_type].file_format;
|
||||
metadata.data.photo.statusType = 1;
|
||||
|
@@ -53,6 +53,8 @@ public:
|
||||
CMAObject *pathToObject(const char *path, int ohfiRoot);
|
||||
int acceptFilteredObject(const CMAObject *parent, const CMAObject *current, int type);
|
||||
|
||||
static int checkFileType(const QString path, int ohfi_root);
|
||||
|
||||
QMutex mutex;
|
||||
|
||||
private:
|
||||
@@ -74,7 +76,6 @@ private:
|
||||
CMAObject *getParent(CMAObject *last_dir, const QString ¤t_path);
|
||||
CMAObject *pathToObjectInternal(const root_list &list, const char *path);
|
||||
static bool lessThanComparator(const CMAObject *a, const CMAObject *b);
|
||||
int checkFileType(const QString path, int ohfi_root);
|
||||
void dumpMetadataList(const metadata_t *p_head);
|
||||
bool continueOperation();
|
||||
|
||||
|
@@ -41,7 +41,7 @@ ConfigWidget::ConfigWidget(QWidget *parent) :
|
||||
{
|
||||
ui->setupUi(this);
|
||||
connectSignals();
|
||||
setDefaultDirs();
|
||||
setDefaultData();
|
||||
}
|
||||
|
||||
void ConfigWidget::connectSignals()
|
||||
@@ -62,7 +62,7 @@ void ConfigWidget::connectSignals()
|
||||
connect(ui->buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
|
||||
}
|
||||
|
||||
void ConfigWidget::setDefaultDirs()
|
||||
void ConfigWidget::setDefaultData()
|
||||
{
|
||||
QString defaultdir;
|
||||
QSettings settings;
|
||||
@@ -78,6 +78,11 @@ void ConfigWidget::setDefaultDirs()
|
||||
defaultdir = QStandardPaths::writableLocation(QStandardPaths::HomeLocation);
|
||||
defaultdir.append(QDir::separator()).append("PSV Updates");
|
||||
ui->urlPath->setText(settings.value("urlPath", defaultdir).toString());
|
||||
|
||||
ui->offlineCheck->setChecked(settings.value("offlineMode", true).toBool());
|
||||
ui->metadataCheck->setChecked(settings.value("skipMetadata", false).toBool());
|
||||
ui->usbCheck->setChecked(settings.value("disableUSB", false).toBool());
|
||||
ui->wifiCheck->setChecked(settings.value("disableWireless", false).toBool());
|
||||
}
|
||||
|
||||
ConfigWidget::~ConfigWidget()
|
||||
@@ -146,6 +151,10 @@ void ConfigWidget::accept()
|
||||
savePath(settings, ui->appPath, "appsPath");
|
||||
savePath(settings, ui->urlPath, "urlPath");
|
||||
settings.setValue("offlineMode", ui->offlineCheck->isChecked());
|
||||
settings.setValue("skipMetadata", ui->metadataCheck->isChecked());
|
||||
settings.setValue("disableUSB", ui->usbCheck->isChecked());
|
||||
settings.setValue("disableWireless", ui->wifiCheck->isChecked());
|
||||
settings.sync();
|
||||
|
||||
done(Accepted);
|
||||
}
|
||||
|
@@ -41,7 +41,7 @@ private:
|
||||
enum browse_buttons {BTN_PHOTO, BTN_MUSIC, BTN_VIDEO, BTN_APPS, BTN_URL};
|
||||
|
||||
void connectSignals();
|
||||
void setDefaultDirs();
|
||||
void setDefaultData();
|
||||
void savePath(QSettings &settings, const QLineEdit *edit, const QString &key);
|
||||
|
||||
Ui::ConfigWidget *ui;
|
||||
|
@@ -242,15 +242,26 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox_2">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<widget class="QCheckBox" name="metadataCheck">
|
||||
<property name="text">
|
||||
<string>Skip metadata extraction</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="usbCheck">
|
||||
<property name="text">
|
||||
<string>Disable USB monitoring</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="wifiCheck">
|
||||
<property name="text">
|
||||
<string>Disable Wi-Fi monitoring</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox_3">
|
||||
<property name="enabled">
|
||||
@@ -261,26 +272,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox_4">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Disable USB monitoring</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox_5">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Disable Wi-Fi monitoring</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QFormLayout" name="formLayout">
|
||||
<item row="0" column="0">
|
||||
|
@@ -22,6 +22,7 @@
|
||||
#endif
|
||||
|
||||
#include <QDebug>
|
||||
#include <QLibraryInfo>
|
||||
#include <QLocale>
|
||||
#include <QThread>
|
||||
#include <QTranslator>
|
||||
@@ -89,6 +90,10 @@ int main(int argc, char *argv[])
|
||||
app.installTranslator(&translator);
|
||||
}
|
||||
|
||||
QTranslator system_translator;
|
||||
system_translator.load("qt_" + locale, QLibraryInfo::location(QLibraryInfo::TranslationsPath));
|
||||
app.installTranslator(&system_translator);
|
||||
|
||||
qDebug("Starting main thread: 0x%016" PRIxPTR, (uintptr_t)QThread::currentThreadId());
|
||||
|
||||
// set the organization/application for QSettings to work properly
|
||||
|
Reference in New Issue
Block a user