From 723e79a7204b3cd8b96e031af07347fd0cce176c Mon Sep 17 00:00:00 2001 From: Tim Jenssen Date: Fri, 9 Dec 2011 14:38:47 +0100 Subject: try to hack around the ubuntu 11.10 problem Change-Id: I3e36c2816513e079f57b168c044f8b2d3355164d Reviewed-by: Niels Weber Reviewed-by: Alexander Lenhardt Reviewed-by: hjk --- installerbuilder/installerbase/installerbase.cpp | 28 ++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'installerbuilder/installerbase/installerbase.cpp') diff --git a/installerbuilder/installerbase/installerbase.cpp b/installerbuilder/installerbase/installerbase.cpp index 2ea1b6fd3..ae4111a88 100644 --- a/installerbuilder/installerbase/installerbase.cpp +++ b/installerbuilder/installerbase/installerbase.cpp @@ -57,6 +57,9 @@ #include #include +#include + +#include #define QUOTE_(x) #x #define QUOTE(x) QUOTE_(x) @@ -85,6 +88,31 @@ static QSet repositories(const QStringList &arguments, const int ind int main(int argc, char *argv[]) { +// hack to use cleanlooks if it is under Ubuntu 11.10 +#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC) + std::string standardString; + std::string cleanLooks ="-style=cleanlooks"; + std::ifstream input("/etc/lsb-release"); + bool isUbuntu = false; + bool is11_10 = false; + while (std::getline(input, standardString)) { + if (standardString == "DISTRIB_ID=Ubuntu") + isUbuntu = true; + else if (standardString == "DISTRIB_RELEASE=11.10") + is11_10 = true; + } + + if (isUbuntu && is11_10) { + char** newArgv = new char* [argc + 1]; + for (int i = 0; i < argc; ++i) { + newArgv[i] = argv[i]; + } + argc++; + newArgv[argc] = const_cast(cleanLooks.data()); + argv = newArgv; + } +#endif + qsrand(QDateTime::currentDateTime().toTime_t()); const KDSelfRestarter restarter(argc, argv); KDRunOnceChecker runCheck(QLatin1String("lockmyApp1234865.lock")); -- cgit v1.2.3