Skip to content
This repository has been archived by the owner on Dec 4, 2020. It is now read-only.

Commit

Permalink
Fix compilation of libpcbsd on 10.x
Browse files Browse the repository at this point in the history
  • Loading branch information
Ken Moore committed Nov 7, 2013
1 parent 44640c4 commit 6019880
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
22 changes: 13 additions & 9 deletions src-qt4/libpcbsd/ui/metaWidget.cpp
Expand Up @@ -542,10 +542,11 @@ QString metaWidget::getAddPkgs()
// See if any packages status have changed
if ( ( (*it)->text(0) == metaPkgList.at(z).at(0) && metaPkgList.at(z).at(5) == "NO" && (*it)->checkState(0) == Qt::Checked ) || \
( (*it)->text(0) == metaPkgList.at(z).at(0) && metaPkgList.at(z).at(5) == "NO" && (*it)->checkState(0) == Qt::PartiallyChecked ) )
if ( tmp.isEmpty() )
if ( tmp.isEmpty() ){
tmp = (*it)->text(0);
else
}else{
tmp = tmp + "," + (*it)->text(0);
}
++it;
}

Expand All @@ -560,10 +561,11 @@ QString metaWidget::getDelPkgs()
for (int z=0; z < metaPkgList.count(); ++z)
// See if any packages status have changed
if ( (*it)->text(0) == metaPkgList.at(z).at(0) && metaPkgList.at(z).at(5) == "YES" && (*it)->checkState(0) == Qt::Unchecked )
if ( tmp.isEmpty() )
if ( tmp.isEmpty() ){
tmp = (*it)->text(0);
else
}else{
tmp = tmp + "," + (*it)->text(0);
}
++it;
}

Expand All @@ -587,15 +589,17 @@ void metaWidget::slotDeskPkgsChanged(QTreeWidgetItem *aItem, int __unused)
disconnect(treeMetaPkgs, SIGNAL(itemChanged(QTreeWidgetItem *, int)), 0, 0);

if (aItem->childCount() == 0) {
if (aItem->checkState(0) == Qt::Checked && aItem->parent() )
if ( allChildrenPkgsChecked(aItem->parent()->text(0)))
if (aItem->checkState(0) == Qt::Checked && aItem->parent() ){
if ( allChildrenPkgsChecked(aItem->parent()->text(0))){
aItem->parent()->setCheckState(0, Qt::Checked);
else
}else{
aItem->parent()->setCheckState(0, Qt::PartiallyChecked);
if (aItem->checkState(0) == Qt::Unchecked && aItem->parent() )
}
}
if (aItem->checkState(0) == Qt::Unchecked && aItem->parent() ){
if ( ! allChildrenPkgsUnchecked(aItem->parent()->text(0)))
aItem->parent()->setCheckState(0, Qt::PartiallyChecked);

}

} else {
if (aItem->checkState(0) == Qt::Checked )
Expand Down
4 changes: 2 additions & 2 deletions src-qt4/libpcbsd/utils/utils.cpp
Expand Up @@ -137,7 +137,7 @@ QString Utils::getValFromSHFile(QString envFile, QString envVal)
{
QFile confFile(envFile);
if ( ! confFile.open( QIODevice::ReadOnly ) )
return false;
return "";

QTextStream stream( &confFile );
QString line;
Expand Down Expand Up @@ -169,7 +169,7 @@ QString Utils::getValFromCSHFile(QString envFile, QString envVal)
{
QFile confFile(envFile);
if ( ! confFile.open( QIODevice::ReadOnly ) )
return false;
return "";

QTextStream stream( &confFile );
QString line;
Expand Down

0 comments on commit 6019880

Please sign in to comment.