diff --git a/src/Host.cpp b/src/Host.cpp index c0de13825de..90ae1db0a13 100644 --- a/src/Host.cpp +++ b/src/Host.cpp @@ -1003,7 +1003,7 @@ QPair Host::createStopWatch(const QString& name) int newWatchId = 1; while (mStopWatchMap.contains(newWatchId)) { ++newWatchId; - }; + } // It is hard to imagine a situation in which this will fail - so we won't // bother coding for it: diff --git a/src/Host.h b/src/Host.h index f03f1f69557..cbe4450e252 100644 --- a/src/Host.h +++ b/src/Host.h @@ -165,9 +165,9 @@ class Host : public QObject QString & getPass() { QMutexLocker locker(& mLock); return mPass; } void setPass(const QString& s ) { QMutexLocker locker(& mLock); mPass = s; } int getRetries() { QMutexLocker locker(& mLock); return mRetries;} - void setRetries( int c ) { QMutexLocker locker(& mLock); mRetries=c; } + void setRetries( int c ) { QMutexLocker locker(& mLock); mRetries = c; } int getTimeout() { QMutexLocker locker(& mLock); return mTimeout; } - void setTimeout( int seconds ) { QMutexLocker locker(& mLock); mTimeout=seconds; } + void setTimeout( int seconds ) { QMutexLocker locker(& mLock); mTimeout = seconds; } bool wideAmbiguousEAsianGlyphs() { QMutexLocker locker(& mLock); return mWideAmbigousWidthGlyphs; } // Uses PartiallyChecked to set the automatic mode, otherwise Checked/Unchecked means use wide/narrow ambiguous glyphs void setWideAmbiguousEAsianGlyphs(Qt::CheckState state ); diff --git a/src/T2DMap.cpp b/src/T2DMap.cpp index 448e8fe674e..7bcfa8f2c63 100644 --- a/src/T2DMap.cpp +++ b/src/T2DMap.cpp @@ -3435,16 +3435,7 @@ void T2DMap::slot_userAction(QString uniqueName) event.mArgumentTypeList.append(ARGUMENT_TYPE_NUMBER); } mpHost->raiseEvent(event); - } - // Unreachable code as had effectively the same test as the previous "if" - // mMultiSelectionList is now mMultiSelectionSet: - // else if( mMultiSelectionList.size() > 0 ) - // { - // event.mArgumentList.append(QString::number(mMultiSelectionList[0])); - // event.mArgumentTypeList.append(ARGUMENT_TYPE_NUMBER); - // mpHost->raiseEvent( & event ); - // } - else { + } else { event.mArgumentList.append(uniqueName); event.mArgumentTypeList.append(ARGUMENT_TYPE_STRING); for (int i = 0; i < userEvent.size(); i++) { diff --git a/src/TBuffer.cpp b/src/TBuffer.cpp index 4bb0905e001..8946fca72b1 100644 --- a/src/TBuffer.cpp +++ b/src/TBuffer.cpp @@ -1094,7 +1094,7 @@ void TBuffer::translateToPlainText(std::string& incoming, const bool isFromServe continue; } - if (spanEnd >= localBufferLength || cParameter.indexOf(localBuffer[spanEnd]) >=0) { + if (spanEnd >= localBufferLength || cParameter.indexOf(localBuffer[spanEnd]) >= 0) { // We have gone to the end of the buffer OR the last character // in the buffer is still within a CSI sequence - therefore we // have got a split between data packets and are not in a @@ -1540,8 +1540,7 @@ void TBuffer::translateToPlainText(std::string& incoming, const bool isFromServe _tl[i].replace("|", ""); if (_element.name == "A") { _tl[i] = "openUrl([[" + _tl[i] + "]])"; - } - else if (!_send_to_command_line) { + } else if (!_send_to_command_line) { _tl[i] = "send([[" + _tl[i] + "]])"; } else { _tl[i] = "printCmdLine([[" + _tl[i] + "]])"; @@ -1604,9 +1603,7 @@ void TBuffer::translateToPlainText(std::string& incoming, const bool isFromServe mSkip.clear(); ch = '"'; } - } - // if the content is split across package borders - else if (mSkip == ">" && ch == ';') { + } else if (mSkip == ">" && ch == ';') { // if the content is split across package borders mIgnoreTag = false; mSkip.clear(); ch = '>'; @@ -2951,7 +2948,7 @@ void TBuffer::decodeOSC(const QString& sequence) // Uses mid(...) rather than at(...) because we want the return to // be a (single character) QString and not a QChar so we can use // QString::toUInt(...): - quint8 colorNumber = sequence.midRef(1,1).toUInt(&isOk, 16); + quint8 colorNumber = sequence.midRef(1, 1).toUInt(&isOk, 16); quint8 rr = 0; if (isOk) { rr = sequence.midRef(2, 2).toUInt(&isOk, 16); @@ -4144,8 +4141,8 @@ QString TBuffer::bufferToHtml(const bool showTimeStamp /*= false*/, const int ro s.append(QStringLiteral("%1").arg(timeBuffer.at(row).left(timeStampFormat.length()))); // Set the current idea of what the formatting is so we can spot if it // changes: - currentFgColor = QColor(200,150,0); - currentBgColor = QColor(22,22,22); + currentFgColor = QColor(200, 150, 0); + currentBgColor = QColor(22, 22, 22); currentFlags = TChar::None; // We are no longer before the first span - so we need to flag that // there will be one to close: diff --git a/src/TBuffer.h b/src/TBuffer.h index 2e62be36343..81871e4170d 100644 --- a/src/TBuffer.h +++ b/src/TBuffer.h @@ -83,8 +83,8 @@ class TChar bool operator==(const TChar&); void setColors(const QColor& newForeGroundColor, const QColor& newBackGroundColor) { - mFgColor=newForeGroundColor; - mBgColor=newBackGroundColor; + mFgColor = newForeGroundColor; + mBgColor = newBackGroundColor; } // Only considers the following flags: Bold, Italic, Overline, Reverse, // Strikeout, Underline, does not consider Echo: @@ -176,7 +176,7 @@ class TBuffer QStringList getEndLines(int); void clear(); QPoint getEndPos(); - void translateToPlainText(std::string& s, bool isFromServer=false); + void translateToPlainText(std::string& s, bool isFromServer = false); void append(const QString& chunk, int sub_start, int sub_end, const QColor& fg, const QColor& bg, const TChar::AttributeFlags flags = TChar::None, const int linkID = 0); // Only the bits within TChar::TestMask are considered for formatting: void append(const QString& chunk, const int sub_start, const int sub_end, const TChar format, const int linkID = 0); diff --git a/src/TCommandLine.cpp b/src/TCommandLine.cpp index 6e4f7d415f3..3c7e95a1591 100644 --- a/src/TCommandLine.cpp +++ b/src/TCommandLine.cpp @@ -52,10 +52,10 @@ TCommandLine::TCommandLine(Host* pHost, TConsole* pConsole, QWidget* parent) setFont(mpHost->getDisplayFont()); - mRegularPalette.setColor(QPalette::Text, mpHost->mCommandLineFgColor); //QColor(0,0,192)); + mRegularPalette.setColor(QPalette::Text, mpHost->mCommandLineFgColor); mRegularPalette.setColor(QPalette::Highlight, QColor(0, 0, 192)); mRegularPalette.setColor(QPalette::HighlightedText, QColor(Qt::white)); - mRegularPalette.setColor(QPalette::Base, mpHost->mCommandLineBgColor); //QColor(255,255,225)); + mRegularPalette.setColor(QPalette::Base, mpHost->mCommandLineBgColor); setPalette(mRegularPalette); @@ -1037,7 +1037,7 @@ void TCommandLine::slot_addWord() void TCommandLine::spellCheckWord(QTextCursor& c) { - if (!mpHost||!mpHost->mEnableSpellCheck) { + if (!mpHost || !mpHost->mEnableSpellCheck) { return; } diff --git a/src/TConsole.cpp b/src/TConsole.cpp index 1dcf95e9a88..8fec42b08f6 100644 --- a/src/TConsole.cpp +++ b/src/TConsole.cpp @@ -446,10 +446,10 @@ TConsole::TConsole(Host* pH, ConsoleType type, QWidget* parent) mpBufferSearchBox->setFocusPolicy(Qt::ClickFocus); mpBufferSearchBox->setPlaceholderText("Search ..."); QPalette __pal; - __pal.setColor(QPalette::Text, mpHost->mCommandLineFgColor); //QColor(0,0,192)); + __pal.setColor(QPalette::Text, mpHost->mCommandLineFgColor); __pal.setColor(QPalette::Highlight, QColor(0, 0, 192)); __pal.setColor(QPalette::HighlightedText, QColor(Qt::white)); - __pal.setColor(QPalette::Base, mpHost->mCommandLineBgColor); //QColor(255,255,225)); + __pal.setColor(QPalette::Base, mpHost->mCommandLineBgColor); __pal.setColor(QPalette::Window, mpHost->mCommandLineBgColor); mpBufferSearchBox->setPalette(__pal); mpBufferSearchBox->setToolTip(QStringLiteral("

