[PC-BSD Commits] r574 - pcbsd/trunk/kcmPBMsource
svn at pcbsd.org
svn at pcbsd.org
Tue Aug 7 20:36:30 PDT 2007
Author: kris
Date: 2007-08-07 20:36:29 -0700 (Tue, 07 Aug 2007)
New Revision: 574
Modified:
pcbsd/trunk/kcmPBMsource/pbm.ui.h
Log:
Fixed bug in PBI removal tool which caused a crash if program config exits
but directory has been removed.
Modified: pcbsd/trunk/kcmPBMsource/pbm.ui.h
===================================================================
--- pcbsd/trunk/kcmPBMsource/pbm.ui.h 2007-08-07 20:24:41 UTC (rev 573)
+++ pcbsd/trunk/kcmPBMsource/pbm.ui.h 2007-08-08 03:36:29 UTC (rev 574)
@@ -41,7 +41,7 @@
fileWatcher->addFile("/Programs/.config/ProgList");
qDebug("Populating list...");
- PopulateList();
+ PopulateList();
connect(fileWatcher, SIGNAL(dirty(const QString&)), this, SLOT(PopulateList()));
// Loads the username
@@ -170,6 +170,15 @@
for (int n=0; n<=i; n++)
{
+ // Check if our directory exists or not
+ QDir d( "/Programs/" + ProgName[n] + ProgVer[n] );
+ if ( !d.exists() ) {
+ // If the directory doesn't exist, remove the entry
+ CleanPackageList(n);
+ PopulateList();
+ return;
+ }
+
qDebug("Working out path for: " + ProgName[n]);
QString progPath = "/Programs/" + ProgName[n] + ProgVer[n];
progPath.remove(" ");
@@ -514,12 +523,14 @@
InfoWindow->kill();
}
+ // Repopulate the List
+ PopulateList();
// Re-enable the buttons
RemoveButton->setEnabled(TRUE);
ExitButton->setEnabled(TRUE);
tabPBM->setEnabled(TRUE);
- QMessageBox::information( this, tr("Success!"), tr("The package was deleted!") );
+ QMessageBox::information( this, tr("Success!"), tr("The package was deleted!") );
}
More information about the Commits
mailing list