1 /****************************************************************************
2 ** ui.h extension file, included from the uic-generated form implementation.
4 ** If you wish to add, delete or rename slots use Qt Designer which will
5 ** update this file, preserving your code. Create an init() slot in place of
6 ** a constructor, and a destroy() slot in place of a destructor.
7 *****************************************************************************/
9 /******************************************************************************
11 * This file is part of KSambaPlugin. *
13 * KSambaPlugin is free software; you can redistribute it and/or modify *
14 * it under the terms of the GNU General Public License as published by *
15 * the Free Software Foundation; either version 2 of the License, or *
16 * (at your option) any later version. *
18 * KSambaPlugin is distributed in the hope that it will be useful, *
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
21 * GNU General Public License for more details. *
23 * You should have received a copy of the GNU General Public License *
24 * along with KSambaPlugin; if not, write to the Free Software *
25 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
27 ******************************************************************************/
29 #ifndef KCM_SAMBACONF_SOCKETOPTIONSDLG_UI_H
30 #define KCM_SAMBACONF_SOCKETOPTIONSDLG_UI_H
32 void SocketOptionsDlg::setShare( SambaShare
* share
)
38 QString s
= _share
->getValue("socket options");
42 // The string s has now the form e.g. :
43 // "OPTION1=1 OPTION2=0 OPTION3=2234 OPTION4"
45 SO_KEEPALIVEChk
->setChecked(getBoolValue( s
, "SO_KEEPALIVE") );
46 SO_REUSEADDRChk
->setChecked( getBoolValue( s
, "SO_REUSEADDR") );
47 SO_BROADCASTChk
->setChecked( getBoolValue( s
, "SO_BROADCAST") );
48 TCP_NODELAYChk
->setChecked( getBoolValue( s
, "TCP_NODELAY") );
49 IPTOS_LOWDELAYChk
->setChecked( getBoolValue( s
, "IPTOS_LOWDELAY") );
50 IPTOS_THROUGHPUTChk
->setChecked( getBoolValue( s
, "IPTOS_THROUGHPUT") );
51 SO_SNDBUFChk
->setChecked( getBoolValue( s
, "SO_SNDBUF") );
52 SO_RCVBUFChk
->setChecked( getBoolValue( s
, "SO_RCVBUF") );
53 SO_SNDLOWATChk
->setChecked( getBoolValue( s
, "SO_SNDLOWAT") );
54 SO_RCVLOWATChk
->setChecked( getBoolValue( s
, "SO_RCVLOWAT") );
56 SO_SNDBUFSpin
->setValue( getIntValue( s
, "SO_SNDBUF") );
57 SO_RCVBUFSpin
->setValue( getIntValue( s
, "SO_RCVBUF") );
58 SO_SNDLOWATSpin
->setValue( getIntValue( s
, "SO_SNDLOWAT") );
59 SO_RCVLOWATSpin
->setValue( getIntValue( s
, "SO_RCVLOWAT") );
65 bool SocketOptionsDlg::getBoolValue( const QString
& str
, const QString
& name
)
68 int i
= s
.find(name
,0,false);
72 s
= s
.remove(0,i
+1+QString(name
).length());
73 if ( s
.startsWith("=") )
76 if ( s
.startsWith("0"))
88 int SocketOptionsDlg::getIntValue( const QString
& str
, const QString
& name
)
91 int i
= s
.find(name
,0,false);
95 s
= s
.remove(0,i
+1+QString(name
).length());
96 if ( s
.startsWith("=") )
117 #endif // KCM_SAMBACONF_SOCKETOPTIONSDLG_UI_H