author | drw <drw> | 2005-01-02 20:26:01 (UTC) |
---|---|---|
committer | drw <drw> | 2005-01-02 20:26:01 (UTC) |
commit | e763e0cea060ae3a2dfb1c411f56354e27ac12a9 (patch) (side-by-side diff) | |
tree | 37896734be7d2679c3f19635fe9fe3b52a549332 /noncore | |
parent | 020ea2d54bcd0fc4420cb433b3e657cd13ae07e2 (diff) | |
download | opie-e763e0cea060ae3a2dfb1c411f56354e27ac12a9.zip opie-e763e0cea060ae3a2dfb1c411f56354e27ac12a9.tar.gz opie-e763e0cea060ae3a2dfb1c411f56354e27ac12a9.tar.bz2 |
Implement native package linking code (removing need for ipkg-link and its shortcomings), move package linking code to OIpkg (proper place for ipkg specific code), many small code tweaks and bump version up to 0.6.1
-rw-r--r-- | noncore/settings/packagemanager/ChangeLog | 7 | ||||
-rw-r--r-- | noncore/settings/packagemanager/TODO | 8 | ||||
-rw-r--r-- | noncore/settings/packagemanager/installdlg.cpp | 81 | ||||
-rw-r--r-- | noncore/settings/packagemanager/installdlg.h | 11 | ||||
-rw-r--r-- | noncore/settings/packagemanager/oipkg.cpp | 208 | ||||
-rw-r--r-- | noncore/settings/packagemanager/oipkg.h | 20 | ||||
-rw-r--r-- | noncore/settings/packagemanager/oipkgconfigdlg.cpp | 34 | ||||
-rw-r--r-- | noncore/settings/packagemanager/oipkgconfigdlg.h | 3 | ||||
-rw-r--r-- | noncore/settings/packagemanager/opackagemanager.cpp | 20 | ||||
-rw-r--r-- | noncore/settings/packagemanager/opie-packagemanager.control | 4 | ||||
-rw-r--r-- | noncore/settings/packagemanager/packageinfodlg.cpp | 10 | ||||
-rw-r--r-- | noncore/settings/packagemanager/packageinfodlg.h | 4 |
12 files changed, 237 insertions, 173 deletions
diff --git a/noncore/settings/packagemanager/ChangeLog b/noncore/settings/packagemanager/ChangeLog index c776ce5..608cd98 100644 --- a/noncore/settings/packagemanager/ChangeLog +++ b/noncore/settings/packagemanager/ChangeLog @@ -1,3 +1,10 @@ +2005-01-02 Dan Williams <drw@handhelds.org> + + * Released version 0.6.1 + * Implemented native package linking code to remove need for ipkg-link + * Implement package in OIpkg (removed from InstallDlg) as this is ipkg specific + * Many small code tweaks + 2004-12-21 Dan Williams <drw@handhelds.org> * Released version 0.6.0 diff --git a/noncore/settings/packagemanager/TODO b/noncore/settings/packagemanager/TODO index 744ad95..2512624 100644 --- a/noncore/settings/packagemanager/TODO +++ b/noncore/settings/packagemanager/TODO @@ -2,16 +2,14 @@ /* /* Opie - Package Manager /* ======================== -/* Version 0.6.0 +/* Version 0.6.1 /* /* A package management client for Opie /* /************************************************************************ ----------------------------------------------- - To-do for Opie-PackageManager - December, 2004 + To-do for Opie-PackageManager - January, 2005 ----------------------------------------------- -1. Move ipkg-link code from InstallDlg to OIpkg -2. Code ipkg-link logic directly in OIpkg -3. Re-work package download dialog +1. Re-work package download dialog diff --git a/noncore/settings/packagemanager/installdlg.cpp b/noncore/settings/packagemanager/installdlg.cpp index 985e2bd..7dea591 100644 --- a/noncore/settings/packagemanager/installdlg.cpp +++ b/noncore/settings/packagemanager/installdlg.cpp @@ -30,7 +30,6 @@ _;:, .> :=|. This file is free software; you can #include "installdlg.h" #include <opie2/ofiledialog.h> -#include <opie2/oprocess.h> #include <qpe/fileselector.h> #include <qpe/resource.h> @@ -247,87 +246,11 @@ void InstallDlg::slotBtnStart() m_btnStart->setEnabled( false ); } - Opie::Core::OProcess process( this ); for ( m_currCommand = 0; m_currCommand < m_numCommands; m_currCommand++ ) { // Execute next command m_packman->executeCommand( m_command[ m_currCommand ], m_packages[ m_currCommand ], dest, - this, SLOT(slotOutput(char*)), true ); - - if ( m_command[ m_currCommand ] == OPackage::Remove ) - { - // Unlink application if the package was removed - - // Loop through all package names in the command group - for ( QStringList::Iterator it = m_packages[ m_currCommand ].begin(); - it != m_packages[ m_currCommand ].end(); - ++it ) - { - OPackage *currPackage = m_packman->findPackage( (*it) ); - - // Skip package if it is not found or being removed from 'root' - if ( !currPackage || ( m_command[ m_currCommand ] == OPackage::Remove && - currPackage->destination() == "root" ) ) - continue; - - // Display feedback to user - m_output->append( tr( QString( "Running ipkg-link to remove links for package '%1'." ) - .arg( currPackage->name() ) ) ); - m_output->setCursorPosition( m_output->numLines(), 0 ); - - // Execute ipkg-link - process.clearArguments(); - process << "ipkg-link" - << ( ( m_command[ m_currCommand ] == OPackage::Install ) ? "add" : "remove" ) - << currPackage->name(); - if ( !process.start( Opie::Core::OProcess::Block, - Opie::Core::OProcess::NoCommunication ) ) - { - slotProcessDone( 0l ); - m_output->append( tr( "Unable to run ipkg-link." ) ); - m_output->setCursorPosition( m_output->numLines(), 0 ); - return; - } - } - } - else if ( m_command[ m_currCommand ] == OPackage::Install && dest != "root" ) - { - // Link applications in the destination directory - - m_output->append( tr( "Running ipkg-link to link packages in '%1'." ).arg( dest ) ); - m_output->setCursorPosition( m_output->numLines(), 0 ); - - QString destPath; - OConfItem *destItem = m_packman->findConfItem( OConfItem::Destination, dest ); - - // Execute ipkg-link - process.clearArguments(); - process << "ipkg-link" - << "mount" - << destItem->value(); - if ( !process.start( Opie::Core::OProcess::Block, - Opie::Core::OProcess::NoCommunication ) ) - { - slotProcessDone( 0l ); - m_output->append( tr( "Unable to run ipkg-link." ) ); - m_output->setCursorPosition( m_output->numLines(), 0 ); - return; - } - } - } - - slotProcessDone( 0l ); -} - -void InstallDlg::slotProcessDone( Opie::Core::OProcess *proc ) -{ - if ( proc ) - { - // Display message pnly if linking was done - m_output->append( tr( "The package linking is done." ) ); - m_output->setCursorPosition( m_output->numLines(), 0 ); - - delete proc; + this, SLOT(slotOutput(const QString &)), true ); } // All commands executed, allow user to close dialog @@ -372,7 +295,7 @@ void InstallDlg::slotBtnOptions() } } -void InstallDlg::slotOutput( char *msg ) +void InstallDlg::slotOutput( const QString &msg ) { // Allow processing of other events qApp->processEvents(); diff --git a/noncore/settings/packagemanager/installdlg.h b/noncore/settings/packagemanager/installdlg.h index 7a64fe0..e633809 100644 --- a/noncore/settings/packagemanager/installdlg.h +++ b/noncore/settings/packagemanager/installdlg.h @@ -42,14 +42,6 @@ class QPushButton; class OConfItem; class OPackageManager; -namespace Opie -{ - namespace Core - { - class OProcess; - } -} - class InstallDlg : public QWidget { Q_OBJECT @@ -89,10 +81,9 @@ private slots: void slotDisplayAvailSpace( const QString &destination ); void slotBtnStart(); void slotBtnOptions(); - void slotProcessDone( Opie::Core::OProcess *proc ); // Execution slots - void slotOutput( char *msg ); + void slotOutput( const QString &msg ); signals: void closeInstallDlg(); diff --git a/noncore/settings/packagemanager/oipkg.cpp b/noncore/settings/packagemanager/oipkg.cpp index a66bd51..f2d7e39 100644 --- a/noncore/settings/packagemanager/oipkg.cpp +++ b/noncore/settings/packagemanager/oipkg.cpp @@ -36,11 +36,13 @@ _;:, .> :=|. This program is free software; you can #include <qtextstream.h> #include <stdlib.h> +#include <unistd.h> const QString IPKG_CONF = "/etc/ipkg.conf"; // Fully-qualified name of Ipkg primary configuration file const QString IPKG_CONF_DIR = "/etc/ipkg"; // Directory of secondary Ipkg configuration files const QString IPKG_PKG_PATH = "/usr/lib/ipkg/lists"; // Directory containing server package lists const QString IPKG_STATUS_PATH = "usr/lib/ipkg/status"; // Destination status file location +const QString IPKG_INFO_PATH = "usr/lib/ipkg/info"; // Package file lists location OIpkg *oipkg; @@ -48,6 +50,7 @@ OIpkg *oipkg; int fsignalIpkgMessage( ipkg_conf_t *conf, message_level_t level, char *msg ) { + // Display message only if it is below the message level threshold if ( conf && ( conf->verbosity < level ) ) return 0; else @@ -58,7 +61,7 @@ int fsignalIpkgMessage( ipkg_conf_t *conf, message_level_t level, char *msg ) char *fIpkgResponse( char */*question*/ ) { - return 0x0; + return 0l; } int fIpkgStatus( char */*name*/, int /*status*/, char *desc, void */*userdata*/ ) @@ -81,6 +84,7 @@ OIpkg::OIpkg( Config *config, QObject *parent, const char *name ) , m_ipkgExecOptions( 0 ) , m_ipkgExecVerbosity( 1 ) { + // Keep pointer to self for the Ipkg callback functions oipkg = this; // Initialize libipkg @@ -362,6 +366,24 @@ OPackageList *OIpkg::installedPackages( const QString &destName, const QString & return pl; } +OConfItem *OIpkg::findConfItem( OConfItem::Type type, const QString &name ) +{ + // Find configuration item in list + OConfItemListIterator configIt( *m_confInfo ); + OConfItem *config = 0l; + for ( ; configIt.current(); ++configIt ) + { + config = configIt.current(); + if ( config->type() == type && config->name() == name ) + break; + } + + if ( config && config->type() == type && config->name() == name ) + return config; + + return 0l; +} + bool OIpkg::executeCommand( OPackage::Command command, const QStringList ¶meters, const QString &destination, const QObject *receiver, const char *slotOutput, bool rawOutput ) { @@ -384,16 +406,11 @@ bool OIpkg::executeCommand( OPackage::Command command, const QStringList ¶me m_ipkgArgs.dest[ len - 1 ] = '\0'; } else - m_ipkgArgs.dest = 0x0; + m_ipkgArgs.dest = 0l; // Connect output signal to widget - if ( rawOutput ) - { -// if ( slotOutput ) -// connect( this, SIGNAL(signalIpkgMessage(char*)), receiver, slotOutput ); - } - else + if ( !rawOutput ) { // TODO - connect to local slot and parse output before emitting signalIpkgMessage } @@ -401,33 +418,53 @@ bool OIpkg::executeCommand( OPackage::Command command, const QStringList ¶me switch( command ) { case OPackage::Update : { - connect( this, SIGNAL(signalIpkgMessage(char*)), receiver, slotOutput ); + connect( this, SIGNAL(signalIpkgMessage(const QString &)), receiver, slotOutput ); ipkg_lists_update( &m_ipkgArgs ); }; break; case OPackage::Upgrade : { - connect( this, SIGNAL(signalIpkgMessage(char*)), receiver, slotOutput ); + connect( this, SIGNAL(signalIpkgMessage(const QString &)), receiver, slotOutput ); ipkg_packages_upgrade( &m_ipkgArgs ); + + // Re-link non-root destinations to make sure everything is in sync + OConfItemList *destList = destinations(); + OConfItemListIterator it( *destList ); + for ( ; it.current(); ++it ) + { + OConfItem *dest = it.current(); + if ( dest->name() != "root" ) + linkPackageDir( dest->name() ); + } + delete destList; }; break; case OPackage::Install : { - connect( this, SIGNAL(signalIpkgMessage(char*)), receiver, slotOutput ); + connect( this, SIGNAL(signalIpkgMessage(const QString &)), receiver, slotOutput ); for ( QStringList::ConstIterator it = parameters.begin(); it != parameters.end(); ++it ) { ipkg_packages_install( &m_ipkgArgs, (*it) ); } + if ( destination != "root" ) + linkPackageDir( destination ); }; break; case OPackage::Remove : { - connect( this, SIGNAL(signalIpkgMessage(char*)), receiver, slotOutput ); + connect( this, SIGNAL(signalIpkgMessage(const QString &)), receiver, slotOutput ); + + // Get list of destinations for unlinking of packages not installed to root + OConfItemList *destList = destinations(); + for ( QStringList::ConstIterator it = parameters.begin(); it != parameters.end(); ++it ) { + unlinkPackage( (*it), destList ); ipkg_packages_remove( &m_ipkgArgs, (*it), true ); } + + delete destList; }; break; case OPackage::Download : { - connect( this, SIGNAL(signalIpkgMessage(char*)), receiver, slotOutput ); + connect( this, SIGNAL(signalIpkgMessage(const QString &)), receiver, slotOutput ); for ( QStringList::ConstIterator it = parameters.begin(); it != parameters.end(); ++it ) { ipkg_packages_download( &m_ipkgArgs, (*it) ); @@ -435,13 +472,13 @@ bool OIpkg::executeCommand( OPackage::Command command, const QStringList ¶me }; break; case OPackage::Info : { - connect( this, SIGNAL(signalIpkgStatus(char*)), receiver, slotOutput ); - ipkg_packages_info( &m_ipkgArgs, (*parameters.begin()), &fIpkgStatus, 0x0 ); + connect( this, SIGNAL(signalIpkgStatus(const QString &)), receiver, slotOutput ); + ipkg_packages_info( &m_ipkgArgs, (*parameters.begin()), &fIpkgStatus, 0l ); }; break; case OPackage::Files : { - connect( this, SIGNAL(signalIpkgList(char*)), receiver, slotOutput ); - ipkg_package_files( &m_ipkgArgs, (*parameters.begin()), &fIpkgFiles, 0x0 ); + connect( this, SIGNAL(signalIpkgList(const QString &)), receiver, slotOutput ); + ipkg_package_files( &m_ipkgArgs, (*parameters.begin()), &fIpkgFiles, 0l ); }; break; default : break; @@ -589,3 +626,140 @@ OConfItemList *OIpkg::filterConfItems( OConfItem::Type typefilter ) return sl; } + +const QString &OIpkg::rootPath() +{ + if ( m_rootPath.isEmpty() ) + { + OConfItem *rootDest = findConfItem( OConfItem::Destination, "root" ); + rootDest ? m_rootPath = rootDest->value() + : m_rootPath = '/'; + if ( m_rootPath.right( 1 ) == '/' ) + m_rootPath.truncate( m_rootPath.length() - 1 ); + } + return m_rootPath; +} + +void OIpkg::linkPackageDir( const QString &dest ) +{ + if ( !dest.isNull() ) + { + OConfItem *destConfItem = findConfItem( OConfItem::Destination, dest ); + + emit signalIpkgMessage( tr( "Linking packages installed in: %1" ).arg( dest ) ); + + // Set package destination directory + QString destDir = destConfItem->value(); + QString destInfoDir = destDir; + if ( destInfoDir.right( 1 ) != '/' ) + destInfoDir.append( '/' ); + destInfoDir.append( IPKG_INFO_PATH ); + + // Get list of installed packages in destination + QDir packageDir( destInfoDir ); + QStringList packageFiles; + if ( packageDir.exists() ) + { + packageDir.setNameFilter( "*.list" ); + packageDir.setFilter( QDir::Files ); + packageFiles = packageDir.entryList( "*.list", QDir::Files ); + } + + // Link all files for every package installed in desination + QStringList::Iterator lastFile = packageFiles.end(); + for ( QStringList::Iterator it = packageFiles.begin(); it != lastFile; ++it ) + { + //emit signalIpkgMessage( QString( "Processing: %1/%2" ).arg( destInfoDir ).arg (*it) ); + QString packageFileName = destInfoDir; + packageFileName.append( '/' ); + packageFileName.append( (*it) ); + QFile packageFile( packageFileName ); + if ( packageFile.open( IO_ReadOnly ) ) + { + QTextStream t( &packageFile ); + QString linkFile; + while ( !t.eof() ) + { + // Get the name of the file to link and build the sym link filename + linkFile = t.readLine(); + QString linkDest( linkFile.right( linkFile.length() - destDir.length() ) ); + linkDest.prepend( rootPath() ); + + // If file installed file is actually symbolic link, use actual file for linking + QFileInfo fileInfo( linkFile ); + if ( fileInfo.isSymLink() && !fileInfo.readLink().isEmpty() ) + linkFile = fileInfo.readLink(); + + // See if directory exists in 'root', if not, create + fileInfo.setFile( linkDest ); + QString linkDestDirName = fileInfo.dirPath( true ); + QDir linkDestDir( linkDestDirName ); + if ( !linkDestDir.exists() ) + { + linkDestDir.mkdir( linkDestDirName ); + } + else + { + // Remove any previous link to make sure we will be pointing to the current version + if ( QFile::exists( linkDest ) ) + QFile::remove( linkDest ); + } + + // Link the file + //emit signalIpkgMessage( QString( "Linking '%1' to '%2'" ).arg( linkFile ).arg( linkDest ) ); + if ( symlink( linkFile, linkDest ) == -1 ) + emit signalIpkgMessage( tr( "Error linkling '%1' to '%2'" ) + .arg( linkFile ) + .arg( linkDest ) ); + } + packageFile.close(); + } + } + } +} + +void OIpkg::unlinkPackage( const QString &package, OConfItemList *destList ) +{ + if ( !package.isNull() ) + { + // Find destination package is installed in + if ( destList ) + { + OConfItemListIterator it( *destList ); + for ( ; it.current(); ++it ) + { + OConfItem *dest = it.current(); + QString destInfoFileName = QString( "%1/%2/%3.list" ).arg( dest->value() ) + .arg( IPKG_INFO_PATH ) + .arg( package ); + //emit signalIpkgMessage( QString( "Looking for '%1'" ).arg ( destInfoFileName ) ); + + // If found and destination is not 'root', remove symbolic links + if ( QFile::exists( destInfoFileName ) && dest->name() != "root" ) + { + QFile destInfoFile( destInfoFileName ); + if ( destInfoFile.open( IO_ReadOnly ) ) + { + QTextStream t( &destInfoFile ); + QString linkFile; + while ( !t.eof() ) + { + // Get the name of the file to link and build the sym link filename + linkFile = t.readLine(); + QString linkDest( linkFile.right( linkFile.length() - + dest->value().length() ) ); + linkDest.prepend( rootPath() ); + + //emit signalIpkgMessage( QString( "Deleting: '%1'" ).arg( linkDest ) ); + QFile::remove( linkDest ); + } + destInfoFile.close(); + } + + emit signalIpkgMessage( tr( "Links removed for: %1" ).arg( package ) ); + return; + } + } + } + } +} diff --git a/noncore/settings/packagemanager/oipkg.h b/noncore/settings/packagemanager/oipkg.h index 3c96200..0263f50 100644 --- a/noncore/settings/packagemanager/oipkg.h +++ b/noncore/settings/packagemanager/oipkg.h @@ -56,7 +56,7 @@ class OIpkg : public QObject Q_OBJECT public: - OIpkg( Config *config = 0x0, QObject *parent = 0x0, const char *name = 0x0 ); + OIpkg( Config *config = 0l, QObject *parent = 0l, const char *name = 0l ); ~OIpkg(); OConfItemList *configItems(); @@ -77,11 +77,14 @@ public: OPackageList *installedPackages( const QString &destName = QString::null, const QString &destPath = QString::null ); + OConfItem *findConfItem( OConfItem::Type type = OConfItem::NotDefined, + const QString &name = QString::null ); + bool executeCommand( OPackage::Command command = OPackage::NotDefined, const QStringList ¶meters = QStringList(), const QString &destination = QString::null, - const QObject *receiver = 0x0, - const char *slotOutput = 0x0, + const QObject *receiver = 0l, + const char *slotOutput = 0l, bool rawOutput = true ); void abortCommand(); @@ -95,14 +98,19 @@ private: OConfItemList *m_confInfo; // Contains info from all Ipkg configuration files int m_ipkgExecOptions; // Bit-mapped flags for Ipkg execution options int m_ipkgExecVerbosity; // Ipkg execution verbosity level + QString m_rootPath; // Directory path where the 'root' destination is located void loadConfiguration(); OConfItemList *filterConfItems( OConfItem::Type typefilter = OConfItem::NotDefined ); + const QString &rootPath(); + void linkPackageDir( const QString &dest = QString::null ); + void unlinkPackage( const QString &package = QString::null, + OConfItemList *destList = 0l ); signals: - void signalIpkgMessage( char *msg ); - void signalIpkgStatus( char *status ); - void signalIpkgList( char *filelist ); + void signalIpkgMessage( const QString &msg ); + void signalIpkgStatus( const QString &status ); + void signalIpkgList( const QString &filelist ); }; #endif diff --git a/noncore/settings/packagemanager/oipkgconfigdlg.cpp b/noncore/settings/packagemanager/oipkgconfigdlg.cpp index 77ad220..e6d6a81 100644 --- a/noncore/settings/packagemanager/oipkgconfigdlg.cpp +++ b/noncore/settings/packagemanager/oipkgconfigdlg.cpp @@ -92,7 +92,7 @@ void OIpkgConfigDlg::accept() if ( !m_installOptions ) { // Update proxy information before saving settings - OConfItem *confItem = findConfItem( OConfItem::Option, "http_proxy" ); + OConfItem *confItem = m_ipkg->findConfItem( OConfItem::Option, "http_proxy" ); if ( confItem ) { confItem->setValue( m_proxyHttpServer->text() ); @@ -103,7 +103,7 @@ void OIpkgConfigDlg::accept() m_proxyHttpServer->text(), QString::null, m_proxyHttpActive->isChecked() ) ); - confItem = findConfItem( OConfItem::Option, "ftp_proxy" ); + confItem = m_ipkg->findConfItem( OConfItem::Option, "ftp_proxy" ); if ( confItem ) { confItem->setValue( m_proxyFtpServer->text() ); @@ -114,14 +114,14 @@ void OIpkgConfigDlg::accept() m_proxyFtpServer->text(), QString::null, m_proxyFtpActive->isChecked() ) ); - confItem = findConfItem( OConfItem::Option, "proxy_username" ); + confItem = m_ipkg->findConfItem( OConfItem::Option, "proxy_username" ); if ( confItem ) confItem->setValue( m_proxyUsername->text() ); else m_configs->append( new OConfItem( OConfItem::Option, "proxy_username", m_proxyUsername->text() ) ); - confItem = findConfItem( OConfItem::Option, "proxy_password" ); + confItem = m_ipkg->findConfItem( OConfItem::Option, "proxy_password" ); if ( confItem ) confItem->setValue( m_proxyPassword->text() ); else @@ -393,24 +393,6 @@ void OIpkgConfigDlg::initData() m_optVerboseIpkg->setCurrentItem( m_ipkg->ipkgExecVerbosity() ); } -OConfItem *OIpkgConfigDlg::findConfItem( OConfItem::Type type, const QString &name ) -{ - // Find selected server in list - OConfItemListIterator configIt( *m_configs ); - OConfItem *config = 0l; - for ( ; configIt.current(); ++configIt ) - { - config = configIt.current(); - if ( config->type() == type && config->name() == name ) - break; - } - - if ( config && config->type() == type && config->name() == name ) - return config; - - return 0l; -} - void OIpkgConfigDlg::slotServerSelected( int index ) { m_serverCurrent = index; @@ -442,7 +424,7 @@ void OIpkgConfigDlg::slotServerNew() void OIpkgConfigDlg::slotServerEdit() { // Find selected server in list - OConfItem *server = findConfItem( OConfItem::Source, m_serverList->currentText() ); + OConfItem *server = m_ipkg->findConfItem( OConfItem::Source, m_serverList->currentText() ); // Edit server if ( server ) @@ -461,7 +443,7 @@ void OIpkgConfigDlg::slotServerEdit() void OIpkgConfigDlg::slotServerDelete() { // Find selected server in list - OConfItem *server = findConfItem( OConfItem::Source, m_serverList->currentText() ); + OConfItem *server = m_ipkg->findConfItem( OConfItem::Source, m_serverList->currentText() ); // Delete server if ( server ) @@ -502,7 +484,7 @@ void OIpkgConfigDlg::slotDestNew() void OIpkgConfigDlg::slotDestEdit() { // Find selected destination in list - OConfItem *dest = findConfItem( OConfItem::Destination, m_destList->currentText() ); + OConfItem *dest = m_ipkg->findConfItem( OConfItem::Destination, m_destList->currentText() ); // Edit destination if ( dest ) @@ -521,7 +503,7 @@ void OIpkgConfigDlg::slotDestEdit() void OIpkgConfigDlg::slotDestDelete() { // Find selected destination in list - OConfItem *destination = findConfItem( OConfItem::Destination, m_destList->currentText() ); + OConfItem *destination = m_ipkg->findConfItem( OConfItem::Destination, m_destList->currentText() ); // Delete destination if ( destination ) diff --git a/noncore/settings/packagemanager/oipkgconfigdlg.h b/noncore/settings/packagemanager/oipkgconfigdlg.h index 5b7e91d..0fb2e16 100644 --- a/noncore/settings/packagemanager/oipkgconfigdlg.h +++ b/noncore/settings/packagemanager/oipkgconfigdlg.h @@ -107,9 +107,6 @@ private: void initData(); - OConfItem *findConfItem( OConfItem::Type type = OConfItem::NotDefined, - const QString &name = QString::null ); - private slots: void slotServerSelected( int index ); void slotServerNew(); diff --git a/noncore/settings/packagemanager/opackagemanager.cpp b/noncore/settings/packagemanager/opackagemanager.cpp index cbddfe7..c9fdec1 100644 --- a/noncore/settings/packagemanager/opackagemanager.cpp +++ b/noncore/settings/packagemanager/opackagemanager.cpp @@ -269,25 +269,7 @@ QStringList OPackageManager::destinations() OConfItem *OPackageManager::findConfItem( OConfItem::Type type, const QString &name ) { - OConfItem *confItem = 0x0; - OConfItemList *confList = m_ipkg.configItems(); - if ( confList ) - { - for ( OConfItemListIterator confIt( *confList ); confIt.current(); ++confIt ) - { - OConfItem *conf = confIt.current(); - - // Add only active confinations - if ( conf->type() == type && conf->name() == name ) - { - confItem = conf; - break; - } - } - } - - return confItem; - + return m_ipkg.findConfItem( type, name ); } OPackage *OPackageManager::findPackage( const QString &name ) diff --git a/noncore/settings/packagemanager/opie-packagemanager.control b/noncore/settings/packagemanager/opie-packagemanager.control index cdf419c..da3ddfe 100644 --- a/noncore/settings/packagemanager/opie-packagemanager.control +++ b/noncore/settings/packagemanager/opie-packagemanager.control @@ -2,9 +2,9 @@ Package: opie-packagemanager Files: plugins/application/libpackagemanager.so* bin/packagemanager pics/packagemanager apps/Settings/packagemanager.desktop Priority: optional Section: opie/settings -Depends: task-opie-minimal, libopiecore2, libopieui2, libipkg (>=0.99.120), ipkg-link +Depends: task-opie-minimal, libopiecore2, libopieui2, libipkg (>=0.99.120) Replaces: packagemanager Architecture: arm Maintainer: Dan Williams (drw@handhelds.org) Description: Opie package management client -Version: 0.6.0$EXTRAVERSION +Version: 0.6.1$EXTRAVERSION diff --git a/noncore/settings/packagemanager/packageinfodlg.cpp b/noncore/settings/packagemanager/packageinfodlg.cpp index 5f72a67..3eef939 100644 --- a/noncore/settings/packagemanager/packageinfodlg.cpp +++ b/noncore/settings/packagemanager/packageinfodlg.cpp @@ -76,7 +76,8 @@ PackageInfoDlg::PackageInfoDlg( QWidget *parent, OPackageManager *pm, const QStr { // 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(const QString &)), true ); } // Files tab (display only if package is installed) @@ -128,18 +129,19 @@ 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(const QString &)), true ); if ( m_retrieveFiles ) m_retrieveFiles->hide(); } -void PackageInfoDlg::slotInfo( char *info ) +void PackageInfoDlg::slotInfo( const QString &info ) { m_information.append( info ); } -void PackageInfoDlg::slotFiles( char *filelist ) +void PackageInfoDlg::slotFiles( const QString &filelist ) { QString str = filelist; diff --git a/noncore/settings/packagemanager/packageinfodlg.h b/noncore/settings/packagemanager/packageinfodlg.h index d1830de..2962f9a 100644 --- a/noncore/settings/packagemanager/packageinfodlg.h +++ b/noncore/settings/packagemanager/packageinfodlg.h @@ -59,8 +59,8 @@ private: private slots: void slotBtnFileScan(); - void slotInfo( char *info ); - void slotFiles( char *filelist ); + void slotInfo( const QString &info ); + void slotFiles( const QString &filelist ); }; #endif |