diff --git a/mythtv/libs/libmythui/DisplayResX.cpp b/mythtv/libs/libmythui/DisplayResX.cpp index 9d62ccc896a..20abfcc16af 100644 --- a/mythtv/libs/libmythui/DisplayResX.cpp +++ b/mythtv/libs/libmythui/DisplayResX.cpp @@ -20,15 +20,15 @@ static XRRScreenConfiguration *GetScreenConfig(MythXDisplay*& display); bool DisplayResX::IsAvailable(void) { - static bool checked = false; - static bool available = false; - if (!checked) + static bool s_checked = false; + static bool s_available = false; + if (!s_checked) { - checked = true; + s_checked = true; MythXDisplay display; - available = display.Open(); + s_available = display.Open(); } - return available; + return s_available; } DisplayResX::DisplayResX(void) diff --git a/mythtv/libs/libmythui/lirc_client.c b/mythtv/libs/libmythui/lirc_client.c index 9bffca90832..916e1aa3669 100644 --- a/mythtv/libs/libmythui/lirc_client.c +++ b/mythtv/libs/libmythui/lirc_client.c @@ -42,10 +42,10 @@ /* internal data structures */ struct filestack_t { - FILE *file; - char *name; - int line; - struct filestack_t *parent; + FILE *m_file; + char *m_name; + int m_line; + struct filestack_t *m_parent; }; enum packet_state @@ -805,10 +805,10 @@ static struct filestack_t *stack_push(const struct lirc_state *state, struct fil lirc_printf(state, "%s: out of memory\n",state->lirc_prog); return NULL; } - entry->file = NULL; - entry->name = NULL; - entry->line = 0; - entry->parent = parent; + entry->m_file = NULL; + entry->m_name = NULL; + entry->m_line = 0; + entry->m_parent = parent; return entry; } @@ -817,9 +817,9 @@ static struct filestack_t *stack_pop(struct filestack_t *entry) struct filestack_t *parent = NULL; if (entry) { - parent = entry->parent; - if (entry->name) - free(entry->name); + parent = entry->m_parent; + if (entry->m_name) + free(entry->m_name); free(entry); } return parent; @@ -965,13 +965,13 @@ static int lirc_readconfig_only_internal(const struct lirc_state *state, { return -1; } - filestack->file = lirc_open(state, file, NULL, &(filestack->name)); - if (filestack->file == NULL) + filestack->m_file = lirc_open(state, file, NULL, &(filestack->m_name)); + if (filestack->m_file == NULL) { stack_free(filestack); return -1; } - filestack->line = 0; + filestack->m_line = 0; int open_files = 1; struct lirc_config_entry *new_entry = NULL; @@ -981,14 +981,14 @@ static int lirc_readconfig_only_internal(const struct lirc_state *state, char *remote=LIRC_ALL; while (filestack) { - if((ret=lirc_readline(state,&string,filestack->file))==-1 || + if((ret=lirc_readline(state,&string,filestack->m_file))==-1 || string==NULL) { - fclose(filestack->file); + fclose(filestack->m_file); if(open_files == 1 && full_name != NULL) { - save_full_name = filestack->name; - filestack->name = NULL; + save_full_name = filestack->m_name; + filestack->m_name = NULL; } filestack = stack_pop(filestack); open_files--; @@ -1011,7 +1011,7 @@ static int lirc_readconfig_only_internal(const struct lirc_state *state, } } } - filestack->line++; + filestack->m_line++; char *eq=strchr(string,'='); if(eq==NULL) { @@ -1031,8 +1031,8 @@ static int lirc_readconfig_only_internal(const struct lirc_state *state, lirc_printf(state, "%s: too many files " "included at %s:%d\n", state->lirc_prog, - filestack->name, - filestack->line); + filestack->m_name, + filestack->m_line); ret=-1; } else @@ -1040,8 +1040,8 @@ static int lirc_readconfig_only_internal(const struct lirc_state *state, token2 = strtok_r(NULL, "", &strtok_state); token2 = lirc_trim(token2); lirc_parse_include - (token2, filestack->name, - filestack->line); + (token2, filestack->m_name, + filestack->m_line); struct filestack_t *stack_tmp = stack_push(state, filestack); if (stack_tmp == NULL) @@ -1050,9 +1050,9 @@ static int lirc_readconfig_only_internal(const struct lirc_state *state, } else { - stack_tmp->file = lirc_open(state, token2, filestack->name, &(stack_tmp->name)); - stack_tmp->line = 0; - if (stack_tmp->file) + stack_tmp->m_file = lirc_open(state, token2, filestack->m_name, &(stack_tmp->m_name)); + stack_tmp->m_line = 0; + if (stack_tmp->m_file) { open_files++; filestack = stack_tmp; @@ -1073,15 +1073,15 @@ static int lirc_readconfig_only_internal(const struct lirc_state *state, (token3=strtok_r(NULL," \t",&strtok_state))!=NULL) { lirc_printf(state, "%s: unexpected token in line %s:%d\n", - state->lirc_prog,filestack->name,filestack->line); + state->lirc_prog,filestack->m_name,filestack->m_line); } else { ret=lirc_mode(state, token,token2,&mode, &new_entry,&first,&last, check, - filestack->name, - filestack->line); + filestack->m_name, + filestack->m_line); if(ret==0) { if(remote!=LIRC_ALL) @@ -1117,7 +1117,7 @@ static int lirc_readconfig_only_internal(const struct lirc_state *state, else if(new_entry==NULL) { lirc_printf(state, "%s: bad file format, %s:%d\n", - state->lirc_prog,filestack->name,filestack->line); + state->lirc_prog,filestack->m_name,filestack->m_line); ret=-1; } else @@ -1246,7 +1246,7 @@ static int lirc_readconfig_only_internal(const struct lirc_state *state, } else { - lirc_parse_string(state,token2,filestack->name,filestack->line); + lirc_parse_string(state,token2,filestack->m_name,filestack->m_line); new_list->string=token2; new_list->next=NULL; if(new_entry->config==NULL) @@ -1275,7 +1275,7 @@ static int lirc_readconfig_only_internal(const struct lirc_state *state, { free(token2); lirc_printf(state, "%s: unknown token \"%s\" in %s:%d ignored\n", - state->lirc_prog,token,filestack->name,filestack->line); + state->lirc_prog,token,filestack->m_name,filestack->m_line); } } } @@ -1636,19 +1636,19 @@ int lirc_code2char(const struct lirc_state *state, struct lirc_config *config,ch char* command = malloc((10+strlen(code)+1+1) * sizeof(char)); if (command == NULL) return LIRC_RET_ERROR; - static char buf[LIRC_PACKET_SIZE]; + static char s_buf[LIRC_PACKET_SIZE]; size_t buf_len = LIRC_PACKET_SIZE; int success = LIRC_RET_ERROR; sprintf(command, "CODE %s\n", code); int ret = lirc_send_command(state, config->sockfd, command, - buf, &buf_len, &success); + s_buf, &buf_len, &success); if(success == LIRC_RET_SUCCESS) { if(ret > 0) { - *string = buf; + *string = s_buf; } else { @@ -1774,14 +1774,14 @@ char *lirc_nextir(struct lirc_state *state) int lirc_nextcode(struct lirc_state *state, char **code) { - static int packet_size=PACKET_SIZE; - static int end_len=0; + static int s_packetSize=PACKET_SIZE; + static int s_endLen=0; char *end = NULL, c = '\0'; *code=NULL; if(state->lirc_buffer==NULL) { - state->lirc_buffer=(char *) malloc(packet_size+1); + state->lirc_buffer=(char *) malloc(s_packetSize+1); if(state->lirc_buffer==NULL) { lirc_printf(state, "%s: out of memory\n",state->lirc_prog); @@ -1791,24 +1791,24 @@ int lirc_nextcode(struct lirc_state *state, char **code) } while((end=strchr(state->lirc_buffer,'\n'))==NULL) { - if(end_len>=packet_size) + if(s_endLen>=s_packetSize) { - packet_size+=PACKET_SIZE; - char *new_buffer=(char *) realloc(state->lirc_buffer,packet_size+1); + s_packetSize+=PACKET_SIZE; + char *new_buffer=(char *) realloc(state->lirc_buffer,s_packetSize+1); if(new_buffer==NULL) { return(-1); } state->lirc_buffer=new_buffer; } - ssize_t len=read(state->lirc_lircd,state->lirc_buffer+end_len,packet_size-end_len); + ssize_t len=read(state->lirc_lircd,state->lirc_buffer+s_endLen,s_packetSize-s_endLen); if(len<=0) { if(len==-1 && errno==EAGAIN) return(0); return(-1); } - end_len+=len; - state->lirc_buffer[end_len]=0; + s_endLen+=len; + state->lirc_buffer[s_endLen]=0; /* return if next code not yet available completely */ if(strchr(state->lirc_buffer,'\n')==NULL) { @@ -1824,12 +1824,12 @@ int lirc_nextcode(struct lirc_state *state, char **code) // // cppcheck-suppress nullPointerArithmeticRedundantCheck end++; - end_len=strlen(end); + s_endLen=strlen(end); c=end[0]; end[0]=0; *code=strdup(state->lirc_buffer); end[0]=c; - memmove(state->lirc_buffer,end,end_len+1); + memmove(state->lirc_buffer,end,s_endLen+1); if(*code==NULL) return(-1); return(0); } @@ -1848,17 +1848,17 @@ const char *lirc_getmode(const struct lirc_state *state, struct lirc_config *con { if(config->sockfd!=-1) { - static char buf[LIRC_PACKET_SIZE]; + static char s_buf[LIRC_PACKET_SIZE]; size_t buf_len = LIRC_PACKET_SIZE; int success = LIRC_RET_ERROR; int ret = lirc_send_command(state, config->sockfd, "GETMODE\n", - buf, &buf_len, &success); + s_buf, &buf_len, &success); if(success == LIRC_RET_SUCCESS) { if(ret > 0) { - return buf; + return s_buf; } return NULL; } @@ -1871,7 +1871,7 @@ const char *lirc_setmode(const struct lirc_state *state, struct lirc_config *con { if(config->sockfd!=-1) { - static char buf[LIRC_PACKET_SIZE]; + static char s_buf[LIRC_PACKET_SIZE]; size_t buf_len = LIRC_PACKET_SIZE; int success = LIRC_RET_ERROR; char cmd[LIRC_PACKET_SIZE]; @@ -1884,12 +1884,12 @@ const char *lirc_setmode(const struct lirc_state *state, struct lirc_config *con } int ret = lirc_send_command(state, config->sockfd, cmd, - buf, &buf_len, &success); + s_buf, &buf_len, &success); if(success == LIRC_RET_SUCCESS) { if(ret > 0) { - return buf; + return s_buf; } return NULL; } @@ -1903,26 +1903,26 @@ const char *lirc_setmode(const struct lirc_state *state, struct lirc_config *con static const char *lirc_read_string(const struct lirc_state *state, int fd) { - static char buffer[LIRC_PACKET_SIZE+1]=""; + static char s_buffer[LIRC_PACKET_SIZE+1]=""; char *end = NULL; - static size_t head=0, tail=0; + static size_t s_head=0, s_tail=0; int ret = 0; ssize_t n = 0; fd_set fds; struct timeval tv; - if(head>0) + if(s_head>0) { - memmove(buffer,buffer+head,tail-head+1); - tail-=head; - head=0; - end=strchr(buffer,'\n'); + memmove(s_buffer,s_buffer+s_head,s_tail-s_head+1); + s_tail-=s_head; + s_head=0; + end=strchr(s_buffer,'\n'); } else { end=NULL; } - if(strlen(buffer)!=tail) + if(strlen(s_buffer)!=s_tail) { lirc_printf(state, "%s: protocol error\n", state->lirc_prog); goto lirc_read_string_error; @@ -1930,7 +1930,7 @@ static const char *lirc_read_string(const struct lirc_state *state, int fd) while(end==NULL) { - if(LIRC_PACKET_SIZE<=tail) + if(LIRC_PACKET_SIZE<=s_tail) { lirc_printf(state, "%s: bad packet\n", state->lirc_prog); goto lirc_read_string_error; @@ -1957,25 +1957,25 @@ static const char *lirc_read_string(const struct lirc_state *state, int fd) goto lirc_read_string_error; } - n=read(fd, buffer+tail, LIRC_PACKET_SIZE-tail); + n=read(fd, s_buffer+s_tail, LIRC_PACKET_SIZE-s_tail); if(n<=0) { lirc_printf(state, "%s: read() failed\n", state->lirc_prog); lirc_perror(state, state->lirc_prog); goto lirc_read_string_error; } - buffer[tail+n]=0; - tail+=n; - end=strchr(buffer,'\n'); + s_buffer[s_tail+n]=0; + s_tail+=n; + end=strchr(s_buffer,'\n'); } end[0]=0; - head=strlen(buffer)+1; - return(buffer); + s_head=strlen(s_buffer)+1; + return(s_buffer); lirc_read_string_error: - head=tail=0; - buffer[0]=0; + s_head=s_tail=0; + s_buffer[0]=0; return(NULL); } diff --git a/mythtv/libs/libmythui/mythdisplay.cpp b/mythtv/libs/libmythui/mythdisplay.cpp index 5dd307856ee..5dafbfd5256 100644 --- a/mythtv/libs/libmythui/mythdisplay.cpp +++ b/mythtv/libs/libmythui/mythdisplay.cpp @@ -22,13 +22,13 @@ static float fix_rate(int video_rate) { - static const float default_rate = 1000000.0F / 60.0F; - float fixed = default_rate; + static constexpr float kDefaultRate = 1000000.0F / 60.0F; + float fixed = kDefaultRate; if (video_rate > 0) { fixed = static_cast(video_rate) / 2.0F; - if (fixed < default_rate) - fixed = default_rate; + if (fixed < kDefaultRate) + fixed = kDefaultRate; } return fixed; } diff --git a/mythtv/libs/libmythui/mythfontproperties.cpp b/mythtv/libs/libmythui/mythfontproperties.cpp index d10305ef861..bd445441850 100644 --- a/mythtv/libs/libmythui/mythfontproperties.cpp +++ b/mythtv/libs/libmythui/mythfontproperties.cpp @@ -175,7 +175,7 @@ MythFontProperties *MythFontProperties::ParseFromXml( { // Crappy, but cached. Move to GlobalFontMap? - static bool show_available = true; + static bool s_showAvailable = true; bool fromBase = false; MythFontProperties *newFont = new MythFontProperties(); newFont->Freeze(); @@ -438,7 +438,7 @@ MythFontProperties *MythFontProperties::ParseFromXml( QString("Failed to load '%1', got '%2' instead") .arg(newFont->m_face.family()).arg(fi.family())); - if (show_available) + if (s_showAvailable) { LOG(VB_GUI, LOG_DEBUG, "Available fonts:"); @@ -468,7 +468,7 @@ MythFontProperties *MythFontProperties::ParseFromXml( } LOG(VB_GUI, LOG_DEBUG, family_styles.join(" ")); } - show_available = false; + s_showAvailable = false; } } else diff --git a/mythtv/libs/libmythui/mythmainwindow.cpp b/mythtv/libs/libmythui/mythmainwindow.cpp index 622b611e323..fd817fa33f4 100644 --- a/mythtv/libs/libmythui/mythmainwindow.cpp +++ b/mythtv/libs/libmythui/mythmainwindow.cpp @@ -111,16 +111,16 @@ class KeyContext struct JumpData { - void (*callback)(void); - QString destination; - QString description; - bool exittomain; - QString localAction; + void (*m_callback)(void); + QString m_destination; + QString m_description; + bool m_exittomain; + QString m_localAction; }; struct MPData { - QString description; - MediaPlayCallback playFn; + QString m_description; + MediaPlayCallback m_playFn; }; class MythMainWindowPrivate @@ -143,10 +143,10 @@ class MythMainWindowPrivate int m_xbase {0}; int m_ybase {0}; - bool m_does_fill_screen {false}; + bool m_doesFillScreen {false}; - bool m_ignore_lirc_keys {false}; - bool m_ignore_joystick_keys {false}; + bool m_ignoreLircKeys {false}; + bool m_ignoreJoystickKeys {false}; LIRC *m_lircThread {nullptr}; @@ -175,10 +175,10 @@ class MythMainWindowPrivate QMap m_mediaPluginMap; QHash > m_actionText; - void (*exitmenucallback)(void) {nullptr}; + void (*m_exitMenuCallback)(void) {nullptr}; - void (*exitmenumediadevicecallback)(MythMediaDevice* mediadevice) {nullptr}; - MythMediaDevice * mediadeviceforcallback {nullptr}; + void (*m_exitMenuMediaDeviceCallback)(MythMediaDevice* mediadevice) {nullptr}; + MythMediaDevice * m_mediaDeviceForCallback {nullptr}; int m_escapekey {0}; @@ -192,7 +192,7 @@ class MythMainWindowPrivate MythPainter *m_painter {nullptr}; MythRender *m_render {nullptr}; - bool m_AllowInput {true}; + bool m_allowInput {true}; QRegion m_repaintRegion; @@ -224,7 +224,7 @@ class MythMainWindowPrivate bool m_standby {false}; bool m_enteringStandby {false}; bool m_disableIdle {false}; - MythNotificationCenter *m_NC {nullptr}; + MythNotificationCenter *m_nc {nullptr}; // window aspect bool m_firstinit {true}; bool m_bSavedPOS {false}; @@ -408,7 +408,7 @@ MythMainWindow::MythMainWindow(const bool useDB) setObjectName("mainwindow"); - d->m_AllowInput = false; + d->m_allowInput = false; // This prevents database errors from RegisterKey() when there is no DB: d->m_useDB = useDB; @@ -420,13 +420,13 @@ MythMainWindow::MythMainWindow(const bool useDB) //Init(); - d->m_ignore_lirc_keys = false; - d->m_ignore_joystick_keys = false; + d->m_ignoreLircKeys = false; + d->m_ignoreJoystickKeys = false; d->m_exitingtomain = false; d->m_popwindows = true; - d->exitmenucallback = nullptr; - d->exitmenumediadevicecallback = nullptr; - d->mediadeviceforcallback = nullptr; + d->m_exitMenuCallback = nullptr; + d->m_exitMenuMediaDeviceCallback = nullptr; + d->m_mediaDeviceForCallback = nullptr; d->m_escapekey = Qt::Key_Escape; d->m_mainStack = nullptr; d->m_sysEventHandler = nullptr; @@ -437,7 +437,7 @@ MythMainWindow::MythMainWindow(const bool useDB) StartLIRC(); #ifdef USE_JOYSTICK_MENU - d->m_ignore_joystick_keys = false; + d->m_ignoreJoystickKeys = false; QString joy_config_file = GetConfDir() + "/joystickmenurc"; @@ -490,7 +490,7 @@ MythMainWindow::MythMainWindow(const bool useDB) d->m_drawTimer = new MythSignalingTimer(this, SLOT(animate())); d->m_drawTimer->start(d->m_drawInterval); - d->m_AllowInput = true; + d->m_allowInput = true; d->m_repaintRegion = QRegion(QRect(0,0,0,0)); @@ -581,7 +581,7 @@ MythMainWindow::~MythMainWindow() delete d->m_cecAdapter; #endif - delete d->m_NC; + delete d->m_nc; delete d->m_painter; // Don't delete. If the app is closing down it causes intermittent segfaults @@ -598,7 +598,7 @@ MythPainter *MythMainWindow::GetCurrentPainter(void) MythNotificationCenter *MythMainWindow::GetCurrentNotificationCenter(void) { - return d->m_NC; + return d->m_nc; } QWidget *MythMainWindow::GetPaintWindow(void) @@ -984,7 +984,7 @@ void MythMainWindow::Init(const QString& forcedpainter, bool mayReInit) GetMythUI()->GetScreenSettings(d->m_xbase, d->m_screenwidth, d->m_wmult, d->m_ybase, d->m_screenheight, d->m_hmult); - d->m_does_fill_screen = + d->m_doesFillScreen = (GetMythDB()->GetNumSetting("GuiOffsetX") == 0 && GetMythDB()->GetNumSetting("GuiWidth") == 0 && GetMythDB()->GetNumSetting("GuiOffsetY") == 0 && @@ -994,7 +994,7 @@ void MythMainWindow::Init(const QString& forcedpainter, bool mayReInit) Qt::WindowFlags flags = Qt::Window; bool inwindow = GetMythDB()->GetBoolSetting("RunFrontendInWindow", false); - bool fullscreen = d->m_does_fill_screen && !MythUIHelper::IsGeometryOverridden(); + bool fullscreen = d->m_doesFillScreen && !MythUIHelper::IsGeometryOverridden(); // On Compiz/Unit, when the window is fullscreen and frameless changing // screen position ends up stuck. Adding a border temporarily prevents this @@ -1173,9 +1173,9 @@ void MythMainWindow::Init(const QString& forcedpainter, bool mayReInit) else d->m_themeBase = new MythThemeBase(); - if (!d->m_NC) + if (!d->m_nc) { - d->m_NC = new MythNotificationCenter(); + d->m_nc = new MythNotificationCenter(); } } @@ -1379,7 +1379,7 @@ void MythMainWindow::ReinitDone(void) void MythMainWindow::Show(void) { bool inwindow = GetMythDB()->GetBoolSetting("RunFrontendInWindow", false); - bool fullscreen = d->m_does_fill_screen && !MythUIHelper::IsGeometryOverridden(); + bool fullscreen = d->m_doesFillScreen && !MythUIHelper::IsGeometryOverridden(); if (fullscreen && !inwindow && !d->m_firstinit) { @@ -1392,7 +1392,7 @@ void MythMainWindow::Show(void) d->m_firstinit = false; #ifdef Q_WS_MACX_OLDQT - if (d->m_does_fill_screen) + if (d->m_doesFillScreen) HideMenuBar(); else ShowMenuBar(); @@ -1518,17 +1518,17 @@ void MythMainWindow::ExitToMainMenu(void) { d->m_exitingtomain = false; d->m_popwindows = true; - if (d->exitmenucallback) + if (d->m_exitMenuCallback) { - void (*callback)(void) = d->exitmenucallback; - d->exitmenucallback = nullptr; + void (*callback)(void) = d->m_exitMenuCallback; + d->m_exitMenuCallback = nullptr; callback(); } - else if (d->exitmenumediadevicecallback) + else if (d->m_exitMenuMediaDeviceCallback) { - void (*callback)(MythMediaDevice*) = d->exitmenumediadevicecallback; - MythMediaDevice * mediadevice = d->mediadeviceforcallback; - d->mediadeviceforcallback = nullptr; + void (*callback)(MythMediaDevice*) = d->m_exitMenuMediaDeviceCallback; + MythMediaDevice * mediadevice = d->m_mediaDeviceForCallback; + d->m_mediaDeviceForCallback = nullptr; callback(mediadevice); } } @@ -1581,27 +1581,27 @@ bool MythMainWindow::TranslateKeyPress(const QString &context, QStringList localActions; if (allowJumps && (d->m_jumpMap.count(keynum) > 0) && - (!d->m_jumpMap[keynum]->localAction.isEmpty()) && + (!d->m_jumpMap[keynum]->m_localAction.isEmpty()) && (d->m_keyContexts.value(context)) && (d->m_keyContexts.value(context)->GetMapping(keynum, localActions))) { - if (localActions.contains(d->m_jumpMap[keynum]->localAction)) + if (localActions.contains(d->m_jumpMap[keynum]->m_localAction)) allowJumps = false; } if (allowJumps && d->m_jumpMap.count(keynum) > 0 && - !d->m_jumpMap[keynum]->exittomain && d->exitmenucallback == nullptr) + !d->m_jumpMap[keynum]->m_exittomain && d->m_exitMenuCallback == nullptr) { - void (*callback)(void) = d->m_jumpMap[keynum]->callback; + void (*callback)(void) = d->m_jumpMap[keynum]->m_callback; callback(); return true; } if (allowJumps && - d->m_jumpMap.count(keynum) > 0 && d->exitmenucallback == nullptr) + d->m_jumpMap.count(keynum) > 0 && d->m_exitMenuCallback == nullptr) { d->m_exitingtomain = true; - d->exitmenucallback = d->m_jumpMap[keynum]->callback; + d->m_exitMenuCallback = d->m_jumpMap[keynum]->m_callback; QCoreApplication::postEvent( this, new QEvent(MythEvent::kExitToMainMenuEventType)); return true; @@ -1790,7 +1790,7 @@ void MythMainWindow::ClearJump(const QString &destination) { it.next(); JumpData *jd = it.value(); - if (jd->destination == destination) + if (jd->m_destination == destination) it.remove(); } } @@ -1890,11 +1890,11 @@ void MythMainWindow::ClearAllJumps() void MythMainWindow::JumpTo(const QString& destination, bool pop) { - if (d->m_destinationMap.count(destination) > 0 && d->exitmenucallback == nullptr) + if (d->m_destinationMap.count(destination) > 0 && d->m_exitMenuCallback == nullptr) { d->m_exitingtomain = true; d->m_popwindows = pop; - d->exitmenucallback = d->m_destinationMap[destination].callback; + d->m_exitMenuCallback = d->m_destinationMap[destination].m_callback; QCoreApplication::postEvent( this, new QEvent(MythEvent::kExitToMainMenuEventType)); return; @@ -1945,7 +1945,7 @@ bool MythMainWindow::HandleMedia(const QString &handler, const QString &mrl, // Let's see if we have a plugin that matches the handler name... if (d->m_mediaPluginMap.count(lhandler)) { - d->m_mediaPluginMap[lhandler].playFn(mrl, plot, title, subtitle, + d->m_mediaPluginMap[lhandler].m_playFn(mrl, plot, title, subtitle, director, season, episode, inetref, lenMins, year, id, useBookmarks); @@ -1994,7 +1994,7 @@ void MythMainWindow::HandleCallback(const QString &Debug, MythCallbackEvent::Cal void MythMainWindow::AllowInput(bool allow) { - d->m_AllowInput = allow; + d->m_allowInput = allow; } void MythMainWindow::mouseTimeout(void) @@ -2116,7 +2116,7 @@ bool MythMainWindow::keyLongPressFilter(QEvent **e, bool MythMainWindow::eventFilter(QObject * /*watched*/, QEvent *e) { /* Don't let anything through if input is disallowed. */ - if (!d->m_AllowInput) + if (!d->m_allowInput) return true; QScopedPointer sNewEvent(nullptr); @@ -2415,7 +2415,7 @@ void MythMainWindow::customEvent(QEvent *ce) } #if defined(USE_LIRC) || defined(USING_APPLEREMOTE) else if (ce->type() == LircKeycodeEvent::kEventType && - !d->m_ignore_lirc_keys) + !d->m_ignoreLircKeys) { LircKeycodeEvent *lke = static_cast(ce); @@ -2445,7 +2445,7 @@ void MythMainWindow::customEvent(QEvent *ce) #endif #ifdef USE_JOYSTICK_MENU else if (ce->type() == JoystickKeycodeEvent::kEventType && - !d->m_ignore_joystick_keys) + !d->m_ignoreJoystickKeys) { JoystickKeycodeEvent *jke = static_cast(ce); int keycode = jke->getKeycode(); @@ -2837,11 +2837,11 @@ void MythMainWindow::LockInputDevices( bool locked ) LOG(VB_GENERAL, LOG_INFO, "Unlocking input devices"); #ifdef USE_LIRC - d->m_ignore_lirc_keys = locked; + d->m_ignoreLircKeys = locked; #endif #ifdef USE_JOYSTICK_MENU - d->m_ignore_joystick_keys = locked; + d->m_ignoreJoystickKeys = locked; #endif } diff --git a/mythtv/libs/libmythui/mythpainter_qt.cpp b/mythtv/libs/libmythui/mythpainter_qt.cpp index e53bff1229a..49a7caa101a 100644 --- a/mythtv/libs/libmythui/mythpainter_qt.cpp +++ b/mythtv/libs/libmythui/mythpainter_qt.cpp @@ -19,14 +19,14 @@ class MythQtImage : public MythImage MythImage(parent, "MythQtImage") { } void SetChanged(bool change = true) override; // MythImage - QPixmap *GetPixmap(void) { return m_Pixmap; } - void SetPixmap(QPixmap *p) { m_Pixmap = p; } + QPixmap *GetPixmap(void) { return m_pixmap; } + void SetPixmap(QPixmap *p) { m_pixmap = p; } bool NeedsRegen(void) { return m_bRegenPixmap; } void RegeneratePixmap(void); protected: - QPixmap *m_Pixmap {nullptr}; + QPixmap *m_pixmap {nullptr}; bool m_bRegenPixmap {false}; }; @@ -42,12 +42,12 @@ void MythQtImage::RegeneratePixmap(void) { // We allocate the pixmap here so it is done in the UI // thread since QPixmap uses non-reentrant X calls. - if (!m_Pixmap) - m_Pixmap = new QPixmap; + if (!m_pixmap) + m_pixmap = new QPixmap; - if (m_Pixmap) + if (m_pixmap) { - *m_Pixmap = QPixmap::fromImage(*((QImage *)this)); + *m_pixmap = QPixmap::fromImage(*((QImage *)this)); m_bRegenPixmap = false; } } diff --git a/mythtv/libs/libmythui/mythprogressdialog.cpp b/mythtv/libs/libmythui/mythprogressdialog.cpp index e9d20ace98b..3cd409b1288 100644 --- a/mythtv/libs/libmythui/mythprogressdialog.cpp +++ b/mythtv/libs/libmythui/mythprogressdialog.cpp @@ -90,22 +90,22 @@ MythUIBusyDialog *ShowBusyPopup(const QString &message) { QString LOC = "ShowBusyPopup('" + message + "') - "; MythUIBusyDialog *pop = nullptr; - static MythScreenStack *stk = nullptr; + static MythScreenStack *s_stk = nullptr; - if (!stk) + if (!s_stk) { MythMainWindow *win = GetMythMainWindow(); if (win) - stk = win->GetStack("popup stack"); + s_stk = win->GetStack("popup stack"); else { LOG(VB_GENERAL, LOG_ERR, LOC + "no main window?"); return nullptr; } - if (!stk) + if (!s_stk) { LOG(VB_GENERAL, LOG_ERR, LOC + "no popup stack? " "Is there a MythThemeBase?"); @@ -113,9 +113,9 @@ MythUIBusyDialog *ShowBusyPopup(const QString &message) } } - pop = new MythUIBusyDialog(message, stk, "showBusyPopup"); + pop = new MythUIBusyDialog(message, s_stk, "showBusyPopup"); if (pop->Create()) - stk->AddScreen(pop); + s_stk->AddScreen(pop); return pop; } diff --git a/mythtv/libs/libmythui/mythuiguidegrid.cpp b/mythtv/libs/libmythui/mythuiguidegrid.cpp index 5982b023845..1ddac8fa72e 100644 --- a/mythtv/libs/libmythui/mythuiguidegrid.cpp +++ b/mythtv/libs/libmythui/mythuiguidegrid.cpp @@ -505,8 +505,8 @@ void MythUIGuideGrid::drawBox(MythPainter *p, int xoffset, int yoffset, UIGTCon area.translate(xoffset, yoffset); // Convert to global coordinates area.adjust(breakin, breakin, -breakin, -breakin); - static const QPen nopen(Qt::NoPen); - p->DrawRect(area, QBrush(calcColor(color, m_categoryAlpha)), nopen, alphaMod); + static const QPen kNoPen(Qt::NoPen); + p->DrawRect(area, QBrush(calcColor(color, m_categoryAlpha)), kNoPen, alphaMod); } /** \fn MythUIGuideGrid::drawBackground(MythPainter *, int, int, UIGTCon *, int) @@ -602,13 +602,13 @@ void MythUIGuideGrid::drawBackground(MythPainter *p, int xoffset, int yoffset, U if (area.height() <= 1) area.setHeight(2); - static const QPen nopen(Qt::NoPen); + static const QPen kNoPen(Qt::NoPen); area.translate(xoffset, yoffset); // Convert to global coordinates - p->DrawRect(area, QBrush(fillColor), nopen, alphaMod); + p->DrawRect(area, QBrush(fillColor), kNoPen, alphaMod); if (overArea.width() > 0) { overArea.translate(xoffset, yoffset); // Convert to global coordinates - p->DrawRect(overArea, QBrush(overColor), nopen, alphaMod); + p->DrawRect(overArea, QBrush(overColor), kNoPen, alphaMod); } } diff --git a/mythtv/libs/libmythui/mythuihelper.cpp b/mythtv/libs/libmythui/mythuihelper.cpp index 0dffc1d66d7..f21d85d7cd1 100644 --- a/mythtv/libs/libmythui/mythuihelper.cpp +++ b/mythtv/libs/libmythui/mythuihelper.cpp @@ -95,7 +95,7 @@ class MythUIHelperPrivate explicit MythUIHelperPrivate(MythUIHelper *p) : m_cacheLock(new QMutex(QMutex::Recursive)), m_imageThreadPool(new MThreadPool("MythUIHelper")), - parent(p) {} + m_parent(p) {} ~MythUIHelperPrivate(); void Init(); @@ -168,14 +168,14 @@ class MythUIHelperPrivate ScreenSaverControl *m_screensaver {nullptr}; bool m_screensaverEnabled {false}; - DisplayRes *m_display_res {nullptr}; + DisplayRes *m_displayRes {nullptr}; bool m_screenSetup {false}; MThreadPool *m_imageThreadPool {nullptr}; - MythUIMenuCallbacks callbacks {nullptr,nullptr,nullptr,nullptr,nullptr}; + MythUIMenuCallbacks m_callbacks {nullptr,nullptr,nullptr,nullptr,nullptr}; - MythUIHelper *parent {nullptr}; + MythUIHelper *m_parent {nullptr}; int m_fontStretch {100}; @@ -205,7 +205,7 @@ MythUIHelperPrivate::~MythUIHelperPrivate() delete m_imageThreadPool; delete m_screensaver; - if (m_display_res) + if (m_displayRes) DisplayRes::SwitchToDesktop(); } @@ -362,7 +362,7 @@ double MythUIHelperPrivate::GetPixelAspectRatio(void) { if (m_pixelAspectRatio < 0) { - if (!m_display_res) + if (!m_displayRes) { DisplayRes *dispRes = DisplayRes::GetDisplayRes(); // create singleton @@ -372,7 +372,7 @@ double MythUIHelperPrivate::GetPixelAspectRatio(void) m_pixelAspectRatio = 1.0; } else - m_pixelAspectRatio = m_display_res->GetPixelAspectRatio(); + m_pixelAspectRatio = m_displayRes->GetPixelAspectRatio(); } return m_pixelAspectRatio; @@ -409,7 +409,7 @@ MythUIHelper::~MythUIHelper() void MythUIHelper::Init(MythUIMenuCallbacks &cbs) { d->Init(); - d->callbacks = cbs; + d->m_callbacks = cbs; d->m_maxCacheSize.fetchAndStoreRelease( GetMythDB()->GetNumSetting("UIImageCacheSize", 30) * 1024 * 1024); @@ -430,7 +430,7 @@ void MythUIHelper::Init(void) MythUIMenuCallbacks *MythUIHelper::GetMenuCBs(void) { - return &(d->callbacks); + return &(d->m_callbacks); } bool MythUIHelper::IsScreenSetup(void) @@ -454,11 +454,11 @@ void MythUIHelper::LoadQtConfig(void) if (dispRes) { - d->m_display_res = dispRes; + d->m_displayRes = dispRes; // Make sure DisplayRes has current context info - d->m_display_res->Initialize(); + d->m_displayRes->Initialize(); // Switch to desired GUI resolution - if (d->m_display_res->SwitchToGUI()) + if (d->m_displayRes->SwitchToGUI()) { d->WaitForScreenChange(); } @@ -762,19 +762,19 @@ bool MythUIHelper::IsImageInCache(const QString &url) QString MythUIHelper::GetThemeCacheDir(void) { - static QString oldcachedir; + static QString s_oldcachedir; QString tmpcachedir = GetThemeBaseCacheDir() + "/" + GetMythDB()->GetSetting("Theme", DEFAULT_UI_THEME) + "." + QString::number(d->m_screenwidth) + "." + QString::number(d->m_screenheight); - if (tmpcachedir != oldcachedir) + if (tmpcachedir != s_oldcachedir) { LOG(VB_GUI | VB_FILE, LOG_INFO, LOC + QString("Creating cache dir: %1").arg(tmpcachedir)); QDir dir; dir.mkdir(tmpcachedir); - oldcachedir = tmpcachedir; + s_oldcachedir = tmpcachedir; } return tmpcachedir; } diff --git a/mythtv/libs/libmythui/mythuiimage.cpp b/mythtv/libs/libmythui/mythuiimage.cpp index f36dcb06372..16c542a2cec 100644 --- a/mythtv/libs/libmythui/mythuiimage.cpp +++ b/mythtv/libs/libmythui/mythuiimage.cpp @@ -544,7 +544,7 @@ class MythUIImagePrivate MythUIImage *m_parent {nullptr}; - QReadWriteLock m_UpdateLock {QReadWriteLock::Recursive}; + QReadWriteLock m_updateLock {QReadWriteLock::Recursive}; }; ///////////////////////////////////////////////////////////////// @@ -612,7 +612,7 @@ MythUIImage::~MythUIImage() */ void MythUIImage::Clear(void) { - QWriteLocker updateLocker(&d->m_UpdateLock); + QWriteLocker updateLocker(&d->m_updateLock); QMutexLocker locker(&m_ImagesLock); while (!m_Images.isEmpty()) @@ -640,7 +640,7 @@ void MythUIImage::Clear(void) */ void MythUIImage::Reset(void) { - d->m_UpdateLock.lockForWrite(); + d->m_updateLock.lockForWrite(); SetMinArea(MythRect()); @@ -657,11 +657,11 @@ void MythUIImage::Reset(void) } emit DependChanged(true); - d->m_UpdateLock.unlock(); + d->m_updateLock.unlock(); Load(); } else - d->m_UpdateLock.unlock(); + d->m_updateLock.unlock(); MythUIType::Reset(); } @@ -671,7 +671,7 @@ void MythUIImage::Reset(void) */ void MythUIImage::SetFilename(const QString &filename) { - QWriteLocker updateLocker(&d->m_UpdateLock); + QWriteLocker updateLocker(&d->m_updateLock); m_imageProperties.m_isThemeImage = false; m_imageProperties.m_filename = filename; if (filename == m_OrigFilename) @@ -687,7 +687,7 @@ void MythUIImage::SetFilename(const QString &filename) void MythUIImage::SetFilepattern(const QString &filepattern, int low, int high) { - QWriteLocker updateLocker(&d->m_UpdateLock); + QWriteLocker updateLocker(&d->m_updateLock); m_imageProperties.m_isThemeImage = false; m_imageProperties.m_filename = filepattern; m_LowNum = low; @@ -703,7 +703,7 @@ void MythUIImage::SetFilepattern(const QString &filepattern, int low, */ void MythUIImage::SetImageCount(int low, int high) { - QWriteLocker updateLocker(&d->m_UpdateLock); + QWriteLocker updateLocker(&d->m_updateLock); m_LowNum = low; m_HighNum = high; } @@ -713,7 +713,7 @@ void MythUIImage::SetImageCount(int low, int high) */ void MythUIImage::SetDelay(int delayms) { - QWriteLocker updateLocker(&d->m_UpdateLock); + QWriteLocker updateLocker(&d->m_updateLock); m_Delay = delayms; m_LastDisplay = QTime::currentTime(); m_CurPos = 0; @@ -724,7 +724,7 @@ void MythUIImage::SetDelay(int delayms) */ void MythUIImage::SetDelays(QVector delays) { - QWriteLocker updateLocker(&d->m_UpdateLock); + QWriteLocker updateLocker(&d->m_updateLock); QMutexLocker imageLocker(&m_ImagesLock); for (auto it = delays.begin(); it != delays.end(); ++it) @@ -743,11 +743,11 @@ void MythUIImage::SetDelays(QVector delays) */ void MythUIImage::SetImage(MythImage *img) { - d->m_UpdateLock.lockForWrite(); + d->m_updateLock.lockForWrite(); if (!img) { - d->m_UpdateLock.unlock(); + d->m_updateLock.unlock(); Reset(); return; } @@ -793,7 +793,7 @@ void MythUIImage::SetImage(MythImage *img) m_Initiator = m_EnableInitiator; SetRedraw(); - d->m_UpdateLock.unlock(); + d->m_updateLock.unlock(); } /** @@ -805,7 +805,7 @@ void MythUIImage::SetImages(QVector *images) { Clear(); - QWriteLocker updateLocker(&d->m_UpdateLock); + QWriteLocker updateLocker(&d->m_updateLock); QSize aSize = GetFullArea().size(); m_imageProperties.m_isThemeImage = false; @@ -897,9 +897,9 @@ void MythUIImage::ForceSize(const QSize &size) if (m_imageProperties.m_forceSize == size) return; - d->m_UpdateLock.lockForWrite(); + d->m_updateLock.lockForWrite(); m_imageProperties.m_forceSize = size; - d->m_UpdateLock.unlock(); + d->m_updateLock.unlock(); if (size.isEmpty()) return; @@ -931,7 +931,7 @@ void MythUIImage::SetSize(int width, int height) */ void MythUIImage::SetSize(const QSize &size) { - QWriteLocker updateLocker(&d->m_UpdateLock); + QWriteLocker updateLocker(&d->m_updateLock); MythUIType::SetSize(size); m_NeedLoad = true; } @@ -951,7 +951,7 @@ void MythUIImage::SetCropRect(int x, int y, int width, int height) */ void MythUIImage::SetCropRect(const MythRect &rect) { - QWriteLocker updateLocker(&d->m_UpdateLock); + QWriteLocker updateLocker(&d->m_updateLock); m_imageProperties.m_cropRect = rect; SetRedraw(); } @@ -961,13 +961,13 @@ void MythUIImage::SetCropRect(const MythRect &rect) */ bool MythUIImage::Load(bool allowLoadInBackground, bool forceStat) { - d->m_UpdateLock.lockForRead(); + d->m_updateLock.lockForRead(); m_Initiator = m_EnableInitiator; QString bFilename = m_imageProperties.m_filename; - d->m_UpdateLock.unlock(); + d->m_updateLock.unlock(); QString filename = bFilename; @@ -1100,9 +1100,9 @@ bool MythUIImage::Load(bool allowLoadInBackground, bool forceStat) m_ImagesLock.unlock(); SetRedraw(); - d->m_UpdateLock.lockForWrite(); + d->m_updateLock.lockForWrite(); m_LastDisplay = QTime::currentTime(); - d->m_UpdateLock.unlock(); + d->m_updateLock.unlock(); } else { @@ -1132,7 +1132,7 @@ bool MythUIImage::Load(bool allowLoadInBackground, bool forceStat) */ void MythUIImage::Pulse(void) { - d->m_UpdateLock.lockForWrite(); + d->m_updateLock.lockForWrite(); int delay = -1; @@ -1147,9 +1147,9 @@ void MythUIImage::Pulse(void) if (m_showingRandomImage) { FindRandomImage(); - d->m_UpdateLock.unlock(); + d->m_updateLock.unlock(); Load(); - d->m_UpdateLock.lockForWrite(); + d->m_updateLock.lockForWrite(); } else { @@ -1189,7 +1189,7 @@ void MythUIImage::Pulse(void) MythUIType::Pulse(); - d->m_UpdateLock.unlock(); + d->m_updateLock.unlock(); } /** @@ -1202,7 +1202,7 @@ void MythUIImage::DrawSelf(MythPainter *p, int xoffset, int yoffset, if (!m_Images.empty()) { - d->m_UpdateLock.lockForWrite(); + d->m_updateLock.lockForWrite(); if (m_CurPos >= (uint)m_Images.size()) m_CurPos = 0; @@ -1232,12 +1232,12 @@ void MythUIImage::DrawSelf(MythPainter *p, int xoffset, int yoffset, currentImage->IncrRef(); m_ImagesLock.unlock(); - d->m_UpdateLock.unlock(); + d->m_updateLock.unlock(); if (!currentImage) return; - d->m_UpdateLock.lockForRead(); + d->m_updateLock.lockForRead(); QRect currentImageArea = currentImage->rect(); @@ -1268,7 +1268,7 @@ void MythUIImage::DrawSelf(MythPainter *p, int xoffset, int yoffset, p->SetClipRect(clipRect); p->DrawImage(area, currentImage, srcRect, alpha); currentImage->DecrRef(); - d->m_UpdateLock.unlock(); + d->m_updateLock.unlock(); } else m_ImagesLock.unlock(); @@ -1280,7 +1280,7 @@ void MythUIImage::DrawSelf(MythPainter *p, int xoffset, int yoffset, bool MythUIImage::ParseElement( const QString &filename, QDomElement &element, bool showWarnings) { - QWriteLocker updateLocker(&d->m_UpdateLock); + QWriteLocker updateLocker(&d->m_updateLock); if (element.tagName() == "filename") { @@ -1420,7 +1420,7 @@ bool MythUIImage::ParseElement( */ void MythUIImage::CopyFrom(MythUIType *base) { - d->m_UpdateLock.lockForWrite(); + d->m_updateLock.lockForWrite(); MythUIImage *im = dynamic_cast(base); if (!im) @@ -1429,7 +1429,7 @@ void MythUIImage::CopyFrom(MythUIType *base) QString("'%1' (%2) ERROR, bad parsing '%3' (%4)") .arg(objectName()).arg(GetXMLLocation()) .arg(base->objectName()).arg(base->GetXMLLocation())); - d->m_UpdateLock.unlock(); + d->m_updateLock.unlock(); return; } @@ -1459,17 +1459,17 @@ void MythUIImage::CopyFrom(MythUIType *base) m_NeedLoad = im->m_NeedLoad; - d->m_UpdateLock.unlock(); + d->m_updateLock.unlock(); - d->m_UpdateLock.lockForRead(); + d->m_updateLock.lockForRead(); if (m_NeedLoad) { - d->m_UpdateLock.unlock(); + d->m_updateLock.unlock(); Load(); } else - d->m_UpdateLock.unlock(); + d->m_updateLock.unlock(); } /** @@ -1477,7 +1477,7 @@ void MythUIImage::CopyFrom(MythUIType *base) */ void MythUIImage::CreateCopy(MythUIType *parent) { - QReadLocker updateLocker(&d->m_UpdateLock); + QReadLocker updateLocker(&d->m_updateLock); MythUIImage *im = new MythUIImage(parent, objectName()); im->CopyFrom(this); } @@ -1487,15 +1487,15 @@ void MythUIImage::CreateCopy(MythUIType *parent) */ void MythUIImage::Finalize(void) { - d->m_UpdateLock.lockForRead(); + d->m_updateLock.lockForRead(); if (m_NeedLoad) { - d->m_UpdateLock.unlock(); + d->m_updateLock.unlock(); Load(); } else - d->m_UpdateLock.unlock(); + d->m_updateLock.unlock(); MythUIType::Finalize(); } @@ -1505,16 +1505,16 @@ void MythUIImage::Finalize(void) */ void MythUIImage::LoadNow(void) { - d->m_UpdateLock.lockForWrite(); + d->m_updateLock.lockForWrite(); if (m_NeedLoad) { - d->m_UpdateLock.unlock(); + d->m_updateLock.unlock(); return; } m_NeedLoad = true; - d->m_UpdateLock.unlock(); + d->m_updateLock.unlock(); Load(false); @@ -1541,9 +1541,9 @@ void MythUIImage::customEvent(QEvent *event) m_runningThreads--; - d->m_UpdateLock.lockForRead(); + d->m_updateLock.lockForRead(); QString propFilename = m_imageProperties.m_filename; - d->m_UpdateLock.unlock(); + d->m_updateLock.unlock(); // 1) We aborted loading the image for some reason (e.g. two requests // for same image) @@ -1587,7 +1587,7 @@ void MythUIImage::customEvent(QEvent *event) if ((m_HighNum == m_LowNum) && !m_animatedImage) Clear(); - d->m_UpdateLock.lockForWrite(); + d->m_updateLock.lockForWrite(); if (m_imageProperties.m_forceSize.isNull()) SetSize(image->size()); @@ -1596,7 +1596,7 @@ void MythUIImage::customEvent(QEvent *event) rect.setSize(image->size()); SetMinArea(rect); - d->m_UpdateLock.unlock(); + d->m_updateLock.unlock(); m_ImagesLock.lock(); @@ -1613,9 +1613,9 @@ void MythUIImage::customEvent(QEvent *event) SetRedraw(); - d->m_UpdateLock.lockForWrite(); + d->m_updateLock.lockForWrite(); m_LastDisplay = QTime::currentTime(); - d->m_UpdateLock.unlock(); + d->m_updateLock.unlock(); } else { diff --git a/mythtv/libs/libmythui/mythuitype.cpp b/mythtv/libs/libmythui/mythuitype.cpp index f7b111be0c9..e37d1a30373 100644 --- a/mythtv/libs/libmythui/mythuitype.cpp +++ b/mythtv/libs/libmythui/mythuitype.cpp @@ -498,10 +498,10 @@ void MythUIType::Draw(MythPainter *p, int xoffset, int yoffset, int alphaMod, if (p->ShowBorders()) { - static const QBrush nullbrush(Qt::NoBrush); + static const QBrush kNullBrush(Qt::NoBrush); QPen pen(m_BorderColor); pen.setWidth(1); - p->DrawRect(realArea, nullbrush, pen, 255); + p->DrawRect(realArea, kNullBrush, pen, 255); if (p->ShowTypeNames()) { diff --git a/mythtv/libs/libmythui/mythuiwebbrowser.cpp b/mythtv/libs/libmythui/mythuiwebbrowser.cpp index ae5e5880036..fb908b2dcf6 100644 --- a/mythtv/libs/libmythui/mythuiwebbrowser.cpp +++ b/mythtv/libs/libmythui/mythuiwebbrowser.cpp @@ -39,9 +39,9 @@ struct MimeType { - QString mimeType; - QString extension; - bool isVideo; + QString m_mimeType; + QString m_extension; + bool m_isVideo; }; static MimeType SupportedMimeTypes[] = @@ -712,8 +712,8 @@ QString MythWebView::getExtensionForMimetype(const QString &mimetype) { for (int x = 0; x < SupportedMimeTypesCount; x++) { - if (!mimetype.isEmpty() && mimetype == SupportedMimeTypes[x].mimeType) - return SupportedMimeTypes[x].extension; + if (!mimetype.isEmpty() && mimetype == SupportedMimeTypes[x].m_mimeType) + return SupportedMimeTypes[x].m_extension; } return QString(""); @@ -723,14 +723,14 @@ bool MythWebView::isMusicFile(const QString &extension, const QString &mimetype) { for (int x = 0; x < SupportedMimeTypesCount; x++) { - if (!SupportedMimeTypes[x].isVideo) + if (!SupportedMimeTypes[x].m_isVideo) { if (!mimetype.isEmpty() && - mimetype == SupportedMimeTypes[x].mimeType) + mimetype == SupportedMimeTypes[x].m_mimeType) return true; if (!extension.isEmpty() && - extension.toLower() == SupportedMimeTypes[x].extension) + extension.toLower() == SupportedMimeTypes[x].m_extension) return true; } } @@ -742,14 +742,14 @@ bool MythWebView::isVideoFile(const QString &extension, const QString &mimetype) { for (int x = 0; x < SupportedMimeTypesCount; x++) { - if (SupportedMimeTypes[x].isVideo) + if (SupportedMimeTypes[x].m_isVideo) { if (!mimetype.isEmpty() && - mimetype == SupportedMimeTypes[x].mimeType) + mimetype == SupportedMimeTypes[x].m_mimeType) return true; if (!extension.isEmpty() && - extension.toLower() == SupportedMimeTypes[x].extension) + extension.toLower() == SupportedMimeTypes[x].m_extension) return true; } } diff --git a/mythtv/libs/libmythui/opengl/mythrenderopengl.cpp b/mythtv/libs/libmythui/opengl/mythrenderopengl.cpp index 30d24361628..b09428f06f0 100644 --- a/mythtv/libs/libmythui/opengl/mythrenderopengl.cpp +++ b/mythtv/libs/libmythui/opengl/mythrenderopengl.cpp @@ -406,10 +406,10 @@ bool MythRenderOpenGL::Init(void) void MythRenderOpenGL::DebugFeatures(void) { - static bool debugged = false; - if (debugged) + static bool s_debugged = false; + if (s_debugged) return; - debugged = true; + s_debugged = true; QSurfaceFormat fmt = format(); QString qtglversion = QString("OpenGL%1 %2.%3") .arg(fmt.renderableType() == QSurfaceFormat::OpenGLES ? "ES" : "") @@ -1181,11 +1181,11 @@ void MythRenderOpenGL::Init2DState(void) QFunctionPointer MythRenderOpenGL::GetProcAddress(const QString &Proc) const { - static const QString exts[4] = { "", "ARB", "EXT", "OES" }; + static const QString kExts[4] = { "", "ARB", "EXT", "OES" }; QFunctionPointer result = nullptr; for (int i = 0; i < 4; i++) { - result = getProcAddress((Proc + exts[i]).toLocal8Bit().constData()); + result = getProcAddress((Proc + kExts[i]).toLocal8Bit().constData()); if (result) break; } diff --git a/mythtv/libs/libmythui/screensaver-x11.cpp b/mythtv/libs/libmythui/screensaver-x11.cpp index 056ddee29e2..feb944610f8 100644 --- a/mythtv/libs/libmythui/screensaver-x11.cpp +++ b/mythtv/libs/libmythui/screensaver-x11.cpp @@ -159,24 +159,24 @@ class ScreenSaverX11Private void SaveScreenSaver(void) { - if (!m_state.saved && m_display) + if (!m_state.m_saved && m_display) { - XGetScreenSaver(m_display->GetDisplay(), &m_state.timeout, - &m_state.interval, &m_state.preferblank, - &m_state.allowexposure); - m_state.saved = true; + XGetScreenSaver(m_display->GetDisplay(), &m_state.m_timeout, + &m_state.m_interval, &m_state.m_preferblank, + &m_state.m_allowexposure); + m_state.m_saved = true; } } void RestoreScreenSaver(void) { - if (m_state.saved && m_display) + if (m_state.m_saved && m_display) { - XSetScreenSaver(m_display->GetDisplay(), m_state.timeout, - m_state.interval, m_state.preferblank, - m_state.allowexposure); + XSetScreenSaver(m_display->GetDisplay(), m_state.m_timeout, + m_state.m_interval, m_state.m_preferblank, + m_state.m_allowexposure); m_display->Sync(); - m_state.saved = false; + m_state.m_saved = false; } } @@ -186,8 +186,8 @@ class ScreenSaverX11Private return; QDateTime current_time = MythDate::current(); - if ((!m_last_deactivated.isValid()) || - (m_last_deactivated.secsTo(current_time) > 30)) + if ((!m_lastDeactivated.isValid()) || + (m_lastDeactivated.secsTo(current_time) > 30)) { if (m_xscreensaverRunning) { @@ -198,7 +198,7 @@ class ScreenSaverX11Private kMSDontDisableDrawing | kMSRunBackground); } - m_last_deactivated = current_time; + m_lastDeactivated = current_time; } } @@ -207,11 +207,11 @@ class ScreenSaverX11Private { public: ScreenSaverState() = default; - bool saved {false}; - int timeout {-1}; - int interval {-1}; - int preferblank {-1}; - int allowexposure {-1}; + bool m_saved {false}; + int m_timeout {-1}; + int m_interval {-1}; + int m_preferblank {-1}; + int m_allowexposure {-1}; }; private: @@ -223,7 +223,7 @@ class ScreenSaverX11Private int m_timeoutInterval {-1}; QTimer *m_resetTimer {nullptr}; - QDateTime m_last_deactivated; + QDateTime m_lastDeactivated; ScreenSaverState m_state; MythXDisplay *m_display {nullptr}; diff --git a/mythtv/libs/libmythui/x11colors.cpp b/mythtv/libs/libmythui/x11colors.cpp index 90dfc761267..7a774505342 100644 --- a/mythtv/libs/libmythui/x11colors.cpp +++ b/mythtv/libs/libmythui/x11colors.cpp @@ -7,19 +7,19 @@ struct colormap { - const char *name; - unsigned char r, g, b; + const char *m_name; + unsigned char m_r, m_g, m_b; }; QColor createColor(const QString &color) { - static QMutex x11colormapLock; - static QMap x11colormap; + static QMutex s_x11ColorMapLock; + static QMap s_x11ColorMap; - QMutexLocker locker(&x11colormapLock); - if (x11colormap.empty()) + QMutexLocker locker(&s_x11ColorMapLock); + if (s_x11ColorMap.empty()) { - static const colormap cmap[] = { + static const colormap kCMap[] = { { "snow", 255, 250, 250}, { "ghost", 248, 248, 255}, { "ghostwhite", 248, 248, 255}, @@ -774,14 +774,14 @@ QColor createColor(const QString &color) { "lightgreen", 144, 238, 144} }; - for (size_t i = 0; i < (sizeof(cmap) / sizeof(cmap[0])); i++) - x11colormap[QString(cmap[i].name)] = QColor(cmap[i].r, - cmap[i].g, - cmap[i].b); + for (size_t i = 0; i < (sizeof(kCMap) / sizeof(kCMap[0])); i++) + s_x11ColorMap[QString(kCMap[i].m_name)] = QColor(kCMap[i].m_r, + kCMap[i].m_g, + kCMap[i].m_b); } - QMap::const_iterator it = x11colormap.find(color.toLower()); - if (it != x11colormap.end()) + QMap::const_iterator it = s_x11ColorMap.find(color.toLower()); + if (it != s_x11ColorMap.end()) return it.value(); return {color};