diff options
| author | Charles Kerr <charles.kerr@canonical.com> | 2016-10-21 13:32:21 +0200 | 
|---|---|---|
| committer | Charles Kerr <charles.kerr@canonical.com> | 2016-10-21 13:32:21 +0200 | 
| commit | 7002fc4e6a6496fb5c0d3294540c957787689847 (patch) | |
| tree | 6b858548d5558e4d960979134103b040589ea836 /src | |
| parent | 144228c916b574e5f4cbc90b9b90c16f0ed9ac73 (diff) | |
| download | ayatana-indicator-display-7002fc4e6a6496fb5c0d3294540c957787689847.tar.gz ayatana-indicator-display-7002fc4e6a6496fb5c0d3294540c957787689847.tar.bz2 ayatana-indicator-display-7002fc4e6a6496fb5c0d3294540c957787689847.zip | |
add block braces as suggested by dobey
Diffstat (limited to 'src')
| -rw-r--r-- | src/adbd-client.cpp | 6 | ||||
| -rw-r--r-- | src/greeter.cpp | 3 | ||||
| -rw-r--r-- | src/usb-manager.cpp | 17 | 
3 files changed, 17 insertions, 9 deletions
| diff --git a/src/adbd-client.cpp b/src/adbd-client.cpp index 8b675d5..47914cb 100644 --- a/src/adbd-client.cpp +++ b/src/adbd-client.cpp @@ -49,8 +49,9 @@ public:          g_cancellable_cancel(m_cancellable);          m_pkresponse_cv.notify_one();          m_sleep_cv.notify_one(); -        if (m_worker_thread.joinable()) +        if (m_worker_thread.joinable()) {              m_worker_thread.join(); +        }          g_clear_object(&m_cancellable);      } @@ -154,8 +155,9 @@ private:                              int(response),                              int(g_cancellable_is_cancelled(m_cancellable)));                  } -                if (!g_cancellable_is_cancelled(m_cancellable)) +                if (!g_cancellable_is_cancelled(m_cancellable)) {                      send_pk_response(socket, response); +                }              } else if (!reqstr.empty()) {                  g_warning("Invalid ADB request: [%s]", reqstr.c_str());              } diff --git a/src/greeter.cpp b/src/greeter.cpp index 9bd5db0..3d0f347 100644 --- a/src/greeter.cpp +++ b/src/greeter.cpp @@ -146,8 +146,9 @@ private:          GError* error {};          auto v = g_dbus_connection_call_finish(G_DBUS_CONNECTION(source), res, &error);          if (error != nullptr) { -            if (!g_error_matches(error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) +            if (!g_error_matches(error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {                  g_warning("Greeter: Error getting IsActive property: %s", error->message); +            }              g_clear_error(&error);          } else {              GVariant* is_active {}; diff --git a/src/usb-manager.cpp b/src/usb-manager.cpp index 7d66e74..f83b5f1 100644 --- a/src/usb-manager.cpp +++ b/src/usb-manager.cpp @@ -50,10 +50,11 @@ public:          });          m_greeter->state().changed().connect([this](const Greeter::State& state) { -            if (state == Greeter::State::INACTIVE) +            if (state == Greeter::State::INACTIVE) {                  maybe_snap(); -            else +            } else {                  stop_snap(); +            }          });          // create a new adbd client @@ -78,8 +79,9 @@ public:      ~Impl()      { -        if (m_request_complete_idle_tag) +        if (m_request_complete_idle_tag) {              g_source_remove(m_request_complete_idle_tag); +        }      }  private: @@ -93,12 +95,14 @@ private:      void maybe_snap()      {          // only prompt if there's something to prompt about -        if (!m_req) +        if (!m_req) {              return; +        }          // only prompt in an unlocked session -        if (m_greeter->state().get() != Greeter::State::INACTIVE) +        if (m_greeter->state().get() != Greeter::State::INACTIVE) {              return; +        }          snap();      } @@ -109,8 +113,9 @@ private:          m_snap_connections.insert((*m_snap).on_user_response().connect(              [this](AdbdClient::PKResponse response, bool remember_choice){ -                if (remember_choice && (response == AdbdClient::PKResponse::ALLOW)) +                if (remember_choice && (response == AdbdClient::PKResponse::ALLOW)) {                      write_public_key(m_req->public_key); +                }                  m_response = response; | 
