From 718a7a8ba68e10faa1a22fcc6bdc26e1723b2a40 Mon Sep 17 00:00:00 2001 From: drw Date: Wed, 17 Nov 2004 00:43:35 +0000 Subject: Some code clean-up items (thanks to zecke) --- (limited to 'noncore/settings/packagemanager/installdlg.cpp') diff --git a/noncore/settings/packagemanager/installdlg.cpp b/noncore/settings/packagemanager/installdlg.cpp index 0cb30e2..945dfed 100644 --- a/noncore/settings/packagemanager/installdlg.cpp +++ b/noncore/settings/packagemanager/installdlg.cpp @@ -1,27 +1,27 @@ /* -                This file is part of the OPIE Project + This file is part of the OPIE Project =. Copyright (c) 2003 Dan Williams -             .=l. -           .>+-= - _;:,     .>    :=|. This file is free software; you can -.> <`_,   >  .   <= redistribute it and/or modify it under -:`=1 )Y*s>-.--   : the terms of the GNU General Public -.="- .-=="i,     .._ License as published by the Free Software - - .   .-<_>     .<> Foundation; either version 2 of the License, -     ._= =}       : or (at your option) any later version. -    .%`+i>       _;_. -    .i_,=:_.      -`: 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 file; -  -_. . .   )=.  = see the file COPYING. If not, write to the -    --        :-=` Free Software Foundation, Inc., + .=l. + .>+-= +_;:, .> :=|. This file is free software; you can +.> <`_, > . <= redistribute it and/or modify it under +:`=1 )Y*s>-.-- : the terms of the GNU General Public +.="- .-=="i, .._ License as published by the Free Software +- . .-<_> .<> Foundation; either version 2 of the License, + ._= =} : or (at your option) any later version. + .%`+i> _;_. + .i_,=:_. -`: 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 file; + -_. . . )=. = see the file COPYING. If not, write to the + -- :-=` Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. @@ -50,9 +50,9 @@ #include "opackagemanager.h" InstallDlg::InstallDlg( QWidget *parent, OPackageManager *pm, const QString &caption, bool showDestInfo, - OPackage::Command command1, QStringList *packages1, - OPackage::Command command2, QStringList *packages2, - OPackage::Command command3, QStringList *packages3 ) + OPackage::Command command1, const QStringList &packages1, + OPackage::Command command2, const QStringList &packages2, + OPackage::Command command3, const QStringList &packages3 ) : QWidget( 0x0 ) , m_packman( pm ) , m_numCommands( 0 ) @@ -89,7 +89,7 @@ InstallDlg::InstallDlg( QWidget *parent, OPackageManager *pm, const QString &cap QLabel *label = new QLabel( tr( "Destination" ), this ); layout->addWidget( label, 0, 0 ); m_destination = new QComboBox( this ); - m_destination->insertStringList( *(m_packman->destinations()) ); + m_destination->insertStringList( m_packman->destinations() ); layout->addWidget( m_destination, 0, 1 ); connect( m_destination, SIGNAL(highlighted(const QString&)), this, SLOT(slotDisplayAvailSpace(const QString&)) ); @@ -129,7 +129,7 @@ InstallDlg::InstallDlg( QWidget *parent, OPackageManager *pm, const QString &cap // Display packages being acted upon in output widget for( int i = 0; i < m_numCommands; i++ ) { - if ( m_packages[ i ] ) + if ( !m_packages[ i ].isEmpty() ) { QString lineStr = tr( "Packages to " ); @@ -148,7 +148,8 @@ InstallDlg::InstallDlg( QWidget *parent, OPackageManager *pm, const QString &cap }; lineStr.append( ":\n" ); - for ( QStringList::Iterator it = m_packages[ i ]->begin(); it != m_packages[ i ]->end(); ++it ) + QStringList tmpPackage = m_packages[ i ]; + for ( QStringList::Iterator it = tmpPackage.begin(); it != tmpPackage.end(); ++it ) { lineStr.append( QString( "\t%1\n" ).arg( ( *it ) ) ); } @@ -164,11 +165,6 @@ InstallDlg::InstallDlg( QWidget *parent, OPackageManager *pm, const QString &cap InstallDlg::~InstallDlg() { - for( int i = 0; i < m_numCommands; i++ ) - { - if ( m_packages[ i ] ) - delete m_packages[ i ]; - } } void InstallDlg::slotDisplayAvailSpace( const QString &destination ) -- cgit v0.9.0.2