* ohneschwanzenegger: fix possible crash, use const reference when installing shared contents

git-svn-id: http://wiiqt.googlecode.com/svn/trunk@88 389f4c8b-5dfe-645f-db0e-df882bc27289
This commit is contained in:
giantpune 2011-05-16 07:46:42 +00:00
parent 8a683c7078
commit 04094e8e54
2 changed files with 536 additions and 533 deletions

View File

@ -174,12 +174,12 @@ void MainWindow::NusIsDone()
{
nandDirty = true;
UpdateTree();
ShowMessage( tr( "Saved setting.txt" ) );
}
}
}
}
//nand.Delete( "/title/00000001/00000002/content/title.tmd" );
if( nandDirty )
{
if( !FlushNand() )
@ -547,7 +547,10 @@ bool MainWindow::UpdateTree()
{
//set up the tree so we know what all is in the nand without asking for it every time
if( root )
{
delete root;
root = NULL;
}
QTreeWidgetItem *r = nand.GetTree();
if( r->childCount() != 1 || r->child( 0 )->text( 0 ) != "/" )
{
@ -575,7 +578,7 @@ quint16 MainWindow::CreateIfNeeded( const QString &path, quint32 uid, quint16 gi
return item->text( 1 ).toInt();
}
bool MainWindow::InstallSharedContent( const QByteArray stuff, const QByteArray hash )
bool MainWindow::InstallSharedContent( const QByteArray &stuff, const QByteArray &hash )
{
//qDebug() << "MainWindow::InstallSharedContent";
QByteArray h;

View File

@ -44,7 +44,7 @@ private:
bool InstallNUSItem( NusJob job );
quint16 CreateIfNeeded( const QString &path, quint32 uid, quint16 gid, quint8 attr, quint8 user_perm, quint8 group_perm, quint8 other_perm );
bool InstallSharedContent( const QByteArray stuff, const QByteArray hash = QByteArray() );
bool InstallSharedContent( const QByteArray &stuff, const QByteArray &hash = QByteArray() );
void SaveSettings();
void LoadSettings();