Browse Source

load blocked friends from settings on start

reviewable/pr6623/r11
Anthony Bilinski 4 years ago
parent
commit
ab65c049ee
No known key found for this signature in database
GPG Key ID: 2AA8E0DA1B31FB3C
  1. 1
      src/nexus.cpp
  2. 6
      src/persistence/profile.cpp
  3. 1
      src/persistence/profile.h

1
src/nexus.cpp

@ -255,6 +255,7 @@ void Nexus::showMainGUI() @@ -255,6 +255,7 @@ void Nexus::showMainGUI()
Qt::BlockingQueuedConnection);
connect(profile, &Profile::badProxy, widget, &Widget::onBadProxyCore, Qt::BlockingQueuedConnection);
connect(profile, &Profile::blockedFriendLoaded, widget, &Widget::addBlockedFriend);
profile->startCore();

6
src/persistence/profile.cpp

@ -464,6 +464,12 @@ void Profile::startCore() @@ -464,6 +464,12 @@ void Profile::startCore()
// reason: Core::getInstance() returns nullptr, because it's not yet initialized
// solution: kill Core::getInstance
setAvatar(data);
// not actually dependent on Core, but dependent on Profile signals all being hooked up.
auto blockedFriends = settings.getBlockedFriends();
for (auto& blockedFriend : blockedFriends) {
emit blockedFriendLoaded(blockedFriend);
}
}
/**

1
src/persistence/profile.h

@ -94,6 +94,7 @@ signals: @@ -94,6 +94,7 @@ signals:
void failedToStart();
void badProxy();
void coreChanged(Core& core);
void blockedFriendLoaded(const ToxPk& friendPk);
public slots:
void onRequestSent(const ToxPk& friendPk, const QString& message);

Loading…
Cancel
Save