mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-28 11:53:11 -07:00
fix compiling on arch (#6768)
* fix compiling on arch * redo all the logging in affected files
This commit is contained in:
@@ -30,6 +30,8 @@
|
||||
#include <libcockatrice/protocol/pb/response_replay_get_code.pb.h>
|
||||
#include <libcockatrice/protocol/pending_command.h>
|
||||
|
||||
inline Q_LOGGING_CATEGORY(TabReplaysLog, "replays_tab");
|
||||
|
||||
TabReplays::TabReplays(TabSupervisor *_tabSupervisor, AbstractClient *_client, const ServerInfo_User *currentUserInfo)
|
||||
: Tab(_tabSupervisor), client(_client)
|
||||
{
|
||||
@@ -265,9 +267,11 @@ void TabReplays::actOpenLocalReplay()
|
||||
f.close();
|
||||
|
||||
GameReplay *replay = new GameReplay;
|
||||
replay->ParseFromArray(_data.data(), _data.size());
|
||||
|
||||
emit openReplay(replay);
|
||||
if (replay->ParseFromArray(_data.data(), _data.size())) {
|
||||
emit openReplay(replay);
|
||||
} else {
|
||||
qCWarning(TabReplaysLog) << "could not parse replay!";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -379,9 +383,12 @@ void TabReplays::openRemoteReplayFinished(const Response &r)
|
||||
|
||||
const Response_ReplayDownload &resp = r.GetExtension(Response_ReplayDownload::ext);
|
||||
GameReplay *replay = new GameReplay;
|
||||
replay->ParseFromString(resp.replay_data());
|
||||
if (replay->ParseFromString(resp.replay_data())) {
|
||||
|
||||
emit openReplay(replay);
|
||||
emit openReplay(replay);
|
||||
} else {
|
||||
qCWarning(TabReplaysLog) << "could not parse remote replay!";
|
||||
}
|
||||
}
|
||||
|
||||
void TabReplays::actDownload()
|
||||
|
||||
@@ -84,6 +84,7 @@
|
||||
const QString MainWindow::appName = "Cockatrice";
|
||||
const QStringList MainWindow::fileNameFilters = QStringList() << QObject::tr("Cockatrice card database (*.xml)")
|
||||
<< QObject::tr("All files (*.*)");
|
||||
inline Q_LOGGING_CATEGORY(MainWindowLog, "main_window");
|
||||
|
||||
/**
|
||||
* Replaces the tab-specific menus that are shown in the menuBar.
|
||||
@@ -277,9 +278,11 @@ void MainWindow::actWatchReplay()
|
||||
file.close();
|
||||
|
||||
replay = new GameReplay;
|
||||
replay->ParseFromArray(buf.data(), buf.size());
|
||||
|
||||
tabSupervisor->openReplay(replay);
|
||||
if (replay->ParseFromArray(buf.data(), buf.size())) {
|
||||
tabSupervisor->openReplay(replay);
|
||||
} else {
|
||||
qCWarning(MainWindowLog) << "failed to parse replay!";
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::localGameEnded()
|
||||
|
||||
Reference in New Issue
Block a user