Diffstat (limited to 'noncore/unsupported/oipkg/package.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/unsupported/oipkg/package.cpp | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/noncore/unsupported/oipkg/package.cpp b/noncore/unsupported/oipkg/package.cpp index 0499e19..6bb53a9 100644 --- a/noncore/unsupported/oipkg/package.cpp +++ b/noncore/unsupported/oipkg/package.cpp | |||
@@ -25,12 +25,13 @@ void Package::init( PackageManagerSettings *s ) | |||
25 | _section = ""; | 25 | _section = ""; |
26 | _subsection = ""; | 26 | _subsection = ""; |
27 | _shortDesc = ""; | 27 | _shortDesc = ""; |
28 | _desc = ""; | 28 | _desc = ""; |
29 | _name = ""; | 29 | _name = ""; |
30 | _toProcess = false; | 30 | _toProcess = false; |
31 | _useFileName = false; | ||
31 | _status = ""; | 32 | _status = ""; |
32 | _dest = settings->getDestinationName(); | 33 | _dest = settings->getDestinationName(); |
33 | _link = settings->createLinks(); | 34 | _link = settings->createLinks(); |
34 | } | 35 | } |
35 | 36 | ||
36 | Package::Package( QStringList pack, PackageManagerSettings *s ) | 37 | Package::Package( QStringList pack, PackageManagerSettings *s ) |
@@ -45,13 +46,14 @@ Package::Package( QString n, PackageManagerSettings *s ) | |||
45 | if ( !QFile::exists( n ) ) | 46 | if ( !QFile::exists( n ) ) |
46 | { | 47 | { |
47 | _name = QString( n ); | 48 | _name = QString( n ); |
48 | }else{ | 49 | }else{ |
49 | parseIpkgFile( n ); | 50 | parseIpkgFile( n ); |
50 | _toProcess = true; | 51 | _toProcess = true; |
51 | _packageName = QString( n ); | 52 | _useFileName = true; |
53 | _fileName = QString( n ); | ||
52 | } | 54 | } |
53 | } | 55 | } |
54 | 56 | ||
55 | Package::Package( Package *pi ) | 57 | Package::Package( Package *pi ) |
56 | { | 58 | { |
57 | init(pi->settings); | 59 | init(pi->settings); |
@@ -87,13 +89,13 @@ void Package::setValue( QString n, QString t ) | |||
87 | 89 | ||
88 | }else if ( n == "Depends") | 90 | }else if ( n == "Depends") |
89 | { | 91 | { |
90 | 92 | ||
91 | }else if ( n == "Filename") | 93 | }else if ( n == "Filename") |
92 | { | 94 | { |
93 | 95 | _fileName = t; | |
94 | }else if ( n == "Size") | 96 | }else if ( n == "Size") |
95 | { | 97 | { |
96 | 98 | ||
97 | }else if ( n == "MD5Sum") | 99 | }else if ( n == "MD5Sum") |
98 | { | 100 | { |
99 | 101 | ||
@@ -115,12 +117,19 @@ void Package::setValue( QString n, QString t ) | |||
115 | 117 | ||
116 | QString Package::name() | 118 | QString Package::name() |
117 | { | 119 | { |
118 | return _name; | 120 | return _name; |
119 | } | 121 | } |
120 | 122 | ||
123 | |||
124 | QString Package::installName() | ||
125 | { | ||
126 | if (_useFileName) return _fileName; | ||
127 | else return _name; | ||
128 | } | ||
129 | |||
121 | bool Package::installed() | 130 | bool Package::installed() |
122 | { | 131 | { |
123 | return _status.contains("installed"); | 132 | return _status.contains("installed"); |
124 | } | 133 | } |
125 | 134 | ||
126 | void Package::setDesc( QString s ) | 135 | void Package::setDesc( QString s ) |
@@ -328,11 +337,16 @@ void Package::parseIpkgFile( QString file) | |||
328 | f.close(); | 337 | f.close(); |
329 | parsePackage( pack ); | 338 | parsePackage( pack ); |
330 | } | 339 | } |
331 | 340 | ||
332 | } | 341 | } |
333 | 342 | ||
334 | QString Package::getPackageName() | 343 | //QString Package::getPackageName() |
344 | //{ | ||
345 | //if ( _packageName.isEmpty() ) return _name; | ||
346 | //else return _packageName; | ||
347 | //} | ||
348 | |||
349 | void Package::instalFromFile(bool iff) | ||
335 | { | 350 | { |
336 | if ( _packageName.isEmpty() ) return _name; | 351 | _useFileName = iff; |
337 | else return _packageName; | ||
338 | } | 352 | } |