-------------------------------------------------------------------------------------
-0.6.4:
-* show user/hidden category apps in the list of installed apps (remove only)
-* show "recommends" and "suggests" in package dependencies if there are any
-* check rootfs and opt free space on startup and warn if low
-* option to disable automatic catalog updates
-* option to start fetching changelogs immediately when package view is opened
-* warn about immediate conflicts when selecting a package for operation (note that this doesn't check all possible conflicts)
-* don't use hildon banner in portrait mode
-* use the proxy settings for fetching package date information and changelogs
-* switched to garage bugtracker
-
-- move stuff away from Package class for possible speed increase
-
-* source code now available also from garage (git)
-
-
0.6.5
- a bugfix release (if needed)
- promote to extras-testing
- support loading .install files
- support installing local .debs
- mime type handling for .install and .deb (can it be done without conflicting HAM?)
+- possible to select cache location?
+- repository color coding?
0.8 (possibly):
void AAptInterface::progressCheckTimerCallback()
{
- if( iAptGetCurrentDownloadFileName=="" )
+ if( iAptGetCurrentDownloadFileName.isEmpty() )
return;
qint64 prevsize = iAptGetCurrentFileDownloadSize;
own.close();
}
- if( log=="" )
+ if( log.isEmpty() )
log = "The log is empty";
return log;
while(!names.atEnd() && c<iRepositories.count())
{
QString line = names.readLine().trimmed();
- if( line.trimmed()!="" )
+ if( !line.trimmed().isEmpty() )
iRepositories.at(c)->setName( line.trimmed() );
c++;
}
quint64 totaldatasize = 0;
quint64 currentreaddata = 0;
quint64 lastupdatedata = 0;
- quint64 updateinterval = 1000000;
+ quint64 updateinterval = 2000000;
if( iNeedListRefresh && !iSkipRefreshListAndDates ) {
for( int i=0; i<files.count(); i++ )
{
while (!db.atEnd() && !iTerminated) {
Package* newpkg = ReadNextPackage(db, currentreaddata);
- //qDebug() << "read" << currentreaddata << "of" << totaldatasize;
if( iUiDimmer && currentreaddata >= lastupdatedata+updateinterval ) {
iUiDimmer->setProgress( currentreaddata*100/totaldatasize );
lastupdatedata = currentreaddata;
QApplication::processEvents();
}
pkgcount_apt++;
- if( newpkg )//&& !newpkg->name().isEmpty() )
+ if( newpkg )
{
newpkg->addRepository( currentRepo );
newpkg=0;
}
}
- }/* else if( newpkg ) {
- delete newpkg;
- newpkg = 0;
- }*/
+ }
}
db.close();
}
Package* pkg = new Package("", this);
bool pkgready = false;
+
+ // this is faster than directly reading to QByteArray...
+ char* data = new char[25000];
+ QByteArray line;
while( !pkgready && !f.atEnd() ) {
- QByteArray line = f.readLine();
+ f.readLine(data,25000);
+ line = data;
currentreaddata += line.size();
if( processPackageDataLine(pkg,line) ) {
pkgready = true;
}
}
+ delete data;
- if( pkg->name() != "" && pkg->isInstalled() ) {
+ if( !pkg->name().isEmpty() && pkg->isInstalled() ) {
QFileInfo f( KDpkgInfoDir + "/" + pkg->name() + ".list" );
if( f.exists() )
pkg->setDate( f.lastModified() );
pkg->updateStatus();
- if( pkg->name() == "" ) {
+ if( pkg->name().isEmpty() ) {
+ qDebug() << "null name package!";
delete pkg;
pkg = 0;
}
bool AAptInterface::processPackageDataLine(Package*& pkg, QByteArray& line)
{
- if( !line.startsWith(' ') && !line.startsWith('\t') )
- line = line.trimmed();
- if( line.trimmed()=="" )
+ if( line.isEmpty() || line=="\n" )
+ {
return true;
+ }
- if( line.startsWith("Package:") )
+ else if( iMultiLine == MultiLineDesc ) {
+ if( (line.startsWith(' ') || line.startsWith('\t')) && !line.trimmed().isEmpty() ) {
+ if( line.trimmed()!="." )
+ pkg->appendDescLong( line.trimmed() + "\n" );
+ else
+ pkg->appendDescLong( "\n" );
+ } else {
+ iMultiLine = MultiLineNone;
+ }
+ }
+ else if( iMultiLine == MultiLineIcon ) {
+ if( (line.startsWith(' ') || line.startsWith('\t')) && !line.trimmed().isEmpty() ) {
+ pkg->appendIconData( line.trimmed() );
+ } else {
+ iMultiLine = MultiLineNone;
+ }
+ }
+ else if( iMultiLine == MultiLineUpgradeDesc ) {
+ if( (line.startsWith(' ') || line.startsWith('\t')) && !line.trimmed().isEmpty() ) {
+ pkg->appendUpgradeDescription( line.trimmed() + "\n" );
+ } else {
+ iMultiLine = MultiLineNone;
+ }
+ }
+
+ else if( line.startsWith("Package:") )
{
pkg->setName( line.mid(8).trimmed() );
iMultiLine=MultiLineNone;
{
pkg->appendPreDepends( line.mid(12).trimmed() );
}
- else if( line.startsWith("Provides:") )
- {
- pkg->appendProvides( line.mid(9).trimmed() );
- }
else if( line.startsWith("Replaces:") )
{
pkg->appendReplaces( line.mid(9).trimmed() );
}
- else if( line.startsWith("Breaks:") )
- {
- pkg->appendBreaks( line.mid(7).trimmed() );
- }
else if( line.startsWith("Recommends:") )
{
pkg->appendRecommends( line.mid(11).trimmed() );
{
pkg->appendSuggests( line.mid(9).trimmed() );
}
-
- if( iMultiLine == MultiLineDesc ) {
- if( (line.startsWith(' ') || line.startsWith('\t')) && line.trimmed()!="" ) {
- if( line.trimmed()!="." )
- pkg->appendDescLong( line.trimmed() + "\n" );
- else
- pkg->appendDescLong( "\n" );
- } else {
- iMultiLine = MultiLineNone;
- }
- }
- else if( iMultiLine == MultiLineIcon ) {
- if( (line.startsWith(' ') || line.startsWith('\t')) && line.trimmed()!="" ) {
- pkg->appendIconData( line.trimmed() );
- } else {
- iMultiLine = MultiLineNone;
- }
+ else if( line.startsWith("Provides:") )
+ {
+ pkg->appendProvides( line.mid(9).trimmed() );
}
- else if( iMultiLine == MultiLineUpgradeDesc ) {
- if( (line.startsWith(' ') || line.startsWith('\t')) && line.trimmed()!="" ) {
- pkg->appendUpgradeDescription( line.trimmed() + "\n" );
- } else {
- iMultiLine = MultiLineNone;
- }
+ else if( line.startsWith("Breaks:") )
+ {
+ pkg->appendBreaks( line.mid(7).trimmed() );
}
- if( line.startsWith("Description:") )
+ else if( line.startsWith("Description:") )
{
pkg->setDescShort( line.mid(12).trimmed() );
iMultiLine = MultiLineDesc;
QNetworkAccessManager* nam = new QNetworkAccessManager(this);
- if( iSettings->qsettings()->value("use_proxies").toBool() && iSettings->qsettings()->value("http_proxy").toString()!="" )
+ if( iSettings->qsettings()->value("use_proxies").toBool() && !iSettings->qsettings()->value("http_proxy").toString().isEmpty() )
{
QNetworkProxy proxy = Settings::createProxyFromString( iSettings->qsettings()->value("http_proxy").toString() );
nam->setProxy(proxy);
{
fe.next();
- if( updProgress >=10 ) {
+ if( updProgress >=20 ) {
iUiDimmer->setProgress( count*100/fetchable.count() );
updProgress=0;
}
}
}
while( iDateRequestsWaiting>0 ) {
- if( updProgress >=10 ) {
+ if( updProgress >=20 ) {
iUiDimmer->setProgress( count*100/fetchable.count() );
updProgress=0;
}
fapman (0.6.4-1) unstable; urgency=low
- *
-
- -- Heikki Holstila <heikki.holstila@gmail.com> Wed, 18 Aug 2010 17:35:44 +0300
+ * show user/hidden category apps in the list of installed apps (remove only)
+ * show "recommends" and "suggests" in package dependencies if there are any
+ * check rootfs and opt free space on startup and warn if low
+ * option to disable automatic catalog updates
+ * option to start fetching changelogs immediately when package view is opened
+ * warn about immediate conflicts when selecting a package for operation
+ * don't use hildon banner in portrait mode
+ * use the proxy settings for fetching package date information and changelogs
+ * package list read speed optimizations
+ * switched to garage bugtracker
+
+ -- Heikki Holstila <heikki.holstila@gmail.com> Thu, 19 Aug 2010 12:57:31 +0300
fapman (0.6.3-1) unstable; urgency=low
QString Package::displayName()
{
QString pkgname = name();
- if( iMaemoDisplayName!="" )
+ if( !iMaemoDisplayName.isEmpty() )
pkgname = maemoDisplayName();
QString n( pkgname.at(0) );
n = n.toUpper();
{
if( iIconData.length() > 0 && iIcon == 0 ) {
iIcon = new QPixmap();
- iIconData = QByteArray::fromBase64( iIconData );
- if( !iIcon->loadFromData( iIconData ) ) {
+ if( !iIcon->loadFromData(QByteArray::fromBase64(iIconData)) ) {
qDebug() << "Warning: Package" << iName << "has invalid icon data";
}
}
-
}
bool Package::isUpgradeable()
QString Package::upgradeableVersion()
{
- QString ver="";
+ QString ver;
if( isInstalled() ) {
Package* newer = iAptInterface->packagesAvailable()->value(iName,0);
if( newer )
Package::packageStatus Package::status()
{
- updateStatus(); // not optimal, but it's here just in case
+ updateStatus(); // just in case
return iPkgStatus;
}
bool Package::versionConflicts(QString conflictVer, QString operVer)
{
- if( conflictVer=="" )
+ if( conflictVer.isEmpty() )
return true;
bool confl = false;
iChangelog = "";
ui->pushButton_website->setIcon(QPixmap("/usr/share/icons/hicolor/48x48/hildon/general_web.png"));
- if( getMaemoOrgUrl(pkg)=="" && getMaemoOrgUrl(pkg->availablePackage())=="" ) {
+ if( getMaemoOrgUrl(pkg).isEmpty() && getMaemoOrgUrl(pkg->availablePackage()).isEmpty() ) {
ui->pushButton_website->setEnabled(false);
}
if( pkg->isMarkedForOperation() )
Package* upg_pkg = iPkg->availablePackage();
if( !upg_pkg )
upg_pkg = iPkg;
- if( (!pkg->isUpgradeable() || (upg_pkg && upg_pkg->upgradeDescription()=="")) && (getMaemoOrgUrl(upg_pkg)=="") )
+ if( (!pkg->isUpgradeable() || (upg_pkg && upg_pkg->upgradeDescription().isEmpty())) && (getMaemoOrgUrl(upg_pkg).isEmpty()) )
ui->radioTabChanges->hide();
if( pkg->isUpgradeable() )
ui->radioRemove->setChecked(true);
}
- if( getMaemoOrgUrl(upg_pkg)!="" && !iChangelogFetched && !iFetchInProgress &&
+ if( !getMaemoOrgUrl(upg_pkg).isEmpty() && !iChangelogFetched && !iFetchInProgress &&
iSettings->qsettings()->value("always_fetch_changes",false).toBool() )
{
queryChangelog();
if( !upg_pkg )
upg_pkg = iPkg;
- if( iPkg->isUpgradeable() && upg_pkg && upg_pkg->upgradeDescription()!="" )
+ if( iPkg->isUpgradeable() && upg_pkg && !upg_pkg->upgradeDescription().isEmpty() )
{
text += "<u><b>Upgrade description:</b></u>";
text += "<font size=\"-1\"><br>";
}
QString changelog;
- if( getMaemoOrgUrl(upg_pkg)!="" && !iChangelogFetched && !iFetchInProgress ) {
+ if( !getMaemoOrgUrl(upg_pkg).isEmpty() && !iChangelogFetched && !iFetchInProgress ) {
queryChangelog();
changelog = "Fetching changelog...";
} else {
iNetworkAccessManager = new QNetworkAccessManager(this);
connect(iNetworkAccessManager,SIGNAL(finished(QNetworkReply*)),this,SLOT(changelogFetchNetworkReply(QNetworkReply*)));
- if( iSettings->qsettings()->value("use_proxies").toBool() && iSettings->qsettings()->value("http_proxy").toString()!="" )
+ if( iSettings->qsettings()->value("use_proxies").toBool() && !iSettings->qsettings()->value("http_proxy").toString().isEmpty() )
{
QNetworkProxy proxy = Settings::createProxyFromString( iSettings->qsettings()->value("http_proxy").toString() );
iNetworkAccessManager->setProxy(proxy);
statusicon = iIconPkgRemove;
}
- QString showVer = "";
+ QString showVer;
if( upgradeable && (statfilter==Package::PkgStatUpgradeable ||
(statfilter==Package::PkgStatUnknown && marked==Package::PkgOpInstallUpgrade) ||
(catfilter==PackageView::CatFilterAllMarked && marked==Package::PkgOpInstallUpgrade) ))
painter->drawText(r, Qt::AlignTop|Qt::AlignRight, showVer, &r);
ver_w = r.width();
} else if( blacklisted==BlacklistSelect::BlacklistThis ) {
- if( upgradeable && upg_version!="" ) {
+ if( upgradeable && !upg_version.isEmpty() ) {
showVer = upg_version;
} else {
showVer = version;
if( pkg_ != 0 )
{
QString name = pkg_->name();
- if( pkg_->maemoDisplayName()!="" )
+ if( !pkg_->maemoDisplayName().isEmpty() )
name = pkg_->maemoDisplayName();
p->setData(UserRoleName, name);
} else {
if( !ui->searchBar->isVisible() )
return;
- if( text=="" ) {
+ if( text.isEmpty() ) {
on_btn_searchClose_clicked();
return;
}
} else {
errors++;
}
- } else if( line!="" ){
+ } else if( !line.isEmpty() ){
errors++;
}
}
com << "";
for( int i=0; i<com.count(); i++ ) {
QString chopUrl = iUrl.mid( iUrl.indexOf("://")+3 );
- if( com.at(i)!="" )
+ if( !com.at(i).isEmpty() )
disttext = "dists_";
else
disttext = "_";
QString str = chopUrl + iDir + disttext + iDist + "_" + com.at(i);
- if( com.at(i)!="" )
+ if( !com.at(i).isEmpty() )
str += "_binary-armel_Packages";
else
str += "_Packages";
iDir = parts.at(1).right( parts.at(1).length()-d-1 );
}
- if( parts.at(2)!="" )
+ if( !parts.at(2).isEmpty() )
iDist = parts.at(2);
else
return false;
if( !iUrl.endsWith('/') )
iUrl.append('/');
iDir = dir.trimmed();
- if( !iDir.endsWith('/') && iDir!="" )
+ if( !iDir.endsWith('/') && !iDir.isEmpty() )
iDir.append('/');
iDist = dist.trimmed();
iComponents = components.trimmed();