%1

").arg( diff --git a/src/TConsole.h b/src/TConsole.h index 7e810761df4..7f84d8bd8c2 100644 --- a/src/TConsole.h +++ b/src/TConsole.h @@ -161,7 +161,7 @@ class TConsole : public QWidget bool setBackgroundColor(const QString& name, int r, int g, int b, int alpha); QString getCurrentLine(std::string&); void selectCurrentLine(std::string&); - bool setMiniConsoleFontSize(int); + bool setMiniConsoleFontSize(int); bool setMiniConsoleFont(const QString& font); void setLink(const QStringList& linkFunction, const QStringList& linkHint); // Cannot be called setAttributes as that would mask an inherited method @@ -367,7 +367,7 @@ public slots: Q_DECLARE_OPERATORS_FOR_FLAGS(TConsole::ConsoleType) -#if ! defined(QT_NO_DEBUG) +#if !defined(QT_NO_DEBUG) inline QDebug& operator<<(QDebug& debug, const TConsole::ConsoleType& type) { QString text; @@ -386,6 +386,6 @@ inline QDebug& operator<<(QDebug& debug, const TConsole::ConsoleType& type) debug.nospace() << text; return debug; } -#endif // ! defined(QT_NO_DEBUG) +#endif // !defined(QT_NO_DEBUG) #endif // MUDLET_TCONSOLE_H diff --git a/src/TLabel.cpp b/src/TLabel.cpp index 89e1cc2b34d..83df376f054 100644 --- a/src/TLabel.cpp +++ b/src/TLabel.cpp @@ -228,7 +228,7 @@ bool TLabel::forwardEventToMapper(QEvent* event) QWidget* qw = qApp->widgetAt(wheelEvent->globalPos()); if (qw && parentWidget()->findChild(QStringLiteral("mapper")) && parentWidget()->findChild(QStringLiteral("mapper"))->isAncestorOf(qw)) { -#if (QT_VERSION >= QT_VERSION_CHECK(5,12, 0)) +#if (QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)) // Have switched to the latest QWheelEvent as that handles both X // and Y wheels at the same time whereas previously we said the // event was a vertical one - even if it wasn't! Additionally we diff --git a/src/TLuaInterpreter.cpp b/src/TLuaInterpreter.cpp index 5403cecda86..a7ccbd5e7c5 100644 --- a/src/TLuaInterpreter.cpp +++ b/src/TLuaInterpreter.cpp @@ -1750,7 +1750,7 @@ int TLuaInterpreter::feedTriggers(lua_State* L) auto* pDataCodec = QTextCodec::codecForName(currentEncoding.toLatin1().constData()); auto* pDataEncoder = pDataCodec->makeEncoder(QTextCodec::IgnoreHeader); if (!(currentEncoding.isEmpty() || currentEncoding == QStringLiteral("ASCII"))) { - if (! pDataCodec->canEncode(dataQString)) { + if (!pDataCodec->canEncode(dataQString)) { lua_pushnil(L); lua_pushfstring(L, "cannot send \"%s\" as it contains one or more characters that cannot be conveyed in the current game server encoding of \"%s\"", data.constData(), currentEncoding.toLatin1().constData()); return 2; @@ -7070,7 +7070,7 @@ int TLuaInterpreter::sendATCP(lua_State* L) Host& host = getHostFromLua(L); std::string msg; if (!lua_isstring(L, 1)) { - lua_pushfstring(L, "sendATCP: bad argument #1 type (message as string expected, got %1!)", luaL_typename(L,1)); + lua_pushfstring(L, "sendATCP: bad argument #1 type (message as string expected, got %1!)", luaL_typename(L, 1)); return lua_error(L); } else { msg = host.mTelnet.encodeAndCookBytes(lua_tostring(L, 1)); @@ -7079,7 +7079,7 @@ int TLuaInterpreter::sendATCP(lua_State* L) std::string what; if (lua_gettop(L) > 1) { if (!lua_isstring(L, 2)) { - lua_pushfstring(L, "sendATCP: bad argument #2 type (what as string is optional, got %1!)", luaL_typename(L,2)); + lua_pushfstring(L, "sendATCP: bad argument #2 type (what as string is optional, got %1!)", luaL_typename(L, 2)); return lua_error(L); } else { what = host.mTelnet.encodeAndCookBytes(lua_tostring(L, 2)); @@ -7105,7 +7105,7 @@ int TLuaInterpreter::sendATCP(lua_State* L) } // output is in Mud Server Encoding form here: - if (! host.mTelnet.socketOutRaw(output)) { + if (!host.mTelnet.socketOutRaw(output)) { lua_pushnil(L); lua_pushstring(L, "unable to send all of the ATCP message"); return 2; @@ -7145,7 +7145,7 @@ int TLuaInterpreter::sendGMCP(lua_State* L) Host& host = getHostFromLua(L); std::string msg; if (!lua_isstring(L, 1)) { - lua_pushfstring(L, "sendGMCP: bad argument #1 type (message as string expected, got %1!)", luaL_typename(L,1)); + lua_pushfstring(L, "sendGMCP: bad argument #1 type (message as string expected, got %1!)", luaL_typename(L, 1)); return lua_error(L); } else { msg = host.mTelnet.encodeAndCookBytes(lua_tostring(L, 1)); @@ -7154,7 +7154,7 @@ int TLuaInterpreter::sendGMCP(lua_State* L) std::string what; if (lua_gettop(L) > 1) { if (!lua_isstring(L, 2)) { - lua_pushfstring(L, "sendGMCP: bad argument #2 type (what as string is optional, got %1!)", luaL_typename(L,2)); + lua_pushfstring(L, "sendGMCP: bad argument #2 type (what as string is optional, got %1!)", luaL_typename(L, 2)); return lua_error(L); } else { what = host.mTelnet.encodeAndCookBytes(lua_tostring(L, 2)); @@ -7180,7 +7180,7 @@ int TLuaInterpreter::sendGMCP(lua_State* L) } // output is in Mud Server Encoding form here: - if (! host.mTelnet.socketOutRaw(output)) { + if (!host.mTelnet.socketOutRaw(output)) { lua_pushnil(L); lua_pushstring(L, "unable to send all of the GMCP message"); return 2; @@ -7386,7 +7386,7 @@ int TLuaInterpreter::tempTimer(lua_State* L) } if (!lua_isstring(L, 2)) { - lua_pushfstring(L, "tempTimer: bad argument #2 type (script or function name as string expected, got %s!)", luaL_typename(L,2)); + lua_pushfstring(L, "tempTimer: bad argument #2 type (script or function name as string expected, got %s!)", luaL_typename(L, 2)); return lua_error(L); } QString luaCode = QString::fromUtf8(lua_tostring(L, 2)); @@ -8461,13 +8461,13 @@ int TLuaInterpreter::permScript(lua_State* L) int TLuaInterpreter::permTimer(lua_State* L) { if (!lua_isstring(L, 1)) { - lua_pushfstring(L, "permTimer: bad argument #1 type (timer name as string expected, got %s!)", luaL_typename(L,1)); + lua_pushfstring(L, "permTimer: bad argument #1 type (timer name as string expected, got %s!)", luaL_typename(L, 1)); return lua_error(L); } QString name = QString::fromUtf8(lua_tostring(L, 1)); if (!lua_isstring(L, 2)) { - lua_pushfstring(L, "permTimer: bad argument #2 type (timer parent name as string expected, got %s!)", luaL_typename(L,2)); + lua_pushfstring(L, "permTimer: bad argument #2 type (timer parent name as string expected, got %s!)", luaL_typename(L, 2)); return lua_error(L); } QString parent = QString::fromUtf8(lua_tostring(L, 2)); @@ -9009,8 +9009,8 @@ int TLuaInterpreter::setAreaName(lua_State* L) // with this ID, but without a TArea instance to accompany it (the latter was/is // instantiated as needed when a room is moved to the relevent area...) and we // need to continue to allow this - Slysven - // else if( ! host.mpMap->mpRoomDB->getAreaIDList().contains( id ) ) { - // lua_pushnil( L ); + // else if (!host.mpMap->mpRoomDB->getAreaIDList().contains(id)) { + // lua_pushnil(L); // lua_pushstring(L, "setAreaName: bad argument #1 value (number %d is not a valid area id)." // id); // return 2; @@ -14948,22 +14948,22 @@ void TLuaInterpreter::parseJSON(QString& key, const QString& string_data, const // Then one pattern for \uXXXX\uXXXX where each XXXX is a 4-digit hexadecimal value // These are 'surrogate pairs', (U+D800-U+DBFF) followed by (U+DC00-U+DFFF). // D800-DF00 DC00-DFFF - int j=0; - while((j = initialText.indexOf(codeRegex,j)) != -1){ + int j = 0; + while((j = initialText.indexOf(codeRegex, j)) != -1){ uint u; switch(initialText.at(j+1).unicode()){ - case 'n' : initialText.replace(j,2,'\n'); break; - case 't' : initialText.replace(j,2,'\t'); break; - case '\"' : initialText.replace(j,2,'\"'); break; - case '\\' : initialText.replace(j,2,'\\'); break; + case 'n' : initialText.replace(j, 2, '\n'); break; + case 't' : initialText.replace(j, 2, '\t'); break; + case '\"' : initialText.replace(j, 2, '\"'); break; + case '\\' : initialText.replace(j, 2, '\\'); break; case 'u': // handle lone code or pair of codes together - u = initialText.midRef(j+2,4).toUShort(0,16); + u = initialText.midRef(j+2, 4).toUShort(0, 16); if(u > 0xFFFD){ j += 5; // FFFE and FFFF are guaranteed to not be Unicode characters. Skip it. } else if((u < 0xD800) || (0xDFFF < u)){ // Characters in ranges U+0000-U+D7FF and U+E000-U+FFFD are stored as a single unit. - initialText.replace(j,6,QChar(u)); + initialText.replace(j, 6, QChar(u)); } else if((0xD7FF < u) && (u < 0xDC00)){ // Non-BMP characters (range U+10000-U+10FFFF) are stored as "surrogate pairs". @@ -14971,9 +14971,9 @@ void TLuaInterpreter::parseJSON(QString& key, const QString& string_data, const // Surrogates are always written in pairs, a lone one is invalid. // The regex above should ensure second code is DCxx-DFxx QChar code[2]; - code[0]=QChar(u); - code[1]=QChar(initialText.midRef(j+8,4).toUShort(0,16)); - initialText.replace(j,12,code,2); + code[0] = QChar(u); + code[1] = QChar(initialText.midRef(j+8, 4).toUShort(0, 16)); + initialText.replace(j, 12, code, 2); j++; // in this case we are adding 2 code points for the character } // DC00-DFFF should be filtered out by the regex. @@ -17241,7 +17241,7 @@ QPair TLuaInterpreter::setScriptCode(QString& name, const QString& // No documentation available in wiki - internal function QPair TLuaInterpreter::startPermTimer(const QString& name, const QString& parent, double timeout, const QString& function) { - QTime time = QTime(0,0,0,0).addMSecs(qRound(timeout * 1000)); + QTime time = QTime(0, 0, 0, 0).addMSecs(qRound(timeout * 1000)); TTimer* pT; if (parent.isEmpty()) { pT = new TTimer(QStringLiteral("newPermTimerWithoutAnId"), time, mpHost); @@ -18098,7 +18098,7 @@ void TLuaInterpreter::updateAnsi16ColorsInTable() lua_getfield(L, LUA_GLOBALSINDEX, "color_table"); if (!(lua_toboolean(L,-1))) { // no it doesn't - lua_pop(L,1); + lua_pop(L, 1); // So make it lua_newtable(L); } @@ -18205,7 +18205,7 @@ void TLuaInterpreter::updateExtendedAnsiColorsInTable() lua_getfield(L, LUA_GLOBALSINDEX, "color_table"); if (!(lua_toboolean(L,-1))) { // no it doesn't - lua_pop(L,1); + lua_pop(L, 1); // So make it lua_newtable(L); } diff --git a/src/TTabBar.cpp b/src/TTabBar.cpp index af156be0728..ec79720ca64 100644 --- a/src/TTabBar.cpp +++ b/src/TTabBar.cpp @@ -36,7 +36,7 @@ void TStyle::drawControl(ControlElement element, const QStyleOption *option, QPa QString tabName = mpTabBar->tabData(mpTabBar->tabAt(option->rect.center())).toString(); QFont font = widget->font(); bool isStyleChanged = false; - if (mBoldTabsSet.contains(tabName)||mItalicTabsSet.contains(tabName)||mUnderlineTabsSet.contains(tabName)) { + if (mBoldTabsSet.contains(tabName) || mItalicTabsSet.contains(tabName) || mUnderlineTabsSet.contains(tabName)) { painter->save(); font.setBold(mBoldTabsSet.contains(tabName)); font.setItalic(mItalicTabsSet.contains(tabName)); @@ -118,7 +118,7 @@ bool TStyle::indexedTabState(const int index, const QSet& effect) const QSize TTabBar::tabSizeHint(int index) const { - if (mStyle.tabBold(index)||mStyle.tabItalic(index)||mStyle.tabUnderline(index)) { + if (mStyle.tabBold(index) || mStyle.tabItalic(index) || mStyle.tabUnderline(index)) { const QSize s = QTabBar::tabSizeHint(index); const QFontMetrics fm(font()); // Note that this method must use (because it is associated with sizing diff --git a/src/TToolBar.cpp b/src/TToolBar.cpp index e319bbead11..28c1cef3a7b 100644 --- a/src/TToolBar.cpp +++ b/src/TToolBar.cpp @@ -79,7 +79,7 @@ void TToolBar::moveEvent(QMoveEvent* e) if (!mpTAction) { return; } - + if (!mudlet::self()->mIsLoadingLayout) { mudlet::self()->setToolbarLayoutUpdated(mpTAction->mpHost, this); } diff --git a/src/TTrigger.cpp b/src/TTrigger.cpp index 452a80402e7..649c14da914 100755 --- a/src/TTrigger.cpp +++ b/src/TTrigger.cpp @@ -130,8 +130,7 @@ TTrigger::~TTrigger() void TTrigger::setName(const QString& name) { - if( ! isTemporary() ) - { + if (!isTemporary()) { mpHost->getTriggerUnit()->mLookupTable.remove( mName, this ); } mName = name; @@ -675,8 +674,8 @@ bool TTrigger::match_color_pattern(int line, int regexNumber) // Ideally we should base the matching on only the ANSI code but not // all parts of the text come from the Server and can be determined to // have come from a decoded ANSI code number: - if (((pCT->ansiFg == scmIgnored)||((pCT->ansiFg == scmDefault) && mpHost->mpConsole->mFgColor == (*it).foreground())||(pCT->mFgColor == (*it).foreground())) - &&((pCT->ansiBg == scmIgnored)||((pCT->ansiBg == scmDefault) && mpHost->mpConsole->mBgColor == (*it).background())||(pCT->mBgColor == (*it).background()))) { + if (((pCT->ansiFg == scmIgnored) || ((pCT->ansiFg == scmDefault) && mpHost->mpConsole->mFgColor == (*it).foreground()) || (pCT->mFgColor == (*it).foreground())) + && ((pCT->ansiBg == scmIgnored) || ((pCT->ansiBg == scmDefault) && mpHost->mpConsole->mBgColor == (*it).background()) || (pCT->mBgColor == (*it).background()))) { if (matchBegin == -1) { matchBegin = pos; diff --git a/src/ctelnet.cpp b/src/ctelnet.cpp index eca0e4d5d40..fe3d0e78f97 100644 --- a/src/ctelnet.cpp +++ b/src/ctelnet.cpp @@ -486,7 +486,6 @@ void cTelnet::handle_socket_signal_disconnected() postMessage(spacer); #if !defined(QT_NO_SSL) - QList sslErrors = getSslErrors(); QSslCertificate cert = socket.peerCertificate(); @@ -609,7 +608,7 @@ bool cTelnet::sendData(QString& data) "Note: this warning will only be issued once, even if this happens again, until\n" "the encoding is changed."; if (!mEncoding.isEmpty()) { - if ((! mEncodingWarningIssued) && (! outgoingDataCodec->canEncode(data))) { + if ((!mEncodingWarningIssued) && (!outgoingDataCodec->canEncode(data))) { QString errorMsg = tr(errorMsgTemplate, "%1 is the name of the encoding currently set.").arg(mEncoding); postMessage(errorMsg); @@ -620,7 +619,7 @@ bool cTelnet::sendData(QString& data) } else { // Plain, raw ASCII, we hope! for (int i = 0, total = data.size(); i < total; ++i) { - if ((! mEncodingWarningIssued) && (data.at(i).row() || data.at(i).cell() > 127)){ + if ((!mEncodingWarningIssued) && (data.at(i).row() || data.at(i).cell() > 127)){ QString errorMsg = tr(errorMsgTemplate, "%1 is the name of the encoding currently set.").arg(QStringLiteral("ASCII")); postMessage(errorMsg); diff --git a/src/dlgAboutDialog.cpp b/src/dlgAboutDialog.cpp index de445ae54a5..344e92a3396 100644 --- a/src/dlgAboutDialog.cpp +++ b/src/dlgAboutDialog.cpp @@ -150,7 +150,7 @@ void dlgAboutDialog::setAboutTab(const QString& htmlHead) const "Discorddiscord.gg\n" "Source codegithub.com/Mudlet/Mudlet\n" "Features/bugsgithub.com/Mudlet/Mudlet/issues")); - + QVector aboutMakers; // [big?, name, discord, github, email, description] aboutMakers.append({true, QStringLiteral("Heiko Köhn"), QString(), QString(), QStringLiteral("KoehnHeiko@googlemail.com"), tr("Original author, original project lead, Mudlet core coding, retired.", @@ -171,7 +171,7 @@ void dlgAboutDialog::setAboutTab(const QString& htmlHead) const "about:SlySven")}); aboutMakers.append({true, QStringLiteral("Damian Monogue"), QStringLiteral("demonnic#4307"), QStringLiteral("demonnic"), QStringLiteral("demonnic@gmail.com"), tr("Former maintainer of the early Windows and Apple OSX packages. " - "He also administers our server and helps the project in many ways.", + "He also administers our server and helps the project in many ways.", "about:demonnic")}); aboutMakers.append({true, QStringLiteral("Florian Scheel"), QStringLiteral("keneanung#2803"), QStringLiteral("keneanung"), QStringLiteral("keneanung@googlemail.com"), tr("Contributed many improvements to Mudlet's db: interface, event system, " @@ -197,7 +197,7 @@ void dlgAboutDialog::setAboutTab(const QString& htmlHead) const tr("Joined in December 2009 though he's been around much longer. " "Contributed to the Lua API and is the former maintainer of the Lua API.", "about:Ben Smith")}); - aboutMakers.append({false, QStringLiteral("Blaine von Roeder"), QString(), QString(), QString(), + aboutMakers.append({false, QStringLiteral("Blaine von Roeder"), QString(), QString(), QString(), tr("Joined in December 2009. He has contributed to the Lua API, submitted small bugfix patches " "and has helped with release management of 1.0.5.", "about:Blaine von Roeder")}); @@ -207,10 +207,10 @@ void dlgAboutDialog::setAboutTab(const QString& htmlHead) const aboutMakers.append({false, QStringLiteral("Carter Dewey"), QString(), QString(), QStringLiteral("eldarerathis@gmail.com"), tr("Contributed to the Lua API.", "about:Carter Dewey")}); - aboutMakers.append({false, QStringLiteral("Erik Pettis"), QStringLiteral("Etomyutikos#9266"), QStringLiteral("Oneymus"), QString(), + aboutMakers.append({false, QStringLiteral("Erik Pettis"), QStringLiteral("Etomyutikos#9266"), QStringLiteral("Oneymus"), QString(), tr("Developed the Vyzor GUI Manager for Mudlet.", "about:Oneymus")}); - aboutMakers.append({false, QStringLiteral("ItsTheFae"), QStringLiteral("TheFae#9971"), QStringLiteral("Kae"), QString(), + aboutMakers.append({false, QStringLiteral("ItsTheFae"), QStringLiteral("TheFae#9971"), QStringLiteral("Kae"), QString(), tr("Worked wonders in rejuventating our Website in 2017 but who prefers a little anonymity - " "if you are a SpamBot you will not get onto our Fora now. They have also made some useful " "C++ core code contributions and we look forward to future reviews on and work in that area.", @@ -225,7 +225,7 @@ void dlgAboutDialog::setAboutTab(const QString& htmlHead) const aboutMakers.append({false, QStringLiteral("John Dahlström"), QString(), QString(), QStringLiteral("email@johndahlstrom.se"), tr("Helped develop and debug the Lua API.", "about:John Dahlström")}); - aboutMakers.append({false, QStringLiteral("Karsten Bock"), QString(), QStringLiteral("Beliaar"), QString(), + aboutMakers.append({false, QStringLiteral("Karsten Bock"), QString(), QStringLiteral("Beliaar"), QString(), tr("Contributed several improvements and new features for Geyser.", "about:Beliaar")}); aboutMakers.append({false, QStringLiteral("Leigh Stillard"), QString(), QString(), QStringLiteral("leigh.stillard@gmail.com"), @@ -279,7 +279,7 @@ QString dlgAboutDialog::createMakerHTML(const aboutMaker& maker) const return QStringLiteral("

%1%2 %3

\n") // name (big?), contacts (if any?), description .arg(coloredText.arg(QStringLiteral("bc8942"), QStringLiteral("%1") .arg((maker.big) ? QStringLiteral("%1").arg(maker.name) : maker.name)), - (contactDetails.isEmpty()) ? QString() : + (contactDetails.isEmpty()) ? QString() : QStringLiteral(" (%1)").arg(contactDetails.join(QChar::Space)), maker.description); } @@ -1005,7 +1005,7 @@ void dlgAboutDialog::setThirdPartyTab(const QString& htmlHead) const // clang-format on } -void dlgAboutDialog::setSupportersTab(const QString& htmlHead) +void dlgAboutDialog::setSupportersTab(const QString& htmlHead) { // see https://www.patreon.com/mudlet if you'd like to be added! QStringList mightier_than_swords = {"Maiyannah Bishop", "Qwindor Rousseau"}; diff --git a/src/dlgIRC.cpp b/src/dlgIRC.cpp index 2221dd9d35a..3db419f86d8 100644 --- a/src/dlgIRC.cpp +++ b/src/dlgIRC.cpp @@ -525,7 +525,7 @@ void dlgIRC::slot_onBufferAdded(IrcBuffer* buffer) connect(buffer, &IrcBuffer::messageReceived, this, &dlgIRC::slot_receiveMessage); // create a document for storing the buffer specific messages auto * document = new QTextDocument(buffer); - document->setMaximumBlockCount(mMessageBufferLimit); + document->setMaximumBlockCount(mMessageBufferLimit); bufferTexts.insert(buffer, document); // create a sorted model for buffer users auto * userModel = new IrcUserModel(buffer); diff --git a/src/dlgMapper.cpp b/src/dlgMapper.cpp index 3e63ed9b8d3..4ec9472c7e9 100644 --- a/src/dlgMapper.cpp +++ b/src/dlgMapper.cpp @@ -124,10 +124,10 @@ dlgMapper::dlgMapper( QWidget * parent, Host * pH, TMap * pM ) mpMap->customEnvColors[271] = mpHost->mLightWhite_2; mpMap->customEnvColors[272] = mpHost->mLightBlack_2; if (mpHost) { - qDebug()<<"dlgMapper::dlgMapper(...) INFO constructor called, mpMap->mProfileName: " << mpMap->mProfileName; + qDebug() << "dlgMapper::dlgMapper(...) INFO constructor called, mpMap->mProfileName: " << mpMap->mProfileName; mp2dMap->init(); } else { - qDebug()<<"dlgMapper::dlgMapper(...) INFO constructor called, mpHost is null"; + qDebug() << "dlgMapper::dlgMapper(...) INFO constructor called, mpHost is null"; } } @@ -277,31 +277,23 @@ void dlgMapper::goRoom() // searchList->clear(); // int id = txt.toInt(); - // if( id != 0 && mpMap->rooms.contains( id ) ) - // { + // if (id != 0 && mpMap->rooms.contains(id)) { // mpMap->mTargetID = id; - // if( mpMap->findPath(0,0) ) - // { - // qDebug()<<"glwidget: starting speedwalk path length="<mPathList.size(); + // if (mpMap->findPath(0,0)) { + // qDebug() << "glwidget: starting speedwalk path length=" << mpMap->mPathList.size(); // mpMap->mpHost->startSpeedWalk(); - // } - // else - // { + // } else { // QString msg = "Cannot find a path to this room.\n"; // mpHost->mpConsole->printSystemMessage(msg); // } - // } - // else - // { - // QMapIterator it( mpMap->rooms ); - // while( it.hasNext() ) - // { + // } else { + // QMapIterator it(mpMap->rooms); + // while (it.hasNext()) { // it.next(); // int i = it.key(); - // if( mpMap->rooms[i]->name.contains( txt, Qt::CaseInsensitive ) ) - // { - // qDebug()<<"inserting match:"<addItem( mpMap->rooms[i]->name ); + // if (mpMap->rooms[i]->name.contains( txt, Qt::CaseInsensitive)) { + // qDebug() << "inserting match:" << i; + // searchList->addItem(mpMap->rooms[i]->name); // } // } // } diff --git a/src/dlgPackageExporter.cpp b/src/dlgPackageExporter.cpp index 590d7fafe09..bf320f8c9f8 100644 --- a/src/dlgPackageExporter.cpp +++ b/src/dlgPackageExporter.cpp @@ -397,7 +397,7 @@ void dlgPackageExporter::slot_export_package() } QFileInfo entryInfo(itDir.fileInfo()); - if (! entryInfo.isReadable()) { + if (!entryInfo.isReadable()) { qWarning() << "dlgPackageExporter::slot_export_package() skipping file: " << itDir.fileName() << "it is NOT readable!"; diff --git a/src/dlgProfilePreferences.cpp b/src/dlgProfilePreferences.cpp index 7f14f881e97..385d3dbbe8f 100644 --- a/src/dlgProfilePreferences.cpp +++ b/src/dlgProfilePreferences.cpp @@ -3185,18 +3185,18 @@ void dlgProfilePreferences::generateMapGlyphDisplay() // can render the codepoints: QVector pCodePoints = symbol.toUcs4(); // These can be used to flag symbols that cannot be reproduced - bool isSingleFontUsable=true; - bool isAllFontUsable=true; + bool isSingleFontUsable = true; + bool isAllFontUsable = true; QStringList codePointsString; for (uint i = 0, total = pCodePoints.size(); i < total; ++i) { codePointsString << QStringLiteral("U+%1").arg(pCodePoints.at(i), 4, 16, QChar('0')).toUpper(); if (!SymbolAnyFontMetrics.inFontUcs4(pCodePoints.at(i))) { - isAllFontUsable=false; + isAllFontUsable = false; // By definition if all the fonts together cannot render the // glyph then the specified one cannot either - isSingleFontUsable=false; + isSingleFontUsable = false; } else if (!SymbolInFontMetrics.inFontUcs4(pCodePoints.at(i))) { - isSingleFontUsable=false; + isSingleFontUsable = false; } } diff --git a/src/dlgRoomExits.cpp b/src/dlgRoomExits.cpp index 3fadf09c41e..898f47c4693 100644 --- a/src/dlgRoomExits.cpp +++ b/src/dlgRoomExits.cpp @@ -2002,75 +2002,77 @@ void dlgRoomExits::init(int id) // We now do not connect up all these things until AFTER we have initialised // things as some controls will issue unwanted signals upon setting values into // them as we have above... - connect( button_save, &QAbstractButton::clicked, this, &dlgRoomExits::slot_endEditSpecialExits); - connect( button_save, &QAbstractButton::clicked, this, &dlgRoomExits::slot_checkModified); - connect( button_save, &QAbstractButton::clicked, this, &dlgRoomExits::save); - connect( button_addSpecialExit,&QAbstractButton::clicked, this, &dlgRoomExits::slot_addSpecialExit); - connect( specialExits, &QTreeWidget::itemClicked, this, &dlgRoomExits::slot_editSpecialExit); - connect( specialExits, &QTreeWidget::itemClicked, this, &dlgRoomExits::slot_checkModified); - connect( button_endEditing, &QAbstractButton::clicked, this, &dlgRoomExits::slot_endEditSpecialExits); - connect( button_endEditing, &QAbstractButton::clicked, this, &dlgRoomExits::slot_checkModified); - connect( nw, &QLineEdit::textEdited, this, &dlgRoomExits::slot_nw_textEdited); - connect( n, &QLineEdit::textEdited, this, &dlgRoomExits::slot_n_textEdited); - connect( ne, &QLineEdit::textEdited, this, &dlgRoomExits::slot_ne_textEdited); - connect( up, &QLineEdit::textEdited, this, &dlgRoomExits::slot_up_textEdited); - connect( w, &QLineEdit::textEdited, this, &dlgRoomExits::slot_w_textEdited); - connect( e, &QLineEdit::textEdited, this, &dlgRoomExits::slot_e_textEdited); - connect( down, &QLineEdit::textEdited, this, &dlgRoomExits::slot_down_textEdited); - connect( sw, &QLineEdit::textEdited, this, &dlgRoomExits::slot_sw_textEdited); - connect( s, &QLineEdit::textEdited, this, &dlgRoomExits::slot_s_textEdited); - connect( se, &QLineEdit::textEdited, this, &dlgRoomExits::slot_se_textEdited); - connect( in, &QLineEdit::textEdited, this, &dlgRoomExits::slot_in_textEdited); - connect( out, &QLineEdit::textEdited, this, &dlgRoomExits::slot_out_textEdited); - connect( stub_nw, &QCheckBox::stateChanged, this, &dlgRoomExits::slot_stub_nw_stateChanged); - connect( stub_n, &QCheckBox::stateChanged, this, &dlgRoomExits::slot_stub_n_stateChanged); - connect( stub_ne, &QCheckBox::stateChanged, this, &dlgRoomExits::slot_stub_ne_stateChanged); - connect( stub_up, &QCheckBox::stateChanged, this, &dlgRoomExits::slot_stub_up_stateChanged); - connect( stub_w, &QCheckBox::stateChanged, this, &dlgRoomExits::slot_stub_w_stateChanged); - connect( stub_e, &QCheckBox::stateChanged, this, &dlgRoomExits::slot_stub_e_stateChanged); - connect( stub_down, &QCheckBox::stateChanged, this, &dlgRoomExits::slot_stub_down_stateChanged); - connect( stub_sw, &QCheckBox::stateChanged, this, &dlgRoomExits::slot_stub_sw_stateChanged); - connect( stub_s, &QCheckBox::stateChanged, this, &dlgRoomExits::slot_stub_s_stateChanged); - connect( stub_se, &QCheckBox::stateChanged, this, &dlgRoomExits::slot_stub_se_stateChanged); - connect( stub_in, &QCheckBox::stateChanged, this, &dlgRoomExits::slot_stub_in_stateChanged); - connect( stub_out, &QCheckBox::stateChanged, this, &dlgRoomExits::slot_stub_out_stateChanged); - connect( noroute_nw, &QCheckBox::stateChanged, this, &dlgRoomExits::slot_checkModified); - connect( noroute_n, &QCheckBox::stateChanged, this, &dlgRoomExits::slot_checkModified); - connect( noroute_ne, &QCheckBox::stateChanged, this, &dlgRoomExits::slot_checkModified); - connect( noroute_up, &QCheckBox::stateChanged, this, &dlgRoomExits::slot_checkModified); - connect( noroute_w, &QCheckBox::stateChanged, this, &dlgRoomExits::slot_checkModified); - connect( noroute_e, &QCheckBox::stateChanged, this, &dlgRoomExits::slot_checkModified); - connect( noroute_down, &QCheckBox::stateChanged, this, &dlgRoomExits::slot_checkModified); - connect( noroute_sw, &QCheckBox::stateChanged, this, &dlgRoomExits::slot_checkModified); - connect( noroute_s, &QCheckBox::stateChanged, this, &dlgRoomExits::slot_checkModified); - connect( noroute_se, &QCheckBox::stateChanged, this, &dlgRoomExits::slot_checkModified); - connect( noroute_in, &QCheckBox::stateChanged, this, &dlgRoomExits::slot_checkModified); - connect( noroute_out, &QCheckBox::stateChanged, this, &dlgRoomExits::slot_checkModified); - connect( weight_nw, qOverload(&QSpinBox::valueChanged), this, &dlgRoomExits::slot_checkModified); - connect( weight_n, qOverload(&QSpinBox::valueChanged), this, &dlgRoomExits::slot_checkModified); - connect( weight_ne, qOverload(&QSpinBox::valueChanged), this, &dlgRoomExits::slot_checkModified); - connect( weight_up, qOverload(&QSpinBox::valueChanged), this, &dlgRoomExits::slot_checkModified); - connect( weight_w, qOverload(&QSpinBox::valueChanged), this, &dlgRoomExits::slot_checkModified); - connect( weight_e, qOverload(&QSpinBox::valueChanged), this, &dlgRoomExits::slot_checkModified); - connect( weight_down, qOverload(&QSpinBox::valueChanged), this, &dlgRoomExits::slot_checkModified); - connect( weight_sw, qOverload(&QSpinBox::valueChanged), this, &dlgRoomExits::slot_checkModified); - connect( weight_s, qOverload(&QSpinBox::valueChanged), this, &dlgRoomExits::slot_checkModified); - connect( weight_se, qOverload(&QSpinBox::valueChanged), this, &dlgRoomExits::slot_checkModified); - connect( weight_in, qOverload(&QSpinBox::valueChanged), this, &dlgRoomExits::slot_checkModified); - connect( weight_out, qOverload(&QSpinBox::valueChanged), this, &dlgRoomExits::slot_checkModified); - connect( doortype_nw, qOverload(&QButtonGroup::buttonClicked),this, &dlgRoomExits::slot_checkModified); - connect( doortype_n, qOverload(&QButtonGroup::buttonClicked),this, &dlgRoomExits::slot_checkModified); - connect( doortype_ne, qOverload(&QButtonGroup::buttonClicked),this, &dlgRoomExits::slot_checkModified); - connect( doortype_up, qOverload(&QButtonGroup::buttonClicked),this, &dlgRoomExits::slot_checkModified); - connect( doortype_w, qOverload(&QButtonGroup::buttonClicked),this, &dlgRoomExits::slot_checkModified); - connect( doortype_e, qOverload(&QButtonGroup::buttonClicked),this, &dlgRoomExits::slot_checkModified); - connect( doortype_down, qOverload(&QButtonGroup::buttonClicked),this, &dlgRoomExits::slot_checkModified); - connect( doortype_sw, qOverload(&QButtonGroup::buttonClicked),this, &dlgRoomExits::slot_checkModified); - connect( doortype_s, qOverload(&QButtonGroup::buttonClicked),this, &dlgRoomExits::slot_checkModified); - connect( doortype_se, qOverload(&QButtonGroup::buttonClicked),this, &dlgRoomExits::slot_checkModified); - connect( doortype_in, qOverload(&QButtonGroup::buttonClicked),this, &dlgRoomExits::slot_checkModified); - connect( doortype_down, qOverload(&QButtonGroup::buttonClicked),this, &dlgRoomExits::slot_checkModified); - connect( doortype_out, qOverload(&QButtonGroup::buttonClicked),this, &dlgRoomExits::slot_checkModified); + // clang-format off + connect( button_save, &QAbstractButton::clicked, this, &dlgRoomExits::slot_endEditSpecialExits); + connect( button_save, &QAbstractButton::clicked, this, &dlgRoomExits::slot_checkModified); + connect( button_save, &QAbstractButton::clicked, this, &dlgRoomExits::save); + connect( button_addSpecialExit, &QAbstractButton::clicked, this, &dlgRoomExits::slot_addSpecialExit); + connect( specialExits, &QTreeWidget::itemClicked, this, &dlgRoomExits::slot_editSpecialExit); + connect( specialExits, &QTreeWidget::itemClicked, this, &dlgRoomExits::slot_checkModified); + connect( button_endEditing, &QAbstractButton::clicked, this, &dlgRoomExits::slot_endEditSpecialExits); + connect( button_endEditing, &QAbstractButton::clicked, this, &dlgRoomExits::slot_checkModified); + connect( nw, &QLineEdit::textEdited, this, &dlgRoomExits::slot_nw_textEdited); + connect( n, &QLineEdit::textEdited, this, &dlgRoomExits::slot_n_textEdited); + connect( ne, &QLineEdit::textEdited, this, &dlgRoomExits::slot_ne_textEdited); + connect( up, &QLineEdit::textEdited, this, &dlgRoomExits::slot_up_textEdited); + connect( w, &QLineEdit::textEdited, this, &dlgRoomExits::slot_w_textEdited); + connect( e, &QLineEdit::textEdited, this, &dlgRoomExits::slot_e_textEdited); + connect( down, &QLineEdit::textEdited, this, &dlgRoomExits::slot_down_textEdited); + connect( sw, &QLineEdit::textEdited, this, &dlgRoomExits::slot_sw_textEdited); + connect( s, &QLineEdit::textEdited, this, &dlgRoomExits::slot_s_textEdited); + connect( se, &QLineEdit::textEdited, this, &dlgRoomExits::slot_se_textEdited); + connect( in, &QLineEdit::textEdited, this, &dlgRoomExits::slot_in_textEdited); + connect( out, &QLineEdit::textEdited, this, &dlgRoomExits::slot_out_textEdited); + connect( stub_nw, &QCheckBox::stateChanged, this, &dlgRoomExits::slot_stub_nw_stateChanged); + connect( stub_n, &QCheckBox::stateChanged, this, &dlgRoomExits::slot_stub_n_stateChanged); + connect( stub_ne, &QCheckBox::stateChanged, this, &dlgRoomExits::slot_stub_ne_stateChanged); + connect( stub_up, &QCheckBox::stateChanged, this, &dlgRoomExits::slot_stub_up_stateChanged); + connect( stub_w, &QCheckBox::stateChanged, this, &dlgRoomExits::slot_stub_w_stateChanged); + connect( stub_e, &QCheckBox::stateChanged, this, &dlgRoomExits::slot_stub_e_stateChanged); + connect( stub_down, &QCheckBox::stateChanged, this, &dlgRoomExits::slot_stub_down_stateChanged); + connect( stub_sw, &QCheckBox::stateChanged, this, &dlgRoomExits::slot_stub_sw_stateChanged); + connect( stub_s, &QCheckBox::stateChanged, this, &dlgRoomExits::slot_stub_s_stateChanged); + connect( stub_se, &QCheckBox::stateChanged, this, &dlgRoomExits::slot_stub_se_stateChanged); + connect( stub_in, &QCheckBox::stateChanged, this, &dlgRoomExits::slot_stub_in_stateChanged); + connect( stub_out, &QCheckBox::stateChanged, this, &dlgRoomExits::slot_stub_out_stateChanged); + connect( noroute_nw, &QCheckBox::stateChanged, this, &dlgRoomExits::slot_checkModified); + connect( noroute_n, &QCheckBox::stateChanged, this, &dlgRoomExits::slot_checkModified); + connect( noroute_ne, &QCheckBox::stateChanged, this, &dlgRoomExits::slot_checkModified); + connect( noroute_up, &QCheckBox::stateChanged, this, &dlgRoomExits::slot_checkModified); + connect( noroute_w, &QCheckBox::stateChanged, this, &dlgRoomExits::slot_checkModified); + connect( noroute_e, &QCheckBox::stateChanged, this, &dlgRoomExits::slot_checkModified); + connect( noroute_down, &QCheckBox::stateChanged, this, &dlgRoomExits::slot_checkModified); + connect( noroute_sw, &QCheckBox::stateChanged, this, &dlgRoomExits::slot_checkModified); + connect( noroute_s, &QCheckBox::stateChanged, this, &dlgRoomExits::slot_checkModified); + connect( noroute_se, &QCheckBox::stateChanged, this, &dlgRoomExits::slot_checkModified); + connect( noroute_in, &QCheckBox::stateChanged, this, &dlgRoomExits::slot_checkModified); + connect( noroute_out, &QCheckBox::stateChanged, this, &dlgRoomExits::slot_checkModified); + connect( weight_nw, qOverload(&QSpinBox::valueChanged), this, &dlgRoomExits::slot_checkModified); + connect( weight_n, qOverload(&QSpinBox::valueChanged), this, &dlgRoomExits::slot_checkModified); + connect( weight_ne, qOverload(&QSpinBox::valueChanged), this, &dlgRoomExits::slot_checkModified); + connect( weight_up, qOverload(&QSpinBox::valueChanged), this, &dlgRoomExits::slot_checkModified); + connect( weight_w, qOverload(&QSpinBox::valueChanged), this, &dlgRoomExits::slot_checkModified); + connect( weight_e, qOverload(&QSpinBox::valueChanged), this, &dlgRoomExits::slot_checkModified); + connect( weight_down, qOverload(&QSpinBox::valueChanged), this, &dlgRoomExits::slot_checkModified); + connect( weight_sw, qOverload(&QSpinBox::valueChanged), this, &dlgRoomExits::slot_checkModified); + connect( weight_s, qOverload(&QSpinBox::valueChanged), this, &dlgRoomExits::slot_checkModified); + connect( weight_se, qOverload(&QSpinBox::valueChanged), this, &dlgRoomExits::slot_checkModified); + connect( weight_in, qOverload(&QSpinBox::valueChanged), this, &dlgRoomExits::slot_checkModified); + connect( weight_out, qOverload(&QSpinBox::valueChanged), this, &dlgRoomExits::slot_checkModified); + connect( doortype_nw, qOverload(&QButtonGroup::buttonClicked), this, &dlgRoomExits::slot_checkModified); + connect( doortype_n, qOverload(&QButtonGroup::buttonClicked), this, &dlgRoomExits::slot_checkModified); + connect( doortype_ne, qOverload(&QButtonGroup::buttonClicked), this, &dlgRoomExits::slot_checkModified); + connect( doortype_up, qOverload(&QButtonGroup::buttonClicked), this, &dlgRoomExits::slot_checkModified); + connect( doortype_w, qOverload(&QButtonGroup::buttonClicked), this, &dlgRoomExits::slot_checkModified); + connect( doortype_e, qOverload(&QButtonGroup::buttonClicked), this, &dlgRoomExits::slot_checkModified); + connect( doortype_down, qOverload(&QButtonGroup::buttonClicked), this, &dlgRoomExits::slot_checkModified); + connect( doortype_sw, qOverload(&QButtonGroup::buttonClicked), this, &dlgRoomExits::slot_checkModified); + connect( doortype_s, qOverload(&QButtonGroup::buttonClicked), this, &dlgRoomExits::slot_checkModified); + connect( doortype_se, qOverload(&QButtonGroup::buttonClicked), this, &dlgRoomExits::slot_checkModified); + connect( doortype_in, qOverload(&QButtonGroup::buttonClicked), this, &dlgRoomExits::slot_checkModified); + connect( doortype_down, qOverload(&QButtonGroup::buttonClicked), this, &dlgRoomExits::slot_checkModified); + connect( doortype_out, qOverload(&QButtonGroup::buttonClicked), this, &dlgRoomExits::slot_checkModified); + // clang-format on } TExit* dlgRoomExits::makeExitFromControls(int direction) diff --git a/src/dlgSystemMessageArea.cpp b/src/dlgSystemMessageArea.cpp index 022c597b837..d131828b9c8 100644 --- a/src/dlgSystemMessageArea.cpp +++ b/src/dlgSystemMessageArea.cpp @@ -26,19 +26,18 @@ dlgSystemMessageArea::dlgSystemMessageArea(QWidget* pF) : QWidget(pF) { // init generated dialog setupUi(this); - + QPixmap holdPixmap; - + holdPixmap = *(this->notificationAreaIconLabelWarning->pixmap()); holdPixmap.setDevicePixelRatio(5.3); this->notificationAreaIconLabelWarning->setPixmap(holdPixmap); - + holdPixmap = *(this->notificationAreaIconLabelError->pixmap()); holdPixmap.setDevicePixelRatio(5.3); this->notificationAreaIconLabelError->setPixmap(holdPixmap); - + holdPixmap = *(this->notificationAreaIconLabelInformation->pixmap()); holdPixmap.setDevicePixelRatio(5.3); this->notificationAreaIconLabelInformation->setPixmap(holdPixmap); - } diff --git a/src/dlgTriggerEditor.cpp b/src/dlgTriggerEditor.cpp index 3b88cd48944..4d410345b79 100644 --- a/src/dlgTriggerEditor.cpp +++ b/src/dlgTriggerEditor.cpp @@ -706,7 +706,7 @@ dlgTriggerEditor::dlgTriggerEditor(Host* pH) pixMap_begin_of_line_substring.fill(Qt::red); QIcon icon_begin_of_line_substring(pixMap_begin_of_line_substring); - QPixmap pixMap_exact_match(256,256); + QPixmap pixMap_exact_match(256, 256); pixMap_exact_match.fill(Qt::green); QIcon icon_exact_match(pixMap_exact_match); @@ -1984,7 +1984,7 @@ void dlgTriggerEditor::recursiveSearchTriggers(TTrigger* pTriggerParent, const Q QStringList textList = trigger->getRegexCodeList(); int total = textList.count(); for (int index = 0; index < total; ++index) { - if (textList.at(index).isEmpty() || ! textList.at(index).contains(s, ((mSearchOptions & SearchOptionCaseSensitive) ? Qt::CaseSensitive : Qt::CaseInsensitive))) { + if (textList.at(index).isEmpty() || !textList.at(index).contains(s, ((mSearchOptions & SearchOptionCaseSensitive) ? Qt::CaseSensitive : Qt::CaseInsensitive))) { // Short-cuts that mean we do not have to examine the line in more detail continue; } @@ -2013,7 +2013,7 @@ void dlgTriggerEditor::recursiveSearchTriggers(TTrigger* pTriggerParent, const Q textList = trigger->getScript().split("\n"); total = textList.count(); for (int index = 0; index < total; ++index) { - if (textList.at(index).isEmpty() || ! textList.at(index).contains(s, ((mSearchOptions & SearchOptionCaseSensitive) ? Qt::CaseSensitive : Qt::CaseInsensitive))) { + if (textList.at(index).isEmpty() || !textList.at(index).contains(s, ((mSearchOptions & SearchOptionCaseSensitive) ? Qt::CaseSensitive : Qt::CaseInsensitive))) { // Short-cuts that mean we do not have to examine the line in more detail continue; } @@ -2106,7 +2106,7 @@ void dlgTriggerEditor::recursiveSearchAlias(TAlias* pTriggerParent, const QStrin int total = textList.count(); for (int index = 0; index < total; ++index) { // CHECK: This may NOT be an optimisation...! - if (textList.at(index).isEmpty() || ! textList.at(index).contains(s, ((mSearchOptions & SearchOptionCaseSensitive) ? Qt::CaseSensitive : Qt::CaseInsensitive))) { + if (textList.at(index).isEmpty() || !textList.at(index).contains(s, ((mSearchOptions & SearchOptionCaseSensitive) ? Qt::CaseSensitive : Qt::CaseInsensitive))) { // Short-cuts that mean we do not have to examine the line in more detail continue; } @@ -2162,7 +2162,7 @@ void dlgTriggerEditor::recursiveSearchScripts(TScript* pTriggerParent, const QSt int total = textList.count(); for (int index = 0; index < total; ++index) { // CHECK: This may NOT be an optimisation...! - if (textList.at(index).isEmpty() || ! textList.at(index).contains(s, ((mSearchOptions & SearchOptionCaseSensitive) ? Qt::CaseSensitive : Qt::CaseInsensitive))) { + if (textList.at(index).isEmpty() || !textList.at(index).contains(s, ((mSearchOptions & SearchOptionCaseSensitive) ? Qt::CaseSensitive : Qt::CaseInsensitive))) { // Short-cuts that mean we do not have to examine the line in more detail continue; } @@ -2192,7 +2192,7 @@ void dlgTriggerEditor::recursiveSearchScripts(TScript* pTriggerParent, const QSt total = textList.count(); for (int index = 0; index < total; ++index) { // CHECK: This may NOT be an optimisation...! - if (textList.at(index).isEmpty() || ! textList.at(index).contains(s, ((mSearchOptions & SearchOptionCaseSensitive) ? Qt::CaseSensitive : Qt::CaseInsensitive))) { + if (textList.at(index).isEmpty() || !textList.at(index).contains(s, ((mSearchOptions & SearchOptionCaseSensitive) ? Qt::CaseSensitive : Qt::CaseInsensitive))) { // Short-cuts that mean we do not have to examine the line in more detail continue; } @@ -2286,7 +2286,7 @@ void dlgTriggerEditor::recursiveSearchActions(TAction* pTriggerParent, const QSt int total = textList.count(); for (int index = 0; index < total; ++index) { // CHECK: This may NOT be an optimisation...! - if (textList.at(index).isEmpty() || ! textList.at(index).contains(s, ((mSearchOptions & SearchOptionCaseSensitive) ? Qt::CaseSensitive : Qt::CaseInsensitive))) { + if (textList.at(index).isEmpty() || !textList.at(index).contains(s, ((mSearchOptions & SearchOptionCaseSensitive) ? Qt::CaseSensitive : Qt::CaseInsensitive))) { // Short-cuts that mean we do not have to examine the line in more detail continue; } @@ -2316,7 +2316,7 @@ void dlgTriggerEditor::recursiveSearchActions(TAction* pTriggerParent, const QSt total = textList.count(); for (int index = 0; index < total; ++index) { // CHECK: This may NOT be an optimisation...! - if (textList.at(index).isEmpty() || ! textList.at(index).contains(s, ((mSearchOptions & SearchOptionCaseSensitive) ? Qt::CaseSensitive : Qt::CaseInsensitive))) { + if (textList.at(index).isEmpty() || !textList.at(index).contains(s, ((mSearchOptions & SearchOptionCaseSensitive) ? Qt::CaseSensitive : Qt::CaseInsensitive))) { // Short-cuts that mean we do not have to examine the line in more detail continue; } @@ -2390,7 +2390,7 @@ void dlgTriggerEditor::recursiveSearchTimers(TTimer* pTriggerParent, const QStri int total = textList.count(); for (int index = 0; index < total; ++index) { // CHECK: This may NOT be an optimisation...! - if (textList.at(index).isEmpty() || ! textList.at(index).contains(s, ((mSearchOptions & SearchOptionCaseSensitive) ? Qt::CaseSensitive : Qt::CaseInsensitive))) { + if (textList.at(index).isEmpty() || !textList.at(index).contains(s, ((mSearchOptions & SearchOptionCaseSensitive) ? Qt::CaseSensitive : Qt::CaseInsensitive))) { // Short-cuts that mean we do not have to examine the line in more detail continue; } @@ -2464,7 +2464,7 @@ void dlgTriggerEditor::recursiveSearchKeys(TKey* pTriggerParent, const QString& int total = textList.count(); for (int index = 0; index < total; ++index) { // CHECK: This may NOT be an optimisation...! - if (textList.at(index).isEmpty() || ! textList.at(index).contains(s, ((mSearchOptions & SearchOptionCaseSensitive) ? Qt::CaseSensitive : Qt::CaseInsensitive))) { + if (textList.at(index).isEmpty() || !textList.at(index).contains(s, ((mSearchOptions & SearchOptionCaseSensitive) ? Qt::CaseSensitive : Qt::CaseInsensitive))) { // Short-cuts that mean we do not have to examine the line in more detail continue; } @@ -5589,11 +5589,11 @@ void dlgTriggerEditor::slot_action_selected(QTreeWidgetItem* pItem) mpActionsMainArea->groupBox_action_button_appearance->hide(); mpActionsMainArea->widget_top->hide(); mpSourceEditorArea->hide(); - } else if (!pT->getParent() || (pT->getParent() && !pT->getParent()->getPackageName().isEmpty())) - // We are a top-level folder with no parent - // OR: We have a parent and that IS a module master folder - // THUS: We are a toolbar - { + } else if (!pT->getParent() || (pT->getParent() && !pT->getParent()->getPackageName().isEmpty())) { + // We are a top-level folder with no parent + // OR: We have a parent and that IS a module master folder + // THUS: We are a toolbar + mpActionsMainArea->groupBox_action_bar->show(); mpActionsMainArea->groupBox_action_button_appearance->hide(); mpActionsMainArea->widget_top->show(); diff --git a/src/dlgTriggerEditor.h b/src/dlgTriggerEditor.h index e482c6eb757..e9ad033dd2b 100644 --- a/src/dlgTriggerEditor.h +++ b/src/dlgTriggerEditor.h @@ -340,7 +340,7 @@ private slots: void exportScriptToClipboard(); void exportKeyToClipboard(); - void clearDocument(edbee::TextEditorWidget* ew, const QString& initialText=QLatin1Literal("")); + void clearDocument(edbee::TextEditorWidget* ew, const QString& initialText = QLatin1Literal("")); void setAllSearchData(QTreeWidgetItem* pItem, const EditorViewType& type, const QString& name, const int& id, const SearchDataResultType& what, const int& pos = 0, const int& instance = 0, const int& subInstance = 0) { // Which is it? A Trigger, an alias etc: diff --git a/src/main.cpp b/src/main.cpp index 748ae20944a..ef1e8b66d98 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -28,9 +28,9 @@ #include #include #include -#if defined(Q_OS_WIN32) && ! defined(INCLUDE_UPDATER) +#if defined(Q_OS_WIN32) && !defined(INCLUDE_UPDATER) #include -#endif // defined(Q_OS_WIN32) && ! defined(INCLUDE_UPDATER) +#endif // defined(Q_OS_WIN32) && !defined(INCLUDE_UPDATER) #include #include #include "post_guard.h" @@ -133,7 +133,7 @@ QCoreApplication* createApplication(int& argc, char* argv[], unsigned int& actio void copyFont(const QString& externalPathName, const QString& resourcePathName, const QString& fileName) { if (!QFile::exists(QStringLiteral("%1/%2").arg(externalPathName, fileName))) { - QFile fileToCopy(QStringLiteral(":/%1/%2").arg(resourcePathName,fileName)); + QFile fileToCopy(QStringLiteral(":/%1/%2").arg(resourcePathName, fileName)); fileToCopy.copy(QStringLiteral("%1/%2").arg(externalPathName, fileName)); } } @@ -448,7 +448,7 @@ int main(int argc, char* argv[]) mudlet::debugMode = false; QString homeLink = QStringLiteral("%1/mudlet-data").arg(QDir::homePath()); -#ifdef Q_OS_WIN32 +#if defined(Q_OS_WIN32) /* * From Qt Documentation for: * bool QFile::link(const QString &linkName) diff --git a/src/mudlet.cpp b/src/mudlet.cpp index 5f32ba4f301..f54585fb5d2 100644 --- a/src/mudlet.cpp +++ b/src/mudlet.cpp @@ -2014,7 +2014,7 @@ bool mudlet::openWindow(Host* pHost, const QString& name, bool loadLayout) // The name is used in BOTH the QMaps of all user created TConsole // and TDockWidget instances - so we HAVE an existing user window, // Lets confirm this: - Q_ASSERT_X(console->getType()==TConsole::UserWindow, "mudlet::openWindow(...)", "An existing TConsole was expected to be marked as a User Window type but it isn't"); + Q_ASSERT_X(console->getType() == TConsole::UserWindow, "mudlet::openWindow(...)", "An existing TConsole was expected to be marked as a User Window type but it isn't"); dockwidget->update(); //do not change the ->show() order! Otherwise, it will automatically minimize the floating/dock window(!!) console->show(); @@ -2395,13 +2395,17 @@ bool mudlet::moveWindow(Host* pHost, const QString& name, int x1, int y1) if (pL) { pL->move(x1, y1); return true; - } else if (pC && !pD) { + } + + if (pC && !pD) { // NOT a floatable/dockable "user window" pC->move(x1, y1); pC->mOldX = x1; pC->mOldY = y1; return true; - } if (pC && pD) { + } + + if (pC && pD) { if (!pD->isFloating()) { // Undock a docked window pD->setFloating(true);