Merge lp:~pete-woods/indicator-network/improve-logging into lp:indicator-network

Proposed by Pete Woods
Status: Merged
Approved by: Pete Woods
Approved revision: 598
Merged at revision: 600
Proposed branch: lp:~pete-woods/indicator-network/improve-logging
Merge into: lp:indicator-network
Prerequisite: lp:~unity-api-team/indicator-network/connectivity-api-mobile-data-management
Diff against target: 935 lines (+213/-70)
25 files modified
src/agent/KeyringCredentialStore.cpp (+2/-2)
src/agent/SecretAgent.cpp (+8/-8)
src/agent/agent-main.cpp (+3/-0)
src/indicator/main.cpp (+4/-0)
src/indicator/nmofono/connection/active-connection-manager.cpp (+1/-1)
src/indicator/nmofono/hotspot-manager.cpp (+12/-12)
src/indicator/nmofono/kill-switch.cpp (+3/-3)
src/indicator/nmofono/manager-impl.cpp (+22/-17)
src/indicator/nmofono/vpn/vpn-connection.cpp (+3/-3)
src/indicator/nmofono/vpn/vpn-manager.cpp (+1/-1)
src/indicator/nmofono/wifi/wifi-link-impl.cpp (+9/-4)
src/indicator/nmofono/wwan/modem.cpp (+6/-2)
src/indicator/root-state.cpp (+1/-1)
src/indicator/vpn-status-notifier.cpp (+1/-1)
src/menumodel-cpp/action-group-merger.cpp (+3/-3)
src/menumodel-cpp/menu-item.cpp (+1/-1)
src/notify-cpp/notification.cpp (+4/-4)
src/qpowerd/qpowerd.cpp (+1/-1)
src/util/CMakeLists.txt (+1/-0)
src/util/logging.cpp (+59/-0)
src/util/logging.h (+29/-0)
tests/unit/secret-agent/secret-agent-main.cpp (+29/-1)
tests/unit/secret-agent/test-secret-agent.cpp (+3/-3)
tests/utils/CMakeLists.txt (+3/-2)
tests/utils/main.cpp (+4/-0)
To merge this branch: bzr merge lp:~pete-woods/indicator-network/improve-logging
Reviewer Review Type Date Requested Status
Charles Kerr (community) Approve
Antti Kaijanmäki Pending
PS Jenkins bot continuous-integration Pending
Review via email: mp+295828@code.launchpad.net

This proposal supersedes a proposal from 2016-05-25.

Commit message

Improve logging

Description of the change

Improve logging

To post a comment you must log in.
Revision history for this message
Antti Kaijanmäki (kaijanmaki) wrote : Posted in a previous version of this proposal

LGTM.

review: Approve
Revision history for this message
Charles Kerr (charlesk) wrote :

Oh, I'm stealing this.

review: Approve
Revision history for this message
Charles Kerr (charlesk) wrote :

Not a showstopper, but a minor nit this does kick up one new warning when I build:

