summaryrefslogtreecommitdiff
path: root/noncore/settings/packagemanager/oipkg.cpp
Side-by-side diff
Diffstat (limited to 'noncore/settings/packagemanager/oipkg.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/packagemanager/oipkg.cpp56
1 files changed, 29 insertions, 27 deletions
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,37 +1,37 @@
/*
-                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.
*/
#include "oipkg.h"
#include <qdir.h>
#include <qfile.h>
#include <qtextstream.h>
@@ -43,24 +43,26 @@ const QString IPKG_PKG_PATH = "/usr/lib/ipkg/lists"; // Directory containing
const QString IPKG_STATUS_PATH = "usr/lib/ipkg/status"; // Destination status file location
OIpkg *oipkg;
// Ipkg callback functions
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*/ )
{
return 0x0;
}
int fIpkgStatus( char */*name*/, int /*status*/, char *desc, void */*userdata*/ )
{
oipkg->ipkgStatus( desc );
return 0;
}
@@ -344,25 +346,25 @@ OPackageList *OIpkg::installedPackages( const QString &destName, const QString &
while ( !line.isEmpty() && line.find( ':', 0 ) == -1 && !t.eof() )
line = t.readLine();
}
else
line = t.readLine();
}
f.close();
return pl;
}
-bool OIpkg::executeCommand( OPackage::Command command, QStringList *parameters, const QString &destination,
+bool OIpkg::executeCommand( OPackage::Command command, const QStringList &parameters, const QString &destination,
const QObject *receiver, const char *slotOutput, bool rawOutput )
{
if ( command == OPackage::NotDefined )
return false;
// Set ipkg run-time options/arguments
m_ipkgArgs.force_depends = ( m_ipkgExecOptions & FORCE_DEPENDS );
m_ipkgArgs.force_reinstall = ( m_ipkgExecOptions & FORCE_REINSTALL );
// TODO m_ipkgArgs.force_remove = ( m_ipkgExecOptions & FORCE_REMOVE );
m_ipkgArgs.force_overwrite = ( m_ipkgExecOptions & FORCE_OVERWRITE );
m_ipkgArgs.verbosity = m_ipkgExecVerbosity;
if ( m_ipkgArgs.dest )
@@ -394,54 +396,54 @@ bool OIpkg::executeCommand( OPackage::Command command, QStringList *parameters,
case OPackage::Update : {
connect( this, SIGNAL(signalIpkgMessage(char*)), receiver, slotOutput );
ipkg_lists_update( &m_ipkgArgs );
};
break;
case OPackage::Upgrade : {
connect( this, SIGNAL(signalIpkgMessage(char*)), receiver, slotOutput );
ipkg_packages_upgrade( &m_ipkgArgs );
};
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;
};
return true;
}
void OIpkg::ipkgMessage( char *msg )
{
emit signalIpkgMessage( msg );
}