diff options
100 files changed, 746 insertions, 812 deletions
diff --git a/src/kvirc/kvs/kvi_kvs_parser.cpp b/src/kvirc/kvs/kvi_kvs_parser.cpp index 74ab1599d..939afaf9c 100644 --- a/src/kvirc/kvs/kvi_kvs_parser.cpp +++ b/src/kvirc/kvs/kvi_kvs_parser.cpp @@ -91,7 +91,7 @@ void KviKvsParser::report(bool bError,const QChar * pLocation,const QString &szM int iLine,iCol; KviKvsReport::findLineColAndListing(m_pBuffer,pLocation,iLine,iCol,pCodeListing); - + KviQString::sprintf(szLocation,__tr2qs_ctx("line %d, near character %d","kvs"),iLine,iCol); } else { szLocation = __tr2qs_ctx("beginning of input","kvs"); @@ -220,7 +220,7 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer // <string parameter body> ::= <anything except '"' or null>... // <command terminator> ::= ';' | '\n' | '\0' -// <data> ::= +// <data> ::= // <data_reference> ::= <function_call> | <structured_data> // <structured_data> ::= <data_structure> | <variable> | <pointer_data> // <data_structure> ::= <array> | <hash> @@ -392,7 +392,7 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer of IRC commands like [cmd]msg[/cmd]. It is almost unavoidable (read: the cost for avoiding it is too high). Note that using '|' or any other character as command terminator will NOT solve the problem: if the terminator is too difficult to type it will annoy the - scripters (and me), if it is too easy then there will be always someone that wants to use it + scripters (and me), if it is too easy then there will be always someone that wants to use it at the end (or in the middle) of a command with the original meaning. The solution is to escape the ';' character: [example] @@ -588,7 +588,7 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer maybe one day I'll implement it).[br] Starting from version 3.0.0 kvirc supports also C++ single line and C multiline comments.[br] A C++ comment starts with two slashes '//' and terminates with a newline. - A multiline C comment starts with '/*' and ends at the first '* /' encountered. + A multiline C comment starts with '/ *' and ends at the first '* /' encountered. Since KVIrc has no pre-processor, the C/C++ comments usually can't be placed in the middle of a command: they must start where a command would start and end before the begin of another command.[br] [/p] @@ -617,7 +617,7 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer adjust the tab size to match their taste. I personally prefer 4 character tabs while most text/code editors usually come with 8 characters as default. [/p] - + [big]And now ?[/big] [p] You're now ready to really start experimenting with KVS. You can take @@ -792,7 +792,7 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer [cmd]kick[/cmd] $0 %reason } [/example] - The example above will first check the validity of the <nickname> passed to kb: + The example above will first check the validity of the <nickname> passed to kb: if no nickname was passed , it will warn the user and stop. The next step will be the "ban <nickname>" call. Another enchancement is the "default reason": we first assign the remaining parameters ($1- means "from $1 to the end") to a temporary variable, @@ -838,8 +838,8 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer [/example] Is a perfectly valid call.... it's just that it will have no visible results (just because a command call implies ignoring the return value. - In fact there is no difference al all between function-aliases and normal-aliases: - the caller makes the difference: by calling an alias as a command the return value + In fact there is no difference al all between function-aliases and normal-aliases: + the caller makes the difference: by calling an alias as a command the return value just disappears in hyperspace, by calling an alias as a function , the return value is propagated (and in fact "used"). (There are some "nice" exceptions to this rule...but you don't need to care about it, for now). @@ -1015,7 +1015,7 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer The [b]logical name[/b] is a property of some kind of windows. It usually corresponds to the first part of the window caption. For example, for channel windows it is the channel name, for - queries it is the list of the targets. For some other windows + queries it is the list of the targets. For some other windows the logical name corresponds to the caption text. This will be discussed later.[br] The [b]type identifier[/b] describes the properties of a certain window. For channel windows the type identifier is "channel" , for query windows is "query" , @@ -1194,7 +1194,7 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer [cmd]kick[/cmd] $0 %reason } [/example] - The example above will first check the validity of the <nickname> passed to kb: + The example above will first check the validity of the <nickname> passed to kb: if no nickname was passed , it will warn the user and stop. The next step will be the "ban <nickname>" call. Another enchancement is the "default reason": we first assign the remaining parameters ($1- means "from $1 to the end") to a temporary variable, @@ -1240,8 +1240,8 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer [/example] Is a perfectly valid call.... it's just that it will have no visible results (just because a command call implies ignoring the return value. - In fact there is no difference al all between function-aliases and normal-aliases: - the caller makes the difference: by calling an alias as a command the return value + In fact there is no difference al all between function-aliases and normal-aliases: + the caller makes the difference: by calling an alias as a command the return value just disappears in hyperspace, by calling an alias as a function , the return value is propagated (and in fact "used"). (There are some "nice" exceptions to this rule...but you don't need to care about it, for now). @@ -1571,7 +1571,7 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer [br] <entity> indicates a ENTITY THAT CAN APPEAR EXACTLY ONE TIME.[br] [<entity>] indicates an OPTIONAL ENTITY.[br] - {<entity>} indicates an ENTITY THAT CAN APPEAR ONE OR MORE TIMES.[br] + {<entity>} indicates an ENTITY THAT CAN APPEAR ONE OR MORE TIMES.[br] 'entity' indicates a LITERAL ENTITY: written exactly as it is.[br] <entity1>|<entity2> indicates mutually exclusive choices.[br] The mutually exclusive choices are often separated in two or more @@ -1640,7 +1640,7 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer [tr] [td]<simple command>[/td] [td][<module name>'.']<command name>[<switch list>]{<space>}<command dependant part>[/td] - [/tr] + [/tr] [tr] [td]<lvalue command>[/td] [td]<variable>[<space>]<operation>[/td] @@ -1733,7 +1733,7 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer @type: language @keyterms: - global variable, global variables, local variable, local variables, + global variable, global variables, local variable, local variables, variables, variable, array, hash, dictionary, global variables, local variables,variable evaluation, associative arrays, scalars, data types, percent sign, extended scope @title: @@ -1837,7 +1837,7 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer [p] The scalars are simple variables containing a single value (a string or an integer). [/p] - + [example] [comment]# %a is a scalar variable[/comment] %a = "This is a string" @@ -1847,7 +1847,7 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer [/example] [subtitle]Arrays[/subtitle] - + [p] Arrays are collections of items indexed by integers. The array items are selected by placing the index in square brackets just after the array name. @@ -1856,7 +1856,7 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer [example] %arrayName[index] [/example] - + [p] An easy way to create an array is to use the [fnc]$array[/fnc] function. [/p] @@ -1923,7 +1923,7 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer Be aware that [cmd]foreach[/cmd] will NOT iterate over unset items in the array unless you use the -a switch. [/p] - + [example] %Array[0]=Pippo %Array[1]=Pluto @@ -1931,7 +1931,7 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer %Array[5]=Prova [cmd]foreach[/cmd](%item,%Array)[cmd]echo[/cmd] Got Item: %item [/example] - + [p] Note that the items 3 and 4 are simply skipped. [/p] @@ -1960,13 +1960,13 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer echo "KEY:" %key "VALUE:" %a{%key}; } [/example] - + [p] Note that in the example above %a refers to the whole hash while %a{%i} refers to one of its elements, in particular the one with the key %key. You also create a hash by explicitly assigning to one of its elements: [/p] - + [example] %a{"MyKey"} = "MyValue" [/example] @@ -1982,7 +1982,7 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer KVS is not strictly typed: any variable can assume different type identities at different times, even in the same script. [/p] - + [example] [comment]# %a is a scalar[/comment] %a = "This is a string" @@ -1991,7 +1991,7 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer [comment]# %a becomes a hash with two values[/comment] %a = $hash("key1","value1","key2","value2"); [/example] - + [p] In literature this kind of variable is called [b]variant[/b] and this is the term that you will find all around the documentation when an explicit @@ -2003,7 +2003,7 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer of arrays, hashes of arrays of hashes and any other multidimensional combination you like. However remember that hash keys are strings and not variants so you can't use an array as hash key. [/p] - + [example] [comment]# here we eat 256 locations of memory at once :)[/comment] %a[16][16] = 10 @@ -2017,23 +2017,23 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer For example, when you put an array in a place where a scalar is requested, KVIrc automatically transforms it to a scalar string by joining all the items with a comma. [/p] - + [example] %a = $array("element1","element2","element3"); echo %a; [comment]# echo expects its arguments to be scalar[/comment] [/example] - + [p] Conversely, when you put a scalar in place of an array, KVIrc automatically transforms it to an array with a single item. In this way a function like [fnc]$sort[/fnc] works also with a scalar. [/p] - + [p] In literature the conversions between data types are called [b]casts[/b]. When the conversion is automatic the cast is said to be [b]implicit[/b]. [/p] - + [p] KVS handles also the other possible implicit casts: scalar->hash,hash->scalar,array->hash,hash->array. Experiment with it. @@ -2045,40 +2045,40 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer Internally KVS is implicitly typed: the "scalar" data type is in fact a set of types that KVIrc manages silently. The types are: integer, string, real, boolean and hobject. [/p] - + [p] Integers are non-floating point numbers. Their allowable range depends on the underlying platform integer size: usually 32 or 64 bit. [/p] - + [p] Reals are floating point numbers. Their allowable range and precision depends on the underlying platform. [/p] - + [p] Booleans are either true or false values. [/p] - + [p] Hobject stands for Handle to Object and it is a sort of a C++ pointer. Detailed description of objects is in [doc:objects]this document[/doc]. [/p] - + [p] Basically anything else fails in the "string" category. [/p] - + [p] In most cases KVS manages all the conversions between data types automatically. For example an integer becomes a true boolean when it's non zero and a false boolean otherwise, a real becomes an integer by truncating it's fractional part... [/p] - + [p] You can find out the type of a specified variable by using the [fnc]$typeof[/fnc]() function. [/p] - + [example] %a = 1 echo $typeof(%a) @@ -2089,24 +2089,24 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer %a = "test" echo $typeof(%a) [/example] - + [p] There is also another subtle type of scalar called "nothing". It stands for an empty (unset) variable. [/p] - + [example] %a = $nothing echo $typeof(%a) [/example] - + [p] Nothing is something in between a data type and a special value for all the other data types: - it rappresents absence of information. + it rappresents absence of information. This may look a bit confusing but realize that all the unreferenced KVS variable are in fact of type "nothing": they just don't exist. This means that you can use [fnc]$nothing[/fnc]() to effectively unset a variable. [p] - + [p] Again, when possible, the conversion between nothing and the other data types is performed automatically. Nothing becomes an empty string, a null object handle or an empty array. @@ -2114,18 +2114,18 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer [title]Explicit casts[/title] - + [p] You can make explicit conversions between some data types by using the casting functions. [fnc]$integer[/fnc]() will attempt to convert the variant parameter to an integer, [fnc]$real[/fnc]() will cast to a floating point value, [fnc]$boolean[/fnc]() will convert to a - true/false value, [fnc]$string[/fnc]() will explicitly convert to a string, + true/false value, [fnc]$string[/fnc]() will explicitly convert to a string, [fnc]$array[/fnc]() will convert to an array and [fnc]$hash[/fnc] will return a dictionary. By assigning the special [fnc]$nothing[/fnc]() value you will convert to the nothing data type (or simply unset the variable). The only explicit conversion that is not possible is to hobject. [/p] - + [p] As stated several times in this document, KVS tries to manage the casts automatically so you usually don't need to care about it. The explicit casts are provided for @@ -2142,12 +2142,12 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer not care about it and just leave the KVS engine to do his cleaning job but it's still worth knowing that you actually can force KVIrc to free the memory used by a variable. [/p] - + [p] The first method to explicitly destroy a variable is to call [cmd]unset[/cmd] on it. [cmd]unset[/cmd] in fact accepts a list of variables so you can destroy more variables at once. [/p] - + [example] %a = [fnc]$array[/fnc]("data","for","a","really","huge","array","of","items") %b = 10 @@ -2167,7 +2167,7 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer %a = ""; [comment]# %a is in fact unset[/comment] %b = ; [comment]# syntactically this is just the same as above[/comment] [/example] - + [p] Note that because of mutability of variables (explained above) you can use the empty string assignment also to free arrays and hashes. @@ -2194,7 +2194,7 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer [/p] [title]Variable evaluation[/title] - + [p] A variable can appear in every place where a parameter is expected: so after the command name, after a switch or inside @@ -2282,7 +2282,7 @@ bool KviKvsParser::skipSpacesAndNewlines() { KVSP_skipChar; } - + switch(KVSP_curCharUnicode) { case '\\': @@ -2416,11 +2416,11 @@ KviKvsTreeNodeData * KviKvsParser::parsePercentOrDollar(bool bInObjScope) // this is @ static QString szStrayAtRoutineName("@"); static QString szMightBeStrayAtOrThisRoutineName("@?"); - + pBegin = KVSP_curCharPointer; - + KVSP_skipChar; - + if(bInObjScope || ((KVSP_curCharUnicode != '$') && (KVSP_curCharUnicode != '%'))) { // we're sure this is just a stray @ @@ -2482,20 +2482,20 @@ KviKvsTreeNodeData * KviKvsParser::parsePercentOrDollar(bool bInObjScope) return new KviKvsTreeNodeArrayReferenceAssert(pBegin,r); } } - + KviKvsTreeNodeExpression * e = parseExpression(']'); if(!e) { delete r; return 0; } - + r = new KviKvsTreeNodeArrayElement(pBegin,r,e); } else { // hash key KVSP_skipChar; skipSpaces(); - + if(KVSP_curCharUnicode == '}') { // entire hash ? @@ -2507,7 +2507,7 @@ KviKvsTreeNodeData * KviKvsParser::parsePercentOrDollar(bool bInObjScope) } return new KviKvsTreeNodeHashReferenceAssert(pBegin,r); } - + KviKvsTreeNodeData * i = parseHashKey(); if(!i) { @@ -2515,11 +2515,11 @@ KviKvsTreeNodeData * KviKvsParser::parsePercentOrDollar(bool bInObjScope) delete r; return 0; } - + KVSP_ASSERT(KVSP_curCharUnicode == '}'); - + KVSP_skipChar; - + r = new KviKvsTreeNodeHashElement(pBegin,r,i); } } @@ -2585,7 +2585,7 @@ handle_scope_operator: delete r; return 0; } - + if(!r2->canEvaluateInObjectScope()) { // ops... it really wasn't @@ -2640,10 +2640,10 @@ KviKvsTreeNodeVariable * KviKvsParser::parsePercent(bool bInObjScope) } return new KviKvsTreeNodeExtendedScopeVariable(pBegin,szIdentifier); } - + if(bInObjScope) return new KviKvsTreeNodeObjectField(pBegin,szIdentifier); - + if(m_pGlobals) { if(m_pGlobals->find(szIdentifier))return new KviKvsTreeNodeGlobalVariable(pBegin,szIdentifier); @@ -2666,7 +2666,7 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseInstruction() { switch(KVSP_curCharUnicode) { - case '#': + case '#': case '/': (void)parseComment(); // this will return 0 anyway return 0; @@ -2777,9 +2777,9 @@ KviKvsTreeNodeSwitchList * KviKvsParser::parseCommandSwitchList() { const QChar * pBegin = KVSP_curCharPointer; KVSP_skipChar; - + bool bLong = false; - + if(KVSP_curCharUnicode == '-') { // long switch @@ -2807,7 +2807,7 @@ KviKvsTreeNodeSwitchList * KviKvsParser::parseCommandSwitchList() } else { delete sw; warning(pBegin,__tr2qs_ctx("The dash after a command should be followed by a letter (switch), by a digit (negative number) or be escaped","kvs")); - + if(KVSP_curCharUnicode == 0) { error(KVSP_curCharPointer,__tr2qs_ctx("Unexpected character '%q' (unicode %x) after a switch dash","kvs"),KVSP_curCharPointer,KVSP_curCharUnicode); @@ -2947,7 +2947,7 @@ KviPointerList<QString> * KviKvsParser::parseCommaSeparatedParameterListNoTree() QString * s = new QString(pBegin,KVSP_curCharPointer - pBegin); s->trimmed(); l->append(s); - + switch(KVSP_curCharUnicode) { case ',': @@ -3009,7 +3009,7 @@ KviKvsTreeNodeDataList * KviKvsParser::parseCommaSeparatedParameterList() return 0; } l->addItem(p); - + switch(KVSP_curCharUnicode) { case ',': @@ -3395,7 +3395,7 @@ KviKvsTreeNodeData * KviKvsParser::parseHashKey() break; case '"': { - // string + // string KviKvsTreeNodeData * p = parseStringParameter(); if(!p) { diff --git a/src/kvirc/kvs/kvi_kvs_popupmenu.cpp b/src/kvirc/kvs/kvi_kvs_popupmenu.cpp index 76e4141ae..533a2e78c 100644 --- a/src/kvirc/kvs/kvi_kvs_popupmenu.cpp +++ b/src/kvirc/kvs/kvi_kvs_popupmenu.cpp @@ -131,7 +131,7 @@ KviKvsPopupMenuItemSeparator::~KviKvsPopupMenuItemSeparator() { } -void KviKvsPopupMenuItemSeparator::fill(KviKvsPopupMenu * pMenu,KviKvsPopupMenuTopLevelData * pData,int iIdx) +void KviKvsPopupMenuItemSeparator::fill(KviKvsPopupMenu * pMenu,KviKvsPopupMenuTopLevelData * pData,int) { if(!evaluateCondition(pData))return; pMenu->insertSeparator(); @@ -310,7 +310,7 @@ void KviKvsPopupMenuItemLabel::clear() } } -void KviKvsPopupMenuItemLabel::fill(KviKvsPopupMenu * pMenu,KviKvsPopupMenuTopLevelData * pData,int iIdx) +void KviKvsPopupMenuItemLabel::fill(KviKvsPopupMenu * pMenu,KviKvsPopupMenuTopLevelData * pData,int) { if(!evaluateCondition(pData))return; QString szText = evaluateText(pData); diff --git a/src/kvirc/kvs/kvi_kvs_report.cpp b/src/kvirc/kvs/kvi_kvs_report.cpp index c4043634f..b952b6307 100644 --- a/src/kvirc/kvs/kvi_kvs_report.cpp +++ b/src/kvirc/kvs/kvi_kvs_report.cpp @@ -48,7 +48,6 @@ void KviKvsReport::findLineAndCol(const QChar * pBegin,const QChar * pPoint,int { iLine = 1; - const QChar * pBufferBegin = pBegin; const QChar * pPrevLine = 0; const QChar * pLineBegin = pBegin; @@ -67,7 +66,7 @@ void KviKvsReport::findLineAndCol(const QChar * pBegin,const QChar * pPoint,int } us = pBegin->unicode(); } - + iCol = (pBegin - pLineBegin) + 1; } @@ -96,9 +95,9 @@ void KviKvsReport::findLineColAndListing(const QChar * pBegin,const QChar * pPoi } us = pBegin->unicode(); } - + iCol = (pBegin - pLineBegin) + 1; - + // previous line if(pPrevLine) { @@ -116,7 +115,7 @@ void KviKvsReport::findLineColAndListing(const QChar * pBegin,const QChar * pPoi pListingStr->replace("\n",""); pListing->append(pListingStr); } - + // current line pBegin = pLineBegin; @@ -140,7 +139,7 @@ void KviKvsReport::findLineColAndListing(const QChar * pBegin,const QChar * pPoi { // next line pLineBegin = pBegin; - + us = pBegin->unicode(); while(us && (us != '\n')) { @@ -148,7 +147,7 @@ void KviKvsReport::findLineColAndListing(const QChar * pBegin,const QChar * pPoi us = pBegin->unicode(); } if(us)pBegin++; - + { QString * pListingStr = new QString(); KviQString::sprintf(*pListingStr,"%d ",iLine + 1); @@ -156,7 +155,7 @@ void KviKvsReport::findLineColAndListing(const QChar * pBegin,const QChar * pPoi pListingStr->replace("\n",""); pListing->append(pListingStr); } - + // there would be yet another line if(us) { @@ -185,8 +184,8 @@ void KviKvsReport::report(KviKvsReport * r,KviWindow * pOutput) // make sure that the output window still exists! - int out; - + int out=0; + switch(r->type()) { case KviKvsReport::ParserWarning: @@ -206,29 +205,29 @@ void KviKvsReport::report(KviKvsReport * r,KviWindow * pOutput) pOutput->output(out,__tr2qs_ctx("[KVS]%c Runtime Error: %Q","kvs"),KVI_TEXT_BOLD,&(r->message())); break; } - + if(r->location().isEmpty()) pOutput->output(out,__tr2qs_ctx("[KVS] in script context \"%Q\"","kvs"),&(r->context())); else pOutput->output(out,__tr2qs_ctx("[KVS] in script context \"%Q\", %Q","kvs"),&(r->context()),&(r->location())); - + if(pOutput == KviDebugWindow::instance()) { KviPointerList<QString> * l; - if(l = r->codeListing()) + if( (l = r->codeListing()) ) { pOutput->outputNoFmt(out,__tr2qs_ctx("[KVS] Code listing:","kvs")); for(QString * s = l->first();s;s = l->next()) pOutput->output(out,"[KVS] %Q",s); } - + pOutput->output(out,__tr2qs_ctx("[KVS] Window:","kvs")); if(g_pApp->windowExists(r->window())) pOutput->output(out,"[KVS] %Q [id: %u]",&(r->window()->windowName()),r->window()->numericId()); else pOutput->output(out,__tr2qs_ctx("[KVS] Destroyed window with pointer %x","kvs"),r->window()); - if(l = r->callStack()) + if( (l = r->callStack()) ) { pOutput->outputNoFmt(out,__tr2qs_ctx("[KVS] Call stack:","kvs")); for(QString * s = l->first();s;s = l->next()) diff --git a/src/kvirc/kvs/kvi_kvs_treenode_constantdata.cpp b/src/kvirc/kvs/kvi_kvs_treenode_constantdata.cpp index fa9f9ddc6..2688d1e75 100644 --- a/src/kvirc/kvs/kvi_kvs_treenode_constantdata.cpp +++ b/src/kvirc/kvs/kvi_kvs_treenode_constantdata.cpp @@ -52,7 +52,7 @@ bool KviKvsTreeNodeConstantData::convertStringConstantToNumeric() m_pValue->setInteger(iVal); return true; } - + kvs_real_t dVal; if(m_pValue->asReal(dVal)) { @@ -71,7 +71,7 @@ void KviKvsTreeNodeConstantData::dump(const char * prefix) m_pValue->dump(tmp.toUtf8().data()); } -bool KviKvsTreeNodeConstantData::evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pBuffer) +bool KviKvsTreeNodeConstantData::evaluateReadOnly(KviKvsRunTimeContext *,KviKvsVariant * pBuffer) { pBuffer->copyFrom(m_pValue); return true; diff --git a/src/kvirc/kvs/kvi_kvs_treenode_data.cpp b/src/kvirc/kvs/kvi_kvs_treenode_data.cpp index 04665971d..d47e81a8c 100644 --- a/src/kvirc/kvs/kvi_kvs_treenode_data.cpp +++ b/src/kvirc/kvs/kvi_kvs_treenode_data.cpp @@ -78,7 +78,7 @@ bool KviKvsTreeNodeData::canReleaseResult() } */ -bool KviKvsTreeNodeData::evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pBuffer) +bool KviKvsTreeNodeData::evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant *) { c->error(this,__tr2qs_ctx("Internal error: pure virtual evaluateReadOnly called","kvs")); return false; @@ -91,13 +91,13 @@ KviKvsRWEvaluationResult * KviKvsTreeNodeData::evaluateReadWrite(KviKvsRunTimeCo } -bool KviKvsTreeNodeData::evaluateReadOnlyInObjectScope(KviKvsObject * o,KviKvsRunTimeContext * c,KviKvsVariant * pBuffer) +bool KviKvsTreeNodeData::evaluateReadOnlyInObjectScope(KviKvsObject *,KviKvsRunTimeContext * c,KviKvsVariant * ) { c->error(this,__tr2qs_ctx("Internal error: pure virtual evaluateReadOnlyInObjectScope called","kvs")); return false; } -KviKvsRWEvaluationResult * KviKvsTreeNodeData::evaluateReadWriteInObjectScope(KviKvsObject * o,KviKvsRunTimeContext * c) +KviKvsRWEvaluationResult * KviKvsTreeNodeData::evaluateReadWriteInObjectScope(KviKvsObject * ,KviKvsRunTimeContext * c) { c->error(this,__tr2qs_ctx("Internal error: trying to evaluate as read-write a read-only data location","kvs")); return 0; diff --git a/src/kvirc/kvs/kvi_kvs_treenode_expression.cpp b/src/kvirc/kvs/kvi_kvs_treenode_expression.cpp index a7856849f..e94e48fff 100644 --- a/src/kvirc/kvs/kvi_kvs_treenode_expression.cpp +++ b/src/kvirc/kvs/kvi_kvs_treenode_expression.cpp @@ -148,7 +148,7 @@ void KviKvsTreeNodeExpressionConstantOperand::dump(const char * prefix) m_pConstant->dump(tmp.toUtf8().data()); } -bool KviKvsTreeNodeExpressionConstantOperand::evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pBuffer) +bool KviKvsTreeNodeExpressionConstantOperand::evaluateReadOnly(KviKvsRunTimeContext *,KviKvsVariant * pBuffer) { pBuffer->copyFrom(m_pConstant); return true; @@ -473,7 +473,7 @@ PREIMPLEMENT_BINARY_OPERATOR(KviKvsTreeNodeExpressionBinaryOperatorMultiplicatio bool KviKvsTreeNodeExpressionBinaryOperatorMultiplication::evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pBuffer) { - if(!evaluateOperands(c))return false; + if(!evaluateOperands(c))return false; if(m_nLeft.isInteger()) { if(m_nRight.isInteger())pBuffer->setInteger(m_nLeft.integer() * m_nRight.integer()); @@ -518,7 +518,7 @@ PREIMPLEMENT_BINARY_OPERATOR(KviKvsTreeNodeExpressionBinaryOperatorModulus,"Expr bool KviKvsTreeNodeExpressionBinaryOperatorModulus::evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pBuffer) { - if(!evaluateOperands(c))return false; + if(!evaluateOperands(c))return false; if(m_nRight.isInteger()) { diff --git a/src/kvirc/kvs/kvi_kvs_treenode_objectfield.cpp b/src/kvirc/kvs/kvi_kvs_treenode_objectfield.cpp index c9142ec32..3cffe5874 100644 --- a/src/kvirc/kvs/kvi_kvs_treenode_objectfield.cpp +++ b/src/kvirc/kvs/kvi_kvs_treenode_objectfield.cpp @@ -53,7 +53,7 @@ bool KviKvsTreeNodeObjectField::canEvaluateInObjectScope() return true; } -bool KviKvsTreeNodeObjectField::evaluateReadOnlyInObjectScope(KviKvsObject * o,KviKvsRunTimeContext * c,KviKvsVariant * pBuffer) +bool KviKvsTreeNodeObjectField::evaluateReadOnlyInObjectScope(KviKvsObject * o,KviKvsRunTimeContext *,KviKvsVariant * pBuffer) { KviKvsVariant * v = o->dataContainer()->find(m_szIdentifier); if(v)pBuffer->copyFrom(v); @@ -61,7 +61,7 @@ bool KviKvsTreeNodeObjectField::evaluateReadOnlyInObjectScope(KviKvsObject * o,K return true; } -KviKvsRWEvaluationResult * KviKvsTreeNodeObjectField::evaluateReadWriteInObjectScope(KviKvsObject * o,KviKvsRunTimeContext * c) +KviKvsRWEvaluationResult * KviKvsTreeNodeObjectField::evaluateReadWriteInObjectScope(KviKvsObject * o,KviKvsRunTimeContext *) { return new KviKvsHashElement(0,o->dataContainer()->get(m_szIdentifier),o->dataContainer(),m_szIdentifier); } diff --git a/src/kvirc/kvs/kvi_kvs_treenode_specialcommanddefpopup.cpp b/src/kvirc/kvs/kvi_kvs_treenode_specialcommanddefpopup.cpp index b98f6a154..ae9e201cb 100644 --- a/src/kvirc/kvs/kvi_kvs_treenode_specialcommanddefpopup.cpp +++ b/src/kvirc/kvs/kvi_kvs_treenode_specialcommanddefpopup.cpp @@ -59,7 +59,7 @@ void KviKvsTreeNodeSpecialCommandDefpopupLabelExtpopup::dump(const char * prefix qDebug("%s",x.toUtf8().data()); } -bool KviKvsTreeNodeSpecialCommandDefpopupLabelExtpopup::execute(KviKvsRunTimeContext * c,KviKvsPopupMenu * p) +bool KviKvsTreeNodeSpecialCommandDefpopupLabelExtpopup::execute(KviKvsRunTimeContext *,KviKvsPopupMenu * p) { p->addExtPopup(m_szItemName,m_szName,m_szText,m_szIcon,m_szCondition); return true; @@ -95,7 +95,7 @@ void KviKvsTreeNodeSpecialCommandDefpopupLabelItem::dump(const char * prefix) qDebug("%s",x.toUtf8().data()); } -bool KviKvsTreeNodeSpecialCommandDefpopupLabelItem::execute(KviKvsRunTimeContext * c,KviKvsPopupMenu * p) +bool KviKvsTreeNodeSpecialCommandDefpopupLabelItem::execute(KviKvsRunTimeContext *,KviKvsPopupMenu * p) { p->addItem(m_szItemName,m_szInstruction,m_szText,m_szIcon,m_szCondition); return true; @@ -126,7 +126,7 @@ void KviKvsTreeNodeSpecialCommandDefpopupLabelLabel::dump(const char * prefix) qDebug("%s",x.toUtf8().data()); } -bool KviKvsTreeNodeSpecialCommandDefpopupLabelLabel::execute(KviKvsRunTimeContext * c,KviKvsPopupMenu * p) +bool KviKvsTreeNodeSpecialCommandDefpopupLabelLabel::execute(KviKvsRunTimeContext *,KviKvsPopupMenu * p) { p->addLabel(m_szItemName,m_szText,m_szIcon,m_szCondition); return true; @@ -147,7 +147,7 @@ void KviKvsTreeNodeSpecialCommandDefpopupLabelSeparator::dump(const char * prefi debug("%s",tmp.toUtf8().data()); } -bool KviKvsTreeNodeSpecialCommandDefpopupLabelSeparator::execute(KviKvsRunTimeContext * c,KviKvsPopupMenu * p) +bool KviKvsTreeNodeSpecialCommandDefpopupLabelSeparator::execute(KviKvsRunTimeContext *,KviKvsPopupMenu * p) { p->addSeparator(m_szItemName,m_szCondition); return true; @@ -168,7 +168,7 @@ void KviKvsTreeNodeSpecialCommandDefpopupLabelEpilogue::dump(const char * prefix debug("%s",tmp.toUtf8().data()); } -bool KviKvsTreeNodeSpecialCommandDefpopupLabelEpilogue::execute(KviKvsRunTimeContext * c,KviKvsPopupMenu * p) +bool KviKvsTreeNodeSpecialCommandDefpopupLabelEpilogue::execute(KviKvsRunTimeContext *,KviKvsPopupMenu * p) { p->addEpilogue(m_szItemName,m_szInstruction); return true; @@ -189,7 +189,7 @@ void KviKvsTreeNodeSpecialCommandDefpopupLabelPrologue::dump(const char * prefix debug("%s",tmp.toUtf8().data()); } -bool KviKvsTreeNodeSpecialCommandDefpopupLabelPrologue::execute(KviKvsRunTimeContext * c,KviKvsPopupMenu * p) +bool KviKvsTreeNodeSpecialCommandDefpopupLabelPrologue::execute(KviKvsRunTimeContext *,KviKvsPopupMenu * p) { p->addPrologue(m_szItemName,m_szInstruction); return true; diff --git a/src/kvirc/kvs/kvi_kvs_treenode_specialcommandswitch.cpp b/src/kvirc/kvs/kvi_kvs_treenode_specialcommandswitch.cpp index 7ea912bd0..8254a6761 100644 --- a/src/kvirc/kvs/kvi_kvs_treenode_specialcommandswitch.cpp +++ b/src/kvirc/kvs/kvi_kvs_treenode_specialcommandswitch.cpp @@ -112,10 +112,10 @@ bool KviKvsTreeNodeSpecialCommandSwitchLabelCase::execute(KviKvsRunTimeContext * // string comparision, case insensitive QString reg; v.asString(reg); - + QString val; pRealParameter->asString(val); - + if(reg.toLower() != val.toLower())return true; } @@ -256,7 +256,7 @@ void KviKvsTreeNodeSpecialCommandSwitchLabelDefault::dump(const char * prefix) if(m_pInstruction)m_pInstruction->dump(tmp.toUtf8().data()); } -bool KviKvsTreeNodeSpecialCommandSwitchLabelDefault::execute(KviKvsRunTimeContext * c,KviKvsVariant * pRealParameter) +bool KviKvsTreeNodeSpecialCommandSwitchLabelDefault::execute(KviKvsRunTimeContext * c,KviKvsVariant *) { if(m_pInstruction) { diff --git a/src/kvirc/kvs/kvi_kvs_variant.cpp b/src/kvirc/kvs/kvi_kvs_variant.cpp index b207d45dc..5482241e8 100644 --- a/src/kvirc/kvs/kvi_kvs_variant.cpp +++ b/src/kvirc/kvs/kvi_kvs_variant.cpp @@ -402,7 +402,7 @@ void KviKvsVariant::castToArray(KviKvsArrayCast *c) const c->set(new KviKvsArray(),true); return; } - + switch(m_pData->m_eType) { case KviKvsVariantData::Array: @@ -440,7 +440,7 @@ void KviKvsVariant::convertToArray() setArray(new KviKvsArray()); return; } - + switch(m_pData->m_eType) { case KviKvsVariantData::Array: @@ -622,18 +622,18 @@ void KviKvsVariant::dump(const char * prefix) const { if(!m_pData) { - debug("%s Nothing [this=0x%lx]",prefix,this); + debug("%s Nothing [this=0x%lx]",prefix,(long unsigned int) this); return; } switch(m_pData->m_eType) { - case KviKvsVariantData::String: debug("%s String(%s) [this=0x%lx]",prefix,m_pData->m_u.pString->toUtf8().data(),this); break; - case KviKvsVariantData::Array: debug("%s Array(ptr=0x%lx) [this=0x%lx]",prefix,m_pData->m_u.pArray,this); break; - case KviKvsVariantData::Hash: debug("%s Hash(ptr=0x%lx,dict=0x%lx) [this=0x%lx]",prefix,m_pData->m_u.pHash,m_pData->m_u.pHash->dict(),this); break; - case KviKvsVariantData::Integer: debug("%s Integer(%d) [this=0x%lx]",prefix,m_pData->m_u.iInteger,this); break; - case KviKvsVariantData::Real: debug("%s Real(%f) [this=0x%lx]",prefix,*(m_pData->m_u.pReal),this); break; - case KviKvsVariantData::Boolean: debug("%s Boolean(%s) [this=0x%lx]",prefix,m_pData->m_u.bBoolean ? "true" : "false",this); break; - case KviKvsVariantData::HObject: debug("%s HObject(%lx) [this=0x%lx]",prefix,m_pData->m_u.hObject,this); break; + case KviKvsVariantData::String: debug("%s String(%s) [this=0x%lx]",prefix,m_pData->m_u.pString->toUtf8().data(),(long unsigned int)this); break; + case KviKvsVariantData::Array: debug("%s Array(ptr=0x%lx) [this=0x%lx]",prefix,(long unsigned int)m_pData->m_u.pArray,(long unsigned int)this); break; + case KviKvsVariantData::Hash: debug("%s Hash(ptr=0x%lx,dict=0x%lx) [this=0x%lx]",prefix,(long unsigned int)m_pData->m_u.pHash,(long unsigned int)m_pData->m_u.pHash->dict(),(long unsigned int)this); break; + case KviKvsVariantData::Integer: debug("%s Integer(%d) [this=0x%lx]",prefix,m_pData->m_u.iInteger,(long unsigned int)this); break; + case KviKvsVariantData::Real: debug("%s Real(%f) [this=0x%lx]",prefix,*(m_pData->m_u.pReal),(long unsigned int)this); break; + case KviKvsVariantData::Boolean: debug("%s Boolean(%s) [this=0x%lx]",prefix,m_pData->m_u.bBoolean ? "true" : "false",(long unsigned int)this); break; + case KviKvsVariantData::HObject: debug("%s HObject(%lx) [this=0x%lx]",prefix,(long unsigned int)m_pData->m_u.hObject,(long unsigned int)this); break; default: /* make gcc happy */ break; } } @@ -766,7 +766,7 @@ public: return v2->m_pData->m_u.bBoolean ? CMP_OTHERGREATER : CMP_EQUAL; return v2->m_pData->m_u.bBoolean ? CMP_EQUAL : CMP_THISGREATER; } - + static inline int compare_integer_hash(const KviKvsVariant * v1,const KviKvsVariant * v2) { if(v1->m_pData->m_u.iInteger == 0) @@ -852,7 +852,7 @@ public: } return CMP_THISGREATER; } - + static inline int compare_string_hobject(const KviKvsVariant * v1,const KviKvsVariant * v2) { if(v2->m_pData->m_u.hObject == (kvs_hobject_t)0) @@ -865,7 +865,7 @@ public: if(dReal == 0)return CMP_EQUAL; } } - + return CMP_THISGREATER; } @@ -1223,7 +1223,7 @@ KviKvsVariant* KviKvsVariant::unserializeHash(const QChar** aux) return 0; } (*aux)++; - + //getting element pElement = unserialize(aux); @@ -1361,7 +1361,7 @@ KviKvsVariant* KviKvsVariant::unserialize(const QString& data) KviKvsVariant* pResult = 0; const QChar * aux = (const QChar *)data.constData(); - + pResult = unserialize(&aux); if(aux->unicode()) @@ -1515,6 +1515,8 @@ int KviKvsVariant::compare(const KviKvsVariant * pOther,bool bPreferNumeric) con case KviKvsVariantData::HObject: return KviKvsVariantComparison::compare_string_hobject(this,pOther); break; + default: + break; } break; case KviKvsVariantData::Hash: @@ -1542,6 +1544,8 @@ int KviKvsVariant::compare(const KviKvsVariant * pOther,bool bPreferNumeric) con case KviKvsVariantData::HObject: return -1 * KviKvsVariantComparison::compare_hobject_hash(pOther,this); break; + default: + break; } break; case KviKvsVariantData::Array: @@ -1567,6 +1571,8 @@ int KviKvsVariant::compare(const KviKvsVariant * pOther,bool bPreferNumeric) con case KviKvsVariantData::HObject: return -1 * KviKvsVariantComparison::compare_hobject_array(pOther,this); break; + default: + break; } break; case KviKvsVariantData::Boolean: @@ -1595,6 +1601,8 @@ int KviKvsVariant::compare(const KviKvsVariant * pOther,bool bPreferNumeric) con case KviKvsVariantData::HObject: return KviKvsVariantComparison::compare_boolean_hobject(this,pOther); break; + default: + break; } break; default: // should never happen anyway diff --git a/src/kvirc/ui/kvi_frame.cpp b/src/kvirc/ui/kvi_frame.cpp index ca806fceb..2a65a1da4 100644 --- a/src/kvirc/ui/kvi_frame.cpp +++ b/src/kvirc/ui/kvi_frame.cpp @@ -222,7 +222,7 @@ KviFrame::~KviFrame() g_pFrame = 0; } -int KviFrame::registerAccelerator(const QString &szKeySequence,QObject * recv,const char * slot) +int KviFrame::registerAccelerator(const QString &szKeySequence,QObject *,const char *) { QShortcut *sc=new QShortcut(QKeySequence(szKeySequence),this); connect(sc,SIGNAL(activated()),this,SLOT(accelActivated())); diff --git a/src/kvirc/ui/kvi_mdimanager.cpp b/src/kvirc/ui/kvi_mdimanager.cpp index 14b3a7a4f..497533b0c 100644 --- a/src/kvirc/ui/kvi_mdimanager.cpp +++ b/src/kvirc/ui/kvi_mdimanager.cpp @@ -117,11 +117,11 @@ void KviMdiManager::paintEvent(QPaintEvent * event) } } -void KviMdiManager::manageChild(KviMdiChild * lpC,bool bCascade,QRect *setGeom) +void KviMdiManager::manageChild(KviMdiChild * lpC, bool, QRect *) { __range_valid(lpC); - QMdiSubWindow * w = this->addSubWindow((QMdiSubWindow*)lpC); + addSubWindow((QMdiSubWindow*)lpC); if(isInSDIMode()) lpC->queuedMaximize(); @@ -241,17 +241,17 @@ void KviMdiManager::childMoved(KviMdiChild *) } -void KviMdiManager::maximizeChild(KviMdiChild * lpC) +void KviMdiManager::maximizeChild(KviMdiChild *) { } -void KviMdiManager::childMaximized(KviMdiChild * lpC) +void KviMdiManager::childMaximized(KviMdiChild *) { - m_bInSDIMode = true; + m_bInSDIMode = true; } -void KviMdiManager::childMinimized(KviMdiChild * lpC,bool bWasMaximized) +void KviMdiManager::childMinimized(KviMdiChild * lpC, bool bWasMaximized) { __range_valid(lpC); @@ -283,7 +283,7 @@ void KviMdiManager::focusTopChild() if (!activeSubWindow()) return; if (!activeSubWindow()->inherits("KviMdiChild")) return; - KviMdiChild * lpC; + KviMdiChild * lpC = 0; QList<QMdiSubWindow *> tmp = subWindowList(QMdiArea::ActivationHistoryOrder); QListIterator<QMdiSubWindow*> wl(tmp); @@ -606,7 +606,7 @@ void KviMdiManager::toggleAutoTile() } -void KviMdiManager::tileAllInternal(int maxWnds,bool bHorizontal) +void KviMdiManager::tileAllInternal(int, bool) //int maxWnds,bool bHorizontal { } diff --git a/src/kvirc/ui/kvi_window.h b/src/kvirc/ui/kvi_window.h index 5512badb8..e85d4daee 100644 --- a/src/kvirc/ui/kvi_window.h +++ b/src/kvirc/ui/kvi_window.h @@ -271,7 +271,6 @@ public: // Interesting overridables: virtual void fillContextPopup(KviTalPopupMenu * p); virtual void getConfigGroupName(QString &buf); -// virtual void getBaseLogFileName(KviStr &buffer); virtual void getBaseLogFileName(QString &buffer); virtual void updateCaption(); void updateCaptionListItem(); diff --git a/src/modules/about/libkviabout.cpp b/src/modules/about/libkviabout.cpp index 4f65fc3c0..bc35d0772 100644 --- a/src/modules/about/libkviabout.cpp +++ b/src/modules/about/libkviabout.cpp @@ -72,14 +72,14 @@ static bool about_module_init(KviModule * m) return true; } -static bool about_module_cleanup(KviModule *m) +static bool about_module_cleanup(KviModule *) { if(g_pAboutDialog)delete g_pAboutDialog; g_pAboutDialog = 0; return true; } -static bool about_module_can_unload(KviModule * m) +static bool about_module_can_unload(KviModule *) { return (!g_pAboutDialog); } diff --git a/src/modules/action/libkviaction.cpp b/src/modules/action/libkviaction.cpp index e3d985baf..9a8de6585 100644 --- a/src/modules/action/libkviaction.cpp +++ b/src/modules/action/libkviaction.cpp @@ -280,36 +280,36 @@ static bool action_kvs_cmd_destroy(KviKvsModuleCommandCall * c) Specifies that the action needs an IRC context to be executed. When the current window does not belong to an IRC context the action is automatically disabled - + !sw: -c | --bind-to-connection Specifies that the action needs an IRC connection to be executed. When the current window has no associated IRC connection the action is automatically disabled. This switch implies -i. - + !sw: -l | --enable-at-login Specifies that the action needs to be enabled at login time, that is when a link to the server has been estabilished but the login operations haven't been carried out yet (and thus there is no real IRC connection). This switch requires -c to work. - + !sw: -w=<window_types> | --window-types=<window_type> Causes the action to be enabled only when the active window is one of the specified types. <window_types> may be any combination of the letters 'q' (query), 'c' (channel), 'x' (console), 'd' (dccchat). If this switch is omitted then the action is enabled in all the windows.[br] - + !sw: -s | --selected-only Specifies that the action will be activated only if the active window has selected users in the userlist. This switch requires -w with a combination of flags 'q','c' and 'x' (it doesn't work for dcc chat). - + !sw: -t=<category> | --category=<category> Causes the action to belong to the specified category. <category> can be one of "irc","scripting","settings","gui","channel","tools" and "generic". If this switch is omitted the "generic" category is automatically assumed. The actions failing in the "tools" category will appear in the "Tools" KVIrc menu too. - + !sw: -k=<key sequence> | --key-sequence=<key sequence> Specifies that the action will be activated also by the <key sequence> which is a string formed from up to four keyboard codes separated by @@ -356,7 +356,7 @@ static bool action_kvs_cmd_destroy(KviKvsModuleCommandCall * c) [cmd]action.destroy[/cmd], [cmd]action.trigger[/cmd] @examples: [example] - + [/example] */ @@ -381,14 +381,14 @@ static bool action_kvs_cmd_create(KviKvsModuleCallbackCommandCall * c) QString szCategory,szWindows,szKeySequence; int iFlags = 0; - + if(c->switches()->find('i',"bind-to-context"))iFlags |= KviAction::NeedsContext; if(c->switches()->find('c',"bind-to-connection"))iFlags |= KviAction::NeedsConnection | KviAction::NeedsContext; if(c->switches()->find('l',"enable-at-login")) { if(iFlags & KviAction::NeedsConnection) iFlags |= KviAction::EnableAtLogin; - else + else c->warning(__tr2qs("The switch -l requires -c")); } c->switches()->getAsStringIfExisting('t',"category",szCategory); @@ -405,11 +405,11 @@ static bool action_kvs_cmd_create(KviKvsModuleCallbackCommandCall * c) { if(iFlags & (KviAction::WindowChannel | KviAction::WindowConsole | KviAction::WindowQuery)) iFlags |= KviAction::WindowOnlyIfUsersSelected; - else + else c->warning(__tr2qs("The switch -s requires -w with a combination of flags 'c','x' and 'q'")); } c->switches()->getAsStringIfExisting('k',"key-sequence",szKeySequence); - + KviAction * old = KviActionManager::instance()->getAction(szName); if(old) @@ -461,7 +461,7 @@ static bool action_kvs_cmd_create(KviKvsModuleCallbackCommandCall * c) */ static bool action_kvs_fnc_exists(KviKvsModuleFunctionCall * c) -{ +{ QString szName; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("action_name",KVS_PT_NONEMPTYSTRING,0,szName) @@ -486,7 +486,7 @@ static bool action_kvs_fnc_exists(KviKvsModuleFunctionCall * c) */ static bool action_kvs_fnc_isEnabled(KviKvsModuleFunctionCall * c) -{ +{ QString szName; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("action_name",KVS_PT_NONEMPTYSTRING,0,szName) @@ -516,7 +516,7 @@ static bool action_module_init(KviModule *m) return true; } -static bool action_module_cleanup(KviModule *m) +static bool action_module_cleanup(KviModule *) { return true; } diff --git a/src/modules/actioneditor/actioneditor.cpp b/src/modules/actioneditor/actioneditor.cpp index ba03594a8..a1660f2b0 100644 --- a/src/modules/actioneditor/actioneditor.cpp +++ b/src/modules/actioneditor/actioneditor.cpp @@ -797,7 +797,7 @@ bool KviActionEditor::actionExists(const QString &szName) } -void KviActionEditor::currentItemChanged(QTreeWidgetItem * i,QTreeWidgetItem *prev) +void KviActionEditor::currentItemChanged(QTreeWidgetItem * i,QTreeWidgetItem *) { if(m_pSingleActionEditor->actionData()) m_pSingleActionEditor->commit(); @@ -910,14 +910,14 @@ QPixmap * KviActionEditorWindow::myIconPtr() return g_pIconManager->getSmallIcon(KVI_SMALLICON_SCRIPTACTION); } -void KviActionEditorWindow::resizeEvent(QResizeEvent *e) +void KviActionEditorWindow::resizeEvent(QResizeEvent *) { int hght = m_pBase->sizeHint().height(); m_pEditor->setGeometry(0,0,width(),height()- hght); m_pBase->setGeometry(0,height() - hght,width(),hght); } -void KviActionEditorWindow::getConfigGroupName(KviStr &szName) +void KviActionEditorWindow::getConfigGroupName(QString &szName) { szName = "actioneditor"; } diff --git a/src/modules/actioneditor/actioneditor.h b/src/modules/actioneditor/actioneditor.h index c0a41a0e0..e1b4acd86 100644 --- a/src/modules/actioneditor/actioneditor.h +++ b/src/modules/actioneditor/actioneditor.h @@ -192,7 +192,7 @@ protected: protected: virtual QPixmap * myIconPtr(); virtual void resizeEvent(QResizeEvent *e); - virtual void getConfigGroupName(KviStr &szName); + virtual void getConfigGroupName(QString &szName); virtual void saveProperties(KviConfig *); virtual void loadProperties(KviConfig *); protected slots: diff --git a/src/modules/actioneditor/libkviactioneditor.cpp b/src/modules/actioneditor/libkviactioneditor.cpp index d2d171dd3..ff37090da 100644 --- a/src/modules/actioneditor/libkviactioneditor.cpp +++ b/src/modules/actioneditor/libkviactioneditor.cpp @@ -64,12 +64,12 @@ static bool actioneditor_module_init(KviModule * m) return true; } -static bool actioneditor_module_can_unload(KviModule * m) +static bool actioneditor_module_can_unload(KviModule *) { return (g_pActionEditorWindow == 0); } -static bool actioneditor_module_cleanup(KviModule *m) +static bool actioneditor_module_cleanup(KviModule *) { if(g_pActionEditorWindow)delete g_pActionEditorWindow; g_pActionEditorWindow = 0; diff --git a/src/modules/addon/addonfunctions.cpp b/src/modules/addon/addonfunctions.cpp index f4d774dc2..a0afec825 100644 --- a/src/modules/addon/addonfunctions.cpp +++ b/src/modules/addon/addonfunctions.cpp @@ -54,11 +54,10 @@ namespace KviAddonFunctions QString * pValue; QString szErr; bool bInstall; - QByteArray * pByteArray; KviHtmlDialogData hd; const char * check_fields[] = { "Name", "Version", "Author", "Description", "Date", "Application" }; - + // check if it is a valid addon file KviPackageReader r; if(!r.readHeader(szAddonPackageFileName)) @@ -67,15 +66,15 @@ namespace KviAddonFunctions KviQString::sprintf(szError,__tr2qs_ctx("The selected file does not seem to be a valid KVIrc package: %Q","addon"),&szErr); return false; } - + pInfoFields = r.stringInfoFields(); - + pValue = pInfoFields->find("PackageType"); if(!pValue)return notAValidAddonPackage(szError); pValue = pInfoFields->find("AddonPackVersion"); if(!pValue)return notAValidAddonPackage(szError); if(!KviQString::equalCI(*pValue,KVI_CURRENT_ADDONS_ENGINE_VERSION))return notAValidAddonPackage(szError); - + // make sure the default fields exist for(int i=0;i<6;i++) { @@ -106,9 +105,9 @@ namespace KviAddonFunctions QString szWarnings; QString szDetails = "<html><body bgcolor=\"#ffffff\">"; QString szTmp; - + bool bValid = true; - + QString szAddonName; QString szAddonVersion; QString szAddonDescription; @@ -202,7 +201,7 @@ namespace KviAddonFunctions hd.addHtmlResource("addon_dialog_details",szDetails); hd.addHtmlResource("addon_dialog_main",hd.szHtmlText); - + QString beginCenter = "<center>"; QString endCenter = "</center>"; @@ -219,20 +218,9 @@ namespace KviAddonFunctions hd.iFlags = KviHtmlDialogData::ForceMinimumSize; bInstall = KviHtmlDialog::display(pDialogParent,&hd) == 2; - + if(bInstall) { - -/* -[02:25:41] <Pragma> (occhio a non cancellare niente di importante eh... bisogna sempre fare attenzione a fare i delete) -[02:25:50] <Pragma> ed occhio anche agli attacchi -[02:26:02] <Pragma> quando parsi dei file esterni che potrebbero essere forgiati -[02:26:19] <Pragma> pensa sempre 3 volte a cosa potrebbe succedere -[02:26:41] <Pragma> tipo se dentro il pacchetto ti ci mettono un path tipo "../../etc/passwd" -[02:27:03] <Pragma> qui magari bisogna intervienire pure sullo spacchettatore eh -[02:27:10] <Pragma> guarda un pò insomma -[02:27:22] <Pragma> la gente co ste cose ci va a nozze -*/ // Create a random extraction dir QString szTmpPath, szUnpackPath; QString szRandomDir = createRandomDir(); diff --git a/src/modules/aliaseditor/aliaseditor.cpp b/src/modules/aliaseditor/aliaseditor.cpp index 064a9a149..e1949ae03 100644 --- a/src/modules/aliaseditor/aliaseditor.cpp +++ b/src/modules/aliaseditor/aliaseditor.cpp @@ -68,7 +68,7 @@ extern KviAliasEditorWindow * g_pAliasEditorWindow; extern KviModule * g_pAliasEditorModule; KviAliasEditorTreeWidgetItem::KviAliasEditorTreeWidgetItem(QTreeWidget * pTreeWidget,Type eType,const QString &szName) -: QTreeWidgetItem(pTreeWidget), m_eType(eType), m_pParentNamespaceItem(0), KviHeapObject() +: QTreeWidgetItem(pTreeWidget), KviHeapObject(), m_eType(eType), m_pParentNamespaceItem(0) { setName(szName); } @@ -82,7 +82,7 @@ KviAliasEditorTreeWidgetItem::KviAliasEditorTreeWidgetItem(KviAliasNamespaceTree -QString KviAliasEditorTreeWidgetItem::key(int column,bool bAsc) const +QString KviAliasEditorTreeWidgetItem::key(int, bool) const { QString ret; if(m_eType == Namespace)ret = "1"; @@ -499,7 +499,7 @@ bool KviAliasEditor::itemExistsRecursive(QTreeWidgetItem *pSearchFor,QTreeWidget if(pSearchFor == pSearchAt->child(i))return true; else { - if (pSearchAt->child(i)->childCount()) + if (pSearchAt->child(i)->childCount()) { if (itemExistsRecursive(pSearchFor,pSearchAt->child(i))) return true; } @@ -725,7 +725,7 @@ void KviAliasEditor::exportSelectionInSinglesFiles(KviPointerList<KviAliasTreeWi } if(!m_szDir.endsWith(QString(KVI_PATH_SEPARATOR)))m_szDir += KVI_PATH_SEPARATOR; - + bool bReplaceAll=false; for(KviAliasTreeWidgetItem * it = l->first();it;it = l->next()) @@ -1010,7 +1010,7 @@ void KviAliasEditor::removeItemChildren(KviAliasEditorTreeWidgetItem *it) delete it->child(i); } } -bool KviAliasEditor::removeItem(KviAliasEditorTreeWidgetItem *it,bool * pbYesToAll,bool bDeleteEmptyTree) +bool KviAliasEditor::removeItem(KviAliasEditorTreeWidgetItem *it,bool * pbYesToAll,bool) { if(!it)return true; QString szMsg; @@ -1232,23 +1232,9 @@ void KviAliasEditor::openParentItems(QTreeWidgetItem * it) } } -void KviAliasEditor::selectOneItem(QTreeWidgetItem * it,QTreeWidgetItem *pStartFrom) -{ - /* - if(!pStartFrom)return; - if(pStartFrom == it)pStartFrom->setSelected(true); - else pStartFrom->setSelected(false); - selectOneItem(it,pStartFrom->firstChild()); - selectOneItem(it,pStartFrom->nextSibling()); - */ - - -} - void KviAliasEditor::activateItem(QTreeWidgetItem * it) { openParentItems(it); - //selectOneItem(it,m_pTreeWidget->child(0)); m_pTreeWidget->setCurrentItem(it); } @@ -1435,7 +1421,7 @@ void KviAliasEditor::saveLastEditedItem() ((KviAliasTreeWidgetItem *)m_pLastEditedItem)->setBuffer(newCode); } -void KviAliasEditor::currentItemChanged(QTreeWidgetItem *it,QTreeWidgetItem *prev) +void KviAliasEditor::currentItemChanged(QTreeWidgetItem *it,QTreeWidgetItem *) { saveLastEditedItem(); @@ -1614,14 +1600,14 @@ QPixmap * KviAliasEditorWindow::myIconPtr() return g_pIconManager->getSmallIcon(KVI_SMALLICON_ALIAS); } -void KviAliasEditorWindow::resizeEvent(QResizeEvent *e) +void KviAliasEditorWindow::resizeEvent(QResizeEvent *) { int hght = m_pBase->sizeHint().height(); m_pEditor->setGeometry(0,0,width(),height()- hght); m_pBase->setGeometry(0,height() - hght,width(),hght); } -void KviAliasEditorWindow::getConfigGroupName(KviStr &szName) +void KviAliasEditorWindow::getConfigGroupName(QString &szName) { szName = "aliaseditor"; } diff --git a/src/modules/aliaseditor/aliaseditor.h b/src/modules/aliaseditor/aliaseditor.h index 1f41ab5e8..b7821b439 100644 --- a/src/modules/aliaseditor/aliaseditor.h +++ b/src/modules/aliaseditor/aliaseditor.h @@ -156,11 +156,10 @@ protected slots: protected: void recursiveCollapseNamespaces(KviAliasEditorTreeWidgetItem * it); void recursiveSearchReplace(const QString &szSearch,KviAliasEditorTreeWidgetItem * it,bool bReplace=false,const QString &szReplace="n"); - + void recursiveCommit(KviAliasEditorTreeWidgetItem * it); void getExportAliasBuffer(QString &buffer,KviAliasTreeWidgetItem * it); void oneTimeSetup(); - void selectOneItem(QTreeWidgetItem * it,QTreeWidgetItem *pStartFrom); void saveLastEditedItem(); void getUniqueItemName(KviAliasEditorTreeWidgetItem *item,QString &buffer,KviAliasEditorTreeWidgetItem::Type eType); void appendSelectedItems(KviPointerList<KviAliasEditorTreeWidgetItem> * l); @@ -208,7 +207,7 @@ protected: protected: virtual QPixmap * myIconPtr(); virtual void resizeEvent(QResizeEvent *e); - virtual void getConfigGroupName(KviStr &szName); + virtual void getConfigGroupName(QString &szName); virtual void saveProperties(KviConfig *); virtual void loadProperties(KviConfig *); protected slots: diff --git a/src/modules/aliaseditor/libkvialiaseditor.cpp b/src/modules/aliaseditor/libkvialiaseditor.cpp index ece2fbd85..e6fee3015 100644 --- a/src/modules/aliaseditor/libkvialiaseditor.cpp +++ b/src/modules/aliaseditor/libkvialiaseditor.cpp @@ -68,12 +68,12 @@ static bool aliaseditor_module_init(KviModule * m) return true; } -static bool aliaseditor_module_can_unload(KviModule * m) +static bool aliaseditor_module_can_unload(KviModule * ) { return (g_pAliasEditorWindow == 0); } -static bool aliaseditor_module_cleanup(KviModule *m) +static bool aliaseditor_module_cleanup(KviModule *) { if(g_pAliasEditorWindow)delete g_pAliasEditorWindow; g_pAliasEditorWindow = 0; diff --git a/src/modules/avatar/libkviavatar.cpp b/src/modules/avatar/libkviavatar.cpp index 6fe1c89b7..dc17f968e 100644 --- a/src/modules/avatar/libkviavatar.cpp +++ b/src/modules/avatar/libkviavatar.cpp @@ -560,7 +560,7 @@ static bool avatar_module_init(KviModule * m) KVSM_REGISTER_SIMPLE_COMMAND(m,"query",avatar_kvs_cmd_query); KVSM_REGISTER_SIMPLE_COMMAND(m,"set",avatar_kvs_cmd_set); - KVSM_REGISTER_SIMPLE_COMMAND(m,"unset",avatar_kvs_cmd_set); + KVSM_REGISTER_SIMPLE_COMMAND(m,"unset",avatar_kvs_cmd_unset); KVSM_REGISTER_SIMPLE_COMMAND(m,"notify",avatar_kvs_cmd_notify); KVSM_REGISTER_FUNCTION(m,"name",avatar_kvs_fnc_name); @@ -569,12 +569,12 @@ static bool avatar_module_init(KviModule * m) return true; } -static bool avatar_module_can_unload(KviModule *m) +static bool avatar_module_can_unload(KviModule *) { return g_pAvatarSelectionDialogList->isEmpty(); } -static bool avatar_module_cleanup(KviModule *m) +static bool avatar_module_cleanup(KviModule *) { while(KviAsyncAvatarSelectionDialog * d = g_pAvatarSelectionDialogList->first()) delete d; diff --git a/src/modules/chan/libkvichan.cpp b/src/modules/chan/libkvichan.cpp index 3e9977572..68cb4154e 100644 --- a/src/modules/chan/libkvichan.cpp +++ b/src/modules/chan/libkvichan.cpp @@ -174,7 +174,7 @@ static bool chan_kvs_fnc_isdead(KviKvsModuleFunctionCall * c) is a channel at all). If the current window is not a channel, a warning is printed and an empty string is returned.[br] The second form returns the topic of the channel specified by <window_id>.[br] - The topic is returned as it is known form at the call time: this means that + The topic is returned as it is known form at the call time: this means that if the channel is not synchronized with the server (as just after the join, for example) you might get an empty string (the topic is not yet known).[br] This function works also on dead channels altough the topic returned is the last @@ -208,7 +208,7 @@ static bool chan_kvs_fnc_topic(KviKvsModuleFunctionCall * c) is a channel at all). If the current window is not a channel, a warning is printed and an empty string is returned.[br] The second form returns the author of the topic of the channel specified by <window_id>.[br] - The topic author nickname is returned if it is known form at the call time: this means that + The topic author nickname is returned if it is known form at the call time: this means that if the channel is not synchronized with the server (as just after the join, for example) you might get an empty string (the topic is not yet known).[br] This function works also on dead channels altough the information returned is the last @@ -242,7 +242,7 @@ static bool chan_kvs_fnc_topicsetby(KviKvsModuleFunctionCall * c) is a channel at all). If the current window is not a channel, a warning is printed and an empty string is returned.[br] The second form returns the set time of the topic of the channel specified by <window_id>.[br] - The topic set time is returned if it is known form at the call time: this means that + The topic set time is returned if it is known form at the call time: this means that if the channel is not synchronized with the server (as just after the join, for example) you might get an empty string (the topic is not yet known).[br] This function works also on dead channels altough the information returned is the last @@ -275,7 +275,7 @@ static bool chan_kvs_fnc_topicsetat(KviKvsModuleFunctionCall * c) is a channel at all). If the current window is not a channel, a warning is printed and an empty string is returned.[br] The second form returns the number of users on the channel specified by <window_id>.[br] - The number of users is returned if it is known form at the call time: this means that + The number of users is returned if it is known form at the call time: this means that if the channel is not synchronized with the server (as just after the join, for example) you might get a number that is actually smaller.[br] */ @@ -307,7 +307,7 @@ static bool chan_kvs_fnc_usercount(KviKvsModuleFunctionCall * c) is a channel at all). If the current window is not a channel, a warning is printed and an empty string is returned.[br] The second form returns the number of owners users on the channel specified by <window_id>.[br] - The number of owners is returned if it is known form at the call time: this means that + The number of owners is returned if it is known form at the call time: this means that if the channel is not synchronized with the server (as just after the join, for example) you might get a number that is actually smaller.[br] */ @@ -339,7 +339,7 @@ static bool chan_kvs_fnc_ownercount(KviKvsModuleFunctionCall * c) is a channel at all). If the current window is not a channel, a warning is printed and an empty string is returned.[br] The second form returns the number of administrator users on the channel specified by <window_id>.[br] - The number of administrators is returned if it is known form at the call time: this means that + The number of administrators is returned if it is known form at the call time: this means that if the channel is not synchronized with the server (as just after the join, for example) you might get a number that is actually smaller.[br] */ @@ -372,7 +372,7 @@ static bool chan_kvs_fnc_admincount(KviKvsModuleFunctionCall * c) is a channel at all). If the current window is not a channel, a warning is printed and an empty string is returned.[br] The second form returns the number of op users on the channel specified by <window_id>.[br] - The number of ops is returned if it is known form at the call time: this means that + The number of ops is returned if it is known form at the call time: this means that if the channel is not synchronized with the server (as just after the join, for example) you might get a number that is actually smaller.[br] */ @@ -404,7 +404,7 @@ static bool chan_kvs_fnc_opcount(KviKvsModuleFunctionCall * c) is a channel at all). If the current window is not a channel, a warning is printed and an empty string is returned.[br] The second form returns the number of voiced users on the channel specified by <window_id>.[br] - The number of voiced users is returned if it is known form at the call time: this means that + The number of voiced users is returned if it is known form at the call time: this means that if the channel is not synchronized with the server (as just after the join, for example) you might get a number that is actually smaller.[br] */ @@ -436,7 +436,7 @@ static bool chan_kvs_fnc_voicecount(KviKvsModuleFunctionCall * c) is a channel at all). If the current window is not a channel, a warning is printed and an empty string is returned.[br] The second form returns the number of half-operator users on the channel specified by <window_id>.[br] - The number of half-operator users is returned if it is known form at the call time: this means that + The number of half-operator users is returned if it is known form at the call time: this means that if the channel is not synchronized with the server (as just after the join, for example) you might get a number that is actually smaller.[br] */ @@ -468,7 +468,7 @@ static bool chan_kvs_fnc_halfopcount(KviKvsModuleFunctionCall * c) is a channel at all). If the current window is not a channel, a warning is printed and an empty string is returned.[br] The second form returns the number of user-operator users on the channel specified by <window_id>.[br] - The number of user-operator users is returned if it is known form at the call time: this means that + The number of user-operator users is returned if it is known form at the call time: this means that if the channel is not synchronized with the server (as just after the join, for example) you might get a number that is actually smaller.[br] */ @@ -500,7 +500,7 @@ static bool chan_kvs_fnc_useropcount(KviKvsModuleFunctionCall * c) is a channel at all). If the current window is not a channel, a warning is printed and 0 is returned.[br] The second form returns the number entries in the ban list of the channel specified by <window_id>.[br] - The number of ban list entries is returned if it is known form at the call time: this means that + The number of ban list entries is returned if it is known form at the call time: this means that if the channel is not synchronized with the server (as just after the join, for example) you might get a number that is actually smaller.[br] */ @@ -532,7 +532,7 @@ static bool chan_kvs_fnc_bancount(KviKvsModuleFunctionCall * c) is a channel at all). If the current window is not a channel, a warning is printed and 0 is returned.[br] The second form returns the number entries in the ban exception list of the channel specified by <window_id>.[br] - The number of ban exception list entries is returned if it is known form at the call time: this means that + The number of ban exception list entries is returned if it is known form at the call time: this means that if the channel is not synchronized with the server (as just after the join, for example) you might get a number that is actually smaller.[br] */ @@ -564,7 +564,7 @@ static bool chan_kvs_fnc_banexceptioncount(KviKvsModuleFunctionCall * c) is a channel at all). If the current window is not a channel, a warning is printed and 0 is returned.[br] The second form returns the number entries in the invite list of the channel specified by <window_id>.[br] - The number of invite list entries is returned if it is known form at the call time: this means that + The number of invite list entries is returned if it is known form at the call time: this means that if the channel is not synchronized with the server (as just after the join, for example) you might get a number that is actually smaller.[br] */ @@ -1008,7 +1008,7 @@ static bool chan_kvs_fnc_limit(KviKvsModuleFunctionCall * c) KviChannel * ch = chan_kvs_find_channel(c,szId); kvs_int_t limit=0; QString lim; - if (ch) + if (ch) { if(ch->hasChannelLimit()) { @@ -1041,7 +1041,7 @@ static bool chan_kvs_fnc_limit(KviKvsModuleFunctionCall * c) "ovhn" are mode flags: the users are added to the array only if they are channel administrators ('a'), operators ('o'), voiced users ('v'), half-operators ('h'), user-operators ('u') or unflagged ('n') users. (Unflagged means not operators, not voiced and not half-operators). If none of the "ovhun" flags are used, KVIrc behaves like all five were passed.[br] - The flag 'm' causes the entire user masks to be added to the + The flag 'm' causes the entire user masks to be added to the array entries, as known by KVIrc at the moment of this function call.[br] The flag 'i' causes KVIrc to invert the match and add only the users that do NOT match [mask].[br] Please note that on really large channels this function may be time consuming (especially if [mask] is used): @@ -1074,7 +1074,7 @@ static bool chan_kvs_fnc_limit(KviKvsModuleFunctionCall * c) %test[] = $chan.users(,*!*@*.edu,vim) echo %test[] [/example] - + */ static bool chan_kvs_fnc_users(KviKvsModuleFunctionCall * c) @@ -1615,7 +1615,7 @@ static bool chan_module_init(KviModule * m) return true; } -static bool chan_module_cleanup(KviModule *m) +static bool chan_module_cleanup(KviModule *) { return true; } diff --git a/src/modules/channelsjoin/channelsjoinwindow.cpp b/src/modules/channelsjoin/channelsjoinwindow.cpp index 4e514480f..6db6c1f3d 100644 --- a/src/modules/channelsjoin/channelsjoinwindow.cpp +++ b/src/modules/channelsjoin/channelsjoinwindow.cpp @@ -62,7 +62,7 @@ KviChannelsJoinWindow::KviChannelsJoinWindow(QWidget * par, const char * name) m_pConsole = 0; QGridLayout * g = new QGridLayout(this); - + m_pTreeWidget = new KviTalTreeWidget(this); m_pTreeWidget->setHeaderLabel(__tr2qs("Channel")); m_pTreeWidget->setRootIsDecorated(true); @@ -78,7 +78,7 @@ KviChannelsJoinWindow::KviChannelsJoinWindow(QWidget * par, const char * name) szMsg.append(":"); QLabel * l = new QLabel(szMsg,m_pGroupBox); - m_pChannelEdit = new QLineEdit(m_pGroupBox); + m_pChannelEdit = new QLineEdit(m_pGroupBox); connect(m_pChannelEdit,SIGNAL(returnPressed()), this, SLOT(editReturnPressed())); connect(m_pChannelEdit,SIGNAL(textChanged(const QString &)),this,SLOT(editTextChanged(const QString &))); @@ -119,7 +119,7 @@ KviChannelsJoinWindow::KviChannelsJoinWindow(QWidget * par, const char * name) /* KviTalHBox * hb = new KviTalHBox(this); hb->setSpacing(4); - + QPushButton * namesButton = new QPushButton("/names", hb); connect(namesButton,SIGNAL(clicked()),this,SLOT(namesClicked())); QPushButton * whoButton = new QPushButton("/who", hb); @@ -165,7 +165,7 @@ void KviChannelsJoinWindow::fillListView() par->setText(0,__tr2qs("Recent Channels")); par->setExpanded(true); KviTalTreeWidgetItem * chld; - + if(m_pConsole) { QStringList * pList = g_pApp->getRecentChannels(m_pConsole->currentNetworkName()); @@ -198,7 +198,7 @@ void KviChannelsJoinWindow::fillListView() } } -void KviChannelsJoinWindow::itemClicked(QTreeWidgetItem * it, int index) +void KviChannelsJoinWindow::itemClicked(QTreeWidgetItem * it, int) { if(!it) return; diff --git a/src/modules/channelsjoin/libkvichannelsjoin.cpp b/src/modules/channelsjoin/libkvichannelsjoin.cpp index 13b970aed..0260729f7 100644 --- a/src/modules/channelsjoin/libkvichannelsjoin.cpp +++ b/src/modules/channelsjoin/libkvichannelsjoin.cpp @@ -48,7 +48,7 @@ QRect g_rectChannelsJoinGeometry; @description: Shows a dialog that allows the user to enter channels in a visual manner.[br] This command is exported by the "channelsjoin" module. - + */ static bool channelsjoin_kvs_cmd_open(KviKvsModuleCommandCall * c) @@ -56,7 +56,7 @@ static bool channelsjoin_kvs_cmd_open(KviKvsModuleCommandCall * c) if(!g_pChannelsWindow)g_pChannelsWindow = new KviChannelsJoinWindow(c->window()->frame(),"channelsjoin"); g_pChannelsWindow->setConsole(c->window()->console()); - + g_pChannelsWindow->show(); g_pChannelsWindow->raise(); g_pChannelsWindow->setFocus(); @@ -71,7 +71,7 @@ static bool channelsjoin_module_init(KviModule * m) KviConfig cfg(fName,KviConfig::Read); g_rectChannelsJoinGeometry = cfg.readRectEntry("geometry",QRect(30,30,320,410)); - + KVSM_REGISTER_SIMPLE_COMMAND(m,"open",channelsjoin_kvs_cmd_open); return true; } @@ -83,13 +83,13 @@ static bool channelsjoin_module_cleanup(KviModule *m) KviConfig cfg(fName,KviConfig::Write); cfg.writeEntry("geometry",g_rectChannelsJoinGeometry); - + if (g_pChannelsWindow)delete g_pChannelsWindow; g_pChannelsWindow = 0; return true; } -static bool channelsjoin_module_can_unload(KviModule *m) +static bool channelsjoin_module_can_unload(KviModule *) { return (!g_pChannelsWindow); } @@ -97,7 +97,7 @@ static bool channelsjoin_module_can_unload(KviModule *m) KVIRC_MODULE( "ChannelsJoin", "4.0.0", - "Copyright (C) 2001-2006 Juan Jos��varez (juanjux@yahoo.es), Alexey (wizard@opendoor.ru)", + "Copyright (C) 2001-2006 Juanjo Alvarez (juanjux@yahoo.es), Alexey (wizard@opendoor.ru)", "Window to join channels in a GUI", channelsjoin_module_init, channelsjoin_module_can_unload, diff --git a/src/modules/codetester/codetester.cpp b/src/modules/codetester/codetester.cpp index 5d11d7681..ddc677a38 100644 --- a/src/modules/codetester/codetester.cpp +++ b/src/modules/codetester/codetester.cpp @@ -99,7 +99,7 @@ QPixmap * KviCodeTesterWindow::myIconPtr() return g_pIconManager->getSmallIcon(KVI_SMALLICON_BOMB); } -void KviCodeTesterWindow::resizeEvent(QResizeEvent *e) +void KviCodeTesterWindow::resizeEvent(QResizeEvent *) { m_pTester->setGeometry(0,0,width(),height()); } @@ -125,12 +125,12 @@ void KviCodeTesterWindow::fillCaptionBuffers() m_szHtmlInactiveCaption += p3; } -void KviCodeTesterWindow::getConfigGroupName(KviStr &szName) +void KviCodeTesterWindow::getConfigGroupName(QString &szName) { szName = "codetester"; } -void KviCodeTesterWindow::saveProperties(KviConfig *cfg) +void KviCodeTesterWindow::saveProperties(KviConfig *) //cfg { /* #ifdef COMPILE_SCRIPTTOOLBAR @@ -141,7 +141,7 @@ void KviCodeTesterWindow::saveProperties(KviConfig *cfg) */ } -void KviCodeTesterWindow::loadProperties(KviConfig *cfg) +void KviCodeTesterWindow::loadProperties(KviConfig *) //cfg { /* #ifdef COMPILE_SCRIPTTOOLBAR diff --git a/src/modules/codetester/codetester.h b/src/modules/codetester/codetester.h index 941b437c6..fad53c478 100644 --- a/src/modules/codetester/codetester.h +++ b/src/modules/codetester/codetester.h @@ -61,7 +61,7 @@ protected: virtual QPixmap * myIconPtr(); virtual void fillCaptionBuffers(); virtual void resizeEvent(QResizeEvent *e); - virtual void getConfigGroupName(KviStr &szName); + virtual void getConfigGroupName(QString &szName); virtual void saveProperties(KviConfig *); virtual void loadProperties(KviConfig *); }; diff --git a/src/modules/codetester/libkvicodetester.cpp b/src/modules/codetester/libkvicodetester.cpp index d0d6ed73c..01be1b1f9 100644 --- a/src/modules/codetester/libkvicodetester.cpp +++ b/src/modules/codetester/libkvicodetester.cpp @@ -64,12 +64,12 @@ static bool codetester_module_init(KviModule * m) return true; } -static bool codetester_module_can_unload(KviModule * m) +static bool codetester_module_can_unload(KviModule *) { return (g_pCodeTesterWindowList->count() == 0); } -static bool codetester_module_cleanup(KviModule *m) +static bool codetester_module_cleanup(KviModule *) { while(KviCodeTesterWindow * w = g_pCodeTesterWindowList->first()) { diff --git a/src/modules/config/libkviconfig.cpp b/src/modules/config/libkviconfig.cpp index e3b5ea5e4..38263ea94 100644 --- a/src/modules/config/libkviconfig.cpp +++ b/src/modules/config/libkviconfig.cpp @@ -81,16 +81,16 @@ static int g_iNextConfigId = 0; static bool config_kvs_fnc_open(KviKvsModuleFunctionCall * c) { - QString szFile; + QString szFile; QString szMode; - + KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("filename",KVS_PT_STRING,0,szFile) KVSM_PARAMETER("mode",KVS_PT_STRING,KVS_PF_OPTIONAL,szMode) KVSM_PARAMETERS_END(c) - + KviConfig::FileMode fileMode; - + if(szMode.contains('r')) { if(szMode.contains('w'))fileMode = KviConfig::ReadWrite; @@ -99,10 +99,10 @@ static bool config_kvs_fnc_open(KviKvsModuleFunctionCall * c) if(szMode.contains('w'))fileMode = KviConfig::Write; else fileMode = KviConfig::ReadWrite; } - + KviFileUtils::adjustFilePath(szFile); QString szAbsFile; - + if(KviFileUtils::isAbsolutePath(szFile))szAbsFile = szFile; else g_pApp->getLocalKvircDirectory(szAbsFile,KviApp::ConfigScripts,szFile,true); @@ -150,11 +150,11 @@ static bool config_kvs_fnc_open(KviKvsModuleFunctionCall * c) static bool config_kvs_fnc_id(KviKvsModuleFunctionCall * c) { QString szFile; - + KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("file",KVS_PT_STRING,0,szFile) KVSM_PARAMETERS_END(c) - + KviFileUtils::adjustFilePath(szFile); QString szAbsFile; @@ -174,7 +174,7 @@ static bool config_kvs_fnc_id(KviKvsModuleFunctionCall * c) } c->returnValue()->setString("0"); - + return true; } @@ -203,15 +203,15 @@ static bool config_kvs_fnc_read(KviKvsModuleFunctionCall * c) QString szId; QString szKey; QString szDefault; - + KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("id",KVS_PT_STRING,0,szId) KVSM_PARAMETER("key",KVS_PT_STRING,0,szKey) KVSM_PARAMETER("default",KVS_PT_STRING,KVS_PF_OPTIONAL,szDefault) KVSM_PARAMETERS_END(c) - + KviConfig * cfg = g_pConfigDict->find(szId); - + if(cfg) { c->returnValue()->setString(cfg->readEntry(szKey,szDefault)); @@ -241,13 +241,13 @@ static bool config_kvs_fnc_read(KviKvsModuleFunctionCall * c) static bool config_kvs_fnc_section(KviKvsModuleFunctionCall * c) { QString szId; - + KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("id",KVS_PT_STRING,0,szId) KVSM_PARAMETERS_END(c) - + KviConfig * cfg = g_pConfigDict->find(szId); - + if(cfg) { c->returnValue()->setString(cfg->group()); @@ -279,13 +279,13 @@ static bool config_kvs_fnc_section(KviKvsModuleFunctionCall * c) static bool config_kvs_fnc_readonly(KviKvsModuleFunctionCall * c) { QString szId; - + KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("id",KVS_PT_STRING,0,szId) KVSM_PARAMETERS_END(c) - + KviConfig * cfg = g_pConfigDict->find(szId); - + if(cfg) { c->returnValue()->setBoolean(cfg->readOnly()); @@ -317,13 +317,13 @@ static bool config_kvs_fnc_readonly(KviKvsModuleFunctionCall * c) static bool config_kvs_fnc_filename(KviKvsModuleFunctionCall * c) { QString szId; - + KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("id",KVS_PT_STRING,0,szId) KVSM_PARAMETERS_END(c) - + KviConfig * cfg = g_pConfigDict->find(szId); - + if(cfg) { c->returnValue()->setString(cfg->fileName()); @@ -353,14 +353,14 @@ static bool config_kvs_fnc_hassection(KviKvsModuleFunctionCall * c) { QString szId; QString szSect; - + KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("id",KVS_PT_STRING,0,szId) KVSM_PARAMETER("id",KVS_PT_STRING,0,szSect) KVSM_PARAMETERS_END(c) - + KviConfig * cfg = g_pConfigDict->find(szId); - + if(cfg) { c->returnValue()->setBoolean(cfg->hasGroup(szSect)); @@ -390,13 +390,13 @@ static bool config_kvs_fnc_hassection(KviKvsModuleFunctionCall * c) static bool config_kvs_fnc_sectionlist(KviKvsModuleFunctionCall * c) { QString szId; - + KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("id",KVS_PT_STRING,0,szId) KVSM_PARAMETERS_END(c) - + KviConfig * cfg = g_pConfigDict->find(szId); - + if(cfg) { KviConfigIterator it(*(cfg->dict())); @@ -434,13 +434,13 @@ static bool config_kvs_fnc_sectionlist(KviKvsModuleFunctionCall * c) static bool config_kvs_fnc_keylist(KviKvsModuleFunctionCall * c) { QString szId; - + KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("id",KVS_PT_STRING,0,szId) KVSM_PARAMETERS_END(c) - + KviConfig * cfg = g_pConfigDict->find(szId); - + if(cfg) { KviConfigGroup * d = cfg->dict()->find(cfg->group()); @@ -450,7 +450,7 @@ static bool config_kvs_fnc_keylist(KviKvsModuleFunctionCall * c) KviKvsArray* pArray = new KviKvsArray(); int id=0; - + while(it.current()) { pArray->set(id++, new KviKvsVariant(it.currentKey())); @@ -483,10 +483,10 @@ static bool config_kvs_fnc_filelist(KviKvsModuleFunctionCall * c) { KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETERS_END(c) - + KviKvsArray* pArray = new KviKvsArray(); int id=0; - + KviPointerHashTableIterator<QString,KviConfig> it(*g_pConfigDict); while(it.current()) { @@ -523,12 +523,12 @@ static bool config_kvs_fnc_filelist(KviKvsModuleFunctionCall * c) static bool config_kvs_cmd_close(KviKvsModuleCommandCall * c) { QString szId; - KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("id",KVS_PT_STRING,0,szId) - KVSM_PARAMETERS_END(c) + KVSM_PARAMETERS_BEGIN(c) + KVSM_PARAMETER("id",KVS_PT_STRING,0,szId) + KVSM_PARAMETERS_END(c) KviConfig * cfg = g_pConfigDict->find(szId); - + if(cfg) { if(cfg->dirty() && cfg->readOnly()) @@ -536,12 +536,12 @@ static bool config_kvs_cmd_close(KviKvsModuleCommandCall * c) if(!c->hasSwitch('q',"quiet")) c->warning(__tr2qs("The config file '%Q' has been changed but is opened as read-only: changes will be lost"),&cfg->fileName()); } - g_pConfigDict->remove(szId); + g_pConfigDict->remove(szId); } else { if(!c->hasSwitch('q',"quiet")) c->warning(__tr2qs("The config file with id '%Q' is not open"),&szId); } - + return true; } @@ -570,12 +570,12 @@ static bool config_kvs_cmd_close(KviKvsModuleCommandCall * c) static bool config_kvs_cmd_flush(KviKvsModuleCommandCall * c) { QString szId; - KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("id",KVS_PT_STRING,0,szId) - KVSM_PARAMETERS_END(c) + KVSM_PARAMETERS_BEGIN(c) + KVSM_PARAMETER("id",KVS_PT_STRING,0,szId) + KVSM_PARAMETERS_END(c) KviConfig * cfg = g_pConfigDict->find(szId); - + if(cfg) { if(cfg->readOnly()) @@ -585,7 +585,7 @@ static bool config_kvs_cmd_flush(KviKvsModuleCommandCall * c) } else { c->warning(__tr2qs("The config file with id '%Q' is not open"),&szId); } - + return true; } @@ -614,19 +614,19 @@ static bool config_kvs_cmd_flush(KviKvsModuleCommandCall * c) static bool config_kvs_cmd_clear(KviKvsModuleCommandCall * c) { QString szId; - KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("id",KVS_PT_STRING,0,szId) - KVSM_PARAMETERS_END(c) + KVSM_PARAMETERS_BEGIN(c) + KVSM_PARAMETER("id",KVS_PT_STRING,0,szId) + KVSM_PARAMETERS_END(c) KviConfig * cfg = g_pConfigDict->find(szId); - + if(cfg) { cfg->clear(); } else { c->warning(__tr2qs("The config file with id '%Q' is not open"),&szId); } - + return true; } @@ -657,20 +657,20 @@ static bool config_kvs_cmd_clearsection(KviKvsModuleCommandCall * c) { QString szId; QString szSect; - KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("id",KVS_PT_STRING,0,szId) + KVSM_PARAMETERS_BEGIN(c) + KVSM_PARAMETER("id",KVS_PT_STRING,0,szId) KVSM_PARAMETER("section",KVS_PT_STRING,0,szSect) - KVSM_PARAMETERS_END(c) + KVSM_PARAMETERS_END(c) KviConfig * cfg = g_pConfigDict->find(szId); - + if(cfg) { cfg->clearGroup(szSect); } else { c->warning(__tr2qs("The config file with id '%Q' is not open"),&szId); } - + return true; } @@ -705,22 +705,22 @@ static bool config_kvs_cmd_write(KviKvsModuleCommandCall * c) QString szId; QString szKey; QString szVal; - - KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("id",KVS_PT_STRING,0,szId) + + KVSM_PARAMETERS_BEGIN(c) + KVSM_PARAMETER("id",KVS_PT_STRING,0,szId) KVSM_PARAMETER("key",KVS_PT_STRING,0,szKey) KVSM_PARAMETER("value",KVS_PT_STRING,0,szVal) - KVSM_PARAMETERS_END(c) + KVSM_PARAMETERS_END(c) KviConfig * cfg = g_pConfigDict->find(szId); - + if(cfg) { cfg->writeEntry(szKey,szVal); } else { c->warning(__tr2qs("The config file with id '%Q' is not open"),&szId); } - + return true; } @@ -749,21 +749,21 @@ static bool config_kvs_cmd_setsection(KviKvsModuleCommandCall * c) { QString szId; QString szSect; - - KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("id",KVS_PT_STRING,0,szId) + + KVSM_PARAMETERS_BEGIN(c) + KVSM_PARAMETER("id",KVS_PT_STRING,0,szId) KVSM_PARAMETER("section",KVS_PT_STRING,0,szSect) - KVSM_PARAMETERS_END(c) + KVSM_PARAMETERS_END(c) KviConfig * cfg = g_pConfigDict->find(szId); - + if(cfg) { cfg->setGroup(szSect); } else { c->warning(__tr2qs("The config file with id '%Q' is not open"),&szId); } - + return true; } @@ -803,7 +803,7 @@ static bool config_kvs_cmd_setsection(KviKvsModuleCommandCall * c) It is not a good idea to keep a config file open forever: a good approach is to keep settings in memory variables and write them all at once when it comes to write settings: you open the config file , write all your values and close the file.[br] - You can obviously keep the config file open for some time but remember that + You can obviously keep the config file open for some time but remember that no change is written to the disk until [cmd]config.flush[/cmd] or [cmd]config.close[/cmd] is called.[br] You write entries by using [cmd]config.write[/cmd] and read them by using [fnc]$config.read[/fnc]().[br] You can change the "current" config section by using [cmd]config.setsection[/cmd].[br] @@ -841,7 +841,7 @@ static bool config_module_init(KviModule * m) KVSM_REGISTER_FUNCTION(m,"filelist",config_kvs_fnc_filelist); KVSM_REGISTER_FUNCTION(m,"filename",config_kvs_fnc_filename); KVSM_REGISTER_FUNCTION(m,"readonly",config_kvs_fnc_readonly); - + KVSM_REGISTER_SIMPLE_COMMAND(m,"close",config_kvs_cmd_close); KVSM_REGISTER_SIMPLE_COMMAND(m,"flush",config_kvs_cmd_flush); KVSM_REGISTER_SIMPLE_COMMAND(m,"clear",config_kvs_cmd_clear); @@ -852,14 +852,14 @@ static bool config_module_init(KviModule * m) return true; } -static bool config_module_cleanup(KviModule *m) +static bool config_module_cleanup(KviModule *) { delete g_pConfigDict; g_pConfigDict = 0; return true; } -static bool config_module_can_unload(KviModule *m) +static bool config_module_can_unload(KviModule *) { return g_pConfigDict->isEmpty(); } diff --git a/src/modules/context/libkvicontext.cpp b/src/modules/context/libkvicontext.cpp index 3c8ccf05c..5b8dc928c 100644 --- a/src/modules/context/libkvicontext.cpp +++ b/src/modules/context/libkvicontext.cpp @@ -384,7 +384,7 @@ static bool context_module_init(KviModule * m) return true; } -static bool context_module_cleanup(KviModule *m) +static bool context_module_cleanup(KviModule *) { return true; } diff --git a/src/modules/dcc/broker.cpp b/src/modules/dcc/broker.cpp index 17522220d..2b10ae2d7 100644 --- a/src/modules/dcc/broker.cpp +++ b/src/modules/dcc/broker.cpp @@ -428,9 +428,9 @@ void KviDccBroker::activeCanvasManage(KviDccDescriptor * dcc) } #endif +#ifdef COMPILE_DCC_CANVAS void KviDccBroker::activeCanvasExecute(KviDccBox *box,KviDccDescriptor * dcc) { -#ifdef COMPILE_DCC_CANVAS if(box)box->forgetDescriptor(); if(!g_pApp->windowExists(dcc->console())) @@ -451,6 +451,9 @@ void KviDccBroker::activeCanvasExecute(KviDccBox *box,KviDccDescriptor * dcc) if(bMinimized)cnv->minimize(); m_pDccWindowList->append(cnv); +#else +void KviDccBroker::activeCanvasExecute(KviDccBox *,KviDccDescriptor *) +{ #endif } @@ -592,8 +595,8 @@ void KviDccBroker::chooseSaveFileName(KviDccBox *box,KviDccDescriptor *dcc) } g_pMediaManager->unlock(); } - - if(dcc->szLocalFileName.isEmpty()) + + if(dcc->szLocalFileName.isEmpty()) { g_pApp->getLocalKvircDirectory(dcc->szLocalFileName,KviApp::Incoming); if(KVI_OPTION_BOOL(KviOption_boolSortReceivedByDccFilesByNicks)) @@ -642,7 +645,7 @@ void KviDccBroker::renameOverwriteResume(KviDccBox *box,KviDccDescriptor * dcc) if(fi.exists() && (fi.size() > 0)) // 0 byte files are senseless for us { dcc->szLocalFileSize.setNum(fi.size()); - + bool bOk; int iRemoteSize = dcc->szFileSize.toInt(&bOk); if(!bOk)iRemoteSize = -1; @@ -654,7 +657,7 @@ void KviDccBroker::renameOverwriteResume(KviDccBox *box,KviDccDescriptor * dcc) { QString tmp; bool bDisableResume = false; - + if((iRemoteSize > -1) || // remote size is unknown (iRemoteSize > ((int)(fi.size())))) // or it is larger than the actual size on disk { @@ -745,7 +748,7 @@ void KviDccBroker::renameDccSendFile(KviDccBox *box,KviDccDescriptor * dcc) szOrig.ptr(),&(dcc->szLocalFileName)); } } - + dcc->szLocalFileSize = "0"; // 0 for sure recvFileExecute(0,dcc); @@ -817,7 +820,7 @@ void KviDccBroker::sendFileExecute(KviDccBox * box,KviDccDescriptor *dcc) delete dcc; return; } - + dcc->szFileName = dcc->szLocalFileName; dcc->szFileName = QFileInfo(dcc->szFileName).fileName(); diff --git a/src/modules/dcc/chat.cpp b/src/modules/dcc/chat.cpp index 4a6532d98..230dc6f94 100644 --- a/src/modules/dcc/chat.cpp +++ b/src/modules/dcc/chat.cpp @@ -287,7 +287,7 @@ QPixmap * KviDccChat::myIconPtr() return g_pIconManager->getSmallIcon(KVI_SMALLICON_DCCMSG); } -void KviDccChat::getBaseLogFileName(KviStr &buffer) +void KviDccChat::getBaseLogFileName(QString &buffer) { buffer.sprintf("%s_%s_%s",m_pDescriptor->szNick.toUtf8().data(),m_pDescriptor->szIp.toUtf8().data(),m_pDescriptor->szPort.toUtf8().data()); } @@ -476,7 +476,7 @@ bool KviDccChat::event(QEvent *e) return KviWindow::event(e); } -void KviDccChat::resizeEvent(QResizeEvent *e) +void KviDccChat::resizeEvent(QResizeEvent *) { int hght = m_pInput->heightHint(); int hght2 = m_pTopSplitter->sizeHint().height(); diff --git a/src/modules/dcc/chat.h b/src/modules/dcc/chat.h index 6ba2019fa..326741d6a 100644 --- a/src/modules/dcc/chat.h +++ b/src/modules/dcc/chat.h @@ -77,7 +77,7 @@ protected: protected: virtual const QString & target(); virtual void fillCaptionBuffers(); - virtual void getBaseLogFileName(KviStr &buffer); + virtual void getBaseLogFileName(QString &buffer); virtual QPixmap * myIconPtr(); virtual void resizeEvent(QResizeEvent *e); virtual QSize sizeHint() const; diff --git a/src/modules/dcc/libkvidcc.cpp b/src/modules/dcc/libkvidcc.cpp index d45b9deda..f050c915a 100644 --- a/src/modules/dcc/libkvidcc.cpp +++ b/src/modules/dcc/libkvidcc.cpp @@ -118,7 +118,7 @@ static bool dcc_kvs_parse_default_parameters(KviDccDescriptor * d,KviKvsModuleCo d->szLocalHost = d->console()->connection()->userInfo()->hostName(); } - if(pSw = c->switches()->find('i',"ip")) + if( (pSw = c->switches()->find('i',"ip")) ) { pSw->asString(d->szListenIp); if(!(d->szListenIp.contains('.') || d->szListenIp.contains(':'))) @@ -142,13 +142,13 @@ static bool dcc_kvs_parse_default_parameters(KviDccDescriptor * d,KviKvsModuleCo d->szListenIp=tmp; } - if(pSw = c->switches()->find('p',"port")) + if( (pSw = c->switches()->find('p',"port")) ) { pSw->asString(d->szListenPort); // fixme! } else d->szListenPort = "0"; // any port is ok - if(pSw = c->switches()->find('a',"fake-address")) + if( (pSw = c->switches()->find('a',"fake-address")) ) { pSw->asString(d->szFakeIp); } @@ -160,7 +160,7 @@ static bool dcc_kvs_parse_default_parameters(KviDccDescriptor * d,KviKvsModuleCo } } - if(pSw = c->switches()->find('f',"fake-port")) + if( (pSw = c->switches()->find('f',"fake-port")) ) { pSw->asString(d->szFakePort); } @@ -198,7 +198,7 @@ static bool dcc_kvs_parse_default_parameters(KviDccDescriptor * d,KviKvsModuleCo !sw: -n | --no-ctcp Do NOT send the CTCP request to the target user, you will have to do it manually, or the remote user will have to connect manually (for example by using dcc.chat -c).[br] - + !sw: -c | --connect Attempt to CONNECT to the remote host specified as <interface> and <port>, instead of listening (active connection instead of a passive one). @@ -220,7 +220,7 @@ static bool dcc_kvs_parse_default_parameters(KviDccDescriptor * d,KviKvsModuleCo -i=3ffe:1001::1: this will bind to the IPv6 interface with the specified address.[br] -i=ppp0: this will bind to the IPv4 address of the interface ppp0 (if supported by the underlying system).[br] The -i switch parameter may serve also as a target address when the -c switch is used.[br] - + !sw: -p=<port> | --port=<port> Bind the local listening socket to the specified <port>. If this switch is NOT specified, the port will be a "random" one choosen by the kernel.[br] @@ -229,7 +229,7 @@ static bool dcc_kvs_parse_default_parameters(KviDccDescriptor * d,KviKvsModuleCo Send the <fake address> as target for the remote client in the requesting CTCP message. If this switch is not given, the CTCP will contain the real IP address of the listening interface.[br] - + !sw: -f=<fake port> | --fake-port=<fake port> Send the <fake port> as target port for the remote client in the requesting CTCP message. If this switch is not given, the CTCP will contain the real port of the listening socket. @@ -445,7 +445,7 @@ static bool dcc_kvs_cmd_chat(KviKvsModuleCommandCall * c) d->bActive = false; d->bSendRequest = !c->switches()->find('n',"no-ctcp"); } - + //c->window()->output(0,"%Q %Q %Q",&(d->szIp),&(d->szPort),&(d->szListenIp)); d->triggerCreationEvent(); g_pDccBroker->executeChat(0,d); @@ -500,7 +500,7 @@ static bool dcc_kvs_cmd_chat(KviKvsModuleCommandCall * c) Assume that the transfer was successful when the whole file has been sent, then close the socket.[br] This is called a "blind" DCC send.[br] - + !sw: -t | -tdcc Emulate the TDCC protocol: Use the TDCC CTCP message (DCC TSEND) for requesting the connection and assume that no acknowledges are sent. Wait for the remote end to close the connection.[br] @@ -516,7 +516,7 @@ static bool dcc_kvs_cmd_chat(KviKvsModuleCommandCall * c) !sw: -n | --no-ctcp Do NOT send the CTCP request to the target user, you will have to do it manually, or the remote user will have to connect manually (for example by using dcc.recv -c).[br] - + !sw: -c | --connect Attempt to CONNECT to the remote host specified as <interface> and <port>, instead of listening (active connection instead of a passive one). @@ -538,7 +538,7 @@ static bool dcc_kvs_cmd_chat(KviKvsModuleCommandCall * c) -i=3ffe:1001::1: this will bind to the IPv6 interface with the specified address.[br] -i=ppp0: this will bind to the IPv4 address of the interface ppp0 (if supported by the underlying system).[br] The -i switch parameter may serve also as a target address when the -c switch is used.[br] - + !sw: -p=<port> | --port=<port> Bind the local listening socket to the specified <port>. If this switch is NOT specified, the port will be a "random" one choosen by the kernel.[br] @@ -547,7 +547,7 @@ static bool dcc_kvs_cmd_chat(KviKvsModuleCommandCall * c) Send the <fake address> as target for the remote client in the requesting CTCP message. If this switch is not given, the CTCP will contain the real IP address of the listening interface.[br] - + !sw: -f=<fake port> | --fake-port=<fake port> Send the <fake port> as target port for the remote client in the requesting CTCP message. If this switch is not given, the CTCP will contain the real port of the listening socket. @@ -618,7 +618,7 @@ static bool dcc_kvs_cmd_send(KviKvsModuleCommandCall * c) QString szTmp; KviKvsVariant * pSw = 0; - if(pSw = c->switches()->find('g',"get")) + if( (pSw = c->switches()->find('g',"get")) ) { d->szFileName = QFileInfo(szFileName).fileName(); @@ -704,7 +704,7 @@ static bool dcc_kvs_cmd_send(KviKvsModuleCommandCall * c) Assume that the transfer was successful when the whole file has been sent, then close the socket.[br] This is called a "blind" DCC send.[br] - + !sw: -t | -tdcc Emulate the TDCC protocol: Use the TDCC CTCP message (DCC TSEND) for requesting the connection and assume that no acknowledges are sent. Wait for the remote end to close the connection.[br] @@ -720,7 +720,7 @@ static bool dcc_kvs_cmd_send(KviKvsModuleCommandCall * c) !sw: -n | --no-ctcp Do NOT send the CTCP request to the target user, you will have to do it manually, or the remote user will have to connect manually (for example by using dcc.recv -c).[br] - + !sw: -i=<interface> | --ip=<interface> Bind the local listening socket to the specified <interface> (which is an IP address, IPv4 or IPv6). If this switch is NOT specified, the socket is bound to the interface of @@ -732,7 +732,7 @@ static bool dcc_kvs_cmd_send(KviKvsModuleCommandCall * c) -i=3ffe:1001::1: this will bind to the IPv6 interface with the specified address.[br] -i=ppp0: this will bind to the IPv4 address of the interface ppp0 (if supported by the underlying system).[br] The -i switch parameter may serve also as a target address when the -c switch is used.[br] - + !sw: -p=<port> | --port=<port> Bind the local listening socket to the specified <port>. If this switch is NOT specified, the port will be a "random" one choosen by the kernel.[br] @@ -741,7 +741,7 @@ static bool dcc_kvs_cmd_send(KviKvsModuleCommandCall * c) Send the <fake address> as target for the remote client in the requesting CTCP message. If this switch is not given, the CTCP will contain the real IP address of the listening interface.[br] - + !sw: -f=<fake port> | --fake-port=<fake port> Send the <fake port> as target port for the remote client in the requesting CTCP message. If this switch is not given, the CTCP will contain the real port of the listening socket. @@ -813,7 +813,7 @@ static bool dcc_kvs_cmd_recv(KviKvsModuleCommandCall * c) d->szFileSize.setNum(uSize); d->bActive = false; // we have to listen! - d->bResume = false; + d->bResume = false; d->bRecvFile = true; // we have to receive the file! d->bSendRequest = !c->switches()->find('n',"no-ctcp"); d->bNoAcks = d->bIsTdcc || c->switches()->find('b',"blind"); @@ -1000,11 +1000,11 @@ static bool dcc_kvs_cmd_get(KviKvsModuleCommandCall * c) !sw: -g=<codec> | --codec=<codec> Use the codec specified as parameter. Actually the supported codecs are "null","adpcm" and "gsm". - + !sw: -h=<rate> | --sample-rate=<rate> Use the sample rate specified by <rage>. Valid sample rates are 8000, 11025, 22050 and 44100 Hz. - + !sw: -m[=<boolean>] | --minimize[=<boolean>] If the -m switch is passed, the default boolCreateMinimizedDccSend option is overridden with the <boolean> parameter passed. So actually @@ -1016,7 +1016,7 @@ static bool dcc_kvs_cmd_get(KviKvsModuleCommandCall * c) !sw: -n | --no-ctcp Do NOT send the CTCP request to the target user, you will have to do it manually, or the remote user will have to connect manually (for example by using dcc.recv -c).[br] - + !sw: -c | --connect Attempt to CONNECT to the remote host specified as <interface> and <port>, instead of listening (active connection instead of a passive one). @@ -1038,7 +1038,7 @@ static bool dcc_kvs_cmd_get(KviKvsModuleCommandCall * c) -i=3ffe:1001::1: this will bind to the IPv6 interface with the specified address.[br] -i=ppp0: this will bind to the IPv4 address of the interface ppp0 (if supported by the underlying system).[br] The -i switch parameter may serve also as a target address when the -c switch is used.[br] - + !sw: -p=<port> | --port=<port> Bind the local listening socket to the specified <port>. If this switch is NOT specified, the port will be a "random" one choosen by the kernel.[br] @@ -1047,7 +1047,7 @@ static bool dcc_kvs_cmd_get(KviKvsModuleCommandCall * c) Send the <fake address> as target for the remote client in the requesting CTCP message. If this switch is not given, the CTCP will contain the real IP address of the listening interface.[br] - + !sw: -f=<fake port> | --fake-port=<fake port> Send the <fake port> as target port for the remote client in the requesting CTCP message. If this switch is not given, the CTCP will contain the real port of the listening socket. @@ -2582,7 +2582,7 @@ static bool dcc_kvs_fnc_session(KviKvsModuleFunctionCall * c) @description: The first form returns an array with all the currently existing dcc session identifiers. The second form returns an array with the session types specified - in <filter> which may be a combination of the flags 'u' (for file upload), + in <filter> which may be a combination of the flags 'u' (for file upload), 'd' (for file download) and 'c' (for dcc chat). To select all the file transfers please use the combination 'ud'.[br] See the [module:dcc]dcc module[/module] documentation for more informations.[br] @@ -2604,7 +2604,7 @@ static bool dcc_kvs_fnc_sessionList(KviKvsModuleFunctionCall * c) KviPointerHashTableIterator<int,KviDccDescriptor> it(*dict); int idx = 0; - + if(szFlags.isEmpty()) { // all @@ -2737,7 +2737,7 @@ static bool dcc_module_init(KviModule * m) return true; } -static bool dcc_module_cleanup(KviModule *m) +static bool dcc_module_cleanup(KviModule *) { delete g_pDccBroker; g_pDccBroker = 0; @@ -2748,7 +2748,7 @@ static bool dcc_module_cleanup(KviModule *m) return true; } -static bool dcc_module_can_unload(KviModule *m) +static bool dcc_module_can_unload(KviModule *) { return g_pDccBroker ? g_pDccBroker->canUnload() : true; } diff --git a/src/modules/dcc/requests.cpp b/src/modules/dcc/requests.cpp index bf0245237..11be14844 100644 --- a/src/modules/dcc/requests.cpp +++ b/src/modules/dcc/requests.cpp @@ -1088,7 +1088,7 @@ static void dccModuleParseDccCanvas(KviDccRequest *dcc) #endif } -static void dccModuleParseDccList(KviDccRequest *dcc) +static void dccModuleParseDccList(KviDccRequest *) { // DCC LIST <mask> <ipaddr> <port> // FIXME! diff --git a/src/modules/dcc/voice.cpp b/src/modules/dcc/voice.cpp index d438e43e8..33cc14009 100644 --- a/src/modules/dcc/voice.cpp +++ b/src/modules/dcc/voice.cpp @@ -787,7 +787,7 @@ const QString & KviDccVoice::target() return m_szTarget; } -void KviDccVoice::getBaseLogFileName(KviStr &buffer) +void KviDccVoice::getBaseLogFileName(QString &buffer) { buffer.sprintf("dccvoice_%s_%s_%s",m_pDescriptor->szNick.toUtf8().data(),m_pDescriptor->szLocalFileName.toUtf8().data(),m_pDescriptor->szPort.toUtf8().data()); } @@ -886,7 +886,7 @@ void KviDccVoice::updateInfo() } } -void KviDccVoice::resizeEvent(QResizeEvent *e) +void KviDccVoice::resizeEvent(QResizeEvent *) { int hght2 = m_pHBox->sizeHint().height(); m_pHBox->setGeometry(0,0,width(),hght2); diff --git a/src/modules/dcc/voice.h b/src/modules/dcc/voice.h index 551812bf0..ab651038d 100644 --- a/src/modules/dcc/voice.h +++ b/src/modules/dcc/voice.h @@ -127,7 +127,7 @@ protected: virtual void resizeEvent(QResizeEvent *e); virtual QSize sizeHint() const; virtual bool event(QEvent *e); - virtual void getBaseLogFileName(KviStr &buffer); + virtual void getBaseLogFileName(QString &buffer); void startTalking(); void stopTalking(); void startConnection(); @@ -158,7 +158,7 @@ CODEC DEFINITION Sample endianness = le/be Sample compressor = name - + <rate>:<bits>:<endianness>:<compressor> 8000:16:le:null @@ -214,7 +214,7 @@ public: KviVoiceAudioEncoder(); ~KviVoiceAudioEncoder(); public: - + }; class KviVoiceAudioDecoder @@ -317,10 +317,10 @@ public: ~KviVoiceConference(); public: KviPointerList<KviVoiceLink> * m_pLinks; - KviPointerHashTable<QString,KviVoiceLink> * + KviPointerHashTable<QString,KviVoiceLink> * SOCKET m_hUdpSocket; QString m_szLastError; - + unsigned int m_uLocalAudioSampleRate; // samples/sec unsigned int m_uLocalAudioSampleSize; // bits unsigned int m_uLocalAudioEndianness; // 0 = le, 1 = be @@ -403,7 +403,7 @@ void KviVoiceConference::conferenceThread() // should be played consecutively. // Each packet in a chunk has an ordinal // Chunks must be relatively short in order -// to allow a remote end that looses a packet to +// to allow a remote end that looses a packet to // synchronize after a short period of time // The maximum number of packets in a chunk is 65535 (but a chunk should be no more than 24-32 KBytes in size // and in general they should be as small as possible, even one packet per chunk, if the codec allows it) diff --git a/src/modules/dialog/libkvidialog.cpp b/src/modules/dialog/libkvidialog.cpp index 0af8658b2..28e5137e7 100644 --- a/src/modules/dialog/libkvidialog.cpp +++ b/src/modules/dialog/libkvidialog.cpp @@ -59,15 +59,8 @@ KviKvsCallbackMessageBox::KviKvsCallbackMessageBox( const QString &szButton2, const QString &szCode, KviKvsVariantList * pMagicParams, - KviWindow * pWindow,bool modal) -: QMessageBox(0)/* - szCaption, - szText, - QMessageBox::NoIcon, - szButton0.isEmpty() ? QMessageBox::NoButton : QMessageBox::Ok | QMessageBox::Default, - szButton1.isEmpty() ? QMessageBox::NoButton : (szButton2.isEmpty() ? QMessageBox::No | QMessageBox::Escape : QMessageBox::No), - szButton2.isEmpty() ? QMessageBox::NoButton : QMessageBox::Cancel | QMessageBox::Escape, - 0,0,modal)*/ , + KviWindow * pWindow,bool) +: QMessageBox(0), KviKvsCallbackObject("dialog.message",pWindow,szCode,pMagicParams,0) { setWindowTitle(szCaption); @@ -107,7 +100,7 @@ void KviKvsCallbackMessageBox::done(int code) QMessageBox::done(code); kvs_int_t iVal = 0; - + switch(code) { case QMessageBox::No: iVal = 1; break; @@ -152,11 +145,11 @@ void KviKvsCallbackMessageBox::done(int code) <magic1>,<magic2>... are the magic parameters: evaluated at dialog.message call time and passed to the <callback_command> as positional parameters.[br] If the -b or -modal switch is specified the dialog will have non-blocking modal behaviour: - it will appear above its parent widget and block its input until it's closed.[br] + it will appear above its parent widget and block its input until it's closed.[br] Once the dialog has been shown , the user will click one of the buttons. At this point the dialog is hidden and the <callback_command> is executed passing the number of the button clicked as $0 and the magic parameters as positional parameters $1 , $2 , $3....[br] - Please note that if the user closes the window with the window manager close button , + Please note that if the user closes the window with the window manager close button , the action is interpreted as a button2 click (that is usually sth as "Cancel").[br] @examples: [example] @@ -361,7 +354,7 @@ void KviKvsCallbackTextInput::done(int code) } QString txt; - + if(m_bMultiLine) { txt = ((QTextEdit *)m_pEdit)->toPlainText(); @@ -424,7 +417,7 @@ void KviKvsCallbackTextInput::showEvent(QShowEvent *e) If the -d switch is used , the initial text input value is set to <default text>.[br] If the -i switch is used , the dialog displays also the icon <icon> , just on the left ot the <info_text>[br] If the -b or -modal switch is specified the dialog will have non-blocking modal behaviour: - it will appear above its parent widget and block its input until it's closed.[br] + it will appear above its parent widget and block its input until it's closed.[br] In that case <icon> is an [doc:image_id]image identifier[/doc] (can be a relative or absolute path to an image file or a signed number (in that case it defines an internal KVIrc image).[br] <magic1>,<magic2>... are the magic parameters: evaluated at dialog.textinput call time and passed @@ -432,7 +425,7 @@ void KviKvsCallbackTextInput::showEvent(QShowEvent *e) Once the dialog has been shown , the user will click one of the buttons. At this point the dialog is hidden and the <callback_command> is executed passing the text input value in $1, the number of the button clicked as $0, and the magic parameters as positional parameters $2 , $3 , $4....[br] - Please note that if the user closes the window with the window manager close button , + Please note that if the user closes the window with the window manager close button , the action is interpreted as a button2 click (that is usually sth as "Cancel").[br] @examples: [example] @@ -572,12 +565,12 @@ void KviKvsCallbackFileDialog::done(int code) <initial_selection> can be a directory or filename that will be initially selected in the dialog.[br] Only files matching <file_filter> are selectable. If filter is an empty string, all files are selectable.[br] In the filter string multiple filters can be specified separated by either two semicolons next to each - other or separated by newlines. To add two filters, one to show all C++ files and one to show all - header files, the filter string could look like "C++ Files (*.cpp *.cc *.C *.cxx *.c++);;Header Files (*.h *.hxx *.h++)" + other or separated by newlines. To add two filters, one to show all C++ files and one to show all + header files, the filter string could look like "C++ Files (*.cpp *.cc *.C *.cxx *.c++);;Header Files (*.h *.hxx *.h++)" <magic1>,<magic2>... are the magic parameters: evaluated at dialog.message call time and passed to the <callback_command> as positional parameters.[br] If the -b or -modal switch is specified the dialog will have non-blocking modal behaviour: - it will appear above its parent widget and block its input until it's closed.[br] + it will appear above its parent widget and block its input until it's closed.[br] Once the dialog has been shown , the user will select an EXISTING file and click either Ok or Cancel. At this point the dialog is hidden and the <callback_command> is executed passing the selected file(s) as $0 and the magic parameters as positional parameters $1 , $2 , $3....[br] @@ -703,7 +696,7 @@ void KviKvsCallbackImageDialog::done(int code) <magic1>,<magic2>... are the magic parameters: evaluated at dialog.image call time and passed to the <callback_command> as positional parameters.[br] If the -b or -modal switch is specified the dialog will have non-blocking modal behaviour: - it will appear above its parent widget and block its input until it's closed.[br] + it will appear above its parent widget and block its input until it's closed.[br] Once the dialog has been shown , the user will select an EXISTING file and click either Ok or Cancel. At this point the dialog is hidden and the <callback_command> is executed passing the selected file(s) as $0 and the magic parameters as positional parameters $1 , $2 , $3....[br] @@ -779,7 +772,7 @@ static bool dialog_kvs_fnc_yesno(KviKvsModuleFunctionCall * c) KVSM_PARAMETER("caption",KVS_PT_STRING,0,szCaption) KVSM_PARAMETER("text",KVS_PT_STRING,0,szText) KVSM_PARAMETERS_END(c) - + c->enterBlockingSection(); bool yes=KviMessageBox::yesNo(szCaption,szText); // this will happily crash on quit ? if(!c->leaveBlockingSection())return true; // just die @@ -869,11 +862,11 @@ static bool dialog_module_fnc_textline(KviModule *m,KviCommand *c,KviParameterLi That's REAL programming. */ -static bool dialog_module_init(KviModule * m) +static bool dialog_module_init(KviModule *m) { g_pDialogModuleDialogList = new KviPointerList<QWidget>; g_pDialogModuleDialogList->setAutoDelete(false); -debug("registering comman"); + KVSM_REGISTER_CALLBACK_COMMAND(m,"message",dialog_kvs_cmd_message); KVSM_REGISTER_CALLBACK_COMMAND(m,"textinput",dialog_kvs_cmd_textinput); KVSM_REGISTER_CALLBACK_COMMAND(m,"file",dialog_kvs_cmd_file); @@ -883,7 +876,7 @@ debug("registering comman"); return true; } -static bool dialog_module_cleanup(KviModule *m) +static bool dialog_module_cleanup(KviModule *) { // Here we get a tragedy if g_iLocalEventLoops > 0! while(g_pDialogModuleDialogList->first())delete g_pDialogModuleDialogList->first(); @@ -892,7 +885,7 @@ static bool dialog_module_cleanup(KviModule *m) return true; } -static bool dialog_module_can_unload(KviModule *m) +static bool dialog_module_can_unload(KviModule *) { return g_pDialogModuleDialogList->isEmpty(); } diff --git a/src/modules/editor/libkvieditor.cpp b/src/modules/editor/libkvieditor.cpp index fff84461e..b9290840f 100644 --- a/src/modules/editor/libkvieditor.cpp +++ b/src/modules/editor/libkvieditor.cpp @@ -42,7 +42,7 @@ static bool editor_module_init(KviModule * m) return true; } -static bool editor_module_cleanup(KviModule *m) +static bool editor_module_cleanup(KviModule *) { while(g_pScriptEditorWindowList->first()) { @@ -67,7 +67,7 @@ static bool editor_module_cleanup(KviModule *m) return true; } -static bool editor_module_can_unload(KviModule *m) +static bool editor_module_can_unload(KviModule *) { return ((g_pScriptEditorWindowList == 0) || (g_pScriptEditorWindowList->count() == 0)); } diff --git a/src/modules/editor/scripteditor.cpp b/src/modules/editor/scripteditor.cpp index 9d584db7d..ad6b53b77 100644 --- a/src/modules/editor/scripteditor.cpp +++ b/src/modules/editor/scripteditor.cpp @@ -96,7 +96,7 @@ KviScriptEditorWidget::KviScriptEditorWidget(QWidget * pParent) iIndex=0; QString szPath; g_pApp->getLocalKvircDirectory(szPath,KviApp::ConfigPlugins,tmp); - + if(!KviFileUtils::fileExists(szPath)) { if (!bSemaphore){ @@ -350,7 +350,7 @@ void KviScriptEditorWidget::keyPressEvent(QKeyEvent * e) static QString eow("~!@#$%^&*()_+{}|:\"<>?,/;'[]\\-="); // end of word bool hasModifier = (e->modifiers() != Qt::NoModifier) && !ctrlOrShift; QString completionPrefix = textUnderCursor(); - if (!isShortcut && (hasModifier || e->text().isEmpty()|| completionPrefix.length() < 3 || eow.contains(e->text().right(1)))) + if (!isShortcut && (hasModifier || e->text().isEmpty()|| completionPrefix.length() < 3 || eow.contains(e->text().right(1)))) { m_pCompleter->popup()->hide(); return; @@ -409,7 +409,7 @@ void KviScriptEditorWidget::mouseReleaseEvent(QMouseEvent * e) QRect r = cursorRect(); QTextCursor cur = cursorForPosition(e->pos()); // cur.select( - + //completelistbox->hide(); if (e->button() == Qt::RightButton) @@ -443,7 +443,7 @@ void KviScriptEditorWidget::mouseReleaseEvent(QMouseEvent * e) szBuffer = *(pList->at(0)); } - for (int i=0; i < pList->count(); i++) + for (unsigned int i=0; i < pList->count(); i++) QString str = *(pList->at(i)); KviKvsKernel::instance()->freeCompletionResult(pList); @@ -566,7 +566,7 @@ KviScriptEditorSyntaxHighlighter::KviScriptEditorSyntaxHighlighter(KviScriptEdit : QSyntaxHighlighter(pWidget),m_pTextEdit(pWidget) { // code adpated from QT4 example - + // FIX-ME: "function ..." - "function internal ..." // FIX-ME: "@$" // FIX-ME: "\" escape char @@ -574,7 +574,7 @@ KviScriptEditorSyntaxHighlighter::KviScriptEditorSyntaxHighlighter(KviScriptEdit updateSyntaxtTextFormat(); KviScriptHighlightingRule rule; - + rule.pattern=QRegExp("([=()[\\]!\"?<>;:.,+-])+"); rule.format=punctuationFormat; highlightingRules.append(rule); @@ -602,12 +602,12 @@ KviScriptEditorSyntaxHighlighter::KviScriptEditorSyntaxHighlighter(KviScriptEdit commentStartExpression = QRegExp("/\\*"); commentEndExpression = QRegExp("\\*/"); - + } KviScriptEditorSyntaxHighlighter::~KviScriptEditorSyntaxHighlighter() { - + } void KviScriptEditorSyntaxHighlighter::updateSyntaxtTextFormat() { @@ -616,15 +616,15 @@ void KviScriptEditorSyntaxHighlighter::updateSyntaxtTextFormat() keywordFormat.setForeground(g_clrKeyword); keywordFormat.setFont(g_fntNormal); - + functionFormat.setForeground(g_clrFunction); functionFormat.setFont(g_fntNormal); - + variableFormat.setForeground(g_clrVariable); variableFormat.setFont(g_fntNormal); - + bracketFormat.setForeground(g_clrBracket); bracketFormat.setFont(g_fntNormal); @@ -654,28 +654,28 @@ void KviScriptEditorSyntaxHighlighter::highlightBlock(const QString & szText) if (iIndexStart == szText.size()) return; // check 'commands' int iCommandStart=iIndexStart; - if (szText.at(iIndexStart).unicode()!='$' && szText.at(iIndexStart).unicode()!='{' && szText.at(iIndexStart).unicode()!='}' && szText.at(iIndexStart).unicode()!='%') - { + if (szText.at(iIndexStart).unicode()!='$' && szText.at(iIndexStart).unicode()!='{' && szText.at(iIndexStart).unicode()!='}' && szText.at(iIndexStart).unicode()!='%') + { while(iIndexStart<szText.size() && (szText.at(iIndexStart).isLetterOrNumber() || (szText.at(iIndexStart).unicode() == '.') || (szText.at(iIndexStart).unicode() == '_') || (szText.at(iIndexStart).unicode()== ':') )) { - iIndexStart++; + iIndexStart++; } - setFormat(iCommandStart,iIndexStart-iCommandStart,keywordFormat); + setFormat(iCommandStart,iIndexStart-iCommandStart,keywordFormat); } // code from QT4 example int index=0; - foreach (KviScriptHighlightingRule rule, highlightingRules) + foreach (KviScriptHighlightingRule rule, highlightingRules) { QRegExp expression(rule.pattern); QString sz=expression.pattern(); index = szText.indexOf(expression,iIndexStart); - + while (index >= 0) { int length = expression.matchedLength(); - setFormat(index, length, rule.format); + setFormat(index, length, rule.format); index = szText.indexOf(expression, index + length); } } @@ -684,8 +684,8 @@ void KviScriptEditorSyntaxHighlighter::highlightBlock(const QString & szText) int startIndex = 0; if (previousBlockState() != 1) startIndex = szText.indexOf(commentStartExpression); - - while (startIndex >= 0) + + while (startIndex >= 0) { int endIndex = szText.indexOf(commentEndExpression, startIndex); int commentLength; @@ -714,7 +714,7 @@ void KviScriptEditorSyntaxHighlighter::highlightBlock(const QString & szText) index = szText.indexOf(regFind, index + length); } } - + } @@ -734,7 +734,7 @@ KviScriptEditorImplementation::KviScriptEditorImplementation(QWidget * par) m_pFindLineEdit->setPalette(p); m_pEditor = new KviScriptEditorWidget(this); - + g->addWidget(m_pEditor, 0, 0, 1,4); g->setRowStretch(0,1); @@ -808,7 +808,7 @@ void KviScriptEditorImplementation::slotFind() emit find(m_pFindLineEdit->text()); } -void KviScriptEditorImplementation::slotNextFind(const QString & szText) +void KviScriptEditorImplementation::slotNextFind(const QString &) //szText { // emit nextFind(const QString & szText); } @@ -846,7 +846,7 @@ void KviScriptEditorImplementation::setFocus() m_pEditor->setFocus(); } -void KviScriptEditorImplementation::focusInEvent(QFocusEvent * e) +void KviScriptEditorImplementation::focusInEvent(QFocusEvent *) { m_pEditor->setFocus(); } @@ -880,6 +880,11 @@ void KviScriptEditorImplementation::saveToFile() } } +void KviScriptEditorImplementation::setText(const char * txt) +{ + setText(KviQCString(txt)); +} + void KviScriptEditorImplementation::setText(const KviQCString & szText) { m_pEditor->setText(szText.data()); @@ -972,7 +977,7 @@ void KviScriptEditorImplementation::configureColors() } } -KviScriptEditorReplaceDialog::KviScriptEditorReplaceDialog(QWidget * parent, const char * name) +KviScriptEditorReplaceDialog::KviScriptEditorReplaceDialog(QWidget * parent, const char *) : QDialog(parent) { m_pParent = parent; @@ -1004,7 +1009,7 @@ KviScriptEditorReplaceDialog::KviScriptEditorReplaceDialog(QWidget * parent, con m_pReplaceLineEdit->setObjectName("replacelineedit"); pLayout->addWidget(m_pReplaceLineEdit,1,1); - + m_pFindLineEdit->setFocus(); m_pCheckReplaceAll = new QCheckBox(this); diff --git a/src/modules/editor/scripteditor.h b/src/modules/editor/scripteditor.h index bda21f108..31d8d63a0 100644 --- a/src/modules/editor/scripteditor.h +++ b/src/modules/editor/scripteditor.h @@ -66,7 +66,7 @@ protected: public: KviScriptEditorSyntaxHighlighter * syntaxHighlighter(){return m_pSyntaxHighlighter;}; void createCompleter(QStringList &list); - + void loadCompleterFromFile(); QCompleter * completer() const { return m_pCompleter; }; QString textUnderCursor() const; @@ -135,7 +135,7 @@ private: QTextCharFormat functionFormat; QTextCharFormat commentFormat; - + }; class KviScriptEditorImplementation : public KviScriptEditor @@ -152,6 +152,7 @@ protected: QLabel * m_pRowColLabel; int m_lastCursorPos; public: + virtual void setText(const char * txt); virtual void setText(const QString & szText); virtual void setText(const KviQCString & szText); virtual void getText(QString & szText); diff --git a/src/modules/eventeditor/eventeditor.cpp b/src/modules/eventeditor/eventeditor.cpp index 39662582b..ea71b625f 100644 --- a/src/modules/eventeditor/eventeditor.cpp +++ b/src/modules/eventeditor/eventeditor.cpp @@ -359,7 +359,7 @@ void KviEventEditor::saveLastEditedItem() m_pLastEditedItem->m_szBuffer = tmp; } -void KviEventEditor::currentItemChanged(QTreeWidgetItem * it,QTreeWidgetItem *prev) +void KviEventEditor::currentItemChanged(QTreeWidgetItem * it,QTreeWidgetItem *) { __range_valid(m_bOneTimeSetupDone); saveLastEditedItem(); @@ -371,7 +371,7 @@ void KviEventEditor::currentItemChanged(QTreeWidgetItem * it,QTreeWidgetItem *pr m_pEditor->setEnabled(false); return; } - + if(it->parent()) { m_pLastEditedItem = (KviEventHandlerTreeWidgetItem *)it; @@ -549,7 +549,7 @@ QPixmap * KviEventEditorWindow::myIconPtr() return g_pIconManager->getSmallIcon(KVI_SMALLICON_EVENT); } -void KviEventEditorWindow::resizeEvent(QResizeEvent *e) +void KviEventEditorWindow::resizeEvent(QResizeEvent *) { int hght = m_pBase->sizeHint().height(); m_pEditor->setGeometry(0,0,width(),height()- hght); @@ -577,12 +577,12 @@ void KviEventEditorWindow::fillCaptionBuffers() m_szHtmlInactiveCaption += p3; } -void KviEventEditorWindow::getConfigGroupName(KviStr &szName) +void KviEventEditorWindow::getConfigGroupName(QString &szName) { szName = "eventeditor"; } -void KviEventEditorWindow::saveProperties(KviConfig *cfg) +void KviEventEditorWindow::saveProperties(KviConfig *) //cfg { /* #ifdef COMPILE_SCRIPTTOOLBAR @@ -593,7 +593,7 @@ void KviEventEditorWindow::saveProperties(KviConfig *cfg) */ } -void KviEventEditorWindow::loadProperties(KviConfig *cfg) +void KviEventEditorWindow::loadProperties(KviConfig *) //cfg { /* #ifdef COMPILE_SCRIPTTOOLBAR diff --git a/src/modules/eventeditor/eventeditor.h b/src/modules/eventeditor/eventeditor.h index 51c0b77fb..0133f504d 100644 --- a/src/modules/eventeditor/eventeditor.h +++ b/src/modules/eventeditor/eventeditor.h @@ -61,7 +61,7 @@ public: public: const int & cursorPosition(){return m_cPos; }; void setCursorPosition(const int &cPos){debug ("set cursor to %d",cPos); m_cPos = cPos; }; - + void setName(const QString &szName); QString name() const { return m_szName; }; void setEnabled(const bool bEnabled); @@ -125,7 +125,7 @@ protected: virtual QPixmap * myIconPtr(); virtual void fillCaptionBuffers(); virtual void resizeEvent(QResizeEvent *e); - virtual void getConfigGroupName(KviStr &szName); + virtual void getConfigGroupName(QString &szName); virtual void saveProperties(KviConfig *); virtual void loadProperties(KviConfig *); protected slots: diff --git a/src/modules/eventeditor/libkvieventeditor.cpp b/src/modules/eventeditor/libkvieventeditor.cpp index b0b9d2ba6..630348929 100644 --- a/src/modules/eventeditor/libkvieventeditor.cpp +++ b/src/modules/eventeditor/libkvieventeditor.cpp @@ -66,12 +66,12 @@ static bool eventeditor_module_init(KviModule * m) return true; } -static bool eventeditor_module_can_unload(KviModule * m) +static bool eventeditor_module_can_unload(KviModule *) { return (g_pEventEditorWindow == 0); } -static bool eventeditor_module_cleanup(KviModule *m) +static bool eventeditor_module_cleanup(KviModule *) { if(g_pEventEditorWindow)delete g_pEventEditorWindow; g_pEventEditorWindow = 0; diff --git a/src/modules/file/libkvifile.cpp b/src/modules/file/libkvifile.cpp index 279e2186f..bb6c8eb24 100644 --- a/src/modules/file/libkvifile.cpp +++ b/src/modules/file/libkvifile.cpp @@ -479,7 +479,7 @@ static bool file_kvs_fnc_allSizes(KviKvsModuleFunctionCall * c) KVSM_PARAMETER("directory",KVS_PT_NONEMPTYSTRING,0,szDir) KVSM_PARAMETERS_END(c) KviFileUtils::adjustFilePath(szDir); - + QDir d(szDir); if(!d.exists()) { @@ -845,7 +845,7 @@ static bool file_kvs_fnc_readLines(KviKvsModuleFunctionCall * c) } f.close(); - + c->returnValue()->setArray(a); return true; @@ -903,7 +903,6 @@ static bool file_kvs_cmd_writeLines(KviKvsModuleCommandCall * c) KviFileUtils::adjustFilePath(szFile); KviFile f(szFile); - int iFlags = QIODevice::WriteOnly; if(!f.openForWriting(c->switches()->find('a',"append"))) { @@ -1231,7 +1230,7 @@ static bool file_module_init(KviModule * m) return true; } -static bool file_module_cleanup(KviModule *m) +static bool file_module_cleanup(KviModule *) { return true; } diff --git a/src/modules/filetransferwindow/filetransferwindow.cpp b/src/modules/filetransferwindow/filetransferwindow.cpp index 76530efb0..893156424 100644 --- a/src/modules/filetransferwindow/filetransferwindow.cpp +++ b/src/modules/filetransferwindow/filetransferwindow.cpp @@ -98,7 +98,7 @@ void KviFileTransferItem::displayUpdate() tableWidget()->model()->setData(tableWidget()->model()->index(row(),2), dummy, Qt::DisplayRole); } -QString KviFileTransferItem::key(int column,bool bAcending) const +QString KviFileTransferItem::key(int,bool) const { QString ret; ret.setNum(m_pTransfer->id()); @@ -183,8 +183,6 @@ void KviFileTransferWidget::paintEvent(QPaintEvent * event) QPainter *p = new QPainter(viewport()); QStyleOptionViewItem option = viewOptions(); QRect rect = event->rect(); - KviFileTransferItem* item; - int r, c; #ifdef COMPILE_PSEUDO_TRANSPARENCY if(g_pShadedChildGlobalDesktopBackground) @@ -227,17 +225,11 @@ void KviFileTransferItemDelegate::paint(QPainter * p, const QStyleOptionViewItem transfer->displayPaint(p, index.column(), option.rect); } -QSize KviFileTransferItemDelegate::sizeHint( const QStyleOptionViewItem & option, const QModelIndex & index ) const +QSize KviFileTransferItemDelegate::sizeHint(const QStyleOptionViewItem &, const QModelIndex &) const { // FIXME fixed width return QSize(((KviFileTransferWidget*)parent())->viewport()->size().width(), 68); } -/* -void KviFileTransferItem::setHeight(int h) -{ - KviTalTableWidgetItem::setHeight(m_pTransfer->displayHeight(g_pFileTransferWindow->lineSpacing())); -} -*/ KviFileTransferWindow::KviFileTransferWindow(KviModuleExtensionDescriptor * d,KviFrame * lpFrm) : KviWindow(KVI_WINDOW_TYPE_TOOL,lpFrm,"file transfer window",0) , KviModuleExtension(d) @@ -262,9 +254,11 @@ KviFileTransferWindow::KviFileTransferWindow(KviModuleExtensionDescriptor * d,Kv m_pItemDelegate = new KviFileTransferItemDelegate(m_pTableWidget); m_pTableWidget->setItemDelegate(m_pItemDelegate); +/* + * TODO KviDynamicToolTip * tp = new KviDynamicToolTip(m_pTableWidget->viewport()); - //TODO - //connect(tp,SIGNAL(tipRequest(KviDynamicToolTip *,const QPoint &)),this,SLOT(tipRequest(KviDynamicToolTip *,const QPoint &))); + connect(tp,SIGNAL(tipRequest(KviDynamicToolTip *,const QPoint &)),this,SLOT(tipRequest(KviDynamicToolTip *,const QPoint &))); +*/ QFontMetrics fm(font()); m_iLineSpacing = fm.lineSpacing(); @@ -364,8 +358,11 @@ void KviFileTransferWindow::transferUnregistering(KviFileTransfer * t) { KviFileTransferItem * it = findItem(t); //t->setDisplayItem(0); - if(it)delete it; - it = 0; + if(it) + { + delete it; + it = 0; + } } void KviFileTransferWindow::doubleClicked(KviFileTransferItem *it,const QPoint &) @@ -781,7 +778,7 @@ void KviFileTransferWindow::clearTerminated() KviFileTransferManager::instance()->killTerminatedTransfers(); } -void KviFileTransferWindow::getBaseLogFileName(KviStr &buffer) +void KviFileTransferWindow::getBaseLogFileName(QString &buffer) { buffer.sprintf("FILETRANSFER"); } @@ -791,7 +788,7 @@ QPixmap * KviFileTransferWindow::myIconPtr() return g_pIconManager->getSmallIcon(KVI_SMALLICON_FILETRANSFER); } -void KviFileTransferWindow::resizeEvent(QResizeEvent *e) +void KviFileTransferWindow::resizeEvent(QResizeEvent *) { m_pSplitter->setGeometry(0,0,width(),height()); } diff --git a/src/modules/filetransferwindow/filetransferwindow.h b/src/modules/filetransferwindow/filetransferwindow.h index ff9be522f..8f126e8f2 100644 --- a/src/modules/filetransferwindow/filetransferwindow.h +++ b/src/modules/filetransferwindow/filetransferwindow.h @@ -109,7 +109,7 @@ protected: virtual void fillCaptionBuffers(); virtual void applyOptions(); virtual void resizeEvent(QResizeEvent *e); - virtual void getBaseLogFileName(KviStr &buffer); + virtual void getBaseLogFileName(QString &buffer); KviFileTransferItem * findItem(KviFileTransfer * t); void fillTransferView(); KviFileTransfer * selectedTransfer(); diff --git a/src/modules/filetransferwindow/libkvifiletransferwindow.cpp b/src/modules/filetransferwindow/libkvifiletransferwindow.cpp index 3a92c7d8f..88d927f3b 100644 --- a/src/modules/filetransferwindow/libkvifiletransferwindow.cpp +++ b/src/modules/filetransferwindow/libkvifiletransferwindow.cpp @@ -131,7 +131,7 @@ static bool filetransferwindow_module_init(KviModule * m) return true; } -static bool filetransferwindow_module_cleanup(KviModule *m) +static bool filetransferwindow_module_cleanup(KviModule *) { if(g_pFileTransferWindow) { @@ -141,7 +141,7 @@ static bool filetransferwindow_module_cleanup(KviModule *m) return true; } -static bool filetransferwindow_module_can_unload(KviModule *m) +static bool filetransferwindow_module_can_unload(KviModule *) { return (!g_pFileTransferWindow); } diff --git a/src/modules/help/helpwidget.cpp b/src/modules/help/helpwidget.cpp index df4badcd3..cd7707913 100644 --- a/src/modules/help/helpwidget.cpp +++ b/src/modules/help/helpwidget.cpp @@ -44,7 +44,7 @@ extern Index * g_pDocIndex; extern KviPointerList<KviHelpWindow> * g_pHelpWindowList; extern KviPointerList<KviHelpWidget> * g_pHelpWidgetList; -KviHelpWidget::KviHelpWidget(QWidget * par,KviFrame * lpFrm,bool bIsStandalone) +KviHelpWidget::KviHelpWidget(QWidget * par,KviFrame *,bool bIsStandalone) : QWidget(par) { setObjectName("help_widget"); @@ -103,7 +103,7 @@ void KviHelpWidget::showIndex() m_pTextBrowser->setSource(QUrl::fromLocalFile(dirHelp.absoluteFilePath("index.html"))); } -void KviHelpWidget::resizeEvent(QResizeEvent *e) +void KviHelpWidget::resizeEvent(QResizeEvent *) { int hght = m_pToolBar->sizeHint().height(); if(hght < 40)hght = 40; diff --git a/src/modules/help/helpwindow.cpp b/src/modules/help/helpwindow.cpp index 33ac9f351..397967deb 100644 --- a/src/modules/help/helpwindow.cpp +++ b/src/modules/help/helpwindow.cpp @@ -271,7 +271,7 @@ QPixmap * KviHelpWindow::myIconPtr() return g_pIconManager->getSmallIcon(KVI_SMALLICON_MDIHELP); } -void KviHelpWindow::resizeEvent(QResizeEvent *e) +void KviHelpWindow::resizeEvent(QResizeEvent *) { m_pSplitter->setGeometry(0,0,width(),height()); } diff --git a/src/modules/help/index.cpp b/src/modules/help/index.cpp index 3a7664b83..a311f42dd 100644 --- a/src/modules/help/index.cpp +++ b/src/modules/help/index.cpp @@ -60,7 +60,7 @@ QDataStream &operator<<( QDataStream &s, const Document &l ) return s; } -Index::Index( const QString &dp, const QString &hp ) +Index::Index( const QString &dp, const QString & ) : QObject( 0), dict( 8999 ), docPath( dp ) { alreadyHaveDocList = FALSE; @@ -68,7 +68,7 @@ Index::Index( const QString &dp, const QString &hp ) connect(qApp,SIGNAL(lastWindowClosed()),this,SLOT(setLastWinClosed())); } -Index::Index( const QStringList &dl, const QString &hp ) +Index::Index( const QStringList &dl, const QString & ) : QObject( 0), dict( 8999 ) { docList = dl; @@ -99,17 +99,17 @@ int Index::makeIndex() dict.clear(); QStringList::Iterator it = docList.begin(); -// QProgressDialog* pProgressDialog = new QProgressDialog( __tr2qs("Indexing help files"), __tr2qs("Cancel"), 0, docList.count() ); -// pProgressDialog->setWindowTitle(__tr2qs("KVIrc")); -// pProgressDialog->setMinimumDuration(500); -// pProgressDialog->setWindowModality(Qt::WindowModal); + QProgressDialog* pProgressDialog = new QProgressDialog( __tr2qs("Indexing help files"), __tr2qs("Cancel"), 0, docList.count() ); + pProgressDialog->setWindowTitle(__tr2qs("KVIrc")); + pProgressDialog->setMinimumDuration(500); + pProgressDialog->setWindowModality(Qt::WindowModal); for ( int i = 0; it != docList.end(); ++it, ++i ) { -// if (lastWindowClosed ||pProgressDialog->wasCanceled()) -// break; + if (lastWindowClosed ||pProgressDialog->wasCanceled()) + break; parseDocument( *it, i ); -// pProgressDialog->setValue(i); + pProgressDialog->setValue(i); } -// delete pProgressDialog; + delete pProgressDialog; return 0; } @@ -162,7 +162,7 @@ void Index::parseDocument( const QString &filename, int docNum ) QChar c = buf[0]; int j = 0; int i = 0; - while ( (uint)j < text.length() ) { + while ( j < text.length() ) { if ( c == '<' || c == '&' ) { valid = FALSE; if ( i > 1 ) insertInDict( QString(str,i), docNum ); @@ -497,7 +497,7 @@ bool Index::searchForPattern( const QStringList &patterns, const QStringList &wo QChar c = buf[0]; int j = 0; int i = 0; - while ( (uint)j < text.length() ) { + while ( j < text.length() ) { if ( c == '<' || c == '&' ) { valid = FALSE; if ( i > 1 ) buildMiniDict( QString(str,i) ); @@ -543,12 +543,12 @@ bool Index::searchForPattern( const QStringList &patterns, const QStringList &wo wordLst = tmp.split( ' '); a = miniDict[ wordLst[0] ]->positions; - for ( int j = 1; j < (int)wordLst.count(); ++j ) { + for ( int j = 1; j < wordLst.count(); ++j ) { b = miniDict[ wordLst[j] ]->positions; aIt = a.begin(); while ( aIt != a.end() ) { - if ( b.indexOf( *aIt + 1 ) != b.at(b.count()-1) ) { + if ( (uint) b.indexOf( *aIt + 1 ) != b.at(b.count()-1) ) { (*aIt)++; ++aIt; } else { diff --git a/src/modules/help/libkvihelp.cpp b/src/modules/help/libkvihelp.cpp index 556eb96f1..266fe2f9c 100644 --- a/src/modules/help/libkvihelp.cpp +++ b/src/modules/help/libkvihelp.cpp @@ -198,7 +198,7 @@ static bool help_module_init(KviModule * m) return true; } -static bool help_module_cleanup(KviModule *m) +static bool help_module_cleanup(KviModule *) { if(g_pDocIndex) delete g_pDocIndex; while(g_pHelpWidgetList->first())delete g_pHelpWidgetList->first(); @@ -210,7 +210,7 @@ static bool help_module_cleanup(KviModule *m) return true; } -static bool help_module_can_unload(KviModule *m) +static bool help_module_can_unload(KviModule *) { return (g_pHelpWidgetList->isEmpty() && g_pHelpWindowList->isEmpty()); } diff --git a/src/modules/http/libkvihttp.cpp b/src/modules/http/libkvihttp.cpp index c62781eab..3d999464f 100644 --- a/src/modules/http/libkvihttp.cpp +++ b/src/modules/http/libkvihttp.cpp @@ -122,10 +122,10 @@ static bool http_kvs_complete_get(KviKvsModuleCommandCall * c,QString &szUrl,QSt if(c->switches()->find('q',"quiet")) hft->setNotifyCompletion(false); - + if(c->switches()->find('y',"no-output")) hft->setNoOutput(true); - + if(!szCallback.isEmpty()) hft->setCompletionCallback(szCallback); @@ -168,7 +168,7 @@ static bool http_kvs_complete_get(KviKvsModuleCommandCall * c,QString &szUrl,QSt Don't show the savefile dialog but determine automatically a file name. The file is put in the KVIrc incoming directory and the file name is the processed url.[br] - + !sw: -e=<existing_file_action> | --existing-file-action=<existing_file_action> Specifies the action to be taken when the local file already exists.[br] The action can be one of "i","e","o" or "r".[br] @@ -178,7 +178,7 @@ static bool http_kvs_complete_get(KviKvsModuleCommandCall * c,QString &szUrl,QSt "o" causes the existing file to be overwritten and "r" will attempt to resume a interrupted transfer.[br] The default is to rename the incoming file.[br] - + !sw: -m=<max_content_length> | --max-len=<max_content_length> Causes content longer than <max_content_length> to be discarded.[br] This is mainly to prevent you from automatically downloading 300 MB files @@ -188,7 +188,7 @@ static bool http_kvs_complete_get(KviKvsModuleCommandCall * c,QString &szUrl,QSt If the Content-length header is missing then the transfer is interrupted when the received data length exceeds <max_content_length>.[br] -m=0 means "accept any content length" (which is the default).[br] - + !sw: -o=<content_offset> | --offset=<content_offset> Causes the download to start from position <content offset>.[br] This can be used to download only a part of the file starting at byte <content_offset>.[br] @@ -198,13 +198,13 @@ static bool http_kvs_complete_get(KviKvsModuleCommandCall * c,QString &szUrl,QSt and -e=r then the file will be resumed, the transfer will start at the specified offset and the received stream will be appended to the existing file.(avoid it unless you know what you're doing: it's easy to download broken files).[br] - + !sw: -h | --head Causes the connection to use the HTTP HEAD method that effectively does not transfer real data. The server sends only the response headers. This might be used in conjunction with the -v option to print the headers to the active window.[br] - + !sw: -w=<flags> | --winctrl This switch controls the creation and visualization of the transfer window. <flags> can be any combination of 'm','n' and 'h'. @@ -212,19 +212,19 @@ static bool http_kvs_complete_get(KviKvsModuleCommandCall * c,QString &szUrl,QSt Note that with 'h' the user has no possibility to interact with the transfer. The flag 'm' causes the transfer window to be created as "minimized". 'm' does nothing if the window alread exists. The flag 'n' causes the window to be NOT activated (brought to top). - + !sw: -i=<magic identifier> | --identifier=<magic identifier> This identifier is passed as $3 parameter to the [event]OnHTTPGetTerminated[/event] when this transfer terminates. If this switch is not present then an empty string is used. With [cmd]http.asyngGet[/cmd] this parameter is passed to the callback command instead. - + !sw: -p=<post data> | --post-data=<post data> The request is sent in form of a POST request. <post data> is the urlencoded payload of the request. -p is incompatible with -h. - + !sw: -q | --quiet Do not notify download completion in the notifier window nor in the console. - + !sw: -y | --no-output Supress any output in the file transfer window. This will effectively disable the file transfer window highlighting (so the user will not be alerted by a failed @@ -297,13 +297,13 @@ static bool http_module_init(KviModule * m) return true; } -static bool http_module_cleanup(KviModule *m) +static bool http_module_cleanup(KviModule *) { KviHttpFileTransfer::done(); return true; } -static bool http_module_can_unload(KviModule *m) +static bool http_module_can_unload(KviModule *) { return (KviHttpFileTransfer::runningTransfers() == 0); } diff --git a/src/modules/ident/libkviident.cpp b/src/modules/ident/libkviident.cpp index 15970d501..3d4f26ddb 100644 --- a/src/modules/ident/libkviident.cpp +++ b/src/modules/ident/libkviident.cpp @@ -278,7 +278,7 @@ void KviIdentDaemon::run() m_sock6 = KVI_INVALID_SOCKET; goto ipv6_failure; } - + if(!kvi_socket_bind(m_sock6,sa6.socketAddress(),((int)(sa6.addressLength())))) { postMessage(__tr("Can't start the ident service on IPv6 : bind() failed"),0); @@ -287,7 +287,7 @@ void KviIdentDaemon::run() goto ipv6_failure; } - + if(!kvi_socket_listen(m_sock6,128)) { postMessage(__tr("Can't start the ident service on IPv6 : listen() failed"),0); @@ -444,16 +444,16 @@ ipv6_failure: for(r = m_pRequestList->first();r;r = m_pRequestList->next()) { - + int idx = r->m_szData.findFirstIdx('\n'); - + if(idx != -1) { // Ok...parse the request KviStr szReq = r->m_szData.left(idx); r->m_szData.cutLeft(idx + 1); szReq.trimmed(); - + if(szReq.hasData()) { postMessage(__tr("Identd processing request"),r,szReq.ptr()); @@ -466,16 +466,16 @@ ipv6_failure: KviStr reply(KviStr::Format,"%s : USERID : UNIX : %s\r\n",szReq.ptr(),m_szUser.ptr()); kvi_socket_write(r->m_sock,reply.ptr(),reply.len()); } - + dying.append(r); - + } else { - + postMessage(__tr("Empty request (EOT ?)"),r,szReq.ptr()); - + dying.append(r); } - + } else { // debug("Data is : (%s)",r->m_szData.ptr()); if(r->m_szData.len() > 1024) @@ -485,7 +485,7 @@ ipv6_failure: postMessage(__tr("Dropping connection (request too long)"),r); } } - + } } @@ -544,7 +544,7 @@ exit_thread: any other ident daemon running on your machine.[br] */ -static bool ident_kvs_cmd_start(KviKvsModuleCommandCall * c) +static bool ident_kvs_cmd_start(KviKvsModuleCommandCall *) { if(!g_iIdentDaemonRunningUsers) startIdentService(); @@ -568,7 +568,7 @@ static bool ident_kvs_cmd_start(KviKvsModuleCommandCall * c) [cmd]ident.start[/cmd] */ -static bool ident_kvs_cmd_stop(KviKvsModuleCommandCall * c) +static bool ident_kvs_cmd_stop(KviKvsModuleCommandCall *) { if(g_iIdentDaemonRunningUsers) g_iIdentDaemonRunningUsers--; if(!g_iIdentDaemonRunningUsers) stopIdentService(); @@ -583,7 +583,7 @@ static bool ident_module_init(KviModule *m) return true; } -static bool ident_module_cleanup(KviModule *m) +static bool ident_module_cleanup(KviModule *) { stopIdentService(); delete g_pIdentSentinel; @@ -592,7 +592,7 @@ static bool ident_module_cleanup(KviModule *m) return true; } -static bool ident_module_can_unload(KviModule *m) +static bool ident_module_can_unload(KviModule *) { return !g_pIdentDaemon; } diff --git a/src/modules/iograph/libkviiograph.cpp b/src/modules/iograph/libkviiograph.cpp index 29267ad61..64f698bcf 100644 --- a/src/modules/iograph/libkviiograph.cpp +++ b/src/modules/iograph/libkviiograph.cpp @@ -61,7 +61,7 @@ QPixmap * KviIOGraphWindow::myIconPtr() return g_pIconManager->getSmallIcon(KVI_SMALLICON_SAYICON); } -void KviIOGraphWindow::resizeEvent(QResizeEvent *e) +void KviIOGraphWindow::resizeEvent(QResizeEvent *) { m_pIOGraph->setGeometry(0,0,width(),height()); } @@ -129,7 +129,7 @@ KviIOGraphWidget::KviIOGraphWidget(QWidget * par) m_maxRate = 1; - int iMax = qMax(m_uLastSentBytes, m_uLastRecvBytes); + unsigned int iMax = qMax(m_uLastSentBytes, m_uLastRecvBytes); while(iMax > m_maxRate) m_maxRate*=2; @@ -147,7 +147,7 @@ KviIOGraphWidget::KviIOGraphWidget(QWidget * par) startTimer(1000); } -void KviIOGraphWidget::timerEvent(QTimerEvent *e) +void KviIOGraphWidget::timerEvent(QTimerEvent *) { kvi_u64_t sB = g_uOutgoingTraffic; kvi_u64_t rB = g_uIncomingTraffic; @@ -156,14 +156,14 @@ void KviIOGraphWidget::timerEvent(QTimerEvent *e) unsigned int rDiff = rB - m_uLastRecvBytes; printf("%d\n",sDiff); - int iMax = qMax(sDiff, rDiff); + unsigned int iMax = qMax(sDiff, rDiff); while(iMax > m_maxRate) m_maxRate*=2; m_uLastSentBytes = sB; m_uLastRecvBytes = rB; - + m_sendRates.prepend(sDiff); if(m_sendRates.count()>(KVI_IOGRAPH_NUMBER_POINTS+1)) m_sendRates.removeLast(); @@ -174,7 +174,7 @@ void KviIOGraphWidget::timerEvent(QTimerEvent *e) update(); } -void KviIOGraphWidget::paintEvent(QPaintEvent * e) +void KviIOGraphWidget::paintEvent(QPaintEvent *) { QPainter p(this); @@ -324,7 +324,7 @@ static bool iograph_module_init(KviModule *m) return true; } -static bool iograph_module_cleanup(KviModule *m) +static bool iograph_module_cleanup(KviModule *) { if(g_pIOGraphWindow) { @@ -334,7 +334,7 @@ static bool iograph_module_cleanup(KviModule *m) return true; } -static bool iograph_module_can_unload(KviModule *m) +static bool iograph_module_can_unload(KviModule *) { return (!g_pIOGraphWindow); } diff --git a/src/modules/language/libkvilanguage.cpp b/src/modules/language/libkvilanguage.cpp index ed56bcd35..44ebe940a 100644 --- a/src/modules/language/libkvilanguage.cpp +++ b/src/modules/language/libkvilanguage.cpp @@ -110,7 +110,7 @@ static bool language_module_init(KviModule * m) return true; } -static bool language_module_cleanup(KviModule *m) +static bool language_module_cleanup(KviModule *) { return true; } diff --git a/src/modules/links/libkvilinks.cpp b/src/modules/links/libkvilinks.cpp index 731cf4b02..8903c9ea6 100644 --- a/src/modules/links/libkvilinks.cpp +++ b/src/modules/links/libkvilinks.cpp @@ -86,7 +86,7 @@ static bool links_module_init(KviModule * m) return true; } -static bool links_module_cleanup(KviModule *m) +static bool links_module_cleanup(KviModule *) { while(g_pLinksWindowList->first())g_pLinksWindowList->first()->die(); delete g_pLinksWindowList; @@ -94,7 +94,7 @@ static bool links_module_cleanup(KviModule *m) return true; } -static bool links_module_can_unload(KviModule *m) +static bool links_module_can_unload(KviModule *) { return (g_pLinksWindowList->isEmpty()); } diff --git a/src/modules/links/linkswindow.cpp b/src/modules/links/linkswindow.cpp index 0babc26c6..fc8b1d796 100644 --- a/src/modules/links/linkswindow.cpp +++ b/src/modules/links/linkswindow.cpp @@ -105,7 +105,7 @@ KviLinksWindow::~KviLinksWindow() delete m_pHostPopup; } -void KviLinksWindow::getBaseLogFileName(KviStr &buffer) +void KviLinksWindow::getBaseLogFileName(QString &buffer) { buffer.sprintf("LINKS_%d",context()->id()); } @@ -141,7 +141,7 @@ QPixmap * KviLinksWindow::myIconPtr() return g_pIconManager->getSmallIcon(KVI_SMALLICON_LINKS); } -void KviLinksWindow::resizeEvent(QResizeEvent *e) +void KviLinksWindow::resizeEvent(QResizeEvent *) { int hght2 = m_pTopSplitter->sizeHint().height(); m_pTopSplitter->setGeometry(0,0,width(),hght2); @@ -472,35 +472,6 @@ void KviLinksWindow::processData(KviIrcMessage *msg) m_pLinkList->append(l); } -//#warning "Load & save properties of this kind of window" - -//void KviLinksWindow::saveProperties() -//{ -// KviWindowProperty p; -// p.rect = externalGeometry(); -// p.isDocked = isAttacched(); -// QValueList<int> l(m_pSplitter->sizes()); -// if(l.count() >= 1)p.splitWidth1 = *(l.at(0)); -// if(l.count() >= 2)p.splitWidth2 = *(l.at(1)); -// p.timestamp = m_pView->timestamp(); -// p.imagesVisible = m_pView->imagesVisible(); -// p.isMaximized = isAttacched() && isMaximized(); -// p.topSplitWidth1 = 0; -// p.topSplitWidth2 = 0; -// p.topSplitWidth3 = 0; -// g_pOptions->m_pWinPropertiesList->setProperty(caption(),&p); -//} -// -//void KviLinksWindow::setProperties(KviWindowProperty *p) -//{ -// QValueList<int> l; -// l.append(p->splitWidth1); -// l.append(p->splitWidth2); -// m_pVertSplitter->setSizes(l); -// m_pIrcView->setTimestamp(p->timestamp); -// m_pIrcView->setShowImages(p->imagesVisible); -//} - void KviLinksWindow::applyOptions() { m_pIrcView->applyOptions(); diff --git a/src/modules/links/linkswindow.h b/src/modules/links/linkswindow.h index b3b5efc06..2252f6b30 100644 --- a/src/modules/links/linkswindow.h +++ b/src/modules/links/linkswindow.h @@ -82,9 +82,7 @@ protected: virtual void fillCaptionBuffers(); virtual void applyOptions(); virtual void resizeEvent(QResizeEvent *e); - virtual void getBaseLogFileName(KviStr &buffer); -// virtual void setProperties(KviWindowProperty *p); -// virtual void saveProperties(); + virtual void getBaseLogFileName(QString &buffer); protected slots: void showHostPopup(QTreeWidgetItem *i,const QPoint &p); void hostPopupClicked(int id); diff --git a/src/modules/list/libkvilist.cpp b/src/modules/list/libkvilist.cpp index 8bdc7a83d..0f4b2529c 100644 --- a/src/modules/list/libkvilist.cpp +++ b/src/modules/list/libkvilist.cpp @@ -73,7 +73,7 @@ static bool list_module_init(KviModule * m) return true; } -static bool list_module_cleanup(KviModule *m) +static bool list_module_cleanup(KviModule *) { while(g_pListWindowList->first())g_pListWindowList->first()->die(); delete g_pListWindowList; @@ -81,7 +81,7 @@ static bool list_module_cleanup(KviModule *m) return true; } -static bool list_module_can_unload(KviModule *m) +static bool list_module_can_unload(KviModule *) { return (g_pListWindowList->isEmpty()); } diff --git a/src/modules/list/listwindow.cpp b/src/modules/list/listwindow.cpp index 986575cd4..e9cf76924 100644 --- a/src/modules/list/listwindow.cpp +++ b/src/modules/list/listwindow.cpp @@ -87,7 +87,7 @@ KviChannelTreeWidgetItem::~KviChannelTreeWidgetItem() delete m_pData; } -int KviChannelTreeWidgetItem::width ( const QFontMetrics & fm, const KviTalTreeWidget * lv, int column ) const +int KviChannelTreeWidgetItem::width ( const QFontMetrics & fm, const KviTalTreeWidget * , int column ) const { debug("width request"); QString szText; @@ -109,8 +109,6 @@ void KviChannelTreeWidgetItemDelegate::paint( QPainter * p, const QStyleOptionVi { KviChannelTreeWidgetItem *item=static_cast<KviChannelTreeWidgetItem *>(index.internalPointer()); - KviTalTreeWidget* lv = (KviTalTreeWidget *)parent(); - if (option.state & QStyle::State_Selected) p->fillRect(option.rect, option.palette.brush( QPalette::Highlight ) ); @@ -229,7 +227,7 @@ KviListWindow::~KviListWindow() delete m_pItemList; } -void KviListWindow::getBaseLogFileName(KviStr &buffer) +void KviListWindow::getBaseLogFileName(QString &buffer) { buffer.sprintf("LIST_%d",context()->id()); } @@ -281,7 +279,7 @@ QPixmap * KviListWindow::myIconPtr() return g_pIconManager->getSmallIcon(KVI_SMALLICON_LIST); } -void KviListWindow::resizeEvent(QResizeEvent *e) +void KviListWindow::resizeEvent(QResizeEvent *) { int hght = m_pTopSplitter->sizeHint().height(); m_pTopSplitter->setGeometry(0,0,width(),hght); diff --git a/src/modules/list/listwindow.h b/src/modules/list/listwindow.h index 1a32d2480..fb31b6f6f 100644 --- a/src/modules/list/listwindow.h +++ b/src/modules/list/listwindow.h @@ -48,7 +48,7 @@ public: : QItemDelegate(pWidget) {}; ~KviChannelTreeWidgetItemDelegate(){}; void paint( QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index ) const; - + }; class KviChannelTreeWidgetItemData { @@ -109,7 +109,7 @@ protected: virtual void fillCaptionBuffers(); virtual void applyOptions(); virtual void resizeEvent(QResizeEvent *e); - virtual void getBaseLogFileName(KviStr &buffer); + virtual void getBaseLogFileName(QString &buffer); protected slots: void flush(); void itemDoubleClicked(QTreeWidgetItem *it, int); diff --git a/src/modules/log/libkvilog.cpp b/src/modules/log/libkvilog.cpp index 5a28a08c6..3365f6af4 100644 --- a/src/modules/log/libkvilog.cpp +++ b/src/modules/log/libkvilog.cpp @@ -86,11 +86,11 @@ static bool log_kvs_cmd_start(KviKvsModuleCommandCall * c) { - QString szFile; - KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("filename",KVS_PT_STRING,KVS_PF_OPTIONAL,szFile) - KVSM_PARAMETERS_END(c) - + QString szFile; + KVSM_PARAMETERS_BEGIN(c) + KVSM_PARAMETER("filename",KVS_PT_STRING,KVS_PF_OPTIONAL,szFile) + KVSM_PARAMETERS_END(c) + KviWindow * pWnd = c->window(); if(c->hasSwitch('w',"window")) { @@ -112,12 +112,12 @@ static bool log_kvs_cmd_start(KviKvsModuleCommandCall * c) if(pWnd->view()) { - + if(szFile.isEmpty()) { pWnd->getDefaultLogFileName(szFile); } - if(!pWnd->view()->startLogging(szFile,c->hasSwitch('p',"log-buffer"))) + if(!pWnd->view()->startLogging(szFile,c->hasSwitch('p',"log-buffer"))) c->warning(__tr2qs("Can't log to file %Q"),&szFile); } else { c->warning(__tr2qs("This window has no logging capabilities")); @@ -260,13 +260,13 @@ static bool log_kvs_fnc_file(KviKvsModuleFunctionCall * c) KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("window id",KVS_PT_STRING,KVS_PF_OPTIONAL,szWindow) KVSM_PARAMETERS_END(c) - + KviWindow * wnd = c->window(); if(!szWindow.isEmpty()) { wnd = g_pApp->findWindow(szWindow); - if(!wnd) + if(!wnd) { c->warning(__tr2qs("Window with id '%Q' not found, returning empty string"),&szWindow); return true; @@ -283,12 +283,12 @@ static bool log_module_init(KviModule * m) KVSM_REGISTER_SIMPLE_COMMAND(m,"start",log_kvs_cmd_start); KVSM_REGISTER_SIMPLE_COMMAND(m,"stop",log_kvs_cmd_stop); KVSM_REGISTER_SIMPLE_COMMAND(m,"flush",log_kvs_cmd_flush); - + KVSM_REGISTER_FUNCTION(m,"file",log_kvs_fnc_file); return true; } -static bool log_module_cleanup(KviModule *m) +static bool log_module_cleanup(KviModule *) { return true; } diff --git a/src/modules/logview/libkvilogview.cpp b/src/modules/logview/libkvilogview.cpp index e80fab100..cbfed9f3e 100644 --- a/src/modules/logview/libkvilogview.cpp +++ b/src/modules/logview/libkvilogview.cpp @@ -99,7 +99,7 @@ static KviModuleExtension * logview_extension_alloc(KviModuleExtensionAllocStruc } } } - + g_pLogViewWindow = new KviLogViewMDIWindow(s->pDescriptor,g_pFrame); g_pFrame->addWindow(g_pLogViewWindow,!bCreateMinimized); if(bCreateMinimized)g_pLogViewWindow->minimize(); @@ -140,14 +140,14 @@ static bool logview_module_init(KviModule * m) return true; } -static bool logview_module_cleanup(KviModule * m) +static bool logview_module_cleanup(KviModule *) { if(g_pLogViewWindow)delete g_pLogViewWindow; g_pLogViewWindow = 0; return true; } -static bool logview_module_can_unload(KviModule *m) +static bool logview_module_can_unload(KviModule *) { return (!g_pLogViewWindow); } diff --git a/src/modules/logview/logviewmdiwindow.cpp b/src/modules/logview/logviewmdiwindow.cpp index b6590e172..b23e9c3e3 100644 --- a/src/modules/logview/logviewmdiwindow.cpp +++ b/src/modules/logview/logviewmdiwindow.cpp @@ -197,7 +197,7 @@ QPixmap * KviLogViewMDIWindow::myIconPtr() return g_pIconManager->getSmallIcon(KVI_SMALLICON_LOG); } -void KviLogViewMDIWindow::resizeEvent(QResizeEvent *e) +void KviLogViewMDIWindow::resizeEvent(QResizeEvent *) { m_pSplitter->setGeometry(0,0,width(),height()); } @@ -232,7 +232,7 @@ void KviLogViewMDIWindow::setupItemList() KviLogFile *pFile; //m_logList.begin(); KviLogListViewItem *pLastCategory=0; - KviLogListViewItemFolder *pLastGroupItem; + KviLogListViewItemFolder *pLastGroupItem=0; QString szLastGroup; QString szCurGroup; const bool bShowChannel=m_pShowChannelsCheck->isChecked(); @@ -338,7 +338,6 @@ void KviLogViewMDIWindow::cacheFileList() void KviLogViewMDIWindow::itemSelected(KviTalTreeWidgetItem * it,KviTalTreeWidgetItem *) { - bool bCompressed=0; //A parent node m_pIrcView->clearBuffer(); if(!it || !it->parent() || !(((KviLogListViewItem *)it)->m_pFileData) ) diff --git a/src/modules/logview/logviewwidget.h b/src/modules/logview/logviewwidget.h index 1f7b102a0..42b15b811 100644 --- a/src/modules/logview/logviewwidget.h +++ b/src/modules/logview/logviewwidget.h @@ -66,7 +66,7 @@ class KviLogListViewLog : public KviLogListViewItem public: KviLogListViewLog(KviTalTreeWidgetItem * par, KviLogFile::KviLogTypes type, KviLogFile * fileData); ~KviLogListViewLog() {}; - virtual QString key ( int column, bool ascending ) const { return text(column); }; + virtual QString key ( int column, bool) const { return text(column); }; virtual QString fileName() const { return m_pFileData->fileName(); }; }; diff --git a/src/modules/mask/libkvimask.cpp b/src/modules/mask/libkvimask.cpp index da0783727..2dfec6aff 100644 --- a/src/modules/mask/libkvimask.cpp +++ b/src/modules/mask/libkvimask.cpp @@ -181,7 +181,7 @@ static bool mask_module_init(KviModule * m) return true; } -static bool mask_module_cleanup(KviModule *m) +static bool mask_module_cleanup(KviModule *) { return true; } diff --git a/src/modules/math/libkvimath.cpp b/src/modules/math/libkvimath.cpp index 1a9469af9..8dcbd83b9 100644 --- a/src/modules/math/libkvimath.cpp +++ b/src/modules/math/libkvimath.cpp @@ -451,7 +451,7 @@ static bool math_module_init(KviModule * m) return true; } -static bool math_module_cleanup(KviModule *m) +static bool math_module_cleanup(KviModule *) { return true; } diff --git a/src/modules/mediaplayer/libkvimediaplayer.cpp b/src/modules/mediaplayer/libkvimediaplayer.cpp index b18283cf7..861932fcc 100644 --- a/src/modules/mediaplayer/libkvimediaplayer.cpp +++ b/src/modules/mediaplayer/libkvimediaplayer.cpp @@ -1706,18 +1706,18 @@ static bool mediaplayer_module_init( KviModule * m ) return true; } -static bool mediaplayer_module_cleanup( KviModule * m ) +static bool mediaplayer_module_cleanup( KviModule * ) { delete g_pDescriptorList; return true; } -static bool mediaplayer_module_can_unload( KviModule * m ) +static bool mediaplayer_module_can_unload( KviModule * ) { return true; } -static bool mediaplayer_module_ctrl(KviModule * m,const char * operation,void * param) +static bool mediaplayer_module_ctrl(KviModule *,const char * operation,void * param) { if(kvi_strEqualCI(operation,"getAvailableMediaPlayers")) { diff --git a/src/modules/mediaplayer/mp_interface.cpp b/src/modules/mediaplayer/mp_interface.cpp index effa1f50d..35147c41c 100644 --- a/src/modules/mediaplayer/mp_interface.cpp +++ b/src/modules/mediaplayer/mp_interface.cpp @@ -33,7 +33,7 @@ static QTextCodec * mediaplayer_get_codec() { QTextCodec * c= QTextCodec::codecForName(KVI_OPTION_STRING(KviOption_stringWinampTextEncoding).toUtf8().data()); - if(!c)c = QTextCodec::codecForLocale(); + if(!c)c = QTextCodec::codecForLocale(); return c; } @@ -91,7 +91,7 @@ QString KviMediaPlayerInterface::getLocalFile() return QString(); } -QString KviMediaPlayerInterface::amipEval(const QString &cmd) +QString KviMediaPlayerInterface::amipEval(const QString &) { return QString(); } @@ -147,19 +147,19 @@ QString KviMediaPlayerInterface::album() return pCodec->toUnicode(KviQCString(mp3.id3.album)); } -bool KviMediaPlayerInterface::playMrl(const QString &mrl) +bool KviMediaPlayerInterface::playMrl(const QString &) { notImplemented(); return false; } -bool KviMediaPlayerInterface::amipExec(const QString &cmd) +bool KviMediaPlayerInterface::amipExec(const QString &) { notImplemented(); return false; } -bool KviMediaPlayerInterface::setVol(kvs_int_t &iVol) +bool KviMediaPlayerInterface::setVol(kvs_int_t &) { notImplemented(); return false; @@ -177,7 +177,7 @@ bool KviMediaPlayerInterface::mute() return false; } -bool KviMediaPlayerInterface::jumpTo(int &iPos) +bool KviMediaPlayerInterface::jumpTo(int &) { notImplemented(); return false; @@ -213,7 +213,7 @@ int KviMediaPlayerInterface::getPlayListPos() return -1; } -bool KviMediaPlayerInterface::setPlayListPos(int &iPos) +bool KviMediaPlayerInterface::setPlayListPos(int &) { notImplemented(); return false; @@ -225,13 +225,13 @@ int KviMediaPlayerInterface::getListLength() return -1; } -int KviMediaPlayerInterface::getEqData(int &ival) +int KviMediaPlayerInterface::getEqData(int &) { notImplemented(); return -1; } -bool KviMediaPlayerInterface::setEqData(int &iPos, int &iVal) +bool KviMediaPlayerInterface::setEqData(int &, int &) { notImplemented(); return false; @@ -249,13 +249,13 @@ bool KviMediaPlayerInterface::getShuffle() return false; } -bool KviMediaPlayerInterface::setRepeat(bool &bVal) +bool KviMediaPlayerInterface::setRepeat(bool &) { notImplemented(); - return false; + return false; } -bool KviMediaPlayerInterface::setShuffle(bool &bVal) +bool KviMediaPlayerInterface::setShuffle(bool &) { notImplemented(); return false; diff --git a/src/modules/mediaplayer/mp_interface.h b/src/modules/mediaplayer/mp_interface.h index bf7ef2c4f..c2d6a2526 100644 --- a/src/modules/mediaplayer/mp_interface.h +++ b/src/modules/mediaplayer/mp_interface.h @@ -68,9 +68,9 @@ public: virtual bool stop() = 0; // pause playback now (do NOT toggle pause, just pause), return false only on communication failure virtual bool pause() = 0; - + // current media related - + // currently played media: it should include AT least the title // but may also include other informations. // this string MUST be non-empty when the player is playing something. @@ -83,7 +83,7 @@ public: // empty if player is not playing (or in the tragic case that the player // can't determine the url). virtual QString mrl() = 0; - + // optional interface // this should play the specified mrl @@ -157,7 +157,7 @@ public: virtual int getPlayListPos(); // set the position in the playlist virtual bool setPlayListPos(int &iPos); - // return the list's length + // return the list's length virtual int getListLength(); // return the Eq(number) value virtual int getEqData(int &i_val); diff --git a/src/modules/mediaplayer/mp_mp3.cpp b/src/modules/mediaplayer/mp_mp3.cpp index 1516e006f..21d5bab7f 100644 --- a/src/modules/mediaplayer/mp_mp3.cpp +++ b/src/modules/mediaplayer/mp_mp3.cpp @@ -30,7 +30,7 @@ // This file is based in part on: // // * MP3Info 0.5 by Ricardo Cerqueira <rmc@rccn.net> -// * MP3Stat 0.9 by Ed Sweetman <safemode@voicenet.com> and +// * MP3Stat 0.9 by Ed Sweetman <safemode@voicenet.com> and // Johannes Overmann <overmann@iname.com> // // There has been also a remarkable work by Cristopher Tieckle (Crissi) @@ -198,19 +198,14 @@ void resetmp3infoStruct(mp3info *i) int get_mp3_info(mp3info *mp3) { - int frame_type[15]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; - float seconds=0,total_rate=0; - int frames=0,frame_types=0,frames_so_far=0; - int l,vbr_median=-1; - int bitrate,lastrate; - int counter=0; + int l,bitrate,lastrate,counter=0; // mp3header header; int sample_pos,data_start=0; QFile fi(mp3->filename); mp3->datasize=fi.size();//filestat.st_size; - + get_id3(mp3); if(get_first_header(mp3,0L)) @@ -226,14 +221,14 @@ int get_mp3_info(mp3info *mp3) } else { bitrate=-1; } - + if(bitrate != lastrate) { mp3->vbr=1; } lastrate=bitrate; counter++; - + } mp3->frames=(mp3->datasize-data_start)/(l=frame_length(&mp3->header)); mp3->seconds = (int)((float)(frame_length(&mp3->header)*mp3->frames)/ @@ -244,12 +239,12 @@ int get_mp3_info(mp3info *mp3) return 0; } -int get_first_header(mp3info *mp3, long startpos) +int get_first_header(mp3info *mp3, long startpos) { int k, l=0,c; mp3header h, h2; long valid_start=0; - + fseek(mp3->file,startpos,SEEK_SET); while(1) { @@ -317,8 +312,8 @@ int get_header(FILE *file,mp3header *header) header->copyright=(buffer[3] >> 3) & 0x1; header->original=(buffer[3] >> 2) & 0x1; header->emphasis=(buffer[3]) & 0x3; - - return ((fl=frame_length(header)) >= MIN_FRAME_SIZE ? fl : 0); + + return ((fl=frame_length(header)) >= MIN_FRAME_SIZE ? fl : 0); } int frame_length(mp3header *header) @@ -397,7 +392,7 @@ int get_id3(mp3info *mp3) } else { fread(fbuf,1,3,mp3->file); fbuf[3] = '\0'; mp3->id3.genre[0]=255; - + if(!strcmp((const char *)"TAG",(const char *)fbuf)) { mp3->id3_isvalid=1; @@ -447,19 +442,19 @@ char *unpad(char *string) return string; } -bool scan_mp3_file(QString& szFileName,mp3info * i) +bool scan_mp3_file(QString& ,mp3info * i) { //memset(i,0,sizeof(mp3info)); resetmp3infoStruct(i); - + i->filename = "text"; i->file = fopen(QTextCodec::codecForLocale()->fromUnicode(i->filename).data(),"rb"); if(!i->file)return false; - + get_mp3_info(i); - + fclose(i->file); - + return (i->id3_isvalid); } diff --git a/src/modules/mediaplayer/mp_mprisinterface.cpp b/src/modules/mediaplayer/mp_mprisinterface.cpp index 817db5800..3ad8e0ced 100644 --- a/src/modules/mediaplayer/mp_mprisinterface.cpp +++ b/src/modules/mediaplayer/mp_mprisinterface.cpp @@ -70,7 +70,7 @@ KviMPRISInterface::~KviMPRISInterface() { } -int KviMPRISInterface::detect(bool bStart) +int KviMPRISInterface::detect(bool) { QDBusReply<QStringList> reply = QDBusConnection::sessionBus().interface()->registeredServiceNames(); if (!reply.isValid()) /* something fishy with dbus, it won't work */ diff --git a/src/modules/mediaplayer/mp_xmmsinterface.cpp b/src/modules/mediaplayer/mp_xmmsinterface.cpp index 67e925e9f..bf554a33b 100644 --- a/src/modules/mediaplayer/mp_xmmsinterface.cpp +++ b/src/modules/mediaplayer/mp_xmmsinterface.cpp @@ -149,7 +149,7 @@ void * KviXmmsInterface::lookupSymbol(const char * szSymbolName) } -int KviXmmsInterface::detect(bool bStart) +int KviXmmsInterface::detect(bool) { void * sym = lookupSymbol("xmms_remote_play"); return sym ? 80 : 0; @@ -191,7 +191,7 @@ bool KviXmmsInterface::quit() XMMS_SIMPLE_CALL("xmms_remote_quit") } -bool KviXmmsInterface::jumpTo(kvs_int_t &iPos) +bool KviXmmsInterface::jumpTo(int &iPos) { void (*sym)(int,int) = (void (*)(int,int))lookupSymbol("xmms_remote_jump_to_time"); if(!sym)return false; diff --git a/src/modules/mediaplayer/mp_xmmsinterface.h b/src/modules/mediaplayer/mp_xmmsinterface.h index 4e0ae0899..91a2c3f57 100644 --- a/src/modules/mediaplayer/mp_xmmsinterface.h +++ b/src/modules/mediaplayer/mp_xmmsinterface.h @@ -49,7 +49,7 @@ virtual bool stop(); virtual bool pause(); virtual bool quit(); - virtual bool jumpTo(kvs_int_t &iPos); + virtual bool jumpTo(int &iPos); virtual bool setVol(kvs_int_t &iVol); virtual int getVol(); virtual KviMediaPlayerInterface::PlayerStatus status(); diff --git a/src/modules/mircimport/libkvimircimport.cpp b/src/modules/mircimport/libkvimircimport.cpp index 435fc699d..16141dcfa 100644 --- a/src/modules/mircimport/libkvimircimport.cpp +++ b/src/modules/mircimport/libkvimircimport.cpp @@ -199,7 +199,7 @@ void KviRemoteMircServerImportWizard::closeEvent(QCloseEvent *) m_pFilter->die(); } -void KviRemoteMircServerImportWizard::done(int r) +void KviRemoteMircServerImportWizard::done(int) { m_pFilter->die(); } @@ -332,7 +332,7 @@ static bool mircimport_module_init(KviModule * m) return true; } -static bool mircimport_module_cleanup(KviModule *m) +static bool mircimport_module_cleanup(KviModule *) { if(g_pMircServersIniImport)delete g_pMircServersIniImport; if(g_pRemoteMircServersIniImport)delete g_pRemoteMircServersIniImport; @@ -342,7 +342,7 @@ static bool mircimport_module_cleanup(KviModule *m) return true; } -static bool mircimport_module_can_unload(KviModule * m) +static bool mircimport_module_can_unload(KviModule *) { return ((!g_pMircServersIniImport) && (!g_pRemoteMircServersIniImport)); } diff --git a/src/modules/my/libkvimy.cpp b/src/modules/my/libkvimy.cpp index 442cbb729..e8812e6cc 100644 --- a/src/modules/my/libkvimy.cpp +++ b/src/modules/my/libkvimy.cpp @@ -50,7 +50,7 @@ Idle* g_pIdle; { \ wnd = g_pApp->findConsole(uiWnd); \ if(!wnd)c->warning(__tr2qs("No such irc context (%d)"),uiWnd); \ - } + } /* @doc: my.nick @type: @@ -95,7 +95,7 @@ static bool my_kvs_fnc_nick(KviKvsModuleFunctionCall * c) Starts a global idle hook. Allows to detect a global user idle time */ -static bool my_kvs_cmd_startIdleTimer(KviKvsModuleCommandCall * c) +static bool my_kvs_cmd_startIdleTimer(KviKvsModuleCommandCall *) { if(!g_pIdle) g_pIdle = new Idle(); @@ -117,7 +117,7 @@ static bool my_kvs_cmd_startIdleTimer(KviKvsModuleCommandCall * c) Stops a global idle hook. Allows to detect a global user idle time */ -static bool my_kvs_cmd_stopIdleTimer(KviKvsModuleCommandCall * c) +static bool my_kvs_cmd_stopIdleTimer(KviKvsModuleCommandCall *) { if(!g_pIdle) return true; g_pIdle->stop(); @@ -141,7 +141,7 @@ static bool my_kvs_cmd_stopIdleTimer(KviKvsModuleCommandCall * c) static bool my_kvs_fnc_globalIdle(KviKvsModuleFunctionCall * c) { - if(g_pIdle) + if(g_pIdle) { c->returnValue()->setInteger(g_pIdle->secondsIdle()); } else { @@ -286,7 +286,7 @@ static bool my_kvs_fnc_ip(KviKvsModuleFunctionCall * c) static bool my_kvs_fnc_serverIsIPV6(KviKvsModuleFunctionCall * c) { - + GET_KVS_CONSOLE if(wnd) { @@ -316,7 +316,7 @@ static bool my_kvs_fnc_serverIsIPV6(KviKvsModuleFunctionCall * c) static bool my_kvs_fnc_serverIsSSL(KviKvsModuleFunctionCall * c) { - + GET_KVS_CONSOLE if(wnd) { @@ -398,13 +398,14 @@ static bool my_module_init(KviModule * m) KVSM_REGISTER_FUNCTION(m,"umode",my_kvs_fnc_umode); KVSM_REGISTER_FUNCTION(m,"serverIsSSL",my_kvs_fnc_serverIsSSL); KVSM_REGISTER_FUNCTION(m,"serverIsIPV6",my_kvs_fnc_serverIsIPV6); + KVSM_REGISTER_FUNCTION(m,"globalIdle",my_kvs_fnc_globalIdle); KVSM_REGISTER_SIMPLE_COMMAND(m,"stopIdleTimer",my_kvs_cmd_stopIdleTimer); KVSM_REGISTER_SIMPLE_COMMAND(m,"startIdleTimer",my_kvs_cmd_startIdleTimer); return true; } -static bool my_module_cleanup(KviModule *m) +static bool my_module_cleanup(KviModule *) { if(g_pIdle) delete g_pIdle; diff --git a/src/modules/notifier/libkvinotifier.cpp b/src/modules/notifier/libkvinotifier.cpp index 5a64a63d4..33b2e3cc6 100644 --- a/src/modules/notifier/libkvinotifier.cpp +++ b/src/modules/notifier/libkvinotifier.cpp @@ -54,7 +54,7 @@ kvi_time_t g_tNotifierDisabledUntil = 0; @description: Adds a message to the notifier window. The notifier window is shown (if not already visible) - unless the -q switch is present. + unless the -q switch is present. The new message becomes the current message of the notifier unless the user is already typing in the input window and the typed message would be directed to a different window. @@ -72,7 +72,7 @@ kvi_time_t g_tNotifierDisabledUntil = 0; @switches: !sw: -n | --noanim Do not animate - !sw: -w | --windowid + !sw: -w | --windowid Causes the message gets attacched to the specified window and the user is able to type commands in that window after showing up the notifier input. If the "=<window_id>" part @@ -90,7 +90,7 @@ kvi_time_t g_tNotifierDisabledUntil = 0; Obviously -n has no meaning if -q is used.[br] !sw: -t | --timeout Set the message lifetime to <timeout> - Obviously this option has no meaning if the window is not going to be shown. + Obviously this option has no meaning if the window is not going to be shown. The timeout may be overriddent by new messages but only in the future. If the timeout expires and is not overridden by any new message then the window will be automatically hidden. @@ -121,12 +121,12 @@ static bool notifier_kvs_cmd_message(KviKvsModuleCommandCall * c) if(!g_pNotifierWindow) g_pNotifierWindow = new KviNotifierWindow(); - + QString szIco=""; QString szWnd=""; - + KviWindow * pWnd = c->window(); - + if(c->hasSwitch('w',"window_id")) { c->switches()->getAsStringIfExisting('w',"window_id",szWnd); @@ -244,7 +244,7 @@ static bool notifier_kvs_cmd_show(KviKvsModuleCommandCall * c) There is also a global option that allows forcibly disabling the notifier forever, this option could be overridden with [cmd]option[/cmd] instead.. but again [b]DON'T do it[/b] :)[br] - + */ static bool notifier_kvs_fnc_isEnabled(KviKvsModuleFunctionCall * c) @@ -260,7 +260,7 @@ static bool notifier_kvs_fnc_isEnabled(KviKvsModuleFunctionCall * c) static bool notifier_module_init(KviModule * m) { - + KVSM_REGISTER_SIMPLE_COMMAND(m,"message",notifier_kvs_cmd_message); KVSM_REGISTER_SIMPLE_COMMAND(m,"show",notifier_kvs_cmd_show); KVSM_REGISTER_SIMPLE_COMMAND(m,"hide",notifier_kvs_cmd_hide); @@ -269,7 +269,7 @@ static bool notifier_module_init(KviModule * m) return true; } -static bool notifier_module_cleanup(KviModule *m) +static bool notifier_module_cleanup(KviModule *) { if(g_pNotifierWindow) { @@ -279,7 +279,7 @@ static bool notifier_module_cleanup(KviModule *m) return true; } -static bool notifier_module_can_unload(KviModule *m) +static bool notifier_module_can_unload(KviModule *) { return (!g_pNotifierWindow); } diff --git a/src/modules/notifier/notifierwindow.cpp b/src/modules/notifier/notifierwindow.cpp index 34765055d..f53058d61 100644 --- a/src/modules/notifier/notifierwindow.cpp +++ b/src/modules/notifier/notifierwindow.cpp @@ -345,6 +345,8 @@ void KviNotifierWindow::doShow(bool bDoAnimate) startAutoHideTimer(); } break; + default: + break; } } @@ -511,16 +513,18 @@ void KviNotifierWindow::doHide(bool bDoAnimate) #endif } break; + default: + break; } } -void KviNotifierWindow::showEvent(QShowEvent *e) +void KviNotifierWindow::showEvent(QShowEvent *) { computeRect(); setGeometry(m_wndRect); // w_win = w_wndRect } -void KviNotifierWindow::hideEvent(QHideEvent * e) +void KviNotifierWindow::hideEvent(QHideEvent *) { if (m_bCrashShowWorkAround) return; stopBlinkTimer(); @@ -625,7 +629,7 @@ static void blend_images(QImage &buffer,QImage &background,QImage &foreground,do } } -void KviNotifierWindow::paintEvent(QPaintEvent * e) +void KviNotifierWindow::paintEvent(QPaintEvent *) { redrawWindow(); @@ -1080,7 +1084,7 @@ bool KviNotifierWindow::checkResizing(QPoint e) return m_bResizing; } -void KviNotifierWindow::resize(QPoint p, bool up) +void KviNotifierWindow::resize(QPoint , bool) { //QPoint aux = mapToGlobal(p); @@ -1169,7 +1173,7 @@ inline void KviNotifierWindow::setCursor(int cur) if(QApplication::overrideCursor()) QApplication::restoreOverrideCursor(); } -void KviNotifierWindow::enterEvent(QEvent * e) +void KviNotifierWindow::enterEvent(QEvent *) { if(!m_pShowHideTimer) { m_pShowHideTimer = new QTimer(); @@ -1179,7 +1183,7 @@ void KviNotifierWindow::enterEvent(QEvent * e) m_pShowHideTimer->start(40); } -void KviNotifierWindow::leaveEvent(QEvent * e) +void KviNotifierWindow::leaveEvent(QEvent *) { // Leaving the widget area, restore default cursor m_pWndBorder->resetIcons(); diff --git a/src/modules/notifier/notifierwindowbody.cpp b/src/modules/notifier/notifierwindowbody.cpp index f14e7ccc7..9beaad336 100644 --- a/src/modules/notifier/notifierwindowbody.cpp +++ b/src/modules/notifier/notifierwindowbody.cpp @@ -72,7 +72,7 @@ void KviNotifierWindowBody::loadImages() m_pixIconPrev_clicked = *p; m_pixIconPrev = m_pixIconPrev_off; - + if((p = g_pIconManager->getPixmap("notifier_icon_body_next_off.png"))) m_pixIconNext_off = *p; if((p = g_pIconManager->getPixmap("notifier_icon_body_next_on.png"))) @@ -90,13 +90,13 @@ void KviNotifierWindowBody::loadImages() m_pixIconWrite_clicked = *p; m_pixIconWrite = m_pixIconWrite_off; - + needToRedraw(); - + m_prevIconState = WDG_ICON_OFF; m_nextIconState = WDG_ICON_OFF; m_writeIconState = WDG_ICON_OFF; - + } void KviNotifierWindowBody::setWidth(int w) @@ -121,18 +121,18 @@ void KviNotifierWindowBody::recalculatePositions() m_rctWriteIcon.setX(m_textRect.x()+m_textRect.width()); m_rctWriteIcon.setY(m_pnt.y()+m_textRect.height()-m_pixIconWrite.height()); m_rctWriteIcon.setWidth(m_pixIconWrite.width()); - m_rctWriteIcon.setHeight(m_pixIconWrite.height()); + m_rctWriteIcon.setHeight(m_pixIconWrite.height()); m_rctPrevIcon.setX(m_textRect.x()+m_textRect.width()); m_rctPrevIcon.setY(m_pnt.y()+2); //FIXME: Maybe the spacing should be calculated? m_rctPrevIcon.setWidth(m_pixIconPrev.width()); m_rctPrevIcon.setHeight(m_pixIconPrev.height()); - + m_rctNextIcon.setX(m_textRect.x()+m_textRect.width()); m_rctNextIcon.setY(m_pnt.y()+m_textRect.height()-m_pixIconNext.height()-m_pixIconWrite.height()); m_rctNextIcon.setWidth(m_pixIconNext.width()); m_rctNextIcon.setHeight(m_pixIconNext.height()); - + needToRedraw(); } @@ -145,7 +145,7 @@ void KviNotifierWindowBody::setPrevIcon(int state) case WDG_ICON_OFF: m_pixIconPrev = m_pixIconPrev_off; break; case WDG_ICON_CLICKED: m_pixIconPrev = m_pixIconPrev_clicked; break; }; - + m_prevIconState=state; needToRedraw(); } @@ -160,7 +160,7 @@ void KviNotifierWindowBody::setNextIcon(int state) case WDG_ICON_OFF: m_pixIconNext = m_pixIconNext_off; break; case WDG_ICON_CLICKED: m_pixIconNext = m_pixIconNext_clicked; break; }; - + needToRedraw(); m_nextIconState=state; } @@ -174,7 +174,7 @@ void KviNotifierWindowBody::setWriteIcon(int state) case WDG_ICON_ON: m_pixIconWrite = m_pixIconWrite_on; break; case WDG_ICON_OFF: m_pixIconWrite = m_pixIconWrite_off; break; case WDG_ICON_CLICKED: m_pixIconWrite = m_pixIconWrite_clicked; break;}; - + needToRedraw(); m_writeIconState=state; } @@ -183,23 +183,23 @@ void KviNotifierWindowBody::setWriteIcon(int state) void KviNotifierWindowBody::draw(QPainter * p) { if (m_bNeedToRedraw) { - + p->fillRect(QRect(m_pnt,m_rct.size()),m_mac_bkgColor); - + // Autotiled borders p->drawTiledPixmap(m_pnt.x(), m_pnt.y(), m_pixSX.width(), m_rct.height() - m_pixDWNSX.height() - m_pixKVIrcSX.height(), m_pixSX); p->drawTiledPixmap(m_pnt.x() + m_rct.width() - m_pixDX.width(), m_pnt.y(),m_pixDX.width(), m_rct.height() - m_pixDWNDX.height(), m_pixDX); p->drawTiledPixmap(m_pnt.x() + m_pixKVIrcDWN.width() + m_pixDWNSX.width(), m_pnt.y() + m_rct.height() - m_pixDWN.height(), m_rct.width() - m_pixKVIrcDWN.width() - m_pixDWNSX.width() - m_pixDWNDX.width(), m_pixDWN.height(), m_pixDWN); - + // Bottom corners p->drawPixmap(m_pnt.x(), m_pnt.y() + m_rct.height() - m_pixDWNSX.height(), m_pixDWNSX); p->drawPixmap(m_pnt.x() + m_rct.width() - m_pixDWNSX.width(), m_pnt.y() + m_rct.height() - m_pixDWNDX.height(), m_pixDWNDX); - + // KVIrc image p->drawPixmap(m_pnt.x(), m_pnt.y() + m_rct.height() - m_pixKVIrcSX.height() - m_pixDWNSX.height(), m_pixKVIrcSX); p->drawPixmap(m_pnt.x() + m_pixKVIrcSX.width(), m_pnt.y() + m_rct.height() - m_pixKVIrcDWN.height(), m_pixKVIrcDWN); p->drawPixmap(m_pnt.x() + m_pixKVIrcSX.width(), m_pnt.y() + m_rct.height() - m_pixKVIrc.height() - m_pixKVIrcDWN.height(), m_pixKVIrc, 0, 0, m_pixKVIrc.width(), m_pixKVIrc.height()); - + // Draw Icons p->drawPixmap(m_rctPrevIcon.x(), m_rctPrevIcon.y(), m_pixIconPrev); p->drawPixmap(m_rctNextIcon.x(), m_rctNextIcon.y(), m_pixIconNext); @@ -209,17 +209,17 @@ void KviNotifierWindowBody::draw(QPainter * p) } } -void KviNotifierWindowBody::mouseMoveEvent(QMouseEvent * e) +void KviNotifierWindowBody::mouseMoveEvent(QMouseEvent *) { } -void KviNotifierWindowBody::mousePressEvent(QMouseEvent * e) +void KviNotifierWindowBody::mousePressEvent(QMouseEvent *) { } -void KviNotifierWindowBody::mouseReleaseEvent(QMouseEvent * e) +void KviNotifierWindowBody::mouseReleaseEvent(QMouseEvent *) { } diff --git a/src/modules/notifier/notifierwindowtabs.cpp b/src/modules/notifier/notifierwindowtabs.cpp index 1069f565c..2d8a749e5 100644 --- a/src/modules/notifier/notifierwindowtabs.cpp +++ b/src/modules/notifier/notifierwindowtabs.cpp @@ -546,9 +546,6 @@ void KviNotifierWindowTabs::draw(QPainter * p) int closeIcon_X = m_rct.width() - m_rctCloseTabIcon.width(); int nextIcon_X = closeIcon_X - m_pixIconTabNext_out.width(); - int prevIcon_X = m_rct.x(); - - int tmpTabsWidth = 0; m_pPainter->drawPixmap(0,0,m_pixSX); m_pPainter->drawPixmap(m_rct.width()-m_pixDX.width(),0,m_pixDX); diff --git a/src/modules/objects/class_button.cpp b/src/modules/objects/class_button.cpp index 68326c1bd..7ea183ad4 100644 --- a/src/modules/objects/class_button.cpp +++ b/src/modules/objects/class_button.cpp @@ -47,7 +47,7 @@ [class]object[/class] [class]button[/class] @description: - This widget provides a push button + This widget provides a push button @functions: !fn: $setText([<text:string>]) Set the button text.[br] @@ -83,7 +83,7 @@ KVSO_BEGIN_DESTRUCTOR(KviKvsObject_button) KVSO_END_DESTRUCTOR(KviKvsObject_button) -bool KviKvsObject_button::init(KviKvsRunTimeContext * pContext,KviKvsVariantList *pParams) +bool KviKvsObject_button::init(KviKvsRunTimeContext *,KviKvsVariantList *) { SET_OBJECT(QPushButton); connect(widget(),SIGNAL(clicked()),this,SLOT(slotClicked())); @@ -118,7 +118,7 @@ KVSO_CLASS_FUNCTION(button,setImage) if(icon.isHObject()) { kvs_hobject_t hObj; - icon.asHObject(hObj); + icon.asHObject(hObj); KviKvsObject *pObject=KviKvsKernel::instance()->objectController()->lookupObject(hObj); if (!pObject) { @@ -127,7 +127,7 @@ KVSO_CLASS_FUNCTION(button,setImage) } if(pObject->inheritsClass("pixmap")) ((QPushButton *)widget())->setIcon(QIcon(*((KviKvsObject_pixmap *)pObject)->getPixmap())); - else{ + else{ c->warning(__tr2qs_ctx("Object Pixmap required!","object")); } return true; diff --git a/src/modules/objects/class_checkbox.cpp b/src/modules/objects/class_checkbox.cpp index 66fbba5ff..0cd0fa9e0 100644 --- a/src/modules/objects/class_checkbox.cpp +++ b/src/modules/objects/class_checkbox.cpp @@ -77,7 +77,7 @@ KVSO_BEGIN_DESTRUCTOR(KviKvsObject_checkbox) KVSO_END_CONSTRUCTOR(KviKvsObject_checkbox) -bool KviKvsObject_checkbox::init(KviKvsRunTimeContext * pContext,KviKvsVariantList *pParams) +bool KviKvsObject_checkbox::init(KviKvsRunTimeContext *,KviKvsVariantList *) { QCheckBox * cb = new QCheckBox(parentScriptWidget()); cb->setObjectName(getName().toUtf8().data()); diff --git a/src/modules/objects/class_combobox.cpp b/src/modules/objects/class_combobox.cpp index 2dddebe7b..80305a347 100644 --- a/src/modules/objects/class_combobox.cpp +++ b/src/modules/objects/class_combobox.cpp @@ -133,7 +133,7 @@ KVSO_BEGIN_DESTRUCTOR(KviKvsObject_combobox) KVSO_END_CONSTRUCTOR(KviKvsObject_combobox) -bool KviKvsObject_combobox::init(KviKvsRunTimeContext * pContext,KviKvsVariantList *pParams) +bool KviKvsObject_combobox::init(KviKvsRunTimeContext *,KviKvsVariantList *) { SET_OBJECT(QComboBox); connect (((QComboBox *)widget()),SIGNAL(activated( int )),this,SLOT(slotActivated( int ))); diff --git a/src/modules/objects/class_dialog.cpp b/src/modules/objects/class_dialog.cpp index 590186227..b52cb80eb 100644 --- a/src/modules/objects/class_dialog.cpp +++ b/src/modules/objects/class_dialog.cpp @@ -66,7 +66,7 @@ KVSO_BEGIN_DESTRUCTOR(KviKvsObject_dialog) KVSO_END_CONSTRUCTOR(KviKvsObject_dialog) -bool KviKvsObject_dialog::init(KviKvsRunTimeContext * pContext,KviKvsVariantList *pParams) +bool KviKvsObject_dialog::init(KviKvsRunTimeContext *,KviKvsVariantList *) { QWidget * w = g_pApp->activeModalWidget(); if(!w)w = g_pFrame; diff --git a/src/modules/objects/class_dockwindow.cpp b/src/modules/objects/class_dockwindow.cpp index 40d83927a..e40fc1c28 100644 --- a/src/modules/objects/class_dockwindow.cpp +++ b/src/modules/objects/class_dockwindow.cpp @@ -81,7 +81,7 @@ KVSO_END_DESTRUCTOR(KviKvsObject_dockwindow) #define _pDockWindow ((QT_DOCK_WINDOW *)widget()) -bool KviKvsObject_dockwindow::init(KviKvsRunTimeContext * pContext,KviKvsVariantList * pParams) +bool KviKvsObject_dockwindow::init(KviKvsRunTimeContext *,KviKvsVariantList *) { QDockWidget * pWidget = new QDockWidget(g_pFrame); pWidget->setObjectName(getName()); diff --git a/src/modules/objects/class_file.cpp b/src/modules/objects/class_file.cpp index eee0b6f27..7ecf96d90 100644 --- a/src/modules/objects/class_file.cpp +++ b/src/modules/objects/class_file.cpp @@ -159,17 +159,17 @@ KVSO_BEGIN_REGISTERCLASS(KviKvsObject_file,"file","object") KVSO_REGISTER_HANDLER(KviKvsObject_file,"isOpen",isOpen) KVSO_REGISTER_HANDLER(KviKvsObject_file,"close",close) KVSO_REGISTER_HANDLER(KviKvsObject_file,"flush",flush) - + KVSO_REGISTER_HANDLER(KviKvsObject_file,"size",size) KVSO_REGISTER_HANDLER(KviKvsObject_file,"atEnd",atEnd) KVSO_REGISTER_HANDLER(KviKvsObject_file,"where",where) KVSO_REGISTER_HANDLER(KviKvsObject_file,"seek",seek) - + KVSO_REGISTER_HANDLER(KviKvsObject_file,"putch",putch) KVSO_REGISTER_HANDLER(KviKvsObject_file,"getch",getch) KVSO_REGISTER_HANDLER(KviKvsObject_file,"ungetch",unGetch) - + KVSO_REGISTER_HANDLER(KviKvsObject_file,"readBlock",readBlock) KVSO_REGISTER_HANDLER(KviKvsObject_file,"writeBlock", writeBlock) @@ -182,7 +182,7 @@ KVSO_BEGIN_REGISTERCLASS(KviKvsObject_file,"file","object") KVSO_REGISTER_HANDLER(KviKvsObject_file,"write",write) KVSO_REGISTER_HANDLER(KviKvsObject_file,"read",read) - + KVSO_END_REGISTERCLASS(KviKvsObject_file) @@ -222,7 +222,7 @@ KVSO_CLASS_FUNCTION(file,open) KVSO_PARAMETERS_BEGIN(c) KVSO_PARAMETER("file_mode",KVS_PT_STRINGLIST,KVS_PF_OPTIONAL,modes) KVSO_PARAMETERS_END(c) - + if(m_pFile->fileName().isEmpty()) { c->warning(__tr2qs_ctx("Empty filename string","objects")); @@ -451,7 +451,7 @@ KVSO_CLASS_FUNCTION(file,write) KVSO_PARAMETERS_BEGIN(c) KVSO_PARAMETER("variant_data",KVS_PT_VARIANT,0,pVariantData) KVSO_PARAMETERS_END(c) - if (pVariantData->isInteger()) + if (pVariantData->isInteger()) { kvs_int_t num; pVariantData->asInteger(num); @@ -508,7 +508,7 @@ KVSO_CLASS_FUNCTION(file,writeBlock) c->warning(__tr2qs_ctx("Buffer parameter is not a memorybuffer object","objects")); return true; } - + } else { @@ -597,14 +597,14 @@ KVSO_CLASS_FUNCTION(file,writeHexBlock) c->warning(__tr2qs_ctx("Lenght of hex string is not multiple of 2","objects")); return true; } - if (uLen>(szBlock.length()/2)|| !uLen) uLen=szBlock.length(); + if (uLen>((uint)szBlock.length()/2)|| !uLen) uLen=szBlock.length(); else uLen*=2; unsigned char byte,lsb,msb; - for(int i=0;i<uLen;i+=2) + for(unsigned int i=0;i<uLen;i+=2) { msb=szBlock.at(i).toAscii(); lsb=szBlock.at(i+1).toAscii(); - + if (((msb>='A' && msb<='F')||(msb>='0' && msb<='9')) && ((lsb>='A' && lsb<='F')|| (lsb>='0' && lsb<='9'))) { msb>='A'?msb-='7':msb-='0'; diff --git a/src/modules/objects/class_ftp.cpp b/src/modules/objects/class_ftp.cpp index c7adb10cf..76d6b6fc9 100644 --- a/src/modules/objects/class_ftp.cpp +++ b/src/modules/objects/class_ftp.cpp @@ -51,14 +51,14 @@ You can use one of the $read* functions to obtain the data. !fn: $connect(<host:string>,<remote_port:integer>) - Connects to the FTP server host using port port.The command is scheduled, and its execution is performed asynchronously. + Connects to the FTP server host using port port.The command is scheduled, and its execution is performed asynchronously. The function returns a unique identifier which is passed by commandStarted() and commandFinished().[br] !fn: $abort() !fn: $login !fn: $get !fn: $cd !fn: $list - !fn: + !fn: */ KVSO_BEGIN_REGISTERCLASS(KviKvsObject_ftp,"ftp","object") @@ -166,7 +166,7 @@ KVSO_CLASS_FUNCTION(ftp,abort) m_pFtp->abort(); return true; } -//signals & slots +//signals & slots KVSO_CLASS_FUNCTION(ftp,commandFinishedEvent) { emitSignal("commandFinished",c,c->params()); @@ -175,21 +175,21 @@ KVSO_CLASS_FUNCTION(ftp,commandFinishedEvent) void KviKvsObject_ftp::slotCommandFinished ( int id, bool error ) { - QString status=""; + QString status=""; if (m_pFtp->currentCommand()==QFtp::Get){ - status="Finished to load"; + status="Finished to load"; m_pFile->close(); delete m_pFile; } - else if (m_pFtp->currentCommand()==QFtp:: ConnectToHost) status="connected"; - else if (m_pFtp->currentCommand()==QFtp:: Login) status="logged"; - else if (m_pFtp->currentCommand()==QFtp:: Cd) status="entered"; - else if (m_pFtp->currentCommand()==QFtp:: List) status="listCompleted"; + else if (m_pFtp->currentCommand()==QFtp:: ConnectToHost) status="connected"; + else if (m_pFtp->currentCommand()==QFtp:: Login) status="logged"; + else if (m_pFtp->currentCommand()==QFtp:: Cd) status="entered"; + else if (m_pFtp->currentCommand()==QFtp:: List) status="listCompleted"; callFunction(this,"commandFinishedEvent",0,new KviKvsVariantList(new KviKvsVariant((kvs_int_t) id), new KviKvsVariant(status),new KviKvsVariant(error))); } -void KviKvsObject_ftp::slotCommandStarted ( int id ) +void KviKvsObject_ftp::slotCommandStarted ( int ) { } @@ -204,21 +204,21 @@ KVSO_CLASS_FUNCTION(ftp,dataTransferProgressEvent) emitSignal("dataTransferProgress",c,c->params()); return true; } -void KviKvsObject_ftp::slotDone ( bool error ) +void KviKvsObject_ftp::slotDone ( bool ) { } void KviKvsObject_ftp::slotListInfo ( const QUrlInfo & i ) { callFunction(this,"listInfoEvent",0,new KviKvsVariantList(new KviKvsVariant(i.name()))); - + } KVSO_CLASS_FUNCTION(ftp,listInfoEvent) { emitSignal("listInfo",c,c->params()); return true; } -void KviKvsObject_ftp::slotRawCommandReply ( int replyCode, const QString & detail ) +void KviKvsObject_ftp::slotRawCommandReply ( int, const QString &) { } diff --git a/src/modules/objects/class_groupbox.cpp b/src/modules/objects/class_groupbox.cpp index 7c5105e37..359c67c59 100644 --- a/src/modules/objects/class_groupbox.cpp +++ b/src/modules/objects/class_groupbox.cpp @@ -179,10 +179,10 @@ KVSO_BEGIN_DESTRUCTOR(KviKvsObject_groupbox) KVSO_END_CONSTRUCTOR(KviKvsObject_groupbox) -bool KviKvsObject_groupbox::init(KviKvsRunTimeContext * pContext,KviKvsVariantList *pParams) +bool KviKvsObject_groupbox::init(KviKvsRunTimeContext *,KviKvsVariantList *) { KviTalGroupBox *groupbox=new KviTalGroupBox(getName(),parentScriptWidget()); - + groupbox->setOrientation(Qt::Horizontal); groupbox->setObjectName(getName()); setObject(groupbox,true); diff --git a/src/modules/objects/class_hbox.cpp b/src/modules/objects/class_hbox.cpp index bba750723..db16a2bfb 100644 --- a/src/modules/objects/class_hbox.cpp +++ b/src/modules/objects/class_hbox.cpp @@ -29,7 +29,7 @@ #include "kvi_tal_hbox.h" const char * const align_tbl[] = { - "Left", + "Left", "Right", "HCenter", "VCenter", @@ -78,8 +78,8 @@ const int align_cod[] = { !fn: $addStretch(<stretch:integer>) Adds a stretchable space with zero minimum size and stretch factor stretch to the end of this box layout. !fn: $setAlignment(<flag1:string>, <flag2:string>, ...) - Sets the alignment for widget w to flags, given as parameters. - Valid flags are:Right,Left,Top,Bottom,HCenter,VCenter,Center + Sets the alignment for widget w to flags, given as parameters. + Valid flags are:Right,Left,Top,Bottom,HCenter,VCenter,Center */ @@ -100,9 +100,9 @@ KVSO_BEGIN_DESTRUCTOR(KviKvsObject_hbox) KVSO_END_CONSTRUCTOR(KviKvsObject_hbox) -bool KviKvsObject_hbox::init(KviKvsRunTimeContext * pContext,KviKvsVariantList *pParams) +bool KviKvsObject_hbox::init(KviKvsRunTimeContext *,KviKvsVariantList *) { - + setObject(new KviTalHBox(parentScriptWidget()), true); return true; } @@ -179,7 +179,7 @@ KVSO_CLASS_FUNCTION(hbox,setAlignment) int align,sum=0; for ( QStringList::Iterator it = alignment.begin(); it != alignment.end(); ++it ) { - + align = 0; for(unsigned int j = 0; j < align_num; j++) { @@ -193,7 +193,7 @@ KVSO_CLASS_FUNCTION(hbox,setAlignment) sum = sum | align; else c->warning(__tr2qs("Unknown alignment: '%Q'"),&(*it)); - + } if (widget()) ((KviTalHBox *)widget())->setAlignment(((QWidget *)(pObject->object())),(Qt::Alignment)sum); return true; diff --git a/src/modules/objects/class_http.cpp b/src/modules/objects/class_http.cpp index 299f8baea..88c16e7dd 100644 --- a/src/modules/objects/class_http.cpp +++ b/src/modules/objects/class_http.cpp @@ -33,7 +33,7 @@ #include <QSslError> const char * const ssl_errors_tbl[] = { - "NoError", + "NoError", "UnableToGetIssuerCertificate", "UnableToDecryptCertificateSignature", "UnableToDecodeIssuerPublicKey", @@ -43,19 +43,19 @@ const char * const ssl_errors_tbl[] = { "InvalidNotBeforeField", "InvalidNotAfterField", "SelfSignedCertificate", - "SelfSignedCertificateInChain", - "UnableToGetLocalIssuerCertificate", + "SelfSignedCertificateInChain", + "UnableToGetLocalIssuerCertificate", "UnableToVerifyFirstCertificate", "CertificateRevoked", - "InvalidCaCertificate", + "InvalidCaCertificate", "PathLengthExceeded", - "InvalidPurpose", - "CertificateUntrusted", - "CertificateRejected", - "SubjectIssuerMismatch", + "InvalidPurpose", + "CertificateUntrusted", + "CertificateRejected", + "SubjectIssuerMismatch", "AuthorityIssuerSerialNumberMismatch", - "NoPeerCertificate", - "HostNameMismatch", + "NoPeerCertificate", + "HostNameMismatch", "UnspecifiedError", "NoSslSupport" }; @@ -106,7 +106,7 @@ const char * const ssl_errors_tbl[] = { !sg: $sslErrors( !sg: $stateChanged( !sg: $responseHeaderReceived( - + */ @@ -121,7 +121,7 @@ KVSO_BEGIN_REGISTERCLASS(KviKvsObject_http,"http","object") KVSO_REGISTER_HANDLER(KviKvsObject_http,"readAll",functionReadAll) KVSO_REGISTER_HANDLER(KviKvsObject_http,"errorString",functionErrorString) KVSO_REGISTER_HANDLER(KviKvsObject_http,"setFollowRedirect",functionFollowRedirect) - + // events KVSO_REGISTER_HANDLER(KviKvsObject_http,"doneEvent",functionDoneEvent) KVSO_REGISTER_HANDLER(KviKvsObject_http,"requestFinishedEvent",functionRequestFinishedEvent) @@ -144,7 +144,7 @@ KVSO_BEGIN_CONSTRUCTOR(KviKvsObject_http,KviKvsObject) m_bEnableForceRedirect=false; connect(m_pHttp,SIGNAL(requestFinished(int,bool)),this,SLOT(slotRequestFinished(int,bool))); connect(m_pHttp,SIGNAL(done(bool)),this,SLOT(slotDone(bool))); - + connect(m_pHttp,SIGNAL(requestStarted(int)),this,SLOT(slotRequestStarted(int))); connect(m_pHttp,SIGNAL(dataSendProgress(int,int)),this,SLOT(slotDataSendProgress(int,int))); connect(m_pHttp,SIGNAL(dataReadProgress(int,int)),this,SLOT(slotDataReadProgress(int,int))); @@ -258,7 +258,7 @@ bool KviKvsObject_http::functionGet(KviKvsObjectFunctionCall *c) } bool KviKvsObject_http::functionPost(KviKvsObjectFunctionCall *c) { - CHECK_INTERNAL_POINTER(m_pHttp) + CHECK_INTERNAL_POINTER(m_pHttp) QString szPath,szDest,szData; KVSO_PARAMETERS_BEGIN(c) KVSO_PARAMETER("remote_path",KVS_PT_STRING,0,szPath) @@ -280,20 +280,20 @@ bool KviKvsObject_http::functionPost(KviKvsObjectFunctionCall *c) } bool KviKvsObject_http::functionAbort(KviKvsObjectFunctionCall *c) { - CHECK_INTERNAL_POINTER(m_pHttp) + CHECK_INTERNAL_POINTER(m_pHttp) m_bAbort=true; m_pHttp->abort(); return true; } bool KviKvsObject_http::functionReadAll(KviKvsObjectFunctionCall *c) { - CHECK_INTERNAL_POINTER(m_pHttp) + CHECK_INTERNAL_POINTER(m_pHttp) c->returnValue()->setString(m_pHttp->readAll()); return true; } bool KviKvsObject_http::functionErrorString(KviKvsObjectFunctionCall *c) { - CHECK_INTERNAL_POINTER(m_pHttp) + CHECK_INTERNAL_POINTER(m_pHttp) c->returnValue()->setString(m_pHttp->errorString()); return true; } @@ -306,7 +306,7 @@ bool KviKvsObject_http::functionFollowRedirect(KviKvsObjectFunctionCall *c) m_bEnableForceRedirect=bEnabled; return true; } -//signals & slots +//signals & slots bool KviKvsObject_http::functionRequestFinishedEvent(KviKvsObjectFunctionCall *c) { @@ -316,12 +316,12 @@ bool KviKvsObject_http::functionRequestFinishedEvent(KviKvsObjectFunctionCall *c void KviKvsObject_http::slotRequestFinished ( int id, bool error ) { - - if (m_bAbort) + + if (m_bAbort) { m_bAbort=false; QHashIterator<int,QFile *> t(getDict); - while (t.hasNext()) + while (t.hasNext()) { t.next(); int key=t.key(); @@ -339,7 +339,7 @@ void KviKvsObject_http::slotRequestFinished ( int id, bool error ) pFile->close(); getDict.remove(id); int res=m_pHttp->lastResponse().statusCode(); - if ((m_pHttp->lastResponse().statusCode()==301 || m_pHttp->lastResponse().statusCode()==302 || m_pHttp->lastResponse().statusCode()==307) && m_bEnableForceRedirect) + if ((res==301 || res==302 || res==307) && m_bEnableForceRedirect) redirect(name,m_pHttp->lastResponse()); delete pFile; } @@ -420,10 +420,10 @@ void KviKvsObject_http::slotResponseHeaderReceived(const QHttpResponseHeader &r) default: szResponse=r.reasonPhrase(); m_bAbort=true; } - + callFunction(this,"responseHeaderReceivedEvent",0,new KviKvsVariantList( new KviKvsVariant(szResponse))); - + } void KviKvsObject_http::slotReadyRead(const QHttpResponseHeader &r) { @@ -466,7 +466,7 @@ bool KviKvsObject_http::functionStateChangedEvent(KviKvsObjectFunctionCall *c) #ifndef QT_NO_OPENSSL -bool KviKvsObject_http::functionIgnoreSslErrors(KviKvsObjectFunctionCall *c) +bool KviKvsObject_http::functionIgnoreSslErrors(KviKvsObjectFunctionCall *) { if (m_pHttp) m_pHttp->ignoreSslErrors(); return true; diff --git a/src/modules/objects/class_label.cpp b/src/modules/objects/class_label.cpp index 555631fd4..8cbc97a0d 100644 --- a/src/modules/objects/class_label.cpp +++ b/src/modules/objects/class_label.cpp @@ -60,7 +60,7 @@ const int align_cod[] = { }; #define align_num (sizeof(align_tbl) / sizeof(align_tbl[0])) - + // used in $frameStyle & $setFrameStyle const char * const frame_tbl[] = { "NoFrame", @@ -110,7 +110,7 @@ const int frame_cod[] = { The text can contain limited html tags. See also [classfnc]$text[/classfnc](). !fn: <string> $text() - Returns the text currently displayed by the label. + Returns the text currently displayed by the label. See also [classfnc]$setText[/classfnc](). !fn: <integer> $margin() Returns current value of margin for this label (default is 0). @@ -119,14 +119,14 @@ const int frame_cod[] = { Sets margin width / height to <margin>. See also [classfnc]$margin[/classfnc](). !fn: <string> $alignment() - Returns a string containing alignment flags that are set for + Returns a string containing alignment flags that are set for this label. The flags are separated by commas. An example output could look like this:[br] [pre]Bottom, Right[/pre][br] See [classfnc]$setAlignment[/classfnc]() for explanation of all alignment flags. !fn: $setAlignment(<flag1:string>, <flag2:string>, ...) - This function sets alignment flags, given as parameters, for + This function sets alignment flags, given as parameters, for this label. Valid flags are: [pre] Right - Text is aligned to right border[br] @@ -138,11 +138,11 @@ const int frame_cod[] = { Center - Equals HCenter + VCenter[br] WordBreak - Enables automatic word breaking[br] [/pre] - It is obvious that you can not set for example [i]Right[/i] - and [i]Left[/i] simoultaneously - this will [b]NOT[/b] + It is obvious that you can not set for example [i]Right[/i] + and [i]Left[/i] simoultaneously - this will [b]NOT[/b] result in an error message - this will simply not work :) !fn: $clear() - Clears the label. Equal to calling + Clears the label. Equal to calling [classfnc]$setText[/classfnc]("") !fn: $frameStyle() Returns a string containing this label's frame-style flags, @@ -158,13 +158,13 @@ const int frame_cod[] = { [pre] NoFrame - draw no frame. You shouldn't specify a shadow when using this.[br] - Box - draws a rectangular box. Its borders can be + Box - draws a rectangular box. Its borders can be [i]Raised[/i] or [i]Sunken[/i][br] - Panel - draws a rectangular panel which can be + Panel - draws a rectangular panel which can be [i]Raised[/i] or [i]Sunken[/i][br] WinPanel - similar to [i]Panel[/i], but is more in Win95 style[br] - Hline - draws a horizontal line that frames nothing (useful as separator) + Hline - draws a horizontal line that frames nothing (useful as separator) [/pre] Valid shadow flags are:[br] [pre] @@ -175,7 +175,7 @@ const int frame_cod[] = { the parent widget[br] [/pre] !fn: $setImage(<image_id>) - Sets the image to be displayed on this label. + Sets the image to be displayed on this label. Giving empty argument clears the pixmap[br] See the [doc:image_id]image identifier[/doc] documentation for the explaination of the <image_id> parameter. @@ -205,7 +205,7 @@ KVSO_BEGIN_DESTRUCTOR(KviKvsObject_label) KVSO_END_CONSTRUCTOR(KviKvsObject_label) -bool KviKvsObject_label::init(KviKvsRunTimeContext * pContext,KviKvsVariantList *pParams) +bool KviKvsObject_label::init(KviKvsRunTimeContext *,KviKvsVariantList *) { SET_OBJECT(QLabel) return true; @@ -213,7 +213,7 @@ bool KviKvsObject_label::init(KviKvsRunTimeContext * pContext,KviKvsVariantList KVSO_CLASS_FUNCTION(label,setText) { - CHECK_INTERNAL_POINTER(widget()) + CHECK_INTERNAL_POINTER(widget()) QString szText; KVSO_PARAMETERS_BEGIN(c) KVSO_PARAMETER("text",KVS_PT_STRING,0,szText) @@ -224,14 +224,14 @@ KVSO_CLASS_FUNCTION(label,setText) KVSO_CLASS_FUNCTION(label,text) { - CHECK_INTERNAL_POINTER(widget()) + CHECK_INTERNAL_POINTER(widget()) c->returnValue()->setString(((QLabel *)widget())->text()); return true; } KVSO_CLASS_FUNCTION(label,setMargin) { - CHECK_INTERNAL_POINTER(widget()) + CHECK_INTERNAL_POINTER(widget()) kvs_uint_t iMargin; KVSO_PARAMETERS_BEGIN(c) KVSO_PARAMETER("margin",KVS_PT_UNSIGNEDINTEGER,0,iMargin) @@ -241,7 +241,7 @@ KVSO_CLASS_FUNCTION(label,setMargin) } KVSO_CLASS_FUNCTION(label,margin) { - CHECK_INTERNAL_POINTER(widget()) + CHECK_INTERNAL_POINTER(widget()) c->returnValue()->setInteger(((QLabel *)widget())->margin()); return true; } @@ -254,7 +254,7 @@ bool KviKvsObject_label::functionSetAutoResize(KviKvsObjectFunctionCall *c) KVSO_PARAMETER("bEnabled",KVS_PT_BOOL,0,bEnabled) KVSO_PARAMETERS_END(c) return true; - + } // FIX ME @@ -267,7 +267,7 @@ bool KviKvsObject_label::functionAutoResize(KviKvsObjectFunctionCall *c) KVSO_CLASS_FUNCTION(label,setAlignment) { - CHECK_INTERNAL_POINTER(widget()) + CHECK_INTERNAL_POINTER(widget()) QStringList alignment; KVSO_PARAMETERS_BEGIN(c) KVSO_PARAMETER("alignment",KVS_PT_STRINGLIST,KVS_PF_OPTIONAL,alignment) @@ -275,7 +275,7 @@ KVSO_CLASS_FUNCTION(label,setAlignment) int align,sum=0; for ( QStringList::Iterator it = alignment.begin(); it != alignment.end(); ++it ) { - + align = 0; for(unsigned int j = 0; j < align_num; j++) { @@ -289,7 +289,7 @@ KVSO_CLASS_FUNCTION(label,setAlignment) sum = sum | align; else c->warning(__tr2qs_ctx("Unknown alignment '%Q'","objects"),&(*it)); - + } ((QLabel *)widget())->setAlignment((Qt::Alignment)sum); return true; @@ -297,7 +297,7 @@ KVSO_CLASS_FUNCTION(label,setAlignment) KVSO_CLASS_FUNCTION(label,alignment) { - CHECK_INTERNAL_POINTER(widget()) + CHECK_INTERNAL_POINTER(widget()) int mode = ((QLabel *)widget())->alignment(); QString szAlignment=""; for(unsigned int i = 0; i < align_num; i++) @@ -314,14 +314,14 @@ KVSO_CLASS_FUNCTION(label,alignment) KVSO_CLASS_FUNCTION(label,clear) { - CHECK_INTERNAL_POINTER(widget()) + CHECK_INTERNAL_POINTER(widget()) ((QLabel *)widget())->clear(); return true; } KVSO_CLASS_FUNCTION(label,setFrameStyle) { - CHECK_INTERNAL_POINTER(widget()) + CHECK_INTERNAL_POINTER(widget()) QStringList style; KVSO_PARAMETERS_BEGIN(c) KVSO_PARAMETER("style",KVS_PT_STRINGLIST,KVS_PF_OPTIONAL,style) @@ -343,7 +343,7 @@ KVSO_CLASS_FUNCTION(label,setFrameStyle) sum = sum | framestyle; else c->warning(__tr2qs_ctx("Unknown style '%Q'","objects"),&(*it)); - + } ((QLabel *)widget())->setFrameStyle(sum); return true; @@ -351,7 +351,7 @@ KVSO_CLASS_FUNCTION(label,setFrameStyle) KVSO_CLASS_FUNCTION(label,frameStyle) { - CHECK_INTERNAL_POINTER(widget()) + CHECK_INTERNAL_POINTER(widget()) int mode = ((QLabel *)widget())->frameStyle(); QString szStyle=""; for(unsigned int i = 0; i < frame_num; i++) @@ -368,7 +368,7 @@ KVSO_CLASS_FUNCTION(label,frameStyle) KVSO_CLASS_FUNCTION(label,setImage) { - CHECK_INTERNAL_POINTER(widget()) + CHECK_INTERNAL_POINTER(widget()) QString icon; KVSO_PARAMETERS_BEGIN(c) KVSO_PARAMETER("icon",KVS_PT_STRING,0,icon) diff --git a/src/modules/objects/class_layout.cpp b/src/modules/objects/class_layout.cpp index 39c342830..9423cdf7a 100644 --- a/src/modules/objects/class_layout.cpp +++ b/src/modules/objects/class_layout.cpp @@ -33,7 +33,7 @@ // Tables used in $setAlignment & $alignment const char * const align_tbl[] = { - "Left", + "Left", "Right", "HCenter", "VCenter", @@ -95,8 +95,8 @@ const int align_cod[] = { !fn: $setMargin(<margin:uint>) Sets the dimension of the layout margin : the distance from the border to the outermost child widget edges. !fn: $setAlignment(<flag1:string>, <flag2:string>, ...) - Sets the alignment for widget w to flags, given as parameters. - Valid flags are:Right,Left,Top,Bottom,HCenter,VCenter,Center + Sets the alignment for widget w to flags, given as parameters. + Valid flags are:Right,Left,Top,Bottom,HCenter,VCenter,Center !fn: $setResizeMode(<resize_mode:string>) Sets the resize mode of the parent widget in relation to this layout. <mode> can be one of:[br] @@ -130,7 +130,7 @@ KVSO_BEGIN_DESTRUCTOR(KviKvsObject_layout) KVSO_END_CONSTRUCTOR(KviKvsObject_layout) -bool KviKvsObject_layout::init(KviKvsRunTimeContext * pContext,KviKvsVariantList *pParams) +bool KviKvsObject_layout::init(KviKvsRunTimeContext * pContext,KviKvsVariantList *) { QWidget * w = parentScriptWidget(); @@ -163,7 +163,7 @@ KVSO_CLASS_FUNCTION(layout,addWidget) KVSO_CLASS_FUNCTION(layout,addMultiCellWidget) { - CHECK_INTERNAL_POINTER(widget()) + CHECK_INTERNAL_POINTER(widget()) KviKvsObject * pObject; kvs_hobject_t hObject; kvs_uint_t uStartCol,uStartRow,uEndCol,uEndRow; @@ -177,13 +177,13 @@ KVSO_CLASS_FUNCTION(layout,addMultiCellWidget) pObject=KviKvsKernel::instance()->objectController()->lookupObject(hObject); CHECK_HOBJECT_IS_WIDGET(pObject) // { addWidget(w, fromRow, fromCol, (toRow < 0) ? -1 : toRow - fromRow + 1, (toCol < 0) ? -1 : toCol - fromCol + 1, _align); } - ((QGridLayout *)object())->addWidget(((QWidget *)(pObject->object())),uStartRow, uStartCol,(uEndRow < 0) ? -1 : uEndRow - uStartRow + 1, (uEndCol < 0) ? -1 : uEndCol - uStartCol + 1); + ((QGridLayout *)object())->addWidget(((QWidget *)(pObject->object())),uStartRow, uStartCol, uEndRow - uStartRow + 1, uEndCol - uStartCol + 1); return true; } KVSO_CLASS_FUNCTION(layout,setRowStretch) { - CHECK_INTERNAL_POINTER(widget()) + CHECK_INTERNAL_POINTER(widget()) kvs_uint_t uRow,uStretch; KVSO_PARAMETERS_BEGIN(c) KVSO_PARAMETER("row",KVS_PT_UNSIGNEDINTEGER,0,uRow) @@ -195,7 +195,7 @@ KVSO_CLASS_FUNCTION(layout,setRowStretch) KVSO_CLASS_FUNCTION(layout,setColumnStretch) { - CHECK_INTERNAL_POINTER(widget()) + CHECK_INTERNAL_POINTER(widget()) kvs_uint_t uCol,uStretch; KVSO_PARAMETERS_BEGIN(c) KVSO_PARAMETER("column",KVS_PT_UNSIGNEDINTEGER,0,uCol) @@ -207,7 +207,7 @@ KVSO_CLASS_FUNCTION(layout,setColumnStretch) KVSO_CLASS_FUNCTION(layout,setMargin) { - CHECK_INTERNAL_POINTER(widget()) + CHECK_INTERNAL_POINTER(widget()) kvs_uint_t uMargin; KVSO_PARAMETERS_BEGIN(c) KVSO_PARAMETER("margin",KVS_PT_UNSIGNEDINTEGER,0,uMargin) @@ -218,7 +218,7 @@ KVSO_CLASS_FUNCTION(layout,setMargin) KVSO_CLASS_FUNCTION(layout,setSpacing) { - CHECK_INTERNAL_POINTER(widget()) + CHECK_INTERNAL_POINTER(widget()) kvs_uint_t uSpacing; KVSO_PARAMETERS_BEGIN(c) KVSO_PARAMETER("spacing",KVS_PT_UNSIGNEDINTEGER,0,uSpacing) @@ -229,7 +229,7 @@ KVSO_CLASS_FUNCTION(layout,setSpacing) KVSO_CLASS_FUNCTION(layout,addRowSpacing) { - CHECK_INTERNAL_POINTER(widget()) + CHECK_INTERNAL_POINTER(widget()) kvs_uint_t uSpacing,uRow; KVSO_PARAMETERS_BEGIN(c) KVSO_PARAMETER("row",KVS_PT_UNSIGNEDINTEGER,0,uRow) @@ -242,7 +242,7 @@ KVSO_CLASS_FUNCTION(layout,addRowSpacing) KVSO_CLASS_FUNCTION(layout,addColSpacing) { - CHECK_INTERNAL_POINTER(widget()) + CHECK_INTERNAL_POINTER(widget()) kvs_uint_t uSpacing,uCol; KVSO_PARAMETERS_BEGIN(c) KVSO_PARAMETER("column",KVS_PT_UNSIGNEDINTEGER,0,uCol) @@ -254,7 +254,7 @@ KVSO_CLASS_FUNCTION(layout,addColSpacing) KVSO_CLASS_FUNCTION(layout,setResizeMode) { - CHECK_INTERNAL_POINTER(widget()) + CHECK_INTERNAL_POINTER(widget()) QString szMode; KVSO_PARAMETERS_BEGIN(c) KVSO_PARAMETER("resize_mode",KVS_PT_STRING,0,szMode) @@ -271,7 +271,7 @@ KVSO_CLASS_FUNCTION(layout,setResizeMode) KVSO_CLASS_FUNCTION(layout,setAlignment) { - CHECK_INTERNAL_POINTER(widget()) + CHECK_INTERNAL_POINTER(widget()) QStringList alignment; KviKvsObject * pObject; kvs_hobject_t hObject; @@ -304,7 +304,7 @@ KVSO_CLASS_FUNCTION(layout,setAlignment) sum = sum | align; else c->warning(__tr2qs_ctx("Unknown alignment: '%Q'","objects"),&(*it)); - + } if (widget()) ((QGridLayout *)widget())->setAlignment(((QWidget *)(pObject->object())),(Qt::Alignment)sum); return true; diff --git a/src/modules/objects/class_lcd.cpp b/src/modules/objects/class_lcd.cpp index 831508f5c..29dc29e7e 100644 --- a/src/modules/objects/class_lcd.cpp +++ b/src/modules/objects/class_lcd.cpp @@ -61,7 +61,7 @@ Sets the lcd number value. !fn: <boolean> $checkOverflow() Returns TRUE if num is too big to be displayed in its entirety; - otherwise returns FALSE. + otherwise returns FALSE. !fn: $setSmallDecimalPoint(<bflag:boolean>) Sets the the decimal point style, valid bool values are 1 or 0. !fn: <boolean> $checkOverflow(<number:integer>) @@ -69,7 +69,7 @@ */ KVSO_BEGIN_REGISTERCLASS(KviKvsObject_lcd,"lcdnumber","widget") - + KVSO_REGISTER_HANDLER_NEW(KviKvsObject_lcd,displayStr) KVSO_REGISTER_HANDLER_NEW(KviKvsObject_lcd,displayInt) KVSO_REGISTER_HANDLER_NEW(KviKvsObject_lcd,displayDouble) @@ -89,7 +89,7 @@ KVSO_BEGIN_DESTRUCTOR(KviKvsObject_lcd) KVSO_END_CONSTRUCTOR(KviKvsObject_lcd) -bool KviKvsObject_lcd::init(KviKvsRunTimeContext * pContext,KviKvsVariantList *pParams) +bool KviKvsObject_lcd::init(KviKvsRunTimeContext *,KviKvsVariantList *) { SET_OBJECT(QLCDNumber) return true; @@ -97,7 +97,7 @@ bool KviKvsObject_lcd::init(KviKvsRunTimeContext * pContext,KviKvsVariantList *p KVSO_CLASS_FUNCTION(lcd,displayInt) { - CHECK_INTERNAL_POINTER(widget()) + CHECK_INTERNAL_POINTER(widget()) kvs_int_t iDigit; KVSO_PARAMETERS_BEGIN(c) KVSO_PARAMETER("number",KVS_PT_INT,0,iDigit) @@ -108,7 +108,7 @@ KVSO_CLASS_FUNCTION(lcd,displayInt) KVSO_CLASS_FUNCTION(lcd,displayStr) { - CHECK_INTERNAL_POINTER(widget()) + CHECK_INTERNAL_POINTER(widget()) QString szText; KVSO_PARAMETERS_BEGIN(c) KVSO_PARAMETER("number",KVS_PT_STRING,0,szText) @@ -119,7 +119,7 @@ KVSO_CLASS_FUNCTION(lcd,displayStr) KVSO_CLASS_FUNCTION(lcd,displayDouble) { - CHECK_INTERNAL_POINTER(widget()) + CHECK_INTERNAL_POINTER(widget()) kvs_real_t dDigit; KVSO_PARAMETERS_BEGIN(c) KVSO_PARAMETER("number",KVS_PT_DOUBLE,0,dDigit) @@ -130,7 +130,7 @@ KVSO_CLASS_FUNCTION(lcd,displayDouble) KVSO_CLASS_FUNCTION(lcd,setMode) { - CHECK_INTERNAL_POINTER(widget()) + CHECK_INTERNAL_POINTER(widget()) QString szMode; KVSO_PARAMETERS_BEGIN(c) KVSO_PARAMETER("mode",KVS_PT_STRING,0,szMode) @@ -145,7 +145,7 @@ KVSO_CLASS_FUNCTION(lcd,setMode) KVSO_CLASS_FUNCTION(lcd,setSegmentStyle) { - CHECK_INTERNAL_POINTER(widget()) + CHECK_INTERNAL_POINTER(widget()) QString szStyle; KVSO_PARAMETERS_BEGIN(c) KVSO_PARAMETER("style",KVS_PT_STRING,0,szStyle) @@ -159,7 +159,7 @@ KVSO_CLASS_FUNCTION(lcd,setSegmentStyle) KVSO_CLASS_FUNCTION(lcd,setNumDigits) { - CHECK_INTERNAL_POINTER(widget()) + CHECK_INTERNAL_POINTER(widget()) kvs_real_t digit; KVSO_PARAMETERS_BEGIN(c) KVSO_PARAMETER("digit",KVS_PT_DOUBLE,0,digit) @@ -170,7 +170,7 @@ KVSO_CLASS_FUNCTION(lcd,setNumDigits) KVSO_CLASS_FUNCTION(lcd,setSmallDecimalPoint) { - CHECK_INTERNAL_POINTER(widget()) + CHECK_INTERNAL_POINTER(widget()) bool bFlag; KVSO_PARAMETERS_BEGIN(c) KVSO_PARAMETER("bflag",KVS_PT_BOOLEAN,0,bFlag) @@ -181,7 +181,7 @@ KVSO_CLASS_FUNCTION(lcd,setSmallDecimalPoint) KVSO_CLASS_FUNCTION(lcd,checkOverflow) { - CHECK_INTERNAL_POINTER(widget()) + CHECK_INTERNAL_POINTER(widget()) kvs_real_t iDigit; KVSO_PARAMETERS_BEGIN(c) KVSO_PARAMETER("digit",KVS_PT_DOUBLE,0,iDigit) diff --git a/src/modules/objects/class_lineedit.cpp b/src/modules/objects/class_lineedit.cpp index 607e7b9ae..74c6e2599 100644 --- a/src/modules/objects/class_lineedit.cpp +++ b/src/modules/objects/class_lineedit.cpp @@ -217,7 +217,7 @@ KVSO_BEGIN_DESTRUCTOR(KviKvsObject_lineedit) KVSO_END_CONSTRUCTOR(KviKvsObject_lineedit) -bool KviKvsObject_lineedit::init(KviKvsRunTimeContext * pContext,KviKvsVariantList * pParams) +bool KviKvsObject_lineedit::init(KviKvsRunTimeContext *,KviKvsVariantList *) { SET_OBJECT(QLineEdit) connect(widget(),SIGNAL(returnPressed()),this,SLOT(slotreturnPressed())); @@ -228,14 +228,14 @@ bool KviKvsObject_lineedit::init(KviKvsRunTimeContext * pContext,KviKvsVariantLi KVSO_CLASS_FUNCTION(lineedit,text) { - CHECK_INTERNAL_POINTER(widget()) + CHECK_INTERNAL_POINTER(widget()) c->returnValue()->setString(((QLineEdit *)widget())->text()); return true; } KVSO_CLASS_FUNCTION(lineedit,setText) { - CHECK_INTERNAL_POINTER(widget()) + CHECK_INTERNAL_POINTER(widget()) QString szText; KVSO_PARAMETERS_BEGIN(c) KVSO_PARAMETER("text",KVS_PT_STRING,0,szText) @@ -245,7 +245,7 @@ KVSO_CLASS_FUNCTION(lineedit,setText) } KVSO_CLASS_FUNCTION(lineedit,setInputValidator) { - CHECK_INTERNAL_POINTER(widget()) + CHECK_INTERNAL_POINTER(widget()) QString szReg; KVSO_PARAMETERS_BEGIN(c) KVSO_PARAMETER("reg_expression",KVS_PT_STRING,0,szReg) @@ -255,14 +255,14 @@ KVSO_CLASS_FUNCTION(lineedit,setInputValidator) } KVSO_CLASS_FUNCTION(lineedit,maxLength) { - CHECK_INTERNAL_POINTER(widget()) + CHECK_INTERNAL_POINTER(widget()) c->returnValue()->setInteger(((QLineEdit *)widget())->maxLength()); return true; } KVSO_CLASS_FUNCTION(lineedit,setMaxLength) { - CHECK_INTERNAL_POINTER(widget()) + CHECK_INTERNAL_POINTER(widget()) kvs_uint_t iMaxlen; KVSO_PARAMETERS_BEGIN(c) KVSO_PARAMETER("maxlen",KVS_PT_UNSIGNEDINTEGER,0,iMaxlen) @@ -273,14 +273,14 @@ KVSO_CLASS_FUNCTION(lineedit,setMaxLength) KVSO_CLASS_FUNCTION(lineedit,frame) { - CHECK_INTERNAL_POINTER(widget()) + CHECK_INTERNAL_POINTER(widget()) c->returnValue()->setBoolean(((QLineEdit *)widget())->hasFrame()); return true; } KVSO_CLASS_FUNCTION(lineedit,setFrame) { - CHECK_INTERNAL_POINTER(widget()) + CHECK_INTERNAL_POINTER(widget()) bool bFrame; KVSO_PARAMETERS_BEGIN(c) KVSO_PARAMETER("bframe",KVS_PT_BOOL,0,bFrame) @@ -291,14 +291,14 @@ KVSO_CLASS_FUNCTION(lineedit,setFrame) KVSO_CLASS_FUNCTION(lineedit,cursorPosition) { - CHECK_INTERNAL_POINTER(widget()) + CHECK_INTERNAL_POINTER(widget()) c->returnValue()->setInteger(((QLineEdit *)widget())->cursorPosition()); return true; } KVSO_CLASS_FUNCTION(lineedit,setCursorPosition) { - CHECK_INTERNAL_POINTER(widget()) + CHECK_INTERNAL_POINTER(widget()) kvs_uint_t iPos; KVSO_PARAMETERS_BEGIN(c) KVSO_PARAMETER("position",KVS_PT_UNSIGNEDINTEGER,0,iPos) @@ -309,14 +309,14 @@ KVSO_CLASS_FUNCTION(lineedit,setCursorPosition) KVSO_CLASS_FUNCTION(lineedit,selectAll) { - CHECK_INTERNAL_POINTER(widget()) + CHECK_INTERNAL_POINTER(widget()) ((QLineEdit *)widget())->selectAll(); return true; } KVSO_CLASS_FUNCTION(lineedit,setSelection) { - CHECK_INTERNAL_POINTER(widget()) + CHECK_INTERNAL_POINTER(widget()) kvs_uint_t uStart,uLen; KVSO_PARAMETERS_BEGIN(c) KVSO_PARAMETER("start",KVS_PT_UNSIGNEDINTEGER,0,uStart) @@ -328,28 +328,28 @@ KVSO_CLASS_FUNCTION(lineedit,setSelection) KVSO_CLASS_FUNCTION(lineedit,copy) { - CHECK_INTERNAL_POINTER(widget()) + CHECK_INTERNAL_POINTER(widget()) ((QLineEdit *)widget())->copy(); return true; } KVSO_CLASS_FUNCTION(lineedit,cut) { - CHECK_INTERNAL_POINTER(widget()) + CHECK_INTERNAL_POINTER(widget()) ((QLineEdit *)widget())->cut(); return true; } KVSO_CLASS_FUNCTION(lineedit,paste) { - CHECK_INTERNAL_POINTER(widget()) + CHECK_INTERNAL_POINTER(widget()) ((QLineEdit *)widget())->paste(); return true; } KVSO_CLASS_FUNCTION(lineedit,echoMode) { - CHECK_INTERNAL_POINTER(widget()) + CHECK_INTERNAL_POINTER(widget()) int mode = ((QLineEdit *)widget())->echoMode(); QString szEchomode=""; for(unsigned int i = 0; i < mode_num; i++) @@ -366,7 +366,7 @@ KVSO_CLASS_FUNCTION(lineedit,echoMode) KVSO_CLASS_FUNCTION(lineedit,setEchoMode) { - CHECK_INTERNAL_POINTER(widget()) + CHECK_INTERNAL_POINTER(widget()) QString szMode; KVSO_PARAMETERS_BEGIN(c) KVSO_PARAMETER("mode",KVS_PT_STRING,0,szMode) @@ -386,7 +386,7 @@ KVSO_CLASS_FUNCTION(lineedit,setEchoMode) KVSO_CLASS_FUNCTION(lineedit,clear) { - CHECK_INTERNAL_POINTER(widget()) + CHECK_INTERNAL_POINTER(widget()) ((QLineEdit *)widget())->clear(); return true; } @@ -394,7 +394,7 @@ KVSO_CLASS_FUNCTION(lineedit,clear) //-| Grifisx & Noldor |-Start: KVSO_CLASS_FUNCTION(lineedit,dragAndDrop) { - CHECK_INTERNAL_POINTER(widget()) + CHECK_INTERNAL_POINTER(widget()) bool bEnabled; KVSO_PARAMETERS_BEGIN(c) KVSO_PARAMETER("bEnabled",KVS_PT_BOOL,0,bEnabled) @@ -405,7 +405,7 @@ KVSO_CLASS_FUNCTION(lineedit,dragAndDrop) KVSO_CLASS_FUNCTION(lineedit,setReadOnly) { - CHECK_INTERNAL_POINTER(widget()) + CHECK_INTERNAL_POINTER(widget()) bool bEnabled; KVSO_PARAMETERS_BEGIN(c) KVSO_PARAMETER("bReadonly",KVS_PT_BOOL,0,bEnabled) @@ -416,7 +416,7 @@ KVSO_CLASS_FUNCTION(lineedit,setReadOnly) KVSO_CLASS_FUNCTION(lineedit,setInputMask) { - CHECK_INTERNAL_POINTER(widget()) + CHECK_INTERNAL_POINTER(widget()) QString szMask; KVSO_PARAMETERS_BEGIN(c) KVSO_PARAMETER("mask",KVS_PT_STRING,0,szMask) diff --git a/src/modules/objects/class_listwidget.cpp b/src/modules/objects/class_listwidget.cpp index 3a877722d..89519d441 100644 --- a/src/modules/objects/class_listwidget.cpp +++ b/src/modules/objects/class_listwidget.cpp @@ -95,7 +95,7 @@ !fn: <index:integer> $onItemEvent()
This function is called by KVIrc when the current item pointed by the mouse changes and gives in $0 the item index.
!fn: <array:x,y,width,height> $itemRect(<item:index>)
- Returns the rectangle on the screen that item occupies, or an invalid rectangle if item is 0 or is not currently visible.
+ Returns the rectangle on the screen that item occupies, or an invalid rectangle if item is 0 or is not currently visible.
@signals:
!sg: <string> $currentItemChanged()
@@ -145,7 +145,7 @@ KVSO_BEGIN_DESTRUCTOR(KviKvsObject_listwidget) KVSO_END_CONSTRUCTOR(KviKvsObject_listwidget)
-bool KviKvsObject_listwidget::init(KviKvsRunTimeContext * pContext,KviKvsVariantList *pParams)
+bool KviKvsObject_listwidget::init(KviKvsRunTimeContext *,KviKvsVariantList *)
{
SET_OBJECT(QListWidget)
obj->setSelectionMode(QAbstractItemView::SingleSelection);
@@ -188,7 +188,7 @@ KVSO_CLASS_FUNCTION(listwidget,changeItem) if (szText.isEmpty()) c->warning(__tr2qs_ctx("No string parameter given - using empty string","objects"));
if(iIndex >= (cnt = ((QListWidget *)widget())->count()))
{
- c->warning(__tr2qs("Item index [%d] is too big - defaulting to "
+ c->warning(__tr2qs("Item index [%d] is too big - defaulting to "
"$count() - 1 [%d]"), iIndex, cnt);
iIndex = cnt - 1;
}
@@ -298,7 +298,7 @@ KVSO_CLASS_FUNCTION(listwidget,insertWidgetItem) KVSO_PARAMETER("index",KVS_PT_INT,0,iIndex)
KVSO_PARAMETERS_END(c)
pObject=KviKvsKernel::instance()->objectController()->lookupObject(hWid);
- if(pObject==this)
+ if(pObject==this)
{
c->warning(__tr2qs_ctx("Can't insert the listwidget itself!","objects"));
return true;
@@ -391,7 +391,7 @@ KVSO_CLASS_FUNCTION(listwidget,itemEnteredEvent) }
//slots
-void KviKvsObject_listwidget::currentItemChanged(QListWidgetItem *currentItem,QListWidgetItem *previousItem)
+void KviKvsObject_listwidget::currentItemChanged(QListWidgetItem *currentItem,QListWidgetItem *)
{
if (!currentItem) callFunction(this,"currentItemChangeEvent",0,0);
else
@@ -403,7 +403,6 @@ void KviKvsObject_listwidget::currentItemChanged(QListWidgetItem *currentItem,QL }
void KviKvsObject_listwidget::selectionChanged()
{
- KviKvsVariantList *params=0;
callFunction(this,"selectionChangeEvent",0,0);
}
diff --git a/src/modules/objects/class_mainwindow.cpp b/src/modules/objects/class_mainwindow.cpp index 01fe8421c..903909b8e 100644 --- a/src/modules/objects/class_mainwindow.cpp +++ b/src/modules/objects/class_mainwindow.cpp @@ -67,7 +67,7 @@ KVSO_BEGIN_DESTRUCTOR(KviKvsObject_mainwindow) KVSO_END_CONSTRUCTOR(KviKvsObject_mainwindow) -bool KviKvsObject_mainwindow::init(KviKvsRunTimeContext * pContext,KviKvsVariantList *pParams) +bool KviKvsObject_mainwindow::init(KviKvsRunTimeContext *,KviKvsVariantList *) { setObject(new KviTalMainWindow(parentScriptWidget(), getName().toUtf8().data()), true); return true; @@ -98,7 +98,7 @@ KVSO_CLASS_FUNCTION(mainwindow,setCentralWidget) return TRUE; } ((KviTalMainWindow *)widget())->setCentralWidget(((QWidget *)(pObject->object()))); - return true; + return true; } //FIX ME KVSO_CLASS_FUNCTION(mainwindow,setDockEnabled) @@ -129,6 +129,6 @@ KVSO_CLASS_FUNCTION(mainwindow,isDockEnabled) KVSO_PARAMETER("dock_area",KVS_PT_STRING,0,szDockarea) KVSO_PARAMETERS_END(c) c->returnValue()->setBoolean(bFlag); - return true; + return true; } diff --git a/src/modules/objects/class_menubar.cpp b/src/modules/objects/class_menubar.cpp index d731af67e..93b79fdb9 100644 --- a/src/modules/objects/class_menubar.cpp +++ b/src/modules/objects/class_menubar.cpp @@ -40,7 +40,7 @@ [class]object[/class] [class]widget[/class] @description: - + @functions: !fn: <integer> $insertItem(<text:string>) Returns an integer that identifies the inserted item. @@ -59,7 +59,7 @@ KVSO_BEGIN_DESTRUCTOR(KviKvsObject_menubar) KVSO_END_CONSTRUCTOR(KviKvsObject_menubar) -bool KviKvsObject_menubar::init(KviKvsRunTimeContext * pContext,KviKvsVariantList *pParams) +bool KviKvsObject_menubar::init(KviKvsRunTimeContext *,KviKvsVariantList *) { SET_OBJECT(QMenuBar) return true; diff --git a/src/modules/objects/libkviobjects.cpp b/src/modules/objects/libkviobjects.cpp index 7e6c5a3fb..8a0e6db75 100644 --- a/src/modules/objects/libkviobjects.cpp +++ b/src/modules/objects/libkviobjects.cpp @@ -85,13 +85,13 @@ static void dumpChildObjects(KviWindow *pWnd, QObject *parent, const char *spacing, bool bWidgetsOnly, KviKvsArray *n, int &idx); -static bool objects_module_cleanup(KviModule *m) +static bool objects_module_cleanup(KviModule *) { // Don't attempt to change the order of these calls. // Derived classes must be unregistered before the base ones. - + KviKvsObject_memorybuffer::unregisterSelf(); - + KviKvsObject_process::unregisterSelf(); KviKvsObject_ftp::unregisterSelf(); KviKvsObject_http::unregisterSelf(); @@ -487,7 +487,7 @@ static bool objects_kvs_fnc_classes(KviKvsModuleFunctionCall * c) KviKvsArray * pArry = new KviKvsArray(); c->returnValue()->setArray(pArry); - int uIdx=0; + KviPointerHashTableIterator<QString,KviKvsObjectClass> it(*KviKvsKernel::instance()->objectController()->classDict()); KviPointerHashTable<QString,bool> *classdict=new KviPointerHashTable<QString,bool>; classdict->setAutoDelete(false); @@ -654,7 +654,6 @@ static bool objects_kvs_cmd_bitBlt(KviKvsModuleCommandCall * c) return true; } - QImage * imgSource=0; QPaintDevice * pdSource = 0; if(obSrc->inheritsClass("pixmap")) pdSource =((KviKvsObject_pixmap *)obSrc)->getPixmap(); @@ -795,11 +794,9 @@ static bool objects_kvs_cmd_blend(KviKvsModuleCommandCall * c) QRgb * fgn = (QRgb *)img_fore->scanLine(y+iFoY); fgn += iFoX; double dRemaining = 1.0 - dBlend; - int a=0; + while(dst < end) { - - *dst = qRgba( (int)((qRed(*bkg) * dRemaining) + (qRed(*fgn) * dBlend)), (int)((qGreen(*bkg) * dRemaining) + (qGreen(*fgn) * dBlend)), @@ -811,8 +808,6 @@ static bool objects_kvs_cmd_blend(KviKvsModuleCommandCall * c) bkg++; fgn++; } - - } QPainter p(pdDest); QRect rect(iDesX,iDesY,buffer.width(),buffer.height()); |
