-rw-r--r-- | noncore/settings/packagemanager/filterdlg.cpp | 4 | ||||
-rw-r--r-- | noncore/settings/packagemanager/installdlg.cpp | 60 | ||||
-rw-r--r-- | noncore/settings/packagemanager/installdlg.h | 59 | ||||
-rw-r--r-- | noncore/settings/packagemanager/mainwindow.cpp | 42 | ||||
-rw-r--r-- | noncore/settings/packagemanager/mainwindow.h | 2 | ||||
-rw-r--r-- | noncore/settings/packagemanager/oconfitem.h | 46 | ||||
-rw-r--r-- | noncore/settings/packagemanager/oipkg.cpp | 56 | ||||
-rw-r--r-- | noncore/settings/packagemanager/oipkg.h | 51 | ||||
-rw-r--r-- | noncore/settings/packagemanager/opackagemanager.cpp | 56 | ||||
-rw-r--r-- | noncore/settings/packagemanager/opackagemanager.h | 57 | ||||
-rw-r--r-- | noncore/settings/packagemanager/packageinfodlg.cpp | 46 | ||||
-rw-r--r-- | noncore/settings/packagemanager/promptdlg.h | 52 |
12 files changed, 265 insertions, 266 deletions
diff --git a/noncore/settings/packagemanager/filterdlg.cpp b/noncore/settings/packagemanager/filterdlg.cpp index 0e1ea52..e69b6eb 100644 --- a/noncore/settings/packagemanager/filterdlg.cpp +++ b/noncore/settings/packagemanager/filterdlg.cpp @@ -103,9 +103,9 @@ FilterDlg::FilterDlg( QWidget *parent, OPackageManager *pm, const QString &name, QWhatsThis::add( m_serverCB, tr( "Tap here to filter package list by source server." ) ); connect( m_serverCB, SIGNAL(toggled(bool)), this, SLOT(slotServerSelected(bool)) ); m_server = new QComboBox( container ); QWhatsThis::add( m_server, tr( "Select the source server to filter by here." ) ); - m_server->insertStringList( *(pm->servers()) ); + m_server->insertStringList( pm->servers() ); initItem( m_server, m_serverCB, server ); layout->addWidget( m_serverCB ); layout->addWidget( m_server ); @@ -114,9 +114,9 @@ FilterDlg::FilterDlg( QWidget *parent, OPackageManager *pm, const QString &name, QWhatsThis::add( m_destCB, tr( "Tap here to filter package list by destination where the package is installed to on this device." ) ); connect( m_destCB, SIGNAL(toggled(bool)), this, SLOT(slotDestSelected(bool)) ); m_destination = new QComboBox( container ); QWhatsThis::add( m_destination, tr( "Select the destination location to filter by here." ) ); - m_destination->insertStringList( *(pm->destinations()) ); + m_destination->insertStringList( pm->destinations() ); initItem( m_destination, m_destCB, destination ); layout->addWidget( m_destCB ); layout->addWidget( m_destination ); } 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,28 +1,28 @@ /* - 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. */ @@ -49,11 +49,11 @@ #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 ) , m_currCommand( 0 ) @@ -88,9 +88,9 @@ 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&)) ); @@ -128,9 +128,9 @@ 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 " ); switch( m_command[ i ] ) @@ -147,9 +147,10 @@ InstallDlg::InstallDlg( QWidget *parent, OPackageManager *pm, const QString &cap break; }; 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 ) ) ); } @@ -163,13 +164,8 @@ 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 ) { diff --git a/noncore/settings/packagemanager/installdlg.h b/noncore/settings/packagemanager/installdlg.h index 4da9cf6..cddc911 100644 --- a/noncore/settings/packagemanager/installdlg.h +++ b/noncore/settings/packagemanager/installdlg.h @@ -1,28 +1,28 @@ /* - 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. */ @@ -47,11 +47,14 @@ class InstallDlg : public QWidget public: InstallDlg( QWidget *parent = 0x0, OPackageManager *pm = 0x0, const QString &caption = QString::null, bool showDestInfo = true, - OPackage::Command command1 = OPackage::NotDefined, QStringList *packages1 = 0x0, - OPackage::Command command2 = OPackage::NotDefined, QStringList *packages2 = 0x0, - OPackage::Command command3 = OPackage::NotDefined, QStringList *packages3 = 0x0 ); + OPackage::Command command1 = OPackage::NotDefined, + const QStringList &packages1 = QStringList(), + OPackage::Command command2 = OPackage::NotDefined, + const QStringList &packages2 = QStringList(), + OPackage::Command command3 = OPackage::NotDefined, + const QStringList &packages3 = QStringList() ); ~InstallDlg(); private: OPackageManager *m_packman; // Pointer to application instance of package manager @@ -63,12 +66,12 @@ private: QPushButton *m_btnStart; // Start/abort/close button QPushButton *m_btnOptions; // Installation options button // Commands and packages to execute - int m_numCommands; // Number of commands to be executed - int m_currCommand; // Number of currently executing command - OPackage::Command m_command[3]; // List of commands to be executed - QStringList *m_packages[3]; // Lists of package names associated to commands (m_command[]) + int m_numCommands; // Number of commands to be executed + int m_currCommand; // Number of currently executing command + OPackage::Command m_command[3]; // List of commands to be executed + QStringList m_packages[3]; // Lists of package names associated to commands (m_command[]) private slots: // UI control slots void slotDisplayAvailSpace( const QString &destination ); diff --git a/noncore/settings/packagemanager/mainwindow.cpp b/noncore/settings/packagemanager/mainwindow.cpp index 349094d..5e15874 100644 --- a/noncore/settings/packagemanager/mainwindow.cpp +++ b/noncore/settings/packagemanager/mainwindow.cpp @@ -312,9 +312,9 @@ void MainWindow::searchForPackage( const QString &text ) void MainWindow::installLocalPackage( const QString &ipkFile ) { // Install selected file InstallDlg *dlg = new InstallDlg( this, &m_packman, tr( "Install local package" ), true, - OPackage::Install, new QStringList( ipkFile ) ); + OPackage::Install, ipkFile ); connect( dlg, SIGNAL(closeInstallDlg()), this, SLOT(slotCloseDlg()) ); // Display widget m_widgetStack.addWidget( dlg, 3 ); @@ -409,19 +409,19 @@ void MainWindow::slotUpgrade() void MainWindow::slotDownload() { // Retrieve list of packages selected for download (if any) - QStringList *workingPackages = new QStringList(); + QStringList workingPackages; for ( QCheckListItem *item = static_cast<QCheckListItem *>(m_packageList.firstChild()); item != 0 ; item = static_cast<QCheckListItem *>(item->nextSibling()) ) { if ( item->isOn() ) - workingPackages->append( item->text() ); + workingPackages.append( item->text() ); } - if ( workingPackages->isEmpty() ) + if ( workingPackages.isEmpty() ) { QMessageBox::information( this, tr( "Nothing to do" ), tr( "No packages selected" ), tr( "OK" ) ); return; } @@ -456,11 +456,11 @@ void MainWindow::slotDownload() } void MainWindow::slotApply() { - QStringList *removeList = 0x0; - QStringList *installList = 0x0; - QStringList *upgradeList = 0x0; + QStringList removeList; + QStringList installList; + QStringList upgradeList; for ( QCheckListItem *item = static_cast<QCheckListItem *>(m_packageList.firstChild()); item != 0 ; item = static_cast<QCheckListItem *>(item->nextSibling()) ) @@ -479,17 +479,13 @@ void MainWindow::slotApply() tr( QString( "Do you wish to remove or upgrade\n%1?" ).arg( item->text() ) ), tr( "Remove" ), tr( "Upgrade" ), this ); if ( answer == 1 ) // Remove { - if ( !removeList ) - removeList = new QStringList(); - removeList->append( item->text() ); + removeList.append( item->text() ); } else if ( answer == 2 ) // Upgrade { - if ( !upgradeList ) - upgradeList = new QStringList(); - upgradeList->append( item->text() ); + upgradeList.append( item->text() ); } } else { @@ -498,47 +494,41 @@ void MainWindow::slotApply() tr( QString( "Do you wish to remove or reinstall\n%1?" ).arg( item->text() ) ), tr( "Remove" ), tr( "Reinstall" ), this ); if ( answer == 1 ) // Remove { - if ( !removeList ) - removeList = new QStringList(); - removeList->append( item->text() ); + removeList.append( item->text() ); } else if ( answer == 2 ) // Reinstall { - if ( !installList ) - installList = new QStringList(); - installList->append( item->text() ); + installList.append( item->text() ); } } } else { // Install package - if ( !installList ) - installList = new QStringList(); - installList->append( item->text() ); + installList.append( item->text() ); } } } } // If nothing is selected, display message and exit - if ( !removeList && !installList && !upgradeList ) + if ( removeList.isEmpty() && installList.isEmpty() && upgradeList.isEmpty() ) { QMessageBox::information( this, tr( "Nothing to do" ), tr( "No packages selected" ), tr( "OK" ) ); return; } // Send command only if there are packages to process OPackage::Command removeCmd = OPackage::NotDefined; - if ( removeList && !removeList->isEmpty() ) + if ( !removeList.isEmpty() ) removeCmd = OPackage::Remove; OPackage::Command installCmd = OPackage::NotDefined; - if ( installList && !installList->isEmpty() ) + if ( !installList.isEmpty() ) installCmd = OPackage::Install; OPackage::Command upgradeCmd = OPackage::NotDefined; - if ( upgradeList && !upgradeList->isEmpty() ) + if ( !upgradeList.isEmpty() ) upgradeCmd = OPackage::Upgrade; // Create package manager output widget InstallDlg *dlg = new InstallDlg( this, &m_packman, tr( "Apply changes" ), true, diff --git a/noncore/settings/packagemanager/mainwindow.h b/noncore/settings/packagemanager/mainwindow.h index 103c664..f00e344 100644 --- a/noncore/settings/packagemanager/mainwindow.h +++ b/noncore/settings/packagemanager/mainwindow.h @@ -50,9 +50,9 @@ class MainWindow :public QMainWindow Q_OBJECT public: MainWindow( QWidget *parent = 0x0, const char *name = 0x0, WFlags fl = 0 ); - static QString appName() { return QString::fromLatin1( "packagemanager" ); }; + static QString appName() { return QString::fromLatin1( QUICKAPP_NAME ); }; protected: void closeEvent( QCloseEvent *event ); diff --git a/noncore/settings/packagemanager/oconfitem.h b/noncore/settings/packagemanager/oconfitem.h index db77980..7c158c9 100644 --- a/noncore/settings/packagemanager/oconfitem.h +++ b/noncore/settings/packagemanager/oconfitem.h @@ -1,29 +1,29 @@ /* - This file is part of the Opie Project + This file is part of the Opie Project - Copyright (c) 2003 Dan Williams <drw@handhelds.org> + Copyright (c) 2003 Dan Williams <drw@handhelds.org> =. .=l. - .>+-= - _;:, .> :=|. This program is free software; you can -.> <`_, > . <= redistribute it and/or modify it under -:`=1 )Y*s>-.-- : the terms of the GNU Library 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 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 -..}^=.= = ; Library General Public License for more -++= -. .` .: details. - : = ...= . :.=- - -. .:....=;==+<; You should have received a copy of the GNU - -_. . . )=. = Library General Public License along with - -- :-=` this library; see the file COPYING.LIB. + .>+-= +_;:, .> :=|. This program is free software; you can +.> <`_, > . <= redistribute it and/or modify it under +:`=1 )Y*s>-.-- : the terms of the GNU Library 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 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 +..}^=.= = ; Library General Public License for more +++= -. .` .: details. +: = ...= . :.=- +-. .:....=;==+<; You should have received a copy of the GNU + -_. . . )=. = Library General Public License along with + -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. @@ -39,10 +39,10 @@ class OConfItem { public: enum Type { Source, Destination, Option, Arch, NotDefined }; - OConfItem( Type type = NotDefined, const QString &name = 0x0, const QString &value = 0x0, - bool active = true ); + OConfItem( Type type = NotDefined, const QString &name = QString::null, + const QString &value = QString::null, bool active = true ); Type type() { return m_type; } const QString &name() { return m_name; } const QString &value() { return m_value; } diff --git a/noncore/settings/packagemanager/oipkg.cpp b/noncore/settings/packagemanager/oipkg.cpp index 1978ad5..b0cc94d 100644 --- a/noncore/settings/packagemanager/oipkg.cpp +++ b/noncore/settings/packagemanager/oipkg.cpp @@ -1,29 +1,29 @@ /* - This file is part of the Opie Project + This file is part of the Opie Project - Copyright (c) 2003 Dan Williams <drw@handhelds.org> + Copyright (c) 2003 Dan Williams <drw@handhelds.org> =. .=l. - .>+-= - _;:, .> :=|. This program is free software; you can -.> <`_, > . <= redistribute it and/or modify it under -:`=1 )Y*s>-.-- : the terms of the GNU Library 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 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 -..}^=.= = ; Library General Public License for more -++= -. .` .: details. - : = ...= . :.=- - -. .:....=;==+<; You should have received a copy of the GNU - -_. . . )=. = Library General Public License along with - -- :-=` this library; see the file COPYING.LIB. + .>+-= +_;:, .> :=|. This program is free software; you can +.> <`_, > . <= redistribute it and/or modify it under +:`=1 )Y*s>-.-- : the terms of the GNU Library 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 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 +..}^=.= = ; Library General Public License for more +++= -. .` .: details. +: = ...= . :.=- +-. .:....=;==+<; You should have received a copy of the GNU + -_. . . )=. = Library General Public License along with + -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. @@ -51,8 +51,10 @@ int fsignalIpkgMessage( ipkg_conf_t *conf, message_level_t level, char *msg ) if ( conf && ( conf->verbosity < level ) ) return 0; else oipkg->ipkgMessage( msg ); + + return 0; } char *fIpkgResponse( char */*question*/ ) { @@ -352,9 +354,9 @@ OPackageList *OIpkg::installedPackages( const QString &destName, const QString & return pl; } -bool OIpkg::executeCommand( OPackage::Command command, QStringList *parameters, const QString &destination, +bool OIpkg::executeCommand( OPackage::Command command, const QStringList ¶meters, const QString &destination, const QObject *receiver, const char *slotOutput, bool rawOutput ) { if ( command == OPackage::NotDefined ) return false; @@ -402,38 +404,38 @@ bool OIpkg::executeCommand( OPackage::Command command, QStringList *parameters, }; break; case OPackage::Install : { connect( this, SIGNAL(signalIpkgMessage(char*)), receiver, slotOutput ); - for ( QStringList::Iterator it = parameters->begin(); it != parameters->end(); ++it ) + for ( QStringList::ConstIterator it = parameters.begin(); it != parameters.end(); ++it ) { ipkg_packages_install( &m_ipkgArgs, (*it) ); } }; break; case OPackage::Remove : { connect( this, SIGNAL(signalIpkgMessage(char*)), receiver, slotOutput ); - for ( QStringList::Iterator it = parameters->begin(); it != parameters->end(); ++it ) + for ( QStringList::ConstIterator it = parameters.begin(); it != parameters.end(); ++it ) { ipkg_packages_remove( &m_ipkgArgs, (*it), true ); } }; break; case OPackage::Download : { connect( this, SIGNAL(signalIpkgMessage(char*)), receiver, slotOutput ); - for ( QStringList::Iterator it = parameters->begin(); it != parameters->end(); ++it ) + for ( QStringList::ConstIterator it = parameters.begin(); it != parameters.end(); ++it ) { ipkg_packages_download( &m_ipkgArgs, (*it) ); } }; break; case OPackage::Info : { connect( this, SIGNAL(signalIpkgStatus(char*)), receiver, slotOutput ); - ipkg_packages_info( &m_ipkgArgs, (*parameters->begin()), &fIpkgStatus, 0x0 ); + ipkg_packages_info( &m_ipkgArgs, (*parameters.begin()), &fIpkgStatus, 0x0 ); }; break; case OPackage::Files : { connect( this, SIGNAL(signalIpkgList(char*)), receiver, slotOutput ); - ipkg_package_files( &m_ipkgArgs, (*parameters->begin()), &fIpkgFiles, 0x0 ); + ipkg_package_files( &m_ipkgArgs, (*parameters.begin()), &fIpkgFiles, 0x0 ); }; break; default : break; }; diff --git a/noncore/settings/packagemanager/oipkg.h b/noncore/settings/packagemanager/oipkg.h index b8a859a..3c96200 100644 --- a/noncore/settings/packagemanager/oipkg.h +++ b/noncore/settings/packagemanager/oipkg.h @@ -1,29 +1,29 @@ /* - This file is part of the Opie Project + This file is part of the Opie Project - Copyright (c) 2003 Dan Williams <drw@handhelds.org> + Copyright (c) 2003 Dan Williams <drw@handhelds.org> =. .=l. - .>+-= - _;:, .> :=|. This program is free software; you can -.> <`_, > . <= redistribute it and/or modify it under -:`=1 )Y*s>-.-- : the terms of the GNU Library 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 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 -..}^=.= = ; Library General Public License for more -++= -. .` .: details. - : = ...= . :.=- - -. .:....=;==+<; You should have received a copy of the GNU - -_. . . )=. = Library General Public License along with - -- :-=` this library; see the file COPYING.LIB. + .>+-= +_;:, .> :=|. This program is free software; you can +.> <`_, > . <= redistribute it and/or modify it under +:`=1 )Y*s>-.-- : the terms of the GNU Library 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 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 +..}^=.= = ; Library General Public License for more +++= -. .` .: details. +: = ...= . :.=- +-. .:....=;==+<; You should have received a copy of the GNU + -_. . . )=. = Library General Public License along with + -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. @@ -76,11 +76,14 @@ public: OPackageList *availablePackages( const QString &server = QString::null ); OPackageList *installedPackages( const QString &destName = QString::null, const QString &destPath = QString::null ); - bool executeCommand( OPackage::Command command = OPackage::NotDefined, QStringList *parameters = 0x0, - const QString &destination = QString::null, const QObject *receiver = 0x0, - const char *slotOutput = 0x0, bool rawOutput = true ); + bool executeCommand( OPackage::Command command = OPackage::NotDefined, + const QStringList ¶meters = QStringList(), + const QString &destination = QString::null, + const QObject *receiver = 0x0, + const char *slotOutput = 0x0, + bool rawOutput = true ); void abortCommand(); void ipkgMessage( char *msg ); void ipkgStatus( char *status ); diff --git a/noncore/settings/packagemanager/opackagemanager.cpp b/noncore/settings/packagemanager/opackagemanager.cpp index f75d3b3..cbddfe7 100644 --- a/noncore/settings/packagemanager/opackagemanager.cpp +++ b/noncore/settings/packagemanager/opackagemanager.cpp @@ -1,29 +1,29 @@ /* - This file is part of the Opie Project + This file is part of the Opie Project - Copyright (c) 2003 Dan Williams <drw@handhelds.org> + Copyright (c) 2003 Dan Williams <drw@handhelds.org> =. .=l. - .>+-= - _;:, .> :=|. This program is free software; you can -.> <`_, > . <= redistribute it and/or modify it under -:`=1 )Y*s>-.-- : the terms of the GNU Library 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 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 -..}^=.= = ; Library General Public License for more -++= -. .` .: details. - : = ...= . :.=- - -. .:....=;==+<; You should have received a copy of the GNU - -_. . . )=. = Library General Public License along with - -- :-=` this library; see the file COPYING.LIB. + .>+-= +_;:, .> :=|. This program is free software; you can +.> <`_, > . <= redistribute it and/or modify it under +:`=1 )Y*s>-.-- : the terms of the GNU Library 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 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 +..}^=.= = ; Library General Public License for more +++= -. .` .: details. +: = ...= . :.=- +-. .:....=;==+<; You should have received a copy of the GNU + -_. . . )=. = Library General Public License along with + -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. @@ -226,11 +226,11 @@ OPackageList *OPackageManager::filterPackages( const QString &name,const QString return pl; } -QStringList *OPackageManager::servers() +QStringList OPackageManager::servers() { - QStringList *sl = new QStringList(); + QStringList sl; OConfItemList *serverList = m_ipkg.servers(); if ( serverList ) { @@ -239,18 +239,18 @@ QStringList *OPackageManager::servers() OConfItem *server = serverIt.current(); // Add only active servers if ( server->active() ) - *sl << server->name(); + sl << server->name(); } } return sl; } -QStringList *OPackageManager::destinations() +QStringList OPackageManager::destinations() { - QStringList *dl = new QStringList(); + QStringList dl; OConfItemList *destList = m_ipkg.destinations(); if ( destList ) { @@ -259,9 +259,9 @@ QStringList *OPackageManager::destinations() OConfItem *destination = destIt.current(); // Add only active destinations if ( destination->active() ) - *dl << destination->name(); + dl << destination->name(); } } return dl; @@ -329,9 +329,9 @@ void OPackageManager::saveSettings() { m_ipkg.saveSettings(); } -bool OPackageManager::executeCommand( OPackage::Command command, QStringList *packages, +bool OPackageManager::executeCommand( OPackage::Command command, const QStringList &packages, const QString &destination, const QObject *receiver, const char *slotOutput, bool rawOutput ) { return m_ipkg.executeCommand( command, packages, destination, receiver, slotOutput, rawOutput ); diff --git a/noncore/settings/packagemanager/opackagemanager.h b/noncore/settings/packagemanager/opackagemanager.h index 58e597b..bc394e8 100644 --- a/noncore/settings/packagemanager/opackagemanager.h +++ b/noncore/settings/packagemanager/opackagemanager.h @@ -1,29 +1,29 @@ /* - This file is part of the Opie Project + This file is part of the Opie Project - Copyright (c) 2003 Dan Williams <drw@handhelds.org> + Copyright (c) 2003 Dan Williams <drw@handhelds.org> =. .=l. - .>+-= - _;:, .> :=|. This program is free software; you can -.> <`_, > . <= redistribute it and/or modify it under -:`=1 )Y*s>-.-- : the terms of the GNU Library 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 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 -..}^=.= = ; Library General Public License for more -++= -. .` .: details. - : = ...= . :.=- - -. .:....=;==+<; You should have received a copy of the GNU - -_. . . )=. = Library General Public License along with - -- :-=` this library; see the file COPYING.LIB. + .>+-= +_;:, .> :=|. This program is free software; you can +.> <`_, > . <= redistribute it and/or modify it under +:`=1 )Y*s>-.-- : the terms of the GNU Library 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 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 +..}^=.= = ; Library General Public License for more +++= -. .` .: details. +: = ...= . :.=- +-. .:....=;==+<; You should have received a copy of the GNU + -_. . . )=. = Library General Public License along with + -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. @@ -52,15 +52,17 @@ public: enum Status { All, NotInstalled, Installed, Updated, NotDefined }; OPackageList *packages(); - OPackageList *filterPackages( const QString &name = 0x0,const QString &server = 0x0, - const QString &destination = 0x0, Status status = NotDefined, - const QString &category = 0x0 ); + OPackageList *filterPackages( const QString &name = QString::null, + const QString &server = QString::null, + const QString &destination = QString::null, + Status status = NotDefined, + const QString &category = QString::null ); const QStringList &categories() { return m_categories; } - QStringList *servers(); - QStringList *destinations(); + QStringList servers(); + QStringList destinations(); int compareVersions( const QString &version1, const QString &version2 ); OConfItem *findConfItem( OConfItem::Type type = OConfItem::NotDefined, @@ -69,9 +71,10 @@ public: bool configureDlg( bool installOptions = false ); void saveSettings(); - bool executeCommand( OPackage::Command command = OPackage::NotDefined, QStringList *parameters = 0x0, + bool executeCommand( OPackage::Command command = OPackage::NotDefined, + const QStringList ¶meters = QStringList(), const QString &destination = QString::null, const QObject *receiver = 0x0, const char *slotOutput = 0x0, bool rawOutput = true ); private: diff --git a/noncore/settings/packagemanager/packageinfodlg.cpp b/noncore/settings/packagemanager/packageinfodlg.cpp index d27eacb..c5924fd 100644 --- a/noncore/settings/packagemanager/packageinfodlg.cpp +++ b/noncore/settings/packagemanager/packageinfodlg.cpp @@ -1,28 +1,28 @@ /* - 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. */ @@ -74,9 +74,9 @@ PackageInfoDlg::PackageInfoDlg( QWidget *parent, OPackageManager *pm, const QStr else { // Package information is not cached, retrieve it QStringList list( package ); - m_packman->executeCommand( OPackage::Info, &list, QString::null, this, SLOT(slotInfo(char*)), true ); + m_packman->executeCommand( OPackage::Info, list, QString::null, this, SLOT(slotInfo(char*)), true ); } // Files tab (display only if package is installed) if ( !m_package->versionInstalled().isNull() ) @@ -123,9 +123,9 @@ void PackageInfoDlg::slotBtnFileScan() { m_files.clear(); QStringList list( m_package->name() ); - m_packman->executeCommand( OPackage::Files, &list, QString::null, this, SLOT(slotFiles(char*)), true ); + m_packman->executeCommand( OPackage::Files, list, QString::null, this, SLOT(slotFiles(char*)), true ); } void PackageInfoDlg::slotInfo( char *info ) { diff --git a/noncore/settings/packagemanager/promptdlg.h b/noncore/settings/packagemanager/promptdlg.h index 790ff4d..f7bc0c0 100644 --- a/noncore/settings/packagemanager/promptdlg.h +++ b/noncore/settings/packagemanager/promptdlg.h @@ -1,28 +1,28 @@ /* - 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. */ @@ -36,16 +36,18 @@ class PromptDlg : public QWidget { Q_OBJECT public: - PromptDlg( const QString &caption = 0x0, const QString &text = 0x0, const QString &btn1 = 0x0, - const QString &btn2 = 0x0, QWidget *parent = 0x0 ); + PromptDlg( const QString &caption = QString::null, const QString &text = QString::null, + const QString &btn1 = QString::null, const QString &btn2 = QString::null, + QWidget *parent = 0x0 ); int display(); int btnPressed() { return m_btnClicked; } - static int ask( const QString &caption = 0x0, const QString &text = 0x0, const QString &btn1 = 0x0, - const QString &btn2 = 0x0, QWidget *parent = 0x0 ); + static int ask( const QString &caption = QString::null, const QString &text = QString::null, + const QString &btn1 = QString::null, const QString &btn2 = QString::null, + QWidget *parent = 0x0 ); private: int m_btnClicked; // Indicator for which button was pressed |