[patch] KProtocolManager (kio/kio) extensions for application-specific user agent string

Jaroslaw Staniek js at iidea.pl
Thu Feb 7 22:30:09 GMT 2008

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:

struct SystemInformation {
	QString name;
	QString version;
	QString machine;

static bool static SystemInformation getSystemInformation();

-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)

More information about the kde-core-devel mailing list