summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/packagemanager/installdlg.cpp52
-rw-r--r--noncore/settings/packagemanager/installdlg.h2
2 files changed, 35 insertions, 19 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,10 +272,6 @@ 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() ) ) );
+ m_output->append( tr( QString( "Running ipkg-link to remove links for package '%1'." )
+ .arg( currPackage->name() ) ) );
m_output->setCursorPosition( m_output->numLines(), 0 );
@@ -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,