Skip to content

Commit 1d758cb

Browse files
Remove debug logging.
1 parent a7a90ff commit 1d758cb

File tree

5 files changed

+70
-64
lines changed

5 files changed

+70
-64
lines changed

src/elgato-cloud-data.cpp

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,7 @@ void ElgatoCloud::_TokenRefresh(bool loadData, bool loadUserDetails)
132132
if (mainWindowOpen && window) {
133133
QMetaObject::invokeMethod(
134134
QCoreApplication::instance()->thread(),
135-
[this]() {
136-
window->setLoggedIn();
137-
});
135+
[this]() { window->setLoggedIn(); });
138136
}
139137
}
140138
}
@@ -198,14 +196,17 @@ void ElgatoCloud::_Listen()
198196
auto response = fetch_string_from_post(
199197
url, encodeddata);
200198

201-
auto responseJson = nlohmann::json::parse(response);
199+
auto responseJson =
200+
nlohmann::json::parse(response);
202201

203202
if (responseJson.contains("error")) {
204203
if (mainWindowOpen && window) {
205204
QMetaObject::invokeMethod(
206-
QCoreApplication::instance()->thread(),
205+
QCoreApplication::instance()
206+
->thread(),
207207
[this]() {
208-
loginError = true;
208+
loginError =
209+
true;
209210
window->setLoggedIn();
210211
});
211212
}
@@ -289,31 +290,32 @@ void ElgatoCloud::LogOut()
289290
void ElgatoCloud::CheckUpdates(bool forceCheck)
290291
{
291292
try {
292-
std::string updateUrl = "https://gc-updates.elgato.com/windows/marketplace-plugin-for-obs/final/app-version-check.json.php";
293+
std::string updateUrl =
294+
"https://gc-updates.elgato.com/windows/marketplace-plugin-for-obs/final/app-version-check.json.php";
293295
auto response = fetch_string_from_get(updateUrl, "");
294-
blog(LOG_INFO, response.c_str());
295296
auto responseJson = nlohmann::json::parse(response);
296297
if (responseJson.contains("Automatic")) {
297298
auto details = responseJson["Automatic"];
298299
std::string version = details["Version"];
299300
std::string downloadUrl = details["downloadURL"];
300-
auto updateVersion = QVersionNumber::fromString(version);
301-
auto currentVersion = QVersionNumber::fromString(PLUGIN_VERSION);
302-
std::string skip = _skipUpdate == "" ? "0.0.0" : _skipUpdate;
303-
blog(LOG_INFO, "update: %s, current: %s, skip: %s", version.c_str(), PLUGIN_VERSION, skip.c_str());
301+
auto updateVersion =
302+
QVersionNumber::fromString(version);
303+
auto currentVersion =
304+
QVersionNumber::fromString(PLUGIN_VERSION);
305+
std::string skip = _skipUpdate == "" ? "0.0.0"
306+
: _skipUpdate;
304307
auto skipVersion = QVersionNumber::fromString(skip);
305-
if ((forceCheck || skipVersion != updateVersion) && updateVersion > currentVersion) {
308+
if ((forceCheck || skipVersion != updateVersion) &&
309+
updateVersion > currentVersion) {
306310
// Reset the "skip this update" flag because we now have a
307311
// new update.
308-
_skipUpdate = !forceCheck ? "" : _skipUpdate;
309-
blog(LOG_INFO, "UPDATE FOUND.");
312+
_skipUpdate = !forceCheck ? "" : _skipUpdate;
310313
openUpdateModal(version, downloadUrl);
311314
}
312315
} else {
313316
throw("Error");
314317
}
315-
}
316-
catch (...) {
318+
} catch (...) {
317319
blog(LOG_INFO, "Unable to contact update server.");
318320
}
319321
}
@@ -391,9 +393,6 @@ nlohmann::json ElgatoCloud::GetPurchaseDownloadLink(std::string variantId)
391393
auto response = fetch_string_from_get(api_url, _accessToken);
392394
// Todo- Error checking
393395
try {
394-
blog(LOG_INFO,
395-
"============= DOWNLOAD REQUEST API RESPONSE =============\nURL: %s\nResponse: %s",
396-
api_url.c_str(), response.c_str());
397396
auto responseJson = nlohmann::json::parse(response);
398397
return responseJson;
399398
} catch (...) {
@@ -453,7 +452,6 @@ void ElgatoCloud::_LoadUserData(bool loadData)
453452
fetch_string_from_get(api_url, _accessToken);
454453
auto userData = nlohmann::json::parse(userResponse);
455454
api->setUserDetails(userData);
456-
blog(LOG_INFO, "User Response:\n%s", userResponse.c_str());
457455
if (mainWindowOpen && window) {
458456
QMetaObject::invokeMethod(
459457
QCoreApplication::instance()->thread(),

src/elgato-cloud-window.cpp

Lines changed: 32 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,10 @@ DownloadButton::DownloadButton(QWidget *parent) : QWidget(parent)
100100
QSizePolicy::Preferred);
101101

102102
_downloadButton = new QPushButton(this);
103-
_downloadButton->setToolTip(obs_module_text("MarketplaceWindow.DownloadButton.Tooltip"));
103+
_downloadButton->setToolTip(
104+
obs_module_text("MarketplaceWindow.DownloadButton.Tooltip"));
104105
std::string downloadIconPath = imageBaseDir + "download.svg";
105106
std::string downloadIconHoverPath = imageBaseDir + "download_hover.svg";
106-
blog(LOG_INFO, "download img: ", downloadIconPath.c_str());
107107
std::string downloadIconDisabledPath =
108108
imageBaseDir + "download_hover.svg";
109109
QString buttonStyle = EIconHoverDisabledButtonStyle;
@@ -226,7 +226,9 @@ WindowToolBar::WindowToolBar(QWidget *parent) : QWidget(parent)
226226
imageBaseDir += "/images/";
227227

228228
auto api = MarketplaceApi::getInstance();
229-
std::string storeUrl = api->storeUrl() + "/obs/scene-collections?utm_source=mp_connect&utm_medium=direct_software&utm_campaign=v_1.0";
229+
std::string storeUrl =
230+
api->storeUrl() +
231+
"/obs/scene-collections?utm_source=mp_connect&utm_medium=direct_software&utm_campaign=v_1.0";
230232

231233
QPalette pal = QPalette();
232234
pal.setColor(QPalette::Window, "#151515");
@@ -245,7 +247,8 @@ WindowToolBar::WindowToolBar(QWidget *parent) : QWidget(parent)
245247
_layout->addStretch();
246248

247249
_settingsButton = new QPushButton(this);
248-
_settingsButton->setToolTip(obs_module_text("MarketplaceWindow.OpenSettingsButton.Tooltip"));
250+
_settingsButton->setToolTip(obs_module_text(
251+
"MarketplaceWindow.OpenSettingsButton.Tooltip"));
249252
std::string settingsIconPath = imageBaseDir + "settings.svg";
250253
std::string settingsIconHoverPath = imageBaseDir + "settings_hover.svg";
251254
QString settingsButtonStyle = EIconHoverButtonStyle;
@@ -262,7 +265,8 @@ WindowToolBar::WindowToolBar(QWidget *parent) : QWidget(parent)
262265
_layout->addWidget(_settingsButton);
263266

264267
_storeButton = new QPushButton(this);
265-
_storeButton->setToolTip(obs_module_text("MarketplaceWindow.StoreButton.Tooltip"));
268+
_storeButton->setToolTip(
269+
obs_module_text("MarketplaceWindow.StoreButton.Tooltip"));
266270
std::string storeIconPath = imageBaseDir + "marketplace-logo.svg";
267271
std::string storeIconHoverPath =
268272
imageBaseDir + "marketplace-logo_hover.svg";
@@ -281,7 +285,8 @@ WindowToolBar::WindowToolBar(QWidget *parent) : QWidget(parent)
281285
_layout->addWidget(_storeButton);
282286

283287
_logInButton = new QPushButton(this);
284-
_logInButton->setText(obs_module_text("MarketplaceWindow.LoginButton.LogIn"));
288+
_logInButton->setText(
289+
obs_module_text("MarketplaceWindow.LoginButton.LogIn"));
285290
_logInButton->setHidden(elgatoCloud->loggedIn);
286291
_logInButton->setStyleSheet(
287292
"QPushButton {font-size: 12pt; border-radius: 8px; padding: 8px; background-color: #232323; border: none; } "
@@ -291,7 +296,8 @@ WindowToolBar::WindowToolBar(QWidget *parent) : QWidget(parent)
291296
[this]() { elgatoCloud->StartLogin(); });
292297

293298
_logOutButton = new QPushButton(this);
294-
_logOutButton->setText(obs_module_text("MarketplaceWindow.LoginButton.LogOut"));
299+
_logOutButton->setText(
300+
obs_module_text("MarketplaceWindow.LoginButton.LogOut"));
295301
_logOutButton->setHidden(!elgatoCloud->loggedIn);
296302
_logOutButton->setStyleSheet(
297303
"QPushButton {font-size: 12pt; border-radius: 8px; padding: 8px; background-color: #232323; border: none; } "
@@ -396,7 +402,8 @@ OwnedProducts::OwnedProducts(QWidget *parent) : QWidget(parent)
396402
connect(_sideMenu, &QListWidget::itemPressed, this,
397403
[this](QListWidgetItem *item) {
398404
QString val = item->text();
399-
if (val == obs_module_text("MarketplaceWindow.PurchasedTab")) {
405+
if (val ==
406+
obs_module_text("MarketplaceWindow.PurchasedTab")) {
400407
if (_numProducts > 0)
401408
_content->setCurrentIndex(0);
402409
else
@@ -422,12 +429,14 @@ OwnedProducts::OwnedProducts(QWidget *parent) : QWidget(parent)
422429
auto npLayout = new QVBoxLayout(noProducts);
423430
npLayout->addStretch();
424431
auto npTitle = new QLabel(
425-
obs_module_text("MarketplaceWindow.Purchased.NoPurchasesTitle"), noProducts);
432+
obs_module_text("MarketplaceWindow.Purchased.NoPurchasesTitle"),
433+
noProducts);
426434
npTitle->setStyleSheet("QLabel {font-size: 18pt;}");
427435
npTitle->setAlignment(Qt::AlignCenter);
428436
npLayout->addWidget(npTitle);
429437
auto npSubTitle = new QLabel(
430-
obs_module_text("MarketplaceWindow.Purchased.NoPurchasesSubtitle"),
438+
obs_module_text(
439+
"MarketplaceWindow.Purchased.NoPurchasesSubtitle"),
431440
noProducts);
432441
npSubTitle->setStyleSheet("QLabel {font-size: 13pt;}");
433442
npSubTitle->setAlignment(Qt::AlignCenter);
@@ -515,7 +524,8 @@ void ElgatoCloudWindow::initialize()
515524
auto loadingWidget = new LoadingWidget(this); // Loading widget, id: 3
516525
_stackedContent->addWidget(loadingWidget);
517526

518-
auto loginErrorWidget = new LoginError(this); // Login error widget, id: 4
527+
auto loginErrorWidget =
528+
new LoginError(this); // Login error widget, id: 4
519529
_stackedContent->addWidget(loginErrorWidget);
520530

521531
mainLayout->addWidget(_stackedContent);
@@ -709,13 +719,15 @@ LoginNeeded::LoginNeeded(QWidget *parent) : QWidget(parent)
709719
login->setAlignment(Qt::AlignCenter);
710720

711721
auto loginSub = new QLabel(this);
712-
loginSub->setText(obs_module_text("MarketplaceWindow.LoginNeeded.Subtitle"));
722+
loginSub->setText(
723+
obs_module_text("MarketplaceWindow.LoginNeeded.Subtitle"));
713724
loginSub->setWordWrap(true);
714725
loginSub->setAlignment(Qt::AlignCenter);
715726

716727
auto hLayout = new QHBoxLayout();
717728
auto loginButton = new QPushButton(this);
718-
loginButton->setText(obs_module_text("MarketplaceWindow.LoginButton.LogIn"));
729+
loginButton->setText(
730+
obs_module_text("MarketplaceWindow.LoginButton.LogIn"));
719731
loginButton->setHidden(elgatoCloud->loggedIn);
720732
loginButton->setStyleSheet(
721733
"QPushButton {font-size: 12pt; border-radius: 8px; padding: 8px; background-color: #232323; border: none; } "
@@ -732,7 +744,7 @@ LoginNeeded::LoginNeeded(QWidget *parent) : QWidget(parent)
732744
layout->addStretch();
733745
}
734746

735-
LoginError::LoginError(QWidget* parent) : QWidget(parent)
747+
LoginError::LoginError(QWidget *parent) : QWidget(parent)
736748
{
737749
auto layout = new QVBoxLayout(this);
738750

@@ -742,7 +754,8 @@ LoginError::LoginError(QWidget* parent) : QWidget(parent)
742754
login->setAlignment(Qt::AlignCenter);
743755

744756
auto loginSub = new QLabel(this);
745-
loginSub->setText(obs_module_text("MarketplaceWindow.LoginError.Subtitle"));
757+
loginSub->setText(
758+
obs_module_text("MarketplaceWindow.LoginError.Subtitle"));
746759
loginSub->setWordWrap(true);
747760
loginSub->setAlignment(Qt::AlignCenter);
748761

@@ -878,10 +891,12 @@ extern void CheckForUpdates(bool forceCheck)
878891
elgatoCloud->CheckUpdates(forceCheck);
879892
}
880893

881-
extern void CheckForUpdatesOnLaunch(enum obs_frontend_event event, void* private_data)
894+
extern void CheckForUpdatesOnLaunch(enum obs_frontend_event event,
895+
void *private_data)
882896
{
883897
if (event == OBS_FRONTEND_EVENT_FINISHED_LOADING) {
884-
obs_frontend_remove_event_callback(CheckForUpdatesOnLaunch, nullptr);
898+
obs_frontend_remove_event_callback(CheckForUpdatesOnLaunch,
899+
nullptr);
885900
CheckForUpdates(false);
886901
}
887902
}

src/elgato-widgets.cpp

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ VideoCaptureSourceSelector::VideoCaptureSourceSelector(QWidget *parent,
6363
_videoPreview->hide();
6464

6565
_blank = new QLabel(this);
66-
_blank->setText(
67-
obs_module_text("MarketplaceWindow.Settings.DefaultVideoDevice.NoneSelected"));
66+
_blank->setText(obs_module_text(
67+
"MarketplaceWindow.Settings.DefaultVideoDevice.NoneSelected"));
6868
_blank->setAlignment(Qt::AlignCenter);
6969
_blank->setFixedHeight(144);
7070

@@ -97,8 +97,8 @@ VideoCaptureSourceSelector::VideoCaptureSourceSelector(QWidget *parent,
9797
auto vSettings = obs_data_create();
9898
std::string id = _videoSourceIds[index];
9999
obs_data_set_string(vSettings,
100-
"video_device_id",
101-
id.c_str());
100+
"video_device_id",
101+
id.c_str());
102102
_changeSource(vSettings);
103103
obs_data_release(vSettings);
104104
} else {
@@ -163,15 +163,14 @@ void VideoCaptureSourceSelector::_setupTempSource(obs_data_t *videoData)
163163
void VideoCaptureSourceSelector::_changeSource(obs_data_t *vSettings)
164164
{
165165
if (vSettings != nullptr) {
166-
blog(LOG_INFO, "_changeSource called.");
167166
if (_videoCaptureSource) {
168-
obs_source_t* tmp = _videoCaptureSource;
167+
obs_source_t *tmp = _videoCaptureSource;
169168
_videoCaptureSource = nullptr;
170169
obs_source_release(tmp);
171170
}
172171

173-
const char* videoSourceId = "dshow_input";
174-
const char* vId = obs_get_latest_input_type_id(videoSourceId);
172+
const char *videoSourceId = "dshow_input";
173+
const char *vId = obs_get_latest_input_type_id(videoSourceId);
175174
_videoCaptureSource = obs_source_create_private(
176175
vId, "elgato-cloud-video-config", vSettings);
177176

@@ -183,12 +182,11 @@ void VideoCaptureSourceSelector::_changeSource(obs_data_t *vSettings)
183182
this->_videoPreview->hide();
184183
this->_blank->show();
185184
if (_videoCaptureSource) {
186-
obs_source_t* tmp = _videoCaptureSource;
185+
obs_source_t *tmp = _videoCaptureSource;
187186
_videoCaptureSource = nullptr;
188187
obs_source_release(tmp);
189188
}
190189
}
191-
192190
}
193191

194192
void VideoCaptureSourceSelector::DrawVideoPreview(void *data, uint32_t cx,

src/scene-bundle.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,6 @@ bool SceneBundle::FromCollection(std::string collection_name)
6969
std::string scene_collections_path = get_scene_collections_path();
7070
std::string file_name = get_current_scene_collection_filename();
7171
std::string collection_file_path = scene_collections_path + file_name;
72-
blog(LOG_INFO, "COLLECTION FILE PATH: %s",
73-
collection_file_path.c_str());
7472

7573
// Load the current collection file into a json object
7674
char *collection_str =
@@ -84,11 +82,9 @@ bool SceneBundle::FromCollection(std::string collection_name)
8482
}
8583

8684
bfree(collection_str);
87-
blog(LOG_INFO, "scripts...");
8885
for (auto &script : _collection["modules"]["scripts-tool"]) {
8986
_ProcessJsonObj(script);
9087
}
91-
blog(LOG_INFO, "sources...");
9288
for (auto &source : _collection["sources"]) {
9389
_ProcessJsonObj(source);
9490
}
@@ -160,7 +156,7 @@ void SceneBundle::ToCollection(std::string collection_name,
160156
curCollectionFileName =
161157
get_scene_collections_path() + curCollectionFileName;
162158

163-
char* ccpath = os_get_abs_path_ptr(curCollectionFileName.c_str());
159+
char *ccpath = os_get_abs_path_ptr(curCollectionFileName.c_str());
164160
std::string curCollectionPath = std::string(ccpath);
165161

166162
size_t pos = 0;
@@ -303,7 +299,6 @@ SceneBundleStatus SceneBundle::ToElgatoCloudFile(
303299

304300
ecFile.writestr("collection.json", collection_json);
305301
ecFile.writestr("bundle_info.json", bundleInfo_json);
306-
blog(LOG_INFO, "Adding files to zip...");
307302
// Write all assets to zip archive.
308303
for (const auto &file : _fileMap) {
309304
std::string oFilename = file.first;
@@ -539,8 +534,6 @@ bool SceneBundle::_AddFileToZip(std::string filePath, std::string zipPath,
539534
if (_interrupt) {
540535
return false;
541536
}
542-
blog(LOG_INFO, "Adding File %s as %s", filePath.c_str(),
543-
zipPath.c_str());
544537
ecFile.write(filePath, zipPath);
545538
return true;
546539
}

0 commit comments

Comments
 (0)