summaryrefslogtreecommitdiff
path: root/noncore/settings/packagemanager/installdlg.cpp
Side-by-side diff
Diffstat (limited to 'noncore/settings/packagemanager/installdlg.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/packagemanager/installdlg.cpp60
1 files changed, 28 insertions, 32 deletions
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 <drw@handhelds.org>
-             .=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_,=:_.      -<s. This file 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 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_,=:_. -<s. This file 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 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 )