aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules
diff options
context:
space:
mode:
authorGravatar Szymon Tomasz Stefanek2012-12-22 01:53:14 +0000
committerGravatar Szymon Tomasz Stefanek2012-12-22 01:53:14 +0000
commita7572583e8a7f0ed963da2238870170bc3bf12ed (patch)
tree3e82d3b87f446fedd7a01924d8d4f281bdf5b140 /src/modules
parentFixed compilation with qt5rc1 (diff)
downloadKVIrc-a7572583e8a7f0ed963da2238870170bc3bf12ed.tar.gz
KVIrc-a7572583e8a7f0ed963da2238870170bc3bf12ed.tar.bz2
KVIrc-a7572583e8a7f0ed963da2238870170bc3bf12ed.zip
Compile and run with Qt5.0. Also add a couple of KVS functions for byte order conversion.
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@6297 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/chan/libkvichan.cpp4
-rw-r--r--src/modules/dcc/canvaswidget.cpp6
-rw-r--r--src/modules/help/HelpWindow.cpp4
-rw-r--r--src/modules/list/ListWindow.cpp4
-rw-r--r--src/modules/mediaplayer/MpMprisInterface.cpp6
-rw-r--r--src/modules/mediaplayer/MpXmmsInterface.cpp2
-rw-r--r--src/modules/mediaplayer/winamp.cpp2
-rw-r--r--src/modules/my/Idle_x11.cpp18
-rw-r--r--src/modules/objects/KvsObject_groupBox.cpp4
-rw-r--r--src/modules/objects/KvsObject_lcd.cpp6
-rw-r--r--src/modules/objects/KvsObject_listWidget.cpp12
-rw-r--r--src/modules/objects/KvsObject_mainWindow.cpp2
-rw-r--r--src/modules/objects/KvsObject_multiLineEdit.cpp18
-rw-r--r--src/modules/objects/KvsObject_painter.cpp12
-rw-r--r--src/modules/objects/KvsObject_process.cpp2
-rw-r--r--src/modules/objects/KvsObject_radioButton.cpp2
-rw-r--r--src/modules/objects/KvsObject_tableWidget.cpp2
-rw-r--r--src/modules/objects/KvsObject_toolButton.cpp2
-rw-r--r--src/modules/objects/KvsObject_treeWidgeteItem.cpp2
-rw-r--r--src/modules/objects/KvsObject_widget.cpp12
-rw-r--r--src/modules/objects/KvsObject_workspace.cpp2
-rw-r--r--src/modules/objects/KvsObject_xmlreader.cpp14
-rw-r--r--src/modules/objects/object_macros.h4
-rw-r--r--src/modules/options/libkvioptions.cpp2
-rw-r--r--src/modules/perlcore/ppport.h8
-rw-r--r--src/modules/reguser/RegisteredUsersDialog.cpp4
-rw-r--r--src/modules/reguser/RegistrationWizard.cpp2
-rw-r--r--src/modules/setup/SetupWizard.cpp8
-rw-r--r--src/modules/setup/libkvisetup.cpp4
-rw-r--r--src/modules/snd/libkvisnd.cpp4
-rw-r--r--src/modules/system/libkvisystem.cpp114
-rw-r--r--src/modules/torrent/KTorrentDbusInterface.cpp6
32 files changed, 211 insertions, 83 deletions
diff --git a/src/modules/chan/libkvichan.cpp b/src/modules/chan/libkvichan.cpp
index 3340e52d3..65d137d34 100644
--- a/src/modules/chan/libkvichan.cpp
+++ b/src/modules/chan/libkvichan.cpp
@@ -263,7 +263,7 @@ static bool chan_kvs_fnc_topicsetat(KviKvsModuleFunctionCall * c)
@short:
Returns the number of users on a channel
@syntax:
- <intger> $chan.usercount
+ <integer> $chan.usercount
<integer> $chan.usercount(<window_id:string>)
@description:
The first form returns the number of users on the current channel (assuming that the current window
@@ -295,7 +295,7 @@ static bool chan_kvs_fnc_usercount(KviKvsModuleFunctionCall * c)
Returns the number of channel owner users on a channel
@syntax:
<integer> $chan.ownercount
- <integer> $chan.ownercount(<window_id:integer>)
+ <integer> $chan.ownercount(<window_id:string>)
@description:
The first form returns the number of owners users on the current channel (assuming that the current window
is a channel at all). If the current window is not a channel, a warning is printed
diff --git a/src/modules/dcc/canvaswidget.cpp b/src/modules/dcc/canvaswidget.cpp
index 1356c5f3c..90431a6b1 100644
--- a/src/modules/dcc/canvaswidget.cpp
+++ b/src/modules/dcc/canvaswidget.cpp
@@ -1228,8 +1228,8 @@
case QVariant::Bool:
{
QComboBox * b = new QComboBox(false,table()->viewport());
- b->addAction("FALSE");
- b->addAction("TRUE");
+ b->addAction("false");
+ b->addAction("true");
b->setCurrentItem(m_property.toBool() ? 1 : 0);
return b;
}
@@ -1335,7 +1335,7 @@
sz = m_property.toString();
break;
case QVariant::Bool:
- sz = m_property.toBool() ? "TRUE" : "FALSE";
+ sz = m_property.toBool() ? "true" : "false";
break;
case QVariant::Font:
sz.setNum(m_property.toFont().pointSize());
diff --git a/src/modules/help/HelpWindow.cpp b/src/modules/help/HelpWindow.cpp
index 00b2255a1..563b7aa93 100644
--- a/src/modules/help/HelpWindow.cpp
+++ b/src/modules/help/HelpWindow.cpp
@@ -47,7 +47,7 @@ extern HelpIndex * g_pDocIndex;
extern KviPointerList<HelpWindow> * g_pHelpWindowList;
extern KviPointerList<HelpWidget> * g_pHelpWidgetList;
-//bool g_bIndexingDone = FALSE;
+//bool g_bIndexingDone = false;
HelpWindow::HelpWindow(const char * name)
: KviWindow(KviWindow::Help,name)
{
@@ -238,7 +238,7 @@ void HelpWindow::startSearch()
m_pResultBox->addItem( g_pDocIndex->getDocumentTitle( *it ) );
m_terms.clear();
- bool isPhrase = FALSE;
+ bool isPhrase = false;
QString s = "";
for ( int i = 0; i < (int)buf.length(); ++i ) {
if ( buf[i] == '\"' ) {
diff --git a/src/modules/list/ListWindow.cpp b/src/modules/list/ListWindow.cpp
index 0bbaa3c99..44fdf0689 100644
--- a/src/modules/list/ListWindow.cpp
+++ b/src/modules/list/ListWindow.cpp
@@ -245,8 +245,8 @@ ListWindow::ListWindow(KviConsoleWindow * lpConsole)
columnLabels.append(__tr2qs("Topic"));
m_pTreeWidget->setColumnCount(3);
m_pTreeWidget->setHeaderLabels(columnLabels);
- m_pTreeWidget->setAllColumnsShowFocus(TRUE);
- m_pTreeWidget->setSortingEnabled(TRUE);
+ m_pTreeWidget->setAllColumnsShowFocus(true);
+ m_pTreeWidget->setSortingEnabled(true);
m_pTreeWidget->sortItems(0,Qt::AscendingOrder);
m_pTreeWidget->setUniformRowHeights(true);
diff --git a/src/modules/mediaplayer/MpMprisInterface.cpp b/src/modules/mediaplayer/MpMprisInterface.cpp
index 14d090580..5f3a19bde 100644
--- a/src/modules/mediaplayer/MpMprisInterface.cpp
+++ b/src/modules/mediaplayer/MpMprisInterface.cpp
@@ -90,9 +90,9 @@ int MpMprisInterface::detect(bool)
if (reply.type() == QDBusMessage::ErrorMessage) { \
QDBusError err = reply; \
qDebug("Error: %s\n%s\n", qPrintable(err.name()), qPrintable(err.message())); \
- return FALSE; \
+ return false; \
} \
- return TRUE;
+ return true;
bool MpMprisInterface::prev()
{
@@ -342,7 +342,7 @@ int MpAudaciousInterface::getPlayListPos()
bool MpAudaciousInterface::quit()
{
if (MpMprisInterface::quit())
- return TRUE;
+ return true;
/* compability with older versions */
MPRIS_SIMPLE_CALL("/Player", "Quit")
diff --git a/src/modules/mediaplayer/MpXmmsInterface.cpp b/src/modules/mediaplayer/MpXmmsInterface.cpp
index bab94cbc5..d2afabbfa 100644
--- a/src/modules/mediaplayer/MpXmmsInterface.cpp
+++ b/src/modules/mediaplayer/MpXmmsInterface.cpp
@@ -137,7 +137,7 @@ void * KviXmmsInterface::lookupSymbol(const char * szSymbolName)
return 0;
}
}
- void * symptr =m_pPlayerLibrary->resolve(szSymbolName);
+ void * symptr = (void *)m_pPlayerLibrary->resolve(szSymbolName);
if(!symptr)
{
QString szTmp = QString(__tr2qs_ctx("Can't find symbol %1 in %2","mediaplayer")).arg(szSymbolName,m_szPlayerLibraryName);
diff --git a/src/modules/mediaplayer/winamp.cpp b/src/modules/mediaplayer/winamp.cpp
index eba45988e..41dca5aa1 100644
--- a/src/modules/mediaplayer/winamp.cpp
+++ b/src/modules/mediaplayer/winamp.cpp
@@ -66,7 +66,7 @@ winampGeneralPurposePlugin plugin =
/*
BOOL WINAPI _DllMainCRTStartup(HANDLE hInst, ULONG ul_reason_for_call, LPVOID lpReserved)
{
- return TRUE;
+ return true;
}
*/
diff --git a/src/modules/my/Idle_x11.cpp b/src/modules/my/Idle_x11.cpp
index 9b4c4a062..cc82cf81e 100644
--- a/src/modules/my/Idle_x11.cpp
+++ b/src/modules/my/Idle_x11.cpp
@@ -30,7 +30,9 @@
#else
#include <QApplication>
#include <QDesktopWidget>
+#if (QT_VERSION < 0x050000)
#include <QX11Info>
+#endif // QT_VERSION < 0x050000
#include <X11/Xlib.h>
#include <X11/Xutil.h>
@@ -78,17 +80,29 @@
old_handler = XSetErrorHandler(xerrhandler);
int event_base, error_base;
+#if (QT_VERSION < 0x050000)
if(XScreenSaverQueryExtension(QX11Info::display(), &event_base, &error_base)) {
d->ss_info = XScreenSaverAllocInfo();
return true;
}
+#else
+ // FIXME: Need a replacement for this?
+#endif
return false;
}
int IdlePlatform::secondsIdle() const
{
- if(!d->ss_info) return 0;
- if(!XScreenSaverQueryInfo(QX11Info::display(), QX11Info::appRootWindow(), d->ss_info)) return 0;
+ if(!d->ss_info)
+ return 0;
+#if (QT_VERSION < 0x050000)
+ if(!XScreenSaverQueryInfo(QX11Info::display(), QX11Info::appRootWindow(), d->ss_info))
+ return 0;
+#else
+ // FIXME: Need a replacement for this?
+ return 0;
+#endif
+
return d->ss_info->idle / 1000;
}
#endif
diff --git a/src/modules/objects/KvsObject_groupBox.cpp b/src/modules/objects/KvsObject_groupBox.cpp
index ccc8a2d41..a6677d105 100644
--- a/src/modules/objects/KvsObject_groupBox.cpp
+++ b/src/modules/objects/KvsObject_groupBox.cpp
@@ -75,9 +75,9 @@ const int align_cod[] = {
!fn: $setFlat(<bflag:boolean>)
Sets whether the group box is painted flat. Valid Values are 1 or 0.
!fn: <boolean> $isFlat()
- Returns 1 (TRUE) if the group box is painted flat; otherwise returns 0 (FALSE).
+ Returns 1 (true) if the group box is painted flat; otherwise returns 0 (false).
!fn: <boolean> $isCheckable()
- Returns 1 (TRUE) if the group box has a checkbox in its title; otherwise returns 0 (FALSE).
+ Returns 1 (true) if the group box has a checkbox in its title; otherwise returns 0 (false).
!fn: $setCheckable(<bflag:boolean>)
Sets whether the group box has a checkbox in its title: Valid values are 1 or 0.
!fn: $setInsideMargin(<margin:uint>)
diff --git a/src/modules/objects/KvsObject_lcd.cpp b/src/modules/objects/KvsObject_lcd.cpp
index 3bc333bf1..3038a4b87 100644
--- a/src/modules/objects/KvsObject_lcd.cpp
+++ b/src/modules/objects/KvsObject_lcd.cpp
@@ -60,12 +60,12 @@
!fn: $setNumDigits(<number:integer>)
Sets the lcd number value.
!fn: <boolean> $checkOverflow()
- Returns TRUE if num is too big to be displayed in its entirety;
- otherwise returns FALSE.
+ Returns true if num is too big to be displayed in its entirety;
+ 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>)
- Returns 1 (TRUE) if num is too big to be displayed in its entirety; otherwise returns 0 (FALSE).
+ Returns 1 (true) if num is too big to be displayed in its entirety; otherwise returns 0 (false).
*/
KVSO_BEGIN_REGISTERCLASS(KvsObject_lcd,"lcdnumber","widget")
diff --git a/src/modules/objects/KvsObject_listWidget.cpp b/src/modules/objects/KvsObject_listWidget.cpp
index db5896e43..972f563a2 100644
--- a/src/modules/objects/KvsObject_listWidget.cpp
+++ b/src/modules/objects/KvsObject_listWidget.cpp
@@ -309,12 +309,12 @@ KVSO_CLASS_FUNCTION(listWidget,setFont)
for(int i=0;i<szListStyle.length();i++)
{
szStyle=szListStyle.at(i);
- if(KviQString::equalCI(szStyle,"italic")) font.setItalic(TRUE);
- else if(KviQString::equalCI(szStyle,"bold")) font.setBold(TRUE);
- else if(KviQString::equalCI(szStyle,"underline"))font.setUnderline(TRUE);
- else if(KviQString::equalCI(szStyle,"overline")) font.setOverline(TRUE);
- else if(KviQString::equalCI(szStyle,"strikeout"))font.setStrikeOut(TRUE);
- else if(KviQString::equalCI(szStyle,"fixedpitch")) font.setFixedPitch(TRUE);
+ if(KviQString::equalCI(szStyle,"italic")) font.setItalic(true);
+ else if(KviQString::equalCI(szStyle,"bold")) font.setBold(true);
+ else if(KviQString::equalCI(szStyle,"underline"))font.setUnderline(true);
+ else if(KviQString::equalCI(szStyle,"overline")) font.setOverline(true);
+ else if(KviQString::equalCI(szStyle,"strikeout"))font.setStrikeOut(true);
+ else if(KviQString::equalCI(szStyle,"fixedpitch")) font.setFixedPitch(true);
else c->warning(__tr2qs_ctx("Unknown style '%Q'","objects"),&szStyle);
}
pItem->setFont(font);
diff --git a/src/modules/objects/KvsObject_mainWindow.cpp b/src/modules/objects/KvsObject_mainWindow.cpp
index 2c4a557ec..8f9d62a45 100644
--- a/src/modules/objects/KvsObject_mainWindow.cpp
+++ b/src/modules/objects/KvsObject_mainWindow.cpp
@@ -93,7 +93,7 @@ KVSO_CLASS_FUNCTION(mainWindow,setCentralWidget)
if(!pObject->inheritsClass("widget"))
{
c->warning(__tr2qs_ctx("Widget object required","objects"));
- return TRUE;
+ return true;
}
((KviTalMainWindow *)widget())->setCentralWidget(((QWidget *)(pObject->object())));
return true;
diff --git a/src/modules/objects/KvsObject_multiLineEdit.cpp b/src/modules/objects/KvsObject_multiLineEdit.cpp
index 61837ab23..48dedf4fc 100644
--- a/src/modules/objects/KvsObject_multiLineEdit.cpp
+++ b/src/modules/objects/KvsObject_multiLineEdit.cpp
@@ -64,9 +64,9 @@
Sets the editor to be read-only if bReadOnly is 1 or
removes the read-only status is ReadOnly is 0
!fn: <boolean> $atBeginning()
- Returns 1(TRUE) if the cursor is placed at the beginning of the text; otherwise returns 0(FALSE).
+ Returns 1(true) if the cursor is placed at the beginning of the text; otherwise returns 0(false).
!fn: <boolean> $atEnd()
- Returns 1(TRUE) if the cursor is placed at the end of the text; otherwise returns 0(FALSE).
+ Returns 1(true) if the cursor is placed at the end of the text; otherwise returns 0(false).
!fn: $setWordWrap(<wrap_mode:string>)
Sets the word wrap mode to mode. Valid Values are:[br]
- NoWrap - Do not wrap the text.[br]
@@ -102,11 +102,11 @@
!fn: $setUnderline(<bUnderline:boolean>)
If the bool value is 1 sets the current format to underline; otherwise, if it's 0 sets the current format to no-underline.
!fn: <boolean> $italic()
- Returns 1(TRUE) if the current format is italic; otherwise returns 0(FALSE).
+ Returns 1(true) if the current format is italic; otherwise returns 0(false).
!fn: <boolean> $bold()
- Returns 1(TRUE) if the current format is bold; otherwise returns 0(FALSE).
+ Returns 1(true) if the current format is bold; otherwise returns 0(false).
!fn: <boolean> $underline()
- Returns 1(TRUE) if the current format is underline; otherwise returns 0(FALSE).
+ Returns 1(true) if the current format is underline; otherwise returns 0(false).
!fn: $zoomIn(<zoom_range:integer>)
Zooms in on the text by making the base font size range points larger.
!fn: $zoomOut(<zoom_range:integer>)
@@ -120,7 +120,7 @@
!fn: $setUndoRedoEnabled(<bUndoRedo:boolean>)
Sets whether undo/redo is enabled to the bool value.
!fn: <boolean> $isUndoRedoEnabled()
- Returns 1 (TRUE) if undo/redo is enabled; otherwise returns 0 (FALSE).
+ Returns 1 (true) if undo/redo is enabled; otherwise returns 0 (false).
!fn: <integer> $undoDepth()
Returns the depth of the undo history.
!fn: $setText(<txt:string>)
@@ -144,16 +144,16 @@
!fn: $loadFile(<path:string>)
Load the file specified in the <path>, also html files.
!fn: <boolean> $isUndoAvailable ()
- Returns 1(TRUE) if undo is available; otherwise returns 0(FALSE).
+ Returns 1(true) if undo is available; otherwise returns 0(false).
!fn: <boolean> $isRedoAvailable ()
- Returns 1(TRUE) if redo is available; otherwise returns 0(FALSE).
+ Returns 1(true) if redo is available; otherwise returns 0(false).
!fn: <integer> $lines()
Returns the number of lines in the multilineedit.
!fn: <integer> $lineOfChar(<paragraph:integer>,<index:integer>)
Returns the line number of the line in paragraph par in which the character at position index appears.[br]
If there is no such paragraph or no such character at the index position -1 is returned.
!fn: $setModified(<bModified:boolean>)
- Sets whether the document has been modified by the user. Valid Values are 1(TRUE) or 0(FALSE)
+ Sets whether the document has been modified by the user. Valid Values are 1(true) or 0(false)
!fn: $setAlignment(<alignment:string>)
Sets the alignment of the current paragraph to <alignment>. Valid values are:[br]
- Auto - Aligns according to the language.[b
diff --git a/src/modules/objects/KvsObject_painter.cpp b/src/modules/objects/KvsObject_painter.cpp
index 968e9434c..72124d318 100644
--- a/src/modules/objects/KvsObject_painter.cpp
+++ b/src/modules/objects/KvsObject_painter.cpp
@@ -772,12 +772,12 @@ KVSO_CLASS_FUNCTION(painter,setFont)
for(int i=0;i<szListStyle.length();i++)
{
szStyle=szListStyle.at(i);
- if(KviQString::equalCI(szStyle,"italic")) font.setItalic(TRUE);
- else if(KviQString::equalCI(szStyle,"bold")) font.setBold(TRUE);
- else if(KviQString::equalCI(szStyle,"underline"))font.setUnderline(TRUE);
- else if(KviQString::equalCI(szStyle,"overline")) font.setOverline(TRUE);
- else if(KviQString::equalCI(szStyle,"strikeout"))font.setStrikeOut(TRUE);
- else if(KviQString::equalCI(szStyle,"fixedpitch")) font.setFixedPitch(TRUE);
+ if(KviQString::equalCI(szStyle,"italic")) font.setItalic(true);
+ else if(KviQString::equalCI(szStyle,"bold")) font.setBold(true);
+ else if(KviQString::equalCI(szStyle,"underline"))font.setUnderline(true);
+ else if(KviQString::equalCI(szStyle,"overline")) font.setOverline(true);
+ else if(KviQString::equalCI(szStyle,"strikeout"))font.setStrikeOut(true);
+ else if(KviQString::equalCI(szStyle,"fixedpitch")) font.setFixedPitch(true);
else c->warning(__tr2qs_ctx("Unknown style '%Q'","objects"),&szStyle);
}
m_pPainter->setFont(font);
diff --git a/src/modules/objects/KvsObject_process.cpp b/src/modules/objects/KvsObject_process.cpp
index 369d197bb..4fd235ee7 100644
--- a/src/modules/objects/KvsObject_process.cpp
+++ b/src/modules/objects/KvsObject_process.cpp
@@ -143,7 +143,7 @@
!fn: <boolean> $isRunning()
Return 1 if the process is running, else return 0.
!fn: <boolean> $normalExit()
- Returns TRUE if the process has exited normally; otherwise returns FALSE.
+ Returns true if the process has exited normally; otherwise returns false.
!fn: $readyReadStdoutEvent()
This function is invoched by the process when there are new datas.[br]
The default implementation emits the [classfnc]$readyReadStdout[/classfnc]() signal.
diff --git a/src/modules/objects/KvsObject_radioButton.cpp b/src/modules/objects/KvsObject_radioButton.cpp
index 2a847866c..7d614fa96 100644
--- a/src/modules/objects/KvsObject_radioButton.cpp
+++ b/src/modules/objects/KvsObject_radioButton.cpp
@@ -48,7 +48,7 @@
!fn: $settext(<text:string>)
Sets the text that will appear in the radiobutton.
!fn: <boolean> $isChecked()
- Returns 1 (TRUE) if the radio button is checked; otherwise returns 0 (FALSE).
+ Returns 1 (true) if the radio button is checked; otherwise returns 0 (false).
!fn: $setChecked(<bChecked:boolean>)
Sets whether the radio button is checked to check.
!fn: $setPixmap(<image_id>)
diff --git a/src/modules/objects/KvsObject_tableWidget.cpp b/src/modules/objects/KvsObject_tableWidget.cpp
index 8b127e936..ddb7a6771 100644
--- a/src/modules/objects/KvsObject_tableWidget.cpp
+++ b/src/modules/objects/KvsObject_tableWidget.cpp
@@ -230,7 +230,7 @@ KVSO_BEGIN_REGISTERCLASS(KvsObject_tableWidget,"tablewidget","widget")
KVSO_REGISTER_HANDLER(KvsObject_tableWidget,"itemEnteredEvent",itemEnteredEvent);
KVSO_REGISTER_HANDLER(KvsObject_tableWidget,"cellActivatedEvent",cellActivatedEvent);
KVSO_REGISTER_HANDLER(KvsObject_tableWidget,"cellDoubleClickedEvent",cellDoubleClickedEvent);
- KVSO_REGISTER_STANDARD_TRUERETURN_HANDLER(KvsObject_tableWidget,"paintCellEvent")
+ KVSO_REGISTER_STANDARD_trueRETURN_HANDLER(KvsObject_tableWidget,"paintCellEvent")
KVSO_REGISTER_STANDARD_NOTHINGRETURN_HANDLER(KvsObject_tableWidget,"sizeHintCellRequestEvent")
diff --git a/src/modules/objects/KvsObject_toolButton.cpp b/src/modules/objects/KvsObject_toolButton.cpp
index c2da8b6a6..eba314778 100644
--- a/src/modules/objects/KvsObject_toolButton.cpp
+++ b/src/modules/objects/KvsObject_toolButton.cpp
@@ -58,7 +58,7 @@
!fn:$usesTextLabel()
Return 1 if the setUsesTextLabel is enabled, otherwise return 0.
!fn:$setTextLabel(<text:String>,[tooltip:string])
- Sets the label of this button to <text> and automatically sets it as a tool tip if <tip> is TRUE.
+ Sets the label of this button to <text> and automatically sets it as a tool tip if <tip> is true.
!fn:<string> $textLabel()
Returns the label of tthe button.
!fn:$setAutoRaise(<bAutoraise:boolean>)
diff --git a/src/modules/objects/KvsObject_treeWidgeteItem.cpp b/src/modules/objects/KvsObject_treeWidgeteItem.cpp
index 0220c8810..7da3a2920 100644
--- a/src/modules/objects/KvsObject_treeWidgeteItem.cpp
+++ b/src/modules/objects/KvsObject_treeWidgeteItem.cpp
@@ -90,7 +90,7 @@ const char * const itemflags_tbl[] = {
Pixmap can be a Kvirc imageid, an image file or a [class]pixmap[/class] object.
!fn: $setItemEditable(<bEnabled:boolean>)
- If bEnabled is TRUE (1), this item can be in-place editable by the user; otherwise it cannot be editable in-place.
+ If bEnabled is true (1), this item can be in-place editable by the user; otherwise it cannot be editable in-place.
!fn: $isItemEditable()
Returns $true if this item is editable and $false otherwise.
diff --git a/src/modules/objects/KvsObject_widget.cpp b/src/modules/objects/KvsObject_widget.cpp
index 0052ae0a2..5a07150d1 100644
--- a/src/modules/objects/KvsObject_widget.cpp
+++ b/src/modules/objects/KvsObject_widget.cpp
@@ -1752,12 +1752,12 @@ KVSO_CLASS_FUNCTION(widget,setFont)
for(int i=0;i<szListStyle.length();i++)
{
szStyle=szListStyle.at(i);
- if(KviQString::equalCI(szStyle,"italic")) font.setItalic(TRUE);
- else if(KviQString::equalCI(szStyle,"bold")) font.setBold(TRUE);
- else if(KviQString::equalCI(szStyle,"underline"))font.setUnderline(TRUE);
- else if(KviQString::equalCI(szStyle,"overline")) font.setOverline(TRUE);
- else if(KviQString::equalCI(szStyle,"strikeout"))font.setStrikeOut(TRUE);
- else if(KviQString::equalCI(szStyle,"fixedpitch")) font.setFixedPitch(TRUE);
+ if(KviQString::equalCI(szStyle,"italic")) font.setItalic(true);
+ else if(KviQString::equalCI(szStyle,"bold")) font.setBold(true);
+ else if(KviQString::equalCI(szStyle,"underline"))font.setUnderline(true);
+ else if(KviQString::equalCI(szStyle,"overline")) font.setOverline(true);
+ else if(KviQString::equalCI(szStyle,"strikeout"))font.setStrikeOut(true);
+ else if(KviQString::equalCI(szStyle,"fixedpitch")) font.setFixedPitch(true);
else c->warning(__tr2qs_ctx("Unknown style '%Q'","objects"),&szStyle);
}
widget()->setFont(font);
diff --git a/src/modules/objects/KvsObject_workspace.cpp b/src/modules/objects/KvsObject_workspace.cpp
index 377dce6c9..f46559936 100644
--- a/src/modules/objects/KvsObject_workspace.cpp
+++ b/src/modules/objects/KvsObject_workspace.cpp
@@ -58,7 +58,7 @@
!fn: <object> $activeWindow()
Returns the active window, or 0 if no window is active.
!fn: <boolean> $scrollBarsEnabled()
- Returns TRUE if the workspace provides scrollbars; otherwise returns FALSE.
+ Returns true if the workspace provides scrollbars; otherwise returns false.
!fn: $setscrollBarsEnabled(<bEnabled:boolean>)
Sets whether the workspace provides scrollbars to enable. (bEnabled 1 or 0)
!fn: $cascade()
diff --git a/src/modules/objects/KvsObject_xmlreader.cpp b/src/modules/objects/KvsObject_xmlreader.cpp
index 0038f1c01..a52b3abdf 100644
--- a/src/modules/objects/KvsObject_xmlreader.cpp
+++ b/src/modules/objects/KvsObject_xmlreader.cpp
@@ -278,13 +278,13 @@ KVSO_BEGIN_REGISTERCLASS(KvsObject_xmlReader,"xmlreader","object")
KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_xmlReader,lastError)
KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_xmlReader,parse)
- KVSO_REGISTER_STANDARD_TRUERETURN_HANDLER(KvsObject_xmlReader,"onDocumentStart")
- KVSO_REGISTER_STANDARD_TRUERETURN_HANDLER(KvsObject_xmlReader,"onDocumentEnd")
- KVSO_REGISTER_STANDARD_TRUERETURN_HANDLER(KvsObject_xmlReader,"onElementStart")
- KVSO_REGISTER_STANDARD_TRUERETURN_HANDLER(KvsObject_xmlReader,"onElementEnd")
- KVSO_REGISTER_STANDARD_TRUERETURN_HANDLER(KvsObject_xmlReader,"onText")
- KVSO_REGISTER_STANDARD_TRUERETURN_HANDLER(KvsObject_xmlReader,"onWarning")
- KVSO_REGISTER_STANDARD_TRUERETURN_HANDLER(KvsObject_xmlReader,"onError")
+ KVSO_REGISTER_STANDARD_trueRETURN_HANDLER(KvsObject_xmlReader,"onDocumentStart")
+ KVSO_REGISTER_STANDARD_trueRETURN_HANDLER(KvsObject_xmlReader,"onDocumentEnd")
+ KVSO_REGISTER_STANDARD_trueRETURN_HANDLER(KvsObject_xmlReader,"onElementStart")
+ KVSO_REGISTER_STANDARD_trueRETURN_HANDLER(KvsObject_xmlReader,"onElementEnd")
+ KVSO_REGISTER_STANDARD_trueRETURN_HANDLER(KvsObject_xmlReader,"onText")
+ KVSO_REGISTER_STANDARD_trueRETURN_HANDLER(KvsObject_xmlReader,"onWarning")
+ KVSO_REGISTER_STANDARD_trueRETURN_HANDLER(KvsObject_xmlReader,"onError")
KVSO_END_REGISTERCLASS(KvsObject_xmlReader)
KVSO_BEGIN_CONSTRUCTOR(KvsObject_xmlReader,KviKvsObject)
diff --git a/src/modules/objects/object_macros.h b/src/modules/objects/object_macros.h
index b12ed3f3a..fe78b23e2 100644
--- a/src/modules/objects/object_macros.h
+++ b/src/modules/objects/object_macros.h
@@ -51,10 +51,10 @@ g_pKvs##__className##Class->registerFunctionHandler(#__szName,(KviKvsObjectFunct
#define KVSO_REGISTER_STANDARD_NOTHINGRETURN_HANDLER(__className,__szName) \
g_pKvs##__className##Class->registerStandardNothingReturnFunctionHandler(__szName);
-#define KVSO_REGISTER_STANDARD_TRUERETURN_HANDLER(__className,__szName) \
+#define KVSO_REGISTER_STANDARD_trueRETURN_HANDLER(__className,__szName) \
g_pKvs##__className##Class->registerStandardTrueReturnFunctionHandler(__szName);
-#define KVSO_REGISTER_STANDARD_FALSERETURN_HANDLER(__className,__szName) \
+#define KVSO_REGISTER_STANDARD_falseRETURN_HANDLER(__className,__szName) \
g_pKvs##__className##Class->registerStandardFalseReturnFunctionHandler(__szName);
#define KVSO_BEGIN_REGISTERCLASS(__className,__stringName,__baseClass) \
diff --git a/src/modules/options/libkvioptions.cpp b/src/modules/options/libkvioptions.cpp
index 61bd7f630..8205591f8 100644
--- a/src/modules/options/libkvioptions.cpp
+++ b/src/modules/options/libkvioptions.cpp
@@ -225,7 +225,7 @@ static bool options_kvs_cmd_edit(KviKvsModuleCommandCall * c)
// a trick for the dialog covering the splash screen before the time (this is prolly a WM or Qt bug)
if(g_pSplashScreen)
{
- if(g_pSplashScreen->isVisible()) // another bug: this ALWAYS RETURNS TRUE, even if the splash was hidden by a mouse click...
+ if(g_pSplashScreen->isVisible()) // another bug: this ALWAYS RETURNS true, even if the splash was hidden by a mouse click...
{
QObject::connect(g_pSplashScreen,SIGNAL(destroyed()),wc,SLOT(show()));
return true;
diff --git a/src/modules/perlcore/ppport.h b/src/modules/perlcore/ppport.h
index e0f8de2bf..df6e9806f 100644
--- a/src/modules/perlcore/ppport.h
+++ b/src/modules/perlcore/ppport.h
@@ -192,7 +192,7 @@ __DATA__
#endif /* PERL_REVISION != 5 */
#ifndef ERRSV
-# define ERRSV perl_get_sv("@",FALSE)
+# define ERRSV perl_get_sv("@",false)
#endif
#if (PERL_VERSION < 4) || ((PERL_VERSION == 4) && (PERL_SUBVERSION <= 5))
@@ -376,7 +376,7 @@ SV *sv;
start_subparse(0),
# else
/* 5.003_23 onwards */
- start_subparse(FALSE, 0),
+ start_subparse(false, 0),
# endif
#endif
@@ -426,11 +426,11 @@ SV *sv;
#if (PERL_VERSION < 4 || (PERL_VERSION == 4 && PERL_SUBVERSION < 68 ))
/* Fetches the SV that keeps the per-interpreter data. */
#define dMY_CXT_SV \
- SV *my_cxt_sv = perl_get_sv(MY_CXT_KEY, FALSE)
+ SV *my_cxt_sv = perl_get_sv(MY_CXT_KEY, false)
#else /* >= perl5.004_68 */
#define dMY_CXT_SV \
SV *my_cxt_sv = *hv_fetch(PL_modglobal, MY_CXT_KEY, \
- sizeof(MY_CXT_KEY)-1, TRUE)
+ sizeof(MY_CXT_KEY)-1, true)
#endif /* < perl5.004_68 */
/* This declaration should be used within all functions that use the
diff --git a/src/modules/reguser/RegisteredUsersDialog.cpp b/src/modules/reguser/RegisteredUsersDialog.cpp
index 3cb51126e..f8f072bd8 100644
--- a/src/modules/reguser/RegisteredUsersDialog.cpp
+++ b/src/modules/reguser/RegisteredUsersDialog.cpp
@@ -89,7 +89,7 @@ KviRegisteredUsersListView::KviRegisteredUsersListView(QWidget * par)
setSelectionBehavior(QAbstractItemView::SelectRows);
setSelectionMode(QAbstractItemView::ExtendedSelection);
- setRootIsDecorated(TRUE);
+ setRootIsDecorated(true);
setSortingEnabled(true);
setToolTip(__tr2qs_ctx("<center>This is the list of registered users. " \
@@ -513,7 +513,7 @@ void RegisteredUsersDialog::fillList()
{
RegisteredUsersGroupItem* pCur = new RegisteredUsersGroupItem(m_pListView,g);
groupItems.insert(g->name(),pCur);
- pCur->setExpanded(TRUE);
+ pCur->setExpanded(true);
}
KviPointerHashTable<QString,KviRegisteredUser> * d = g_pLocalRegisteredUserDataBase->userDict();
diff --git a/src/modules/reguser/RegistrationWizard.cpp b/src/modules/reguser/RegistrationWizard.cpp
index dc092dff2..9588ed05c 100644
--- a/src/modules/reguser/RegistrationWizard.cpp
+++ b/src/modules/reguser/RegistrationWizard.cpp
@@ -77,7 +77,7 @@ RegistrationWizard::RegistrationWizard(const QString &startMask,KviRegisteredUse
setWindowTitle(__tr2qs_ctx("User Registration Wizard - KVIrc","register"));
setWindowIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Linux)));
- setSizeGripEnabled( TRUE );
+ setSizeGripEnabled( true );
m_pPage1 = new QWidget(this);
m_pPage1Layout = new QGridLayout(m_pPage1);
diff --git a/src/modules/setup/SetupWizard.cpp b/src/modules/setup/SetupWizard.cpp
index e9017a24a..9aa3447d1 100644
--- a/src/modules/setup/SetupWizard.cpp
+++ b/src/modules/setup/SetupWizard.cpp
@@ -299,7 +299,7 @@ SetupWizard::SetupWizard()
#endif
// Pragma: Unused, takes only space.
//m_pDirRestore = new QRadioButton(__tr2qs("Restore from backup archive"),m_pDirButtonGroup);
- //m_pDirRestore->setEnabled(FALSE);
+ //m_pDirRestore->setEnabled(false);
//l = new QLabel(m_pDirectory->m_pVBox,"<b> </b>");
@@ -526,7 +526,7 @@ SetupWizard::SetupWizard()
{
KviConfigurationFile cfg(szTmp,KviConfigurationFile::Read);
cfg.setGroup("Setup");
- if(cfg.readBoolEntry("hideServerList",FALSE))
+ if(cfg.readBoolEntry("hideServerList",false))
{
//setPageEnabled(m_pServers,false);
//setFinishEnabled(m_pIdentity,true);
@@ -1075,12 +1075,12 @@ void SetupWizard::accept()
if(m_pServersSpecifyManually->isOn())
{
- KVI_OPTION_BOOL(KviOption_boolShowServersConnectDialogOnStart) = FALSE;
+ KVI_OPTION_BOOL(KviOption_boolShowServersConnectDialogOnStart) = false;
szHost = m_szServerHost;
uPort=m_uServerPort;
} else if(m_pServersOpenIrcUrl->isOn())
{
- KVI_OPTION_BOOL(KviOption_boolShowServersConnectDialogOnStart) = FALSE;
+ KVI_OPTION_BOOL(KviOption_boolShowServersConnectDialogOnStart) = false;
szUrl=m_szServerUrl;
}
*/
diff --git a/src/modules/setup/libkvisetup.cpp b/src/modules/setup/libkvisetup.cpp
index bc8e7b1fb..7bbfbdd75 100644
--- a/src/modules/setup/libkvisetup.cpp
+++ b/src/modules/setup/libkvisetup.cpp
@@ -112,14 +112,14 @@ KVIMODULEEXPORTFUNC void setup_finish()
pParams->append(szUrl);
KviKvsScript::run("openurl $0",g_pActiveWindow,pParams);
delete pParams;
- KVI_OPTION_BOOL(KviOption_boolShowServersConnectDialogOnStart) = TRUE;
+ KVI_OPTION_BOOL(KviOption_boolShowServersConnectDialogOnStart) = true;
} else if(!szHost.isEmpty()) {
KviKvsVariantList * pParams = new KviKvsVariantList();
pParams->append(szHost);
pParams->append((kvs_int_t)uPort);
KviKvsScript::run("server $0 $1",g_pActiveWindow,pParams);
delete pParams;
- KVI_OPTION_BOOL(KviOption_boolShowServersConnectDialogOnStart) = TRUE;
+ KVI_OPTION_BOOL(KviOption_boolShowServersConnectDialogOnStart) = true;
}
}
}
diff --git a/src/modules/snd/libkvisnd.cpp b/src/modules/snd/libkvisnd.cpp
index 8df5d325e..0fad1f912 100644
--- a/src/modules/snd/libkvisnd.cpp
+++ b/src/modules/snd/libkvisnd.cpp
@@ -754,7 +754,7 @@ static bool snd_kvs_cmd_mute(KviKvsModuleCommandCall * c)
{
KVSM_PARAMETERS_BEGIN(c)
KVSM_PARAMETERS_END(c)
- g_pSoundPlayer->setMuted(TRUE);
+ g_pSoundPlayer->setMuted(true);
return true;
}
@@ -776,7 +776,7 @@ static bool snd_kvs_cmd_unmute(KviKvsModuleCommandCall * c)
{
KVSM_PARAMETERS_BEGIN(c)
KVSM_PARAMETERS_END(c)
- g_pSoundPlayer->setMuted(FALSE);
+ g_pSoundPlayer->setMuted(false);
return true;
}
diff --git a/src/modules/system/libkvisystem.cpp b/src/modules/system/libkvisystem.cpp
index b11755554..a4869dca0 100644
--- a/src/modules/system/libkvisystem.cpp
+++ b/src/modules/system/libkvisystem.cpp
@@ -34,6 +34,7 @@
#include "KviEnvironment.h"
#include "KviOsInfo.h"
#include "KviModuleManager.h"
+#include "KviByteOrder.h"
#include <QClipboard>
#include <QByteArray>
@@ -804,6 +805,117 @@ static bool system_kvs_cmd_runcmd(KviKvsModuleCommandCall *c)
return c->error(__tr2qs("Failed to start the terminal program"));
}
+/*
+ @doc: system.ntohi
+ @type:
+ function
+ @title:
+ $system.ntohi
+ @short:
+ Convert an integer from network to host byte order.
+ @syntax:
+ <integer> $system.ntohi(<value:integer>)
+ <integer> $system.ntohi(<value:integer>,<bytecount:integer>)
+ @description:
+ Converts the integer value in network byte order
+ to it's host byte order counterpart.
+ Since the conversion is carried at binary rappresentation
+ level you must specify the number of bytes you want
+ the binary rappresentation to have. Valid values are
+ 1 (no conversion), 2 (short), 4 (32 bit int) and 8 (64 bit int).
+ If omitted, bytecount is assumed to be 4.
+*/
+static bool system_kvs_fnc_ntohi(KviKvsModuleFunctionCall * c)
+{
+ kvs_int_t iValue;
+ kvs_uint_t uBytes;
+
+ KVSM_PARAMETERS_BEGIN(c)
+ KVSM_PARAMETER("value",KVS_PT_INT,0,iValue)
+ KVSM_PARAMETER("bytecount",KVS_PT_UINT,KVS_PF_OPTIONAL,uBytes)
+ KVSM_PARAMETERS_END(c)
+
+ switch(uBytes)
+ {
+ case 0:
+ c->returnValue()->setInteger((kvs_int_t)KviByteOrder::networkByteOrderToLocalCpu32((kvi_u32_t)iValue));
+ break;
+ case 1:
+ c->returnValue()->setInteger((kvs_int_t)((kvi_u8_t)iValue));
+ break;
+ case 2:
+ c->returnValue()->setInteger((kvs_int_t)KviByteOrder::networkByteOrderToLocalCpu16((kvi_u16_t)iValue));
+ break;
+ case 4:
+ c->returnValue()->setInteger((kvs_int_t)KviByteOrder::networkByteOrderToLocalCpu32((kvi_u32_t)iValue));
+ break;
+ case 8:
+ c->returnValue()->setInteger((kvs_int_t)KviByteOrder::networkByteOrderToLocalCpu64((kvi_u64_t)iValue));
+ break;
+ default:
+ return c->error(__tr2qs("Bad bytecount specification: 1, 2, 4 and 8 are allowed"));
+ break;
+ }
+
+ return true;
+}
+
+
+/*
+ @doc: system.htoni
+ @type:
+ function
+ @title:
+ $system.htoni
+ @short:
+ Convert an integer from host to network byte order.
+ @syntax:
+ <integer> $system.htoni(<value:integer>)
+ <integer> $system.htoni(<value:integer>,<bytecount:integer>)
+ @description:
+ Converts the integer value in host byte order
+ to it's network byte order counterpart.
+ Since the conversion is carried at binary rappresentation
+ level you must specify the number of bytes you want
+ the binary rappresentation to have. Valid values are
+ 1 (no conversion), 2 (short), 4 (32 bit int) and 8 (64 bit int).
+ If omitted, bytecount is assumed to be 4.
+*/
+static bool system_kvs_fnc_htoni(KviKvsModuleFunctionCall * c)
+{
+ kvs_int_t iValue;
+ kvs_uint_t uBytes;
+
+ KVSM_PARAMETERS_BEGIN(c)
+ KVSM_PARAMETER("value",KVS_PT_INT,0,iValue)
+ KVSM_PARAMETER("bytecount",KVS_PT_UINT,KVS_PF_OPTIONAL,uBytes)
+ KVSM_PARAMETERS_END(c)
+
+ switch(uBytes)
+ {
+ case 0:
+ c->returnValue()->setInteger((kvs_int_t)KviByteOrder::localCpuToNetworkByteOrder32((kvi_u32_t)iValue));
+ break;
+ case 1:
+ c->returnValue()->setInteger((kvs_int_t)((kvi_u8_t)iValue));
+ break;
+ case 2:
+ c->returnValue()->setInteger((kvs_int_t)KviByteOrder::localCpuToNetworkByteOrder16((kvi_u16_t)iValue));
+ break;
+ case 4:
+ c->returnValue()->setInteger((kvs_int_t)KviByteOrder::localCpuToNetworkByteOrder32((kvi_u32_t)iValue));
+ break;
+ case 8:
+ c->returnValue()->setInteger((kvs_int_t)KviByteOrder::localCpuToNetworkByteOrder64((kvi_u64_t)iValue));
+ break;
+ default:
+ return c->error(__tr2qs("Bad bytecount specification: 1, 2, 4 and 8 are allowed"));
+ break;
+ }
+
+ return true;
+}
+
static bool system_module_init(KviModule * m)
{
KVSM_REGISTER_FUNCTION(m,"ostype",system_kvs_fnc_ostype);
@@ -815,6 +927,8 @@ static bool system_module_init(KviModule * m)
KVSM_REGISTER_FUNCTION(m,"getenv",system_kvs_fnc_getenv);
KVSM_REGISTER_FUNCTION(m,"hostname",system_kvs_fnc_hostname);
KVSM_REGISTER_FUNCTION(m,"dbus",system_kvs_fnc_dbus);
+ KVSM_REGISTER_FUNCTION(m,"htoni",system_kvs_fnc_htoni);
+ KVSM_REGISTER_FUNCTION(m,"ntohi",system_kvs_fnc_ntohi);
KVSM_REGISTER_FUNCTION(m,"clipboard",system_kvs_fnc_clipboard);
KVSM_REGISTER_FUNCTION(m,"selection",system_kvs_fnc_selection);
KVSM_REGISTER_FUNCTION(m,"checkModule",system_kvs_fnc_checkModule);
diff --git a/src/modules/torrent/KTorrentDbusInterface.cpp b/src/modules/torrent/KTorrentDbusInterface.cpp
index d28b1f95b..ae9d46553 100644
--- a/src/modules/torrent/KTorrentDbusInterface.cpp
+++ b/src/modules/torrent/KTorrentDbusInterface.cpp
@@ -49,7 +49,7 @@
// QTimer *timer = new QTimer(this);
// connect(timer, SIGNAL(timeout()), this, SLOT(slotTimer()));
-// timer->start(250, FALSE);
+// timer->start(250, false);
// make sure we have a list of files,
// otherwise functions dealing would
@@ -96,9 +96,9 @@
if (reply.type() == QDBusMessage::ErrorMessage) { \
QDBusError err = reply; \
qDebug("Error: %s\n%s\n", qPrintable(err.name()), qPrintable(err.message())); \
- return FALSE; \
+ return false; \
} \
- return TRUE;
+ return true;
bool KTorrentDbusInterface::startAll()
{