Ubuntu Pastebin

Paste from ted at Wed, 6 Apr 2016 17:22:59 +0000

Download as text
 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
=== modified file 'plugins/Unity/Launcher/asadapter.cpp'
--- plugins/Unity/Launcher/asadapter.cpp	2015-09-14 09:11:08 +0000
+++ plugins/Unity/Launcher/asadapter.cpp	2016-04-06 17:05:49 +0000
@@ -18,14 +18,21 @@
 #include "launcheritem.h"
 #include "AccountsServiceDBusAdaptor.h"
 
+#include <unistd.h>
+#include <sys/types.h>
+#include <pwd.h>
+
 #include <QDebug>
 
 ASAdapter::ASAdapter()
 {
     m_accounts = new AccountsServiceDBusAdaptor();
-    m_user = qgetenv("USER");
+
+	auto pw = getpwuid(getuid());
+    m_user = pw->pw_name;
+
     if (m_user.isEmpty()) {
-        qWarning() << "$USER not valid. Account Service integration will not work.";
+        qWarning() << "username not valid. Account Service integration will not work.";
     }
 }
 
Download as text