diff options
Diffstat (limited to 'src/mumble/UserLocalNicknameDialog.cpp')
-rw-r--r-- | src/mumble/UserLocalNicknameDialog.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/mumble/UserLocalNicknameDialog.cpp b/src/mumble/UserLocalNicknameDialog.cpp index 6c31a9cbb..bb2dea4e1 100644 --- a/src/mumble/UserLocalNicknameDialog.cpp +++ b/src/mumble/UserLocalNicknameDialog.cpp @@ -7,14 +7,11 @@ #include "ClientUser.h" #include "Database.h" #include "MainWindow.h" +#include "Global.h" #include <QtGui/QCloseEvent> #include <QtWidgets/QPushButton> -// We define a global macro called 'g'. This can lead to issues when included code uses 'g' as a type or parameter name -// (like protobuf 3.7 does). As such, for now, we have to make this our last include. -#include "Global.h" - UserLocalNicknameDialog::UserLocalNicknameDialog( unsigned int sessionId, std::unordered_map< unsigned int, NicknameDialogPtr > &qmUserNicknameTracker) @@ -35,7 +32,7 @@ UserLocalNicknameDialog::UserLocalNicknameDialog( m_originalNickname = qleUserLocalNickname->text(); } - if (g.mw && g.mw->windowFlags() & Qt::WindowStaysOnTopHint) { + if (Global::get().mw && Global::get().mw->windowFlags() & Qt::WindowStaysOnTopHint) { // If the main window is set to always be on top of other windows, we should make the // nickname dialog behave the same in order for it to not get hidden behind the main window. setWindowFlags(Qt::WindowStaysOnTopHint); @@ -56,7 +53,7 @@ void UserLocalNicknameDialog::present( } else { // Make sure to use the custom deleter for QObjects that calls deleteLater() on them instead of using // delete directly as the latter can lead to segmentation faults. - NicknameDialogPtr userNickname(new UserLocalNicknameDialog(sessionId, qmUserNicknameTracker), deleteQObject); + NicknameDialogPtr userNickname(new UserLocalNicknameDialog(sessionId, qmUserNicknameTracker), Mumble::QtUtils::deleteQObject); userNickname->show(); qmUserNicknameTracker.insert(std::make_pair(sessionId, std::move(userNickname))); } @@ -76,9 +73,9 @@ void UserLocalNicknameDialog::on_qbbUserLocalNickname_clicked(QAbstractButton *b ClientUser *user = ClientUser::get(m_clientSession); if (user) { if (!user->qsHash.isEmpty()) { - g.db->setUserLocalNickname(user->qsHash, user->getLocalNickname()); + Global::get().db->setUserLocalNickname(user->qsHash, user->getLocalNickname()); } else { - g.mw->logChangeNotPermanent(QObject::tr("Local Nickname Adjustment..."), user); + Global::get().mw->logChangeNotPermanent(QObject::tr("Local Nickname Adjustment..."), user); } } UserLocalNicknameDialog::close(); |