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
@@ -53,14 +53,14 @@ _;:, .> :=|. This file is free software; you can
InstallDlg::InstallDlg( QWidget *parent, OPackageManager *pm, const QString &caption,
OPackage::Command command1, const QStringList &packages1,
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
if ( command1 != OPackage::NotDefined )
{
@@ -115,10 +115,10 @@ InstallDlg::InstallDlg( QWidget *parent, OPackageManager *pm, const QString &cap
slotDisplayAvailSpace( m_destination->currentText() );
}
else
{
- m_destination = 0x0;
- m_availSpace = 0x0;
+ m_destination = 0l;
+ m_availSpace = 0l;
}
QGroupBox *groupBox = new QGroupBox( 0, Qt::Vertical, tr( "Output" ), this );
groupBox->layout()->setSpacing( 0 );
@@ -253,14 +253,11 @@ void InstallDlg::slotBtnStart()
// Execute next command
m_packman->executeCommand( m_command[ m_currCommand ], m_packages[ m_currCommand ], dest,
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
for ( QStringList::Iterator it = m_packages[ m_currCommand ].begin();
it != m_packages[ m_currCommand ].end();
@@ -273,12 +270,8 @@ void InstallDlg::slotBtnStart()
currPackage->destination() == "root" ) )
continue;
// 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() ) ) );
m_output->setCursorPosition( m_output->numLines(), 0 );
@@ -289,19 +282,42 @@ void InstallDlg::slotBtnStart()
<< currPackage->name();
if ( !process.start( Opie::Core::OProcess::Block,
Opie::Core::OProcess::NoCommunication ) )
{
- slotProcessDone( 0x0 );
+ 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( 0x0 );
+ slotProcessDone( 0l );
}
void InstallDlg::slotProcessDone( Opie::Core::OProcess *proc )
{
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
@@ -54,9 +54,9 @@ class InstallDlg : public QWidget
{
Q_OBJECT
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,
const QStringList &packages1 = QStringList(),
OPackage::Command command2 = OPackage::NotDefined,