Skip to content

Commit 482aac6

Browse files
committed
fix
1 parent befe48a commit 482aac6

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

Common/Cpp/Json/JsonObject.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,14 @@ class JsonObject{
1919
JsonObject(JsonObject&& x) = default;
2020
JsonObject& operator=(JsonObject&& x) = default;
2121

22-
bool operator==(const JsonObject& x){ // TODO: implement == properly. For JsonValue as well.
23-
return dump() == x.dump();
22+
// TODO: implement == properly. For JsonValue as well.
23+
friend bool operator==(const JsonObject& x, const JsonObject& y){
24+
return x.dump() == y.dump();
2425
}
25-
bool operator!=(const JsonObject& x){
26-
return !(*this == x);
26+
friend bool operator!=(const JsonObject& x, const JsonObject& y){
27+
return !(x == y);
2728
}
29+
2830
private:
2931
// Private to avoid accidental copying.
3032
JsonObject(const JsonObject& x);

Common/Qt/Redispatch.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
#include <QApplication>
1111
#include "Redispatch.h"
1212

13+
//#include <iostream>
14+
//using std::cout;
15+
//using std::endl;
16+
1317
namespace PokemonAutomation{
1418

1519

@@ -31,16 +35,24 @@ void run_on_object_thread_and_wait(QObject* object, std::function<void()> lambda
3135
return;
3236
}
3337

38+
// static int c = 0;
39+
// c++;
40+
3441
std::mutex lock;
3542
std::condition_variable cv;
3643
bool done = false;
44+
// cout << c << ": " << "Invoking..." << endl;
3745
QMetaObject::invokeMethod(object, [&]{
46+
// cout << c << ": " << "Running Lambda..." << endl;
3847
lambda();
48+
// cout << c << ": " << "Running Lambda... Done" << endl;
3949
std::lock_guard<std::mutex> lg(lock);
4050
done = true;
4151
cv.notify_all();
4252
});
53+
// cout << c << ": " << "Invoking... Done" << endl;
4354
std::unique_lock<std::mutex> lg(lock);
55+
// cout << c << ": " << "Waiting..." << endl;
4456
cv.wait(lg, [&]{ return done; });
4557
}
4658

0 commit comments

Comments
 (0)