本文整理汇总了C++中Package::getDescription方法的典型用法代码示例。如果您正苦于以下问题:C++ Package::getDescription方法的具体用法?C++ Package::getDescription怎么用?C++ Package::getDescription使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Package
的用法示例。
在下文中一共展示了Package::getDescription方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: buildLocalPackages
void Server :: buildLocalPackages( Server *local )
{
Package *curr;
QListIterator<Package> it( packageList );
QList<Package> *locallist = &local->getPackageList();
for ( ; it.current(); ++it )
{
curr = it.current();
QString name = curr->getPackageName();
// If the package name is an ipk name, then convert the filename to a package name
if ( name.find( ".ipk" ) != -1 )
name = Utils::getPackageNameFromIpkFilename( curr->getFilename() );
if ( local )
{
Package *p = local->getPackage( name );
curr->setLocalPackage( p );
if ( p )
{
// Replace local version
if ( curr->getVersion() > p->getVersion() )
{
int pos = locallist->at();
locallist->remove( p );
locallist->insert( pos, curr );
}
// Set some default stuff like size and things
if ( p->getInstalledVersion() == curr->getVersion() )
{
p->setPackageSize( curr->getPackageSize() );
p->setSection( curr->getSection() );
p->setDescription( curr->getDescription() );
}
}
}
else
curr->setLocalPackage( 0 );
}
}
示例2: onPackageRemove
void PackagesPage::onPackageRemove()
{
QModelIndex index = _ui->_listPackages->currentIndex();
Package package = PackageTable::getFromModel(_model, index.row());
QMessageBox msg(this);
msg.setWindowIcon(getIcon());
msg.setWindowTitle(tr("Remove package?"));
msg.setInformativeText(tr("Are you sure to delete package\n'%1'\nwith description\n'%2'?").arg(package.getName()).arg(package.getDescription()));
msg.setStandardButtons(QMessageBox::Yes|QMessageBox::No);
msg.setDefaultButton(QMessageBox::No);
msg.setIcon(QMessageBox::Warning);
int button = msg.exec();
if(button!=QMessageBox::Yes) return;
bool ok = _model->removeRow(index.row());
if(!ok) {
QMessageBox::critical(this, tr("Error"), tr("Could not remove package:\n %1").arg(_model->lastError().text()));
return;
}
_model->submitAll();
onCurrentRowChanged(QModelIndex());
}