author | tille <tille> | 2002-11-24 16:28:25 (UTC) |
---|---|---|
committer | tille <tille> | 2002-11-24 16:28:25 (UTC) |
commit | 5b029ef4b109d50ae41a3fd8bfae0b30864745f8 (patch) (side-by-side diff) | |
tree | f5a3d81a404a57dd21c5205e70dca985bb948416 | |
parent | 9387bc3f63b1e48c559d0758c50d9af857e7feeb (diff) | |
download | opie-5b029ef4b109d50ae41a3fd8bfae0b30864745f8.zip opie-5b029ef4b109d50ae41a3fd8bfae0b30864745f8.tar.gz opie-5b029ef4b109d50ae41a3fd8bfae0b30864745f8.tar.bz2 |
valgrind found bugs
thanks to simon
-rw-r--r-- | noncore/unsupported/oipkg/package.cpp | 30 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/package.h | 5 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/packagelist.cpp | 1 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/packagelistitem.cpp | 5 |
4 files changed, 27 insertions, 14 deletions
diff --git a/noncore/unsupported/oipkg/package.cpp b/noncore/unsupported/oipkg/package.cpp index e020601..190b3fb 100644 --- a/noncore/unsupported/oipkg/package.cpp +++ b/noncore/unsupported/oipkg/package.cpp @@ -14,34 +14,41 @@ #include <qfile.h> #include <qtextstream.h> #include <stdlib.h> #include <unistd.h> #include "debug.h" OipkgPackage::OipkgPackage( QObject *parent, const char *name ) - : QObject(parent,name) + : QObject(parent,name) { - + init(); } OipkgPackage::~OipkgPackage() { + } OipkgPackage::OipkgPackage( PackageManagerSettings *s, QObject *parent, const char *name ) : QObject(parent,name) { - init(s); + settings = s; + init(); } -void OipkgPackage::init( PackageManagerSettings *s ) +// void OipkgPackage::init( PackageManagerSettings *s ) +// { +// settings = s; +// init(); +// } + +void OipkgPackage::init( ) { - settings = s; _size = ""; _section = ""; _subsection = ""; _shortDesc = ""; _desc = ""; _name = ""; _toProcess = false; _useFileName = false; @@ -50,40 +57,43 @@ void OipkgPackage::init( PackageManagerSettings *s ) _dest = settings->getDestinationName(); _link = settings->createLinks(); _versions=0; _version=""; } OipkgPackage::OipkgPackage( QStringList pack, PackageManagerSettings *s , QObject *parent, const char *name ) : QObject(parent,name) -{ - init(s); +{ + settings = s; + init(); parsePackage( pack ); } OipkgPackage::OipkgPackage( QString n, PackageManagerSettings *s, QObject *parent, const char *name ) : QObject(parent,name) -{ - init(s); +{ + settings = s; + init(); if ( !QFile::exists( n ) ) { _name = QString( n ); }else{ pvDebug(4,"remote file: "+n); parseIpkgFile( n ); _useFileName = true; _fileName = QString( n ); } } OipkgPackage::OipkgPackage( OipkgPackage *pi, QObject *parent, const char *name ) : QObject(parent,name) { - init(pi->settings); + settings = pi->settings; + init(); copyValues( pi ); } void OipkgPackage::setValue( QString n, QString t ) { if ( n == "Package" ) { diff --git a/noncore/unsupported/oipkg/package.h b/noncore/unsupported/oipkg/package.h index 2334c31..02d8eff 100644 --- a/noncore/unsupported/oipkg/package.h +++ b/noncore/unsupported/oipkg/package.h @@ -85,16 +85,17 @@ private: QString _size; QString _section; QString _subsection; QString _shortDesc; QString _desc; QString _version; QString _dest; QDict<QString> _values; - QDict<OipkgPackage> *_versions; + QDict<OipkgPackage> *_versions; bool _useFileName; void parsePackage( QStringList ); - void init(PackageManagerSettings *); + void init(); + // void init(PackageManagerSettings*); }; #endif diff --git a/noncore/unsupported/oipkg/packagelist.cpp b/noncore/unsupported/oipkg/packagelist.cpp index 5f79ec1..6f0b56f 100644 --- a/noncore/unsupported/oipkg/packagelist.cpp +++ b/noncore/unsupported/oipkg/packagelist.cpp @@ -201,16 +201,17 @@ void PackageList::readFileEntries( QString filename, QString dest ) if ( p ) { p->setDest( dest ); insertPackage( p ); packEntry.clear(); } } delete statusStream; + f.close(); return; } void PackageList::setSettings( PackageManagerSettings *s ) { settings = s; } diff --git a/noncore/unsupported/oipkg/packagelistitem.cpp b/noncore/unsupported/oipkg/packagelistitem.cpp index 51d024b..1610a37 100644 --- a/noncore/unsupported/oipkg/packagelistitem.cpp +++ b/noncore/unsupported/oipkg/packagelistitem.cpp @@ -39,22 +39,23 @@ PackageListItem::PackageListItem(QListView* lv, OipkgPackage *pi, PackageManager PackageListItem::PackageListItem(ListViewItemOipkg *lvi, OipkgPackage *pi, PackageManagerSettings *s) : ListViewItemOipkg(lvi,pi->name(),ListViewItemOipkg::Package) { init(pi,s); } PackageListItem::~PackageListItem() { - delete popupMenu; - delete destsMenu; + delete popupMenu; + delete destsMenu; } void PackageListItem::init( OipkgPackage *pi, PackageManagerSettings *s) { + //waring pass something different than 0 popupMenu = new QPopupMenu( 0 ); destsMenu = new QPopupMenu( 0 ); package = pi; settings = s; setExpandable( true ); ListViewItemOipkg *item; nameItem = new ListViewItemOipkg( this, ListViewItemOipkg::Attribute,"name" ); item = new ListViewItemOipkg( this, ListViewItemOipkg::Attribute, QObject::tr("Description: ")+pi->desc() ); |