Enable SQLiteDB backend.
Multiple fixed and finished the implementation of the SQLite backend. Try to load the database before trying to attempt a rescan. Delete the metadala list for backends that allocate them on demand. Moved some generic functions to the databse class. Renamed utils header to avoid rare QtCreator bug.
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
|
||||
#include "backupitem.h"
|
||||
#include "ui_backupitem.h"
|
||||
#include "utils.h"
|
||||
#include "cmautils.h"
|
||||
#include "dds.h"
|
||||
|
||||
#include <QDesktopServices>
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#include "cmaobject.h"
|
||||
#include "sforeader.h"
|
||||
#include "confirmdialog.h"
|
||||
#include "utils.h"
|
||||
#include "cmautils.h"
|
||||
#include "filterlineedit.h"
|
||||
|
||||
#include <QDebug>
|
||||
@@ -83,7 +83,7 @@ void BackupManagerForm::removeEntry(BackupItem *item)
|
||||
}
|
||||
}
|
||||
|
||||
void BackupManagerForm::setBackupUsage(quint64 size)
|
||||
void BackupManagerForm::setBackupUsage(qint64 size)
|
||||
{
|
||||
ui->usageLabel->setText(tr("Backup disk usage: %1").arg(readable_size(size, true)));
|
||||
}
|
||||
@@ -163,10 +163,12 @@ void BackupManagerForm::loadBackupListing(int index)
|
||||
#else
|
||||
horiz_header->setResizeMode(QHeaderView::Stretch);
|
||||
#endif
|
||||
setBackupUsage(m_db->getObjectSize(ohfi));
|
||||
qint64 backup_size = m_db->getObjectSize(ohfi);
|
||||
setBackupUsage(backup_size);
|
||||
QString path = m_db->getAbsolutePath(ohfi);
|
||||
QList<BackupItem *> item_list;
|
||||
|
||||
metadata_t *first = meta;
|
||||
while(meta) {
|
||||
QString base_path = path + QDir::separator() + meta->name;
|
||||
QString parent_path = sys_dir ? base_path + QDir::separator() + "sce_sys" : base_path;
|
||||
@@ -215,6 +217,8 @@ void BackupManagerForm::loadBackupListing(int index)
|
||||
meta = meta->next_metadata;
|
||||
}
|
||||
|
||||
m_db->freeMetadata(first);
|
||||
|
||||
qSort(item_list.begin(), item_list.end(), BackupItem::lessThan);
|
||||
|
||||
int row;
|
||||
|
||||
@@ -41,7 +41,7 @@ public:
|
||||
|
||||
private:
|
||||
void setupForm();
|
||||
void setBackupUsage(quint64 size);
|
||||
void setBackupUsage(qint64 size);
|
||||
|
||||
Ui::BackupManagerForm *ui;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user