mirror of
https://github.com/QuasarApp/installer-framework.git
synced 2025-04-29 15:04:32 +00:00
Remove superfluous functions after 9dfa0c6e and compile error.
Remove the enclosing namespace, fixes explicit qualification in declaration compile error. Strange that this works on Windows. Change-Id: I5cd4b8328cbdb8471e4be242e38b7894288781e0 Reviewed-by: Karsten Heimrich <karsten.heimrich@nokia.com>
This commit is contained in:
parent
aea0e0669a
commit
c2ca2d0e19
@ -45,12 +45,7 @@
|
||||
|
||||
#include <iostream>
|
||||
|
||||
namespace QInstallerTools {
|
||||
|
||||
static bool operator==(const PackageInfo &lhs, const PackageInfo &rhs)
|
||||
{
|
||||
return lhs.name == rhs.name && lhs.version == rhs.version;
|
||||
}
|
||||
using namespace QInstallerTools;
|
||||
|
||||
void QInstallerTools::printRepositoryGenOptions()
|
||||
{
|
||||
@ -66,38 +61,6 @@ void QInstallerTools::printRepositoryGenOptions()
|
||||
std::cout << " --ignore-invalid-packages Ignore all invalid packages instead of aborting." << std::endl;
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns PackageInfo of package with right name and version
|
||||
*/
|
||||
static PackageInfo findMatchingPackage(const QString &name, const PackageInfoVector &available)
|
||||
{
|
||||
const QString id = name.contains(QChar::fromLatin1('-'))
|
||||
? name.section(QChar::fromLatin1('-'), 0, 0) : name;
|
||||
QString version = name.contains(QChar::fromLatin1('-'))
|
||||
? name.section(QChar::fromLatin1('-'), 1, -1) : QString();
|
||||
|
||||
QRegExp compEx(QLatin1String("([<=>]+)(.*)"));
|
||||
const QString comparator = compEx.exactMatch(version) ? compEx.cap(1) : QLatin1String("=");
|
||||
version = compEx.exactMatch(version) ? compEx.cap(2) : version;
|
||||
|
||||
const bool allowEqual = comparator.contains(QLatin1Char('='));
|
||||
const bool allowLess = comparator.contains(QLatin1Char('<'));
|
||||
const bool allowMore = comparator.contains(QLatin1Char('>'));
|
||||
|
||||
for (PackageInfoVector::const_iterator it = available.begin(); it != available.end(); ++it) {
|
||||
if (it->name != id)
|
||||
continue;
|
||||
if (allowEqual && (version.isEmpty() || it->version == version))
|
||||
return *it;
|
||||
if (allowLess && KDUpdater::compareVersion(version, it->version) > 0)
|
||||
return *it;
|
||||
if (allowMore && KDUpdater::compareVersion(version, it->version) < 0)
|
||||
return *it;
|
||||
}
|
||||
|
||||
return PackageInfo();
|
||||
}
|
||||
|
||||
void QInstallerTools::compressDirectory(const QStringList &paths, const QString &archivePath)
|
||||
{
|
||||
foreach (const QString &path, paths) {
|
||||
@ -655,5 +618,3 @@ void QInstallerTools::copyComponentData(const QString &packageDir, const QString
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace QInstallerTools
|
||||
|
Loading…
x
Reference in New Issue
Block a user