[PC-BSD Commits] r15902 - pcbsd/current/src-qt4/libpcbsd
svn at pcbsd.org
svn at pcbsd.org
Wed Mar 21 19:30:59 PDT 2012
Author: kris
Date: 2012-03-22 02:30:59 +0000 (Thu, 22 Mar 2012)
New Revision: 15902
Modified:
pcbsd/current/src-qt4/libpcbsd/metaWidget.cpp
pcbsd/current/src-qt4/libpcbsd/pcbsd-utils.h
Log:
Improve metaWidget to now understand chroot properly, works in
Warden!
Modified: pcbsd/current/src-qt4/libpcbsd/metaWidget.cpp
===================================================================
--- pcbsd/current/src-qt4/libpcbsd/metaWidget.cpp 2012-03-22 02:05:04 UTC (rev 15901)
+++ pcbsd/current/src-qt4/libpcbsd/metaWidget.cpp 2012-03-22 02:30:59 UTC (rev 15902)
@@ -26,10 +26,13 @@
{
qDebug() << "Starting metaWidget...";
treeMetaPkgs = new QTreeWidget();
- if ( chroot.isEmpty() )
+ if ( chroot.isEmpty() ) {
treeMetaPkgs->setHeaderLabel("System Meta Pkgs");
- else
+ } else {
treeMetaPkgs->setHeaderLabel(QString("Meta Pkgs for") + QString(" ") + chroot);
+ chrootArg1="--chroot";
+ chrootArg2=chroot;
+ }
QVBoxLayout *verticalLayout = new QVBoxLayout(this);
verticalLayout->addWidget(treeMetaPkgs);
@@ -76,7 +79,7 @@
connect( getMetaProc, SIGNAL(readyReadStandardOutput()), this, SLOT(slotGetPackageDataOutput()) );
connect( getMetaProc, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(slotFinishLoadingMetaPkgs()) );
getMetaProc->setProcessChannelMode(QProcess::MergedChannels);
- getMetaProc->start(QString("pc-metapkgmanager"), QStringList() << "list");
+ getMetaProc->start(QString("pc-metapkgmanager"), QStringList() << chrootArg1 << chrootArg2 << "list");
}
@@ -140,7 +143,7 @@
{
QString tmp;
QProcess pcmp;
- pcmp.start(QString("pc-metapkgmanager"), QStringList() << "status" << mPkg);
+ pcmp.start(QString("pc-metapkgmanager"), QStringList() << chrootArg1 << chrootArg2 << "status" << mPkg);
while ( pcmp.state() != QProcess::NotRunning ) {
pcmp.waitForFinished(50);
QCoreApplication::processEvents();
@@ -253,6 +256,7 @@
void metaWidget::startMetaChanges()
{
+ qDebug() << "Starting meta deletion";
// We've gotten this far, now time to do the actual meta pkg changes
if ( ! delPkgs.isEmpty() ) {
@@ -264,7 +268,7 @@
delMetaProc->setProcessChannelMode(QProcess::MergedChannels);
connect( delMetaProc, SIGNAL(readyReadStandardOutput()), this, SLOT(slotMetaDelRead()) );
connect( delMetaProc, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(slotMetaDelDone()) );
- delMetaProc->start("pc-metapkgmanager", QStringList() << "del" << delPkgs);
+ delMetaProc->start("pc-metapkgmanager", QStringList() << chrootArg1 << chrootArg2 << "del" << delPkgs);
} else
slotMetaDelDone();
@@ -311,7 +315,7 @@
void metaWidget::slotMetaDelDone()
{
- //if ( ! delPkgs.isEmpty() )
+ if ( ! delPkgs.isEmpty() )
metaProgressDel->close();
// We've gotten this far, now time to do the actual meta pkg changes
@@ -325,8 +329,8 @@
addMetaProc->setProcessChannelMode(QProcess::MergedChannels);
connect( addMetaProc, SIGNAL(readyReadStandardOutput()), this, SLOT(slotMetaAddRead()) );
connect( addMetaProc, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(slotMetaAddDone()) );
- addMetaProc->start("pc-metapkgmanager", QStringList() << "add" << addPkgs << rDir);
- qDebug() << "pc-metapkgmanager" << "add" << addPkgs << rDir;
+ addMetaProc->start("pc-metapkgmanager", QStringList() << chrootArg1 << chrootArg2 <<"add" << addPkgs << rDir);
+ qDebug() << "pc-metapkgmanager" << chrootArg1 << chrootArg2 << "add" << addPkgs << rDir;
} else {
populateMetaPkgs();
}
@@ -404,6 +408,10 @@
bool metaWidget::haveAMetaDesktop()
{
+ // If running in a chroot we can skip this check
+ if ( ! chrootArg1.isEmpty() )
+ return true;
+
QTreeWidgetItemIterator it(treeMetaPkgs);
while (*it) {
if ( ((*it)->checkState(0) == Qt::Checked) || ((*it)->checkState(0) == Qt::PartiallyChecked) )
Modified: pcbsd/current/src-qt4/libpcbsd/pcbsd-utils.h
===================================================================
--- pcbsd/current/src-qt4/libpcbsd/pcbsd-utils.h 2012-03-22 02:05:04 UTC (rev 15901)
+++ pcbsd/current/src-qt4/libpcbsd/pcbsd-utils.h 2012-03-22 02:30:59 UTC (rev 15902)
@@ -149,6 +149,8 @@
QString rDir;
QString Version;
QString Arch;
+ QString chrootArg1;
+ QString chrootArg2;
QMenu *popup;
metaProgressDialog *metaProgressDel;
@@ -156,7 +158,6 @@
dialogInfo *dIB;
-
void uncheckAllChildrenPkgs(QString parent);
void checkAllChildrenPkgs(QString parent);
bool allChildrenPkgsUnchecked(QString parent);
More information about the Commits
mailing list