src/util/logging.cpp: In function ‘void util::loggingFunction(QtMsgType, const QMessageLogContext&, const QString&)’:
src/util/logging.cpp:28:16: warning: switch missing default case [-Wswitch-default]

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/agent/KeyringCredentialStore.cpp'
--- src/agent/KeyringCredentialStore.cpp 2016-02-18 12:37:05 +0000
+++ src/agent/KeyringCredentialStore.cpp 2016-05-26 16:58:27 +0000
@@ -80,7 +80,7 @@
80 }80 }
81 g_error_free(error);81 g_error_free(error);
82 }82 }
83 qCritical() << __PRETTY_FUNCTION__ << message;83 qCritical() << message;
84 }84 }
85}85}
8686
@@ -146,7 +146,7 @@
146 message = QString::fromUtf8(error->message);146 message = QString::fromUtf8(error->message);
147 }147 }
148 g_error_free(error);148 g_error_free(error);
149 qCritical() << __PRETTY_FUNCTION__ << message;149 qCritical() << message;
150 }150 }
151 }151 }
152}152}
153153
=== modified file 'src/agent/SecretAgent.cpp'
--- src/agent/SecretAgent.cpp 2016-02-18 12:37:30 +0000
+++ src/agent/SecretAgent.cpp 2016-05-26 16:58:27 +0000
@@ -132,7 +132,7 @@
132 NM_SECRET_AGENT_CAPABILITY_NONE);132 NM_SECRET_AGENT_CAPABILITY_NONE);
133 reply.waitForFinished();133 reply.waitForFinished();
134 if (reply.isError()) {134 if (reply.isError()) {
135 qCritical() << __PRETTY_FUNCTION__ << reply.error().message();135 qCritical() << reply.error().message();
136 }136 }
137 }137 }
138 }138 }
@@ -176,7 +176,7 @@
176 NM_SECRET_AGENT_CAPABILITY_NONE);176 NM_SECRET_AGENT_CAPABILITY_NONE);
177 reply.waitForFinished();177 reply.waitForFinished();
178 if (reply.isError()) {178 if (reply.isError()) {
179 qCritical() << __PRETTY_FUNCTION__ << reply.error().message();179 qCritical() << reply.error().message();
180 }180 }
181}181}
182182
@@ -184,7 +184,7 @@
184 auto reply = d->m_agentManager.Unregister();184 auto reply = d->m_agentManager.Unregister();
185 reply.waitForFinished();185 reply.waitForFinished();
186 if (reply.isError()) {186 if (reply.isError()) {
187 qCritical() << __PRETTY_FUNCTION__ << reply.error().message();187 qCritical() << reply.error().message();
188 }188 }
189}189}
190190
@@ -232,7 +232,7 @@
232232
233 setDelayedReply(true);233 setDelayedReply(true);
234234
235 qDebug() << __PRETTY_FUNCTION__ << connectionPath.path() << settingName << hints << flags;235 qDebug() << connectionPath.path() << settingName << hints << flags;
236236
237 // If we want a WiFi secret, and237 // If we want a WiFi secret, and
238 if (settingName == NM_WIRELESS_SECURITY_SETTING_NAME &&238 if (settingName == NM_WIRELESS_SECURITY_SETTING_NAME &&
@@ -241,12 +241,12 @@
241 ((flags & NM_SECRET_AGENT_GET_SECRETS_FLAG_REQUEST_NEW) > 0) ||241 ((flags & NM_SECRET_AGENT_GET_SECRETS_FLAG_REQUEST_NEW) > 0) ||
242 ((flags & NM_SECRET_AGENT_GET_SECRETS_FLAG_USER_REQUESTED) > 0)242 ((flags & NM_SECRET_AGENT_GET_SECRETS_FLAG_USER_REQUESTED) > 0)
243 )) {243 )) {
244 qDebug() << __PRETTY_FUNCTION__ << "Requesting secret from user";244 qDebug() << "Requesting secret from user";
245 d->m_request.reset(new SecretRequest(*this, connection,245 d->m_request.reset(new SecretRequest(*this, connection,
246 connectionPath, settingName, hints, flags, message()));246 connectionPath, settingName, hints, flags, message()));
247 } else if (((flags == NM_SECRET_AGENT_GET_SECRETS_FLAG_NONE) ||247 } else if (((flags == NM_SECRET_AGENT_GET_SECRETS_FLAG_NONE) ||
248 (flags == NM_SECRET_AGENT_GET_SECRETS_FLAG_USER_REQUESTED))) {248 (flags == NM_SECRET_AGENT_GET_SECRETS_FLAG_USER_REQUESTED))) {
249 qDebug() << __PRETTY_FUNCTION__ << "Retrieving secret from keyring";249 qDebug() << "Retrieving secret from keyring";
250250
251 bool isVpn = (settingName == NM_VPN_SETTING_NAME);251 bool isVpn = (settingName == NM_VPN_SETTING_NAME);
252252
@@ -288,7 +288,7 @@
288 d->m_systemConnection.send(288 d->m_systemConnection.send(
289 message().createReply(QVariant::fromValue(newConnection)));289 message().createReply(QVariant::fromValue(newConnection)));
290 } else {290 } else {
291 qDebug() << __PRETTY_FUNCTION__ << "Can't get secrets for this connection";291 qDebug() << "Can't get secrets for this connection";
292 d->m_systemConnection.send(292 d->m_systemConnection.send(
293 message().createErrorReply("org.freedesktop.NetworkManager.SecretAgent.NoSecrets",293 message().createErrorReply("org.freedesktop.NetworkManager.SecretAgent.NoSecrets",
294 "No secrets found for this connection."));294 "No secrets found for this connection."));
@@ -301,7 +301,7 @@
301 if (error) {301 if (error) {
302 d->m_systemConnection.send(302 d->m_systemConnection.send(
303 request.message().createErrorReply("org.freedesktop.NetworkManager.SecretAgent.NoSecrets",303 request.message().createErrorReply("org.freedesktop.NetworkManager.SecretAgent.NoSecrets",
304 "No password found for this connection."));304 "No secrets found for this connection."));
305 } else {305 } else {
306 d->m_systemConnection.send(306 d->m_systemConnection.send(
307 request.message().createReply(307 request.message().createReply(
308308
=== modified file 'src/agent/agent-main.cpp'
--- src/agent/agent-main.cpp 2016-02-15 09:31:38 +0000
+++ src/agent/agent-main.cpp 2016-05-26 16:58:27 +0000
@@ -20,6 +20,7 @@
20#include <notify-cpp/notification-manager.h>20#include <notify-cpp/notification-manager.h>
21#include <agent/KeyringCredentialStore.h>21#include <agent/KeyringCredentialStore.h>
22#include <agent/SecretAgent.h>22#include <agent/SecretAgent.h>
23#include <util/logging.h>
23#include <util/unix-signal-handler.h>24#include <util/unix-signal-handler.h>
24#include <dbus-types.h>25#include <dbus-types.h>
2526
@@ -38,6 +39,8 @@
38int39int
39main(int argc, char **argv)40main(int argc, char **argv)
40{41{
42 qInstallMessageHandler(util::loggingFunction);
43
41 QCoreApplication app(argc, argv);44 QCoreApplication app(argc, argv);
42 DBusTypes::registerMetaTypes();45 DBusTypes::registerMetaTypes();
43 Variant::registerMetaTypes();46 Variant::registerMetaTypes();
4447
=== modified file 'src/indicator/main.cpp'
--- src/indicator/main.cpp 2015-12-11 14:58:11 +0000
+++ src/indicator/main.cpp 2016-05-26 16:58:27 +0000
@@ -18,6 +18,7 @@
18 */18 */
1919
20#include <factory.h>20#include <factory.h>
21#include <util/logging.h>
21#include <util/unix-signal-handler.h>22#include <util/unix-signal-handler.h>
22#include <dbus-types.h>23#include <dbus-types.h>
2324
@@ -34,9 +35,12 @@
34using namespace std;35using namespace std;
35using namespace connectivity_service;36using namespace connectivity_service;
3637
38
37int39int
38main(int argc, char **argv)40main(int argc, char **argv)
39{41{
42 qInstallMessageHandler(util::loggingFunction);
43
40 QCoreApplication app(argc, argv);44 QCoreApplication app(argc, argv);
41 DBusTypes::registerMetaTypes();45 DBusTypes::registerMetaTypes();
42 Variant::registerMetaTypes();46 Variant::registerMetaTypes();
4347
=== modified file 'src/indicator/nmofono/connection/active-connection-manager.cpp'
--- src/indicator/nmofono/connection/active-connection-manager.cpp 2015-10-06 10:19:30 +0000
+++ src/indicator/nmofono/connection/active-connection-manager.cpp 2016-05-26 16:58:27 +0000
@@ -115,7 +115,7 @@
115 reply.waitForFinished();115 reply.waitForFinished();
116 if (reply.isError())116 if (reply.isError())
117 {117 {
118 qWarning() << __PRETTY_FUNCTION__ << reply.error().message();118 qWarning() << reply.error().message();
119 return false;119 return false;
120 }120 }
121 return true;121 return true;
122122
=== modified file 'src/indicator/nmofono/hotspot-manager.cpp'
--- src/indicator/nmofono/hotspot-manager.cpp 2016-05-11 16:52:45 +0000
+++ src/indicator/nmofono/hotspot-manager.cpp 2016-05-26 16:58:27 +0000
@@ -62,7 +62,7 @@
6262
63 void addConnection()63 void addConnection()
64 {64 {
65 qDebug() << __PRETTY_FUNCTION__ << "Adding new hotspot connection";65 qDebug() << "Adding new hotspot connection";
66 QVariantDictMap connection = createConnectionSettings(m_ssid, m_password,66 QVariantDictMap connection = createConnectionSettings(m_ssid, m_password,
67 m_mode, m_auth);67 m_mode, m_auth);
6868
@@ -91,7 +91,7 @@
9191
92 void updateConnection()92 void updateConnection()
93 {93 {
94 qDebug() << __PRETTY_FUNCTION__ << "Updating hotspot connection";94 qDebug() << "Updating hotspot connection";
95 // Get new settings95 // Get new settings
96 QVariantDictMap new_settings = createConnectionSettings(m_ssid,96 QVariantDictMap new_settings = createConnectionSettings(m_ssid,
97 m_password,97 m_password,
@@ -129,7 +129,7 @@
129 // Wait for connection to activate129 // Wait for connection to activate
130 while (count < 20 && activeConnection.state() != NM_ACTIVE_CONNECTION_STATE_ACTIVATED)130 while (count < 20 && activeConnection.state() != NM_ACTIVE_CONNECTION_STATE_ACTIVATED)
131 {131 {
132 qDebug() << __PRETTY_FUNCTION__ << "Waiting for hotspot to connect";132 qDebug() << "Waiting for hotspot to connect";
133 QThread::msleep(100);133 QThread::msleep(100);
134 ++count;134 ++count;
135 }135 }
@@ -144,11 +144,11 @@
144 {144 {
145 if (!m_hotspot)145 if (!m_hotspot)
146 {146 {
147 qWarning() << __PRETTY_FUNCTION__ << "Could not find a hotspot setup to enable";147 qWarning() << "Could not find a hotspot setup to enable";
148 return;148 return;
149 }149 }
150150
151 qDebug() << __PRETTY_FUNCTION__ << "Activating hotspot on device" << device.path();151 qDebug() << "Activating hotspot on device" << device.path();
152 bool success = activateConnection(device);152 bool success = activateConnection(device);
153 setEnable(success);153 setEnable(success);
154 if (success)154 if (success)
@@ -332,7 +332,7 @@
332 continue;332 continue;
333 }333 }
334334
335 qDebug() << __PRETTY_FUNCTION__ << "Using AP interface " << interface;335 qDebug() << "Using AP interface " << interface;
336 m_device = make_unique<ApDevice>(*path, interface);336 m_device = make_unique<ApDevice>(*path, interface);
337 break;337 break;
338 }338 }
@@ -350,7 +350,7 @@
350 {350 {
351 QThread::msleep(100);351 QThread::msleep(100);
352 findApDevice();352 findApDevice();
353 qDebug() << __PRETTY_FUNCTION__ << "Searching for AP device";353 qDebug() << "Searching for AP device";
354 ++count;354 ++count;
355 }355 }
356 }356 }
@@ -546,7 +546,7 @@
546 {546 {
547 if (!m_hotspot)547 if (!m_hotspot)
548 {548 {
549 qWarning() << __PRETTY_FUNCTION__ << "Could not find a hotspot setup to enable";549 qWarning() << "Could not find a hotspot setup to enable";
550 return;550 return;
551 }551 }
552552
@@ -561,12 +561,12 @@
561561
562 if (m_device)562 if (m_device)
563 {563 {
564 qDebug() << __PRETTY_FUNCTION__ << "Reactivating hotspot connection on device" << m_device->m_path.path();564 qDebug() << "Reactivating hotspot connection on device" << m_device->m_path.path();
565 activateConnection(m_device->m_path);565 activateConnection(m_device->m_path);
566 }566 }
567 else567 else
568 {568 {
569 qWarning() << __PRETTY_FUNCTION__ << "Could not get device when reactivating hotspot connection";569 qWarning() << "Could not get device when reactivating hotspot connection";
570 }570 }
571 }571 }
572572
@@ -649,7 +649,7 @@
649 // If the SSID is empty, we report an error.649 // If the SSID is empty, we report an error.
650 if (d->m_ssid.isEmpty())650 if (d->m_ssid.isEmpty())
651 {651 {
652 qWarning() << __PRETTY_FUNCTION__ << " SSID was empty";652 qWarning() << " SSID was empty";
653 Q_EMIT reportError(1);653 Q_EMIT reportError(1);
654 d->setEnable(false);654 d->setEnable(false);
655 return;655 return;
@@ -662,7 +662,7 @@
662662
663 if (!d->m_device)663 if (!d->m_device)
664 {664 {
665 qWarning() << __PRETTY_FUNCTION__ << "Failed to create AP device";665 qWarning() << "Failed to create AP device";
666 Q_EMIT reportError(1);666 Q_EMIT reportError(1);
667 d->setDisconnectWifi(false);667 d->setDisconnectWifi(false);
668 return;668 return;
669669
=== modified file 'src/indicator/nmofono/kill-switch.cpp'
--- src/indicator/nmofono/kill-switch.cpp 2015-08-06 11:23:00 +0000
+++ src/indicator/nmofono/kill-switch.cpp 2016-05-26 16:58:27 +0000
@@ -118,7 +118,7 @@
118{118{
119 if (!block && state() == State::hard_blocked)119 if (!block && state() == State::hard_blocked)
120 {120 {
121 qCritical() << __PRETTY_FUNCTION__ << "Killswitch is hard blocked.";121 qCritical() << "Killswitch is hard blocked.";
122 return;122 return;
123 }123 }
124124
@@ -141,7 +141,7 @@
141 }141 }
142 catch (std::exception &e)142 catch (std::exception &e)
143 {143 {
144 qCritical() << __PRETTY_FUNCTION__ << e.what();144 qCritical() << e.what();
145 }145 }
146}146}
147147
@@ -163,7 +163,7 @@
163 }163 }
164 catch (std::runtime_error& e)164 catch (std::runtime_error& e)
165 {165 {
166 qWarning() << __PRETTY_FUNCTION__ << ": " << QString::fromStdString(e.what());166 qWarning() << e.what();
167 return false;167 return false;
168 }168 }
169}169}
170170
=== modified file 'src/indicator/nmofono/manager-impl.cpp'
--- src/indicator/nmofono/manager-impl.cpp 2016-05-26 16:58:27 +0000
+++ src/indicator/nmofono/manager-impl.cpp 2016-05-26 16:58:27 +0000
@@ -288,6 +288,9 @@
288 auto toAdd = modemPaths;288 auto toAdd = modemPaths;
289 toAdd.subtract(currentModemPaths);289 toAdd.subtract(currentModemPaths);
290290
291 if (!toRemove.isEmpty()) {
292 qDebug() << "Removing modems" << toRemove;
293 }
291 for (const auto& path : toRemove)294 for (const auto& path : toRemove)
292 {295 {
293 auto modem = m_ofonoLinks.take(path);296 auto modem = m_ofonoLinks.take(path);
@@ -301,6 +304,9 @@
301 Q_EMIT p.modemsChanged();304 Q_EMIT p.modemsChanged();
302 }305 }
303306
307 if (!toAdd.isEmpty()) {
308 qDebug() << "Adding modems" << toAdd;
309 }
304 for (const auto& path : toAdd)310 for (const auto& path : toAdd)
305 {311 {
306 auto modemInterface = make_shared<QOfonoModem>();312 auto modemInterface = make_shared<QOfonoModem>();
@@ -467,6 +473,8 @@
467void473void
468ManagerImpl::setWifiEnabled(bool enabled)474ManagerImpl::setWifiEnabled(bool enabled)
469{475{
476 qDebug() << "Setting WiFi enabled =" << enabled;
477
470 if (!d->m_hasWifi)478 if (!d->m_hasWifi)
471 {479 {
472 return;480 return;
@@ -504,6 +512,8 @@
504void512void
505ManagerImpl::setHotspotEnabled(bool enabled)513ManagerImpl::setHotspotEnabled(bool enabled)
506{514{
515 qDebug() << "Setting hotspot enabled =" << enabled;
516
507 if (d->m_hotspotManager->enabled() == enabled)517 if (d->m_hotspotManager->enabled() == enabled)
508 {518 {
509 return;519 return;
@@ -511,7 +521,7 @@
511521
512 if (enabled && d->m_flightMode)522 if (enabled && d->m_flightMode)
513 {523 {
514 qWarning() << __PRETTY_FUNCTION__ << "Cannot set hotspot enabled when flight mode is on";524 qWarning() << "Cannot set hotspot enabled when flight mode is on";
515 return;525 return;
516 }526 }
517527
@@ -530,6 +540,8 @@
530void540void
531ManagerImpl::setFlightMode(bool enabled)541ManagerImpl::setFlightMode(bool enabled)
532{542{
543 qDebug() << "Setting flight mode enabled =" << enabled;
544
533 if (enabled == d->m_killSwitch->isFlightMode())545 if (enabled == d->m_killSwitch->isFlightMode())
534 {546 {
535 return;547 return;
@@ -567,9 +579,7 @@
567void579void
568ManagerImpl::device_removed(const QDBusObjectPath &path)580ManagerImpl::device_removed(const QDBusObjectPath &path)
569{581{
570#ifdef INDICATOR_NETWORK_TRACE_MESSAGES582 qDebug() << "Device Removed:" << path.path();
571 qDebug() << "Device Removed:" << path.path();
572#endif
573 Link::Ptr toRemove;583 Link::Ptr toRemove;
574 for (auto dev : d->m_nmLinks)584 for (auto dev : d->m_nmLinks)
575 {585 {
@@ -591,9 +601,7 @@
591void601void
592ManagerImpl::device_added(const QDBusObjectPath &path)602ManagerImpl::device_added(const QDBusObjectPath &path)
593{603{
594#ifdef INDICATOR_NETWORK_TRACE_MESSAGES
595 qDebug() << "Device Added:" << path.path();604 qDebug() << "Device Added:" << path.path();
596#endif
597 for (const auto &dev : d->m_nmLinks)605 for (const auto &dev : d->m_nmLinks)
598 {606 {
599 auto wifiLink = dynamic_pointer_cast<wifi::WifiLinkImpl>(dev);607 auto wifiLink = dynamic_pointer_cast<wifi::WifiLinkImpl>(dev);
@@ -623,7 +631,7 @@
623 }631 }
624 }632 }
625 } catch (const exception &e) {633 } catch (const exception &e) {
626 qDebug() << __PRETTY_FUNCTION__ << ": failed to create Device proxy for "<< path.path() << ": ";634 qDebug() << ": failed to create Device proxy for "<< path.path() << ": ";
627 qDebug() << "\t" << e.what();635 qDebug() << "\t" << e.what();
628 qDebug() << "\tIgnoring.";636 qDebug() << "\tIgnoring.";
629 return;637 return;
@@ -694,6 +702,7 @@
694 || d->m_unlockDialog->modem() == modem702 || d->m_unlockDialog->modem() == modem
695 || count(d->m_pendingUnlocks.begin(), d->m_pendingUnlocks.end(), modem) != 0)703 || count(d->m_pendingUnlocks.begin(), d->m_pendingUnlocks.end(), modem) != 0)
696 {704 {
705 qDebug() << "Didn't unlock modem because it's already being unlocked or is queued for unlock" << modem->simIdentifier();
697 return;706 return;
698 }707 }
699708
@@ -702,15 +711,18 @@
702 {711 {
703 if (modem->isReadyToUnlock())712 if (modem->isReadyToUnlock())
704 {713 {
714 qDebug() << "Unlocking modem" << modem->simIdentifier();
705 d->m_unlockDialog->unlock(modem);715 d->m_unlockDialog->unlock(modem);
706 }716 }
707 else717 else
708 {718 {
719 qDebug() << "Waiting for modem to be ready" << modem->simIdentifier();
709 modem->notifyWhenReadyToUnlock();720 modem->notifyWhenReadyToUnlock();
710 }721 }
711 }722 }
712 else723 else
713 {724 {
725 qDebug() << "Queueing modem for unlock" << modem->simIdentifier();
714 d->m_pendingUnlocks.push_back(modem);726 d->m_pendingUnlocks.push_back(modem);
715 }727 }
716 } catch(const exception &e) {728 } catch(const exception &e) {
@@ -718,21 +730,16 @@
718 // crashed taking the notification server with it. There is no graceful730 // crashed taking the notification server with it. There is no graceful
719 // and reliable way to recover so die and get restarted.731 // and reliable way to recover so die and get restarted.
720 // See also https://bugs.launchpad.net/unity-notifications/+bug/1238990732 // See also https://bugs.launchpad.net/unity-notifications/+bug/1238990
721 qWarning() << __PRETTY_FUNCTION__ << " sim unlocking failed: " << QString::fromStdString(e.what());733 qWarning() << " sim unlocking failed: " << QString::fromStdString(e.what());
722 }734 }
723}735}
724736
725void737void
726ManagerImpl::unlockAllModems()738ManagerImpl::unlockAllModems()
727{739{
728#ifdef INDICATOR_NETWORK_TRACE_MESSAGES740 qDebug() << "Unlock all modems";
729 qDebug() << __PRETTY_FUNCTION__;
730#endif
731 for (auto& m : d->m_ofonoLinks)741 for (auto& m : d->m_ofonoLinks)
732 {742 {
733#ifdef INDICATOR_NETWORK_TRACE_MESSAGES
734 qDebug() << "Unlocking " << m->simIdentifier();
735#endif
736 unlockModem(m);743 unlockModem(m);
737 }744 }
738}745}
@@ -740,9 +747,7 @@
740void747void
741ManagerImpl::unlockModemByName(const QString &name)748ManagerImpl::unlockModemByName(const QString &name)
742{749{
743#ifdef INDICATOR_NETWORK_TRACE_MESSAGES750 qDebug() << "Unlock modem:" << name;
744 qDebug() << __PRETTY_FUNCTION__ ;
745#endif
746 auto it = d->m_ofonoLinks.find(name);751 auto it = d->m_ofonoLinks.find(name);
747 if (it != d->m_ofonoLinks.cend())752 if (it != d->m_ofonoLinks.cend())
748 {753 {
749754
=== modified file 'src/indicator/nmofono/vpn/vpn-connection.cpp'
--- src/indicator/nmofono/vpn/vpn-connection.cpp 2016-03-04 11:03:02 +0000
+++ src/indicator/nmofono/vpn/vpn-connection.cpp 2016-05-26 16:58:27 +0000
@@ -206,7 +206,7 @@
206 reply.waitForFinished();206 reply.waitForFinished();
207 if (reply.isError())207 if (reply.isError())
208 {208 {
209 qWarning() << __PRETTY_FUNCTION__ << reply.error().message() << m_pendingSettings;209 qWarning() << reply.error().message() << m_pendingSettings;
210 }210 }
211211
212 m_dirty = false;212 m_dirty = false;
@@ -237,7 +237,7 @@
237 reply.waitForFinished();237 reply.waitForFinished();
238 if (reply.isError())238 if (reply.isError())
239 {239 {
240 qWarning() << __PRETTY_FUNCTION__ << reply.error().message();240 qWarning() << reply.error().message();
241 return;241 return;
242 }242 }
243243
@@ -261,7 +261,7 @@
261 reply.waitForFinished();261 reply.waitForFinished();
262 if (reply.isError())262 if (reply.isError())
263 {263 {
264 qWarning() << __PRETTY_FUNCTION__ << reply.error().message();264 qWarning() << reply.error().message();
265 return;265 return;
266 }266 }
267267
268268
=== modified file 'src/indicator/nmofono/vpn/vpn-manager.cpp'
--- src/indicator/nmofono/vpn/vpn-manager.cpp 2016-02-23 09:05:16 +0000
+++ src/indicator/nmofono/vpn/vpn-manager.cpp 2016-05-26 16:58:27 +0000
@@ -122,7 +122,7 @@
122 QDBusPendingReply<QDBusObjectPath> reply = *call;122 QDBusPendingReply<QDBusObjectPath> reply = *call;
123 if (reply.isError())123 if (reply.isError())
124 {124 {
125 qWarning() << __PRETTY_FUNCTION__ << reply.error().message();125 qWarning() << reply.error().message();
126 }126 }
127 call->deleteLater();127 call->deleteLater();
128 }128 }
129129
=== modified file 'src/indicator/nmofono/wifi/wifi-link-impl.cpp'
--- src/indicator/nmofono/wifi/wifi-link-impl.cpp 2015-10-06 10:19:30 +0000
+++ src/indicator/nmofono/wifi/wifi-link-impl.cpp 2016-05-26 16:58:27 +0000
@@ -242,7 +242,7 @@
242 NM_DBUS_SERVICE, path.path(), m_dev->connection());242 NM_DBUS_SERVICE, path.path(), m_dev->connection());
243 shap = make_shared<AccessPointImpl>(ap);243 shap = make_shared<AccessPointImpl>(ap);
244 } catch(const exception &e) {244 } catch(const exception &e) {
245 qWarning() << __PRETTY_FUNCTION__ << ": failed to create AccessPoint proxy for "<< path.path() << ": ";245 qWarning() << "Failed to create AccessPoint proxy for "<< path.path() << ": ";
246 qWarning() << "\t" << QString::fromStdString(e.what());246 qWarning() << "\t" << QString::fromStdString(e.what());
247 qWarning() << "\tIgnoring.";247 qWarning() << "\tIgnoring.";
248 return;248 return;
@@ -261,7 +261,7 @@
261 /// @bug dbus-cpp internal logic exploded261 /// @bug dbus-cpp internal logic exploded
262 // If this happens, indicator-network is in an unknown state with no clear way of262 // If this happens, indicator-network is in an unknown state with no clear way of
263 // recovering. The only reasonable way out is a graceful exit.263 // recovering. The only reasonable way out is a graceful exit.
264 cerr << __PRETTY_FUNCTION__ << " Failed to run dbus service: " << e.what() << endl;264 cerr << " Failed to run dbus service: " << e.what() << endl;
265 }265 }
266 }266 }
267267
@@ -278,7 +278,7 @@
278 }278 }
279 }279 }
280 if (!shap) {280 if (!shap) {
281 qWarning() << __PRETTY_FUNCTION__ << ": Tried to remove access point " << path.path() << " that has not been added.";281 qWarning() << "Tried to remove access point " << path.path() << " that has not been added.";
282 return;282 return;
283 }283 }
284 m_rawAccessPoints = list;284 m_rawAccessPoints = list;
@@ -449,6 +449,8 @@
449void449void
450WifiLinkImpl::connect_to(AccessPoint::Ptr accessPoint)450WifiLinkImpl::connect_to(AccessPoint::Ptr accessPoint)
451{451{
452 qDebug() << "Connecting to:" << accessPoint->ssid();
453
452 try {454 try {
453 d->m_connecting = true;455 d->m_connecting = true;
454 QByteArray ssid = accessPoint->raw_ssid();456 QByteArray ssid = accessPoint->raw_ssid();
@@ -479,11 +481,13 @@
479481
480 QDBusObjectPath ac("/");482 QDBusObjectPath ac("/");
481 if (found) {483 if (found) {
484 qDebug() << "Connecting to known access point";
482 ac = d->m_nm->ActivateConnection(QDBusObjectPath(found->path()),485 ac = d->m_nm->ActivateConnection(QDBusObjectPath(found->path()),
483 QDBusObjectPath(d->m_dev->path()),486 QDBusObjectPath(d->m_dev->path()),
484 accessPoint->object_path());487 accessPoint->object_path());
485 } else {488 } else {
486 if (accessPoint->enterprise()) {489 if (accessPoint->enterprise()) {
490 qDebug() << "New connection to enterprise access point";
487 // activate system settings URI491 // activate system settings URI
488 QUrlQuery q;492 QUrlQuery q;
489 q.addQueryItem("ssid", accessPoint->raw_ssid());493 q.addQueryItem("ssid", accessPoint->raw_ssid());
@@ -496,6 +500,7 @@
496 }500 }
497 });501 });
498 } else {502 } else {
503 qDebug() << "New connection to regular access point";
499 QVariantDictMap conf;504 QVariantDictMap conf;
500505
501 /// @todo getting the ssid multiple times over dbus is stupid.506 /// @todo getting the ssid multiple times over dbus is stupid.
@@ -519,7 +524,7 @@
519 // @bug default timeout expired: LP(#1361642)524 // @bug default timeout expired: LP(#1361642)
520 // If this happens, indicator-network is in an unknown state with no clear way of525 // If this happens, indicator-network is in an unknown state with no clear way of
521 // recovering. The only reasonable way out is a graceful exit.526 // recovering. The only reasonable way out is a graceful exit.
522 qWarning() << __PRETTY_FUNCTION__ << " Failed to activate connection: " << e.what();527 qWarning() << " Failed to activate connection: " << e.what();
523 }528 }
524}529}
525530
526531
=== modified file 'src/indicator/nmofono/wwan/modem.cpp'
--- src/indicator/nmofono/wwan/modem.cpp 2016-05-26 16:58:27 +0000
+++ src/indicator/nmofono/wwan/modem.cpp 2016-05-26 16:58:27 +0000
@@ -20,6 +20,7 @@
20#include <nmofono/wwan/modem.h>20#include <nmofono/wwan/modem.h>
2121
22#include <ofono/dbus.h>22#include <ofono/dbus.h>
23#include <QDebug>
2324
24#define slots25#define slots
25#include <qofono-qt5/qofonomodem.h>26#include <qofono-qt5/qofonomodem.h>
@@ -52,7 +53,7 @@
52 if (str == "roaming")53 if (str == "roaming")
53 return Modem::ModemStatus::roaming;54 return Modem::ModemStatus::roaming;
5455
55 qWarning() << __PRETTY_FUNCTION__ << ": Unknown status" << str;56 qWarning() << ": Unknown status" << str;
56 return Modem::ModemStatus::unknown;57 return Modem::ModemStatus::unknown;
57}58}
5859
@@ -73,7 +74,7 @@
73 if (str == "lte")74 if (str == "lte")
74 return Modem::Bearer::lte;75 return Modem::Bearer::lte;
7576
76 qWarning() << __PRETTY_FUNCTION__ << ": Unknown techonology" << str;77 qWarning() << "Unknown technology" << str;
77 return Modem::Bearer::notAvailable;78 return Modem::Bearer::notAvailable;
78}79}
79}80}
@@ -160,6 +161,8 @@
160161
161 if (p.isReadyToUnlock() && m_shouldTriggerUnlock)162 if (p.isReadyToUnlock() && m_shouldTriggerUnlock)
162 {163 {
164
165 qDebug() << "SIM ready to unlock:" << p.simIdentifier();
163 m_shouldTriggerUnlock = false;166 m_shouldTriggerUnlock = false;
164 Q_EMIT p.readyToUnlock(p.name());167 Q_EMIT p.readyToUnlock(p.name());
165 }168 }
@@ -760,6 +763,7 @@
760void763void
761Modem::notifyWhenReadyToUnlock()764Modem::notifyWhenReadyToUnlock()
762{765{
766 qDebug() << "Notify when ready to unlock" << simIdentifier();
763 d->m_shouldTriggerUnlock = true;767 d->m_shouldTriggerUnlock = true;
764}768}
765769
766770
=== modified file 'src/indicator/root-state.cpp'
--- src/indicator/root-state.cpp 2015-08-14 16:11:08 +0000
+++ src/indicator/root-state.cpp 2016-05-26 16:58:27 +0000
@@ -288,7 +288,7 @@
288 try {288 try {
289 state["icon"] = createIcon(m_networkingIcons.first().toStdString());289 state["icon"] = createIcon(m_networkingIcons.first().toStdString());
290 } catch (exception &e) {290 } catch (exception &e) {
291 qWarning() << __PRETTY_FUNCTION__ << e.what();291 qWarning() << e.what();
292 }292 }
293293
294 for (const auto& icon: m_networkingIcons)294 for (const auto& icon: m_networkingIcons)
295295
=== modified file 'src/indicator/vpn-status-notifier.cpp'
--- src/indicator/vpn-status-notifier.cpp 2015-12-17 10:41:14 +0000
+++ src/indicator/vpn-status-notifier.cpp 2016-05-26 16:58:27 +0000
@@ -64,7 +64,7 @@
64 QString id = activeVpnConnection->activeConnection().id();64 QString id = activeVpnConnection->activeConnection().id();
65 QString message = REASON_MAP.value(reason, FAILED_MESSAGE).arg(id);65 QString message = REASON_MAP.value(reason, FAILED_MESSAGE).arg(id);
6666
67 qDebug() << __PRETTY_FUNCTION__ << "VPN Connection Failed" << message;67 qDebug() << "VPN Connection Failed" << message;
68 m_notificationManager->notify(_("VPN Connection Failed"), message, "network-vpn", {}, {}, 5)->show();68 m_notificationManager->notify(_("VPN Connection Failed"), message, "network-vpn", {}, {}, 5)->show();
69 }69 }
70 }70 }
7171
=== modified file 'src/menumodel-cpp/action-group-merger.cpp'
--- src/menumodel-cpp/action-group-merger.cpp 2015-10-06 10:14:57 +0000
+++ src/menumodel-cpp/action-group-merger.cpp 2016-05-26 16:58:27 +0000
@@ -30,7 +30,7 @@
30 // then they will override each other in GActionGroup so let's catch that30 // then they will override each other in GActionGroup so let's catch that
31 // early on.31 // early on.
32 if (name_iter->second != action) {32 if (name_iter->second != action) {
33 qWarning() << __PRETTY_FUNCTION__ << ": Conflicting action names. \"" << action->name() << "\"";33 qWarning() << "Conflicting action names. \"" << action->name() << "\"";
34 /// @todo thow something.34 /// @todo thow something.
35 return;35 return;
36 }36 }
@@ -73,7 +73,7 @@
73 auto iter = m_groups.find(group);73 auto iter = m_groups.find(group);
74 if (iter != m_groups.end()) {74 if (iter != m_groups.end()) {
75 /// @todo throw something.75 /// @todo throw something.
76 std::cerr << __PRETTY_FUNCTION__ << ": Trying to add action group which was already added before." << std::endl;76 qWarning() << "Trying to add action group which was already added before.";
77 return;77 return;
78 }78 }
7979
@@ -91,7 +91,7 @@
91 auto iter = m_groups.find(group);91 auto iter = m_groups.find(group);
92 if (iter == m_groups.end()) {92 if (iter == m_groups.end()) {
93 /// @todo throw something.93 /// @todo throw something.
94 std::cerr << __PRETTY_FUNCTION__ << ": Trying to remove action group which was not added before." << std::endl;94 qWarning() << "Trying to remove action group which was not added before.";
95 return;95 return;
96 }96 }
97 auto connections = m_groups[group];97 auto connections = m_groups[group];
9898
=== modified file 'src/menumodel-cpp/menu-item.cpp'
--- src/menumodel-cpp/menu-item.cpp 2015-10-06 10:14:57 +0000
+++ src/menumodel-cpp/menu-item.cpp 2016-05-26 16:58:27 +0000
@@ -83,7 +83,7 @@
83 auto gicon = shared_ptr<GIcon>(g_icon_new_for_string(m_icon.toUtf8().constData(), &error), GObjectDeleter());83 auto gicon = shared_ptr<GIcon>(g_icon_new_for_string(m_icon.toUtf8().constData(), &error), GObjectDeleter());
84 if (error)84 if (error)
85 {85 {
86 qWarning() << __PRETTY_FUNCTION__ << error->message;86 qWarning() << error->message;
87 g_error_free(error);87 g_error_free(error);
88 return;88 return;
89 }89 }
9090
=== modified file 'src/notify-cpp/notification.cpp'
--- src/notify-cpp/notification.cpp 2015-12-11 14:58:11 +0000
+++ src/notify-cpp/notification.cpp 2016-05-26 16:58:27 +0000
@@ -95,12 +95,12 @@
95{95{
96 if (d->m_id > 0 && d->m_open && d->m_expireTimeout <= 0)96 if (d->m_id > 0 && d->m_open && d->m_expireTimeout <= 0)
97 {97 {
98 qDebug() << __PRETTY_FUNCTION__ << "Closing notification:" << d->m_id;98 qDebug() << "Closing notification:" << d->m_id;
99 auto reply = d->m_notificationsInterface->CloseNotification(d->m_id);99 auto reply = d->m_notificationsInterface->CloseNotification(d->m_id);
100 reply.waitForFinished();100 reply.waitForFinished();
101 if (reply.isError())101 if (reply.isError())
102 {102 {
103 qCritical() << __PRETTY_FUNCTION__ << reply.error().message();103 qCritical() << reply.error().message();
104 }104 }
105 }105 }
106}106}
@@ -221,7 +221,7 @@
221 reply.waitForFinished();221 reply.waitForFinished();
222 if (reply.isError())222 if (reply.isError())
223 {223 {
224 qCritical() << __PRETTY_FUNCTION__ << reply.error().message();224 qCritical() << reply.error().message();
225 }225 }
226 else226 else
227 {227 {
@@ -241,7 +241,7 @@
241 reply.waitForFinished();241 reply.waitForFinished();
242 if (reply.isError())242 if (reply.isError())
243 {243 {
244 qCritical() << __PRETTY_FUNCTION__ << reply.error().message();244 qCritical() << reply.error().message();
245 }245 }
246 else246 else
247 {247 {
248248
=== modified file 'src/qpowerd/qpowerd.cpp'
--- src/qpowerd/qpowerd.cpp 2015-07-28 08:26:51 +0000
+++ src/qpowerd/qpowerd.cpp 2016-05-26 16:58:27 +0000
@@ -68,7 +68,7 @@
68 reply.waitForFinished();68 reply.waitForFinished();
69 if (reply.isError())69 if (reply.isError())
70 {70 {
71 qWarning() << __PRETTY_FUNCTION__ << reply.error().message();71 qWarning() << reply.error().message();
72 }72 }
73 else73 else
74 {74 {
7575
=== modified file 'src/util/CMakeLists.txt'
--- src/util/CMakeLists.txt 2016-02-15 09:31:38 +0000
+++ src/util/CMakeLists.txt 2016-05-26 16:58:27 +0000
@@ -2,6 +2,7 @@
22
3set(UTIL_SOURCES3set(UTIL_SOURCES
4 dbus-utils.cpp4 dbus-utils.cpp
5 logging.cpp
5 unix-signal-handler.cpp6 unix-signal-handler.cpp
6)7)
78
89
=== added file 'src/util/logging.cpp'
--- src/util/logging.cpp 1970-01-01 00:00:00 +0000
+++ src/util/logging.cpp 2016-05-26 16:58:27 +0000
@@ -0,0 +1,59 @@
1/*
2 * Copyright (C) 2016 Canonical, Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3, as published
6 * by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranties of
10 * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
11 * PURPOSE. See the GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License along
14 * with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Author: Pete Woods <pete.woods@canonical.com>
17 */
18
19#include <logging.h>
20
21namespace util
22{
23 void
24 loggingFunction (QtMsgType type, const QMessageLogContext &context,
25 const QString &msg)
26 {
27 QByteArray localMsg = msg.toLocal8Bit ();
28 switch (type)
29 {
30 case QtMsgType::QtDebugMsg:
31 fprintf (stderr, "Debug: %s (%s:%u, %s)\n",
32 localMsg.constData (), context.file, context.line,
33 context.function);
34 break;
35#if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0)
36 case QtMsgType::QtInfoMsg:
37 fprintf (stderr, "Info: %s (%s:%u, %s)\n",
38 localMsg.constData (), context.file, context.line,
39 context.function);
40 break;
41#endif
42 case QtMsgType::QtWarningMsg:
43 fprintf (stderr, "Warning: %s (%s:%u, %s)\n",
44 localMsg.constData (), context.file, context.line,
45 context.function);
46 break;
47 case QtMsgType::QtCriticalMsg:
48 fprintf (stderr, "Critical: %s (%s:%u, %s)\n",
49 localMsg.constData (), context.file, context.line,
50 context.function);
51 break;
52 case QtMsgType::QtFatalMsg:
53 fprintf (stderr, "Fatal: %s (%s:%u, %s)\n",
54 localMsg.constData (), context.file, context.line,
55 context.function);
56 abort ();
57 }
58 }
59}
060
=== added file 'src/util/logging.h'
--- src/util/logging.h 1970-01-01 00:00:00 +0000
+++ src/util/logging.h 2016-05-26 16:58:27 +0000
@@ -0,0 +1,29 @@
1/*
2 * Copyright (C) 2016 Canonical, Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3, as published
6 * by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranties of
10 * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
11 * PURPOSE. See the GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License along
14 * with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Author: Pete Woods <pete.woods@canonical.com>
17 */
18
19#pragma once
20
21#include <QMessageLogContext>
22#include <QString>
23
24namespace util
25{
26 void
27 loggingFunction (QtMsgType type, const QMessageLogContext &context,
28 const QString &msg);
29}
030
=== modified file 'tests/unit/secret-agent/secret-agent-main.cpp'
--- tests/unit/secret-agent/secret-agent-main.cpp 2016-02-15 09:31:38 +0000
+++ tests/unit/secret-agent/secret-agent-main.cpp 2016-05-26 16:58:27 +0000
@@ -32,6 +32,34 @@
3232
33using namespace std;33using namespace std;
3434
35class DummyCredentialStore : public agent::CredentialStore
36{
37public:
38 DummyCredentialStore() {
39 }
40
41 ~DummyCredentialStore() {
42 }
43
44 void
45 save (const QString&, const QString&, const QString&, const QString&,
46 const QString&)
47 {
48 }
49
50 QMap<QString, QString>
51 get (const QString&, const QString&)
52 {
53 return QMap<QString, QString> ();
54 }
55
56 void
57 clear (const QString&)
58 {
59 }
60
61};
62
35int main(int argc, char *argv[]) {63int main(int argc, char *argv[]) {
36 QCoreApplication application(argc, argv);64 QCoreApplication application(argc, argv);
37 DBusTypes::registerMetaTypes();65 DBusTypes::registerMetaTypes();
@@ -49,7 +77,7 @@
4977
50 auto secretAgent = make_unique<agent::SecretAgent>(78 auto secretAgent = make_unique<agent::SecretAgent>(
51 make_shared<notify::NotificationManager>(GETTEXT_PACKAGE),79 make_shared<notify::NotificationManager>(GETTEXT_PACKAGE),
52 make_shared<agent::KeyringCredentialStore>(),80 make_shared<DummyCredentialStore>(),
53 QDBusConnection::systemBus(), QDBusConnection::sessionBus());81 QDBusConnection::systemBus(), QDBusConnection::sessionBus());
5482
55 if (argc == 2 && QString("--print-address") == argv[1]) {83 if (argc == 2 && QString("--print-address") == argv[1]) {
5684
=== modified file 'tests/unit/secret-agent/test-secret-agent.cpp'
--- tests/unit/secret-agent/test-secret-agent.cpp 2016-02-15 09:31:38 +0000
+++ tests/unit/secret-agent/test-secret-agent.cpp 2016-05-26 16:58:27 +0000
@@ -261,9 +261,9 @@
261 reply.waitForFinished();261 reply.waitForFinished();
262262
263 ASSERT_TRUE(reply.isError());263 ASSERT_TRUE(reply.isError());
264 EXPECT_EQ(QDBusError::InternalError, reply.error().type());264 EXPECT_EQ("org.freedesktop.NetworkManager.SecretAgent.NoSecrets", reply.error().name().toStdString());
265 EXPECT_EQ("No password found for this connection.",265 EXPECT_EQ("No secrets found for this connection.",
266 reply.error().message());266 reply.error().message().toStdString());
267}267}
268268
269/* Tests that if we request secrets and then cancel the request269/* Tests that if we request secrets and then cancel the request
270270
=== modified file 'tests/utils/CMakeLists.txt'
--- tests/utils/CMakeLists.txt 2014-08-05 21:16:22 +0000
+++ tests/utils/CMakeLists.txt 2016-05-26 16:58:27 +0000
@@ -8,7 +8,8 @@
8 action-utils.cpp8 action-utils.cpp
9)9)
1010
11qt5_use_modules(11target_link_libraries(
12 test-utils12 test-utils
13 Core13 Qt5::Core
14 util
14)15)
1516
=== modified file 'tests/utils/main.cpp'
--- tests/utils/main.cpp 2016-03-04 11:11:56 +0000
+++ tests/utils/main.cpp 2016-05-26 16:58:27 +0000
@@ -25,6 +25,8 @@
2525
26#include <libqtdbusmock/DBusMock.h>26#include <libqtdbusmock/DBusMock.h>
2727
28#include <util/logging.h>
29
28using namespace QtDBusMock;30using namespace QtDBusMock;
2931
30class Runner: public QObject32class Runner: public QObject
@@ -39,6 +41,8 @@
3941
40int main(int argc, char **argv)42int main(int argc, char **argv)
41{43{
44 qInstallMessageHandler(util::loggingFunction);
45
42 qputenv("LANG", "C.UTF-8");46 qputenv("LANG", "C.UTF-8");
43 unsetenv("LC_ALL");47 unsetenv("LC_ALL");
44 unsetenv("GDM_LANG");48 unsetenv("GDM_LANG");

Subscribers

People subscribed via source and target branches