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

Jarosław Staniek js at iidea.pl
Wed Feb 6 13:34:59 GMT 2008


Hello
For review;

- only adds 'X11' bit for 'p' key in "static QString 
KProtocolManager::defaultUserAgent(const QString &keys)" for X11-based targets

- adds
  static QString KProtocolManager::userAgentForApplication(
     const QString &appName,
     const QString& appVersion, const QStringList& extraInfo = QStringList() );
  for the application's user-agent string other than web browser (think of
  KMail/KNode/Mailody..)

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


The result in KMail is then user agent string like
KMail/1.9.50 (Windows/5.0; KDE/3.97.1; i686; svn-762186; 2008-01-15)
delivered by this code:

   QStringList extraInfo;
#if defined KMAIL_SVN_REVISION_STRING && defined KMAIL_SVN_LAST_CHANGE
   extraInfo << KMAIL_SVN_REVISION_STRING << KMAIL_SVN_LAST_CHANGE;
#endif
   setHeaderField("User-Agent",
     KProtocolManager::userAgentForApplication(
       "KMail", KMAIL_VERSION, extraInfo )
   );

-- 
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)
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: kio-kprotocolmanager.patch
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20080206/a4efc2ae/attachment.ksh>
-------------- next part --------------
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/


More information about the kde-pim mailing list