Logo Search packages:      
Sourcecode: qapt version File versions  Download package

QUrl QApt::Package::changelogUrl (  )  const

Member function that fetches a package's changelog over the Internet.

Returns:
The location of the package changelog as a QString

Definition at line 391 of file package.cpp.

References availableVersion(), section(), and sourcePackage().

{
    QString prefix;
    const QString srcPackage = sourcePackage();
    QString sourceSection = section();

    if (sourceSection.contains('/')) {
        QStringList split = sourceSection.split('/');
        sourceSection = split.at(0);
    } else {
        sourceSection = QString("main");
    }

    if (srcPackage.size() > 3 && srcPackage.startsWith(QLatin1String("lib"))) {
        prefix = "lib" % srcPackage[3];
    } else {
        prefix = srcPackage[0];
    }

    QString versionString;
    if (!availableVersion().isEmpty()) {
        versionString = availableVersion();
    }

    if (versionString.contains(':')) {
        QStringList epochVersion = versionString.split(':');
        // If the version has an epoch, take the stuff after the epoch
        versionString = epochVersion[1];
    }

    QString urlBase = "http://changelogs.ubuntu.com/changelogs/pool/";
    QUrl url = QUrl(urlBase % sourceSection % '/' % prefix % '/' %
                    srcPackage % '/' % srcPackage % '_' % versionString % '/'
                    % "changelog");

    return url;
}


Generated by  Doxygen 1.6.0   Back to index