Skip to content

Commit

Permalink
use value in frontmost_application.hpp
Browse files Browse the repository at this point in the history
  • Loading branch information
tekezo committed Jul 9, 2017
1 parent 6fcd395 commit 1f03cf0
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@ class frontmost_application final : public base {
const auto& value = it.value();

if (key == "type") {
if (json.find(key) != std::end(json) && json[key].is_string()) {
if (json[key] == "frontmost_application_if") {
if (value.is_string()) {
if (value == "frontmost_application_if") {
type_ = type::frontmost_application_if;
}
if (json[key] == "frontmost_application_unless") {
if (value == "frontmost_application_unless") {
type_ = type::frontmost_application_unless;
}
}
} else if (key == "bundle_identifiers") {
if (json.find(key) != std::end(json) && json[key].is_array()) {
for (const auto& j : json[key]) {
if (value.is_array()) {
for (const auto& j : value) {
if (j.is_string()) {
std::string s = j;
try {
Expand All @@ -50,8 +50,8 @@ class frontmost_application final : public base {
}
}
} else if (key == "file_paths") {
if (json.find(key) != std::end(json) && json[key].is_array()) {
for (const auto& j : json[key]) {
if (value.is_array()) {
for (const auto& j : value) {
if (j.is_string()) {
std::string s = j;
try {
Expand Down

0 comments on commit 1f03cf0

Please sign in to comment.