diff --git a/.gitignore b/.gitignore
index ed6769f..596c592 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,2 @@
qcma.pro.user*
-*.qm
-.directory
\ No newline at end of file
+*.qm
\ No newline at end of file
diff --git a/cmaevent.cpp b/cmaevent.cpp
index afae735..d93eb97 100644
--- a/cmaevent.cpp
+++ b/cmaevent.cpp
@@ -608,9 +608,12 @@ void CmaEvent::vitaEventGetSettingInfo(vita_event_t *event, int eventId)
qDebug("Current account id: %s", settingsinfo->current_account.accountId);
QSettings settings;
+
+ // Always refresh the account name
+ settings.setValue("lastOnlineId", settingsinfo->current_account.userName);
+
if(settings.value("lastAccountId").toString() != settingsinfo->current_account.accountId) {
- db->setUUID(settingsinfo->current_account.accountId);
- settings.setValue("lastOnlineId", settingsinfo->current_account.userName);
+ db->setUUID(settingsinfo->current_account.accountId);
// set the database to be updated ASAP
emit refreshDatabase();
}
diff --git a/cmarootobject.cpp b/cmarootobject.cpp
index eb9c6a1..7e22b4e 100644
--- a/cmarootobject.cpp
+++ b/cmarootobject.cpp
@@ -99,6 +99,10 @@ void CMARootObject::initObject(const QString &path)
this->path = QDir(QDir(path).absoluteFilePath("SYSTEM")).absoluteFilePath(uuid);
num_filters = 0;
}
+
+ // create the backup directories
+ QDir dir(this->path);
+ dir.mkpath(dir.absolutePath());
}
CMARootObject::~CMARootObject()
diff --git a/filterlineedit.cpp b/filterlineedit.cpp
index 23ef75d..8d23741 100644
--- a/filterlineedit.cpp
+++ b/filterlineedit.cpp
@@ -1,7 +1,26 @@
+/*
+ * QCMA: Cross-platform content manager assistant for the PS Vita
+ *
+ * Copyright (C) 2013 Xian Nox
+ *
+ * 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 "filterlineedit.h"
-#include
#include
+#include
FilterLineEdit::FilterLineEdit(QWidget *parent) :
QLineEdit(parent)
@@ -18,16 +37,18 @@ FilterLineEdit::FilterLineEdit(QWidget *parent) :
void FilterLineEdit::updateCloseButton(const QString& text)
{
- if(text.isEmpty() || text == tr("Filter"))
+ if(text.isEmpty() || text == tr("Filter")) {
clearButton->setVisible(false);
- else
+ } else {
clearButton->setVisible(true);
+ }
}
void FilterLineEdit::focusInEvent(QFocusEvent *e)
{
- if(this->styleSheet() == "color:gray;font-style:italic")
+ if(this->styleSheet() == "color:gray;font-style:italic") {
this->clear();
+ }
this->setStyleSheet(QString("color:black;font-style:normal;padding-right:%1").arg(clearButton->sizeHint().width()));
@@ -47,7 +68,7 @@ void FilterLineEdit::focusOutEvent(QFocusEvent *e)
void FilterLineEdit::resizeEvent(QResizeEvent *e)
{
QSize sz = clearButton->sizeHint();
- clearButton->move(rect().right() - sz.width(), (rect().bottom() - sz.height())/2);
+ clearButton->move(rect().right() - sz.width(), (rect().bottom() - sz.height()) / 2);
QLineEdit::resizeEvent(e);
}
diff --git a/filterlineedit.h b/filterlineedit.h
index 71d77df..78cb6fe 100644
--- a/filterlineedit.h
+++ b/filterlineedit.h
@@ -1,3 +1,22 @@
+/*
+ * QCMA: Cross-platform content manager assistant for the PS Vita
+ *
+ * Copyright (C) 2013 Xian Nox
+ *
+ * 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 FILTERLINEEDIT_H
#define FILTERLINEEDIT_H
@@ -7,25 +26,21 @@
class FilterLineEdit : public QLineEdit
{
Q_OBJECT
+
public:
explicit FilterLineEdit(QWidget *parent = 0);
-
-signals:
-
-public slots:
-
-private slots:
- void updateCloseButton(const QString &text);
protected:
void focusInEvent(QFocusEvent *e);
void focusOutEvent(QFocusEvent *e);
-
void resizeEvent(QResizeEvent *e);
private:
QToolButton *clearButton;
-
+
+private slots:
+ void updateCloseButton(const QString &text);
+
};
#endif // FILTERLINEEDIT_H
diff --git a/main.cpp b/main.cpp
index 23a857a..3e4216d 100644
--- a/main.cpp
+++ b/main.cpp
@@ -74,13 +74,15 @@ int main(int argc, char *argv[])
QTranslator translator;
QString locale = QLocale().system().name();
qDebug("Current locale: %s", locale.toUtf8().data());
+
if(app.arguments().contains("--set-locale")) {
int index = app.arguments().indexOf("--set-locale");
- if(index+1 < app.arguments().length()) {
- qDebug("Enforcing locale: %s", app.arguments().at(index+1).toUtf8().data());
- locale = app.arguments().at(index+1);
+ if(index + 1 < app.arguments().length()) {
+ qDebug("Enforcing locale: %s", app.arguments().at(index + 1).toUtf8().data());
+ locale = app.arguments().at(index + 1);
}
}
+
if(translator.load("qcma." + locale, ":/main/resources/translations")) {
app.installTranslator(&translator);
}
diff --git a/resources/translations/qcma.es.ts b/resources/translations/qcma.es.ts
index c381a9f..4d4cb58 100644
--- a/resources/translations/qcma.es.ts
+++ b/resources/translations/qcma.es.ts
@@ -75,7 +75,7 @@
Filter
-
+ Filtro
@@ -302,10 +302,10 @@
FilterLineEdit
-
+ Filter
-
+ Filtro
diff --git a/resources/translations/qcma.ja.ts b/resources/translations/qcma.ja.ts
index 0891be4..ddf3129 100644
--- a/resources/translations/qcma.ja.ts
+++ b/resources/translations/qcma.ja.ts
@@ -303,8 +303,8 @@
FilterLineEdit
-
+ Filter