kde-core-devel@kde.org
[Top] [All Lists]

Re: [patch] KProtocolManager (kio/kio) extensions for application-specif

Subject: Re: [patch] KProtocolManager (kio/kio) extensions for application-specific user agent string
From: Jaroslaw Staniek
Date: Thu, 07 Feb 2008 23:30:09 +0100
Thiago Macieira said the following, On 2008-02-07 00:45:
JarosÅaw Staniek wrote:
- adds static bool getSystemNameVersionAndMachine(
      QString& systemName, QString& systemVersion, QString& machine );
   (returns nicely splitted system name, version and machine type, for
example "Windows", "5.1", "i686"; also more useful for various sysinfo
reporting)

I don't like this function name and its arguments.

Can't we have three functions instead, each returning a QString?

We can.
Even beter, alternatively I'd propose KProtocolManager::SystemInformation:

<code>
struct SystemInformation {
        QString name;
        QString version;
        QString machine;
}

static bool static SystemInformation getSystemInformation();
</code>

-avoid calling system-level function 3 times, and then checking the result 3 times in the user's code -give up with checking result (uname() wouldnt fail on UNIX, and GetVersionEx() wouldnt fail on Windows)

--
regards / pozdrawiam, Jaroslaw Staniek
 Sponsored by OpenOffice Polska (http://www.openoffice.com.pl/en) to work on
 Kexi & KOffice (http://www.kexi.pl/en, http://www.koffice.org/kexi)
 KDE Libraries for MS Windows (http://windows.kde.org)

<Prev in Thread] Current Thread [Next in Thread>