summaryrefslogtreecommitdiff
authordrw <drw>2004-12-21 19:58:58 (UTC)
committer drw <drw>2004-12-21 19:58:58 (UTC)
commit2e21be2e93866511f55e2a200514b3ce15b14791 (patch) (side-by-side diff)
tree0aa6ca907bfbcfc5b8abbc5a83f0a2cae70730fe
parent570c8709d1d7622e2a57432f40a67213216d2606 (diff)
downloadopie-2e21be2e93866511f55e2a200514b3ce15b14791.zip
opie-2e21be2e93866511f55e2a200514b3ce15b14791.tar.gz
opie-2e21be2e93866511f55e2a200514b3ce15b14791.tar.bz2
Fix app linking to link all dependent packages as well as selected packages.
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/packagemanager/installdlg.cpp46
-rw-r--r--noncore/settings/packagemanager/installdlg.h2
2 files changed, 32 insertions, 16 deletions
diff --git a/noncore/settings/packagemanager/installdlg.cpp b/noncore/settings/packagemanager/installdlg.cpp
index 494603b..985e2bd 100644
--- a/noncore/settings/packagemanager/installdlg.cpp
+++ b/noncore/settings/packagemanager/installdlg.cpp
@@ -55,10 +55,10 @@ InstallDlg::InstallDlg( QWidget *parent, OPackageManager *pm, const QString &cap
OPackage::Command command2, const QStringList &packages2,
OPackage::Command command3, const QStringList &packages3 )
- : QWidget( 0x0 )
+ : QWidget( 0l )
, m_packman( pm )
, m_installFound( false )
, m_numCommands( 0 )
, m_currCommand( 0 )
- , m_destItem( 0x0 )
+ , m_destItem( 0l )
{
// Save command/package list information
@@ -117,6 +117,6 @@ InstallDlg::InstallDlg( QWidget *parent, OPackageManager *pm, const QString &cap
else
{
- m_destination = 0x0;
- m_availSpace = 0x0;
+ m_destination = 0l;
+ m_availSpace = 0l;
}
@@ -255,10 +255,7 @@ void InstallDlg::slotBtnStart()
this, SLOT(slotOutput(char*)), true );
- // Link/Unlink application if the package was removed from or installed to a destination
- // other than root
- if ( ( m_command[ m_currCommand ] == OPackage::Install && dest != "root" ) ||
- ( m_command[ m_currCommand ] == OPackage::Remove ) )
+ if ( m_command[ m_currCommand ] == OPackage::Remove )
{
- //m_packman->findPackage( m_packages[ m_currCommand ]->destination() != "root"*/ )
+ // Unlink application if the package was removed
// Loop through all package names in the command group
@@ -275,8 +272,4 @@ void InstallDlg::slotBtnStart()
// Display feedback to user
- if ( m_command[ m_currCommand ] == OPackage::Install )
- m_output->append( tr( QString( "Running ipkg-link to link package '%1'." )
- .arg( currPackage->name() ) ) );
- else
m_output->append( tr( QString( "Running ipkg-link to remove links for package '%1'." )
.arg( currPackage->name() ) ) );
@@ -291,5 +284,5 @@ void InstallDlg::slotBtnStart()
Opie::Core::OProcess::NoCommunication ) )
{
- slotProcessDone( 0x0 );
+ slotProcessDone( 0l );
m_output->append( tr( "Unable to run ipkg-link." ) );
m_output->setCursorPosition( m_output->numLines(), 0 );
@@ -297,9 +290,32 @@ void InstallDlg::slotBtnStart()
}
}
+ }
+ 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( 0x0 );
+ slotProcessDone( 0l );
}
diff --git a/noncore/settings/packagemanager/installdlg.h b/noncore/settings/packagemanager/installdlg.h
index eabb717..7a64fe0 100644
--- a/noncore/settings/packagemanager/installdlg.h
+++ b/noncore/settings/packagemanager/installdlg.h
@@ -56,5 +56,5 @@ class InstallDlg : public QWidget
public:
- InstallDlg( QWidget *parent = 0x0, OPackageManager *pm = 0x0,
+ InstallDlg( QWidget *parent = 0l, OPackageManager *pm = 0l,
const QString &caption = QString::null,
OPackage::Command command1 = OPackage::NotDefined,