summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/unsupported/oipkg/package.cpp2
-rw-r--r--noncore/unsupported/oipkg/pksettings.cpp5
2 files changed, 3 insertions, 4 deletions
diff --git a/noncore/unsupported/oipkg/package.cpp b/noncore/unsupported/oipkg/package.cpp
index 1054a1d..3effb73 100644
--- a/noncore/unsupported/oipkg/package.cpp
+++ b/noncore/unsupported/oipkg/package.cpp
@@ -359,97 +359,97 @@ QString Package::details()
}
}
}
return description;
}
void Package::processed()
{
_toProcess = false;
//hack, but we're not writing status anyway...
if ( installed() ) _status = "install";
else _status = "installed";
}
QString Package::dest()
{
if ( installed()||(!installed() && _toProcess) )
return _dest!=""?_dest:settings->getDestinationName();
else return "";
}
void Package::setDest( QString d )
{
if ( d == "remote") _useFileName = true;
else _dest = d;
}
void Package::setOn()
{
_toProcess = true;
}
bool Package::link()
{
if ( _dest == "root" || (!installed() && !_toProcess) ) return false;
return _link;
}
void Package::setLink(bool b)
{
_link = b;
}
void Package::parseIpkgFile( QString file)
{
// 20020830
// a quick hack to make oipkg understand the new ipk format
// neu: ar pf PACKAGE control.tar.gz | tar xfOz - ./control > /tmp/control
- if (! system("ar pf "+file+" control.tar.gz | tar xfOz - ./control > /tmp/control") )
+ if (system("ar pf "+file+" control.tar.gz | tar xfOz - ./control > /tmp/control") != 0)
{
//#old tar ipk format
system("tar xzf "+file+" -C /tmp");
system("tar xzf /tmp/control.tar.gz -C /tmp");
}
QFile f("/tmp/control");
if ( f.open(IO_ReadOnly) )
{
QTextStream t( &f );
QStringList pack;
while ( !t.eof() )
{
pack << t.readLine();
}
f.close();
parsePackage( pack );
}
}
//QString Package::getPackageName()
//{
// if ( _packageName.isEmpty() ) return _name;
// else return _packageName;
//}
void Package::instalFromFile(bool iff)
{
_useFileName = iff;
}
void Package::setName(QString n)
{
_displayName = n;
}
QDict<QString>* Package::getFields()
{
return &_values;
}
QString Package::status()
{
return _status;
}
bool Package::isOld()
{
diff --git a/noncore/unsupported/oipkg/pksettings.cpp b/noncore/unsupported/oipkg/pksettings.cpp
index acabaed..063b018 100644
--- a/noncore/unsupported/oipkg/pksettings.cpp
+++ b/noncore/unsupported/oipkg/pksettings.cpp
@@ -182,102 +182,101 @@ void PackageManagerSettings::removeDestination()
destinations->removeItem(editeddestination);
activeDestination->removeItem(editeddestination);
activeLinkDestination->removeItem(editeddestination);
editeddestination=0;
connect( destinations, SIGNAL(highlighted(int)), this, SLOT(editDestination(int)) );
destinationname->setEnabled(FALSE);
destinationurl->setEnabled(FALSE);
changed = true;
}
void PackageManagerSettings::serverNameChanged(const QString& t)
{
disconnect( servers, SIGNAL(highlighted(int)), this, SLOT(editServer(int)) );
servers->changeItem( t, editedserver );
activeServers->changeItem( t, editedserver );
connect( servers, SIGNAL(highlighted(int)), this, SLOT(editServer(int)) );
changed = true;
serverChanged = true;
}
void PackageManagerSettings::destNameChanged(const QString& t)
{
disconnect( destinations, SIGNAL(highlighted(int)), this, SLOT(editDestination(int)) );
destinations->changeItem( t, editeddestination );
activeDestination->changeItem( t, editeddestination );
activeLinkDestination->changeItem( t, editeddestination );
connect( destinations, SIGNAL(highlighted(int)), this, SLOT(editDestination(int)) );
changed = true;
}
void PackageManagerSettings::serverUrlChanged(const QString& t)
{
serverurlDic.replace(editedserver, new QString(t));
changed = true;
serverChanged = true;
}
void PackageManagerSettings::destUrlChanged(const QString& t)
{
destinationurlDic.replace(editeddestination, new QString(t));
changed = true;
}
void PackageManagerSettings::writeIpkgConfig(const QString& conffile)
{
QFile conf(conffile);
if ( ! conf.open(IO_WriteOnly) ) return;
QTextStream s(&conf);
- s << "# Written by qpie Package Manager\n";
+ s << "# Written by oipkg -- the opie package manager\n";
for (int i=0; i<(int)activeServers->count(); i++)
{
QString url = serverurlDic[i] ? *serverurlDic[i] : QString("???");
- if ( !activeServers->isSelected(i) )
- s << "#";
+ if ( !activeServers->isSelected(i) ) s << "#";
s << "src " << activeServers->text(i) << " " << url << "\n";
}
for (int i=0; i<(int)destinations->count(); i++)
{
QString url = destinationurlDic[i] ? *destinationurlDic[i] : QString("???");
s << "dest " << destinations->text(i) << " " << url << "\n";
}
conf.close();
}
void PackageManagerSettings::readInstallationSettings()
{
Config cfg( "oipkg", Config::User );
cfg.setGroup( "Settings" );
installationSettingsCount = cfg.readNumEntry( "count", -1 );
currentSetting = cfg.readNumEntry( "current", 0 );// o should be -1
// for (int i = 0; i < installationSettingsCount; i++)
// {
// cfg.setGroup( "Setting_" + QString::number(i) );
// settingName->insertItem( cfg.readEntry( "name", "???" ), i );
// };
readInstallationSetting( currentSetting );
}
///**
// * remove from conf file
// */
//void PackageManagerSettings::removeInstallationSetting()
//{
// settingName->removeItem( settingName->currentItem() );
// Config cfg( "oipkg", Config::User );
// cfg.setGroup( "Setting_" + QString::number( installationSettingsCount ) );
// cfg.clearGroup();
// installationSettingsCount--;
// changed = true;
// settingName->setEditable( false );
//}
///**
// * write to confgile
// */
//void PackageManagerSettings::newInstallationSetting()
//{