summaryrefslogtreecommitdiff
authortille <tille>2002-05-12 09:32:43 (UTC)
committer tille <tille>2002-05-12 09:32:43 (UTC)
commit6f5ac2fbf69f019cc9d3a1522fc507c6b88d2bd6 (patch) (unidiff)
treec584a13cb4b70f007435731b63c0f0c5e6d5460c
parent93eca505676b623407259bccf802e2069708dc36 (diff)
downloadopie-6f5ac2fbf69f019cc9d3a1522fc507c6b88d2bd6.zip
opie-6f5ac2fbf69f019cc9d3a1522fc507c6b88d2bd6.tar.gz
opie-6f5ac2fbf69f019cc9d3a1522fc507c6b88d2bd6.tar.bz2
fixed mem leak
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/unsupported/oipkg/TODO5
-rw-r--r--noncore/unsupported/oipkg/mainwindow.cpp3
-rw-r--r--noncore/unsupported/oipkg/packagelist.cpp6
-rw-r--r--noncore/unsupported/oipkg/packagelistdoclnk.cpp1
-rw-r--r--noncore/unsupported/oipkg/packagelistremote.cpp1
-rw-r--r--noncore/unsupported/oipkg/pmipkg.cpp25
6 files changed, 24 insertions, 17 deletions
diff --git a/noncore/unsupported/oipkg/TODO b/noncore/unsupported/oipkg/TODO
index 6de54ec..b92cbb0 100644
--- a/noncore/unsupported/oipkg/TODO
+++ b/noncore/unsupported/oipkg/TODO
@@ -1,6 +1,4 @@
1* Settings Class 1* Settings Class
2* tr() ;)
3* Dialog to display ipkg output live
4* parse "to install" and "to remove" from status 2* parse "to install" and "to remove" from status
5* install local file dialog 3* install local file dialog
6* qcop 4* qcop
@@ -11,5 +9,4 @@
11* allow reinstalling 9* allow reinstalling
12* different types of filters and searches 10* different types of filters and searches
13 i.e. name, desc, files etc 11 i.e. name, desc, files etc
14* mark packages from doclnk and ipkgfind installed if installed 12* display new list after update \ No newline at end of file
15* show if different version is installed \ No newline at end of file
diff --git a/noncore/unsupported/oipkg/mainwindow.cpp b/noncore/unsupported/oipkg/mainwindow.cpp
index 2fa91e3..19a1420 100644
--- a/noncore/unsupported/oipkg/mainwindow.cpp
+++ b/noncore/unsupported/oipkg/mainwindow.cpp
@@ -92,7 +92,8 @@ void MainWindow::makeMenu()
92 menuBar->insertItem( tr( "Settings" ), cfgMenu ); 92 menuBar->insertItem( tr( "Settings" ), cfgMenu );
93 // menuBar->insertItem( tr( "Sections" ), sectMenu ); 93 // menuBar->insertItem( tr( "Sections" ), sectMenu );
94 94
95 QLabel *spacer = new QLabel( "", toolBar ); 95 QLabel *spacer;
96// spacer = new QLabel( "", toolBar );
96// spacer->setBackgroundColor( toolBar->backgroundColor() ); 97// spacer->setBackgroundColor( toolBar->backgroundColor() );
97// toolBar->setStretchableWidget( spacer ); 98// toolBar->setStretchableWidget( spacer );
98 99
diff --git a/noncore/unsupported/oipkg/packagelist.cpp b/noncore/unsupported/oipkg/packagelist.cpp
index 2fc4c41..fdd1163 100644
--- a/noncore/unsupported/oipkg/packagelist.cpp
+++ b/noncore/unsupported/oipkg/packagelist.cpp
@@ -8,12 +8,14 @@
8#include "debug.h" 8#include "debug.h"
9 9
10static QDict<Package> *packageListAll; 10static QDict<Package> *packageListAll;
11static int packageListAllRefCount = 0;
11 12
12PackageList::PackageList() 13PackageList::PackageList()
13 : packageIter( packageList ) 14 : packageIter( packageList )
14{ 15{
15 empty=true; 16 empty=true;
16 if (!packageListAll) packageListAll = new QDict<Package>(); 17 if (!packageListAll) packageListAll = new QDict<Package>();
18 packageListAllRefCount++;
17 sections << "All"; 19 sections << "All";
18 subSections.insert("All", new QStringList() ); 20 subSections.insert("All", new QStringList() );
19 QStringList *ss = subSections["All"]; 21 QStringList *ss = subSections["All"];
@@ -31,6 +33,7 @@ PackageList::PackageList( PackageManagerSettings* s)
31 33
32PackageList::~PackageList() 34PackageList::~PackageList()
33{ 35{
36 if (--packageListAllRefCount < 1 ) delete packageListAll;
34} 37}
35 38
36/** Inserts a package into the list */ 39/** Inserts a package into the list */
@@ -51,7 +54,7 @@ void PackageList::insertPackage( Package* pack )
51 // p->setName( pack->name()+"["+p->version()+"]" ); 54 // p->setName( pack->name()+"["+p->version()+"]" );
52 if (!packver) 55 if (!packver)
53 { 56 {
54 packver = new QDict<Package>; 57 packver = new QDict<Package>();
55 packver->insert( pack->name(), p ); 58 packver->insert( pack->name(), p );
56 p->setOtherVersions( packver ); 59 p->setOtherVersions( packver );
57 } 60 }
@@ -182,6 +185,7 @@ void PackageList::readFileEntries( QString filename, QString dest )
182 packEntry << line; 185 packEntry << line;
183 }; 186 };
184 } 187 }
188 delete statusStream;
185 return; 189 return;
186} 190}
187 191
diff --git a/noncore/unsupported/oipkg/packagelistdoclnk.cpp b/noncore/unsupported/oipkg/packagelistdoclnk.cpp
index 1d10adf..f31f742 100644
--- a/noncore/unsupported/oipkg/packagelistdoclnk.cpp
+++ b/noncore/unsupported/oipkg/packagelistdoclnk.cpp
@@ -29,6 +29,7 @@ PackageListDocLnk::~PackageListDocLnk()
29 Config cfg( "oipkg", Config::User ); 29 Config cfg( "oipkg", Config::User );
30 cfg.setGroup( "Common" ); 30 cfg.setGroup( "Common" );
31 cfg.writeEntry( "docLnkDir", docLnkDir ); 31 cfg.writeEntry( "docLnkDir", docLnkDir );
32 delete doclnkset;
32} 33}
33 34
34 35
diff --git a/noncore/unsupported/oipkg/packagelistremote.cpp b/noncore/unsupported/oipkg/packagelistremote.cpp
index ee54fca..e37f256 100644
--- a/noncore/unsupported/oipkg/packagelistremote.cpp
+++ b/noncore/unsupported/oipkg/packagelistremote.cpp
@@ -29,6 +29,7 @@ void PackageListRemote::query(QString s)
29void PackageListRemote::update() 29void PackageListRemote::update()
30{ 30{
31 pvDebug(2,"PackageListRemote::update"); 31 pvDebug(2,"PackageListRemote::update");
32 if (searchString.isEmpty()) return;
32 int r=0; 33 int r=0;
33 QString cmd = "wget"; 34 QString cmd = "wget";
34 QString redirect = "/tmp/oipkg.query"; 35 QString redirect = "/tmp/oipkg.query";
diff --git a/noncore/unsupported/oipkg/pmipkg.cpp b/noncore/unsupported/oipkg/pmipkg.cpp
index f2852c3..6ef6d19 100644
--- a/noncore/unsupported/oipkg/pmipkg.cpp
+++ b/noncore/unsupported/oipkg/pmipkg.cpp
@@ -51,7 +51,7 @@ bool PmIpkg::runIpkg(const QString& args, const QString& dest )
51 51
52 cmd += " -force-defaults "; 52 cmd += " -force-defaults ";
53 53
54 if (installDialog->_force_depends) 54 if (installDialog && installDialog->_force_depends)
55 { 55 {
56 if (installDialog->_force_depends->isChecked()) 56 if (installDialog->_force_depends->isChecked())
57 cmd += " -force-depends "; 57 cmd += " -force-depends ";
@@ -87,6 +87,7 @@ bool PmIpkg::runIpkg(const QString& args, const QString& dest )
87 if (lineStr!=lineStrOld) 87 if (lineStr!=lineStrOld)
88 out(lineStr); 88 out(lineStr);
89 lineStrOld = lineStr; 89 lineStrOld = lineStr;
90 qApp->processEvents();
90 } 91 }
91 pclose(fp); 92 pclose(fp);
92 } 93 }
@@ -156,6 +157,8 @@ void PmIpkg::processLinkDir( QString file, QString dest )
156 QString destFile = file; 157 QString destFile = file;
157 file = dest+"/"+file; 158 file = dest+"/"+file;
158 if (file == dest) return; 159 if (file == dest) return;
160// if (linkOpp==createLink) out( "\ncreating links\n" );
161 // if (linkOpp==removeLink) out( "\nremoving links\n" );
159 QFileInfo fileInfo( file ); 162 QFileInfo fileInfo( file );
160 if ( fileInfo.isDir() ) 163 if ( fileInfo.isDir() )
161 { 164 {
@@ -265,18 +268,18 @@ void PmIpkg::remove()
265 runwindow->progress->setProgress( 1 ); 268 runwindow->progress->setProgress( 1 );
266 linkOpp = removeLink; 269 linkOpp = removeLink;
267 to_remove.at(i)->processed(); 270 to_remove.at(i)->processed();
271 if ( to_remove.at(i)->link() )
272 processFileList( fileList, to_remove.at(i)->dest() );
268 to_remove.take( i ); 273 to_remove.take( i );
269 274
270 out("\n\n"); 275 out("\n");
271 }else{ 276 }else{
272 out(tr("Error while removing")+to_remove.at(i)->name()+"\n"); 277 out(tr("Error while removing")+to_remove.at(i)->name()+"\n");
273 }
274 if ( to_remove.at(i)->link() ) 278 if ( to_remove.at(i)->link() )
275 {
276 out( "\nremoving links\n" );
277 out( "for package "+to_remove.at(i)->name()+" in "+to_remove.at(i)->dest()+"\n" );
278 processFileList( fileList, to_remove.at(i)->dest() ); 279 processFileList( fileList, to_remove.at(i)->dest() );
279 } 280 }
281 if ( to_remove.at(i)->link() )
282 processFileList( fileList, to_remove.at(i)->dest() );
280 if ( to_remove.at(i)->link() )delete fileList; 283 if ( to_remove.at(i)->link() )delete fileList;
281 } 284 }
282 to_remove.clear(); 285 to_remove.clear();
@@ -290,20 +293,20 @@ void PmIpkg::install()
290 out(tr("Installing")+"\n"+tr("please wait")+"\n"); 293 out(tr("Installing")+"\n"+tr("please wait")+"\n");
291 for (uint i=0; i < to_install.count(); i++) 294 for (uint i=0; i < to_install.count(); i++)
292 { 295 {
296 qDebug("install loop %i of %i installing %s",i,to_install.count(),to_install.at(i)->installName().latin1()); //pvDebug
293 if ( runIpkg("install " + to_install.at(i)->installName(), to_install.at(i)->dest() )) 297 if ( runIpkg("install " + to_install.at(i)->installName(), to_install.at(i)->dest() ))
294 { 298 {
295 runwindow->progress->setProgress( to_install.at(i)->size().toInt() + runwindow->progress->progress()); 299 runwindow->progress->setProgress( to_install.at(i)->size().toInt() + runwindow->progress->progress());
296 to_install.at(i)->processed(); 300 to_install.at(i)->processed();
301 linkOpp = createLink;
302 if ( to_install.at(i)->link() )
303 makeLinks( to_install.at(i) );
297 to_install.take( i ); 304 to_install.take( i );
298 out("\n\n"); 305 out("\n");
299 }else{ 306 }else{
300 out(tr("Error while installing")+to_install.at(i)->name()+"\n"); 307 out(tr("Error while installing")+to_install.at(i)->name()+"\n");
301 }
302 linkOpp = createLink; 308 linkOpp = createLink;
303 if ( to_install.at(i)->link() ) 309 if ( to_install.at(i)->link() )
304 {
305 out( "\ncreating links\n" );
306 out( "for package "+to_install.at(i)->name()+" in "+to_install.at(i)->dest()+"\n" );
307 makeLinks( to_install.at(i) ); 310 makeLinks( to_install.at(i) );
308 } 311 }
309 } 312 }