summaryrefslogtreecommitdiff
path: root/noncore/unsupported/oipkg/package.cpp
Side-by-side diff
Diffstat (limited to 'noncore/unsupported/oipkg/package.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/unsupported/oipkg/package.cpp54
1 files changed, 44 insertions, 10 deletions
diff --git a/noncore/unsupported/oipkg/package.cpp b/noncore/unsupported/oipkg/package.cpp
index 1705f78..9f602b5 100644
--- a/noncore/unsupported/oipkg/package.cpp
+++ b/noncore/unsupported/oipkg/package.cpp
@@ -10,6 +10,12 @@ Package::~Package()
}
-Package::Package()
+Package::Package( PackageManagerSettings *s )
{
+ init(s);
+}
+
+void Package::init( PackageManagerSettings *s )
+{
+ settings = s;
_size = "";
_section = "";
@@ -20,16 +26,17 @@ Package::Package()
_toProcess = false;
_status = "";
+ _dest = "";
}
-Package::Package( QStringList pack )
+Package::Package( QStringList pack, PackageManagerSettings *s )
{
- Package();
+ init(s);
parsePackage( pack );
_toProcess = false;
}
-Package::Package( QString n )
+Package::Package( QString n, PackageManagerSettings *s )
{
- Package();
+ init(s);
_name = QString( n );
_toProcess = false;
@@ -38,5 +45,5 @@ Package::Package( QString n )
Package::Package( Package *pi )
{
- Package();
+ init(pi->settings);
copyValues( pi );
_toProcess = false;
@@ -173,5 +180,5 @@ void Package::copyValues( Package* pack )
}
-QString Package::getSection()
+QString Package::section()
{
return _section;
@@ -191,5 +198,5 @@ void Package::setSection( QString s)
}
-QString Package::getSubSection()
+QString Package::subSection()
{
return _subsection;
@@ -254,10 +261,37 @@ QString Package::details()
}
-/** No descriptions */
void Package::processed()
{
_toProcess = false;
- //hack, but we're mot writing status anyway...
+ //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 )
+{
+ _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;
+}