summaryrefslogtreecommitdiffstats
path: root/ubuntu/lucid_automake/kdelibs/debian/patches/kubuntu_19_debianize_useragent.diff
blob: 23fefb7dd4be1b6359bcb8a95ad49da361d9c6c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
--- a/kio/kio/kprotocolmanager.cpp
+++ b/kio/kio/kprotocolmanager.cpp
@@ -450,14 +450,19 @@
      return d->useragent;
 
   TQString supp;
+  int debian_append = 0;
   struct utsname nam;
   if( uname(&nam) >= 0 )
   {
     if( modifiers.contains('o') )
     {
       supp += TQString("; %1").arg(nam.sysname);
+      debian_append = 1;
       if ( modifiers.contains('v') )
+      {
         supp += TQString(" %1").arg(nam.release);
+        debian_append = 2;
+      }
     }
     if( modifiers.contains('p') )
     {
@@ -485,6 +490,16 @@
   }
   d->modifiers = modifiers;
   d->useragent = CFG_DEFAULT_UAGENT(supp);
+
+  if (debian_append == 1)
+    d->useragent.append(" (Debian)");
+  else if (debian_append == 2)
+  {
+#define STRINGIFY(macro_or_string) STRINGIFY_ARG(macro_or_string)
+#define STRINGIFY_ARG(contents) #contents
+    d->useragent.append(" (Kubuntu package " STRINGIFY(DEBIAN_VERSION) ")");
+  }
+  
   return d->useragent;
 }