From 9d20e99fffeebe67fd8ff27cb4f9e353892f5190 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Fri, 25 Feb 2011 00:19:27 +0100 Subject: Coding style --- src/useragent/useragentinfo.cpp | 72 ++++++++++++++++++++--------------------- 1 file changed, 36 insertions(+), 36 deletions(-) (limited to 'src/useragent/useragentinfo.cpp') diff --git a/src/useragent/useragentinfo.cpp b/src/useragent/useragentinfo.cpp index cf07d9a4..d6b286b6 100644 --- a/src/useragent/useragentinfo.cpp +++ b/src/useragent/useragentinfo.cpp @@ -44,8 +44,8 @@ UserAgentInfo::UserAgentInfo() { -/* KService::List m_providers = KServiceTypeTrader::self()->query("UserAgentStrings");*/ - + /* KService::List m_providers = KServiceTypeTrader::self()->query("UserAgentStrings");*/ + // NOTE: limiting User Agent Numbers m_providers << KService::serviceByDesktopName("firefox36oncurrent"); m_providers << KService::serviceByDesktopName("ie70onwinnt51"); @@ -61,76 +61,76 @@ UserAgentInfo::UserAgentInfo() QString UserAgentInfo::userAgentString(int i) { - if(i<0) + if (i < 0) { kDebug() << "oh oh... negative index on the user agent choice!"; return QL1S("Default"); } - + QString tmp = m_providers.at(i)->property("X-KDE-UA-FULL").toString(); - + struct utsname utsn; - uname( &utsn ); + uname(&utsn); - tmp.replace( QL1S("appSysName"), QString(utsn.sysname) ); - tmp.replace( QL1S("appSysRelease"), QString(utsn.release) ); - tmp.replace( QL1S("appMachineType"), QString(utsn.machine) ); + tmp.replace(QL1S("appSysName"), QString(utsn.sysname)); + tmp.replace(QL1S("appSysRelease"), QString(utsn.release)); + tmp.replace(QL1S("appMachineType"), QString(utsn.machine)); QStringList languageList = KGlobal::locale()->languageList(); - if ( languageList.count() ) + if (languageList.count()) { - int ind = languageList.indexOf( QL1S("C") ); - if( ind >= 0 ) + int ind = languageList.indexOf(QL1S("C")); + if (ind >= 0) { - if( languageList.contains( QL1S("en") ) ) - languageList.removeAt( ind ); + if (languageList.contains(QL1S("en"))) + languageList.removeAt(ind); else languageList.value(ind) = QL1S("en"); } } - tmp.replace( QL1S("appLanguage"), QString("%1").arg(languageList.join(", ")) ); - tmp.replace( QL1S("appPlatform"), QL1S("X11") ); - + tmp.replace(QL1S("appLanguage"), QString("%1").arg(languageList.join(", "))); + tmp.replace(QL1S("appPlatform"), QL1S("X11")); + return tmp; } QString UserAgentInfo::userAgentName(int i) { - if(i<0) + if (i < 0) { kDebug() << "oh oh... negative index on the user agent choice!"; return QL1S("Default"); } - + return m_providers.at(i)->property("X-KDE-UA-NAME").toString(); } QString UserAgentInfo::userAgentVersion(int i) { - if(i<0) + if (i < 0) { kDebug() << "oh oh... negative index on the user agent choice!"; return QL1S("Default"); } - + return m_providers.at(i)->property("X-KDE-UA-VERSION").toString(); } QString UserAgentInfo::userAgentDescription(int i) { - if(i<0) + if (i < 0) { kDebug() << "oh oh... negative index on the user agent choice!"; return QL1S("Default"); } - + QString tmp = m_providers.at(i)->property("Name").toString(); - tmp.remove( QL1S("UADescription (") ); - tmp.remove( QL1C(')') ); + tmp.remove(QL1S("UADescription (")); + tmp.remove(QL1C(')')); return tmp; } @@ -139,7 +139,7 @@ QStringList UserAgentInfo::availableUserAgents() { QStringList UAs; int n = m_providers.count(); - for(int i = 0; i